f1f25b905a0d026580bb1cf48eb30ecb9424d83a
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / sconeserver / 0001-fix-ssl-libs-ordering.patch
1 configure: re-order SSL libs when linking
2
3 When doing static builds, the ordering of libs is important, as the
4 linker does not back-pedal to previous libraries specified on the
5 command line to find missing symbols, and only searches for those
6 missing symbols in the following libs.
7
8 Thus, as -lssl needs symbols from -lcrypto, it needs to come before
9 -lcrypto.
10
11 And globally, we do *not* append new libraries, we prepend them.
12
13 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
14
15 diff -durN a/configure.in b/configure.in
16 --- a/configure.in      2014-10-16 11:12:08.000000000 +0200
17 +++ b/configure.in      2015-05-30 15:44:25.540329788 +0200
18 @@ -133,12 +133,14 @@
19      [AC_MSG_ERROR([header file <openssl/ssl.h> is required for OpenSSL, use --with-openssl-path=PATH])]
20    )
21    AC_CHECK_LIB([crypto],[CRYPTO_new_ex_data],
22 -    [SSL_LIBADD="$SSL_LIBADD -lcrypto"],
23 -    [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])]
24 +    [SSL_LIBADD="-lcrypto $SSL_LIBADD"],
25 +    [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])],
26 +    [$SSL_LIBADD]
27    )
28    AC_CHECK_LIB([ssl],[SSL_library_init],
29 -    [SSL_LIBADD="$SSL_LIBADD -lssl"],
30 -    [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])]
31 +    [SSL_LIBADD="-lssl $SSL_LIBADD"],
32 +    [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])],
33 +    [$SSL_LIBADD]
34    )
35    AC_SUBST(SSL_LIBADD)
36  fi