diff options
author | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2006-07-14 18:01:52 +0400 |
---|---|---|
committer | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2006-07-14 18:01:52 +0400 |
commit | edc5548cfe200d98b2f00393ae0838cae8ecc94b (patch) | |
tree | 368900099f8294cf20d87cb7e491831c2bc94d63 /moses-cmd | |
parent | d7e5db08561737ba2f62665b9de685596dde9e2b (diff) |
recommit config.in
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@103 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'moses-cmd')
-rw-r--r-- | moses-cmd/config.in | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/moses-cmd/config.in b/moses-cmd/config.in new file mode 100644 index 000000000..0f4b2d35b --- /dev/null +++ b/moses-cmd/config.in @@ -0,0 +1,93 @@ +AC_INIT(src) + +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(moses, 0.1) + +AC_PROG_CXX +AC_LANG_CPLUSPLUS +AC_PROG_RANLIB +#AM_PROG_LIBTOOL + +AC_ARG_WITH(srilm, + [AC_HELP_STRING([--with-srilm=PATH], [(optional) path to SRI's LM toolkit])], + [with_srilm=$withval], + [with_srilm=no] + ) + +AC_ARG_WITH(boost, + [AC_HELP_STRING([--with-srilm=PATH], [path to BOOST libraries])], + [with_boost=$withval], + [with_boost=no] + ) + +AC_ARG_WITH(moses, + [AC_HELP_STRING([--with-moses=PATH], [path to moses library])], + [with_moses=$withval], + [with_moses=no] + ) + +AC_ARG_ENABLE(mysql, AC_HELP_STRING([--enable-mysql], [(optional) build in MySQL support])], + [mysql_flag=yes], [mysql_flag=no]) +if test "x$with_boost" != 'xno' +then + CPPFLAGS="$CPPFLAGS -I${with_boost}" + LDFLAGS="$LDFLAGS -L${with_boost}/lib -L${with_boost}/stage/lib" +fi + +if test "x$with_moses" != 'xno' +then + CPPFLAGS="$CPPFLAGS -I${with_moses}/src" + LDFLAGS="$LDFLAGS -L${with_moses}/src" +fi +LIBS="$LIBS -lmoses" + +AC_CHECK_HEADER([Manager.h], [], [AC_MSG_ERROR([Cannot find moses headers! Use --with-moses=PATH])]) +AC_CHECK_HEADER([boost/algorithm/string.hpp], [], [AC_MSG_ERROR([Cannot find boost. Use --with-boost=PATH])]) +AC_CHECK_HEADER([boost/iostreams/filtering_stream.hpp], [], [AC_MSG_ERROR([Cannot find boost. Use --with-boost=PATH])]) + +if test "$mysql_flag" = 'yes' +then + AC_MYSQLCLIENT(,, + [AC_ERROR([Could not locate mysql client libraries. Try --with-mysql-prefix/-include/-lib])]) + LDFLAGS="$LDFLAGS $MYSQLCLIENT_LDFLAGS" + CPPFLAGS="$CPPFLAGS $MYSQLCLIENT_CPPFLAGS" + LIBS="$LIBS $MYSQLCLIENT_LIBS" + + MYSQLPP_DEVEL + LIBS="$LIBS -lmysqlpp" + + AM_CONDITIONAL([BUILD_MYSQL_SUPPORT], true) +else + AM_CONDITIONAL([BUILD_MYSQL_SUPPORT], false) +fi + +if test "x$with_srilm" != 'xno' +then + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I${with_srilm}/include" + + AC_CHECK_HEADER(Ngram.h, + [AC_DEFINE([HAVE_SRILM], [], [flag for SRILM])], + [AC_MSG_ERROR([Cannot find SRILM!])]) + + LIB_SRILM="-loolm -ldstruct -lmisc" + # ROOT/lib/i686-m64/liboolm.a + # ROOT/lib/i686-m64/libdstruct.a + # ROOT/lib/i686-m64/libmisc.a + MY_ARCH=`${with_srilm}/sbin/machine-type` + LDFLAGS="$LDFLAGS -L${with_srilm}/lib/${MY_ARCH}" + LIBS="$LIBS $LIB_SRILM" + FMTLIBS="$FMTLIBS liboolm.a libdstruct.a libmisc.a" + AM_CONDITIONAL([SRI_LM], true) + AM_CONDITIONAL([INTERNAL_LM], false) +else + echo "Using internal language model (use --with-srilm to change)!" + AM_CONDITIONAL([SRI_LM], false) + AM_CONDITIONAL([INTERNAL_LM], true) +fi + +LIBS="$LIBS -lboost_iostreams-gcc-mt -lboost_filesystem-gcc-mt -lboost_thread-gcc-mt -lz" +FMT_LIBS="$FMT_LIBS libboost_iostreams.a libboost_filesystem.a libboost_thread.a" + + +AC_OUTPUT(Makefile src/Makefile) |