summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac7
-rw-r--r--decoder/Makefile.am2
-rw-r--r--utils/Makefile.am1
-rw-r--r--word-aligner/Makefile.am1
4 files changed, 10 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index d7ced0ea..eae2f32e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -177,6 +177,13 @@ then
AM_CONDITIONAL([HAVE_GTEST], true)
fi
+# Enable static linking
+AC_ARG_WITH(
+ [static],
+ AS_HELP_STRING([--with-static], [Statically link binaries when possible]),
+ AC_SUBST(AS_TR_CPP([STATIC_FLAGS]), ["-all-static"]),
+)
+
#BOOST_THREADS
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
LDFLAGS="$LDFLAGS $BOOST_PROGRAM_OPTIONS_LDFLAGS $BOOST_REGEX_LDFLAGS $BOOST_SERIALIZATION_LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS"
diff --git a/decoder/Makefile.am b/decoder/Makefile.am
index c85f17ed..02e58479 100644
--- a/decoder/Makefile.am
+++ b/decoder/Makefile.am
@@ -20,7 +20,7 @@ trule_test_SOURCES = trule_test.cc
trule_test_LDADD = $(BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS) $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) libcdec.a ../mteval/libmteval.a ../utils/libutils.a
cdec_SOURCES = cdec.cc
-cdec_LDFLAGS= -rdynamic
+cdec_LDFLAGS= -rdynamic $(STATIC_FLAGS)
cdec_LDADD = libcdec.a ../mteval/libmteval.a ../utils/libutils.a ../klm/search/libksearch.a ../klm/lm/libklm.a ../klm/util/libklm_util.a ../klm/util/double-conversion/libklm_util_double.a
AM_CPPFLAGS = -DTEST_DATA=\"$(top_srcdir)/decoder/test_data\" -DBOOST_TEST_DYN_LINK -W -Wno-sign-compare -I$(top_srcdir) -I$(top_srcdir)/mteval -I$(top_srcdir)/utils -I$(top_srcdir)/klm
diff --git a/utils/Makefile.am b/utils/Makefile.am
index 18495c3a..727fa8a5 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -92,6 +92,7 @@ reconstruct_weights_SOURCES = reconstruct_weights.cc
reconstruct_weights_LDADD = libutils.a
atools_SOURCES = atools.cc
atools_LDADD = libutils.a
+atools_LDFLAGS = $(STATIC_FLAGS)
phmt_SOURCES = phmt.cc
phmt_LDADD = libutils.a $(BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS) $(BOOST_UNIT_TEST_FRAMEWORK_LIBS)
diff --git a/word-aligner/Makefile.am b/word-aligner/Makefile.am
index 075ad009..071e4977 100644
--- a/word-aligner/Makefile.am
+++ b/word-aligner/Makefile.am
@@ -2,6 +2,7 @@ bin_PROGRAMS = fast_align binderiv
fast_align_SOURCES = fast_align.cc ttables.cc da.h ttables.h
fast_align_LDADD = ../utils/libutils.a
+fast_align_LDFLAGS = $(STATIC_FLAGS)
binderiv_SOURCES = binderiv.cc
binderiv_LDADD = ../utils/libutils.a