Using a dummy channel causes CDR() testing to fail.
[asterisk/asterisk.git] / configure.ac
index e325c32..ea0e3eb 100644 (file)
@@ -183,6 +183,8 @@ if test "x$with_gnu_ld" = "xyes" ; then
 fi
 AC_SUBST(GNU_LD)
 
+AC_PATH_PROG([BISON], [bison], :)
+AC_PATH_PROG([FLEX], [flex], :)
 AC_PATH_PROG([GREP], [grep], :)
 AC_PATH_PROG([FIND], [find], :)
 AC_PATH_PROG([COMPRESS], [compress], :)
@@ -208,6 +210,49 @@ fi
 fi
 AC_SUBST(DOWNLOAD)
 
+AC_CACHE_CHECK([for bison that supports parse-param], [ac_cv_path_BISON2], [
+       if test "x$BISON" != "x:" ; then
+               # Create a temporary directory $tmp in $TMPDIR (default /tmp).
+               # Use mktemp if possible; otherwise fall back on mkdir,
+               # with $RANDOM to make collisions less likely.
+               : ${TMPDIR=/tmp}
+               {
+                 tmp=`
+                   (umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null
+                 ` &&
+                 test -n "$tmp" && test -d "$tmp"
+               } || {
+                 tmp=$TMPDIR/foo$$-$RANDOM
+                 (umask 077 && mkdir "$tmp")
+               } || exit $?
+               cat >$tmp/test.y <<__EOL__
+%parse-param {struct parse_io *parseio}
+%%
+file : { \$\$ = parseio->pval = 1; }
+       ;
+%%
+__EOL__
+               ${BISON} -o ${tmp}/test.tab.c ${tmp}/test.y >/dev/null 2>&1
+               if test -e "${tmp}/test.tab.c"; then
+                       ac_cv_path_BISON2=${BISON}
+               fi
+               rm -rf ${tmp}
+       fi
+       ])
+if test "x${ac_cv_path_BISON2}" = "x" ; then
+       BISON=:
+       PBX_BISON=0
+else
+       PBX_BISON=1
+fi
+AC_SUBST(PBX_BISON)
+if test "x${FLEX}" = "x:" ; then
+       PBX_FLEX=0
+else
+       PBX_FLEX=1
+fi
+AC_SUBST(PBX_FLEX)
+
 AC_CHECK_TOOL([SOXMIX], [soxmix], [:])
 if test "${SOXMIX}" != ":" ; then
        AC_DEFINE([HAVE_SOXMIX], 1, [Define to 1 if your system has soxmix application.])
@@ -533,8 +578,9 @@ saved_CFLAGS="${CFLAGS}"
 CFLAGS="${CFLAGS} -Werror -Wmissing-braces"
 AC_COMPILE_IFELSE(
   [AC_LANG_PROGRAM(
-    [#include <pthread.h>],
-       [pthread_once_t once = PTHREAD_ONCE_INIT;])
+    [#include <pthread.h>
+     void empty(){}],
+       [pthread_once_t once = PTHREAD_ONCE_INIT; pthread_once(&once, empty);])
   ],[
     AC_MSG_RESULT(no)
     ac_cv_pthread_once_needsbraces="no"
@@ -1608,7 +1654,7 @@ fi
 
 if test "$PBX_OPENSSL" = "1";
 then
-    AST_CHECK_OSPTK([3], [5], [0])
+    AST_CHECK_OSPTK([3], [6], [0])
 fi
 
 AST_EXT_TOOL_CHECK([GMIME], [gmime-config], [], [], [#include <gmime/gmime.h>], [gboolean q = g_mime_check_version(0,0,0);])