]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
handle the GNUTLS library properly in the configure script and build system
authorKevin P. Fleming <kpfleming@digium.com>
Fri, 25 May 2007 14:28:46 +0000 (14:28 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Fri, 25 May 2007 14:28:46 +0000 (14:28 +0000)
don't build in OSP support unless we have found and are allowed to use SSL support

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66157 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_gtalk.c
configure
configure.ac
makeopts.in
res/res_jabber.c

index 02838a04452a009edf6b8b7de4aa42876d626b01..83dc19384ffc8d816681edd163577c2e1855f1e5 100644 (file)
@@ -28,6 +28,7 @@
 /*** MODULEINFO
        <depend>iksemel</depend>
        <depend>res_jabber</depend>
+       <use>gnutls</use>
  ***/
 
 #include "asterisk.h"
index e5c92b4584e51e575857b009561d8b986c0993d8..67d663ab956bfa5d0b7489f1c34ec5d01572cf01 100755 (executable)
--- a/configure
+++ b/configure
@@ -17734,7 +17734,7 @@ if test "${ac_cv_lib_gnutls_gnutls_bye+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgnutls ${pbxlibdir}  $LIBS"
+LIBS="-lgnutls ${pbxlibdir} -lz -lgcrypt -lgpg-error $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 
 
    if test "${AST_GNUTLS_FOUND}" = "yes"; then
-      GNUTLS_LIB="-lgnutls "
+      GNUTLS_LIB="-lgnutls -lz -lgcrypt -lgpg-error"
       GNUTLS_HEADER_FOUND="1"
       if test "x${GNUTLS_DIR}" != "x"; then
          GNUTLS_LIB="${pbxlibdir} ${GNUTLS_LIB}"
         GNUTLS_INCLUDE="-I${GNUTLS_DIR}/include"
         saved_cppflags="${CPPFLAGS}"
         CPPFLAGS="${CPPFLAGS} -I${GNUTLS_DIR}/include"
-        if test "x" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${GNUTLS_DIR}/include/" | $as_tr_sh`
+        if test "xgnutls/gnutls.h" != "x" ; then
+           as_ac_Header=`echo "ac_cv_header_${GNUTLS_DIR}/include/gnutls/gnutls.h" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${GNUTLS_DIR}/include/" >&5
-echo $ECHO_N "checking for ${GNUTLS_DIR}/include/... $ECHO_C" >&6; }
+  { echo "$as_me:$LINENO: checking for ${GNUTLS_DIR}/include/gnutls/gnutls.h" >&5
+echo $ECHO_N "checking for ${GNUTLS_DIR}/include/gnutls/gnutls.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
@@ -17817,8 +17817,8 @@ ac_res=`eval echo '${'$as_ac_Header'}'`
 echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${GNUTLS_DIR}/include/ usability" >&5
-echo $ECHO_N "checking ${GNUTLS_DIR}/include/ usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${GNUTLS_DIR}/include/gnutls/gnutls.h usability" >&5
+echo $ECHO_N "checking ${GNUTLS_DIR}/include/gnutls/gnutls.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17826,7 +17826,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${GNUTLS_DIR}/include/>
+#include <${GNUTLS_DIR}/include/gnutls/gnutls.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -17858,15 +17858,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${GNUTLS_DIR}/include/ presence" >&5
-echo $ECHO_N "checking ${GNUTLS_DIR}/include/ presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking ${GNUTLS_DIR}/include/gnutls/gnutls.h presence" >&5
+echo $ECHO_N "checking ${GNUTLS_DIR}/include/gnutls/gnutls.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 <${GNUTLS_DIR}/include/>
+#include <${GNUTLS_DIR}/include/gnutls/gnutls.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -17899,30 +17899,30 @@ 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: ${GNUTLS_DIR}/include/: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for ${GNUTLS_DIR}/include/" >&5
-echo $ECHO_N "checking for ${GNUTLS_DIR}/include/... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking for ${GNUTLS_DIR}/include/gnutls/gnutls.h" >&5
+echo $ECHO_N "checking for ${GNUTLS_DIR}/include/gnutls/gnutls.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
         fi
         CPPFLAGS="${saved_cppflags}"
       else
-        if test "x" != "x" ; then
-            if test "${ac_cv_header_+set}" = set; then
-  { echo "$as_me:$LINENO: checking for " >&5
-echo $ECHO_N "checking for ... $ECHO_C" >&6; }
-if test "${ac_cv_header_+set}" = set; then
+        if test "xgnutls/gnutls.h" != "x" ; then
+            if test "${ac_cv_header_gnutls_gnutls_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for gnutls/gnutls.h" >&5
+echo $ECHO_N "checking for gnutls/gnutls.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_gnutls_gnutls_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
-echo "${ECHO_T}$ac_cv_header_" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_gnutls_gnutls_h" >&5
+echo "${ECHO_T}$ac_cv_header_gnutls_gnutls_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking  usability" >&5
-echo $ECHO_N "checking  usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking gnutls/gnutls.h usability" >&5
+echo $ECHO_N "checking gnutls/gnutls.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17963,7 +17963,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <>
+#include <gnutls/gnutls.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -17995,15 +17995,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking  presence" >&5
-echo $ECHO_N "checking  presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking gnutls/gnutls.h presence" >&5
+echo $ECHO_N "checking gnutls/gnutls.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 <>
+#include <gnutls/gnutls.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -18036,40 +18036,40 @@ 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: : accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: gnutls/gnutls.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: gnutls/gnutls.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5
-echo "$as_me: WARNING: : present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: :     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: :     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5
-echo "$as_me: WARNING: : see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: :     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: :     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: gnutls/gnutls.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: gnutls/gnutls.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: gnutls/gnutls.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: gnutls/gnutls.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: gnutls/gnutls.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: gnutls/gnutls.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: gnutls/gnutls.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for " >&5
-echo $ECHO_N "checking for ... $ECHO_C" >&6; }
-if test "${ac_cv_header_+set}" = set; then
+{ echo "$as_me:$LINENO: checking for gnutls/gnutls.h" >&5
+echo $ECHO_N "checking for gnutls/gnutls.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_gnutls_gnutls_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_=$ac_header_preproc
+  ac_cv_header_gnutls_gnutls_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5
-echo "${ECHO_T}$ac_cv_header_" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_gnutls_gnutls_h" >&5
+echo "${ECHO_T}$ac_cv_header_gnutls_gnutls_h" >&6; }
 
 fi
-if test $ac_cv_header_ = yes; then
+if test $ac_cv_header_gnutls_gnutls_h = yes; then
   GNUTLS_HEADER_FOUND=1
 else
   GNUTLS_HEADER_FOUND=0
@@ -18116,9 +18116,6 @@ echo "$as_me: *** without explicitly specifying --with-${GNUTLS_OPTION}" >&6;}
    fi
 fi
 
-   if test "${PBX_GNUTLS}" = 1; then
-      IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -lz -lgcrypt -lgpg-error"
-   fi
 fi
 
 if test "${USE_IMAP_TK}" != "no"; then
@@ -22236,6 +22233,8 @@ echo "$as_me: *** without explicitly specifying --with-${OGG_OPTION}" >&6;}
 fi
 
 
+if test "$PBX_OPENSSL" = "1";
+then
 
 if test "${USE_OSPTK}" != "no"; then
    pbxlibdir=""
@@ -22634,6 +22633,7 @@ echo "$as_me: *** without explicitly specifying --with-${OSPTK_OPTION}" >&6;}
    fi
 fi
 
+fi
 
 if test "${USE_OSS}" != "no"; then
 PBX_OSS=0
index c33724886f1dfb4e3999e131419083ed2500aa02..16693c473e91a5466b9097f73fa7fca9c7be4862 100644 (file)
@@ -422,10 +422,7 @@ fi
 AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
 
 if test "${PBX_IKSEMEL}" = 1; then
-   AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye])
-   if test "${PBX_GNUTLS}" = 1; then
-      IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -lz -lgcrypt -lgpg-error"
-   fi
+   AST_EXT_LIB_CHECK([GNUTLS], [gnutls], [gnutls_bye], [gnutls/gnutls.h], [-lz -lgcrypt -lgpg-error])
 fi
 
 if test "${USE_IMAP_TK}" != "no"; then
@@ -697,7 +694,10 @@ AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [-lltdl])
 
 AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
 
-AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
+if test "$PBX_OPENSSL" = "1";
+then
+    AST_EXT_LIB_CHECK([OSPTK], [osptk], [OSPPCryptoDecrypt], [osp/osp.h], [-lcrypto -lssl])
+fi
 
 if test "${USE_OSS}" != "no"; then
 PBX_OSS=0
index d4b57c416c659c8fa10aa9ad8a5fb5412f933f75..52e1e6bdc87228af36f160d0f3f2f3e0f7151e7a 100644 (file)
@@ -89,6 +89,9 @@ GTK2_LIB=@GTK2_LIB@
 IKSEMEL_INCLUDE=@IKSEMEL_INCLUDE@
 IKSEMEL_LIB=@IKSEMEL_LIB@
 
+GNUTLS_INCLUDE=@GNUTLS_INCLUDE@
+GNUTLS_LIB=@GNUTLS_LIB@
+
 IMAP_TK_INCLUDE=@IMAP_TK_INCLUDE@
 IMAP_TK_LIB=@IMAP_TK_LIB@
 
index faf1a0202aec5a263be7eacbec2ddddef759cd25..a318387004275e9e7bd3d793ede62dae87e3a86c 100644 (file)
@@ -23,6 +23,7 @@
 
 /*** MODULEINFO
        <depend>iksemel</depend>
+       <use>gnutls</use>
  ***/
 
 #include "asterisk.h"