From: J. Ali Harlow Date: Mon, 20 Feb 2012 19:28:38 +0000 (+0000) Subject: Overload --disable-shared to also build static executables. X-Git-Tag: 0.5.4~2 X-Git-Url: http://project.juiblex.co.uk/git/?a=commitdiff_plain;h=33a024afb69a68ee6098d6b5e3cd81202914f48a;p=razor.git Overload --disable-shared to also build static executables. --- diff --git a/configure.ac b/configure.ac index 98ebf5f..b3aed81 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,34 @@ AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([sys/mman.h]) gl_INIT AC_CHECK_FUNCS([symlink chroot]) -AC_LIBTOOL_WIN32_DLL -AM_PROG_LIBTOOL +LT_INIT([win32-dll]) +# Libtool supports a --disable-shared option to tell it to avoid +# building shared versions of libraries. In addition to this,we want +# to support building static versions of our executables. Libtool +# can do this (under the right circumstances) so we overload this +# switch for this purpose. +# +# The libtool option that we use (-static-libtool-libs) means to use +# static linking with libraries that supply a .la file and which +# include a non-empty value for "old_library". If the library doesn't +# include a .la file (they are deleted by some distributions), then +# this option will have no effect and likewise if old_library is set +# to '' (eg., if the library was build with --disable-static) then +# again -static-libtool-libs will have no effect. +# +# If old_library is set to a non-empty value, then specifying +# -static-libtool-libs will cause the link to fail if the old library +# cannot be found (libtool will not fallback to a shared library +# in these circumstances). This can happen with Fedora, for example, +# if a main mingw32 library package is installed but not the +# coresponding static sub-package. The solution is to either +# install the relevant static sub-packages or don't use --disable-shared. +AS_IF([test "$enable_shared" = no],[ + LDFLAGS="$LDFLAGS -static-libtool-libs" +]) +LT_OUTPUT +ac_compile="./libtool --mode=compile --tag=CC $ac_compile" +ac_link="./libtool --mode=link --tag=CC $ac_link" AC_PROG_MAKE_SET AC_PROG_LN_S AC_SYS_LARGEFILE