Ticket #8137: libbdnav-remove-openssl.patch

File libbdnav-remove-openssl.patch, 5.3 KB (added by kolbus, 6 years ago)

Patch

  • xbmc/cores/dvdplayer/Codecs/libbdnav/configure.ac

     
    22AC_CONFIG_AUX_DIR([build-aux])
    33AM_INIT_AUTOMAKE([foreign])
    44
    5 
    6 # The big search for OpenSSL
    7 # copied from openssh's configure.ac
    8 tryssldir=""
    9 AC_ARG_WITH(ssl-dir,
    10         [  --with-ssl-dir=PATH     Specify path to OpenSSL installation ],
    11         [
    12                 if test "x$withval" != "xno" ; then
    13                         tryssldir=$withval
    14                 fi
    15         ]
    16 )
    17 
    185AC_PROG_CC
    196
    207AC_PROG_CXX
     
    6047
    6148AC_CHECK_FUNCS([strtoul strtouq strtoull strtoll])
    6249
    63 dnl Where do you live, openssl?  And how do we call you?
    64 AC_ARG_WITH([openssl],
    65             [AS_HELP_STRING([--without-openssl],[Disable openssl support])],
    66             [],
    67             [with_openssl=yes])
    68 
    69 dnl If SSL was NOT disable, then go look for it.
    70 if test x"$with_openssl" != x"no" ; then
    71 
    72 AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssl_dir, [
    73   saved_LIBS="$LIBS"
    74   saved_LDFLAGS="$LDFLAGS"
    75   saved_CPPFLAGS="$CPPFLAGS"
    76   ssl_found=no
    77   for ssldir in $tryssldir "" $prefix /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/athena /usr/pkg /opt /opt/openssl ; do
    78     LDFLAGS="$saved_LDFLAGS"
    79     LIBS="$saved_LIBS -lssl -lcrypto"
    80 
    81     # Skip the directory if it isn't there.
    82     if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
    83        continue;
    84     fi
    85     if test ! -z "$ssldir" ; then
    86       if test -d "$ssldir/lib" ; then
    87         LDFLAGS="-L$ssldir/lib $LDFLAGS"
    88       else
    89         LDFLAGS="-L$ssldir $LDFLAGS"
    90       fi
    91       if test -d "$ssldir/include" ; then
    92         CPPFLAGS="-I$ssldir/include $CPPFLAGS"
    93       else
    94         CPPFLAGS="-I$ssldir $CPPFLAGS"
    95       fi
    96     fi
    97     # Can I link it?
    98     AC_TRY_LINK([#include <openssl/rand.h>],
    99        [ RAND_add((void*)0,0,0); ],
    100        [ openssl_linked=yes ], [ openssl_linked=no ])
    101     if test $openssl_linked = yes; then
    102        if test ! -z "$ssldir" ; then
    103          ac_cv_openssl_dir=$ssldir
    104        else
    105          ac_cv_openssl_dir="(system)"
    106        fi
    107        ssl_found=yes
    108        break
    109     fi
    110   done
    111   LIBS="$saved_LIBS"
    112   LDFLAGS="$saved_LDFLAGS"
    113   CPPFLAGS="$saved_CPPFLAGS"
    114   if test $ssl_found = no ; then
    115     AC_MSG_ERROR([Could not find a linkable OpenSSL. You can specify an explicit path using --with-ssl-dir])
    116   fi
    117 ])
    118 AC_DEFINE([WITH_SSL], 1, [Define if we found OpenSSL - Legacy name])
    119 
    120 LIBS="$LIBS -lssl -lcrypto"
    121 if test "$ac_cv_openssl_dir" != "(system)"; then
    122   if test -d "$ac_cv_openssl_dir/lib" ; then
    123     LDFLAGS="-L$ac_cv_openssl_dir/lib $LDFLAGS"
    124     ssl_libdir="$ac_cv_openssl_dir/lib"
    125   else
    126     LDFLAGS="-L$ac_cv_openssl_dir $LDFLAGS"
    127     ssl_libdir="$ac_cv_openssl_dir"
    128   fi
    129   if test -d "$ac_cv_openssl_dir/include" ; then
    130     CPPFLAGS="-I$ac_cv_openssl_dir/include $CPPFLAGS"
    131   else
    132     CPPFLAGS="-I$ac_cv_openssl_dir $CPPFLAGS"
    133   fi
    134 fi
    135 
    136 if test -z $CROSS_COMPILE
    137 then
    138 AC_CACHE_CHECK([whether we need extra options to link OpenSSL],
    139                ac_cv_openssl_linker_option, [
    140     saved_LDFLAGS="$LDFLAGS"
    141     ssl_runs=no
    142     linked_with=nothing
    143     for ssl_extra in "" "-Wl,-R$ssl_libdir" "-R$ssl_libdir" ; do
    144       LDFLAGS="$ssl_extra $saved_LDFLAGS"
    145       AC_TRY_RUN([
    146 #include <string.h>
    147 #include <openssl/rand.h>
    148 int main(void)
    149 {
    150         char a[2048];
    151         memset(a, 0, sizeof(a));
    152         RAND_add(a, sizeof(a), sizeof(a));
    153         return(RAND_status() <= 0);
    154 }
    155                         ],
    156                 openssl_runs=yes, openssl_runs=no)
    157       if test $openssl_runs = yes ; then
    158         if test "$linked_with" = nothing; then
    159            linked_with="$ssl_extra"
    160         fi
    161         AC_TRY_RUN([
    162 #include <openssl/opensslv.h>
    163 #include <openssl/crypto.h>
    164 int main(void) {
    165 return (OPENSSL_VERSION_NUMBER == SSLeay()) == 0;
    166 }],
    167         right_version=yes, right_version=no)
    168         if test "$right_version" = yes; then
    169           if test -z "$ssl_extra" ; then
    170             ac_cv_openssl_linker_option='(none)'
    171           else
    172             ac_cv_openssl_linker_option=$ssl_extra
    173           fi
    174           ssl_runs=yes
    175           break
    176         fi
    177      fi
    178     done
    179     if test $ssl_runs = no ; then
    180       if test "$linked_with" = 'nothing' ; then
    181         AC_MSG_ERROR([Found linkable OpenSSL in $ac_cv_openssl_dir, but it doesn't run, even with -R.  Maybe specify another using --with-ssl-dir?])
    182       else
    183         if test -z "$linked_with" ; then
    184             ac_cv_openssl_linker_option='(none)'
    185         else
    186             ac_cv_openssl_linker_option=$linked_with
    187         fi
    188         AC_MSG_WARN([I managed to make OpenSSL link and run, but I couldn't make it link against the same version I found header files for.])
    189       fi
    190     fi
    191     LDFLAGS="$saved_LDFLAGS"
    192 ])
    193 
    194 if test "$ac_cv_openssl_linker_option" != '(none)' ; then
    195    LDFLAGS="$ac_cv_openssl_linker_option $LDFLAGS"
    196 fi
    197 fi
    198 
    199 dnl if NOSSL
    200 fi
    201 
    202 
    203 # Make sure OpenSSL is cool enough to play with the big boys.
    204 AC_CHECK_HEADERS([openssl/ecdsa.h], [], [
    205   AC_MSG_ERROR([Version of OpenSSL does not feature openssl/ecdsa.h, please upgrade]) ]
    206       , [])
    207 
    208 
    20950AM_CONFIG_HEADER(config.h)
    21051
    21152# List all Makefiles here.