Add configure script check for JACK.
[asterisk/asterisk.git] / configure
index 89669ee..a7855ff 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 98454 .
+# From configure.ac Revision: 98604 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.4.
 #
@@ -773,6 +773,10 @@ ISDNNET_LIB
 ISDNNET_INCLUDE
 ISDNNET_DIR
 PBX_ISDNNET
+JACK_LIB
+JACK_INCLUDE
+JACK_DIR
+PBX_JACK
 LTDL_LIB
 LTDL_INCLUDE
 LTDL_DIR
@@ -1578,6 +1582,7 @@ Optional Packages:
   --with-iksemel=PATH     use Iksemel Jabber Library files in PATH
   --with-imap=PATH        use UW IMAP Toolkit files in PATH
   --with-isdnnet=PATH     use ISDN4Linux Library files in PATH
+  --with-jack=PATH        use Jack Audio Connection Kit files in PATH
   --with-ltdl=PATH        use libtool files in PATH
   --with-lua=PATH         use Lua files in PATH
   --with-misdn=PATH       use mISDN User Library files in PATH
@@ -8291,6 +8296,34 @@ fi
 
 
 
+    JACK_DESCRIP="Jack Audio Connection Kit"
+    JACK_OPTION="jack"
+
+# Check whether --with-jack was given.
+if test "${with_jack+set}" = set; then
+  withval=$with_jack;
+       case ${withval} in
+       n|no)
+       USE_JACK=no
+       ;;
+       y|ye|yes)
+       ac_mandatory_list="${ac_mandatory_list} JACK"
+       ;;
+       *)
+       JACK_DIR="${withval}"
+       ac_mandatory_list="${ac_mandatory_list} JACK"
+       ;;
+       esac
+
+fi
+
+    PBX_JACK=0
+
+
+
+
+
+
     LTDL_DESCRIP="libtool"
     LTDL_OPTION="ltdl"
 
@@ -32601,6 +32634,268 @@ echo "${ECHO_T}no" >&6; }
    fi
 fi
 
+
+if test "x${PBX_JACK}" != "x1" -a "${USE_JACK}" != "no"; then
+   pbxlibdir=""
+   # if --with-JACK=DIR has been specified, use it.
+   if test "x${JACK_DIR}" != "x"; then
+      if test -d ${JACK_DIR}/lib; then
+        pbxlibdir="-L${JACK_DIR}/lib"
+      else
+        pbxlibdir="-L${JACK_DIR}"
+      fi
+   fi
+   pbxfuncname="jack_activate"
+   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
+      AST_JACK_FOUND=yes
+   else
+      as_ac_Lib=`echo "ac_cv_lib_jack_${pbxfuncname}" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ${pbxfuncname} in -ljack" >&5
+echo $ECHO_N "checking for ${pbxfuncname} in -ljack... $ECHO_C" >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ljack ${pbxlibdir}  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* 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 ${pbxfuncname} ();
+int
+main ()
+{
+return ${pbxfuncname} ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_Lib=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_Lib=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+ac_res=`eval echo '${'$as_ac_Lib'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+  AST_JACK_FOUND=yes
+else
+  AST_JACK_FOUND=no
+fi
+
+   fi
+
+   # now check for the header.
+   if test "${AST_JACK_FOUND}" = "yes"; then
+      JACK_LIB="${pbxlibdir} -ljack "
+      # if --with-JACK=DIR has been specified, use it.
+      if test "x${JACK_DIR}" != "x"; then
+        JACK_INCLUDE="-I${JACK_DIR}/include"
+      fi
+      JACK_INCLUDE="${JACK_INCLUDE} "
+      if test "xjack/jack.h" = "x" ; then      # no header, assume found
+         JACK_HEADER_FOUND="1"
+      else                             # check for the header
+         saved_cppflags="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${JACK_INCLUDE} "
+        if test "${ac_cv_header_jack_jack_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for jack/jack.h" >&5
+echo $ECHO_N "checking for jack/jack.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_jack_jack_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_jack_jack_h" >&5
+echo "${ECHO_T}$ac_cv_header_jack_jack_h" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking jack/jack.h usability" >&5
+echo $ECHO_N "checking jack/jack.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <jack/jack.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking jack/jack.h presence" >&5
+echo $ECHO_N "checking jack/jack.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <jack/jack.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: jack/jack.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: jack/jack.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: jack/jack.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: jack/jack.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: jack/jack.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: jack/jack.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: jack/jack.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: jack/jack.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: jack/jack.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: jack/jack.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: jack/jack.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: jack/jack.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: jack/jack.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: jack/jack.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: jack/jack.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: jack/jack.h: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ------------------------------- ##
+## Report this to www.asterisk.org ##
+## ------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for jack/jack.h" >&5
+echo $ECHO_N "checking for jack/jack.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_jack_jack_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_jack_jack_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_jack_jack_h" >&5
+echo "${ECHO_T}$ac_cv_header_jack_jack_h" >&6; }
+
+fi
+if test $ac_cv_header_jack_jack_h = yes; then
+  JACK_HEADER_FOUND=1
+else
+  JACK_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${saved_cppflags}"
+      fi
+      if test "x${JACK_HEADER_FOUND}" = "x0" ; then
+         JACK_LIB=""
+         JACK_INCLUDE=""
+      else
+         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
+           JACK_LIB=""
+        fi
+         PBX_JACK=1
+         # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_JACK 1
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_JACK_VERSION
+_ACEOF
+
+      fi
+   fi
+fi
+
+
 # Needed by unixodbc
 
 if test "x${PBX_LTDL}" != "x1" -a "${USE_LTDL}" != "no"; then
@@ -48641,6 +48936,10 @@ ISDNNET_LIB!$ISDNNET_LIB$ac_delim
 ISDNNET_INCLUDE!$ISDNNET_INCLUDE$ac_delim
 ISDNNET_DIR!$ISDNNET_DIR$ac_delim
 PBX_ISDNNET!$PBX_ISDNNET$ac_delim
+JACK_LIB!$JACK_LIB$ac_delim
+JACK_INCLUDE!$JACK_INCLUDE$ac_delim
+JACK_DIR!$JACK_DIR$ac_delim
+PBX_JACK!$PBX_JACK$ac_delim
 LTDL_LIB!$LTDL_LIB$ac_delim
 LTDL_INCLUDE!$LTDL_INCLUDE$ac_delim
 LTDL_DIR!$LTDL_DIR$ac_delim
@@ -48678,10 +48977,6 @@ OGG_INCLUDE!$OGG_INCLUDE$ac_delim
 OGG_DIR!$OGG_DIR$ac_delim
 PBX_OGG!$PBX_OGG$ac_delim
 OSPTK_LIB!$OSPTK_LIB$ac_delim
-OSPTK_INCLUDE!$OSPTK_INCLUDE$ac_delim
-OSPTK_DIR!$OSPTK_DIR$ac_delim
-PBX_OSPTK!$PBX_OSPTK$ac_delim
-OSS_LIB!$OSS_LIB$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -48723,6 +49018,10 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+OSPTK_INCLUDE!$OSPTK_INCLUDE$ac_delim
+OSPTK_DIR!$OSPTK_DIR$ac_delim
+PBX_OSPTK!$PBX_OSPTK$ac_delim
+OSS_LIB!$OSS_LIB$ac_delim
 OSS_INCLUDE!$OSS_INCLUDE$ac_delim
 OSS_DIR!$OSS_DIR$ac_delim
 PBX_OSS!$PBX_OSS$ac_delim
@@ -48816,10 +49115,6 @@ ZLIB_DIR!$ZLIB_DIR$ac_delim
 PBX_ZLIB!$PBX_ZLIB$ac_delim
 ZAPTEL_LIB!$ZAPTEL_LIB$ac_delim
 ZAPTEL_INCLUDE!$ZAPTEL_INCLUDE$ac_delim
-ZAPTEL_DIR!$ZAPTEL_DIR$ac_delim
-PBX_ZAPTEL!$PBX_ZAPTEL$ac_delim
-ZAPTEL_TRANSCODE_LIB!$ZAPTEL_TRANSCODE_LIB$ac_delim
-ZAPTEL_TRANSCODE_INCLUDE!$ZAPTEL_TRANSCODE_INCLUDE$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -48861,6 +49156,10 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+ZAPTEL_DIR!$ZAPTEL_DIR$ac_delim
+PBX_ZAPTEL!$PBX_ZAPTEL$ac_delim
+ZAPTEL_TRANSCODE_LIB!$ZAPTEL_TRANSCODE_LIB$ac_delim
+ZAPTEL_TRANSCODE_INCLUDE!$ZAPTEL_TRANSCODE_INCLUDE$ac_delim
 ZAPTEL_TRANSCODE_DIR!$ZAPTEL_TRANSCODE_DIR$ac_delim
 PBX_ZAPTEL_TRANSCODE!$PBX_ZAPTEL_TRANSCODE$ac_delim
 ZAPTEL_VLDTMF_LIB!$ZAPTEL_VLDTMF_LIB$ac_delim
@@ -48921,7 +49220,7 @@ CURL_CONFIG!$CURL_CONFIG$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 58; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 62; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5