From cacab413e886e8c90691428e1e3f78b77814945e Mon Sep 17 00:00:00 2001 From: Jelte Jansen Date: Thu, 28 Apr 2011 19:22:20 +0000 Subject: [PATCH] [master] fix BOTAN_LDFLAGS and BOTAN_INCLUDES --- configure.ac | 14 ++++++++++++-- src/lib/cryptolink/Makefile.am | 2 +- src/lib/cryptolink/tests/Makefile.am | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 090d3fb818..ad362c2643 100644 --- a/configure.ac +++ b/configure.ac @@ -392,9 +392,17 @@ if test -z "$with_botan"; then done fi if test "${botan_path}" ; then - CPPFLAGS="$CPPFLAGS -I${botan_path}/include" - LDFLAGS="$LDFLAGS -L${botan_path}/lib -lbotan" + BOTAN_LDFLAGS="-L${botan_path}/lib -lbotan" + BOTAN_INCLUDES="-I${botan_path}/include" + AC_SUBST(BOTAN_LDFLAGS) + AC_SUBST(BOTAN_INCLUDES) fi + +CPPFLAGS_SAVED=$CPPFLAGS +CPPFLAGS="$BOTAN_INCLUDES $CPPFLAGS" +LDFLAGS_SAVED=$LDFLAGS +LDFLAGS="$BOTAN_LDFLAGS $LDFLAGS" + AC_CHECK_HEADERS([botan/botan.h],,AC_MSG_ERROR([Missing required header files.])) AC_LINK_IFELSE( [AC_LANG_PROGRAM([#include @@ -408,6 +416,8 @@ AC_LINK_IFELSE( [AC_MSG_RESULT([checking for Botan library... no]) AC_MSG_ERROR([Needs Botan library 1.8 or higher])] ) +CPPFLAGS=$CPPFLAGS_SAVED +LDFLAGS=$LDFLAGS_SAVED # # Configure Boost header path diff --git a/src/lib/cryptolink/Makefile.am b/src/lib/cryptolink/Makefile.am index 2f5d9c38d0..bbb86bc262 100644 --- a/src/lib/cryptolink/Makefile.am +++ b/src/lib/cryptolink/Makefile.am @@ -1,7 +1,7 @@ SUBDIRS = . tests AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib -AM_CPPFLAGS += $(BOOST_INCLUDES) +AM_CPPFLAGS += $(BOOST_INCLUDES) $(BOTAN_INCLUDES) AM_CXXFLAGS = $(B10_CXXFLAGS) CLEANFILES = *.gcno *.gcda diff --git a/src/lib/cryptolink/tests/Makefile.am b/src/lib/cryptolink/tests/Makefile.am index c8b5e266f4..c3add234bc 100644 --- a/src/lib/cryptolink/tests/Makefile.am +++ b/src/lib/cryptolink/tests/Makefile.am @@ -16,7 +16,7 @@ TESTS += run_unittests run_unittests_SOURCES = run_unittests.cc run_unittests_SOURCES += crypto_unittests.cc run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) -run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) +run_unittests_LDFLAGS = $(BOTAN_LDFLAGS) $(AM_LDFLAGS) $(GTEST_LDFLAGS) run_unittests_LDADD = $(GTEST_LDADD) run_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libcryptolink.la run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la