diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 60 |
1 files changed, 36 insertions, 24 deletions
diff --git a/configure.ac b/configure.ac index 4b9b83038..219f85d0c 100644 --- a/configure.ac +++ b/configure.ac @@ -286,6 +286,9 @@ AC_PATH_PROG([PATCH], [patch], :) AC_PATH_PROG([SED], [sed], :) AC_PATH_PROG([NM], [nm], :) +DOWNLOAD=":" +DOWNLOAD_TO_STDOUT= +DOWNLOAD_TIMEOUT= if test "${WGET}" != ":" ; then DOWNLOAD=${WGET} DOWNLOAD_TO_STDOUT="${WGET} -q -O-" @@ -295,13 +298,14 @@ else if test "${CURL}" != ":" ; then DOWNLOAD_TO_STDOUT="${CURL} -Ls" DOWNLOAD_TIMEOUT='--max-time $(or $2,$1)' else - AC_PATH_PROG([FETCH], [fetch], [:]) - DOWNLOAD=${FETCH} - DOWNLOAD_TO_STDOUT="${FETCH} -o-" - DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)' + AC_PATH_PROG([FETCH], [fetch], :) + if test "${FETCH}" != ":" ; then + DOWNLOAD=${FETCH} + DOWNLOAD_TO_STDOUT="${FETCH} -o-" + DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)' + fi fi fi - AC_SUBST(DOWNLOAD) AC_SUBST(DOWNLOAD_TO_STDOUT) AC_SUBST(DOWNLOAD_TIMEOUT) @@ -484,7 +488,6 @@ AST_EXT_LIB_SETUP_OPTIONAL([LIBEDIT_IS_UNICODE], [Libedit compiled for unicode], AST_EXT_LIB_SETUP([LIBXML2], [LibXML2], [libxml2]) AST_EXT_LIB_SETUP([LIBXSLT], [LibXSLT], [libxslt]) AST_EXT_LIB_SETUP_OPTIONAL([LIBXSLT_CLEANUP], [LibXSLT Library Cleanup Function], [LIBXSLT], [libxslt]) -AST_EXT_LIB_SETUP([LTDL], [libtool], [ltdl]) AST_EXT_LIB_SETUP([LUA], [Lua], [lua]) AST_EXT_LIB_SETUP([MISDN], [mISDN user], [misdn]) AST_EXT_LIB_SETUP([MYSQLCLIENT], [MySQL client], [mysqlclient]) @@ -642,12 +645,12 @@ AC_SUBST(EDITLINE_LIB) # * -luuid on Linux # * -le2fs-uuid on OpenBSD # * in libsystem on OS X -AST_EXT_LIB_CHECK([LIBUUID], [uuid], [uuid_generate_random], [uuid/uuid.h], []) +AST_EXT_LIB_CHECK([LIBUUID], [uuid], [uuid_generate_random], [uuid/uuid.h]) if test "x$LIBUUID_LIB" != "x" ; then UUID_INCLUDE="$LIBUUID_INCLUDE" UUID_LIB="$LIBUUID_LIB" else - AST_EXT_LIB_CHECK([E2FSUUID], [e2fs-uuid], [uuid_generate_random], [uuid/uuid.h], []) + AST_EXT_LIB_CHECK([E2FSUUID], [e2fs-uuid], [uuid_generate_random], [uuid/uuid.h]) if test "x$E2FSUUID_LIB" != "x" ; then UUID_INCLUDE="$E2FSUUID_INCLUDE" UUID_LIB="$E2FSUUID_LIB" @@ -672,7 +675,7 @@ if test "${PBX_JANSSON}" != 1; then fi # See if clock_gettime is in librt -AST_EXT_LIB_CHECK([RT], [rt], [clock_gettime]) +AST_EXT_LIB_CHECK([RT], [rt], [clock_gettime], []) AST_EXT_TOOL_CHECK([LIBXML2], [xml2-config], , , [#include <libxml/tree.h> @@ -1460,13 +1463,30 @@ AC_LINK_IFELSE( ) LIBS=${old_LIBS} +# re-check without -ldl +# Non-Linux platforms like FreeBSD and NetBSD do not need a library libdl.so. +if test "${PBX_DLADDR}" = "0"; then + AC_MSG_CHECKING(for dladdr in dlfcn.h without -ldl) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#define _GNU_SOURCE 1 +#include <dlfcn.h>], + [dladdr((void *)0, (void *)0)] + )], + AC_MSG_RESULT(yes) + PBX_DLADDR=1 + AC_SUBST([PBX_DLADDR]) + AC_DEFINE([HAVE_DLADDR], 1, [Define to 1 if your system has the dladdr() GNU extension]), + AC_MSG_RESULT(no) + ) +fi + # PKGCONFIG is used in later tests PKG_PROG_PKG_CONFIG() # do the package library checks now -AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl]) +AST_EXT_LIB_CHECK([ALSA], [asound], [snd_pcm_open], [alsa/asoundlib.h]) AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h]) # Fedora/RedHat/CentOS require extra libraries @@ -2133,9 +2153,6 @@ AST_EXT_LIB_CHECK([KQUEUE], [c], [kqueue], [sys/event.h]) # 64-bit version of kevent (from kqueue) on OS X AC_CHECK_FUNCS([kevent64]) -# Needed by unixodbc -AST_EXT_LIB_CHECK([LTDL], [ltdl], [lt_dlinit], [ltdl.h], []) - AST_EXT_LIB_CHECK([LDAP], [ldap], [ldap_initialize], [ldap.h]) AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h]) @@ -2176,12 +2193,12 @@ AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h]) # script bug which does not find the ldns library. The bug is fixed in # v1.4.22 but that version is not easily detectable. # -AST_EXT_LIB_CHECK([UNBOUND], [unbound], [ub_ctx_delete], [unbound.h], []) +AST_EXT_LIB_CHECK([UNBOUND], [unbound], [ub_ctx_delete], [unbound.h]) AST_C_DECLARE_CHECK([UNBOUND_CONST_PARAMS], [UNBOUND_VERSION_MAJOR], [unbound.h]) -AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], []) +AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h]) -AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], []) +AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_stream_init], [ogg/ogg.h]) # Non-glibc platforms require libexecinfo for backtrace support AST_EXT_LIB_CHECK([BKTR], [execinfo], [backtrace], [execinfo.h]) @@ -2260,7 +2277,7 @@ if test "$USE_PJPROJECT" != "no" ; then if test "$PJPROJECT_BUNDLED" = "no" ; then AST_PKG_CONFIG_CHECK([PJPROJECT], [libpjproject]) - AST_EXT_LIB_CHECK([PJSIP_DLG_CREATE_UAS_AND_INC_LOCK], [pjsip], [pjsip_dlg_create_uas_and_inc_lock], [pjsip.h], [$PJPROJECT_LIBS], [$PJPROJECT_CFLAGS]) + AST_EXT_LIB_CHECK([PJSIP_DLG_CREATE_UAS_AND_INC_LOCK], [pjsip], [pjsip_dlg_create_uas_and_inc_lock], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS]) AST_EXT_LIB_CHECK([PJ_TRANSACTION_GRP_LOCK], [pjsip], [pjsip_tsx_create_uac2], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS]) saved_cppflags="${CPPFLAGS}" @@ -2273,7 +2290,7 @@ if test "$USE_PJPROJECT" != "no" ; then AST_EXT_LIB_CHECK([PJSIP_GET_DEST_INFO], [pjsip], [pjsip_get_dest_info], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS]) AST_EXT_LIB_CHECK([PJ_SSL_CERT_LOAD_FROM_FILES2], [pj], [pj_ssl_cert_load_from_files2], [pjlib.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS]) - AST_EXT_LIB_CHECK([PJSIP_EXTERNAL_RESOLVER], [pjsip], [pjsip_endpt_set_ext_resolver], [pjsip.h], [$PJPROJECT_LIBS], [$PJPROJECT_CFLAGS]) + AST_EXT_LIB_CHECK([PJSIP_EXTERNAL_RESOLVER], [pjsip], [pjsip_endpt_set_ext_resolver], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS]) saved_cppflags="${CPPFLAGS}" saved_libs="${LIBS}" @@ -2567,12 +2584,7 @@ fi AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [dahdi/tonezone.h], [${tonezone_extra} ${DAHDI_INCLUDE}]) -if test "${OSARCH}" = "OpenBSD"; -then - AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc -lvorbisfile -logg]) -else - AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc -lvorbisfile]) -fi +AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc -lvorbisfile]) AST_C_DECLARE_CHECK([VORBIS_OPEN_CALLBACKS], [OV_CALLBACKS_NOCLOSE], [vorbis/vorbisfile.h]) AC_LANG_PUSH(C++) |