Skip to content
Snippets Groups Projects
Commit ea8af9b9 authored by Luigi Rizzo's avatar Luigi Rizzo
Browse files

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).




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93898 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 1d6b192c
No related branches found
No related tags found
No related merge requests found
......@@ -173,16 +173,19 @@ fi
# 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], [symbol], [version])
# 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
......
This diff is collapsed.
......@@ -183,7 +183,13 @@ AC_ARG_ENABLE(dev-mode,
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([CURL], [cURL], [curl])
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([NBS], [nbs], [nbs_connect], [nbs.h])
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 @@ AC_CHECK_HEADER([linux/videodev.h],
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)
......
......@@ -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 */
......
......@@ -110,6 +110,7 @@ NCURSES_INCLUDE=@NCURSES_INCLUDE@
NCURSES_LIB=@NCURSES_LIB@
NCURSES_DIR=@NCURSES_DIR@
NETSNMP_INCLUDE=@NETSNMP_INCLUDE@
NETSNMP_LIB=@NETSNMP_LIB@
NEWT_INCLUDE=@NEWT_INCLUDE@
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment