[asterisk-commits] trunk r35607 - in /trunk: ./ build_tools/ res/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jun 22 18:50:56 MST 2006


Author: russell
Date: Thu Jun 22 20:50:55 2006
New Revision: 35607

URL: http://svn.digium.com/view/asterisk?rev=35607&view=rev
Log:
add basic autoconf support for res_snmp

Modified:
    trunk/build_tools/menuselect-deps.in
    trunk/configure
    trunk/configure.ac
    trunk/makeopts.in
    trunk/res/Makefile
    trunk/res/res_snmp.c

Modified: trunk/build_tools/menuselect-deps.in
URL: http://svn.digium.com/view/asterisk/trunk/build_tools/menuselect-deps.in?rev=35607&r1=35606&r2=35607&view=diff
==============================================================================
--- trunk/build_tools/menuselect-deps.in (original)
+++ trunk/build_tools/menuselect-deps.in Thu Jun 22 20:50:55 2006
@@ -26,3 +26,4 @@
 LIBGSM=@PBX_LIBgsm@
 IKSEMEL=@PBX_LIBIKSEMEL@
 IXJUSER=@PBX_IXJUSER@
+NETSNMP=@PBX_NETSNMP@

Modified: trunk/configure
URL: http://svn.digium.com/view/asterisk/trunk/configure?rev=35607&r1=35606&r2=35607&view=diff
==============================================================================
--- trunk/configure (original)
+++ trunk/configure Thu Jun 22 20:50:55 2006
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 35391 .
+# From configure.ac Revision: 35439 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59e.
 #
@@ -765,6 +765,9 @@
 pq_INCLUDE
 pq_LIB
 PBX_LIBpq
+NET_SNMP_CONFIG
+NETSNMP_LIBS
+PBX_NETSNMP
 PBX_H323
 PBX_IXJUSER
 VPB_INCLUDE
@@ -17674,6 +17677,117 @@
    fi
 fi
 
+
+
+
+NETSNMP_LIBS=
+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_NET_SNMP_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $NET_SNMP_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_NET_SNMP_CONFIG="$NET_SNMP_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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_NET_SNMP_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
+NET_SNMP_CONFIG=$ac_cv_path_NET_SNMP_CONFIG
+if test -n "$NET_SNMP_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $NET_SNMP_CONFIG" >&5
+echo "${ECHO_T}$NET_SNMP_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_NET_SNMP_CONFIG"; then
+  ac_pt_NET_SNMP_CONFIG=$NET_SNMP_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_NET_SNMP_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_NET_SNMP_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_NET_SNMP_CONFIG="$ac_pt_NET_SNMP_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_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_NET_SNMP_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_NET_SNMP_CONFIG=$ac_cv_path_ac_pt_NET_SNMP_CONFIG
+if test -n "$ac_pt_NET_SNMP_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $ac_pt_NET_SNMP_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_NET_SNMP_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_pt_NET_SNMP_CONFIG" = x; then
+    NET_SNMP_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
+    NET_SNMP_CONFIG=$ac_pt_NET_SNMP_CONFIG
+  fi
+else
+  NET_SNMP_CONFIG="$ac_cv_path_NET_SNMP_CONFIG"
+fi
+
+if test "x${NET_SNMP_CONFIG}" != "xNo" ; then
+   NETSNMP_LIBS=`${NET_SNMP_CONFIG} --agent-libs`
+   PBX_NETSNMP=1
+fi
 
 
 
@@ -27193,6 +27307,9 @@
 pq_INCLUDE!$pq_INCLUDE$ac_delim
 pq_LIB!$pq_LIB$ac_delim
 PBX_LIBpq!$PBX_LIBpq$ac_delim
+NET_SNMP_CONFIG!$NET_SNMP_CONFIG$ac_delim
+NETSNMP_LIBS!$NETSNMP_LIBS$ac_delim
+PBX_NETSNMP!$PBX_NETSNMP$ac_delim
 PBX_H323!$PBX_H323$ac_delim
 PBX_IXJUSER!$PBX_IXJUSER$ac_delim
 VPB_INCLUDE!$VPB_INCLUDE$ac_delim
@@ -27223,7 +27340,7 @@
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@@ -27242,7 +27359,7 @@
 
 cat >>$CONFIG_STATUS <<_ACEOF
 cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
 _ACEOF
 sed '
 s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
@@ -27255,8 +27372,6 @@
 ' >>$CONFIG_STATUS <conf$$subs.sed
 rm -f conf$$subs.sed
 cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
 CEOF$ac_eof
 _ACEOF
 
@@ -27504,7 +27619,7 @@
 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed 's/|#_!!_#|//g' >$tmp/out
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&

Modified: trunk/configure.ac
URL: http://svn.digium.com/view/asterisk/trunk/configure.ac?rev=35607&r1=35606&r2=35607&view=diff
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Thu Jun 22 20:50:55 2006
@@ -367,6 +367,16 @@
 AC_SUBST([pq_LIB])
 AC_SUBST([PBX_LIBpq])
 
+NETSNMP_LIBS=
+PBX_NETSNMP=0
+AC_PATH_TOOL([NET_SNMP_CONFIG], [net-snmp-config], No)
+if test "x${NET_SNMP_CONFIG}" != "xNo" ; then
+   NETSNMP_LIBS=`${NET_SNMP_CONFIG} --agent-libs`
+   PBX_NETSNMP=1
+fi
+AC_SUBST([NETSNMP_LIBS])
+AC_SUBST([PBX_NETSNMP])
+
 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
 AC_SUBST(PBX_H323)
 

Modified: trunk/makeopts.in
URL: http://svn.digium.com/view/asterisk/trunk/makeopts.in?rev=35607&r1=35606&r2=35607&view=diff
==============================================================================
--- trunk/makeopts.in (original)
+++ trunk/makeopts.in Thu Jun 22 20:50:55 2006
@@ -123,3 +123,5 @@
 
 RADIUSCLIENT_LIB=@RADIUSCLIENT_LIB@
 RADIUSCLIENT_INCLUDE=@RADIUSCLIENT_INCLUDE@
+
+NETSNMP_LIBS=@NETSNMP_LIBS@

Modified: trunk/res/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/res/Makefile?rev=35607&r1=35606&r2=35607&view=diff
==============================================================================
--- trunk/res/Makefile (original)
+++ trunk/res/Makefile Thu Jun 22 20:50:55 2006
@@ -21,23 +21,6 @@
 
 ifeq ($(OSARCH),FreeBSD)
   SELECTED_MODS:=$(filter-out $(shell if test ${BSDVERSION} -lt 500000 ; then echo "res_config_odbc"; fi),$(SELECTED_MODS))
-endif
-
-# NETsnmp has some difficulties on some platforms (conflict with unload_module)
-# Until we figure out if the collission is version-specific or what to do
-# we have disabled res_snmp on OS/X and *BSD
-ifeq ($(OSARCH),Darwin)
-  SELECTED_MODS:=$(filter-out res_snmp,$(SELECTED_MODS))
-else
-  ifeq ($(findstring BSD,$(OSARCH)),BSD)
-    SELECTED_MODS:=$(filter-out res_snmp,$(SELECTED_MODS))
-  endif
-endif
-
-ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/net-snmp/net-snmp-config.h),)
-  SELECTED_MODS:=$(filter-out res_snmp,$(SELECTED_MODS))
-else
-  SNMP_LDLIBS+=$(shell net-snmp-config --agent-libs)
 endif
 
 MODS:=$(patsubst %,%.so,$(SELECTED_MODS))
@@ -97,7 +80,7 @@
 	$(CC) -c -o $@ $(CFLAGS) $(ODBC_INCLUDE) $<
 
 res_snmp.so: res_snmp.o snmp/agent.o
-	$(CC) $(SOLINK) $(SNMP_LDFLAGS) -o $@ $< snmp/agent.o $(SNMP_LDLIBS)
+	$(CC) $(SOLINK) -o $@ $< snmp/agent.o $(NETSNMP_LIBS)
 
 res_config_pgsql.so: res_config_pgsql.o
 	$(CC) $(SOLINK) -o $@ $< $(PGSQL_LIB)

Modified: trunk/res/res_snmp.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_snmp.c?rev=35607&r1=35606&r2=35607&view=diff
==============================================================================
--- trunk/res/res_snmp.c (original)
+++ trunk/res/res_snmp.c Thu Jun 22 20:50:55 2006
@@ -15,6 +15,7 @@
  */
 
 /*** MODULEINFO
+	<depend>netsnmp</depend>
 	<defaultenabled>no</defaultenabled>
  ***/
 



More information about the asterisk-commits mailing list