@@ -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
@@ -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.
@@ -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?
@@ -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.
@@ -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.
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(-)
@@ -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
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(-)
@@ -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.
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(-)
@@ -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
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.