Do a link test in AST_EXT_TOOL_CHECK() to ensure we have all the required libs
authorRussell Bryant <russell@russellbryant.com>
Fri, 14 Mar 2008 17:05:11 +0000 (17:05 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 14 Mar 2008 17:05:11 +0000 (17:05 +0000)
reported by the tool.

(closes issue #12067, reported by Juggie, patched by me)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108740 65c4cc65-6c06-0410-ace0-fbb531ad65f3

acinclude.m4
configure

index 9b84af6..6e310e5 100644 (file)
@@ -230,7 +230,10 @@ AC_DEFUN([AST_EXT_TOOL_CHECK],
                fi
                CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
 
-               AC_COMPILE_IFELSE(
+               saved_ldflags="${LDFLAGS}"
+               LDFLAGS="${$1_LIB}"
+
+               AC_LINK_IFELSE(
                    [ AC_LANG_PROGRAM( [ $5 ],
                                       [ $6; ]
                                       )],
@@ -240,6 +243,7 @@ AC_DEFUN([AST_EXT_TOOL_CHECK],
                    []
                )
                CPPFLAGS="${saved_cppflags}"
+               LDFLAGS="${saved_ldflags}"
            else
                PBX_$1=1
                AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 libraries.])
index d70d8f9..fda2024 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 107409 .
+# From configure.ac Revision: 107462 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.6.
 #
@@ -35440,6 +35440,9 @@ fi
                fi
                CPPFLAGS="${CPPFLAGS} ${NETSNMP_INCLUDE}"
 
+               saved_ldflags="${LDFLAGS}"
+               LDFLAGS="${NETSNMP_LIB}"
+
                cat >conftest.$ac_ext <<_ACEOF
  /* confdefs.h.  */
 _ACEOF
@@ -35458,14 +35461,14 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -35474,7 +35477,8 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
      PBX_NETSNMP=1
 
 cat >>confdefs.h <<\_ACEOF
@@ -35490,8 +35494,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
                CPPFLAGS="${saved_cppflags}"
+               LDFLAGS="${saved_ldflags}"
            else
                PBX_NETSNMP=1
 
@@ -47734,6 +47740,9 @@ fi
                fi
                CPPFLAGS="${CPPFLAGS} ${SDL_INCLUDE}"
 
+               saved_ldflags="${LDFLAGS}"
+               LDFLAGS="${SDL_LIB}"
+
                cat >conftest.$ac_ext <<_ACEOF
  /* confdefs.h.  */
 _ACEOF
@@ -47750,14 +47759,14 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -47766,7 +47775,8 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
      PBX_SDL=1
 
 cat >>confdefs.h <<\_ACEOF
@@ -47782,8 +47792,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
                CPPFLAGS="${saved_cppflags}"
+               LDFLAGS="${saved_ldflags}"
            else
                PBX_SDL=1
 
@@ -49124,6 +49136,9 @@ fi
                fi
                CPPFLAGS="${CPPFLAGS} ${GTK_INCLUDE}"
 
+               saved_ldflags="${LDFLAGS}"
+               LDFLAGS="${GTK_LIB}"
+
                cat >conftest.$ac_ext <<_ACEOF
  /* confdefs.h.  */
 _ACEOF
@@ -49140,14 +49155,14 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -49156,7 +49171,8 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
      PBX_GTK=1
 
 cat >>confdefs.h <<\_ACEOF
@@ -49172,8 +49188,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
                CPPFLAGS="${saved_cppflags}"
+               LDFLAGS="${saved_ldflags}"
            else
                PBX_GTK=1