diff options
-rw-r--r-- | source3/aclocal.m4 | 23 | ||||
-rw-r--r-- | source3/configure.in | 8 |
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) ################################################# |