From 019df92bdfa654b771f6c24470d0684b8492721b Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Sat, 15 Feb 2003 23:07:59 +0000 Subject: Merge from head CFLAGS/CPPFLAGS and LIBS/LDFLAGS sanitizing (This used to be commit bf1c82a48f89d25af767d73cb9c25f78bd868d30) --- source3/aclocal.m4 | 23 +++++++++++++++++++++++ source3/configure.in | 8 ++++++++ 2 files changed, 31 insertions(+) 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) ################################################# -- cgit