[asterisk-commits] rizzo: trunk r93898 - in /trunk: ./ include/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Dec 19 02:57:46 CST 2007


Author: rizzo
Date: Wed Dec 19 02:57:45 2007
New Revision: 93898

URL: http://svn.digium.com/view/asterisk?view=rev&rev=93898
Log:
Properly document AST_EXT_TOOL_CHECK() and use it to check for
NETSMP and GTK (GTK is not used thoug).

AST_EXT_TOOL_CHECK() could be used for checking curl status
as well, perhaps with a small addition because we currently seem
to require a curl version greater than X.Y.Z

Add a NETSMP_INCLUDE entry in makeopts.in

We don't have yet any macros for using pkg-config to check
for a specific package (right now there is only gtk2+
in the category).



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

Modified: trunk/acinclude.m4
URL: http://svn.digium.com/view/asterisk/trunk/acinclude.m4?view=diff&rev=93898&r1=93897&r2=93898
==============================================================================
--- trunk/acinclude.m4 (original)
+++ trunk/acinclude.m4 Wed Dec 19 02:57:45 2007
@@ -173,16 +173,19 @@
 
 # Check for a package using $2-config. Similar to AST_EXT_LIB_CHECK,
 # but use $2-config to determine cflags and libraries to use.
-
-# AST_EXT_TOOL_CHECK([package], [tool name], [symbol], [version])
+# $3 and $4 can be used to replace --cflags and --libs in the request 
+
+# AST_EXT_TOOL_CHECK([package], [tool name], [--cflags], [--libs])
 AC_DEFUN([AST_EXT_TOOL_CHECK],
 [
     if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
 	PBX_$1=0
 	AC_CHECK_TOOL(CONFIG_$1, $2-config, No)
 	if test ! "x${CONFIG_$1}" = xNo; then
-	    $1_INCLUDE=$(${CONFIG_$1} --cflags $3)
-	    $1_LIB=$(${CONFIG_$1} --libs $3)
+	    if test x"$3" = x ; then A=--cflags ; else A="$3" ; fi
+	    $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.])
 	fi

Modified: trunk/configure
URL: http://svn.digium.com/view/asterisk/trunk/configure?view=diff&rev=93898&r1=93897&r2=93898
==============================================================================
--- trunk/configure (original)
+++ trunk/configure Wed Dec 19 02:57:45 2007
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 93184 .
+# From configure.ac Revision: 93211 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.4.
 #
@@ -747,6 +747,14 @@
 GSM_INCLUDE
 GSM_DIR
 PBX_GSM
+GTK_LIB
+GTK_INCLUDE
+GTK_DIR
+PBX_GTK
+GTK2_LIB
+GTK2_INCLUDE
+GTK2_DIR
+PBX_GTK2
 IKSEMEL_LIB
 IKSEMEL_INCLUDE
 IKSEMEL_DIR
@@ -929,7 +937,7 @@
 GSM_INTERNAL
 KDEINIT
 KDEDIR
-NETSNMP_CONFIG
+CONFIG_NETSNMP
 PG_CONFIG
 PTLIB_CONFIG
 PWLIBDIR
@@ -946,14 +954,8 @@
 PBX_H323
 PBX_IXJUSER
 CONFIG_SDL
-GTKCONFIG
-PBX_GTK
-GTK_INCLUDE
-GTK_LIB
+CONFIG_GTK
 PKGCONFIG
-PBX_GTK2
-GTK2_INCLUDE
-GTK2_LIB
 CURL_CONFIG
 LTLIBOBJS'
 ac_subst_files=''
@@ -1559,6 +1561,8 @@
   --with-crypto=PATH      use OpenSSL Cryptography support files in PATH
   --with-gsm=PATH         use External GSM library files in PATH , use
                           'internal' GSM otherwise
+  --with-gtk=PATH         use gtk libraries files in PATH
+  --with-gtk2=PATH        use gtk2 libraries files in PATH
   --with-iksemel=PATH     use Iksemel Jabber Library files in PATH
   --with-imap=PATH        use UW IMAP Toolkit files in PATH
   --with-isdnnet=PATH     use ISDN4Linux Library files in PATH
@@ -7746,7 +7750,13 @@
 
 
 
-# package option names should be in alphabetical order
+# AST_EXT_LIB_SETUP is used to tell configure to handle variables for
+# various packages.
+# $1 is the prefix for the variables in makeopts and autoconfig.h
+# $2 is the short comment, $4 is the long comment
+# $3 is the name used in --with- or --without- flags for configure.
+#
+# Package option names should be in alphabetical order
 # by the --with option name (the third field),
 # to make things easier for the users.
 
@@ -7944,6 +7954,62 @@
 fi
 
     PBX_GSM=0
+
+
+
+
+
+
+    GTK_DESCRIP="gtk libraries"
+    GTK_OPTION="gtk"
+
+# Check whether --with-gtk was given.
+if test "${with_gtk+set}" = set; then
+  withval=$with_gtk;
+	case ${withval} in
+	n|no)
+	USE_GTK=no
+	;;
+	y|ye|yes)
+	ac_mandatory_list="${ac_mandatory_list} GTK"
+	;;
+	*)
+	GTK_DIR="${withval}"
+	ac_mandatory_list="${ac_mandatory_list} GTK"
+	;;
+	esac
+
+fi
+
+    PBX_GTK=0
+
+
+
+
+
+
+    GTK2_DESCRIP="gtk2 libraries"
+    GTK2_OPTION="gtk2"
+
+# Check whether --with-gtk2 was given.
+if test "${with_gtk2+set}" = set; then
+  withval=$with_gtk2;
+	case ${withval} in
+	n|no)
+	USE_GTK2=no
+	;;
+	y|ye|yes)
+	ac_mandatory_list="${ac_mandatory_list} GTK2"
+	;;
+	*)
+	GTK2_DIR="${withval}"
+	ac_mandatory_list="${ac_mandatory_list} GTK2"
+	;;
+	esac
+
+fi
+
+    PBX_GTK2=0
 
 
 
@@ -12528,13 +12594,11 @@
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h> /* for off_t */
-     #include <stdio.h>
+#include <stdio.h>
 int
 main ()
 {
-int (*fp) (FILE *, off_t, int) = fseeko;
-     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
   ;
   return 0;
 }
@@ -12574,13 +12638,11 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #define _LARGEFILE_SOURCE 1
-#include <sys/types.h> /* for off_t */
-     #include <stdio.h>
+#include <stdio.h>
 int
 main ()
 {
-int (*fp) (FILE *, off_t, int) = fseeko;
-     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
+return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
   ;
   return 0;
 }
@@ -34083,30 +34145,29 @@
 fi
 
 
-NETSNMP_CONFIG=No
-if test "${USE_NETSNMP}" != "no"; then
-   if test "x${NETSNMP_DIR}" != "x"; then
-      if test -n "$ac_tool_prefix"; then
+# XXX do we need to check for snmp_register_callback ?
+
+    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
@@ -34114,13 +34175,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; }
@@ -34128,28 +34188,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
@@ -34157,20 +34215,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:)
@@ -34182,208 +34239,26 @@
 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.  */
-_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 ();
-int
-main ()
-{
-return snmp_register_callback ();
-  ;
-  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
-  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_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_netsnmp_snmp_register_callback=yes
-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
+  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)
+	    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
+
 
 
 if test "x${PBX_NEWT}" != "x1" -a "${USE_NEWT}" != "no"; then
@@ -45816,8 +45691,10 @@
 fi
 
 	if test ! "x${CONFIG_SDL}" = xNo; then
-	    SDL_INCLUDE=$(${CONFIG_SDL} --cflags )
-	    SDL_LIB=$(${CONFIG_SDL} --libs )
+	    if test x"" = x ; then A=--cflags ; else A="" ; fi
+	    SDL_INCLUDE=$(${CONFIG_SDL} $A)
+	    if test x"" = x ; then A=--libs ; else A="" ; fi
+	    SDL_LIB=$(${CONFIG_SDL} $A)
 	    PBX_SDL=1
 
 cat >>confdefs.h <<\_ACEOF
@@ -47015,17 +46892,20 @@
 fi
 
 
-PBX_GTK=0
-if test -n "$ac_tool_prefix"; then
+# we don't use gtk right now...
+
+    if test "x${PBX_GTK}" != "x1" -a "${USE_GTK}" != "no"; then
+	PBX_GTK=0
+	if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gtk-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gtk-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_prog_GTKCONFIG+set}" = set; then
+if test "${ac_cv_prog_CONFIG_GTK+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$GTKCONFIG"; then
-  ac_cv_prog_GTKCONFIG="$GTKCONFIG" # Let the user override the test.
+  if test -n "$CONFIG_GTK"; then
+  ac_cv_prog_CONFIG_GTK="$CONFIG_GTK" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -47034,7 +46914,7 @@
   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_prog_GTKCONFIG="${ac_tool_prefix}gtk-config"
+    ac_cv_prog_CONFIG_GTK="${ac_tool_prefix}gtk-config"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -47044,10 +46924,10 @@
 
 fi
 fi
-GTKCONFIG=$ac_cv_prog_GTKCONFIG
-if test -n "$GTKCONFIG"; then
-  { echo "$as_me:$LINENO: result: $GTKCONFIG" >&5
-echo "${ECHO_T}$GTKCONFIG" >&6; }
+CONFIG_GTK=$ac_cv_prog_CONFIG_GTK
+if test -n "$CONFIG_GTK"; then
+  { echo "$as_me:$LINENO: result: $CONFIG_GTK" >&5
+echo "${ECHO_T}$CONFIG_GTK" >&6; }
 else
   { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
@@ -47055,17 +46935,17 @@
 
 
 fi
-if test -z "$ac_cv_prog_GTKCONFIG"; then
-  ac_ct_GTKCONFIG=$GTKCONFIG
+if test -z "$ac_cv_prog_CONFIG_GTK"; then
+  ac_ct_CONFIG_GTK=$CONFIG_GTK
   # Extract the first word of "gtk-config", so it can be a program name with args.
 set dummy gtk-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_prog_ac_ct_GTKCONFIG+set}" = set; then
+if test "${ac_cv_prog_ac_ct_CONFIG_GTK+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_GTKCONFIG"; then
-  ac_cv_prog_ac_ct_GTKCONFIG="$ac_ct_GTKCONFIG" # Let the user override the test.
+  if test -n "$ac_ct_CONFIG_GTK"; then
+  ac_cv_prog_ac_ct_CONFIG_GTK="$ac_ct_CONFIG_GTK" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -47074,7 +46954,7 @@
   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_prog_ac_ct_GTKCONFIG="gtk-config"
+    ac_cv_prog_ac_ct_CONFIG_GTK="gtk-config"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -47084,17 +46964,17 @@
 
 fi
 fi
-ac_ct_GTKCONFIG=$ac_cv_prog_ac_ct_GTKCONFIG
-if test -n "$ac_ct_GTKCONFIG"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_GTKCONFIG" >&5
-echo "${ECHO_T}$ac_ct_GTKCONFIG" >&6; }
+ac_ct_CONFIG_GTK=$ac_cv_prog_ac_ct_CONFIG_GTK
+if test -n "$ac_ct_CONFIG_GTK"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CONFIG_GTK" >&5
+echo "${ECHO_T}$ac_ct_CONFIG_GTK" >&6; }
 else
   { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
 fi
 
-  if test "x$ac_ct_GTKCONFIG" = x; then
-    GTKCONFIG="No"
+  if test "x$ac_ct_CONFIG_GTK" = x; then
+    CONFIG_GTK="No"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
@@ -47106,24 +46986,25 @@
 configuration is useful to you, please write to autoconf at gnu.org." >&2;}
 ac_tool_warned=yes ;;
 esac
-    GTKCONFIG=$ac_ct_GTKCONFIG
+    CONFIG_GTK=$ac_ct_CONFIG_GTK
   fi
 else
-  GTKCONFIG="$ac_cv_prog_GTKCONFIG"
-fi
-
-if test ! "x${GTKCONFIG}" = xNo; then
-   GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
-   GTK_LIB=$(${GTKCONFIG} --libs gthread)
-   PBX_GTK=1
+  CONFIG_GTK="$ac_cv_prog_CONFIG_GTK"
+fi
+
+	if test ! "x${CONFIG_GTK}" = xNo; then
+	    if test x"" = x ; then A=--cflags ; else A="" ; fi
+	    GTK_INCLUDE=$(${CONFIG_GTK} $A)
+	    if test x"" = x ; then A=--libs ; else A="" ; fi
+	    GTK_LIB=$(${CONFIG_GTK} $A)
+	    PBX_GTK=1
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_GTK 1
 _ACEOF
 
-fi
-
-
+	fi
+    fi
 
 
 PBX_GTK2=0
@@ -48229,6 +48110,14 @@
 GSM_INCLUDE!$GSM_INCLUDE$ac_delim
 GSM_DIR!$GSM_DIR$ac_delim
 PBX_GSM!$PBX_GSM$ac_delim
+GTK_LIB!$GTK_LIB$ac_delim
+GTK_INCLUDE!$GTK_INCLUDE$ac_delim
+GTK_DIR!$GTK_DIR$ac_delim
+PBX_GTK!$PBX_GTK$ac_delim
+GTK2_LIB!$GTK2_LIB$ac_delim
+GTK2_INCLUDE!$GTK2_INCLUDE$ac_delim
+GTK2_DIR!$GTK2_DIR$ac_delim
+PBX_GTK2!$PBX_GTK2$ac_delim
 IKSEMEL_LIB!$IKSEMEL_LIB$ac_delim
 IKSEMEL_INCLUDE!$IKSEMEL_INCLUDE$ac_delim
 IKSEMEL_DIR!$IKSEMEL_DIR$ac_delim
@@ -48288,14 +48177,6 @@
 OSS_LIB!$OSS_LIB$ac_delim
 OSS_INCLUDE!$OSS_INCLUDE$ac_delim
 OSS_DIR!$OSS_DIR$ac_delim
-PBX_OSS!$PBX_OSS$ac_delim
-POPT_LIB!$POPT_LIB$ac_delim
-POPT_INCLUDE!$POPT_INCLUDE$ac_delim
-POPT_DIR!$POPT_DIR$ac_delim
-PBX_POPT!$PBX_POPT$ac_delim
-PGSQL_LIB!$PGSQL_LIB$ac_delim
-PGSQL_INCLUDE!$PGSQL_INCLUDE$ac_delim
-PGSQL_DIR!$PGSQL_DIR$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -48337,6 +48218,14 @@
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+PBX_OSS!$PBX_OSS$ac_delim
+POPT_LIB!$POPT_LIB$ac_delim
+POPT_INCLUDE!$POPT_INCLUDE$ac_delim
+POPT_DIR!$POPT_DIR$ac_delim
+PBX_POPT!$PBX_POPT$ac_delim
+PGSQL_LIB!$PGSQL_LIB$ac_delim
+PGSQL_INCLUDE!$PGSQL_INCLUDE$ac_delim
+PGSQL_DIR!$PGSQL_DIR$ac_delim
 PBX_PGSQL!$PBX_PGSQL$ac_delim
 PRI_LIB!$PRI_LIB$ac_delim
 PRI_INCLUDE!$PRI_INCLUDE$ac_delim
@@ -48426,14 +48315,6 @@
 ZAPTEL_TRANSCODE_INCLUDE!$ZAPTEL_TRANSCODE_INCLUDE$ac_delim
 ZAPTEL_TRANSCODE_DIR!$ZAPTEL_TRANSCODE_DIR$ac_delim
 PBX_ZAPTEL_TRANSCODE!$PBX_ZAPTEL_TRANSCODE$ac_delim
-ZAPTEL_VLDTMF_LIB!$ZAPTEL_VLDTMF_LIB$ac_delim
-ZAPTEL_VLDTMF_INCLUDE!$ZAPTEL_VLDTMF_INCLUDE$ac_delim
-ZAPTEL_VLDTMF_DIR!$ZAPTEL_VLDTMF_DIR$ac_delim
-PBX_ZAPTEL_VLDTMF!$PBX_ZAPTEL_VLDTMF$ac_delim
-SDL_LIB!$SDL_LIB$ac_delim
-SDL_INCLUDE!$SDL_INCLUDE$ac_delim
-SDL_DIR!$SDL_DIR$ac_delim
-PBX_SDL!$PBX_SDL$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -48475,6 +48356,14 @@
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+ZAPTEL_VLDTMF_LIB!$ZAPTEL_VLDTMF_LIB$ac_delim
+ZAPTEL_VLDTMF_INCLUDE!$ZAPTEL_VLDTMF_INCLUDE$ac_delim
+ZAPTEL_VLDTMF_DIR!$ZAPTEL_VLDTMF_DIR$ac_delim
+PBX_ZAPTEL_VLDTMF!$PBX_ZAPTEL_VLDTMF$ac_delim
+SDL_LIB!$SDL_LIB$ac_delim
+SDL_INCLUDE!$SDL_INCLUDE$ac_delim
+SDL_DIR!$SDL_DIR$ac_delim
+PBX_SDL!$PBX_SDL$ac_delim
 SDL_IMAGE_LIB!$SDL_IMAGE_LIB$ac_delim
 SDL_IMAGE_INCLUDE!$SDL_IMAGE_INCLUDE$ac_delim
 SDL_IMAGE_DIR!$SDL_IMAGE_DIR$ac_delim
@@ -48493,7 +48382,7 @@
 GSM_INTERNAL!$GSM_INTERNAL$ac_delim
 KDEINIT!$KDEINIT$ac_delim
 KDEDIR!$KDEDIR$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
@@ -48510,19 +48399,13 @@
 PBX_H323!$PBX_H323$ac_delim
 PBX_IXJUSER!$PBX_IXJUSER$ac_delim
 CONFIG_SDL!$CONFIG_SDL$ac_delim
-GTKCONFIG!$GTKCONFIG$ac_delim
-PBX_GTK!$PBX_GTK$ac_delim
-GTK_INCLUDE!$GTK_INCLUDE$ac_delim
-GTK_LIB!$GTK_LIB$ac_delim
+CONFIG_GTK!$CONFIG_GTK$ac_delim
 PKGCONFIG!$PKGCONFIG$ac_delim
-PBX_GTK2!$PBX_GTK2$ac_delim
-GTK2_INCLUDE!$GTK2_INCLUDE$ac_delim
-GTK2_LIB!$GTK2_LIB$ac_delim
 CURL_CONFIG!$CURL_CONFIG$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 45; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 47; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

Modified: trunk/configure.ac
URL: http://svn.digium.com/view/asterisk/trunk/configure.ac?view=diff&rev=93898&r1=93897&r2=93898
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Wed Dec 19 02:57:45 2007
@@ -183,7 +183,13 @@
 	esac])
 AC_SUBST(AST_DEVMODE)
 
-# package option names should be in alphabetical order
+# AST_EXT_LIB_SETUP is used to tell configure to handle variables for
+# various packages.
+# $1 is the prefix for the variables in makeopts and autoconfig.h
+# $2 is the short comment, $4 is the long comment
+# $3 is the name used in --with- or --without- flags for configure.
+#
+# Package option names should be in alphabetical order
 # by the --with option name (the third field),
 # to make things easier for the users.
 
@@ -197,6 +203,8 @@
 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
 AST_EXT_LIB_SETUP([CRYPTO], [OpenSSL Cryptography support], [crypto])
 AST_EXT_LIB_SETUP([GSM], [External GSM library], [gsm], [, use 'internal' GSM otherwise])
+AST_EXT_LIB_SETUP([GTK], [gtk libraries], [gtk])
+AST_EXT_LIB_SETUP([GTK2], [gtk2 libraries], [gtk2])
 AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel])
 AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
 AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet])
@@ -835,33 +843,8 @@
 
 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
+# XXX do we need to check for snmp_register_callback ?
+AST_EXT_TOOL_CHECK([NETSNMP], [net-snmp], , [--agent-libs])
 
 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
 
@@ -1203,17 +1186,8 @@
 AST_EXT_LIB_CHECK([X11], [X11], [XOpenDisplay], [X11/Xlib.h],,, [standard_path])
 AST_EXT_LIB_CHECK([X11], [X11], [XOpenDisplay], [X11/Xlib.h],, [-I/usr/X11R6/include], [X11R6])
 
-PBX_GTK=0
-AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
-if test ! "x${GTKCONFIG}" = xNo; then
-   GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
-   GTK_LIB=$(${GTKCONFIG} --libs gthread)
-   PBX_GTK=1
-   AC_DEFINE([HAVE_GTK], 1, [Define if your system has the GTK libraries.])
-fi
-AC_SUBST(PBX_GTK)
-AC_SUBST(GTK_INCLUDE)
-AC_SUBST(GTK_LIB)
+# we don't use gtk right now...
+AST_EXT_TOOL_CHECK([GTK], [gtk])
 
 PBX_GTK2=0
 AC_CHECK_TOOL(PKGCONFIG, pkg-config, No)

Modified: trunk/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/autoconfig.h.in?view=diff&rev=93898&r1=93897&r2=93898
==============================================================================
--- trunk/include/asterisk/autoconfig.h.in (original)
+++ trunk/include/asterisk/autoconfig.h.in Wed Dec 19 02:57:45 2007
@@ -490,7 +490,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 */

Modified: trunk/makeopts.in
URL: http://svn.digium.com/view/asterisk/trunk/makeopts.in?view=diff&rev=93898&r1=93897&r2=93898
==============================================================================
--- trunk/makeopts.in (original)
+++ trunk/makeopts.in Wed Dec 19 02:57:45 2007
@@ -110,6 +110,7 @@
 NCURSES_LIB=@NCURSES_LIB@
 NCURSES_DIR=@NCURSES_DIR@
 
+NETSNMP_INCLUDE=@NETSNMP_INCLUDE@
 NETSNMP_LIB=@NETSNMP_LIB@
 
 NEWT_INCLUDE=@NEWT_INCLUDE@




More information about the asterisk-commits mailing list