mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
configure.ac: handle --disable-shared flag
Since LVM 2.02 it appears that compiling LVM on a platform which lacks a shared library linker/loader will fail to produce any binaries (dmsetup, lvm2, etc). Adds support for the standard --disable-shared flag, and use it to disable attempts at building shared libraries. Modified-by: zkabelac
This commit is contained in:
parent
fb124f0839
commit
dc8837f079
14
configure.ac
14
configure.ac
@ -185,6 +185,14 @@ AC_ARG_ENABLE(static_link,
|
||||
STATIC_LINK=$enableval, STATIC_LINK="no")
|
||||
AC_MSG_RESULT([$STATIC_LINK])
|
||||
|
||||
################################################################################
|
||||
dnl -- Disables shared linking
|
||||
AC_MSG_CHECKING([whether to use dynamic linking])
|
||||
AC_ARG_ENABLE(shared,
|
||||
AS_HELP_STRING([--disable-shared], [disable dynamic linking]),
|
||||
SHARED_LINK=$enableval, SHARED_LINK="yes")
|
||||
AC_MSG_RESULT([$SHARED_LINK])
|
||||
|
||||
################################################################################
|
||||
dnl -- Check if compiler/linker supports PIE and RELRO
|
||||
AC_TRY_CCFLAG([-pie], [HAVE_PIE], [], [])
|
||||
@ -1218,7 +1226,10 @@ AC_ARG_ENABLE(cmdlib,
|
||||
CMDLIB=$enableval, CMDLIB="no")
|
||||
AC_MSG_RESULT([$CMDLIB])
|
||||
AC_SUBST([LVM2CMD_LIB])
|
||||
AS_IF([test "$CMDLIB" = "yes"], [LVM2CMD_LIB="-llvm2cmd"], [LVM2CMD_LIB=])
|
||||
AS_IF([test "$CMDLIB" = "yes"],
|
||||
[AS_IF([test "$SHARED_LINK" = "no"],
|
||||
[AC_MSG_ERROR([--enable-cmdlib requires dynamic linking.])])
|
||||
LVM2CMD_LIB="-llvm2cmd"], [LVM2CMD_LIB=])
|
||||
|
||||
################################################################################
|
||||
dnl -- Enable D-Bus service
|
||||
@ -1892,6 +1903,7 @@ AC_SUBST(SBINDIR)
|
||||
AC_SUBST(SELINUX_LIBS)
|
||||
AC_SUBST(SELINUX_PC)
|
||||
AC_SUBST(SELINUX_STATIC_LIBS)
|
||||
AC_SUBST(SHARED_LINK)
|
||||
AC_SUBST(SILENT_RULES)
|
||||
AC_SUBST(SNAPSHOTS)
|
||||
AC_SUBST(STATICDIR)
|
||||
|
@ -47,7 +47,9 @@ endif
|
||||
|
||||
LIB_SHARED = $(interface)/libdevmapper.$(LIB_SUFFIX)
|
||||
LIB_VERSION = $(LIB_VERSION_DM)
|
||||
ifeq ("@SHARED_LINK@", "yes")
|
||||
TARGETS = libdevmapper.$(LIB_SUFFIX) libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION) .symver_check
|
||||
endif
|
||||
|
||||
CFLOW_LIST = $(SOURCES)
|
||||
CFLOW_LIST_TARGET = libdevmapper.cflow
|
||||
@ -103,7 +105,12 @@ install_dynamic: install_@interface@
|
||||
|
||||
install_static: install_@interface@_static
|
||||
|
||||
ifeq ("@SHARED_LINK@", "yes")
|
||||
install_ioctl: install_lib_shared
|
||||
endif
|
||||
ifeq ("@STATIC_LINK@", "yes")
|
||||
install_ioctl: install_ioctl_static
|
||||
endif
|
||||
|
||||
install_pkgconfig: libdevmapper.pc
|
||||
@echo " [INSTALL] $<"
|
||||
|
@ -19,13 +19,15 @@ top_builddir = @top_builddir@
|
||||
all: device-mapper
|
||||
|
||||
SOURCES2 = dmsetup.c
|
||||
TARGETS_DM = dmsetup
|
||||
|
||||
CFLOW_SOURCES = $(addprefix $(srcdir)/, $(SOURCES2))
|
||||
CFLOW_TARGET := $(TARGETS_DM)
|
||||
-include $(top_builddir)/libdm/libdevmapper.cflow
|
||||
|
||||
install_device-mapper: install_dmsetup_dynamic
|
||||
ifeq ("@SHARED_LINK@", "yes")
|
||||
TARGETS_DM += dmsetup
|
||||
install_device-mapper: install_dmsetup_dynamic
|
||||
endif
|
||||
|
||||
ifeq ("@STATIC_LINK@", "yes")
|
||||
TARGETS_DM += dmsetup.static
|
||||
@ -35,8 +37,11 @@ endif
|
||||
# dmfilemapd support
|
||||
ifeq ("@BUILD_DMFILEMAPD@", "yes")
|
||||
SOURCES2 += dmfilemapd.c
|
||||
TARGETS_DM += dmfilemapd
|
||||
install_dmfilemapd: install_dmfilemapd_dynamic
|
||||
|
||||
ifeq ("@SHARED_LINK@", "yes")
|
||||
TARGETS_DM += dmfilemapd
|
||||
install_dmfilemapd: install_dmfilemapd_dynamic
|
||||
endif
|
||||
|
||||
ifeq ("@STATIC_LINK@", "yes")
|
||||
TARGETS_DM += dmfilemapd.static
|
||||
|
@ -318,7 +318,12 @@ SUBDIRS.cflow := $(SUBDIRS:=.cflow)
|
||||
SUBDIRS.clean := $(SUBDIRS:=.clean)
|
||||
SUBDIRS.distclean := $(SUBDIRS:=.distclean)
|
||||
|
||||
TARGETS += $(LIB_SHARED) $(LIB_STATIC)
|
||||
ifeq ("@SHARED_LINK@", "yes")
|
||||
TARGETS += $(LIB_SHARED)
|
||||
endif
|
||||
ifeq ("@STATIC_LINK@", "yes")
|
||||
TARGETS += $(LIB_STATIC)
|
||||
endif
|
||||
|
||||
all: $(SUBDIRS) $(TARGETS)
|
||||
|
||||
|
@ -373,7 +373,12 @@ SUBDIRS.cflow := $(SUBDIRS:=.cflow)
|
||||
SUBDIRS.clean := $(SUBDIRS:=.clean)
|
||||
SUBDIRS.distclean := $(SUBDIRS:=.distclean)
|
||||
|
||||
TARGETS += $(LIB_SHARED) $(LIB_STATIC)
|
||||
ifeq ("@SHARED_LINK@", "yes")
|
||||
TARGETS += $(LIB_SHARED)
|
||||
endif
|
||||
ifeq ("@STATIC_LINK@", "yes")
|
||||
TARGETS += $(LIB_STATIC)
|
||||
endif
|
||||
|
||||
INTERNAL_LIBS = \
|
||||
$(top_builddir)/libdaemon/client/libdaemonclient.a \
|
||||
|
@ -100,10 +100,12 @@ CLEAN_TARGETS = liblvm2cmd.$(LIB_SUFFIX) $(TARGETS_DM) \
|
||||
$(LDDEPS) .exported_symbols_generated cmds.h \
|
||||
command-lines-input.h command-count.h man-generator.c
|
||||
|
||||
ifeq ("@SHARED_LINK@", "yes")
|
||||
ifeq ("@CMDLIB@", "yes")
|
||||
TARGETS += liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION)
|
||||
INSTALL_LVM_TARGETS += $(INSTALL_CMDLIB_TARGETS)
|
||||
endif
|
||||
endif
|
||||
|
||||
EXPORTED_HEADER = $(srcdir)/lvm2cmd.h
|
||||
EXPORTED_FN_PREFIX = lvm2
|
||||
|
Loading…
Reference in New Issue
Block a user