From 355c902a73e7bc50f7a44b5b8064dc7ec0d191b0 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Thu, 23 Jan 2003 14:19:02 -0500 Subject: [svn-r6317] Purpose: Bug Fix Description: Some compilers were having problems if we included the -I/usr/include and -L/usr/lib flags which are completely redundant. This could occur if the user configured with something like: ./configure --with-zlib=/usr/include,/usr/lib Solution: Check if the --with-* command is specified with /usr/include and /usr/lib. If so, then don't place them in the compile macros. Platforms tested: Linux, Modi4 --- configure | 50 +++++++++++++++++++++++++++++++++++++++++++++--- configure.in | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 106 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 9f5cbaf..c0de588 100755 --- a/configure +++ b/configure @@ -1609,7 +1609,7 @@ echo "${ECHO_T}found" >&6 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 done -if test $host_config != "none"; then +if test "X$host_config" != "Xnone"; then CC_BASENAME="`echo $CC | cut -f1 -d' ' | xargs basename 2>/dev/null`" . $host_config fi @@ -7288,7 +7288,7 @@ case $host_os in if $CC -v 2>&1 | grep '^gcc' > /dev/null ; then : using gcc else - echo 'fix $wl in' $ofile + echo 'fixing $wl in' $ofile ed - $ofile < /dev/null /^wl=""/s//wl="-Wl,"/ w @@ -22557,6 +22557,13 @@ echo "${ECHO_T}suppressed" >&6 ;; esac + if test "X$dmalloc_inc" = "X/usr/include"; then + dmalloc_inc="" + fi + if test "X$dmalloc_lib" = "X/usr/lib"; then + dmalloc_lib="" + fi + saved_CPPFLAGS="$CPPFLAGS" saved_LDFLAGS="$LDFLAGS" @@ -23051,6 +23058,13 @@ echo "${ECHO_T}suppressed" >&6 ;; esac + if test "X$zlib_inc" = "X/usr/include"; then + zlib_inc="" + fi + if test "X$zlib_lib" = "X/usr/lib"; then + zlib_lib="" + fi + saved_CPPFLAGS="$CPPFLAGS" saved_LDFLAGS="$LDFLAGS" @@ -23370,6 +23384,13 @@ echo "${ECHO_T}suppressed" >&6 ;; esac + if test "X$pablo_inc" = "X/usr/include"; then + pablo_inc="" + fi + if test "X$pablo_lib" = "X/usr/lib"; then + pablo_lib="" + fi + saved_CPPFLAGS="$CPPFLAGS" saved_LDFLAGS="$LDFLAGS" if test -n "$pablo_inc"; then @@ -23561,7 +23582,9 @@ echo "${ECHO_T}suppressed" >&6 ;; *) saved_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -L$with_ssl" + if test "X$with_ssl" != "X/usr/lib"; then + LDFLAGS="$LDFLAGS -L$with_ssl" + fi echo "$as_me:$LINENO: checking for main in -lcrypto" >&5 echo $ECHO_N "checking for main in -lcrypto... $ECHO_C" >&6 @@ -24407,6 +24430,13 @@ echo "${ECHO_T}suppressed" >&6 ;; esac + if test "X$gass_inc" = "X/usr/include"; then + gass_inc="" + fi + if test "X$gass_lib" = "X/usr/lib"; then + gass_lib="" + fi + if test -n "$gass_inc"; then saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$gass_inc" @@ -26122,6 +26152,13 @@ echo "${ECHO_T}suppressed" >&6 ;; esac + if test "X$srb_inc" = "X/usr/include"; then + srb_inc="" + fi + if test "X$srb_lib" = "X/usr/lib"; then + srb_lib="" + fi + if test -n "$srb_inc"; then saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$srb_inc" @@ -27270,6 +27307,13 @@ echo "${ECHO_T}suppressed" >&6 ;; esac + if test "X$pthread_inc" = "X/usr/include"; then + pthread_inc="" + fi + if test "X$pthread_lib" = "X/usr/lib"; then + pthread_lib="" + fi + if test -n "$pthread_inc"; then saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$pthread_inc" diff --git a/configure.in b/configure.in index 7b29de6..69b2cd6 100644 --- a/configure.in +++ b/configure.in @@ -160,7 +160,7 @@ for f in $host_cpu-$host_vendor-$host_os \ fi AC_MSG_RESULT([no]) done -if test $host_config != "none"; then +if test "X$host_config" != "Xnone"; then CC_BASENAME="`echo $CC | cut -f1 -d' ' | xargs basename 2>/dev/null`" . $host_config fi @@ -285,7 +285,7 @@ case $host_os in if $CC -v 2>&1 | grep '^gcc' > /dev/null ; then : using gcc else - echo 'fix $wl in' $ofile + echo 'fixing $wl in' $ofile ed - $ofile < /dev/null /^wl=""/s//wl="-Wl,"/ w @@ -710,6 +710,15 @@ case $withval in ;; esac + dnl Trying to include -I/usr/include and -L/usr/lib is redundant and + dnl can mess some compilers up. + if test "X$dmalloc_inc" = "X/usr/include"; then + dmalloc_inc="" + fi + if test "X$dmalloc_lib" = "X/usr/lib"; then + dmalloc_lib="" + fi + saved_CPPFLAGS="$CPPFLAGS" saved_LDFLAGS="$LDFLAGS" @@ -773,6 +782,15 @@ case $withval in ;; esac + dnl Trying to include -I/usr/include and -L/usr/lib is redundant and + dnl can mess some compilers up. + if test "X$zlib_inc" = "X/usr/include"; then + zlib_inc="" + fi + if test "X$zlib_lib" = "X/usr/lib"; then + zlib_lib="" + fi + saved_CPPFLAGS="$CPPFLAGS" saved_LDFLAGS="$LDFLAGS" @@ -838,6 +856,15 @@ case "$withval" in ;; esac + dnl Trying to include -I/usr/include and -L/usr/lib is redundant and + dnl can mess some compilers up. + if test "X$pablo_inc" = "X/usr/include"; then + pablo_inc="" + fi + if test "X$pablo_lib" = "X/usr/lib"; then + pablo_lib="" + fi + saved_CPPFLAGS="$CPPFLAGS" saved_LDFLAGS="$LDFLAGS" if test -n "$pablo_inc"; then @@ -898,7 +925,9 @@ case "$withval" in ;; *) saved_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -L$with_ssl" + if test "X$with_ssl" != "X/usr/lib"; then + LDFLAGS="$LDFLAGS -L$with_ssl" + fi AC_CHECK_LIB(crypto,main,, LDFLAGS="$saved_LDFLAGS"; unset SSL) AC_CHECK_LIB(ssl,SSL_get_version,, LDFLAGS="$saved_LDFLAGS"; unset SSL) ;; @@ -949,6 +978,15 @@ case "$withval" in ;; esac + dnl Trying to include -I/usr/include and -L/usr/lib is redundant and + dnl can mess some compilers up. + if test "X$gass_inc" = "X/usr/include"; then + gass_inc="" + fi + if test "X$gass_lib" = "X/usr/lib"; then + gass_lib="" + fi + if test -n "$gass_inc"; then saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$gass_inc" @@ -1026,6 +1064,15 @@ case "$withval" in ;; esac + dnl Trying to include -I/usr/include and -L/usr/lib is redundant and + dnl can mess some compilers up. + if test "X$srb_inc" = "X/usr/include"; then + srb_inc="" + fi + if test "X$srb_lib" = "X/usr/lib"; then + srb_lib="" + fi + if test -n "$srb_inc"; then saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$srb_inc" @@ -1105,6 +1152,15 @@ case "$withval" in ;; esac + dnl Trying to include -I/usr/include and -L/usr/lib is redundant and + dnl can mess some compilers up. + if test "X$pthread_inc" = "X/usr/include"; then + pthread_inc="" + fi + if test "X$pthread_lib" = "X/usr/lib"; then + pthread_lib="" + fi + if test -n "$pthread_inc"; then saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$pthread_inc" -- cgit v0.12