Ignore:
Timestamp:
Mar 26, 2019 7:25:57 AM (5 years ago)
Author:
ming
Message:

Re #2185: Darwin SSL backend

  • Security framework availability will be automatically detected for Mac OS and iOS, and if found, Darwin SSL will be the default SSL backend.
  • OpenSSL availability will still be checked regardless of the above result, as it may be needed for DTLS.
  • Add configure option --disable-darwin-ssl to disable the automatic detection
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/aconfigure.ac

    r5957 r5959  
    15421542dnl # SSL alt prefix 
    15431543AC_ARG_WITH(ssl, 
    1544     AS_HELP_STRING([--with-ssl=SSL_BACKEND/DIR], 
    1545                    [Specify alternate SSL library prefix or SSL native-backend. 
    1546                     You can specify "darwin" as the native iOS/MacOS backend 
    1547                     using Security framework, or you can specify an alternate 
    1548                     SSL library prefix directory. If a directory 
    1549                     is specified, this option will try to find OpenSSL first, 
    1550                     then if not found, GnuTLS. To skip OpenSSL finding, use 
    1551                     --with-gnutls option instead.]), 
     1544    AS_HELP_STRING([--with-ssl=DIR], 
     1545                   [Specify alternate SSL library prefix. This option will try 
     1546                    to find OpenSSL first, then if not found, GnuTLS. To skip 
     1547                    OpenSSL finding, use --with-gnutls option instead.]), 
    15521548    [], 
    15531549    [with_ssl=no] 
     
    15711567AC_SUBST(ac_ssl_has_aes_gcm,0) 
    15721568AC_SUBST(ac_ssl_backend) 
    1573 AC_ARG_ENABLE(ssl, 
    1574               AS_HELP_STRING([--disable-ssl], 
    1575                              [Exclude SSL support the build (default: autodetect)]) 
    1576               , 
    1577               [ 
    1578                 if test "$enable_ssl" = "no"; then 
    1579                  [ac_no_ssl=1] 
    1580                  AC_MSG_RESULT([Checking if SSL support is disabled... yes]) 
    1581                 fi 
    1582               ], 
    1583               [ 
    1584                 if test "x$with_ssl" = "xdarwin"; then 
     1569 
     1570AC_ARG_ENABLE(darwin-ssl, 
     1571              AS_HELP_STRING([--disable-darwin-ssl], 
     1572                             [Exclude Darwin SSL (default: autodetect)]), 
     1573              [if test "$enable_darwin_ssl" = "no"; then 
     1574                 AC_MSG_RESULT([Checking if Darwin SSL support is disabled... yes]) 
     1575                fi], 
     1576              [ 
     1577                case $target in 
     1578                *darwin*) 
    15851579                    SAVED_LIBS="$LIBS" 
    15861580                    LIBS="-framework Security" 
     
    15921586                        AC_DEFINE(PJ_SSL_SOCK_IMP, PJ_SSL_SOCK_IMP_DARWIN) 
    15931587                        LIBS="$LIBS -framework Security" 
    1594                         ac_ssl_backend="darwin" 
    15951588                        AC_MSG_RESULT([Checking if Security framework for Darwin SSL is available... yes]) 
    15961589                    else 
    15971590                        AC_MSG_RESULT([Checking if Security framework for Darwin SSL is available... no]) 
    15981591                    fi 
    1599                 fi 
    1600                  
    1601                 if test "x$ac_ssl_backend" = "x" -a "x$with_ssl" != "xno" -a "x$with_ssl" != "x"; then 
     1592                    ;; 
     1593                esac 
     1594              ]) 
     1595 
     1596AC_ARG_ENABLE(ssl, 
     1597              AS_HELP_STRING([--disable-ssl], 
     1598                             [Exclude SSL support the build (default: autodetect)]) 
     1599              , 
     1600              [ 
     1601                if test "$enable_ssl" = "no"; then 
     1602                 [ac_no_ssl=1] 
     1603                 AC_MSG_RESULT([Checking if SSL support is disabled... yes]) 
     1604                fi 
     1605              ], 
     1606              [ 
     1607                if test "x$with_ssl" != "xno" -a "x$with_ssl" != "x"; then 
    16021608                    CFLAGS="$CFLAGS -I$with_ssl/include" 
    16031609                    CPPFLAGS="$CPPFLAGS -I$with_ssl/include" 
     
    16061612                fi 
    16071613 
    1608                 if test "x$ac_ssl_backend" = "x" -a "x$with_gnutls" = "xno"; then 
    1609  
     1614                if test "x$with_gnutls" = "xno"; then 
     1615                    # We still need to check for OpenSSL installations even if 
     1616                    # we find Darwin SSL above since DTLS requires OpenSSL. 
    16101617                    AC_MSG_RESULT([checking for OpenSSL installations..]) 
    16111618                    AC_SUBST(openssl_h_present) 
     
    16331640                        fi 
    16341641 
    1635                         # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK 
    1636                         #AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1) 
    1637                         AC_DEFINE(PJ_HAS_SSL_SOCK, 1) 
    1638                         AC_DEFINE(PJ_SSL_SOCK_IMP, PJ_SSL_SOCK_IMP_OPENSSL) 
    1639                         ac_ssl_backend="openssl" 
     1642                        if test "x$ac_ssl_backend" = "x"; then 
     1643                            # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK 
     1644                            #AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1) 
     1645                            AC_DEFINE(PJ_HAS_SSL_SOCK, 1) 
     1646                            AC_DEFINE(PJ_SSL_SOCK_IMP, PJ_SSL_SOCK_IMP_OPENSSL) 
     1647                            ac_ssl_backend="openssl" 
     1648                        fi 
    16401649                    else 
    16411650                        AC_MSG_RESULT([** OpenSSL libraries not found **]) 
Note: See TracChangeset for help on using the changeset viewer.