From 31e371c8045e1dd1b755f1b32e3cfdf0e1305a6f Mon Sep 17 00:00:00 2001 From: russell Date: Fri, 14 Mar 2008 17:05:11 +0000 Subject: [PATCH] Do a link test in AST_EXT_TOOL_CHECK() to ensure we have all the required libs reported by the tool. (closes issue #12067, reported by Juggie, patched by me) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@108740 f38db490-d61c-443f-a65b-d21fe96a405b --- acinclude.m4 | 6 +++++- configure | 50 ++++++++++++++++++++++++++++++++++---------------- 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 9b84af614..6e310e53f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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.]) diff --git a/configure b/configure index d70d8f925..fda20245a 100755 --- 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