diff options
author | Paul Baltescu <pauldb89@gmail.com> | 2013-01-28 11:56:31 +0000 |
---|---|---|
committer | Paul Baltescu <pauldb89@gmail.com> | 2013-01-28 11:56:31 +0000 |
commit | 5530575ae0ad939e17f08d6bd49978acea388ab7 (patch) | |
tree | 4620a276c1c827d824e285148f4f4a5bf781ebfe /configure.ac | |
parent | ce6937f136a38af93d9a5cd9628acc712da95543 (diff) |
Initial working commit.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 87 |
1 files changed, 85 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index eabb8645..21ea5c70 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,7 @@ BOOST_PROGRAM_OPTIONS BOOST_SYSTEM BOOST_SERIALIZATION BOOST_TEST +BOOST_FILESYSTEM AM_PATH_PYTHON AC_CHECK_HEADER(dlfcn.h,AC_DEFINE(HAVE_DLFCN_H)) AC_CHECK_LIB(dl, dlopen) @@ -85,11 +86,92 @@ then AM_CONDITIONAL([HAVE_CMPH], true) fi +AM_CONDITIONAL([HAVE_GTEST], false) +AC_ARG_WITH(gtest, + [AC_HELP_STRING([--with-gtest=DIR], [(optional) path to Google Test library])], + [with_gtest=$withval], + [with_gtest=no] + ) + +if test "x$with_gtest" != 'xno' +then + gtest_CPPFLAGS="-I${with_gtest}/include" + gtest_LDFLAGS="-L${with_gtest} -L${with_gtest}/lib" + gtest_LIBS="-lgtest_main -lgtest -lpthread" + + SAVECPP_FLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $gtest_CPPFLAGS" + AC_CHECK_HEADER(${with_gtest}/include/gtest/gtest.h, + [AC_DEFINE([HAVE_GTEST], [1], [flag for Google Test header])], + [AC_MSG_ERROR([Cannot find Google Test headers!])] + ) + + SAVE_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $gtest_LDFLAGS" + SAVE_LIBS="$LIBS" + # Google Test needs pthreads. + AC_CHECK_LIB([pthread], + [pthread_mutex_init], + [], + [AC_MSG_ERROR([Cannot find pthread library])] + ) + AX_CXX_CHECK_LIB([gtest], + [testing::TestInfo::name() const], + [], + [AC_MSG_ERROR([Cannot find Google Test library libgtest])] + ) + AC_CHECK_LIB([gtest_main], + [main], + [], + [AC_MSG_ERROR([Cannot find Google Test library libgtest_main])] + ) + + AC_SUBST(AS_TR_CPP([GTEST_CPPFLAGS]), ["$gtest_CPPFLAGS"]) + AC_SUBST(AS_TR_CPP([GTEST_LDFLAGS]), ["$gtest_LDFLAGS"]) + AC_SUBST(AS_TR_CPP([GTEST_LIBS]), ["$gtest_LIBS"]) + + AM_CONDITIONAL([HAVE_GMOCK], false) + AC_ARG_WITH(gmock, + [AC_HELP_STRING([--with-gmock=DIR], [(optional) path to Google Mock library])], + [with_gmock=$withval], + [with_gmock=no] + ) + + if test "x$with_gmock" != 'xno' + then + gmock_CPPFLAGS="-I${with_gmock}/include" + gmock_LDFLAGS="-L${with_gmock} -L${with_gmock}/lib" + gmock_LIBS="-lgmock" + + CPPFLAGS="$CPPFLAGS $gmock_CPPFLAGS" + AC_CHECK_HEADER(${with_gmock}/include/gmock/gmock.h, + [AC_DEFINE([HAVE_GMOCK], [1], [flag for Google Mock header])], + [AC_MSG_ERROR([Cannot find Google Mock headers!])] + ) + + LDFLAGS="$LDFLAGS $gmock_LDFLAGS" + AX_CXX_CHECK_LIB([gmock], + [testing::Expectation], + [], + [AC_MSG_ERROR([Cannot find Google Mock library libgmock])] + ) + + AC_SUBST(AS_TR_CPP([GMOCK_CPPFLAGS]), ["$gmock_CPPFLAGS"]) + AC_SUBST(AS_TR_CPP([GMOCK_LDFLAGS]), ["$gmock_LDFLAGS"]) + AC_SUBST(AS_TR_CPP([GMOCK_LIBS]), ["$gmock_LIBS"]) + fi + + CPPFLAGS="$SAVE_CPPFLAGS" + LDFLAGS="$SAVE_LDFLAGS" + LIBS="$SAVE_LIBS" + AM_CONDITIONAL([HAVE_GTEST], true) +fi + #BOOST_THREADS CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" -LDFLAGS="$LDFLAGS $BOOST_PROGRAM_OPTIONS_LDFLAGS $BOOST_SERIALIZATION_LDFLAGS $BOOST_SYSTEM_LDFLAGS" +LDFLAGS="$LDFLAGS $BOOST_PROGRAM_OPTIONS_LDFLAGS $BOOST_SERIALIZATION_LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS" # $BOOST_THREAD_LDFLAGS" -LIBS="$LIBS $BOOST_PROGRAM_OPTIONS_LIBS $BOOST_SERIALIZATION_LIBS $BOOST_SYSTEM_LIBS $ZLIBS" +LIBS="$LIBS $BOOST_PROGRAM_OPTIONS_LIBS $BOOST_SERIALIZATION_LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $ZLIBS" # $BOOST_THREAD_LIBS" AC_CHECK_HEADER(google/dense_hash_map, @@ -106,6 +188,7 @@ AC_CONFIG_FILES([mteval/Makefile]) AC_CONFIG_FILES([mteval/meteor_jar.cc]) AC_CONFIG_FILES([decoder/Makefile]) AC_CONFIG_FILES([python/setup.py]) +AC_CONFIG_FILES([extractor/Makefile]) AC_CONFIG_FILES([word-aligner/Makefile]) # KenLM stuff |