summaryrefslogtreecommitdiff
path: root/source3
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
commit019df92bdfa654b771f6c24470d0684b8492721b (patch)
treea0b301ea5672651f2af9ede4dd367a77652f1b2f /source3
parent07886ac8569f46aad044da870af463d08b26bc22 (diff)
downloadsamba-019df92bdfa654b771f6c24470d0684b8492721b.tar.gz
samba-019df92bdfa654b771f6c24470d0684b8492721b.tar.bz2
samba-019df92bdfa654b771f6c24470d0684b8492721b.zip
Merge from head CFLAGS/CPPFLAGS and LIBS/LDFLAGS sanitizing
(This used to be commit bf1c82a48f89d25af767d73cb9c25f78bd868d30)
Diffstat (limited to 'source3')
-rw-r--r--source3/aclocal.m423
-rw-r--r--source3/configure.in8
2 files changed, 31 insertions, 0 deletions
diff --git a/source3/aclocal.m4 b/source3/aclocal.m4
index 758dfa3b37..5b1500106c 100644
--- a/source3/aclocal.m4
+++ b/source3/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/source3/configure.in b/source3/configure.in
index fbab1143a2..541946e671 100644
--- a/source3/configure.in
+++ b/source3/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)
#################################################