comparison configure.ac @ 1406:96a282e78085

Fix libtomcrypt/libtommath linking order To prevent build failures when using system libtom libraries and linking with --as-needed, LIBTOM_LIBS should be in the order -ltomcrypt -ltommath, not the other way around, ie libs should be prepended to LIBTOM_LIBS as they are found, not appended. Signed-off-by: Andre McCurdy <[email protected]>
author Andre McCurdy <armccurdy@gmail.com>
date Fri, 16 Sep 2016 12:18:23 -0700
parents 94d4038bb34c
children 8d9bad0a1c86
comparison
equal deleted inserted replaced
1321:2535ea9d0a6f 1406:96a282e78085
386 if test "x$enableval" = "xyes"; then 386 if test "x$enableval" = "xyes"; then
387 BUNDLED_LIBTOM=1 387 BUNDLED_LIBTOM=1
388 AC_MSG_NOTICE(Forcing bundled libtom*) 388 AC_MSG_NOTICE(Forcing bundled libtom*)
389 else 389 else
390 BUNDLED_LIBTOM=0 390 BUNDLED_LIBTOM=0
391 AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="$LIBTOM_LIBS -ltommath", 391 AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="-ltommath $LIBTOM_LIBS",
392 [AC_MSG_ERROR([Missing system libtommath and --disable-bundled-libtom was specified])] ) 392 [AC_MSG_ERROR([Missing system libtommath and --disable-bundled-libtom was specified])] )
393 AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="$LIBTOM_LIBS -ltomcrypt", 393 AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="-ltomcrypt $LIBTOM_LIBS",
394 [AC_MSG_ERROR([Missing system libtomcrypt and --disable-bundled-libtom was specified])] ) 394 [AC_MSG_ERROR([Missing system libtomcrypt and --disable-bundled-libtom was specified])] )
395 fi 395 fi
396 ], 396 ],
397 [ 397 [
398 BUNDLED_LIBTOM=0 398 BUNDLED_LIBTOM=0
399 AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="$LIBTOM_LIBS -ltommath", BUNDLED_LIBTOM=1) 399 AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="-ltommath $LIBTOM_LIBS", BUNDLED_LIBTOM=1)
400 AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="$LIBTOM_LIBS -ltomcrypt", BUNDLED_LIBTOM=1) 400 AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="-ltomcrypt $LIBTOM_LIBS", BUNDLED_LIBTOM=1)
401 ] 401 ]
402 ) 402 )
403 403
404 if test $BUNDLED_LIBTOM = 1 ; then 404 if test $BUNDLED_LIBTOM = 1 ; then
405 AC_DEFINE(BUNDLED_LIBTOM,,Use bundled libtom) 405 AC_DEFINE(BUNDLED_LIBTOM,,Use bundled libtom)