summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-10-05 07:38:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:11 -0500
commit4e47aef017e57c6f2525942d6190dab5ad601ea9 (patch)
treeb827fc2e6dbba8659d71e27eeefeea0c5afbfa99
parenteade80109b2706dc3ceaa0510ed984e5cbfc5f67 (diff)
downloadsamba-4e47aef017e57c6f2525942d6190dab5ad601ea9.tar.gz
samba-4e47aef017e57c6f2525942d6190dab5ad601ea9.tar.bz2
samba-4e47aef017e57c6f2525942d6190dab5ad601ea9.zip
r19088: filter out -Wl,-rpath combinations with /usr/lib too
metze (This used to be commit 52ffc8b12c53d4a65e31385108b34a20f1c74326)
-rw-r--r--source3/aclocal.m429
1 files changed, 24 insertions, 5 deletions
diff --git a/source3/aclocal.m4 b/source3/aclocal.m4
index 185bae0f44..5d9a9e054b 100644
--- a/source3/aclocal.m4
+++ b/source3/aclocal.m4
@@ -263,14 +263,33 @@ AC_DEFUN(CFLAGS_REMOVE_USR_INCLUDE,[
done
$1=[$]ac_new_flags
])
-
-dnl Removes -L/usr/lib/? from given variable
+
+dnl Removes '-L/usr/lib[/]', '-Wl,-rpath,/usr/lib[/]'
+dnl and '-Wl,-rpath -Wl,/usr/lib[/]' from given variable
AC_DEFUN(LIB_REMOVE_USR_LIB,[
ac_new_flags=""
+ l=""
for i in [$]$1; do
- case [$]i in
- -L/usr/lib|-L/usr/lib/) ;;
- *) ac_new_flags="[$]ac_new_flags [$]i" ;;
+ case [$]l[$]i in
+ -L/usr/lib) ;;
+ -L/usr/lib/) ;;
+ -Wl,-rpath,/usr/lib) ;;
+ -Wl,-rpath,/usr/lib/) ;;
+ -Wl,-rpath) l=[$]i;;
+ -Wl,-rpath-Wl,/usr/lib) l="";;
+ -Wl,-rpath-Wl,/usr/lib/) l="";;
+ *)
+ s=" "
+ if test x"[$]ac_new_flags" = x""; then
+ s="";
+ fi
+ if test x"[$]l" = x""; then
+ ac_new_flags="[$]ac_new_flags[$]s[$]i";
+ else
+ ac_new_flags="[$]ac_new_flags[$]s[$]l [$]i";
+ fi
+ l=""
+ ;;
esac
done
$1=[$]ac_new_flags