Skip to content
Snippets Groups Projects
configure 940 KiB
Newer Older
  • Learn to ignore specific revisions
  • { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
    $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
    ac_tool_warned=yes ;;
    esac
        PKG_CONFIG=$ac_pt_PKG_CONFIG
      fi
    else
      PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
    fi
    
    fi
    if test -n "$PKG_CONFIG"; then
    	_pkg_min_version=0.9.0
    	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
    $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
    	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
    		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    $as_echo "yes" >&6; }
    	else
    		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    $as_echo "no" >&6; }
    		PKG_CONFIG=""
    	fi
    fi
    
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bison that supports parse-param" >&5
    
    $as_echo_n "checking for bison that supports parse-param... " >&6; }
    
    David M. Lee's avatar
    David M. Lee committed
    if ${ac_cv_path_BISON2+:} false; then :
    
      $as_echo_n "(cached) " >&6
    
    else
    
    	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
    
    fi
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_BISON2" >&5
    
    $as_echo "$ac_cv_path_BISON2" >&6; }
    
    if test "x${ac_cv_path_BISON2}" = "x" ; then
    	BISON=:
    	PBX_BISON=0
    else
    	PBX_BISON=1
    fi
    
    
    if test "${XMLSTARLET}" = ":"; then
    
    if test "${BASH}" = ":"; then
    
    if test -n "$ac_tool_prefix"; then
      # Extract the first word of "${ac_tool_prefix}soxmix", so it can be a program name with args.
    set dummy ${ac_tool_prefix}soxmix; ac_word=$2
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    
    $as_echo_n "checking for $ac_word... " >&6; }
    
    David M. Lee's avatar
    David M. Lee committed
    if ${ac_cv_prog_SOXMIX+:} false; then :
    
      $as_echo_n "(cached) " >&6
    
    else
      if test -n "$SOXMIX"; then
      ac_cv_prog_SOXMIX="$SOXMIX" # Let the user override the test.
    else
    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
    
    David M. Lee's avatar
    David M. Lee committed
      if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    
        ac_cv_prog_SOXMIX="${ac_tool_prefix}soxmix"
    
        $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
    
    IFS=$as_save_IFS
    
    fi
    fi
    SOXMIX=$ac_cv_prog_SOXMIX
    if test -n "$SOXMIX"; then
    
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOXMIX" >&5
    
    $as_echo "$SOXMIX" >&6; }
    
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    
    $as_echo "no" >&6; }
    
    fi
    
    
    fi
    if test -z "$ac_cv_prog_SOXMIX"; then
      ac_ct_SOXMIX=$SOXMIX
      # Extract the first word of "soxmix", so it can be a program name with args.
    set dummy soxmix; ac_word=$2
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    
    $as_echo_n "checking for $ac_word... " >&6; }
    
    David M. Lee's avatar
    David M. Lee committed
    if ${ac_cv_prog_ac_ct_SOXMIX+:} false; then :
    
      $as_echo_n "(cached) " >&6
    
    else
      if test -n "$ac_ct_SOXMIX"; then
      ac_cv_prog_ac_ct_SOXMIX="$ac_ct_SOXMIX" # Let the user override the test.
    else
    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
    
    David M. Lee's avatar
    David M. Lee committed
      if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    
        ac_cv_prog_ac_ct_SOXMIX="soxmix"
    
        $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
    
    IFS=$as_save_IFS
    
    fi
    fi
    ac_ct_SOXMIX=$ac_cv_prog_ac_ct_SOXMIX
    if test -n "$ac_ct_SOXMIX"; then
    
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_SOXMIX" >&5
    
    $as_echo "$ac_ct_SOXMIX" >&6; }
    
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    
    $as_echo "no" >&6; }
    
    fi
    
      if test "x$ac_ct_SOXMIX" = x; then
        SOXMIX=":"
      else
        case $cross_compiling:$ac_tool_warned in
    yes:)
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
    
    $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
    
    ac_tool_warned=yes ;;
    esac
        SOXMIX=$ac_ct_SOXMIX
      fi
    else
      SOXMIX="$ac_cv_prog_SOXMIX"
    fi
    
    
    if test "x${SOXMIX}" != "x:"; then
    
    $as_echo "#define HAVE_SOXMIX 1" >>confdefs.h
    
    
    fi
    
    for ac_prog in md5 md5sum gmd5sum digest
    do
      # Extract the first word of "$ac_prog", so it can be a program name with args.
    set dummy $ac_prog; ac_word=$2
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    
    $as_echo_n "checking for $ac_word... " >&6; }
    
    David M. Lee's avatar
    David M. Lee committed
    if ${ac_cv_prog_MD5+:} false; then :
    
      $as_echo_n "(cached) " >&6
    
    else
      if test -n "$MD5"; then
      ac_cv_prog_MD5="$MD5" # Let the user override the test.
    else
    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
    
    David M. Lee's avatar
    David M. Lee committed
      if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    
        ac_cv_prog_MD5="$ac_prog"
    
        $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
    
    IFS=$as_save_IFS
    
    fi
    fi
    MD5=$ac_cv_prog_MD5
    if test -n "$MD5"; then
    
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MD5" >&5
    
    $as_echo "$MD5" >&6; }
    
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    
    $as_echo "no" >&6; }
    
    fi
    
    
      test -n "$MD5" && break
    done
    
    
    if test "${MD5}" = "digest" ; then
       MD5="${MD5} -a md5"
    fi
    
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
    $as_echo_n "checking for a sed that does not truncate output... " >&6; }
    if ${ac_cv_path_SED+:} false; then :
      $as_echo_n "(cached) " >&6
    else
                ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
         for ac_i in 1 2 3 4 5 6 7; do
           ac_script="$ac_script$as_nl$ac_script"
         done
         echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
         { ac_script=; unset ac_script;}
         if test -z "$SED"; then
      ac_path_SED_found=false
      # Loop through the user's path and test for each of PROGNAME-LIST
      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_prog in sed gsed; do
        for ac_exec_ext in '' $ac_executable_extensions; do
          ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
          as_fn_executable_p "$ac_path_SED" || continue
    # Check for GNU ac_path_SED and select it if it is found.
      # Check for GNU $ac_path_SED
    case `"$ac_path_SED" --version 2>&1` in
    *GNU*)
      ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
    *)
      ac_count=0
      $as_echo_n 0123456789 >"conftest.in"
      while :
      do
        cat "conftest.in" "conftest.in" >"conftest.tmp"
        mv "conftest.tmp" "conftest.in"
        cp "conftest.in" "conftest.nl"
        $as_echo '' >> "conftest.nl"
        "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
        diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
        as_fn_arith $ac_count + 1 && ac_count=$as_val
        if test $ac_count -gt ${ac_path_SED_max-0}; then
          # Best one so far, save it but keep looking for a better one
          ac_cv_path_SED="$ac_path_SED"
          ac_path_SED_max=$ac_count
        fi
        # 10*(2^10) chars as input seems more than enough
        test $ac_count -gt 10 && break
      done
      rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
    esac
    
          $ac_path_SED_found && break 3
        done
      done
      done
    IFS=$as_save_IFS
      if test -z "$ac_cv_path_SED"; then
        as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
      fi
    else
      ac_cv_path_SED=$SED
    fi
    
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
    $as_echo "$ac_cv_path_SED" >&6; }
     SED="$ac_cv_path_SED"
      rm -f conftest.sed
    
    
    
    
    
    
    ac_ext=c
    ac_cpp='$CPP $CPPFLAGS'
    ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    ac_compiler_gnu=$ac_cv_c_compiler_gnu
    
    
    
    # We used to check for pthread.h first, but this fails if pthread.h
    
    # requires special compiler flags (e.g. on Tru64 or Sequent).
    
    # It gets checked for in the link test anyway.
    
    # First of all, check if the user has set any of the PTHREAD_LIBS,
    # etcetera environment variables, and if threads linking works using
    # them:
    
    if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
            ax_pthread_save_CC="$CC"
            ax_pthread_save_CFLAGS="$CFLAGS"
            ax_pthread_save_LIBS="$LIBS"
            if test "x$PTHREAD_CC" != "x"; then :
      CC="$PTHREAD_CC"
    fi
    
            CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
            LIBS="$PTHREAD_LIBS $LIBS"
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5
    $as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; }
    
            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    
    /* end confdefs.h.  */
    
    /* Override any GCC internal prototype to avoid an error.
       Use char because int might match the return type of a GCC
       builtin and then its argument prototype would still apply.  */
    #ifdef __cplusplus
    extern "C"
    #endif
    char pthread_join ();
    int
    main ()
    {
    return pthread_join ();
      ;
      return 0;
    }
    _ACEOF
    
    if ac_fn_c_try_link "$LINENO"; then :
    
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
    $as_echo "$ax_pthread_ok" >&6; }
            if test "x$ax_pthread_ok" = "xno"; then
    
                    PTHREAD_LIBS=""
                    PTHREAD_CFLAGS=""
            fi
    
            CC="$ax_pthread_save_CC"
            CFLAGS="$ax_pthread_save_CFLAGS"
            LIBS="$ax_pthread_save_LIBS"
    
    fi
    
    # We must check for the threads library under a number of different
    # names; the ordering is very important because some systems
    # (e.g. DEC) have both -lpthread and -lpthreads, where one of the
    # libraries is broken (non-POSIX).
    
    # Create a list of thread flags to try.  Items starting with a "-" are
    # C compiler flags, and other items are library names, except for "none"
    # which indicates that we try without any flags at all, and "pthread-config"
    # which is a program returning the flags for the Pth emulation library.
    
    
    ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
    
    
    # The ordering *is* (sometimes) important.  Some notes on the
    # individual items follow:
    
    # pthreads: AIX (must check this before -lpthread)
    # none: in case threads are in libc; should be tried before -Kthread and
    #       other compiler flags to prevent continual compiler warnings
    # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
    
    # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
    #           (Note: HP C rejects this with "bad form for `-t' option")
    # -pthreads: Solaris/gcc (Note: HP C also rejects)
    
    # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
    
    #      doesn't hurt to check since this sometimes defines pthreads and
    #      -D_REENTRANT too), HP C (must be checked before -lpthread, which
    #      is present but should not be used directly; and before -mthreads,
    #      because the compiler interprets this as "-mt" + "-hreads")
    # -mthreads: Mingw32/gcc, Lynx/gcc
    
    # pthread: Linux, etcetera
    # --thread-safe: KAI C++
    # pthread-config: use pthread-config program (for GNU Pth library)
    
    
    case $host_os in
    
            freebsd*)
    
            # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
            # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
    
            ax_pthread_flags="-kthread lthread $ax_pthread_flags"
            ;;
    
            hpux*)
    
            # From the cc(1) man page: "[-mt] Sets various -D flags to enable
            # multi-threading and also sets -lpthread."
    
            ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
            ;;
    
            openedition*)
    
            # IBM z/OS requires a feature-test macro to be defined in order to
            # enable POSIX threads at all, so give the user a hint if this is
            # not set. (We don't define these ourselves, as they can affect
            # other portions of the system API in unpredictable ways.)
    
            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    /* end confdefs.h.  */
    
    #            if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
                 AX_PTHREAD_ZOS_MISSING
    #            endif
    
    _ACEOF
    if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
      $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then :
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5
    $as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;}
    fi
    rm -f conftest*
    
            ;;
    
            solaris*)
    
    
            # On Solaris (at least, for some versions), libc contains stubbed
            # (non-functional) versions of the pthreads routines, so link-based
    
            # tests will erroneously succeed. (N.B.: The stubs are missing
            # pthread_cleanup_push, or rather a function called by this macro,
            # so we could check for that, but who knows whether they'll stub
            # that too in a future libc.)  So we'll check first for the
            # standard Solaris way of linking pthreads (-mt -lpthread).
    
            ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
    
    # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
    
    if test "x$GCC" = "xyes"; then :
      ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"
    fi
    
    # The presence of a feature test macro requesting re-entrant function
    # definitions is, on some systems, a strong hint that pthreads support is
    # correctly enabled
    
    case $host_os in
            darwin* | hpux* | linux* | osf* | solaris*)
            ax_pthread_check_macro="_REENTRANT"
            ;;
    
            aix*)
            ax_pthread_check_macro="_THREAD_SAFE"
            ;;
    
            *)
            ax_pthread_check_macro="--"
            ;;
    esac
    if test "x$ax_pthread_check_macro" = "x--"; then :
      ax_pthread_check_cond=0
    else
      ax_pthread_check_cond="!defined($ax_pthread_check_macro)"
    fi
    
    # Are we compiling with Clang?
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5
    $as_echo_n "checking whether $CC is Clang... " >&6; }
    if ${ax_cv_PTHREAD_CLANG+:} false; then :
      $as_echo_n "(cached) " >&6
    else
      ax_cv_PTHREAD_CLANG=no
         # Note that Autoconf sets GCC=yes for Clang as well as GCC
         if test "x$GCC" = "xyes"; then
            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    /* end confdefs.h.  */
    /* Note: Clang 2.7 lacks __clang_[a-z]+__ */
    #            if defined(__clang__) && defined(__llvm__)
                 AX_PTHREAD_CC_IS_CLANG
    #            endif
    
    _ACEOF
    if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
      $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1; then :
      ax_cv_PTHREAD_CLANG=yes
    fi
    rm -f conftest*
    
         fi
    
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5
    $as_echo "$ax_cv_PTHREAD_CLANG" >&6; }
    ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
    
    ax_pthread_clang_warning=no
    
    # Clang needs special handling, because older versions handle the -pthread
    # option in a rather... idiosyncratic way
    
    if test "x$ax_pthread_clang" = "xyes"; then
    
            # Clang takes -pthread; it has never supported any other flag
    
            # (Note 1: This will need to be revisited if a system that Clang
            # supports has POSIX threads in a separate library.  This tends not
            # to be the way of modern systems, but it's conceivable.)
    
            # (Note 2: On some systems, notably Darwin, -pthread is not needed
            # to get POSIX threads support; the API is always present and
            # active.  We could reasonably leave PTHREAD_CFLAGS empty.  But
            # -pthread does define _REENTRANT, and while the Darwin headers
            # ignore this macro, third-party headers might not.)
    
            PTHREAD_CFLAGS="-pthread"
            PTHREAD_LIBS=
    
            ax_pthread_ok=yes
    
            # However, older versions of Clang make a point of warning the user
            # that, in an invocation where only linking and no compilation is
            # taking place, the -pthread option has no effect ("argument unused
            # during compilation").  They expect -pthread to be passed in only
            # when source code is being compiled.
            #
            # Problem is, this is at odds with the way Automake and most other
            # C build frameworks function, which is that the same flags used in
            # compilation (CFLAGS) are also used in linking.  Many systems
            # supported by AX_PTHREAD require exactly this for POSIX threads
            # support, and in fact it is often not straightforward to specify a
            # flag that is used only in the compilation phase and not in
            # linking.  Such a scenario is extremely rare in practice.
            #
            # Even though use of the -pthread flag in linking would only print
            # a warning, this can be a nuisance for well-run software projects
            # that build with -Werror.  So if the active version of Clang has
            # this misfeature, we search for an option to squash it.
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5
    $as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; }
    if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then :
      $as_echo_n "(cached) " >&6
    else
      ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
                 # Create an alternate version of $ac_link that compiles and
                 # links in two steps (.c -> .o, .o -> exe) instead of one
                 # (.c -> exe), because the warning occurs only in the second
                 # step
                 ax_pthread_save_ac_link="$ac_link"
                 ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
                 ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
                 ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
                 ax_pthread_save_CFLAGS="$CFLAGS"
                 for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
                    if test "x$ax_pthread_try" = "xunknown"; then :
      break
    fi
                    CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
                    ac_link="$ax_pthread_save_ac_link"
                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    /* end confdefs.h.  */
    int main(void){return 0;}
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
      ac_link="$ax_pthread_2step_ac_link"
                         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    /* end confdefs.h.  */
    int main(void){return 0;}
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
      break
    fi
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    
    fi
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
                 done
                 ac_link="$ax_pthread_save_ac_link"
                 CFLAGS="$ax_pthread_save_CFLAGS"
                 if test "x$ax_pthread_try" = "x"; then :
      ax_pthread_try=no
    fi
                 ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
    
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5
    $as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; }
    
            case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
                    no | unknown) ;;
                    *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
            esac
    
    fi # $ax_pthread_clang = yes
    
    if test "x$ax_pthread_ok" = "xno"; then
    for ax_pthread_try_flag in $ax_pthread_flags; do
    
            case $ax_pthread_try_flag in
    
                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
    
    $as_echo_n "checking whether pthreads work without any flags... " >&6; }
    
                    -mt,pthread)
                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5
    $as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; }
                    PTHREAD_CFLAGS="-mt"
                    PTHREAD_LIBS="-lpthread"
                    ;;
    
    
                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5
    $as_echo_n "checking whether pthreads work with $ax_pthread_try_flag... " >&6; }
                    PTHREAD_CFLAGS="$ax_pthread_try_flag"
    
                    pthread-config)
                    # Extract the first word of "pthread-config", so it can be a program name with args.
    
    set dummy pthread-config; ac_word=$2
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    
    $as_echo_n "checking for $ac_word... " >&6; }
    
    if ${ac_cv_prog_ax_pthread_config+:} false; then :
    
      $as_echo_n "(cached) " >&6
    
      if test -n "$ax_pthread_config"; then
      ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
    
    else
    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
    
    David M. Lee's avatar
    David M. Lee committed
      if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    
        ac_cv_prog_ax_pthread_config="yes"
    
        $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
    
      test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
    
    ax_pthread_config=$ac_cv_prog_ax_pthread_config
    if test -n "$ax_pthread_config"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
    $as_echo "$ax_pthread_config" >&6; }
    
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    
    $as_echo "no" >&6; }
    
                    if test "x$ax_pthread_config" = "xno"; then :
      continue
    fi
                    PTHREAD_CFLAGS="`pthread-config --cflags`"
                    PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
                    ;;
    
                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5
    $as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; }
                    PTHREAD_LIBS="-l$ax_pthread_try_flag"
    
            ax_pthread_save_CFLAGS="$CFLAGS"
            ax_pthread_save_LIBS="$LIBS"
    
            CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
    
    
            # Check for various functions.  We must include pthread.h,
            # since some functions may be macros.  (On the Sequent, we
            # need a special flag -Kthread to make this header compile.)
            # We check for pthread_join because it is in -lpthread on IRIX
            # while pthread_create is in libc.  We check for pthread_attr_init
            # due to DEC craziness with -lpthreads.  We check for
            # pthread_cleanup_push because it is one of the few pthread
            # functions on Solaris that doesn't have a non-functional libc stub.
            # We try pthread_create on general principles.
    
            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    
    /* end confdefs.h.  */
    #include <pthread.h>
    
    #                       if $ax_pthread_check_cond
    #                        error "$ax_pthread_check_macro must be defined"
    #                       endif
                            static void routine(void *a) { a = 0; }
                            static void *start_routine(void *a) { return a; }
    
    pthread_t th; pthread_attr_t attr;
                            pthread_create(&th, 0, start_routine, 0);
                            pthread_join(th, 0);
                            pthread_attr_init(&attr);
                            pthread_cleanup_push(routine, 0);
                            pthread_cleanup_pop(0) /* ; */
    
    if ac_fn_c_try_link "$LINENO"; then :
    
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    
            CFLAGS="$ax_pthread_save_CFLAGS"
            LIBS="$ax_pthread_save_LIBS"
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
    $as_echo "$ax_pthread_ok" >&6; }
            if test "x$ax_pthread_ok" = "xyes"; then :
      break
    fi
    
    
            PTHREAD_LIBS=""
            PTHREAD_CFLAGS=""
    done
    fi
    
    # Various other checks:
    
    if test "x$ax_pthread_ok" = "xyes"; then
            ax_pthread_save_CFLAGS="$CFLAGS"
            ax_pthread_save_LIBS="$LIBS"
    
            CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
    
    
            # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
    
    $as_echo_n "checking for joinable pthread attribute... " >&6; }
    
    if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then :
      $as_echo_n "(cached) " >&6
    else
      ax_cv_PTHREAD_JOINABLE_ATTR=unknown
                 for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
                     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    
    /* end confdefs.h.  */
    #include <pthread.h>
    int
    main ()
    {
    
    int attr = $ax_pthread_attr; return attr /* ; */
    
    if ac_fn_c_try_link "$LINENO"; then :
    
      ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break
    
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    
                 done
    
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5
    $as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; }
            if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
                   test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
                   test "x$ax_pthread_joinable_attr_defined" != "xyes"; then :
    
    
    cat >>confdefs.h <<_ACEOF
    
    #define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR
    
                   ax_pthread_joinable_attr_defined=yes
    
    fi
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5
    $as_echo_n "checking whether more special flags are required for pthreads... " >&6; }
    if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then :
      $as_echo_n "(cached) " >&6
    else
      ax_cv_PTHREAD_SPECIAL_FLAGS=no
                 case $host_os in
                 solaris*)
                 ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
                 ;;
                 esac
    
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5
    $as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; }
            if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
                   test "x$ax_pthread_special_flags_added" != "xyes"; then :
      PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
                   ax_pthread_special_flags_added=yes
    fi
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5
    $as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; }
    if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then :
      $as_echo_n "(cached) " >&6
    else
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    /* end confdefs.h.  */
    #include <pthread.h>
    int
    main ()
    {
    int i = PTHREAD_PRIO_INHERIT;
      ;
      return 0;
    }
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
      ax_cv_PTHREAD_PRIO_INHERIT=yes
    else
      ax_cv_PTHREAD_PRIO_INHERIT=no
    fi
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5
    $as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; }
            if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
                   test "x$ax_pthread_prio_inherit_defined" != "xyes"; then :
    
    $as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h
    
                   ax_pthread_prio_inherit_defined=yes
    
    fi
    
            CFLAGS="$ax_pthread_save_CFLAGS"
            LIBS="$ax_pthread_save_LIBS"
    
            # More AIX lossage: compile with *_r variant
            if test "x$GCC" != "xyes"; then
                case $host_os in
                    aix*)
                    case "x/$CC" in #(
      x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) :
        #handle absolute path differently from PATH based program lookup
                         case "x$CC" in #(
      x/*) :
        if as_fn_executable_p ${CC}_r; then :
      PTHREAD_CC="${CC}_r"
    fi ;; #(
      *) :
        for ac_prog in ${CC}_r
    
    do
      # Extract the first word of "$ac_prog", so it can be a program name with args.
    set dummy $ac_prog; ac_word=$2
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    
    $as_echo_n "checking for $ac_word... " >&6; }
    
    David M. Lee's avatar
    David M. Lee committed
    if ${ac_cv_prog_PTHREAD_CC+:} false; then :
    
      $as_echo_n "(cached) " >&6
    
    else
      if test -n "$PTHREAD_CC"; then
      ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
    else
    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
    
    David M. Lee's avatar
    David M. Lee committed
      if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    
        ac_cv_prog_PTHREAD_CC="$ac_prog"
    
        $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
    
    IFS=$as_save_IFS
    
    fi
    fi
    PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
    if test -n "$PTHREAD_CC"; then
    
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
    
    $as_echo "$PTHREAD_CC" >&6; }
    
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    
    $as_echo "no" >&6; }
    
    fi
    
    
      test -n "$PTHREAD_CC" && break
    done
    
    test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
     ;;
    esac ;; #(
      *) :
         ;;
    esac
                    ;;
                esac
            fi
    
    test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
    
    
    
    
    
    
    # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
    
    if test "x$ax_pthread_ok" = "xyes"; then
    
    $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
    
    
    fi
    ac_ext=c
    ac_cpp='$CPP $CPPFLAGS'
    ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    ac_compiler_gnu=$ac_cv_c_compiler_gnu
    
    
    
    ac_ext=c
    ac_cpp='$CPP $CPPFLAGS'
    ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
    ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
    ac_compiler_gnu=$ac_cv_c_compiler_gnu
    
    
    
    PBX_NO_BINARY_MODULES=0
    # Check whether --enable-binary-modules was given.
    if test "${enable_binary_modules+set}" = set; then :
      enableval=$enable_binary_modules; case "${enableval}" in
    	      y|ye|yes) PBX_NO_BINARY_MODULES=0 ;;
    	      n|no)  PBX_NO_BINARY_MODULES=1 ;;
    	      *) as_fn_error $? "bad value ${enableval} for --disable-binary-modules" "$LINENO" 5  ;;
    	esac
    fi
    
    
    
    
    # Check whether --enable-dev-mode was given.
    
    if test "${enable_dev_mode+set}" = set; then :
    
      enableval=$enable_dev_mode; case "${enableval}" in
    	      y|ye|yes) AST_DEVMODE=yes ;;
    	      n|no)  AST_DEVMODE=no ;;
    	      noisy)
    	      AST_DEVMODE=yes
    	      NOISY_BUILD=yes
    	      ;;
    
    	      strict)
    	      AST_DEVMODE=yes
    	      AST_DEVMODE_STRICT=yes
    	      ;;
    
    David M. Lee's avatar
    David M. Lee committed
    	      *) as_fn_error $? "bad value ${enableval} for --enable-dev-mode" "$LINENO" 5  ;;
    
    # Check whether --with-download-cache was given.
    if test "${with_download_cache+set}" = set; then :
      withval=$with_download_cache;
    	case ${withval} in
    	n|no)
    		unset AST_DOWNLOAD_CACHE
    		;;
    	*)
    		if test "x${withval}" = "x"; then
    			:
    		else