# HG changeset patch # User Matt Johnston # Date 1392728607 -28800 # Node ID 4f1988cb79cee325c2a4a04c1823aa88a71eb833 # Parent 5d3e917bb7a644793e66453f31e43916f21c3b12 Fix building with system libtomcrypt/libtommath diff -r 5d3e917bb7a6 -r 4f1988cb79ce Makefile.in --- a/Makefile.in Mon Feb 17 22:05:59 2014 +0800 +++ b/Makefile.in Tue Feb 18 21:03:27 2014 +0800 @@ -13,13 +13,15 @@ PROGRAMS=dropbear dbclient dropbearkey dropbearconvert endif -LTC=libtomcrypt/libtomcrypt.a -LTM=libtommath/libtommath.a +STATIC_LTC=libtomcrypt/libtomcrypt.a +STATIC_LTM=libtommath/libtommath.a + +LIBTOM_LIBS=@LIBTOM_LIBS@ ifeq (@BUNDLED_LIBTOM@, 1) -LIBTOM_DEPS=$(LTC) $(LTM) +LIBTOM_DEPS=$(STATIC_LTC) $(STATIC_LTM) CFLAGS+=-I$(srcdir)/libtomcrypt/src/headers/ -LIBTOM_LIBS+=$(LTC) $(LTM) +LIBTOM_LIBS=$(STATIC_LTC) $(STATIC_LTM) endif COMMONOBJS=dbutil.o buffer.o \ @@ -192,10 +194,10 @@ -rm -f $*$(EXEEXT) -ln -s dropbearmulti$(EXEEXT) $*$(EXEEXT) -$(LTC): options.h +$(STATIC_LTC): options.h cd libtomcrypt && $(MAKE) -$(LTM): options.h +$(STATIC_LTM): options.h cd libtommath && $(MAKE) .PHONY : clean sizes thisclean distclean tidy ltc-clean ltm-clean diff -r 5d3e917bb7a6 -r 4f1988cb79ce configure.ac --- a/configure.ac Mon Feb 17 22:05:59 2014 +0800 +++ b/configure.ac Tue Feb 18 21:03:27 2014 +0800 @@ -371,16 +371,16 @@ AC_MSG_NOTICE(Forcing bundled libtom*) else BUNDLED_LIBTOM=0 - AC_CHECK_LIB(tommath, mp_exptmod, , - [AC_MSG_ERROR([Missing system libtomcrypt and --disable-bundled-libtom was specified])] ) - AC_CHECK_LIB(tomcrypt, register_cipher, , + AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="$LIBTOM_LIBS -ltommath", + [AC_MSG_ERROR([Missing system libtommath and --disable-bundled-libtom was specified])] ) + AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="$LIBTOM_LIBS -ltomcrypt", [AC_MSG_ERROR([Missing system libtomcrypt and --disable-bundled-libtom was specified])] ) fi ], [ BUNDLED_LIBTOM=0 - AC_CHECK_LIB(tommath, mp_exptmod, , BUNDLED_LIBTOM=1) - AC_CHECK_LIB(tomcrypt, register_cipher, , BUNDLED_LIBTOM=1) + AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="$LIBTOM_LIBS -ltommath", BUNDLED_LIBTOM=1) + AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="$LIBTOM_LIBS -ltomcrypt", BUNDLED_LIBTOM=1) ] ) @@ -388,6 +388,7 @@ AC_DEFINE(BUNDLED_LIBTOM,,Use bundled libtom) fi +AC_SUBST(LIBTOM_LIBS) AC_SUBST(BUNDLED_LIBTOM) dnl Added from OpenSSH 3.6.1p2's configure.ac