diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-14 15:50:49 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-14 15:50:49 +0000 |
commit | 70ba0ec26db55a30927a20513ff7958b92895035 (patch) | |
tree | 1038ba5510d7b25e122cbe93cc82ea534766f501 /configure | |
parent | 4b7add369a1a77105a5f2738eb4e8c68be8b7c46 (diff) |
Add checking for libusb here, so nobody has to deal with conflicts in the
chan_usbradio-1.4 branch every time the configure script gets changed
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@82385 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 446 |
1 files changed, 440 insertions, 6 deletions
@@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 77865 . +# From configure.ac Revision: 78166 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # @@ -852,6 +852,10 @@ TONEZONE_LIB TONEZONE_INCLUDE TONEZONE_DIR PBX_TONEZONE +USB_LIB +USB_INCLUDE +USB_DIR +PBX_USB VORBIS_LIB VORBIS_INCLUDE VORBIS_DIR @@ -1533,6 +1537,7 @@ Optional Packages: --with-termcap=PATH use Termcap files in PATH --with-tinfo=PATH use Term Info files in PATH --with-tonezone=PATH use tonezone files in PATH + --with-usb=PATH use usb files in PATH --with-vorbis=PATH use Vorbis files in PATH --with-vpb=PATH use Voicetronix API files in PATH --with-z=PATH use zlib files in PATH @@ -8526,6 +8531,34 @@ PBX_TONEZONE=0 +USB_DESCRIP="usb" +USB_OPTION="usb" + +# Check whether --with-usb was given. +if test "${with_usb+set}" = set; then + withval=$with_usb; +case ${withval} in + n|no) + USE_USB=no + ;; + y|ye|yes) + USB_MANDATORY="yes" + ;; + *) + USB_DIR="${withval}" + USB_MANDATORY="yes" + ;; +esac + +fi + +PBX_USB=0 + + + + + + VORBIS_DESCRIP="Vorbis" VORBIS_OPTION="vorbis" @@ -30653,6 +30686,405 @@ fi +if test "${USE_USB}" != "no"; then + pbxlibdir="" + if test "x${USB_DIR}" != "x"; then + if test -d ${USB_DIR}/lib; then + pbxlibdir="-L${USB_DIR}/lib" + else + pbxlibdir="-L${USB_DIR}" + fi + fi + { echo "$as_me:$LINENO: checking for usb_init in -lusb" >&5 +echo $ECHO_N "checking for usb_init in -lusb... $ECHO_C" >&6; } +if test "${ac_cv_lib_usb_usb_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusb ${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 usb_init (); +int +main () +{ +return usb_init (); + ; + 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 + ac_cv_lib_usb_usb_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_usb_usb_init=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 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_init" >&5 +echo "${ECHO_T}$ac_cv_lib_usb_usb_init" >&6; } +if test $ac_cv_lib_usb_usb_init = yes; then + AST_USB_FOUND=yes +else + AST_USB_FOUND=no +fi + + + if test "${AST_USB_FOUND}" = "yes"; then + USB_LIB="-lusb " + USB_HEADER_FOUND="1" + if test "x${USB_DIR}" != "x"; then + USB_LIB="${pbxlibdir} ${USB_LIB}" + USB_INCLUDE="-I${USB_DIR}/include" + saved_cppflags="${CPPFLAGS}" + CPPFLAGS="${CPPFLAGS} -I${USB_DIR}/include" + if test "xusb.h" != "x" ; then + as_ac_Header=`echo "ac_cv_header_${USB_DIR}/include/usb.h" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for ${USB_DIR}/include/usb.h" >&5 +echo $ECHO_N "checking for ${USB_DIR}/include/usb.h... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking ${USB_DIR}/include/usb.h usability" >&5 +echo $ECHO_N "checking ${USB_DIR}/include/usb.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 <${USB_DIR}/include/usb.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 ${USB_DIR}/include/usb.h presence" >&5 +echo $ECHO_N "checking ${USB_DIR}/include/usb.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 <${USB_DIR}/include/usb.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: ${USB_DIR}/include/usb.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: ${USB_DIR}/include/usb.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: ${USB_DIR}/include/usb.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: ${USB_DIR}/include/usb.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: ${USB_DIR}/include/usb.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: ${USB_DIR}/include/usb.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: ${USB_DIR}/include/usb.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: ${USB_DIR}/include/usb.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: ${USB_DIR}/include/usb.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: ${USB_DIR}/include/usb.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: ${USB_DIR}/include/usb.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: ${USB_DIR}/include/usb.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: ${USB_DIR}/include/usb.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: ${USB_DIR}/include/usb.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: ${USB_DIR}/include/usb.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: ${USB_DIR}/include/usb.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for ${USB_DIR}/include/usb.h" >&5 +echo $ECHO_N "checking for ${USB_DIR}/include/usb.h... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + USB_HEADER_FOUND=1 +else + USB_HEADER_FOUND=0 +fi + + + fi + CPPFLAGS="${saved_cppflags}" + else + if test "xusb.h" != "x" ; then + if test "${ac_cv_header_usb_h+set}" = set; then + { echo "$as_me:$LINENO: checking for usb.h" >&5 +echo $ECHO_N "checking for usb.h... $ECHO_C" >&6; } +if test "${ac_cv_header_usb_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_usb_h" >&5 +echo "${ECHO_T}$ac_cv_header_usb_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking usb.h usability" >&5 +echo $ECHO_N "checking usb.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 <usb.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 usb.h presence" >&5 +echo $ECHO_N "checking usb.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 <usb.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: usb.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: usb.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: usb.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: usb.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: usb.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: usb.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: usb.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: usb.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: usb.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: usb.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: usb.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: usb.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: usb.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: usb.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: usb.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: usb.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for usb.h" >&5 +echo $ECHO_N "checking for usb.h... $ECHO_C" >&6; } +if test "${ac_cv_header_usb_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_usb_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_usb_h" >&5 +echo "${ECHO_T}$ac_cv_header_usb_h" >&6; } + +fi +if test $ac_cv_header_usb_h = yes; then + USB_HEADER_FOUND=1 +else + USB_HEADER_FOUND=0 +fi + + + fi + fi + if test "x${USB_HEADER_FOUND}" = "x0" ; then + if test -n "${USB_MANDATORY}" ; + then + { echo "$as_me:$LINENO: ***" >&5 +echo "$as_me: ***" >&6;} + { echo "$as_me:$LINENO: *** It appears that you do not have the usb development package installed." >&5 +echo "$as_me: *** It appears that you do not have the usb development package installed." >&6;} + { echo "$as_me:$LINENO: *** Please install it to include ${USB_DESCRIP} support, or re-run configure" >&5 +echo "$as_me: *** Please install it to include ${USB_DESCRIP} support, or re-run configure" >&6;} + { echo "$as_me:$LINENO: *** without explicitly specifying --with-${USB_OPTION}" >&5 +echo "$as_me: *** without explicitly specifying --with-${USB_OPTION}" >&6;} + exit 1 + fi + USB_LIB="" + USB_INCLUDE="" + PBX_USB=0 + else + PBX_USB=1 + +cat >>confdefs.h <<_ACEOF +#define HAVE_USB 1 +_ACEOF + + fi + elif test -n "${USB_MANDATORY}"; + then + { echo "$as_me:$LINENO: ***" >&5 +echo "$as_me: ***" >&6;} + { echo "$as_me:$LINENO: *** The ${USB_DESCRIP} installation on this system appears to be broken." >&5 +echo "$as_me: *** The ${USB_DESCRIP} installation on this system appears to be broken." >&6;} + { echo "$as_me:$LINENO: *** Either correct the installation, or run configure" >&5 +echo "$as_me: *** Either correct the installation, or run configure" >&6;} + { echo "$as_me:$LINENO: *** without explicitly specifying --with-${USB_OPTION}" >&5 +echo "$as_me: *** without explicitly specifying --with-${USB_OPTION}" >&6;} + exit 1 + fi +fi + + + if test "${USE_VORBIS}" != "no"; then pbxlibdir="" if test "x${VORBIS_DIR}" != "x"; then @@ -33442,6 +33874,10 @@ TONEZONE_LIB!$TONEZONE_LIB$ac_delim TONEZONE_INCLUDE!$TONEZONE_INCLUDE$ac_delim TONEZONE_DIR!$TONEZONE_DIR$ac_delim PBX_TONEZONE!$PBX_TONEZONE$ac_delim +USB_LIB!$USB_LIB$ac_delim +USB_INCLUDE!$USB_INCLUDE$ac_delim +USB_DIR!$USB_DIR$ac_delim +PBX_USB!$PBX_USB$ac_delim VORBIS_LIB!$VORBIS_LIB$ac_delim VORBIS_INCLUDE!$VORBIS_INCLUDE$ac_delim VORBIS_DIR!$VORBIS_DIR$ac_delim @@ -33497,7 +33933,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` = 92; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -33516,7 +33952,7 @@ fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-3.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g @@ -33529,8 +33965,6 @@ N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS <conf$$subs.sed rm -f conf$$subs.sed cat >>$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g CEOF$ac_eof _ACEOF @@ -33778,7 +34212,7 @@ s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" >$tmp/out +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" | sed 's/|#_!!_#|//g' >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && |