Version 1.02.05 -
=============================
+ Separate install_include target in makefiles.
+ Separate out DEFS from CFLAGS.
+ Support pkg-config.
+ Check for libsepol.
Version 1.02.04 - 14 Apr 2006
=============================
#endif"
ac_default_prefix=/usr
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os AWK CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB LIBOBJS MSGFMT JOBS STATIC_LINK OWNER GROUP interface kerneldir missingkernel kernelvsn tmpdir COPTIMISE_FLAG CLDFLAGS LDDEPS LIB_SUFFIX DEBUG DM_LIB_VERSION COMPAT DMIOCTLS LOCALEDIR INTL_PACKAGE INTL DEVICE_UID DEVICE_GID DEVICE_MODE DMEVENTD LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os AWK CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB LIBOBJS MSGFMT usrlibdir JOBS STATIC_LINK OWNER GROUP interface kerneldir missingkernel kernelvsn tmpdir LVM_DEFS COPTIMISE_FLAG CLDFLAGS LDDEPS LIB_SUFFIX DEBUG DM_LIB_VERSION COMPAT DMIOCTLS LOCALEDIR INTL_PACKAGE INTL DEVICE_UID DEVICE_GID DEVICE_MODE DMEVENTD LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
SELINUX="no" ;;
esac
+################################################################################
+usrlibdir='${prefix}/lib'
+
################################################################################
for ac_prog in gawk mawk nawk awk
do
then exec_prefix="";
fi;
-################################################################################dnl -- Disable selinux
+################################################################################
echo "$as_me:$LINENO: checking whether to enable selinux support" >&5
echo $ECHO_N "checking whether to enable selinux support... $ECHO_C" >&6
# Check whether --enable-selinux or --disable-selinux was given.
################################################################################
if test x$SELINUX = xyes; then
+ echo "$as_me:$LINENO: checking for sepol_check_context function" >&5
+echo $ECHO_N "checking for sepol_check_context function... $ECHO_C" >&6
+ echo "$as_me:$LINENO: checking for sepol_check_context in -lsepol" >&5
+echo $ECHO_N "checking for sepol_check_context in -lsepol... $ECHO_C" >&6
+if test "${ac_cv_lib_sepol_sepol_check_context+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsepol $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char sepol_check_context ();
+int
+main ()
+{
+sepol_check_context ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_sepol_sepol_check_context=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_sepol_sepol_check_context=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_sepol_sepol_check_context" >&5
+echo "${ECHO_T}$ac_cv_lib_sepol_sepol_check_context" >&6
+if test $ac_cv_lib_sepol_sepol_check_context = yes; then
+ HAVE_SEPOL=yes
+else
+ HAVE_SEPOL=no
+fi
+
+ echo "$as_me:$LINENO: result: $HAVE_SEPOL" >&5
+echo "${ECHO_T}$HAVE_SEPOL" >&6
+
+ if test x$HAVE_SEPOL = xyes; then
+ LIBS="-lsepol $LIBS"
+ fi
+
+ echo "$as_me:$LINENO: checking for is_selinux_enabled function" >&5
+echo $ECHO_N "checking for is_selinux_enabled function... $ECHO_C" >&6
echo "$as_me:$LINENO: checking for is_selinux_enabled in -lselinux" >&5
echo $ECHO_N "checking for is_selinux_enabled in -lselinux... $ECHO_C" >&6
if test "${ac_cv_lib_selinux_is_selinux_enabled+set}" = set; then
HAVE_SELINUX=no
fi
+ echo "$as_me:$LINENO: result: $HAVE_SELINUX" >&5
+echo "${ECHO_T}$HAVE_SELINUX" >&6
if test x$HAVE_SELINUX = xyes; then
- CFLAGS="$CFLAGS -DHAVE_SELINUX"
+ LVM_DEFS="$LVM_DEFS -DHAVE_SELINUX"
LIBS="-lselinux $LIBS"
else
{ echo "$as_me:$LINENO: WARNING: Disabling selinux" >&5
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
- CFLAGS="$CFLAGS -DHAVE_GETOPTLONG"
+ LVM_DEFS="$LVM_DEFS -DHAVE_GETOPTLONG"
fi
done
+
################################################################################
- ac_config_files="$ac_config_files Makefile make.tmpl include/Makefile dmsetup/Makefile lib/Makefile lib/libdm-common.h dmeventd/Makefile kernel/Makefile man/Makefile po/Makefile"
+ ac_config_files="$ac_config_files Makefile make.tmpl include/Makefile dmsetup/Makefile lib/Makefile lib/libdevmapper.pc lib/libdm-common.h dmeventd/Makefile dmeventd/libdevmapper-event.pc kernel/Makefile man/Makefile po/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
"include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
"dmsetup/Makefile" ) CONFIG_FILES="$CONFIG_FILES dmsetup/Makefile" ;;
"lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
+ "lib/libdevmapper.pc" ) CONFIG_FILES="$CONFIG_FILES lib/libdevmapper.pc" ;;
"lib/libdm-common.h" ) CONFIG_FILES="$CONFIG_FILES lib/libdm-common.h" ;;
"dmeventd/Makefile" ) CONFIG_FILES="$CONFIG_FILES dmeventd/Makefile" ;;
+ "dmeventd/libdevmapper-event.pc" ) CONFIG_FILES="$CONFIG_FILES dmeventd/libdevmapper-event.pc" ;;
"kernel/Makefile" ) CONFIG_FILES="$CONFIG_FILES kernel/Makefile" ;;
"man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
"po/Makefile" ) CONFIG_FILES="$CONFIG_FILES po/Makefile" ;;
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@MSGFMT@,$MSGFMT,;t t
+s,@usrlibdir@,$usrlibdir,;t t
s,@JOBS@,$JOBS,;t t
s,@STATIC_LINK@,$STATIC_LINK,;t t
s,@OWNER@,$OWNER,;t t
s,@missingkernel@,$missingkernel,;t t
s,@kernelvsn@,$kernelvsn,;t t
s,@tmpdir@,$tmpdir,;t t
+s,@LVM_DEFS@,$LVM_DEFS,;t t
s,@COPTIMISE_FLAG@,$COPTIMISE_FLAG,;t t
s,@CLDFLAGS@,$CLDFLAGS,;t t
s,@LDDEPS@,$LDDEPS,;t t
SELINUX="no" ;;
esac
+################################################################################
+dnl -- Additional library location
+usrlibdir='${prefix}/lib'
+
################################################################################
dnl -- Checks for programs.
AC_PROG_AWK
then exec_prefix="";
fi;
-################################################################################dnl -- Disable selinux
+################################################################################
+dnl -- Disable selinux
AC_MSG_CHECKING(whether to enable selinux support)
AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support],
SELINUX=$enableval)
AC_MSG_RESULT($SELINUX)
################################################################################
-dnl -- Check for is_selinux_enabled
+dnl -- Check for selinux
if test x$SELINUX = xyes; then
+ AC_MSG_CHECKING(for sepol_check_context function)
+ AC_CHECK_LIB(sepol, sepol_check_context, HAVE_SEPOL=yes, HAVE_SEPOL=no)
+ AC_MSG_RESULT($HAVE_SEPOL)
+
+ if test x$HAVE_SEPOL = xyes; then
+ LIBS="-lsepol $LIBS"
+ fi
+
+ AC_MSG_CHECKING(for is_selinux_enabled function)
AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no)
+ AC_MSG_RESULT($HAVE_SELINUX)
if test x$HAVE_SELINUX = xyes; then
- CFLAGS="$CFLAGS -DHAVE_SELINUX"
+ LVM_DEFS="$LVM_DEFS -DHAVE_SELINUX"
LIBS="-lselinux $LIBS"
else
AC_MSG_WARN(Disabling selinux)
################################################################################
dnl -- Check for getopt
-AC_CHECK_HEADERS(getopt.h, CFLAGS="$CFLAGS -DHAVE_GETOPTLONG")
+AC_CHECK_HEADERS(getopt.h, LVM_DEFS="$LVM_DEFS -DHAVE_GETOPTLONG")
################################################################################
dnl -- Internationalisation stuff
################################################################################
+AC_SUBST(usrlibdir)
AC_SUBST(JOBS)
AC_SUBST(STATIC_LINK)
AC_SUBST(OWNER)
AC_SUBST(missingkernel)
AC_SUBST(kernelvsn)
AC_SUBST(tmpdir)
+AC_SUBST(LVM_DEFS)
AC_SUBST(CFLAGS)
AC_SUBST(COPTIMISE_FLAG)
AC_SUBST(CLDFLAGS)
AC_SUBST(DEVICE_MODE)
AC_SUBST(DMEVENTD)
-
################################################################################
dnl -- First and last lines should not contain files to generate in order to
dnl -- keep utility scripts running properly
include/Makefile \
dmsetup/Makefile \
lib/Makefile \
+lib/libdevmapper.pc \
lib/libdm-common.h \
dmeventd/Makefile \
+dmeventd/libdevmapper-event.pc \
kernel/Makefile \
man/Makefile \
po/Makefile \
CLDFLAGS += -ldl -ldevmapper -lpthread
-.PHONY: install_dynamic install_static
+.PHONY: install_dynamic install_static install_include
INSTALL_TYPE = install_dynamic
install: $(INSTALL_TYPE)
+install_include:
+ $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper-event.h \
+ $(includedir)/libdevmapper-event.h
+
install_dynamic: libdevmapper-event.$(LIB_SUFFIX)
$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
$(libdir)/libdevmapper-event.$(LIB_SUFFIX).$(LIB_VERSION)
$(LN_S) -f libdevmapper-event.$(LIB_SUFFIX).$(LIB_VERSION) \
$(libdir)/libdevmapper-event.$(LIB_SUFFIX)
- $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper-event.h \
- $(includedir)/libdevmapper-event.h
+ $(INSTALL) -D $(OWNER) $(GROUP) -m 444 devmapper-event.pc \
+ $(usrlibdir)/pkgconfig/libdevmapper-event.pc
install_static: libdevmapper-event.a
$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: devmapper-event
+Description: device-mapper event library
+Version: @DM_LIB_VERSION@
+Requires: devmapper
+Cflags: -I${includedir}
+Libs: -L${libdir} -ldevmapper-event
+Libs.private: -lpthread -ldl
include ../make.tmpl
-.PHONY: install_dynamic install_static \
+.PHONY: install_dynamic install_static install_include \
install_fs install_ioctl install_ioctl_static
INSTALL_TYPE = install_dynamic
INSTALL_TYPE += install_static
endif
-install: $(INSTALL_TYPE)
+install: $(INSTALL_TYPE) install_include
+
+install_include:
+ $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper.h \
+ $(includedir)/libdevmapper.h
install_dynamic: install_@interface@
$(LN_S) -f libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION) \
$(libdir)/libdevmapper.$(LIB_SUFFIX)
- $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper.h \
- $(includedir)/libdevmapper.h
install_static: install_@interface@_static
$(LN_S) -f libdevmapper.a.$(LIB_VERSION) $(libdir)/libdevmapper.a
- $(INSTALL) -D $(OWNER) $(GROUP) -m 444 libdevmapper.h \
- $(includedir)/libdevmapper.h
install_fs: fs/libdevmapper.$(LIB_SUFFIX)
$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
install_ioctl: ioctl/libdevmapper.$(LIB_SUFFIX)
$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
$(libdir)/libdevmapper.$(LIB_SUFFIX).$(LIB_VERSION)
+ $(INSTALL) -D $(OWNER) $(GROUP) -m 444 devmapper.pc \
+ $(usrlibdir)/pkgconfig/libdevmapper.pc
install_ioctl_static: ioctl/libdevmapper.a
$(INSTALL) -D $(OWNER) $(GROUP) -m 555 $(STRIP) $< \
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: devmapper
+Description: device-mapper library
+Version: @DM_LIB_VERSION@
+Cflags: -I${includedir}
+Libs: -L${libdir} -ldevmapper
+Libs.private: -lselinux -lsepol
MSGFMT = @MSGFMT@
LN_S = @LN_S@
LIBS = @LIBS@
-CFLAGS += @DEFS@
+DEFS += @DEFS@ @LVM_DEFS@
CFLAGS += @CFLAGS@
CLDFLAGS += @CLDFLAGS@
LDDEPS += @LDDEPS@
bindir = $(DESTDIR)@bindir@
includedir = $(DESTDIR)@includedir@
libdir = $(DESTDIR)@libdir@
+usrlibdir = $(DESTDIR)@usrlibdir@
sbindir = $(DESTDIR)@sbindir@
infodir = $(DESTDIR)@infodir@
mandir = $(DESTDIR)@mandir@
CFLAGS += @COPTIMISE_FLAG@
ifeq ("@DEBUG@", "yes")
- CFLAGS += -g -fno-omit-frame-pointer -DDEBUG
- CFLAGS += -DDEBUG_MEM
+ CFLAGS += -g -fno-omit-frame-pointer
+ DEFS += -DDEBUG
+ DEFS += -DDEBUG_MEM
endif
ifeq ("@INTL@", "yes")
- CFLAGS += -DINTL_PACKAGE=\"@INTL_PACKAGE@\" -DLOCALEDIR=\"@LOCALEDIR@\"
+ DEFS += -DINTL_PACKAGE=\"@INTL_PACKAGE@\" -DLOCALEDIR=\"@LOCALEDIR@\"
endif
LDFLAGS += -L$(interfacedir)
CLDFLAGS += -L$(interfacedir)
ifeq ("@COMPAT@", "yes")
- CFLAGS += -DDM_COMPAT
+ DEFS += -DDM_COMPAT
endif
ifeq ("@DMIOCTLS@", "yes")
- CFLAGS += -DDM_IOCTLS
+ DEFS += -DDM_IOCTLS
endif
-#CFLAGS += -DDEBUG_POOL
-#CFLAGS += -DBOUNDS_CHECK
+#DEFS += -DDEBUG_POOL
+#DEFS += -DBOUNDS_CHECK
#CFLAGS += -pg
#LDFLAGS += -pg
$(TARGETS): $(OBJECTS)
%.o: %.c
- $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
+ $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $< -o $@
%.pot: %.c Makefile
$(CC) -E $(INCLUDES) -include $(top_srcdir)/include/pogen.h \
- $(CFLAGS) $< > $@
+ $(DEFS) $(CFLAGS) $< > $@
%.so: %.o
- $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
+ $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $< -o $@
ifeq ("@LIB_SUFFIX@","so")
$(LIB_SHARED): $(OBJECTS) $(LDDEPS)
set -e; \
FILE=`echo $@ | sed 's/\\//\\\\\\//g;s/\\.d//g'`; \
DEPS=`echo $(DEPS) | sed -e 's/\\//\\\\\\//g'`; \
- $(CC) -MM $(INCLUDES) $(CFLAGS) $< | \
+ $(CC) -MM $(INCLUDES) $(DEFS) $(CFLAGS) $< | \
sed "s/\(.*\)\.o[ :]*/$$FILE.o $$FILE.d $$FILE.pot: $$DEPS /g" > $@; \
[ -s $@ ] || $(RM) $@