summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2003-02-15 23:07:59 +0000
committerAlexander Bokovoy <ab@samba.org>2003-02-15 23:07:59 +0000
commitbf1c82a48f89d25af767d73cb9c25f78bd868d30 (patch)
treec8239d1526aa1af30cd94c03b7b285da76dbc330
parente257141c9b3703ef73ee312f3ec30d377e0d3293 (diff)
downloadsamba-bf1c82a48f89d25af767d73cb9c25f78bd868d30.tar.gz
samba-bf1c82a48f89d25af767d73cb9c25f78bd868d30.tar.xz
samba-bf1c82a48f89d25af767d73cb9c25f78bd868d30.zip
Merge from head CFLAGS/CPPFLAGS and LIBS/LDFLAGS sanitizing
-rw-r--r--source/aclocal.m423
-rw-r--r--source/configure.in8
2 files changed, 31 insertions, 0 deletions
diff --git a/source/aclocal.m4 b/source/aclocal.m4
index 758dfa3b379..5b1500106cb 100644
--- a/source/aclocal.m4
+++ b/source/aclocal.m4
@@ -462,3 +462,26 @@ int main(int argc, char *argv[])
rm -f conf.mysqltest
])
+dnl Removes -I/usr/include/? from given variable
+AC_DEFUN(CFLAGS_REMOVE_USR_INCLUDE,[
+ ac_new_flags=""
+ for i in [$]$1; do
+ case [$]i in
+ -I/usr/include|-I/usr/include/) ;;
+ *) ac_new_flags="[$]ac_new_flags [$]i" ;;
+ esac
+ done
+ $1=[$]ac_new_flags
+])
+
+dnl Removes -L/usr/lib/? from given variable
+AC_DEFUN(LIB_REMOVE_USR_LIB,[
+ ac_new_flags=""
+ for i in [$]$1; do
+ case [$]i in
+ -L/usr/lib|-L/usr/lib/) ;;
+ *) ac_new_flags="[$]ac_new_flags [$]i" ;;
+ esac
+ done
+ $1=[$]ac_new_flags
+])
diff --git a/source/configure.in b/source/configure.in
index fbab1143a21..541946e6718 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -3354,6 +3354,14 @@ AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
builddir=`pwd`
AC_SUBST(builddir)
+dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
+LIB_REMOVE_USR_LIB(LDFLAGS)
+LIB_REMOVE_USR_LIB(LIBS)
+
+dnl Remove -I/usr/include/? from CFLAGS and CPPFLAGS
+CFLAGS_REMOVE_USR_INCLUDE(CFLAGS)
+CFLAGS_REMOVE_USR_INCLUDE(CPPFLAGS)
+
AC_OUTPUT(include/stamp-h Makefile script/findsmb)
#################################################