diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-03-10 17:42:04 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-03-10 17:42:04 +0100 |
commit | 67b846c099968439c415ae18fcc6736bdd26e233 (patch) | |
tree | 0c2efc26d2ebd0ab5735c20c2582fd6799da3571 /configure.ac | |
parent | e88f9bb28500bdf2bfe5106b565ab56a0b601239 (diff) | |
download | sciteco-67b846c099968439c415ae18fcc6736bdd26e233.tar.gz |
added ./configure --enable-static-executables option
* This adds the -all-static libtool option and can be used to
link a static sciteco binary (or at least link in as few as possible
dynamic libraries)
* Esp. useful on MinGW to link in all dependant libraries (glib, libintl,
libiconv, libpdcurses, ...) statically.
A static .exe is much smaller than a dynamically linked plus all the
DLLs and is easier to relocate.
* This does not guarantee that ALL libraries are linked in dynamically.
E.g. on MinGW, the sciteco.exe will still link to MSVCRT and the Windows
system DLLs, but they already ship with Windows.
* On MinGW, even a static build will still require the gspawn-win32-helper-console.exe
which is used by glib to implement g_spawn with redirection.
We cannot get around that.
* It would be better to let this be decided by the package builder using
the standard env variables like LDFLAGS. However, this does not seem to
work well with libtool. It IS possible to define LDFLAGS="-all-static" when
calling make but this approach sucks.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index af4220b..3ddf295 100644 --- a/configure.ac +++ b/configure.ac @@ -223,6 +223,20 @@ if [[ $bootstrap = no -a x$SCITECO = x ]]; then fi AM_CONDITIONAL(BOOTSTRAP, [test x$bootstrap = xyes]) +# This cannot be done with --enable-static as it only controls +# which kind of libraries libtool builds. +# Also, it cannot be controlled reliably by setting LDFLAGS for +# ./configure, as this would be used for linking the test cases +# without libtool and libtool would ignore it. +# It is only possible to call `make LDFLAGS="-all-static"` but +# this is inconvenient... +AC_ARG_ENABLE(static-executables, + AS_HELP_STRING([--enable-static-executables], + [Link in as many runtime dependencies as possible + statically [default=no]]), + [static_executables=$enableval], [static_executables=no]) +AM_CONDITIONAL(STATIC_EXECUTABLES, [test x$static_executables = xyes]) + AC_CONFIG_FILES([Makefile src/Makefile lib/Makefile]) AC_CONFIG_FILES([doc/Makefile doc/Doxyfile]) AC_OUTPUT |