[asterisk-commits] qwell: trunk r98985 - in /trunk: ./ include/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 16 17:08:12 CST 2008


Author: qwell
Date: Wed Jan 16 17:08:11 2008
New Revision: 98985

URL: http://svn.digium.com/view/asterisk?view=rev&rev=98985
Log:
Change AST_EXT_TOOL_CHECK to attempt to build against <package>_LIB, per recommendations from Russell.

Modified:
    trunk/acinclude.m4
    trunk/configure
    trunk/configure.ac
    trunk/include/asterisk/autoconfig.h.in

Modified: trunk/acinclude.m4
URL: http://svn.digium.com/view/asterisk/trunk/acinclude.m4?view=diff&rev=98985&r1=98984&r2=98985
==============================================================================
--- trunk/acinclude.m4 (original)
+++ trunk/acinclude.m4 Wed Jan 16 17:08:11 2008
@@ -210,9 +210,9 @@
 
 # Check for a package using $2-config. Similar to AST_EXT_LIB_CHECK,
 # but use $2-config to determine cflags and libraries to use.
-# $3 and $4 can be used to replace --cflags and --libs in the request 
-
-# AST_EXT_TOOL_CHECK([package], [tool name], [--cflags], [--libs])
+# $3 and $4 can be used to replace --cflags and --libs in the request
+
+# AST_EXT_TOOL_CHECK([package], [tool name], [--cflags], [--libs], [includes], [expression])
 AC_DEFUN([AST_EXT_TOOL_CHECK],
 [
     if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
@@ -223,8 +223,27 @@
 	    $1_INCLUDE=$(${CONFIG_$1} $A)
 	    if test x"$4" = x ; then A=--libs ; else A="$4" ; fi
 	    $1_LIB=$(${CONFIG_$1} $A)
-	    PBX_$1=1
-	    AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 libraries.])
+	    if test x"$5" != x ; then
+		saved_cppflags="${CPPFLAGS}"
+		if test "x${$1_DIR}" != "x"; then
+		    $1_INCLUDE="-I${$1_DIR}/include"
+		fi
+		CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
+
+		AC_COMPILE_IFELSE(
+		    [ AC_LANG_PROGRAM( [ $5 ],
+				       [ $6; ]
+				       )],
+		    [   PBX_$1=1
+			AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
+		    ],
+		    []
+		)
+		CPPFLAGS="${saved_cppflags}"
+	    else
+		PBX_$1=1
+		AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 libraries.])
+	    fi
 	fi
     fi
 ])

Modified: trunk/configure
URL: http://svn.digium.com/view/asterisk/trunk/configure?view=diff&rev=98985&r1=98984&r2=98985
==============================================================================
--- trunk/configure (original)
+++ trunk/configure Wed Jan 16 17:08:11 2008
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 98952 .
+# From configure.ac Revision: 98971 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.4.
 #
@@ -957,7 +957,7 @@
 GC_LDFLAGS
 AST_DECLARATION_AFTER_STATEMENT
 GSM_INTERNAL
-NETSNMP_CONFIG
+CONFIG_NETSNMP
 PG_CONFIG
 PTLIB_CONFIG
 PWLIBDIR
@@ -34792,30 +34792,28 @@
 fi
 
 
-NETSNMP_CONFIG=No
-if test "${USE_NETSNMP}" != "no"; then
-   if test "x${NETSNMP_DIR}" != "x"; then
-      if test -n "$ac_tool_prefix"; then
+
+    if test "x${PBX_NETSNMP}" != "x1" -a "${USE_NETSNMP}" != "no"; then
+	PBX_NETSNMP=0
+	if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}net-snmp-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}net-snmp-config; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_NETSNMP_CONFIG+set}" = set; then
+if test "${ac_cv_prog_CONFIG_NETSNMP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $NETSNMP_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_NETSNMP_CONFIG="$NETSNMP_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in ${NETSNMP_DIR}/bin
+  if test -n "$CONFIG_NETSNMP"; then
+  ac_cv_prog_CONFIG_NETSNMP="$CONFIG_NETSNMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_NETSNMP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_prog_CONFIG_NETSNMP="${ac_tool_prefix}net-snmp-config"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -34823,13 +34821,12 @@
 done
 IFS=$as_save_IFS
 
-  ;;
-esac
-fi
-NETSNMP_CONFIG=$ac_cv_path_NETSNMP_CONFIG
-if test -n "$NETSNMP_CONFIG"; then
-  { echo "$as_me:$LINENO: result: $NETSNMP_CONFIG" >&5
-echo "${ECHO_T}$NETSNMP_CONFIG" >&6; }
+fi
+fi
+CONFIG_NETSNMP=$ac_cv_prog_CONFIG_NETSNMP
+if test -n "$CONFIG_NETSNMP"; then
+  { echo "$as_me:$LINENO: result: $CONFIG_NETSNMP" >&5
+echo "${ECHO_T}$CONFIG_NETSNMP" >&6; }
 else
   { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
@@ -34837,28 +34834,26 @@
 
 
 fi
-if test -z "$ac_cv_path_NETSNMP_CONFIG"; then
-  ac_pt_NETSNMP_CONFIG=$NETSNMP_CONFIG
+if test -z "$ac_cv_prog_CONFIG_NETSNMP"; then
+  ac_ct_CONFIG_NETSNMP=$CONFIG_NETSNMP
   # Extract the first word of "net-snmp-config", so it can be a program name with args.
 set dummy net-snmp-config; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_ac_pt_NETSNMP_CONFIG+set}" = set; then
+if test "${ac_cv_prog_ac_ct_CONFIG_NETSNMP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $ac_pt_NETSNMP_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_NETSNMP_CONFIG="$ac_pt_NETSNMP_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in ${NETSNMP_DIR}/bin
+  if test -n "$ac_ct_CONFIG_NETSNMP"; then
+  ac_cv_prog_ac_ct_CONFIG_NETSNMP="$ac_ct_CONFIG_NETSNMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_ac_pt_NETSNMP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_prog_ac_ct_CONFIG_NETSNMP="net-snmp-config"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -34866,20 +34861,19 @@
 done
 IFS=$as_save_IFS
 
-  ;;
-esac
-fi
-ac_pt_NETSNMP_CONFIG=$ac_cv_path_ac_pt_NETSNMP_CONFIG
-if test -n "$ac_pt_NETSNMP_CONFIG"; then
-  { echo "$as_me:$LINENO: result: $ac_pt_NETSNMP_CONFIG" >&5
-echo "${ECHO_T}$ac_pt_NETSNMP_CONFIG" >&6; }
+fi
+fi
+ac_ct_CONFIG_NETSNMP=$ac_cv_prog_ac_ct_CONFIG_NETSNMP
+if test -n "$ac_ct_CONFIG_NETSNMP"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CONFIG_NETSNMP" >&5
+echo "${ECHO_T}$ac_ct_CONFIG_NETSNMP" >&6; }
 else
   { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
 fi
 
-  if test "x$ac_pt_NETSNMP_CONFIG" = x; then
-    NETSNMP_CONFIG="No"
+  if test "x$ac_ct_CONFIG_NETSNMP" = x; then
+    CONFIG_NETSNMP="No"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
@@ -34891,170 +34885,52 @@
 configuration is useful to you, please write to autoconf at gnu.org." >&2;}
 ac_tool_warned=yes ;;
 esac
-    NETSNMP_CONFIG=$ac_pt_NETSNMP_CONFIG
+    CONFIG_NETSNMP=$ac_ct_CONFIG_NETSNMP
   fi
 else
-  NETSNMP_CONFIG="$ac_cv_path_NETSNMP_CONFIG"
-fi
-
-      if test x"${NETSNMP_CONFIG}" = xNo; then
-         { echo "$as_me:$LINENO: ***" >&5
-echo "$as_me: ***" >&6;}
-         { echo "$as_me:$LINENO: *** net-snmp-config was not found in the path you specified:" >&5
-echo "$as_me: *** net-snmp-config was not found in the path you specified:" >&6;}
-         { echo "$as_me:$LINENO: *** ${NETSNMP_DIR}/bin" >&5
-echo "$as_me: *** ${NETSNMP_DIR}/bin" >&6;}
-         { echo "$as_me:$LINENO: *** Either correct the installation, or run configure" >&5
-echo "$as_me: *** Either correct the installation, or run configure" >&6;}
-         { echo "$as_me:$LINENO: *** including --without-netsnmp" >&5
-echo "$as_me: *** including --without-netsnmp" >&6;}
-         exit 1
-      fi
-   else
-      if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}net-snmp-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}net-snmp-config; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_NETSNMP_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $NETSNMP_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_NETSNMP_CONFIG="$NETSNMP_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_NETSNMP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-NETSNMP_CONFIG=$ac_cv_path_NETSNMP_CONFIG
-if test -n "$NETSNMP_CONFIG"; then
-  { echo "$as_me:$LINENO: result: $NETSNMP_CONFIG" >&5
-echo "${ECHO_T}$NETSNMP_CONFIG" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_path_NETSNMP_CONFIG"; then
-  ac_pt_NETSNMP_CONFIG=$NETSNMP_CONFIG
-  # Extract the first word of "net-snmp-config", so it can be a program name with args.
-set dummy net-snmp-config; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_path_ac_pt_NETSNMP_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $ac_pt_NETSNMP_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_NETSNMP_CONFIG="$ac_pt_NETSNMP_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_ac_pt_NETSNMP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-ac_pt_NETSNMP_CONFIG=$ac_cv_path_ac_pt_NETSNMP_CONFIG
-if test -n "$ac_pt_NETSNMP_CONFIG"; then
-  { echo "$as_me:$LINENO: result: $ac_pt_NETSNMP_CONFIG" >&5
-echo "${ECHO_T}$ac_pt_NETSNMP_CONFIG" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-  if test "x$ac_pt_NETSNMP_CONFIG" = x; then
-    NETSNMP_CONFIG="No"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
-    NETSNMP_CONFIG=$ac_pt_NETSNMP_CONFIG
-  fi
-else
-  NETSNMP_CONFIG="$ac_cv_path_NETSNMP_CONFIG"
-fi
-
-   fi
-fi
-if test x"${NETSNMP_CONFIG}" != xNo; then
-   NETSNMP_libs=`${NETSNMP_CONFIG} --agent-libs`
-
-   { echo "$as_me:$LINENO: checking for snmp_register_callback in -lnetsnmp" >&5
-echo $ECHO_N "checking for snmp_register_callback in -lnetsnmp... $ECHO_C" >&6; }
-if test "${ac_cv_lib_netsnmp_snmp_register_callback+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnetsnmp ${NETSNMP_LIBS} $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+  CONFIG_NETSNMP="$ac_cv_prog_CONFIG_NETSNMP"
+fi
+
+	if test ! "x${CONFIG_NETSNMP}" = xNo; then
+	    if test x"" = x ; then A=--cflags ; else A="" ; fi
+	    NETSNMP_INCLUDE=$(${CONFIG_NETSNMP} $A)
+	    if test x"--agent-libs" = x ; then A=--libs ; else A="--agent-libs" ; fi
+	    NETSNMP_LIB=$(${CONFIG_NETSNMP} $A)
+	    if test x"#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>" != x ; then
+		saved_cppflags="${CPPFLAGS}"
+		if test "x${NETSNMP_DIR}" != "x"; then
+		    NETSNMP_INCLUDE="-I${NETSNMP_DIR}/include"
+		fi
+		CPPFLAGS="${CPPFLAGS} ${NETSNMP_INCLUDE}"
+
+		cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char snmp_register_callback ();
+ #include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
 int
 main ()
 {
-return snmp_register_callback ();
+ int callback = snmp_register_callback(0, 0, NULL, NULL);
+
   ;
   return 0;
 }
 _ACEOF
-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_link") 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+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
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -35063,35 +34939,35 @@
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_netsnmp_snmp_register_callback=yes
+       } && test -s conftest.$ac_objext; then
+     PBX_NETSNMP=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_NETSNMP 1
+_ACEOF
+
+
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_lib_netsnmp_snmp_register_callback=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_netsnmp_snmp_register_callback" >&5
-echo "${ECHO_T}$ac_cv_lib_netsnmp_snmp_register_callback" >&6; }
-if test $ac_cv_lib_netsnmp_snmp_register_callback = yes; then
-
-cat >>confdefs.h <<_ACEOF
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+		CPPFLAGS="${saved_cppflags}"
+	    else
+		PBX_NETSNMP=1
+
+cat >>confdefs.h <<\_ACEOF
 #define HAVE_NETSNMP 1
 _ACEOF
 
-fi
-
-   if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
-      NETSNMP_LIB="${NETSNMP_libs}"
-      PBX_NETSNMP=1
-   fi
-fi
+	    fi
+	fi
+    fi
+
 
 
 if test "x${PBX_NEWT}" != "x1" -a "${USE_NEWT}" != "no"; then
@@ -46976,12 +46852,71 @@
 	    SDL_INCLUDE=$(${CONFIG_SDL} $A)
 	    if test x"" = x ; then A=--libs ; else A="" ; fi
 	    SDL_LIB=$(${CONFIG_SDL} $A)
-	    PBX_SDL=1
+	    if test x"" != x ; then
+		saved_cppflags="${CPPFLAGS}"
+		if test "x${SDL_DIR}" != "x"; then
+		    SDL_INCLUDE="-I${SDL_DIR}/include"
+		fi
+		CPPFLAGS="${CPPFLAGS} ${SDL_INCLUDE}"
+
+		cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ ;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+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
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+     PBX_SDL=1
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_SDL 1
 _ACEOF
 
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+		CPPFLAGS="${saved_cppflags}"
+	    else
+		PBX_SDL=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SDL 1
+_ACEOF
+
+	    fi
 	fi
     fi
 
@@ -48278,12 +48213,71 @@
 	    GTK_INCLUDE=$(${CONFIG_GTK} $A)
 	    if test x"--libs gthread" = x ; then A=--libs ; else A="--libs gthread" ; fi
 	    GTK_LIB=$(${CONFIG_GTK} $A)
-	    PBX_GTK=1
+	    if test x"" != x ; then
+		saved_cppflags="${CPPFLAGS}"
+		if test "x${GTK_DIR}" != "x"; then
+		    GTK_INCLUDE="-I${GTK_DIR}/include"
+		fi
+		CPPFLAGS="${CPPFLAGS} ${GTK_INCLUDE}"
+
+		cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+ ;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+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
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+     PBX_GTK=1
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_GTK 1
 _ACEOF
 
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+		CPPFLAGS="${saved_cppflags}"
+	    else
+		PBX_GTK=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GTK 1
+_ACEOF
+
+	    fi
 	fi
     fi
 
@@ -49683,7 +49677,7 @@
 GC_LDFLAGS!$GC_LDFLAGS$ac_delim
 AST_DECLARATION_AFTER_STATEMENT!$AST_DECLARATION_AFTER_STATEMENT$ac_delim
 GSM_INTERNAL!$GSM_INTERNAL$ac_delim
-NETSNMP_CONFIG!$NETSNMP_CONFIG$ac_delim
+CONFIG_NETSNMP!$CONFIG_NETSNMP$ac_delim
 PG_CONFIG!$PG_CONFIG$ac_delim
 PTLIB_CONFIG!$PTLIB_CONFIG$ac_delim
 PWLIBDIR!$PWLIBDIR$ac_delim

Modified: trunk/configure.ac
URL: http://svn.digium.com/view/asterisk/trunk/configure.ac?view=diff&rev=98985&r1=98984&r2=98985
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Wed Jan 16 17:08:11 2008
@@ -828,32 +828,11 @@
 
 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
 
-NETSNMP_CONFIG=No
-if test "${USE_NETSNMP}" != "no"; then
-   if test "x${NETSNMP_DIR}" != "x"; then
-      AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No, [${NETSNMP_DIR}/bin])
-      if test x"${NETSNMP_CONFIG}" = xNo; then
-         AC_MSG_NOTICE([***])
-         AC_MSG_NOTICE([*** net-snmp-config was not found in the path you specified:])
-         AC_MSG_NOTICE([*** ${NETSNMP_DIR}/bin])
-         AC_MSG_NOTICE([*** Either correct the installation, or run configure])
-         AC_MSG_NOTICE([*** including --without-netsnmp])
-         exit 1
-      fi
-   else
-      AC_PATH_TOOL([NETSNMP_CONFIG], [net-snmp-config], No)
-   fi
-fi
-if test x"${NETSNMP_CONFIG}" != xNo; then
-   NETSNMP_libs=`${NETSNMP_CONFIG} --agent-libs`
-
-   AC_CHECK_LIB([netsnmp], [snmp_register_callback], AC_DEFINE_UNQUOTED([HAVE_NETSNMP], 1,
-   [Define to indicate the Net-SNMP library]), [], ${NETSNMP_LIBS})
-   if test "${ac_cv_lib_netsnmp_snmp_register_callback}" = "yes"; then
-      NETSNMP_LIB="${NETSNMP_libs}"
-      PBX_NETSNMP=1
-   fi
-fi
+AST_EXT_TOOL_CHECK([NETSNMP], [net-snmp], , [--agent-libs],
+[#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>],
+[int callback = snmp_register_callback(0, 0, NULL, NULL)])
 
 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
 

Modified: trunk/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/autoconfig.h.in?view=diff&rev=98985&r1=98984&r2=98985
==============================================================================
--- trunk/include/asterisk/autoconfig.h.in (original)
+++ trunk/include/asterisk/autoconfig.h.in Wed Jan 16 17:08:11 2008
@@ -499,7 +499,7 @@
 /* Define to 1 if you have the <netinet/in.h> header file. */
 #undef HAVE_NETINET_IN_H
 
-/* Define to indicate the Net-SNMP library */
+/* Define if your system has the NETSNMP libraries. */
 #undef HAVE_NETSNMP
 
 /* Define this to indicate the ${NEWT_DESCRIP} library */




More information about the asterisk-commits mailing list