Commit 4d050c34 authored by Matt Johnston's avatar Matt Johnston
Browse files

Use system libtomcrypt/libtommath if available. Doesn't currently

build due to clash in rsa_key identifier.

--HG--
extra : convert_revision : c9a4726d1c89e17ee8e96801d1aaa8049216aae1
parent a8c28714
......@@ -16,6 +16,12 @@ endif
LTC=libtomcrypt/libtomcrypt.a
LTM=libtommath/libtommath.a
ifeq (@[email protected], 1)
LIBTOM_DEPS=$(LTC) $(LTM)
CFLAGS+=-I$(srcdir)/libtomcrypt/src/headers/
LIBS+=$(LTC) $(LTM)
endif
COMMONOBJS=dbutil.o buffer.o \
dss.o bignum.o \
signkey.o rsa.o random.o \
......@@ -70,8 +76,8 @@ [email protected]@
STRIP=@[email protected]
INSTALL=@[email protected]
CPPFLAGS=@[email protected]
CFLAGS=-I. -I$(srcdir) -I$(srcdir)/libtomcrypt/src/headers/ $(CPPFLAGS) @[email protected]
LIBS=$(LTC) $(LTM) @[email protected]
CFLAGS=-I. -I$(srcdir) $(CPPFLAGS) @[email protected]
LIBS+=@[email protected]
LDFLAGS=@[email protected]
EXEEXT=@[email protected]
......@@ -107,10 +113,6 @@ ifeq ($(SCPPROGRESS), 1)
CFLAGS+=-DPROGRESS_METER
endif
#%: $(HEADERS)
#%: $(HEADERS) Makefile
# TODO
all: $(TARGETS)
strip: $(TARGETS)
......@@ -154,8 +156,7 @@ dbclient: $(dbclientobjs)
dropbearkey: $(dropbearkeyobjs)
dropbearconvert: $(dropbearconvertobjs)
dropbear dbclient dropbearkey dropbearconvert: $(HEADERS) $(LTC) $(LTM) \
Makefile
dropbear dbclient dropbearkey dropbearconvert: $(HEADERS) $(LIBTOM_DEPS) Makefile
$(CC) $(LDFLAGS) -o [email protected]$(EXEEXT) $([email protected]objs) $(LIBS)
# scp doesn't use the libs so is special.
......@@ -172,7 +173,7 @@ endif
dropbearmulti: multilink
multibinary: $(HEADERS) $(MULTIOBJS) $(LTC) $(LTM) Makefile
multibinary: $(HEADERS) $(MULTIOBJS) $(LIBTOM_DEPS) Makefile
$(CC) $(LDFLAGS) -o dropbearmulti$(EXEEXT) $(MULTIOBJS) $(LIBS)
multilink: multibinary $(addprefix link, $(PROGRAMS))
......
......@@ -363,6 +363,23 @@ AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
AC_CHECK_FUNCS(setutxent utmpxname)
AC_CHECK_FUNCS(logout updwtmp logwtmp)
AC_ARG_ENABLE(bundled-libtom,
[ --enable-bundled-libtom Use bundled libtomcrypt/libtommath even if a system version exists],
[
AC_MSG_NOTICE(use bundled)
AC_DEFINE(BUNDLED_LIBTOM,,Use bundled libtom)
BUNDLED_LIBTOM=1
],
[
AC_MSG_NOTICE(not bundled)
BUNDLED_LIBTOM=0
AC_CHECK_LIB(tomcrypt, register_cipher, , BUNDLED_LIBTOM=1)
AC_CHECK_LIB(tommath, mp_exptmod, , BUNDLED_LIBTOM=1)
]
)
AC_SUBST(BUNDLED_LIBTOM)
dnl Added from OpenSSH 3.6.1p2's configure.ac
dnl allow user to disable some login recording features
......@@ -671,5 +688,13 @@ AC_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile)
AC_OUTPUT(libtomcrypt/Makefile)
AC_OUTPUT(libtommath/Makefile)
AC_MSG_NOTICE()
if test $BUNDLED_LIBTOM = 1 ; then
AC_MSG_NOTICE(Using bundled libtomcrypt and libtommath)
else
AC_MSG_NOTICE(Using system libtomcrypt and libtommath)
fi
AC_MSG_NOTICE()
AC_MSG_NOTICE(Now edit options.h to choose features.)
......@@ -120,8 +120,14 @@
#include <libgen.h>
#endif
#ifdef BUNDLED_LIBTOM
#include "libtomcrypt/src/headers/tomcrypt.h"
#include "libtommath/tommath.h"
#else
#include <tomcrypt.h>
#include <tommath.h>
#endif
#include "compat.h"
#include "fake-rfc2553.h"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment