* Remove --disable-shared-library switch and handle static library build
authorMilan Broz <gmazyland@gmail.com>
Mon, 18 Oct 2010 14:47:35 +0000 (14:47 +0000)
committerMilan Broz <gmazyland@gmail.com>
Mon, 18 Oct 2010 14:47:35 +0000 (14:47 +0000)
  by common libtool logic (using --enable-static).
* Add --enable-static-cryptsetup option to build cryptsetup.static binary
  together with shared build.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@344 36d66b0a-2a48-0410-832c-cd162a569da5

ChangeLog
configure.in
lib/Makefile.am

index 55e6ce9..bf9915a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,8 +2,10 @@
        * Add crypt_get_device_name() to API (get underlying device name).
        * Change detection for static libraries.
        * Fix pkg-config use in automake scripts.
-       * Build statically linked binary (cryptsetup.static) together with shared build
-         if --enable-static is specified.
+       * Remove --disable-shared-library switch and handle static library build
+         by common libtool logic (using --enable-static).
+       * Add --enable-static-cryptsetup option to build cryptsetup.static binary
+         together with shared build.
 
 2010-08-05  Milan Broz  <mbroz@redhat.com>
        * Wipe iteration and salt after KillSlot in LUKS header.
index 264aba9..5db07f1 100644 (file)
@@ -68,16 +68,23 @@ LIBS=$saved_LIBS
 dnl ==========================================================================
 saved_LIBS=$LIBS
 
-AC_ARG_ENABLE(shared-library,
-[  --disable-shared-library
-                          disable building of shared cryptsetup library],,
-enable_shared_library=yes)
-AM_CONDITIONAL(STATIC_LIBRARY, test x$enable_shared_library = xno)
+AC_ARG_ENABLE([static-cryptsetup],
+       AS_HELP_STRING([--enable-static-cryptsetup],
+       [enable build of static cryptsetup binary]), [
+       if test x$enable_static = xno; then
+               AC_MSG_WARN([Requested static cryptsetup build, enabling static library.])
+               enable_static=yes
+       fi
+       enable_static_cryptsetup=yes])
+AM_CONDITIONAL(STATIC_CRYPTSETUP, test x$enable_static_cryptsetup = xyes)
 
 AC_ARG_ENABLE(selinux,
-[  --disable-selinux       disable selinux support [[default=auto]]],[], [])
+       AS_HELP_STRING([--disable-selinux],
+       [disable selinux support [default=auto]]),[], [])
 
-AC_ARG_ENABLE([udev],AS_HELP_STRING([--disable-udev],[disable udev support]),[], enable_udev=yes)
+AC_ARG_ENABLE([udev],
+       AS_HELP_STRING([--disable-udev],
+       [disable udev support]),[], enable_udev=yes)
 
 dnl Try to use pkg-config for devmapper, but fallback to old detection
 PKG_CHECK_MODULES([DEVMAPPER], [devmapper >= 1.02.03],, [
@@ -101,7 +108,7 @@ fi
 LIBS=$saved_LIBS
 
 dnl Magic for cryptsetup.static build.
-if test x$enable_static = xyes; then
+if test x$enable_static_cryptsetup = xyes; then
        saved_PKG_CONFIG=$PKG_CONFIG
        PKG_CONFIG="$PKG_CONFIG --static"
 
@@ -166,10 +173,6 @@ CS_STR_WITH([luks1-cipher], [cipher for LUKS1], [aes])
 CS_STR_WITH([luks1-mode],   [cipher mode for LUKS1], [cbc-essiv:sha256])
 CS_NUM_WITH([luks1-keybits],[key length in bits for LUKS1], [256])
 
-dnl ==========================================================================
-
-AM_CONDITIONAL(STATIC_CRYPTSETUP, test x$enable_static = xyes)
-AM_CONDITIONAL(DYNAMIC_CRYPTSETUP, test x$enable_static = xno)
 
 dnl ==========================================================================
 
index 6068751..635e6c6 100644 (file)
@@ -17,14 +17,9 @@ INCLUDES = \
 
 lib_LTLIBRARIES = libcryptsetup.la
 
-if STATIC_LIBRARY
-_STATIC_LIBRARY = -static
-endif
-
 libcryptsetup_la_DEPENDENCIES = libcryptsetup.sym
 
 libcryptsetup_la_LDFLAGS = \
-       $(_STATIC_LIBRARY) \
        -Wl,--version-script=$(top_srcdir)/lib/libcryptsetup.sym \
        -version-info @LIBCRYPTSETUP_VERSION_INFO@