diff configure.in @ 585:d194db6f9453

Use system libtomcrypt/libtommath if available. Doesn't currently build due to clash in rsa_key identifier.
author Matt Johnston <matt@ucc.asn.au>
date Wed, 21 Jul 2010 12:38:46 +0000
parents d3ea8b9672f0
children 1151059c5eff
line wrap: on
line diff
--- a/configure.in	Tue Jul 20 13:54:20 2010 +0000
+++ b/configure.in	Wed Jul 21 12:38:46 2010 +0000
@@ -363,6 +363,23 @@
 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_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.)