[PATCH] configure: Add search path for 64bit library.

Subsystems: the rest

STALE5096d

9 messages, 4 authors, 2012-09-09 · open the first message on its own page

[PATCH] configure: Add search path for 64bit library.

From: Li Wei <hidden>
Date: 2012-08-07 04:23:53

Signed-off-by: Li Wei <redacted>
---
 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

Re: [PATCH] configure: Add search path for 64bit library.

From: Ben Hutchings <hidden>
Date: 2012-08-07 18:16:02

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:
quoted hunk
Signed-off-by: Li Wei <redacted>
---
 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.

Re: [PATCH] configure: Add search path for 64bit library.

From: Stephen Hemminger <hidden>
Date: 2012-08-13 15:26:35

On Tue, 7 Aug 2012 19:15:58 +0100
Ben Hutchings [off-list ref] 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:
quoted
Signed-off-by: Li Wei <redacted>
---
 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?

Re: [PATCH] configure: Add search path for 64bit library.

From: Ben Hutchings <hidden>
Date: 2012-08-13 16:22:53

On Mon, 2012-08-13 at 08:26 -0700, Stephen Hemminger wrote:
On Tue, 7 Aug 2012 19:15:58 +0100
Ben Hutchings [off-list ref] wrote:
quoted
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:
quoted
Signed-off-by: Li Wei <redacted>
---
 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.

Re: [PATCH] configure: Add search path for 64bit library.

From: Stephen Hemminger <hidden>
Date: 2012-08-13 16:33:38

On Mon, 13 Aug 2012 17:22:40 +0100
Ben Hutchings [off-list ref] wrote:
On Mon, 2012-08-13 at 08:26 -0700, Stephen Hemminger wrote:
quoted
On Tue, 7 Aug 2012 19:15:58 +0100
Ben Hutchings [off-list ref] wrote:
quoted
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:
quoted
Signed-off-by: Li Wei <redacted>
---
 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.

[PATCH v2] iproute2: configure: Add search path for 64bit library.

From: Li Wei <hidden>
Date: 2012-08-20 01:42:55

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 <redacted>
---

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

Re: [PATCH v2] iproute2: configure: Add search path for 64bit library.

From: Ben Hutchings <hidden>
Date: 2012-08-20 15:30:39

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 <redacted>
Tested-by: Ben Hutchings <redacted>

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.
quoted hunk
---

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.

Re: [PATCH v2] iproute2: configure: Add search path for 64bit library.

From: Stephen Hemminger <hidden>
Date: 2012-08-20 16:02:51

On Mon, 20 Aug 2012 09:41:47 +0800
Li Wei [off-list ref] wrote:
quoted hunk
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 <redacted>
---

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

Re: [PATCH] configure: Add search path for 64bit library.

From: Jan Engelhardt <hidden>
Date: 2012-09-09 19:43:01

On Monday 2012-08-13 18:33, Stephen Hemminger wrote:
quoted
quoted
quoted
quoted
 	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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help