summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2018-09-10 20:10:19 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2018-10-01 14:56:18 +0200
commitd6e762570619f84318ade5b44fdeb2f920637f1f (patch)
tree753c129e6a267da47b70931a1fe6467797942519 /configure.ac
parentMerge pull request #3111 from pacovn/Coverity_1302499_Logically_dead_code (diff)
downloadfrr-d6e762570619f84318ade5b44fdeb2f920637f1f.tar.xz
frr-d6e762570619f84318ade5b44fdeb2f920637f1f.zip
build: add --enable-static-bin option
This option can be used to get statically linked binaries. Note: libfrr.la is removed from modules' library dependency list. This is intentional and explained in a comment in lib/subdir.am. Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'configure.ac')
-rwxr-xr-xconfigure.ac11
1 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 4d18c7997..cf6ba2bf1 100755
--- a/configure.ac
+++ b/configure.ac
@@ -310,7 +310,18 @@ AC_CHECK_TOOL(AR, ar)
dnl -------
dnl libtool
dnl -------
+AC_ARG_ENABLE(static-bin,
+ AS_HELP_STRING([--enable-static-bin], [link binaries statically]))
LT_INIT
+_LT_CONFIG_LIBTOOL([
+ patch -N -i "${srcdir}/m4/libtool-whole-archive.patch" libtool >&AS_MESSAGE_LOG_FD || \
+ AC_MSG_WARN([Could not patch libtool for static linking support. Loading modules into a statically linked daemon will fail.])
+])
+if test "$enable_static_bin" = "yes"; then
+ AC_LDFLAGS="-static"
+fi
+AC_SUBST(AC_LDFLAGS)
+AM_CONDITIONAL([STATIC_BIN], [test "x$enable_static_bin" = "xyes"])
dnl ----------------------
dnl Packages configuration