match the change made to AST_EXT_LIB in asterisk-addons
[asterisk/asterisk.git] / configure.ac
index 85e8ec8..237a137 100644 (file)
@@ -224,7 +224,7 @@ if test "${USE_GSM}" != "no"; then
    if test "${GSM_SYSTEM}" = "yes"; then
       gsmlibdir=""
       if test "x${GSM_DIR}" != "x"; then
-         gsmlibdir="-L${GSM_DIR}/lib"
+         gsmlibdir="-L${GSM_DIR} -L${GSM_DIR}/lib"
       fi
       AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
       [Define to indicate the GSM library]), [], ${gsmlibdir})
@@ -276,7 +276,7 @@ PBX_KDE=0
 if test "${USE_KDE}" != "no"; then
    echo -n "checking for crashHandler in -lkdecore... "
    saved_ldflags="${LDFLAGS}"
-   LDFLAGS="-I${KDE_DIR}/include ${LDFLAGS} -L${KDE_DIR}/lib -lkdecore"
+   LDFLAGS="-I${KDE_DIR}/include ${LDFLAGS} -L${KDE_DIR} -L${KDE_DIR}/lib -lkdecore"
        AC_LINK_IFELSE(
        [
                AC_LANG_PROGRAM(
@@ -295,13 +295,13 @@ if test "${USE_KDE}" != "no"; then
        fi
        
        if test "${ac_cv_lib_kde_crash}" = "yes"; then
-               KDE_LIBS="-lkdecore -lkdeui"
+               KDE_LIB="-lkdecore -lkdeui"
                if test "${KDE_DIR}" != ""; then
-                       KDE_LIBS="-L${KDE_DIR}/lib ${KDE_LIBS}"
+                       KDE_LIB="-L${KDE_DIR} -L${KDE_DIR}/lib ${KDE_LIB}"
                        KDE_INCLUDE="-I${KDE_DIR}/include"
                        AC_SUBST([KDE_INCLUDE])
                fi
-               AC_SUBST([KDE_LIBS])
+               AC_SUBST([KDE_LIB])
                PBX_KDE=1
                AC_DEFINE([HAVE_LIBKDE], 1, [Define if your system has the KDE library])
    elif test ! -z "${KDE_MANDATORY}"; 
@@ -635,6 +635,22 @@ AST_EXT_LIB([speex], [speex_encode], [speex/speex.h], [SPEEX], [Speex], [-lm])
 AST_EXT_LIB([sqlite], [sqlite_exec], [sqlite.h], [SQLITE], [SQLite])
 AST_EXT_LIB([ssl], [ssl2_connect], [openssl/ssl.h], [OPENSSL], [OpenSSL], [-lcrypto])
 AST_EXT_LIB([tds], [tds_version], [tds.h], [FREETDS], [FreeTDS])
+
+if test "${PBX_LIBFREETDS}" != "0";
+then
+    case `grep TDS_VERSION_NO ${FREETDS_DIR:-/usr/include}/tdsver.h` in
+    *0.63*)
+        FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_63"
+       ;;
+    *0.62*)
+        FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_0_62"
+       ;;
+    *)
+        FREETDS_INCLUDE="${FREETDS_INCLUDE} -DFREETDS_PRE_0_62"
+       ;;
+    esac
+fi
+
 AST_EXT_LIB([termcap], [tgetent], [], [TERMCAP], [Termcap])
 AST_EXT_LIB([tinfo], [tgetent], [], [TINFO], [Term Info])
 
@@ -667,7 +683,7 @@ if test "${USE_VPB}" != "no"; then
    saved_libs="${LIBS}"
    saved_cppflags="${CPPFLAGS}"
    if test "x${VPB_DIR}" != "x"; then
-      LIBS="${LIBS} -L${VPB_DIR}/lib"
+      LIBS="${LIBS} -L${VPB_DIR} -L${VPB_DIR}/lib"
       CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
    fi
    LIBS="${LIBS} -lvpb -lpthread"
@@ -690,7 +706,7 @@ if test "${USE_VPB}" != "no"; then
    if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
        VPB_LIB="-lvpb"
        if test "${VPB_DIR}" != ""; then
-          VPB_LIB="-L${VPB_DIR}/lib ${VPB_LIB}"
+          VPB_LIB="-L${VPB_DIR} -L${VPB_DIR}/lib ${VPB_LIB}"
           VPB_INCLUDE="-I${VPB_DIR}/include"
           AC_SUBST([VPB_INCLUDE])
        fi
@@ -767,20 +783,20 @@ fi
 
 AC_SUBST([PBX_ZAPTEL])
 
-EDITLINE_LIBS=""
+EDITLINE_LIB=""
 if test "x$TERMCAP_LIB" != "x" ; then
-  EDITLINE_LIBS="$TERMCAP_LIB"
+  EDITLINE_LIB="$TERMCAP_LIB"
 elif test "x$TINFO_LIB" != "x" ; then
-  EDITLINE_LIBS="$TINFO_LIB"
+  EDITLINE_LIB="$TINFO_LIB"
 elif test "x$CURSES_LIB" != "x" ; then
-  EDITLINE_LIBS="$CURSES_LIB"
+  EDITLINE_LIB="$CURSES_LIB"
 elif test "x$NCURSES_LIB" != "x" ; then
-  EDITLINE_LIBS="$NCURSES_LIB"
+  EDITLINE_LIB="$NCURSES_LIB"
 else
   echo "*** termcap support not found"
   exit 1
 fi
-AC_SUBST(EDITLINE_LIBS)
+AC_SUBST(EDITLINE_LIB)
 
 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
 AC_SUBST(PBX_H323)
@@ -797,24 +813,24 @@ PBX_GTK=0
 AC_CHECK_TOOL(GTKCONFIG, gtk-config, No)
 if test ! "x${GTKCONFIG}" = xNo; then
    GTK_INCLUDE=$(${GTKCONFIG} --cflags gthread)
-   GTK_LIBS=$(${GTKCONFIG} --libs 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_LIBS)
+AC_SUBST(GTK_LIB)
 
 PBX_CURL=0
 AC_PATH_TOOL([CURL], [curl-config], No)
 if test ! x"${CURL}" = xNo; then
 # check for version
-   CURLLIBS=$(${CURL} --libs)
+   CURLLIB=$(${CURL} --libs)
    PBX_CURL=1
    AC_DEFINE([HAVE_CURL], 1, [Define if your system has the curl libraries.])
 fi
 AC_SUBST(PBX_CURL)
-AC_SUBST(CURLLIBS)
+AC_SUBST(CURLLIB)
 
 AC_FUNC_ALLOCA
 AC_HEADER_DIRENT
@@ -871,6 +887,11 @@ AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides at
 AC_MSG_RESULT(no)
 )
 
+AC_CHECK_HEADER([libkern/OSAtomic.h],
+                [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
+
+AC_CHECK_SIZEOF(int)
+
 AC_CONFIG_FILES([build_tools/menuselect-deps makeopts])
 AC_OUTPUT