]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Disable static libraries by default
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 2 Apr 2013 15:52:31 +0000 (16:52 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 3 Apr 2013 10:02:27 +0000 (11:02 +0100)
Every source file is currently built twice by libtool, once for
the shared library and once for the static library. Static libs
are not commonly packaged by distros and slow down compilation
time by more than 50% compared to a shared-only build time.

Time for 'make -j 4':

      shared only: 2 mins  9 secs
  shared + static: 3 mins 26 secs

Time for non-parallel make

      shared only: 3 mins 32 secs
  shared + static: 5 mins 41 secs

Those few people who really want them, can pass --enable-static
to configure

Disabling them by default requires use of LT_INIT, but for
compat with RHEL5 we can't rely on that. So we conditionally
use LT_INIT, but fallback to AM_PROG_LIBTOOL if not present.

autobuild.sh
configure.ac

index b3cb2514b54f62958b4e2366f6c8784167e02486..a8781b0791178fc3d5f168df13a6f0d06d1e4e2a 100755 (executable)
@@ -20,7 +20,8 @@ cd build
 ../autogen.sh --prefix="$AUTOBUILD_INSTALL_ROOT" \
   --enable-test-coverage \
   --disable-nls \
-  --enable-werror
+  --enable-werror \
+  --enable-static
 
 # If the MAKEFLAGS envvar does not yet include a -j option,
 # add -jN where N depends on the number of processors.
index 09e4ad9f7290d6b131694d05420637b60bb96ee8..0df9e5ccd1124177564e21afff59d06f894e7b33 100644 (file)
@@ -123,7 +123,11 @@ AC_TYPE_UID_T
 dnl Support building Win32 DLLs (must appear *before* AM_PROG_LIBTOOL)
 AC_LIBTOOL_WIN32_DLL
 
-AM_PROG_LIBTOOL
+m4_ifndef([LT_INIT], [
+  AM_PROG_LIBTOOL
+], [
+  LT_INIT([shared disable-static])
+])
 AM_PROG_CC_C_O
 AM_PROG_LD