netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] configure: Add search path for 64bit library.
@ 2012-08-07  4:22 Li Wei
  2012-08-07 18:15 ` Ben Hutchings
  0 siblings, 1 reply; 9+ messages in thread
From: Li Wei @ 2012-08-07  4:22 UTC (permalink / raw)
  To: shemminger; +Cc: netdev, Li Wei

Signed-off-by: Li Wei <lw@cn.fujitsu.com>
---
 configure |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 0f4444f..997759c 100755
--- a/configure
+++ b/configure
@@ -149,7 +149,7 @@ check_ipt()
 check_ipt_lib_dir()
 {
 	IPT_LIB_DIR=""
-	for dir in /lib /usr/lib /usr/local/lib
+	for dir in /lib /usr/lib /usr/local/lib /lib64 /usr/lib64 /usr/local/lib64
 	do
 		for file in $dir/{xtables,iptables}/lib*t_*so ; do
 			if [ -f $file ]; then
-- 
1.7.10.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] configure: Add search path for 64bit library.
  2012-08-07  4:22 [PATCH] configure: Add search path for 64bit library Li Wei
@ 2012-08-07 18:15 ` Ben Hutchings
  2012-08-13 15:26   ` Stephen Hemminger
  0 siblings, 1 reply; 9+ messages in thread
From: Ben Hutchings @ 2012-08-07 18:15 UTC (permalink / raw)
  To: Li Wei; +Cc: shemminger, netdev

The subject line doesn't say what this is for, but it looks like
iproute2...

On Tue, 2012-08-07 at 12:22 +0800, Li Wei wrote:
> Signed-off-by: Li Wei <lw@cn.fujitsu.com>
> ---
>  configure |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 0f4444f..997759c 100755
> --- a/configure
> +++ b/configure
> @@ -149,7 +149,7 @@ check_ipt()
>  check_ipt_lib_dir()
>  {
>  	IPT_LIB_DIR=""
> -	for dir in /lib /usr/lib /usr/local/lib
> +	for dir in /lib /usr/lib /usr/local/lib /lib64 /usr/lib64 /usr/local/lib64
>  	do
>  		for file in $dir/{xtables,iptables}/lib*t_*so ; do
>  			if [ -f $file ]; then

On a bi-arch system, surely the lib64 directories should be preferred to
the lib directories?  And this still leaves multi-arch to be handled.

I think this should be done with pkg-config:

    pkg-config --variable=xtlibdir xtables

possibly with that directory list as a fallback if it's useful to
support iptables library versions that didn't include xtables.pc.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] configure: Add search path for 64bit library.
  2012-08-07 18:15 ` Ben Hutchings
@ 2012-08-13 15:26   ` Stephen Hemminger
  2012-08-13 16:22     ` Ben Hutchings
  0 siblings, 1 reply; 9+ messages in thread
From: Stephen Hemminger @ 2012-08-13 15:26 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Li Wei, netdev

On Tue, 7 Aug 2012 19:15:58 +0100
Ben Hutchings <bhutchings@solarflare.com> wrote:

> The subject line doesn't say what this is for, but it looks like
> iproute2...
> 
> On Tue, 2012-08-07 at 12:22 +0800, Li Wei wrote:
> > Signed-off-by: Li Wei <lw@cn.fujitsu.com>
> > ---
> >  configure |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/configure b/configure
> > index 0f4444f..997759c 100755
> > --- a/configure
> > +++ b/configure
> > @@ -149,7 +149,7 @@ check_ipt()
> >  check_ipt_lib_dir()
> >  {
> >  	IPT_LIB_DIR=""
> > -	for dir in /lib /usr/lib /usr/local/lib
> > +	for dir in /lib /usr/lib /usr/local/lib /lib64 /usr/lib64 /usr/local/lib64
> >  	do
> >  		for file in $dir/{xtables,iptables}/lib*t_*so ; do
> >  			if [ -f $file ]; then
> 
> On a bi-arch system, surely the lib64 directories should be preferred to
> the lib directories?  And this still leaves multi-arch to be handled.
> 
> I think this should be done with pkg-config:
> 
>     pkg-config --variable=xtlibdir xtables
> 
> possibly with that directory list as a fallback if it's useful to
> support iptables library versions that didn't include xtables.pc.
> 
> Ben.
> 

Does every distro have pkg-config or does more logic need to be done here?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] configure: Add search path for 64bit library.
  2012-08-13 15:26   ` Stephen Hemminger
@ 2012-08-13 16:22     ` Ben Hutchings
  2012-08-13 16:33       ` Stephen Hemminger
  0 siblings, 1 reply; 9+ messages in thread
From: Ben Hutchings @ 2012-08-13 16:22 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Li Wei, netdev

On Mon, 2012-08-13 at 08:26 -0700, Stephen Hemminger wrote:
> On Tue, 7 Aug 2012 19:15:58 +0100
> Ben Hutchings <bhutchings@solarflare.com> wrote:
> 
> > The subject line doesn't say what this is for, but it looks like
> > iproute2...
> > 
> > On Tue, 2012-08-07 at 12:22 +0800, Li Wei wrote:
> > > Signed-off-by: Li Wei <lw@cn.fujitsu.com>
> > > ---
> > >  configure |    2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/configure b/configure
> > > index 0f4444f..997759c 100755
> > > --- a/configure
> > > +++ b/configure
> > > @@ -149,7 +149,7 @@ check_ipt()
> > >  check_ipt_lib_dir()
> > >  {
> > >  	IPT_LIB_DIR=""
> > > -	for dir in /lib /usr/lib /usr/local/lib
> > > +	for dir in /lib /usr/lib /usr/local/lib /lib64 /usr/lib64 /usr/local/lib64
> > >  	do
> > >  		for file in $dir/{xtables,iptables}/lib*t_*so ; do
> > >  			if [ -f $file ]; then
> > 
> > On a bi-arch system, surely the lib64 directories should be preferred to
> > the lib directories?  And this still leaves multi-arch to be handled.
> > 
> > I think this should be done with pkg-config:
> > 
> >     pkg-config --variable=xtlibdir xtables
> > 
> > possibly with that directory list as a fallback if it's useful to
> > support iptables library versions that didn't include xtables.pc.
> > 
> > Ben.
> > 
> 
> Does every distro have pkg-config or does more logic need to be done here?

Every distro has pkg-config; the question is whether you want to support
library versions that don't include a pkg-config file (xtables.pc), if
they exist.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] configure: Add search path for 64bit library.
  2012-08-13 16:22     ` Ben Hutchings
@ 2012-08-13 16:33       ` Stephen Hemminger
  2012-08-20  1:41         ` [PATCH v2] iproute2: " Li Wei
  2012-09-09 19:42         ` [PATCH] " Jan Engelhardt
  0 siblings, 2 replies; 9+ messages in thread
From: Stephen Hemminger @ 2012-08-13 16:33 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Li Wei, netdev

On Mon, 13 Aug 2012 17:22:40 +0100
Ben Hutchings <bhutchings@solarflare.com> wrote:

> On Mon, 2012-08-13 at 08:26 -0700, Stephen Hemminger wrote:
> > On Tue, 7 Aug 2012 19:15:58 +0100
> > Ben Hutchings <bhutchings@solarflare.com> wrote:
> > 
> > > The subject line doesn't say what this is for, but it looks like
> > > iproute2...
> > > 
> > > On Tue, 2012-08-07 at 12:22 +0800, Li Wei wrote:
> > > > Signed-off-by: Li Wei <lw@cn.fujitsu.com>
> > > > ---
> > > >  configure |    2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > 
> > > > diff --git a/configure b/configure
> > > > index 0f4444f..997759c 100755
> > > > --- a/configure
> > > > +++ b/configure
> > > > @@ -149,7 +149,7 @@ check_ipt()
> > > >  check_ipt_lib_dir()
> > > >  {
> > > >  	IPT_LIB_DIR=""
> > > > -	for dir in /lib /usr/lib /usr/local/lib
> > > > +	for dir in /lib /usr/lib /usr/local/lib /lib64 /usr/lib64 /usr/local/lib64
> > > >  	do
> > > >  		for file in $dir/{xtables,iptables}/lib*t_*so ; do
> > > >  			if [ -f $file ]; then
> > > 
> > > On a bi-arch system, surely the lib64 directories should be preferred to
> > > the lib directories?  And this still leaves multi-arch to be handled.
> > > 
> > > I think this should be done with pkg-config:
> > > 
> > >     pkg-config --variable=xtlibdir xtables
> > > 
> > > possibly with that directory list as a fallback if it's useful to
> > > support iptables library versions that didn't include xtables.pc.
> > > 
> > > Ben.
> > > 
> > 
> > Does every distro have pkg-config or does more logic need to be done here?
> 
> Every distro has pkg-config; the question is whether you want to support
> library versions that don't include a pkg-config file (xtables.pc), if
> they exist.

Let's do pkg-config first, and as a fallback keep the old code and only
look in the same old places.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2] iproute2: configure: Add search path for 64bit library.
  2012-08-13 16:33       ` Stephen Hemminger
@ 2012-08-20  1:41         ` Li Wei
  2012-08-20 15:30           ` Ben Hutchings
  2012-08-20 16:02           ` Stephen Hemminger
  2012-09-09 19:42         ` [PATCH] " Jan Engelhardt
  1 sibling, 2 replies; 9+ messages in thread
From: Li Wei @ 2012-08-20  1:41 UTC (permalink / raw)
  To: shemminger; +Cc: bhutchings, netdev, Li Wei

Use pkg-config to tell us the library path and fallback to search
old paths if xtables.pc not exists.

Signed-off-by: Li Wei <lw@cn.fujitsu.com>
---

Changes from v1:
- use pkg-config as Ben and Stephen suggested.

 configure |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index a1916de..db7cd6a 100755
--- a/configure
+++ b/configure
@@ -148,7 +148,13 @@ check_ipt()
 
 check_ipt_lib_dir()
 {
-	IPT_LIB_DIR=""
+	IPT_LIB_DIR=$(pkg-config --variable=xtlibdir xtables)
+	if [ -n "$IPT_LIB_DIR" ]; then
+		echo $IPT_LIB_DIR
+		echo "IPT_LIB_DIR:=$IPT_LIB_DIR" >> Config
+		return
+	fi
+
 	for dir in /lib /usr/lib /usr/local/lib
 	do
 		for file in $dir/{xtables,iptables}/lib*t_*so ; do
-- 
1.7.10.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] iproute2: configure: Add search path for 64bit library.
  2012-08-20  1:41         ` [PATCH v2] iproute2: " Li Wei
@ 2012-08-20 15:30           ` Ben Hutchings
  2012-08-20 16:02           ` Stephen Hemminger
  1 sibling, 0 replies; 9+ messages in thread
From: Ben Hutchings @ 2012-08-20 15:30 UTC (permalink / raw)
  To: Li Wei; +Cc: shemminger, netdev

On Mon, 2012-08-20 at 09:41 +0800, Li Wei wrote:
> Use pkg-config to tell us the library path and fallback to search
> old paths if xtables.pc not exists.
> 
> Signed-off-by: Li Wei <lw@cn.fujitsu.com>

Tested-by: Ben Hutchings <bhutchings@solarflare.com>

Works for me on Fedora 16.

You should probably change the subject line, as this doesn't change the
search path but mostly replaces it.

Ben.

> ---
> 
> Changes from v1:
> - use pkg-config as Ben and Stephen suggested.
> 
>  configure |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index a1916de..db7cd6a 100755
> --- a/configure
> +++ b/configure
> @@ -148,7 +148,13 @@ check_ipt()
>  
>  check_ipt_lib_dir()
>  {
> -	IPT_LIB_DIR=""
> +	IPT_LIB_DIR=$(pkg-config --variable=xtlibdir xtables)
> +	if [ -n "$IPT_LIB_DIR" ]; then
> +		echo $IPT_LIB_DIR
> +		echo "IPT_LIB_DIR:=$IPT_LIB_DIR" >> Config
> +		return
> +	fi
> +
>  	for dir in /lib /usr/lib /usr/local/lib
>  	do
>  		for file in $dir/{xtables,iptables}/lib*t_*so ; do

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2] iproute2: configure: Add search path for 64bit library.
  2012-08-20  1:41         ` [PATCH v2] iproute2: " Li Wei
  2012-08-20 15:30           ` Ben Hutchings
@ 2012-08-20 16:02           ` Stephen Hemminger
  1 sibling, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2012-08-20 16:02 UTC (permalink / raw)
  To: Li Wei; +Cc: bhutchings, netdev

On Mon, 20 Aug 2012 09:41:47 +0800
Li Wei <lw@cn.fujitsu.com> wrote:

> Use pkg-config to tell us the library path and fallback to search
> old paths if xtables.pc not exists.
> 
> Signed-off-by: Li Wei <lw@cn.fujitsu.com>
> ---
> 
> Changes from v1:
> - use pkg-config as Ben and Stephen suggested.
> 
>  configure |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index a1916de..db7cd6a 100755
> --- a/configure
> +++ b/configure
> @@ -148,7 +148,13 @@ check_ipt()
>  
>  check_ipt_lib_dir()
>  {
> -	IPT_LIB_DIR=""
> +	IPT_LIB_DIR=$(pkg-config --variable=xtlibdir xtables)
> +	if [ -n "$IPT_LIB_DIR" ]; then
> +		echo $IPT_LIB_DIR
> +		echo "IPT_LIB_DIR:=$IPT_LIB_DIR" >> Config
> +		return
> +	fi
> +
>  	for dir in /lib /usr/lib /usr/local/lib
>  	do
>  		for file in $dir/{xtables,iptables}/lib*t_*so ; do

Applied

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] configure: Add search path for 64bit library.
  2012-08-13 16:33       ` Stephen Hemminger
  2012-08-20  1:41         ` [PATCH v2] iproute2: " Li Wei
@ 2012-09-09 19:42         ` Jan Engelhardt
  1 sibling, 0 replies; 9+ messages in thread
From: Jan Engelhardt @ 2012-09-09 19:42 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Ben Hutchings, Li Wei, netdev


On Monday 2012-08-13 18:33, Stephen Hemminger wrote:
>> > > >  	IPT_LIB_DIR=""
>> > > > -	for dir in /lib /usr/lib /usr/local/lib
>> > > > +	for dir in /lib /usr/lib /usr/local/lib /lib64 /usr/lib64 /usr/local/lib64
>> > > >  	do
>> > > >  		for file in $dir/{xtables,iptables}/lib*t_*so ; do
>> > > >  			if [ -f $file ]; then
>> > > 
>> > > I think this should be done with pkg-config:
>> > > 
>> > >     pkg-config --variable=xtlibdir xtables
>> > 
>> > Does every distro have pkg-config or does more logic need to be done here?
>> 
>> Every distro has pkg-config; the question is whether you want to support
>> library versions that don't include a pkg-config file (xtables.pc), if
>> they exist.
>
>Let's do pkg-config first, and as a fallback keep the old code and only
>look in the same old places.

Every distro that has libxtables.so also has the .pc file.

The obvious reason to have the .pc file is to render such error
prone static path searching redundant.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-09-09 19:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-07  4:22 [PATCH] configure: Add search path for 64bit library Li Wei
2012-08-07 18:15 ` Ben Hutchings
2012-08-13 15:26   ` Stephen Hemminger
2012-08-13 16:22     ` Ben Hutchings
2012-08-13 16:33       ` Stephen Hemminger
2012-08-20  1:41         ` [PATCH v2] iproute2: " Li Wei
2012-08-20 15:30           ` Ben Hutchings
2012-08-20 16:02           ` Stephen Hemminger
2012-09-09 19:42         ` [PATCH] " Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).