[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r1660 - trunk/utils/m4

Jakob Schlyter jakob at kirei.se
Wed Aug 19 10:06:43 CEST 2009


Author: jakob
Date: 2009-08-19 10:06:43 +0200 (Wed, 19 Aug 2009)
New Revision: 1660

Modified:
   trunk/utils/m4/acx_libhsm.m4
Log:
tweek libhsm detection a bit


Modified: trunk/utils/m4/acx_libhsm.m4
===================================================================
--- trunk/utils/m4/acx_libhsm.m4	2009-08-19 07:57:08 UTC (rev 1659)
+++ trunk/utils/m4/acx_libhsm.m4	2009-08-19 08:06:43 UTC (rev 1660)
@@ -9,38 +9,39 @@
 			LIBHSM_PATH="/usr/local"
 		])
 
-	AC_MSG_CHECKING(what are the libhsm includes)
-	LIBHSM_INCLUDES="-I$LIBHSM_PATH/include"
-	AC_MSG_RESULT($LIBHSM_INCLUDES)
-
-	AC_MSG_CHECKING(what are the libhsm libs)
-	LIBHSM_LIBS="-L$LIBHSM_PATH/lib -lhsm"
-	AC_MSG_RESULT($LIBHSM_INCLUDES)
-
 	tmp_CPPFLAGS=$CPPFLAGS
 	tmp_LIBS=$LIBS
 
-	CPPFLAGS="$CPPFLAGS $XML2_INCLUDES $LIBHSM_INCLUDES"
-	LIBS="$LIBS -L$LIBHSM_PATH/lib"
+	BUILD_LIBHSM=""
 
-	BUILD_LIBHSM=""
-	
 	ACX_ABS_SRCDIR # defines ac_sub_srcdir as an absolute path
 	
-	# dnl ok we don't have an installed library, use the source
-	# (makefile will figure it out)
-	if test ! -f $ac_sub_srcdir/../libhsm/config.h; then
+	if test -f ../libhsm/config.h; then
+		AC_MSG_NOTICE([using libhsm from source tree])
+		LIBHSM_INCLUDES="-I$ac_sub_srcdir/../libhsm/src"
+		LIBHSM_LIBS="-L../../libhsm/src/.libs -lhsm"
+		BUILD_LIBHSM="../../libhsm/src/libhsm.la"
+	else
+		AC_MSG_NOTICE([no libhsm in source tree, looking elsewhere])
+	
+		AC_MSG_CHECKING(what are the libhsm includes)
+		LIBHSM_INCLUDES="-I$LIBHSM_PATH/include"
+		AC_MSG_RESULT($LIBHSM_INCLUDES)
+
+		AC_MSG_CHECKING(what are the libhsm libs)
+		LIBHSM_LIBS="-L$LIBHSM_PATH/lib -lhsm"
+		AC_MSG_RESULT($LIBHSM_INCLUDES)
+
+		CPPFLAGS="$CPPFLAGS $XML2_INCLUDES $LIBHSM_INCLUDES"
+		LIBS="$LIBS -L$LIBHSM_PATH/lib"
+
 		AC_CHECK_HEADERS(libhsm.h, [
 			AC_CHECK_LIB(hsm,hsm_create_context,, [
-				AC_MSG_ERROR([libhsm not found on system, and libhsm source not present, use --with-libhsm=path.])
-			])
+				AC_MSG_ERROR([libhsm not found on system and libhsm source not present; use --with-libhsm=path])
+				])
 		], [
-			AC_MSG_ERROR([libhsm headers not found in source tree or on system])
+			AC_MSG_ERROR([libhsm not found in source tree nor on system])
 		])
-	else
-		LIBHSM_INCLUDES="$LIBHSM_INCLUDE -I$ac_sub_srcdir/../libhsm/src"
-		LIBHSM_LIBS="$LIBHSM_LIBS -L../../libhsm/src/.libs"
-		BUILD_LIBHSM="../../libhsm/src/libhsm.la"
 	fi
 
 	CPPFLAGS=$tmp_CPPFLAGS




More information about the Opendnssec-commits mailing list