mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
Use DL_LIBS, remove -ldl from global LIBS and link -ldl only when needed.
This commit is contained in:
parent
5451f79f55
commit
76f4498303
@ -1,5 +1,6 @@
|
||||
Version 2.02.62 -
|
||||
====================================
|
||||
Define and use internal makefile variable DL_LIBS.
|
||||
Update check for selinux libraries and link them only when needed.
|
||||
Define and use internal makefile variable SELINUX_LIBS and STATIC_LIBS.
|
||||
Remove -rdynamic from static builds.
|
||||
|
14
configure
vendored
14
configure
vendored
@ -685,6 +685,7 @@ DM_DEVICE_MODE
|
||||
DM_DEVICE_GID
|
||||
DM_COMPAT
|
||||
DMEVENTD
|
||||
DL_LIBS
|
||||
DEVMAPPER
|
||||
DEBUG
|
||||
COPTIMISE_FLAG
|
||||
@ -12681,23 +12682,21 @@ fi
|
||||
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
|
||||
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
|
||||
if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
|
||||
HAVE_LIBDL=yes
|
||||
else
|
||||
HAVE_LIBDL=no
|
||||
fi
|
||||
|
||||
|
||||
if [ "x$HAVE_LIBDL" = xyes ]; then
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_LIBDL 1
|
||||
_ACEOF
|
||||
|
||||
LIBS="-ldl $LIBS"
|
||||
DL_LIBS="-ldl"
|
||||
HAVE_LIBDL=yes
|
||||
else
|
||||
|
||||
DL_LIBS=
|
||||
HAVE_LIBDL=no
|
||||
fi
|
||||
|
||||
|
||||
################################################################################
|
||||
if [ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \
|
||||
-o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
|
||||
@ -15559,6 +15558,7 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[()]' '{print $2}'`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
|
13
configure.in
13
configure.in
@ -789,14 +789,12 @@ fi;
|
||||
|
||||
################################################################################
|
||||
dnl -- Check for dlopen
|
||||
AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no)
|
||||
|
||||
if [[ "x$HAVE_LIBDL" = xyes ]]; then
|
||||
AC_CHECK_LIB(dl, dlopen, [
|
||||
AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
|
||||
LIBS="-ldl $LIBS"
|
||||
else
|
||||
HAVE_LIBDL=no
|
||||
fi
|
||||
DL_LIBS="-ldl"
|
||||
HAVE_LIBDL=yes ], [
|
||||
DL_LIBS=
|
||||
HAVE_LIBDL=no ])
|
||||
|
||||
################################################################################
|
||||
dnl -- Check for shared/static conflicts
|
||||
@ -1074,6 +1072,7 @@ AC_SUBST(DEBUG)
|
||||
AC_SUBST(DEVMAPPER)
|
||||
AC_SUBST(DLM_CFLAGS)
|
||||
AC_SUBST(DLM_LIBS)
|
||||
AC_SUBST(DL_LIBS)
|
||||
AC_SUBST(DMEVENTD)
|
||||
AC_SUBST(DM_COMPAT)
|
||||
AC_SUBST(DM_DEVICE_GID)
|
||||
|
@ -53,7 +53,6 @@ include $(top_builddir)/make.tmpl
|
||||
all: device-mapper
|
||||
device-mapper: $(TARGETS)
|
||||
|
||||
LIBS += -ldl
|
||||
LVMLIBS += -ldevmapper-event -ldevmapper $(PTHREAD_LIBS)
|
||||
|
||||
$(VERSIONED_SHLIB): $(LIB_SHARED)
|
||||
@ -62,11 +61,11 @@ $(VERSIONED_SHLIB): $(LIB_SHARED)
|
||||
|
||||
dmeventd: $(LIB_SHARED) $(VERSIONED_SHLIB) dmeventd.o
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ dmeventd.o \
|
||||
$(LVMLIBS) $(LIBS) -rdynamic
|
||||
$(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
|
||||
|
||||
dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
|
||||
dmeventd.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
|
||||
dmeventd.o $(DL_LIBS) $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
|
||||
|
||||
ifeq ("@PKGCONFIG@", "yes")
|
||||
INSTALL_LIB_TARGETS += install_pkgconfig
|
||||
|
@ -38,7 +38,8 @@ CLDFLAGS += @CLDFLAGS@
|
||||
LDDEPS += @LDDEPS@
|
||||
LDFLAGS += @LDFLAGS@
|
||||
LIB_SUFFIX = @LIB_SUFFIX@
|
||||
LVMINTERNAL_LIBS = -llvm-internal
|
||||
LVMINTERNAL_LIBS = -llvm-internal $(DL_LIBS)
|
||||
DL_LIBS = @DL_LIBS@
|
||||
PTHREAD_LIBS = @PTHREAD_LIBS@
|
||||
READLINE_LIBS = @READLINE_LIBS@
|
||||
SELINUX_LIBS = @SELINUX_LIBS@
|
||||
|
Loading…
Reference in New Issue
Block a user