Skip to content
Snippets Groups Projects
configure 1.4 MiB
Newer Older
  • Learn to ignore specific revisions
  • echo "${ECHO_T}$ac_header_compiler" >&6; }
    
    # Is the header present?
    { echo "$as_me:$LINENO: checking ffmpeg/avcodec.h presence" >&5
    echo $ECHO_N "checking ffmpeg/avcodec.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 <ffmpeg/avcodec.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
    
    
    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: ffmpeg/avcodec.h: accepted by the compiler, rejected by the preprocessor!" >&5
    echo "$as_me: WARNING: ffmpeg/avcodec.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
        { echo "$as_me:$LINENO: WARNING: ffmpeg/avcodec.h: proceeding with the compiler's result" >&5
    echo "$as_me: WARNING: ffmpeg/avcodec.h: proceeding with the compiler's result" >&2;}
        ac_header_preproc=yes
        ;;
      no:yes:* )
        { echo "$as_me:$LINENO: WARNING: ffmpeg/avcodec.h: present but cannot be compiled" >&5
    echo "$as_me: WARNING: ffmpeg/avcodec.h: present but cannot be compiled" >&2;}
        { echo "$as_me:$LINENO: WARNING: ffmpeg/avcodec.h:     check for missing prerequisite headers?" >&5
    echo "$as_me: WARNING: ffmpeg/avcodec.h:     check for missing prerequisite headers?" >&2;}
        { echo "$as_me:$LINENO: WARNING: ffmpeg/avcodec.h: see the Autoconf documentation" >&5
    echo "$as_me: WARNING: ffmpeg/avcodec.h: see the Autoconf documentation" >&2;}
        { echo "$as_me:$LINENO: WARNING: ffmpeg/avcodec.h:     section \"Present But Cannot Be Compiled\"" >&5
    echo "$as_me: WARNING: ffmpeg/avcodec.h:     section \"Present But Cannot Be Compiled\"" >&2;}
        { echo "$as_me:$LINENO: WARNING: ffmpeg/avcodec.h: proceeding with the preprocessor's result" >&5
    echo "$as_me: WARNING: ffmpeg/avcodec.h: proceeding with the preprocessor's result" >&2;}
        { echo "$as_me:$LINENO: WARNING: ffmpeg/avcodec.h: in the future, the compiler will take precedence" >&5
    echo "$as_me: WARNING: ffmpeg/avcodec.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 ffmpeg/avcodec.h" >&5
    echo $ECHO_N "checking for ffmpeg/avcodec.h... $ECHO_C" >&6; }
    if test "${ac_cv_header_ffmpeg_avcodec_h+set}" = set; then
      echo $ECHO_N "(cached) $ECHO_C" >&6
    
      ac_cv_header_ffmpeg_avcodec_h=$ac_header_preproc
    fi
    { echo "$as_me:$LINENO: result: $ac_cv_header_ffmpeg_avcodec_h" >&5
    echo "${ECHO_T}$ac_cv_header_ffmpeg_avcodec_h" >&6; }
    
    fi
    if test $ac_cv_header_ffmpeg_avcodec_h = yes; then
      FFMPEG_HEADER_FOUND=1
    else
      FFMPEG_HEADER_FOUND=0
    
             CPPFLAGS="${saved_cppflags}"
    
          fi
          if test "x${FFMPEG_HEADER_FOUND}" = "x0" ; then
             FFMPEG_LIB=""
             FFMPEG_INCLUDE=""
          else
             if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
    	    FFMPEG_LIB=""
    	 fi
             PBX_FFMPEG=1
             # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
    
    cat >>confdefs.h <<_ACEOF
    #define HAVE_FFMPEG 1
    _ACEOF
    
    
    cat >>confdefs.h <<_ACEOF
    #define HAVE_FFMPEG_VERSION
    _ACEOF
    
          fi
       fi
    fi
    
    Luigi Rizzo's avatar
    Luigi Rizzo committed
    # possible places for video4linux version 1
    if test "${ac_cv_header_linux_videodev_h+set}" = set; then
      { echo "$as_me:$LINENO: checking for linux/videodev.h" >&5
    echo $ECHO_N "checking for linux/videodev.h... $ECHO_C" >&6; }
    if test "${ac_cv_header_linux_videodev_h+set}" = set; then
      echo $ECHO_N "(cached) $ECHO_C" >&6
    fi
    { echo "$as_me:$LINENO: result: $ac_cv_header_linux_videodev_h" >&5
    echo "${ECHO_T}$ac_cv_header_linux_videodev_h" >&6; }
    else
      # Is the header compilable?
    { echo "$as_me:$LINENO: checking linux/videodev.h usability" >&5
    echo $ECHO_N "checking linux/videodev.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 <linux/videodev.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
    
    Luigi Rizzo's avatar
    Luigi Rizzo committed
      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 linux/videodev.h presence" >&5
    echo $ECHO_N "checking linux/videodev.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 <linux/videodev.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
    
    Luigi Rizzo's avatar
    Luigi Rizzo committed
      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: linux/videodev.h: accepted by the compiler, rejected by the preprocessor!" >&5
    echo "$as_me: WARNING: linux/videodev.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
        { echo "$as_me:$LINENO: WARNING: linux/videodev.h: proceeding with the compiler's result" >&5
    echo "$as_me: WARNING: linux/videodev.h: proceeding with the compiler's result" >&2;}
        ac_header_preproc=yes
        ;;
      no:yes:* )
        { echo "$as_me:$LINENO: WARNING: linux/videodev.h: present but cannot be compiled" >&5
    echo "$as_me: WARNING: linux/videodev.h: present but cannot be compiled" >&2;}
        { echo "$as_me:$LINENO: WARNING: linux/videodev.h:     check for missing prerequisite headers?" >&5
    echo "$as_me: WARNING: linux/videodev.h:     check for missing prerequisite headers?" >&2;}
        { echo "$as_me:$LINENO: WARNING: linux/videodev.h: see the Autoconf documentation" >&5
    echo "$as_me: WARNING: linux/videodev.h: see the Autoconf documentation" >&2;}
        { echo "$as_me:$LINENO: WARNING: linux/videodev.h:     section \"Present But Cannot Be Compiled\"" >&5
    echo "$as_me: WARNING: linux/videodev.h:     section \"Present But Cannot Be Compiled\"" >&2;}
        { echo "$as_me:$LINENO: WARNING: linux/videodev.h: proceeding with the preprocessor's result" >&5
    echo "$as_me: WARNING: linux/videodev.h: proceeding with the preprocessor's result" >&2;}
        { echo "$as_me:$LINENO: WARNING: linux/videodev.h: in the future, the compiler will take precedence" >&5
    echo "$as_me: WARNING: linux/videodev.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
    
    Luigi Rizzo's avatar
    Luigi Rizzo committed
        ;;
    esac
    { echo "$as_me:$LINENO: checking for linux/videodev.h" >&5
    echo $ECHO_N "checking for linux/videodev.h... $ECHO_C" >&6; }
    if test "${ac_cv_header_linux_videodev_h+set}" = set; then
      echo $ECHO_N "(cached) $ECHO_C" >&6
    else
      ac_cv_header_linux_videodev_h=$ac_header_preproc
    fi
    { echo "$as_me:$LINENO: result: $ac_cv_header_linux_videodev_h" >&5
    echo "${ECHO_T}$ac_cv_header_linux_videodev_h" >&6; }
    
    fi
    if test $ac_cv_header_linux_videodev_h = yes; then
    
    cat >>confdefs.h <<_ACEOF
    #define HAVE_VIDEODEV_H 1
    _ACEOF
    
    fi
    
    
    
    
    # possible places for X11
    
    if test "x${PBX_X11}" != "x1" -a "${USE_X11}" != "no"; then
       pbxlibdir=""
       # if --with-X11=DIR has been specified, use it.
       if test "x${X11_DIR}" != "x"; then
          if test -d ${X11_DIR}/lib; then
          	 pbxlibdir="-L${X11_DIR}/lib"
          else
          	 pbxlibdir="-L${X11_DIR}"
          fi
       fi
       pbxfuncname="XOpenDisplay"
       if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
          AST_X11_FOUND=yes
       else
          as_ac_Lib=`echo "ac_cv_lib_X11_${pbxfuncname}" | $as_tr_sh`
    { echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lX11" >&5
    echo $ECHO_N "checking for ${pbxfuncname} in -lX11... $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="-lX11 ${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_X11_FOUND=yes
    else
      AST_X11_FOUND=no
    fi
    
       fi
    
       # now check for the header.
       if test "${AST_X11_FOUND}" = "yes"; then
          X11_LIB="${pbxlibdir} -lX11 "
          # if --with-X11=DIR has been specified, use it.
          if test "x${X11_DIR}" != "x"; then
    	 X11_INCLUDE="-I${X11_DIR}/include"
          fi
          X11_INCLUDE="${X11_INCLUDE} "
          if test "xX11/Xlib.h" = "x" ; then	# no header, assume found
             X11_HEADER_FOUND="1"
          else				# check for the header
             saved_cppflags="${CPPFLAGS}"
             CPPFLAGS="${CPPFLAGS} ${X11_INCLUDE} "
    	 if test "${ac_cv_header_X11_Xlib_h+set}" = set; then
      { echo "$as_me:$LINENO: checking for X11/Xlib.h" >&5
    echo $ECHO_N "checking for X11/Xlib.h... $ECHO_C" >&6; }
    if test "${ac_cv_header_X11_Xlib_h+set}" = set; then
      echo $ECHO_N "(cached) $ECHO_C" >&6
    fi
    { echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xlib_h" >&5
    echo "${ECHO_T}$ac_cv_header_X11_Xlib_h" >&6; }
    else
      # Is the header compilable?
    { echo "$as_me:$LINENO: checking X11/Xlib.h usability" >&5
    echo $ECHO_N "checking X11/Xlib.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 <X11/Xlib.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 X11/Xlib.h presence" >&5
    echo $ECHO_N "checking X11/Xlib.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 <X11/Xlib.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: X11/Xlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
    echo "$as_me: WARNING: X11/Xlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
        { echo "$as_me:$LINENO: WARNING: X11/Xlib.h: proceeding with the compiler's result" >&5
    echo "$as_me: WARNING: X11/Xlib.h: proceeding with the compiler's result" >&2;}
        ac_header_preproc=yes
        ;;
      no:yes:* )
        { echo "$as_me:$LINENO: WARNING: X11/Xlib.h: present but cannot be compiled" >&5
    echo "$as_me: WARNING: X11/Xlib.h: present but cannot be compiled" >&2;}
        { echo "$as_me:$LINENO: WARNING: X11/Xlib.h:     check for missing prerequisite headers?" >&5
    echo "$as_me: WARNING: X11/Xlib.h:     check for missing prerequisite headers?" >&2;}
        { echo "$as_me:$LINENO: WARNING: X11/Xlib.h: see the Autoconf documentation" >&5
    echo "$as_me: WARNING: X11/Xlib.h: see the Autoconf documentation" >&2;}
        { echo "$as_me:$LINENO: WARNING: X11/Xlib.h:     section \"Present But Cannot Be Compiled\"" >&5
    echo "$as_me: WARNING: X11/Xlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
        { echo "$as_me:$LINENO: WARNING: X11/Xlib.h: proceeding with the preprocessor's result" >&5
    echo "$as_me: WARNING: X11/Xlib.h: proceeding with the preprocessor's result" >&2;}
        { echo "$as_me:$LINENO: WARNING: X11/Xlib.h: in the future, the compiler will take precedence" >&5
    echo "$as_me: WARNING: X11/Xlib.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 X11/Xlib.h" >&5
    echo $ECHO_N "checking for X11/Xlib.h... $ECHO_C" >&6; }
    if test "${ac_cv_header_X11_Xlib_h+set}" = set; then
      echo $ECHO_N "(cached) $ECHO_C" >&6
    else
      ac_cv_header_X11_Xlib_h=$ac_header_preproc
    fi
    { echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xlib_h" >&5
    echo "${ECHO_T}$ac_cv_header_X11_Xlib_h" >&6; }
    
    fi
    if test $ac_cv_header_X11_Xlib_h = yes; then
      X11_HEADER_FOUND=1
    else
      X11_HEADER_FOUND=0
    fi
    
    
             CPPFLAGS="${saved_cppflags}"
          fi
          if test "x${X11_HEADER_FOUND}" = "x0" ; then
             X11_LIB=""
             X11_INCLUDE=""
          else
             if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
    	    X11_LIB=""
    	 fi
             PBX_X11=1
             # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
    
    cat >>confdefs.h <<_ACEOF
    #define HAVE_X11 1
    _ACEOF
    
    
    cat >>confdefs.h <<_ACEOF
    #define HAVE_X11_VERSION standard_path
    _ACEOF
    
          fi
       fi
    fi
    
    
    if test "x${PBX_X11}" != "x1" -a "${USE_X11}" != "no"; then
       pbxlibdir=""
       # if --with-X11=DIR has been specified, use it.
       if test "x${X11_DIR}" != "x"; then
          if test -d ${X11_DIR}/lib; then
          	 pbxlibdir="-L${X11_DIR}/lib"
          else
          	 pbxlibdir="-L${X11_DIR}"
          fi
       fi
       pbxfuncname="XOpenDisplay"
       if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
          AST_X11_FOUND=yes
       else
          as_ac_Lib=`echo "ac_cv_lib_X11_${pbxfuncname}" | $as_tr_sh`
    { echo "$as_me:$LINENO: checking for ${pbxfuncname} in -lX11" >&5
    echo $ECHO_N "checking for ${pbxfuncname} in -lX11... $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="-lX11 ${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_X11_FOUND=yes
    else
      AST_X11_FOUND=no
    fi
    
       fi
    
       # now check for the header.
       if test "${AST_X11_FOUND}" = "yes"; then
          X11_LIB="${pbxlibdir} -lX11 "
          # if --with-X11=DIR has been specified, use it.
          if test "x${X11_DIR}" != "x"; then
    	 X11_INCLUDE="-I${X11_DIR}/include"
          fi
          X11_INCLUDE="${X11_INCLUDE} -I/usr/X11R6/include"
          if test "xX11/Xlib.h" = "x" ; then	# no header, assume found
             X11_HEADER_FOUND="1"
          else				# check for the header
             saved_cppflags="${CPPFLAGS}"
             CPPFLAGS="${CPPFLAGS} ${X11_INCLUDE} -I/usr/X11R6/include"
    	 if test "${ac_cv_header_X11_Xlib_h+set}" = set; then
      { echo "$as_me:$LINENO: checking for X11/Xlib.h" >&5
    echo $ECHO_N "checking for X11/Xlib.h... $ECHO_C" >&6; }
    if test "${ac_cv_header_X11_Xlib_h+set}" = set; then
      echo $ECHO_N "(cached) $ECHO_C" >&6
    fi
    { echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xlib_h" >&5
    echo "${ECHO_T}$ac_cv_header_X11_Xlib_h" >&6; }
    else
      # Is the header compilable?
    { echo "$as_me:$LINENO: checking X11/Xlib.h usability" >&5
    echo $ECHO_N "checking X11/Xlib.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 <X11/Xlib.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 X11/Xlib.h presence" >&5
    echo $ECHO_N "checking X11/Xlib.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 <X11/Xlib.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: X11/Xlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
    echo "$as_me: WARNING: X11/Xlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
        { echo "$as_me:$LINENO: WARNING: X11/Xlib.h: proceeding with the compiler's result" >&5
    echo "$as_me: WARNING: X11/Xlib.h: proceeding with the compiler's result" >&2;}
        ac_header_preproc=yes
        ;;
      no:yes:* )
        { echo "$as_me:$LINENO: WARNING: X11/Xlib.h: present but cannot be compiled" >&5
    echo "$as_me: WARNING: X11/Xlib.h: present but cannot be compiled" >&2;}
        { echo "$as_me:$LINENO: WARNING: X11/Xlib.h:     check for missing prerequisite headers?" >&5
    echo "$as_me: WARNING: X11/Xlib.h:     check for missing prerequisite headers?" >&2;}
        { echo "$as_me:$LINENO: WARNING: X11/Xlib.h: see the Autoconf documentation" >&5
    echo "$as_me: WARNING: X11/Xlib.h: see the Autoconf documentation" >&2;}
        { echo "$as_me:$LINENO: WARNING: X11/Xlib.h:     section \"Present But Cannot Be Compiled\"" >&5
    echo "$as_me: WARNING: X11/Xlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
        { echo "$as_me:$LINENO: WARNING: X11/Xlib.h: proceeding with the preprocessor's result" >&5
    echo "$as_me: WARNING: X11/Xlib.h: proceeding with the preprocessor's result" >&2;}
        { echo "$as_me:$LINENO: WARNING: X11/Xlib.h: in the future, the compiler will take precedence" >&5
    echo "$as_me: WARNING: X11/Xlib.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 X11/Xlib.h" >&5
    echo $ECHO_N "checking for X11/Xlib.h... $ECHO_C" >&6; }
    if test "${ac_cv_header_X11_Xlib_h+set}" = set; then
      echo $ECHO_N "(cached) $ECHO_C" >&6
    else
      ac_cv_header_X11_Xlib_h=$ac_header_preproc
    fi
    { echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xlib_h" >&5
    echo "${ECHO_T}$ac_cv_header_X11_Xlib_h" >&6; }
    
    fi
    if test $ac_cv_header_X11_Xlib_h = yes; then
      X11_HEADER_FOUND=1
    else
      X11_HEADER_FOUND=0
    fi
    
    
             CPPFLAGS="${saved_cppflags}"
          fi
          if test "x${X11_HEADER_FOUND}" = "x0" ; then
             X11_LIB=""
             X11_INCLUDE=""
          else
             if test "x${pbxfuncname}" = "x" ; then		# only checking headers -> no library
    	    X11_LIB=""
    	 fi
             PBX_X11=1
             # XXX don't know how to evaluate the description (third argument) in AC_DEFINE_UNQUOTED
    
    cat >>confdefs.h <<_ACEOF
    #define HAVE_X11 1
    _ACEOF
    
    
    cat >>confdefs.h <<_ACEOF
    #define HAVE_X11_VERSION X11R6
    _ACEOF
    
          fi
       fi
    fi
    
    
    
    # we don't use gtk right now...
    
        if test "x${PBX_GTK}" != "x1" -a "${USE_GTK}" != "no"; then
    	PBX_GTK=0
    	if test -n "$ac_tool_prefix"; then
    
      # Extract the first word of "${ac_tool_prefix}gtk-config", so it can be a program name with args.
    set dummy ${ac_tool_prefix}gtk-config; ac_word=$2
    { echo "$as_me:$LINENO: checking for $ac_word" >&5
    echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
    
    if test "${ac_cv_prog_CONFIG_GTK+set}" = set; then
    
      if test -n "$CONFIG_GTK"; then
      ac_cv_prog_CONFIG_GTK="$CONFIG_GTK" # 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
    
      if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    
        ac_cv_prog_CONFIG_GTK="${ac_tool_prefix}gtk-config"
    
        echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
        break 2
      fi
    done
    done
    IFS=$as_save_IFS
    
    fi
    fi
    
    CONFIG_GTK=$ac_cv_prog_CONFIG_GTK
    if test -n "$CONFIG_GTK"; then
      { echo "$as_me:$LINENO: result: $CONFIG_GTK" >&5
    echo "${ECHO_T}$CONFIG_GTK" >&6; }
    
    else
      { echo "$as_me:$LINENO: result: no" >&5
    echo "${ECHO_T}no" >&6; }
    fi
    
    
    fi
    
    if test -z "$ac_cv_prog_CONFIG_GTK"; then
      ac_ct_CONFIG_GTK=$CONFIG_GTK
    
      # Extract the first word of "gtk-config", so it can be a program name with args.
    set dummy gtk-config; ac_word=$2
    { echo "$as_me:$LINENO: checking for $ac_word" >&5
    echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
    
    if test "${ac_cv_prog_ac_ct_CONFIG_GTK+set}" = set; then
    
      if test -n "$ac_ct_CONFIG_GTK"; then
      ac_cv_prog_ac_ct_CONFIG_GTK="$ac_ct_CONFIG_GTK" # 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
    
      if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    
        ac_cv_prog_ac_ct_CONFIG_GTK="gtk-config"
    
        echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
        break 2
      fi
    done
    done
    IFS=$as_save_IFS
    
    fi
    fi
    
    ac_ct_CONFIG_GTK=$ac_cv_prog_ac_ct_CONFIG_GTK
    if test -n "$ac_ct_CONFIG_GTK"; then
      { echo "$as_me:$LINENO: result: $ac_ct_CONFIG_GTK" >&5
    echo "${ECHO_T}$ac_ct_CONFIG_GTK" >&6; }
    
    else
      { echo "$as_me:$LINENO: result: no" >&5
    echo "${ECHO_T}no" >&6; }
    fi
    
    
      if test "x$ac_ct_CONFIG_GTK" = x; then
        CONFIG_GTK="No"
    
      else
        case $cross_compiling:$ac_tool_warned in
    yes:)
    { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
    whose name does not start with the host triplet.  If you think this
    configuration is useful to you, please write to autoconf@gnu.org." >&5
    echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
    whose name does not start with the host triplet.  If you think this
    configuration is useful to you, please write to autoconf@gnu.org." >&2;}
    ac_tool_warned=yes ;;
    esac
    
        CONFIG_GTK=$ac_ct_CONFIG_GTK
    
    Russell Bryant's avatar
    Russell Bryant committed
    else
    
      CONFIG_GTK="$ac_cv_prog_CONFIG_GTK"
    
    	if test ! "x${CONFIG_GTK}" = xNo; then
    	    if test x"" = x ; then A=--cflags ; else A="" ; fi
    	    GTK_INCLUDE=$(${CONFIG_GTK} $A)
    	    if test x"" = x ; then A=--libs ; else A="" ; fi
    	    GTK_LIB=$(${CONFIG_GTK} $A)
    	    PBX_GTK=1
    
    Russell Bryant's avatar
    Russell Bryant committed
    
    
    PBX_GTK2=0
    if test -n "$ac_tool_prefix"; then
      # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
    set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
    { echo "$as_me:$LINENO: checking for $ac_word" >&5
    echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
    if test "${ac_cv_prog_PKGCONFIG+set}" = set; then
      echo $ECHO_N "(cached) $ECHO_C" >&6
    else
      if test -n "$PKGCONFIG"; then
      ac_cv_prog_PKGCONFIG="$PKGCONFIG" # 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
    
      if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    
        ac_cv_prog_PKGCONFIG="${ac_tool_prefix}pkg-config"
        echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
        break 2
      fi
    done
    done
    IFS=$as_save_IFS
    
    fi
    fi
    PKGCONFIG=$ac_cv_prog_PKGCONFIG
    if test -n "$PKGCONFIG"; then
      { echo "$as_me:$LINENO: result: $PKGCONFIG" >&5
    echo "${ECHO_T}$PKGCONFIG" >&6; }
    else
      { echo "$as_me:$LINENO: result: no" >&5
    echo "${ECHO_T}no" >&6; }
    fi
    
    
    fi
    if test -z "$ac_cv_prog_PKGCONFIG"; then
      ac_ct_PKGCONFIG=$PKGCONFIG
      # Extract the first word of "pkg-config", so it can be a program name with args.
    set dummy pkg-config; ac_word=$2
    { echo "$as_me:$LINENO: checking for $ac_word" >&5
    echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
    if test "${ac_cv_prog_ac_ct_PKGCONFIG+set}" = set; then
      echo $ECHO_N "(cached) $ECHO_C" >&6
    else
      if test -n "$ac_ct_PKGCONFIG"; then
      ac_cv_prog_ac_ct_PKGCONFIG="$ac_ct_PKGCONFIG" # 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
    
      if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
    
        ac_cv_prog_ac_ct_PKGCONFIG="pkg-config"
        echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
        break 2
      fi
    done
    done
    IFS=$as_save_IFS
    
    fi
    fi
    ac_ct_PKGCONFIG=$ac_cv_prog_ac_ct_PKGCONFIG
    if test -n "$ac_ct_PKGCONFIG"; then
      { echo "$as_me:$LINENO: result: $ac_ct_PKGCONFIG" >&5
    echo "${ECHO_T}$ac_ct_PKGCONFIG" >&6; }
    else
      { echo "$as_me:$LINENO: result: no" >&5
    echo "${ECHO_T}no" >&6; }
    fi
    
      if test "x$ac_ct_PKGCONFIG" = x; then
        PKGCONFIG="No"
      else
        case $cross_compiling:$ac_tool_warned in
    yes:)
    { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
    whose name does not start with the host triplet.  If you think this
    configuration is useful to you, please write to autoconf@gnu.org." >&5
    echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
    whose name does not start with the host triplet.  If you think this
    configuration is useful to you, please write to autoconf@gnu.org." >&2;}
    ac_tool_warned=yes ;;
    esac
        PKGCONFIG=$ac_ct_PKGCONFIG
      fi
    else
      PKGCONFIG="$ac_cv_prog_PKGCONFIG"
    fi
    
    if test ! "x${PKGCONFIG}" = xNo; then
    
       GTK2_INCLUDE=$(${PKGCONFIG} gtk+-2.0 --cflags 2>/dev/null)
    
       GTK2_LIB=$(${PKGCONFIG} gtk+-2.0 --libs)
       PBX_GTK2=1
    
    cat >>confdefs.h <<\_ACEOF
    #define HAVE_GTK2 1
    _ACEOF