Ignore:
Timestamp:
Jan 15, 2018 8:52:29 AM (6 years ago)
Author:
ming
Message:

Re #2082: Initial implementation of GnuTLS support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/aconfigure

    r5679 r5725  
    643643ac_no_opencore_amrwb 
    644644ac_no_opencore_amrnb 
     645libgnutls_present 
     646gnutls_h_present 
    645647libcrypto_present 
    646648libssl_present 
    647649openssl_h_present 
     650ac_ssl_backend 
    648651ac_ssl_has_aes_gcm 
    649652ac_no_ssl 
     
    759762oldincludedir 
    760763includedir 
    761 runstatedir 
    762764localstatedir 
    763765sharedstatedir 
     
    820822with_ipp_arch 
    821823with_ssl 
     824with_gnutls 
    822825enable_ssl 
    823826with_opencore_amrnb 
     
    884887sharedstatedir='${prefix}/com' 
    885888localstatedir='${prefix}/var' 
    886 runstatedir='${localstatedir}/run' 
    887889includedir='${prefix}/include' 
    888890oldincludedir='/usr/include' 
     
    11371139    silent=yes ;; 
    11381140 
    1139   -runstatedir | --runstatedir | --runstatedi | --runstated \ 
    1140   | --runstate | --runstat | --runsta | --runst | --runs \ 
    1141   | --run | --ru | --r) 
    1142     ac_prev=runstatedir ;; 
    1143   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ 
    1144   | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ 
    1145   | --run=* | --ru=* | --r=*) 
    1146     runstatedir=$ac_optarg ;; 
    1147  
    11481141  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) 
    11491142    ac_prev=sbindir ;; 
     
    12831276                datadir sysconfdir sharedstatedir localstatedir includedir \ 
    12841277                oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ 
    1285                 libdir localedir mandir runstatedir 
     1278                libdir localedir mandir 
    12861279do 
    12871280  eval ac_val=\$$ac_var 
     
    14361429  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com] 
    14371430  --localstatedir=DIR     modifiable single-machine data [PREFIX/var] 
    1438   --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run] 
    14391431  --libdir=DIR            object code libraries [EPREFIX/lib] 
    14401432  --includedir=DIR        C header files [PREFIX/include] 
     
    15551547  --with-ipp-arch=ARCH    Specify the Intel IPP ARCH suffix, e.g. "64" or 
    15561548                          "em64t. Default is blank for IA32" 
    1557   --with-ssl=DIR          Specify alternate libssl prefix 
     1549  --with-ssl=DIR          Specify alternate SSL library prefix. This option 
     1550                          will try to find OpenSSL first, then if not found, 
     1551                          GnuTLS. To skip OpenSSL finding, use --with-gnutls 
     1552                          option instead. 
     1553  --with-gnutls=DIR       Specify alternate GnuTLS prefix 
    15581554  --with-opencore-amrnb=DIR 
    15591555                          This option is obsolete and replaced by 
     
    78607856 
    78617857 
    7862 if test "x$ac_cross_compile" != "x" -a "x$with_ssl" = "xno"; then 
     7858 
     7859# Check whether --with-gnutls was given. 
     7860if test "${with_gnutls+set}" = set; then : 
     7861  withval=$with_gnutls; 
     7862else 
     7863  with_gnutls=no 
     7864 
     7865fi 
     7866 
     7867 
     7868if test "x$ac_cross_compile" != "x" -a "x$with_ssl" = "xno" -a "x$with_gnutls" = "xno"; then 
    78637869    enable_ssl=no 
    78647870fi 
     
    78667872 
    78677873ac_ssl_has_aes_gcm=0 
     7874 
    78687875 
    78697876# Check whether --enable-ssl was given. 
     
    78787885else 
    78797886 
    7880                 { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for OpenSSL installations.." >&5 
    7881 $as_echo "checking for OpenSSL installations.." >&6; } 
    78827887                if test "x$with_ssl" != "xno" -a "x$with_ssl" != "x"; then 
    78837888                    CFLAGS="$CFLAGS -I$with_ssl/include" 
     
    78877892                fi 
    78887893 
    7889  
    7890  
    7891                 ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" 
     7894                if test "x$with_gnutls" = "xno"; then 
     7895 
     7896                    { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for OpenSSL installations.." >&5 
     7897$as_echo "checking for OpenSSL installations.." >&6; } 
     7898 
     7899 
     7900 
     7901                    ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default" 
    78927902if test "x$ac_cv_header_openssl_ssl_h" = xyes; then : 
    78937903  openssl_h_present=1 
     
    78957905 
    78967906 
    7897                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_load_BIO_strings in -lcrypto" >&5 
     7907                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ERR_load_BIO_strings in -lcrypto" >&5 
    78987908$as_echo_n "checking for ERR_load_BIO_strings in -lcrypto... " >&6; } 
    78997909if ${ac_cv_lib_crypto_ERR_load_BIO_strings+:} false; then : 
     
    79357945fi 
    79367946 
    7937                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_CTX_new in -lssl" >&5 
     7947                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_CTX_new in -lssl" >&5 
    79387948$as_echo_n "checking for SSL_CTX_new in -lssl... " >&6; } 
    79397949if ${ac_cv_lib_ssl_SSL_CTX_new+:} false; then : 
     
    79757985fi 
    79767986 
    7977                 if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then 
     7987                    if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then 
    79787988                        { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL library found, SSL support enabled" >&5 
    79797989$as_echo "OpenSSL library found, SSL support enabled" >&6; } 
     
    80518061                        $as_echo "#define PJ_HAS_SSL_SOCK 1" >>confdefs.h 
    80528062 
    8053                 else 
    8054                         { $as_echo "$as_me:${as_lineno-$LINENO}: result: ** OpenSSL libraries not found, disabling SSL support **" >&5 
    8055 $as_echo "** OpenSSL libraries not found, disabling SSL support **" >&6; } 
     8063                        $as_echo "#define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_OPENSSL" >>confdefs.h 
     8064 
     8065                        ac_ssl_backend="openssl" 
     8066                    else 
     8067                        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ** OpenSSL libraries not found **" >&5 
     8068$as_echo "** OpenSSL libraries not found **" >&6; } 
     8069                    fi 
     8070 
    80568071                fi 
     8072 
     8073                if test "x$ac_ssl_backend" = "x"; then 
     8074 
     8075                    if test "x$with_gnutls" != "xno" -a "x$with_gnutls" != "x"; then 
     8076                        CFLAGS="$CFLAGS -I$with_gnutls/include" 
     8077                        LDFLAGS="$LDFLAGS -L$with_gnutls/lib" 
     8078                        { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using GnuTLS prefix... $with_gnutls" >&5 
     8079$as_echo "Using GnuTLS prefix... $with_gnutls" >&6; } 
     8080                    fi 
     8081 
     8082                    for ac_prog in $host-pkg-config pkg-config "python pkgconfig.py" 
     8083do 
     8084  # Extract the first word of "$ac_prog", so it can be a program name with args. 
     8085set dummy $ac_prog; ac_word=$2 
     8086{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 
     8087$as_echo_n "checking for $ac_word... " >&6; } 
     8088if ${ac_cv_prog_PKG_CONFIG+:} false; then : 
     8089  $as_echo_n "(cached) " >&6 
     8090else 
     8091  if test -n "$PKG_CONFIG"; then 
     8092  ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test. 
     8093else 
     8094as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 
     8095for as_dir in $PATH 
     8096do 
     8097  IFS=$as_save_IFS 
     8098  test -z "$as_dir" && as_dir=. 
     8099    for ac_exec_ext in '' $ac_executable_extensions; do 
     8100  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 
     8101    ac_cv_prog_PKG_CONFIG="$ac_prog" 
     8102    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 
     8103    break 2 
     8104  fi 
     8105done 
     8106  done 
     8107IFS=$as_save_IFS 
     8108 
     8109fi 
     8110fi 
     8111PKG_CONFIG=$ac_cv_prog_PKG_CONFIG 
     8112if test -n "$PKG_CONFIG"; then 
     8113  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 
     8114$as_echo "$PKG_CONFIG" >&6; } 
     8115else 
     8116  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
     8117$as_echo "no" >&6; } 
     8118fi 
     8119 
     8120 
     8121  test -n "$PKG_CONFIG" && break 
     8122done 
     8123test -n "$PKG_CONFIG" || PKG_CONFIG="none" 
     8124 
     8125                    { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for GnuTLS installations.." >&5 
     8126$as_echo "checking for GnuTLS installations.." >&6; } 
     8127 
     8128 
     8129                    ac_fn_c_check_header_mongrel "$LINENO" "gnutls/gnutls.h" "ac_cv_header_gnutls_gnutls_h" "$ac_includes_default" 
     8130if test "x$ac_cv_header_gnutls_gnutls_h" = xyes; then : 
     8131  gnutls_h_present=1 
     8132fi 
     8133 
     8134 
     8135 
     8136                    if test "$PKG_CONFIG" != "none"; then 
     8137                        if $PKG_CONFIG --exists gnutls; then 
     8138                            LIBS="$LIBS `$PKG_CONFIG --libs gnutls`" 
     8139                            libgnutls_present=1 
     8140                        else 
     8141                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls_certificate_set_x509_system_trust in -lgnutls" >&5 
     8142$as_echo_n "checking for gnutls_certificate_set_x509_system_trust in -lgnutls... " >&6; } 
     8143if ${ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust+:} false; then : 
     8144  $as_echo_n "(cached) " >&6 
     8145else 
     8146  ac_check_lib_save_LIBS=$LIBS 
     8147LIBS="-lgnutls  $LIBS" 
     8148cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     8149/* end confdefs.h.  */ 
     8150 
     8151/* Override any GCC internal prototype to avoid an error. 
     8152   Use char because int might match the return type of a GCC 
     8153   builtin and then its argument prototype would still apply.  */ 
     8154#ifdef __cplusplus 
     8155extern "C" 
     8156#endif 
     8157char gnutls_certificate_set_x509_system_trust (); 
     8158int 
     8159main () 
     8160{ 
     8161return gnutls_certificate_set_x509_system_trust (); 
     8162  ; 
     8163  return 0; 
     8164} 
     8165_ACEOF 
     8166if ac_fn_c_try_link "$LINENO"; then : 
     8167  ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust=yes 
     8168else 
     8169  ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust=no 
     8170fi 
     8171rm -f core conftest.err conftest.$ac_objext \ 
     8172    conftest$ac_exeext conftest.$ac_ext 
     8173LIBS=$ac_check_lib_save_LIBS 
     8174fi 
     8175{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust" >&5 
     8176$as_echo "$ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust" >&6; } 
     8177if test "x$ac_cv_lib_gnutls_gnutls_certificate_set_x509_system_trust" = xyes; then : 
     8178  libgnutls_present=1 && 
     8179                              LIBS="$LIBS -lgnutls" 
     8180fi 
     8181 
     8182                        fi 
     8183                    else 
     8184                        { $as_echo "$as_me:${as_lineno-$LINENO}: result: *** Warning: neither pkg-config nor python is available, disabling gnutls. ***" >&5 
     8185$as_echo "*** Warning: neither pkg-config nor python is available, disabling gnutls. ***" >&6; } 
     8186                    fi 
     8187 
     8188                    if test "x$gnutls_h_present" = "x1" -a "x$libgnutls_present" = "x1"; then 
     8189                        { $as_echo "$as_me:${as_lineno-$LINENO}: result: GnuTLS library found, SSL support enabled" >&5 
     8190$as_echo "GnuTLS library found, SSL support enabled" >&6; } 
     8191                        $as_echo "#define PJ_HAS_SSL_SOCK 1" >>confdefs.h 
     8192 
     8193                        $as_echo "#define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_GNUTLS" >>confdefs.h 
     8194 
     8195                        ac_ssl_backend="gnutls" 
     8196                    else 
     8197                        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ** No GnuTLS libraries found, disabling SSL support **" >&5 
     8198$as_echo "** No GnuTLS libraries found, disabling SSL support **" >&6; } 
     8199                    fi 
     8200 
     8201                fi 
    80578202 
    80588203fi 
Note: See TracChangeset for help on using the changeset viewer.