1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 01:55:10 +03:00
lvm2/configure.in

403 lines
11 KiB
Plaintext
Raw Normal View History

2001-09-21 16:37:43 +04:00
##
## Copyright 1999-2000 Sistina Software, Inc.
##
## This is free software released under the GNU General Public License.
## There is no warranty for this software. See the file COPYING for
## details.
##
## See the file CONTRIBUTORS for a list of contributors.
##
## This file is maintained by:
## AJ Lewis <lewis@sistina.com>
##
## File name: configure.in
##
## Description: Input file for autoconf. Generates the configure script
## that tries to keep everything nice and portable. It also
## simplifies distribution package building considerably.
################################################################################
dnl Process this file with autoconf to produce a configure script.
2001-10-10 14:11:25 +04:00
AC_INIT(lib/device/dev-cache.h)
2001-09-21 16:37:43 +04:00
dnl setup the directory where autoconf has auxilary files
AC_CONFIG_AUX_DIR(autoconf)
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h malloc.h sys/ioctl.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_ST_RDEV
AC_HEADER_TIME
2003-04-15 17:24:42 +04:00
dnl Get system type
AC_CANONICAL_SYSTEM
case "$host_os" in
linux*)
2004-03-26 17:17:14 +03:00
CFLAGS=
CLDFLAGS="-Wl,--version-script,.export.sym"
CLDWHOLEARCHIVE="-Wl,-whole-archive"
CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
LD_DEPS=".export.sym"
2004-04-05 20:29:37 +04:00
LD_FLAGS="-Wl,--export-dynamic"
2004-03-26 17:17:14 +03:00
SOFLAG="-shared"
DEVMAPPER=yes
ODIRECT=yes ;;
darwin*)
CFLAGS="-no-cpp-precomp -fno-common"
CLDFLAGS=
CLDWHOLEARCHIVE="-all_load"
CLDNOWHOLEARCHIVE=
LD_DEPS=
2004-04-05 20:29:37 +04:00
LD_FLAGS=
2004-03-26 17:17:14 +03:00
SOFLAG="-dynamiclib"
DEVMAPPER=no
ODIRECT=no ;;
2003-04-15 17:24:42 +04:00
esac
2001-09-21 16:37:43 +04:00
dnl -- prefix is /usr by default, the exec_prefix default is setup later
AC_PREFIX_DEFAULT(/usr)
OWNER="root"
GROUP="root"
2001-09-21 16:37:43 +04:00
dnl -- setup the ownership of the files
AC_ARG_WITH(user,
[ --with-user=USER Set the owner of installed files ],
[ OWNER="$withval" ])
if test x$OWNER != x; then
OWNER="-o $OWNER"
fi
2001-09-21 16:37:43 +04:00
dnl -- setup the group ownership of the files
AC_ARG_WITH(group,
[ --with-group=GROUP Set the group owner of installed files ],
[ GROUP="$withval" ])
if test x$GROUP != x; then
GROUP="-g $GROUP"
fi
2001-09-21 16:37:43 +04:00
dnl -- LVM1 tool fallback option
AC_ARG_ENABLE(lvm1_fallback, [ --enable-lvm1_fallback Use this to fall back and use LVM1 binaries if
device-mapper is missing from the kernel], LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
if test x$LVM1_FALLBACK = xyes; then
CFLAGS="$CFLAGS -DLVM1_FALLBACK"
fi
2002-11-18 17:04:08 +03:00
dnl -- format1 inclusion type
AC_ARG_WITH(lvm1,
[ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none
[TYPE=internal] ],
[ LVM1="$withval" ],
[ LVM1="internal" ])
if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
then AC_MSG_ERROR(
--with-lvm1 parameter invalid
)
exit
fi;
2003-04-15 17:24:42 +04:00
if test x$LVM1 = xinternal; then
CFLAGS="$CFLAGS -DLVM1_INTERNAL"
fi
2004-06-07 23:10:21 +04:00
dnl -- format_pool inclusion type
AC_ARG_WITH(pool,
[ --with-pool=TYPE GFS pool metadata support: internal/shared/none
[TYPE=internal] ],
[ POOL="$withval" ],
[ POOL="internal" ])
if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]];
then AC_MSG_ERROR(
--with-pool parameter invalid
)
exit
fi;
if test x$POOL = xinternal; then
CFLAGS="$CFLAGS -DPOOL_INTERNAL"
fi
AC_ARG_ENABLE(jobs, [ --enable-jobs=NUM Number of jobs to run simultaneously], JOBS=-j$enableval, JOBS=-j2)
2001-09-21 16:37:43 +04:00
2004-05-05 01:25:57 +04:00
dnl -- snapshots inclusion type
AC_ARG_WITH(snapshots,
[ --with-snapshots=TYPE Snapshot support: internal/shared/none
[TYPE=internal] ],
[ SNAPSHOTS="$withval" ],
[ SNAPSHOTS="internal" ])
if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]];
then AC_MSG_ERROR(
--with-snapshots parameter invalid
)
exit
fi;
if test x$SNAPSHOTS = xinternal; then
CFLAGS="$CFLAGS -DSNAPSHOT_INTERNAL"
fi
dnl -- mirrors inclusion type
AC_ARG_WITH(mirrors,
[ --with-mirrors=TYPE Mirror support: internal/shared/none
[TYPE=internal] ],
[ MIRRORS="$withval" ],
[ MIRRORS="internal" ])
if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]];
then AC_MSG_ERROR(
--with-mirrors parameter invalid
)
exit
fi;
if test x$MIRRORS = xinternal; then
CFLAGS="$CFLAGS -DMIRRORED_INTERNAL"
fi
2004-03-26 17:17:14 +03:00
dnl Enables staticly-linked tools
AC_ARG_ENABLE(static_link, [ --enable-static_link Use this to link the tools to their libraries
2001-09-21 16:37:43 +04:00
statically. Default is dynamic linking], STATIC_LINK=$enableval, STATIC_LINK=no)
2002-11-18 17:04:08 +03:00
dnl Enable readline
AC_ARG_ENABLE(readline, [ --enable-readline Enable readline support], \
READLINE=$enableval, READLINE=no)
2001-09-21 16:37:43 +04:00
2003-04-15 17:24:42 +04:00
if test x$READLINE = xyes; then
CFLAGS="$CFLAGS -DREADLINE_SUPPORT"
fi
2004-02-14 01:56:45 +03:00
echo $ac_n "checking whether to enable debugging""... $ac_c" 1>&6
dnl Enable Debugging
AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging], \
DEBUG=yes, DEBUG=no)
2004-02-14 01:56:45 +03:00
echo "$ac_t""$DEBUG" 1>&6
2004-02-14 01:56:45 +03:00
echo $ac_n "checking whether to enable device-mapper""... $ac_c" 1>&6
dnl Disable devmapper
AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable device-mapper interaction], \
2004-03-26 17:17:14 +03:00
DEVMAPPER=no)
2004-02-14 01:56:45 +03:00
echo "$ac_t""$DEVMAPPER" 1>&6
2003-04-15 17:24:42 +04:00
if test x$DEVMAPPER = xyes; then
CFLAGS="$CFLAGS -DDEVMAPPER_SUPPORT"
fi
2004-02-14 01:56:45 +03:00
echo $ac_n "checking whether to enable O_DIRECT""... $ac_c" 1>&6
2003-11-06 20:14:06 +03:00
dnl Disable O_DIRECT
AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT], \
2004-03-26 17:17:14 +03:00
ODIRECT=no)
2004-02-14 01:56:45 +03:00
echo "$ac_t""$ODIRECT" 1>&6
2003-11-06 20:14:06 +03:00
if test x$ODIRECT = xyes; then
CFLAGS="$CFLAGS -DO_DIRECT_SUPPORT"
fi
2004-03-26 17:17:14 +03:00
echo $ac_n "checking whether to compile liblvm2cmd.so""... $ac_c" 1>&6
dnl Enable cmdlib
AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library], \
CMDLIB=yes, CMDLIB=no)
echo "$ac_t""$CMDLIB" 1>&6
if test x$CMDLIB = xyes; then
CFLAGS="$CFLAGS -DCMDLIB"
fi
2001-09-21 16:37:43 +04:00
dnl Mess with default exec_prefix
if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
then exec_prefix="";
fi;
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(mkdir rmdir uname)
dnl check for termcap (Shamelessly copied from parted 1.4.17)
if test x$READLINE = xyes; then
AC_SEARCH_LIBS(tgetent, ncurses curses termcap termlib, ,
AC_MSG_ERROR(
termcap could not be found which is required for the
--enable-readline option (which is enabled by default). Either disable readline
support with --disable-readline or download and install termcap from:
ftp.gnu.org/gnu/termcap
Note: if you are using precompiled packages you will also need the development
package as well (which may be called termcap-devel or something similar).
Note: (n)curses also seems to work as a substitute for termcap. This was
not found either - but you could try installing that as well.
)
exit
)
fi
dnl Check for dlopen
AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no)
2004-05-04 16:14:20 +04:00
if [[ "x$HAVE_LIBDL" = xyes -a "x$STATIC_LINK" = xno ]]; then
2003-04-15 17:24:42 +04:00
CFLAGS="$CFLAGS -DHAVE_LIBDL"
LIBS="-ldl $LIBS"
2004-04-05 20:29:37 +04:00
else
HAVE_LIBDL=no
fi
2004-04-05 20:29:37 +04:00
dnl Check for shared/static conflicts
2004-06-07 23:10:21 +04:00
if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o \
2004-05-05 01:25:57 +04:00
"x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
\) -a "x$STATIC_LINK" = xyes ]];
2004-04-05 20:29:37 +04:00
then AC_MSG_ERROR(
2004-04-07 18:08:22 +04:00
Features cannot be 'shared' when building statically
2004-04-05 20:29:37 +04:00
)
exit
2004-04-07 18:08:22 +04:00
fi
dnl Check for is_selinux_enabled
AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no)
if test x$HAVE_SELINUX = xyes; then
CFLAGS="$CFLAGS -DHAVE_SELINUX"
LIBS="-lselinux $LIBS"
fi
2004-04-05 20:29:37 +04:00
2003-04-15 17:24:42 +04:00
dnl Check for getopt
AC_CHECK_HEADERS(getopt.h, CFLAGS="$CFLAGS -DHAVE_GETOPTLONG")
2001-09-21 16:37:43 +04:00
dnl Check for readline (Shamelessly copied from parted 1.4.17)
if test x$READLINE = xyes; then
AC_CHECK_LIB(readline, readline, ,
AC_MSG_ERROR(
GNU Readline could not be found which is required for the
--enable-readline option (which is enabled by default). Either disable readline
support with --disable-readline or download and install readline from:
ftp.gnu.org/gnu/readline
Note: if you are using precompiled packages you will also need the development
package as well (which may be called readline-devel or something similar).
)
exit
)
2003-04-15 17:24:42 +04:00
AC_CHECK_FUNC(rl_completion_matches, CFLAGS="$CFLAGS -DHAVE_RL_COMPLETION_MATCHES")
2001-09-21 16:37:43 +04:00
fi
2004-02-14 01:56:45 +03:00
echo $ac_n "checking whether to enable internationalisation""... $ac_c" 1>&6
dnl Internationalisation stuff
AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support],\
INTL=yes, INTL=no)
echo "$ac_t""$INTL" 1>&6
if test x$INTL = xyes; then
INTL_PACKAGE="lvm2"
AC_PATH_PROG(MSGFMT, msgfmt)
if [[ "x$MSGFMT" == x ]];
then AC_MSG_ERROR(
msgfmt not found in path $PATH
)
exit
fi;
AC_ARG_WITH(localedir,
[ --with-localedir=DIR Translation files in DIR [PREFIX/share/locale]],
[ LOCALEDIR="$withval" ],
[ LOCALEDIR='${prefix}/share/locale' ])
fi
AC_ARG_WITH(confdir,
[ --with-confdir=DIR Configuration files in DIR [/etc]],
[ CONFDIR="$withval" ],
[ CONFDIR='/etc' ])
AC_ARG_WITH(staticdir,
[ --with-staticdir=DIR Static binary in DIR [EXEC_PREFIX/sbin]],
[ STATICDIR="$withval" ],
[ STATICDIR='${exec_prefix}/sbin' ])
if test "-f VERSION"; then
LVM_VERSION="\"`cat VERSION`\""
else
LVM_VERSION="Unknown"
fi
2001-09-21 16:37:43 +04:00
AC_SUBST(JOBS)
AC_SUBST(STATIC_LINK)
2002-11-18 17:04:08 +03:00
AC_SUBST(LVM1)
2004-06-07 23:10:21 +04:00
AC_SUBST(POOL)
2004-05-05 01:25:57 +04:00
AC_SUBST(SNAPSHOTS)
AC_SUBST(MIRRORS)
2001-09-21 16:37:43 +04:00
AC_SUBST(OWNER)
AC_SUBST(GROUP)
2003-04-15 17:24:42 +04:00
AC_SUBST(CFLAGS)
2004-03-26 17:17:14 +03:00
AC_SUBST(CLDFLAGS)
AC_SUBST(CLDWHOLEARCHIVE)
AC_SUBST(CLDNOWHOLEARCHIVE)
AC_SUBST(LD_DEPS)
2004-04-05 20:29:37 +04:00
AC_SUBST(LD_FLAGS)
2004-03-26 17:17:14 +03:00
AC_SUBST(SOFLAG)
AC_SUBST(LIBS)
AC_SUBST(LVM_VERSION)
AC_SUBST(LVM1_FALLBACK)
AC_SUBST(DEBUG)
AC_SUBST(DEVMAPPER)
AC_SUBST(HAVE_LIBDL)
2004-04-07 18:08:22 +04:00
AC_SUBST(HAVE_SELINUX)
2004-03-26 17:17:14 +03:00
AC_SUBST(CMDLIB)
2004-02-14 01:56:45 +03:00
AC_SUBST(MSGFMT)
AC_SUBST(LOCALEDIR)
AC_SUBST(CONFDIR)
AC_SUBST(STATICDIR)
2004-02-14 01:56:45 +03:00
AC_SUBST(INTL_PACKAGE)
AC_SUBST(INTL)
2004-03-26 17:17:14 +03:00
2001-09-21 16:37:43 +04:00
dnl First and last lines should not contain files to generate in order to
dnl keep utility scripts running properly
AC_OUTPUT( \
Makefile \
make.tmpl \
doc/Makefile \
include/Makefile \
2001-09-21 16:37:43 +04:00
lib/Makefile \
2002-11-18 17:04:08 +03:00
lib/format1/Makefile \
2004-06-07 23:10:21 +04:00
lib/format_pool/Makefile \
2004-05-05 01:25:57 +04:00
lib/mirror/Makefile \
lib/snapshot/Makefile \
2001-09-21 16:37:43 +04:00
man/Makefile \
2004-02-14 01:56:45 +03:00
po/Makefile \
2001-09-21 16:37:43 +04:00
tools/Makefile \
tools/version.h \
test/mm/Makefile \
2001-10-08 17:58:52 +04:00
test/device/Makefile \
2001-10-08 13:50:00 +04:00
test/format1/Makefile \
test/regex/Makefile \
test/filters/Makefile \
2001-09-21 16:37:43 +04:00
)
2003-11-06 20:14:06 +03:00
if test x$ODIRECT != xyes; then
echo
echo Warning: O_DIRECT disabled.
echo Use of pvmove may cause machine to lock up under low memory conditions.
echo
fi