]> sourceware.org Git - lvm2.git/blame - configure.in
libdevmapper version - will change once the merger's settled in
[lvm2.git] / configure.in
CommitLineData
d0191583 1###############################################################################
ad6254c5 2## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved.
d0191583 3## Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
795ca3e5 4##
ad6254c5
AK
5## This copyrighted material is made available to anyone wishing to use,
6## modify, copy, or redistribute it subject to the terms and conditions
7## of the GNU General Public License v.2.
795ca3e5 8##
ad6254c5
AK
9## You should have received a copy of the GNU General Public License
10## along with this program; if not, write to the Free Software Foundation,
11## Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
795ca3e5
AK
12################################################################################
13
7a197a62 14AC_PREREQ(2.57)
80992638 15################################################################################
8ce0cbda 16dnl -- Process this file with autoconf to produce a configure script.
7a197a62
AK
17AC_INIT
18AC_CONFIG_SRCDIR([lib/device/dev-cache.h])
d0191583 19AC_CONFIG_HEADERS([lib/misc/configure.h])
72b2cb61 20
80992638 21################################################################################
ad6254c5 22dnl -- Setup the directory where autoconf has auxilary files
d3a356b4 23AC_CONFIG_AUX_DIR(autoconf)
795ca3e5 24
80992638 25################################################################################
8ce0cbda 26dnl -- Get system type
7a197a62 27AC_CANONICAL_TARGET([])
b896caa1
AK
28
29case "$host_os" in
30 linux*)
8ce0cbda 31 COPTIMISE_FLAG="-O2"
80992638 32 CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
8106cdd5
AK
33 CLDWHOLEARCHIVE="-Wl,-whole-archive"
34 CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
80992638
AK
35 LDDEPS="$LDDEPS .export.sym"
36 LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
d0191583 37 LIB_SUFFIX=so
8106cdd5 38 DEVMAPPER=yes
1a9ea74d 39 ODIRECT=yes
d0191583 40 DM_IOCTLS=yes
80992638 41 SELINUX=yes
8b1a3214 42 REALTIME=yes
d3c8211f 43 CLUSTER=internal
d0191583
JM
44 FSADM=no
45 ;;
8106cdd5 46 darwin*)
80992638 47 CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
8ce0cbda 48 COPTIMISE_FLAG="-O2"
80992638 49 CLDFLAGS="$CLDFLAGS"
8106cdd5
AK
50 CLDWHOLEARCHIVE="-all_load"
51 CLDNOWHOLEARCHIVE=
d0191583 52 LIB_SUFFIX=dylib
a653923f 53 DEVMAPPER=yes
1a9ea74d 54 ODIRECT=no
d0191583 55 DM_IOCTLS=no
80992638 56 SELINUX=no
8b1a3214 57 REALTIME=no
d3c8211f 58 CLUSTER=none
d0191583
JM
59 FSADM=no
60 ;;
b896caa1
AK
61esac
62
80992638 63################################################################################
8ce0cbda 64dnl -- Checks for programs.
5951ef33 65AC_PROG_SED
8ce0cbda
AK
66AC_PROG_AWK
67AC_PROG_CC
d0191583
JM
68
69dnl probably no longer needed in 2008, but...
70AC_PROG_GCC_TRADITIONAL
8ce0cbda
AK
71AC_PROG_INSTALL
72AC_PROG_LN_S
73AC_PROG_MAKE_SET
fddafd51 74AC_PROG_MKDIR_P
5556819a 75AC_PROG_RANLIB
8a2fc586
AK
76AC_PATH_PROG(CFLOW_CMD, cflow)
77AC_PATH_PROG(CSCOPE_CMD, cscope)
8ce0cbda
AK
78
79################################################################################
d0191583 80dnl -- Check for header files.
80992638
AK
81AC_HEADER_DIRENT
82AC_HEADER_STDC
ad6254c5
AK
83AC_HEADER_SYS_WAIT
84AC_HEADER_TIME
85
d0191583
JM
86AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \
87 libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h sys/wait.h time.h], ,
88 [AC_MSG_ERROR(bailing out)])
ad6254c5
AK
89
90case "$host_os" in
91 linux*)
92 AC_CHECK_HEADERS(asm/byteorder.h linux/fs.h malloc.h,,AC_MSG_ERROR(bailing out)) ;;
93 darwin*)
94 AC_CHECK_HEADERS(machine/endian.h sys/disk.h,,AC_MSG_ERROR(bailing out)) ;;
95esac
80992638 96
d0191583
JM
97AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \
98 stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \
99 sys/types.h unistd.h], , [AC_MSG_ERROR(bailing out)])
100AC_CHECK_HEADERS(termios.h sys/statvfs.h)
101
80992638 102################################################################################
d0191583 103dnl -- Check for typedefs, structures, and compiler characteristics.
80992638
AK
104AC_C_CONST
105AC_C_INLINE
d0191583 106AC_CHECK_MEMBERS([struct stat.st_rdev])
80992638
AK
107AC_TYPE_OFF_T
108AC_TYPE_PID_T
d0191583 109AC_TYPE_SIGNAL
80992638 110AC_TYPE_SIZE_T
ad6254c5 111AC_TYPE_MODE_T
7a197a62 112AC_CHECK_MEMBERS([struct stat.st_rdev])
ad6254c5
AK
113AC_STRUCT_TM
114
115################################################################################
116dnl -- Check for functions
d0191583
JM
117AC_CHECK_FUNCS([gethostname getpagesize memset mkdir rmdir munmap setlocale \
118 strcasecmp strchr strdup strncasecmp strerror strrchr strstr strtol strtoul \
119 uname], , [AC_MSG_ERROR(bailing out)])
ad6254c5
AK
120AC_FUNC_ALLOCA
121AC_FUNC_CLOSEDIR_VOID
122AC_FUNC_FORK
123AC_FUNC_LSTAT
124AC_FUNC_MALLOC
125AC_FUNC_MEMCMP
126AC_FUNC_MMAP
127AC_FUNC_STAT
128AC_FUNC_STRTOD
d0191583 129AC_FUNC_VPRINTF
80992638
AK
130
131################################################################################
8ce0cbda 132dnl -- Prefix is /usr by default, the exec_prefix default is setup later
795ca3e5
AK
133AC_PREFIX_DEFAULT(/usr)
134
80992638 135################################################################################
8ce0cbda 136dnl -- Setup the ownership of the files
ad6254c5 137AC_MSG_CHECKING(file owner)
80992638
AK
138OWNER="root"
139
795ca3e5 140AC_ARG_WITH(user,
d0191583 141 [ --with-user=USER Set the owner of installed files [[USER=root]] ],
a38df97f 142 [ OWNER="$withval" ])
ad6254c5 143AC_MSG_RESULT($OWNER)
a38df97f
AK
144
145if test x$OWNER != x; then
146 OWNER="-o $OWNER"
147fi
795ca3e5 148
80992638 149################################################################################
8ce0cbda 150dnl -- Setup the group ownership of the files
ad6254c5 151AC_MSG_CHECKING(group owner)
80992638 152GROUP="root"
795ca3e5 153AC_ARG_WITH(group,
d0191583 154 [ --with-group=GROUP Set the group owner of installed files [[GROUP=root]] ],
a38df97f 155 [ GROUP="$withval" ])
ad6254c5 156AC_MSG_RESULT($GROUP)
a38df97f
AK
157
158if test x$GROUP != x; then
159 GROUP="-g $GROUP"
160fi
795ca3e5 161
80992638 162################################################################################
7d1552c9 163dnl -- LVM1 tool fallback option
ad6254c5 164AC_MSG_CHECKING(whether to enable lvm1 fallback)
7d1552c9
AK
165AC_ARG_ENABLE(lvm1_fallback, [ --enable-lvm1_fallback Use this to fall back and use LVM1 binaries if
166 device-mapper is missing from the kernel], LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
ad6254c5 167AC_MSG_RESULT($LVM1_FALLBACK)
7d1552c9
AK
168
169if test x$LVM1_FALLBACK = xyes; then
72b2cb61 170 AC_DEFINE([LVM1_FALLBACK], 1, [Define to 1 if 'lvm' should fall back to using LVM1 binaries if device-mapper is missing from the kernel])
7d1552c9
AK
171fi
172
80992638 173################################################################################
5a52dca9 174dnl -- format1 inclusion type
ad6254c5 175AC_MSG_CHECKING(whether to include support for lvm1 metadata)
5a52dca9
AK
176AC_ARG_WITH(lvm1,
177 [ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none
178 [TYPE=internal] ],
179 [ LVM1="$withval" ],
180 [ LVM1="internal" ])
ad6254c5 181AC_MSG_RESULT($LVM1)
5a52dca9
AK
182
183if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
184 then AC_MSG_ERROR(
185--with-lvm1 parameter invalid
186)
5a52dca9
AK
187fi;
188
b896caa1 189if test x$LVM1 = xinternal; then
72b2cb61 190 AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.])
b896caa1
AK
191fi
192
80992638 193################################################################################
d8ac0fbc 194dnl -- format_pool inclusion type
ad6254c5 195AC_MSG_CHECKING(whether to include support for GFS pool metadata)
d8ac0fbc 196AC_ARG_WITH(pool,
60329273 197 [ --with-pool=TYPE GFS pool read-only support: internal/shared/none
d8ac0fbc
AK
198 [TYPE=internal] ],
199 [ POOL="$withval" ],
200 [ POOL="internal" ])
ad6254c5 201AC_MSG_RESULT($POOL)
d8ac0fbc
AK
202
203if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]];
204 then AC_MSG_ERROR(
205--with-pool parameter invalid
206)
d8ac0fbc
AK
207fi;
208
209if test x$POOL = xinternal; then
72b2cb61 210 AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.])
d8ac0fbc
AK
211fi
212
80992638 213################################################################################
d3c8211f 214dnl -- cluster_locking inclusion type
ad6254c5 215AC_MSG_CHECKING(whether to include support for cluster locking)
d3c8211f
AK
216AC_ARG_WITH(cluster,
217 [ --with-cluster=TYPE Cluster LVM locking support: internal/shared/none
218 [TYPE=internal] ],
219 [ CLUSTER="$withval" ])
ad6254c5 220AC_MSG_RESULT($CLUSTER)
d3c8211f
AK
221
222if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]];
223 then AC_MSG_ERROR(
224--with-cluster parameter invalid
225)
d3c8211f
AK
226fi;
227
228if test x$CLUSTER = xinternal; then
72b2cb61 229 AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.])
d3c8211f 230fi
d8ac0fbc 231
80992638 232################################################################################
4922197a 233dnl -- snapshots inclusion type
ad6254c5 234AC_MSG_CHECKING(whether to include snapshots)
4922197a
AK
235AC_ARG_WITH(snapshots,
236 [ --with-snapshots=TYPE Snapshot support: internal/shared/none
237 [TYPE=internal] ],
238 [ SNAPSHOTS="$withval" ],
239 [ SNAPSHOTS="internal" ])
ad6254c5 240AC_MSG_RESULT($SNAPSHOTS)
4922197a
AK
241
242if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]];
243 then AC_MSG_ERROR(
244--with-snapshots parameter invalid
245)
4922197a
AK
246fi;
247
248if test x$SNAPSHOTS = xinternal; then
72b2cb61 249 AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.])
4922197a
AK
250fi
251
80992638 252################################################################################
4922197a 253dnl -- mirrors inclusion type
ad6254c5 254AC_MSG_CHECKING(whether to include mirrors)
4922197a
AK
255AC_ARG_WITH(mirrors,
256 [ --with-mirrors=TYPE Mirror support: internal/shared/none
257 [TYPE=internal] ],
258 [ MIRRORS="$withval" ],
259 [ MIRRORS="internal" ])
ad6254c5 260AC_MSG_RESULT($MIRRORS)
4922197a
AK
261
262if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]];
263 then AC_MSG_ERROR(
264--with-mirrors parameter invalid
265)
4922197a
AK
266fi;
267
268if test x$MIRRORS = xinternal; then
72b2cb61 269 AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])
4922197a
AK
270fi
271
80992638 272################################################################################
1b523347 273dnl -- Disable readline
ad6254c5 274AC_MSG_CHECKING(whether to enable readline)
2c189a57 275AC_ARG_ENABLE([readline],
1b523347 276 [ --disable-readline Disable readline support],
ea7cfb00 277 [READLINE=$enableval], [READLINE=maybe])
ad6254c5 278AC_MSG_RESULT($READLINE)
795ca3e5 279
8b1a3214
AK
280################################################################################
281dnl -- Disable realtime clock support
282AC_MSG_CHECKING(whether to enable realtime support)
3d978351 283AC_ARG_ENABLE(realtime, [ --disable-realtime Disable realtime clock support],
8b1a3214
AK
284REALTIME=$enableval)
285AC_MSG_RESULT($REALTIME)
286
80992638 287################################################################################
8ce0cbda 288dnl -- Build cluster LVM daemon
ad6254c5 289AC_MSG_CHECKING(whether to build cluster LVM daemon)
a266258f 290AC_ARG_WITH(clvmd,
5c7fc7c4 291 [ --with-clvmd=TYPE Build cluster LVM Daemon: cman/gulm/none/all
a266258f
AK
292 [TYPE=none] ],
293 [ CLVMD="$withval" ],
294 [ CLVMD="none" ])
295if test x$CLVMD = xyes; then
5c7fc7c4 296 CLVMD=all
b1098701 297fi
ad6254c5 298AC_MSG_RESULT($CLVMD)
80992638 299
8ce0cbda 300dnl -- If clvmd enabled without cluster locking, automagically include it
a266258f 301if test x$CLVMD != xnone && test x$CLUSTER = xnone; then
d3c8211f
AK
302 CLUSTER=internal
303fi
d3c8211f 304
80992638 305################################################################################
8ce0cbda 306dnl -- Enable debugging
ad6254c5
AK
307AC_MSG_CHECKING(whether to enable debugging)
308AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging],
d0191583 309 DEBUG=$enableval, DEBUG=no)
ad6254c5 310AC_MSG_RESULT($DEBUG)
8ef2b021 311
8ce0cbda
AK
312dnl -- Normally turn off optimisation for debug builds
313if test x$DEBUG = xyes; then
314 COPTIMISE_FLAG=
8a2fc586
AK
315else
316 CSCOPE_CMD=
8ce0cbda
AK
317fi
318
319################################################################################
320dnl -- Override optimisation
ad6254c5 321AC_MSG_CHECKING(for C optimisation flag)
8ce0cbda 322AC_ARG_WITH(optimisation,
d0191583 323 [ --with-optimisation=OPT C optimisation flag [[OPT=-O2]] ],
8ce0cbda 324 [ COPTIMISE_FLAG="$withval" ])
ad6254c5 325AC_MSG_RESULT($COPTIMISE_FLAG)
8ce0cbda 326
fddafd51
ZK
327################################################################################
328dnl -- Enable profiling
5556819a 329AC_MSG_CHECKING(whether to gather gcov profiling data)
fddafd51 330AC_ARG_ENABLE(profiling,
5556819a
AK
331 AC_HELP_STRING(--enable-profiling, [Gather gcov profiling data]),
332 PROFILING=$enableval, PROFILING=no)
333AC_MSG_RESULT($PROFILING)
334
335if test "x$PROFILING" = xyes; then
336 COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage"
b145d876
ZK
337 AC_PATH_PROG(LCOV, lcov, no)
338 AC_PATH_PROG(GENHTML, genhtml, no)
339 if test "$LCOV" = no -o "$GENHTML" = no ; then
340 AC_MSG_ERROR([lcov and genhtml are required for profiling])
341 fi
5556819a 342fi
fddafd51 343
80992638 344################################################################################
8ce0cbda 345dnl -- Disable devmapper
ad6254c5
AK
346AC_MSG_CHECKING(whether to use device-mapper)
347AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable device-mapper interaction],
348DEVMAPPER=$enableval)
349AC_MSG_RESULT($DEVMAPPER)
199e490e 350
b896caa1 351if test x$DEVMAPPER = xyes; then
72b2cb61 352 AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable device-mapper interaction.])
b896caa1
AK
353fi
354
80992638 355################################################################################
8ce0cbda 356dnl -- Disable O_DIRECT
ad6254c5
AK
357AC_MSG_CHECKING(whether to enable O_DIRECT)
358AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT],
359ODIRECT=$enableval)
360AC_MSG_RESULT($ODIRECT)
2dc95e1c
AK
361
362if test x$ODIRECT = xyes; then
72b2cb61 363 AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.])
2dc95e1c
AK
364fi
365
80992638 366################################################################################
8ce0cbda 367dnl -- Enable cmdlib
ad6254c5
AK
368AC_MSG_CHECKING(whether to compile liblvm2cmd.so)
369AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library],
370CMDLIB=$enableval, CMDLIB=no)
371AC_MSG_RESULT($CMDLIB)
aa4d1e31 372AC_SUBST([LVM2CMD_LIB])
2a9a80c9 373test x$CMDLIB = xyes \
aa4d1e31
JM
374 && LVM2CMD_LIB=-llvm2cmd \
375 || LVM2CMD_LIB=
8106cdd5 376
2a9a80c9 377
80992638 378################################################################################
8ce0cbda 379dnl -- Enable fsadm
1995c9ff 380AC_MSG_CHECKING(whether to install fsadm)
ad6254c5
AK
381AC_ARG_ENABLE(fsadm, [ --enable-fsadm Enable fsadm],
382FSADM=$enableval)
383AC_MSG_RESULT($FSADM)
809fae91 384
06f62ad1
AK
385################################################################################
386dnl -- enable dmeventd handling
387AC_MSG_CHECKING(whether to use dmeventd)
388AC_ARG_ENABLE(dmeventd, [ --enable-dmeventd Enable the device-mapper event daemon],
389DMEVENTD=$enableval)
390AC_MSG_RESULT($DMEVENTD)
391
392dnl -- dmeventd currently requires internal mirror support
2a9a80c9
PR
393if test x$DMEVENTD = xyes; then
394 if test x$MIRRORS != xinternal; then
395 AC_MSG_ERROR(
396 --enable-dmeventd currently requires --with-mirrors=internal
397 )
398 fi
399 if test x$CMDLIB = xno; then
400 AC_MSG_ERROR(
401 --enable-dmeventd requires --enable-cmdlib to be used as well
402 )
403 fi
06f62ad1
AK
404fi
405
15d91f5a 406if test x$DMEVENTD = xyes; then
72b2cb61 407 AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])
15d91f5a 408fi
80992638 409################################################################################
d0191583 410dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
795ca3e5
AK
411if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
412 then exec_prefix="";
413fi;
414
80992638 415################################################################################
8ce0cbda 416dnl -- Check for termcap (Shamelessly copied from parted 1.4.17)
ea7cfb00
JM
417if test x$READLINE != xno; then
418 AC_SEARCH_LIBS([tgetent], [ncurses curses termcap termlib],
419 [tg_found=yes], [tg_found=no])
420 test x$READLINE:$tg_found = xyes:no &&
421 AC_MSG_ERROR(
795ca3e5
AK
422termcap could not be found which is required for the
423--enable-readline option (which is enabled by default). Either disable readline
424support with --disable-readline or download and install termcap from:
425 ftp.gnu.org/gnu/termcap
426Note: if you are using precompiled packages you will also need the development
427 package as well (which may be called termcap-devel or something similar).
428Note: (n)curses also seems to work as a substitute for termcap. This was
429 not found either - but you could try installing that as well.
430)
795ca3e5
AK
431fi
432
80992638 433################################################################################
8ce0cbda 434dnl -- Check for dlopen
26e7f2e0
AK
435AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no)
436
7e9e9502 437if [[ "x$HAVE_LIBDL" = xyes ]]; then
72b2cb61 438 AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
26e7f2e0 439 LIBS="-ldl $LIBS"
d68a82ec
AK
440else
441 HAVE_LIBDL=no
26e7f2e0
AK
442fi
443
80992638 444################################################################################
8ce0cbda 445dnl -- Check for shared/static conflicts
80992638
AK
446if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \
447 -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
4922197a 448 \) -a "x$STATIC_LINK" = xyes ]];
d68a82ec 449 then AC_MSG_ERROR(
036f273a 450Features cannot be 'shared' when building statically
d68a82ec 451)
036f273a
AK
452fi
453
d0191583
JM
454################################################################################
455dnl -- Enables statically-linked tools
456AC_MSG_CHECKING(whether to use static linking)
457AC_ARG_ENABLE(static_link,
458 [ --enable-static_link Use this to link the tools to their libraries
459 statically. Default is dynamic linking],
460 STATIC_LINK=$enableval, STATIC_LINK=no)
461AC_MSG_RESULT($STATIC_LINK)
462
463################################################################################
464dnl -- Disable selinux
465AC_MSG_CHECKING(whether to enable selinux support)
466AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support],
467 SELINUX=$enableval)
468AC_MSG_RESULT($SELINUX)
469
80992638 470################################################################################
8a2fc586 471dnl -- Check for selinux
80992638 472if test x$SELINUX = xyes; then
8a2fc586 473 AC_CHECK_LIB(sepol, sepol_check_context, HAVE_SEPOL=yes, HAVE_SEPOL=no)
8a2fc586
AK
474
475 if test x$HAVE_SEPOL = xyes; then
d0191583
JM
476 AC_DEFINE([HAVE_SEPOL], 1,
477 [Define to 1 if sepol_check_context is available.])
8a2fc586
AK
478 LIBS="-lsepol $LIBS"
479 fi
480
80992638
AK
481 AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no)
482
483 if test x$HAVE_SELINUX = xyes; then
72b2cb61 484 AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
80992638
AK
485 LIBS="-lselinux $LIBS"
486 else
ad6254c5 487 AC_MSG_WARN(Disabling selinux)
80992638 488 fi
66e941e8 489
d0191583 490 # With --enable-static_link and selinux enabled, linking
66e941e8
JM
491 # fails on at least Debian unstable due to unsatisfied references
492 # to pthread_mutex_lock and _unlock. See if we need -lpthread.
493 if test "$STATIC_LINK-$HAVE_SELINUX" = yes-yes; then
494 lvm_saved_libs=$LIBS
495 LIBS="$LIBS -static"
496 AC_SEARCH_LIBS([pthread_mutex_lock], [pthread],
497 [test "$ac_cv_search_pthread_mutex_lock" = "none required" ||
498 LIB_PTHREAD=-lpthread])
499 LIBS=$lvm_saved_libs
500 fi
036f273a 501fi
d68a82ec 502
8b1a3214
AK
503################################################################################
504dnl -- Check for realtime clock support
505if test x$REALTIME = xyes; then
8b1a3214 506 AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no)
8b1a3214
AK
507
508 if test x$HAVE_REALTIME = xyes; then
509 AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.])
510 LIBS="-lrt $LIBS"
511 else
512 AC_MSG_WARN(Disabling realtime clock)
513 fi
514fi
515
80992638 516################################################################################
8ce0cbda 517dnl -- Check for getopt
d0191583 518AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.]))
b896caa1 519
80992638 520################################################################################
8ce0cbda 521dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
ea7cfb00 522if test x$READLINE != xno; then
0ad6b7e2
JM
523 rl_found=yes
524 AC_CHECK_LIB([readline], [readline], , [rl_found=no])
ea7cfb00
JM
525 test x$READLINE:$rl_found = xyes:no &&
526 AC_MSG_ERROR(
795ca3e5
AK
527GNU Readline could not be found which is required for the
528--enable-readline option (which is enabled by default). Either disable readline
529support with --disable-readline or download and install readline from:
530 ftp.gnu.org/gnu/readline
531Note: if you are using precompiled packages you will also need the development
532package as well (which may be called readline-devel or something similar).
533)
ea7cfb00 534 if test $rl_found = yes; then
0ad6b7e2 535 AC_CHECK_FUNCS([rl_completion_matches])
ea7cfb00
JM
536 AC_DEFINE([READLINE_SUPPORT], 1,
537 [Define to 1 to include the LVM readline shell.])
538 fi
795ca3e5
AK
539fi
540
80992638 541################################################################################
8ce0cbda 542dnl -- Internationalisation stuff
ad6254c5
AK
543AC_MSG_CHECKING(whether to enable internationalisation)
544AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support],
545 INTL=$enableval, INTL=no)
546AC_MSG_RESULT($INTL)
69792976
AK
547
548if test x$INTL = xyes; then
549 INTL_PACKAGE="lvm2"
550 AC_PATH_PROG(MSGFMT, msgfmt)
551 if [[ "x$MSGFMT" == x ]];
552 then AC_MSG_ERROR(
553 msgfmt not found in path $PATH
554 )
69792976
AK
555 fi;
556
557 AC_ARG_WITH(localedir,
d0191583
JM
558 [ --with-localedir=DIR Translation files in DIR [[PREFIX/share/locale]] ],
559 [ LOCALEDIR="$withval" ],
560 [ LOCALEDIR='${prefix}/share/locale' ])
69792976
AK
561fi
562
80992638 563################################################################################
4a7f3eb2 564AC_ARG_WITH(confdir,
0a62c911 565 [ --with-confdir=DIR Configuration files in DIR [/etc]],
d0191583
JM
566 [ CONFDIR="$withval" ],
567 [ CONFDIR='/etc' ])
0a62c911
AK
568
569AC_ARG_WITH(staticdir,
570 [ --with-staticdir=DIR Static binary in DIR [EXEC_PREFIX/sbin]],
d0191583
JM
571 [ STATICDIR="$withval" ],
572 [ STATICDIR='${exec_prefix}/sbin' ])
0a62c911 573
33f732c5
AK
574AC_ARG_WITH(dmdir,
575 [ --with-dmdir=DIR Build against device-mapper source tree in DIR],
d0191583 576 [ DMDIR="$withval" CPPFLAGS="$CPPFLAGS -I$DMDIR/include"],
33f732c5
AK
577 [ DMDIR= ])
578
09339e2b 579# Convert a relative dir name to absolute.
25fbec5b
AK
580case $DMDIR in
581 /*) ;;
582 *) DMDIR="`pwd`/$DMDIR" ;;
09339e2b
JM
583esac
584
68f2de6d
AK
585AC_ARG_WITH(usrlibdir,
586 [ --with-usrlibdir=DIR],
587 [ usrlibdir="$withval"],
588 [ usrlibdir='${prefix}/lib' ])
589
590AC_ARG_WITH(usrsbindir,
591 [ --with-usrsbindir=DIR],
592 [ usrsbindir="$withval"],
593 [ usrsbindir='${prefix}/sbin' ])
594
ad6254c5
AK
595################################################################################
596dnl -- Ensure additional headers required
597if test x$READLINE = xyes; then
598 AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out))
599fi
600
5c7fc7c4 601if test x$CLVMD != xnone; then
ad6254c5
AK
602 AC_CHECK_HEADERS(mntent.h netdb.h netinet/in.h pthread.h search.h sys/mount.h sys/socket.h sys/uio.h sys/un.h utmpx.h,,AC_MSG_ERROR(bailing out))
603 AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out))
604 AC_FUNC_GETMNTENT
605# AC_FUNC_REALLOC
606 AC_FUNC_SELECT_ARGTYPES
607fi
608
ad6254c5
AK
609if test x$CLUSTER != xnone; then
610 AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out))
611 AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out))
612fi
613
614if test x$HAVE_LIBDL = xyes; then
615 AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out))
616fi
617
618if test x$INTL = xyes; then
619 AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out))
620fi
621
2293567c 622AC_CHECK_HEADERS(libdevmapper.h,,AC_MSG_ERROR(bailing out))
ad6254c5
AK
623
624if test x$HAVE_SELINUX = xyes; then
625 AC_CHECK_HEADERS(selinux/selinux.h,,AC_MSG_ERROR(bailing out))
626fi
4a7f3eb2 627
a653923f
AK
628################################################################################
629AC_PATH_PROG(MODPROBE_CMD, modprobe)
630
631if test x$MODPROBE_CMD != x; then
72b2cb61 632 AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
a653923f
AK
633fi
634
80992638 635################################################################################
d0191583 636LVM_VERSION="\"`cat VERSION 2>/dev/null || echo Unknown`\""
fae0c576 637
80992638 638################################################################################
d0191583 639AC_SUBST(BUILD_DMEVENTD)
b896caa1 640AC_SUBST(CFLAGS)
d0191583 641AC_SUBST(CFLOW_CMD)
8106cdd5 642AC_SUBST(CLDFLAGS)
8106cdd5 643AC_SUBST(CLDNOWHOLEARCHIVE)
d0191583
JM
644AC_SUBST(CLDWHOLEARCHIVE)
645AC_SUBST(CLUSTER)
646AC_SUBST(CLVMD)
647AC_SUBST(CMDLIB)
648AC_SUBST(COPTIMISE_FLAG)
649AC_SUBST(CSCOPE_CMD)
8ef2b021 650AC_SUBST(DEBUG)
199e490e 651AC_SUBST(DEVMAPPER)
d0191583
JM
652AC_SUBST(DMDIR)
653# FIXME: rename to LVM_USE_DMEVENTD
654AC_SUBST(DMEVENTD)
655AC_SUBST(DM_COMPAT)
656AC_SUBST(DM_DEVICE_GID)
657AC_SUBST(DM_DEVICE_MODE)
658AC_SUBST(DM_DEVICE_UID)
659AC_SUBST(DM_IOCTLS)
660AC_SUBST(DM_LIB_VERSION)
661AC_SUBST(FSADM)
662AC_SUBST(GROUP)
26e7f2e0 663AC_SUBST(HAVE_LIBDL)
8b1a3214 664AC_SUBST(HAVE_REALTIME)
d0191583
JM
665AC_SUBST(HAVE_SELINUX)
666AC_SUBST(INTL)
667AC_SUBST(INTL_PACKAGE)
668AC_SUBST(JOBS)
669AC_SUBST(LDDEPS)
670AC_SUBST(LIBS)
671AC_SUBST(LIB_SUFFIX)
69792976 672AC_SUBST(LOCALEDIR)
d0191583
JM
673AC_SUBST(LVM1)
674AC_SUBST(LVM1_FALLBACK)
675# FIXME: rename to LVM_CONF_DIR
4a7f3eb2 676AC_SUBST(CONFDIR)
d0191583
JM
677AC_SUBST(LVM_VERSION)
678AC_SUBST(MIRRORS)
679AC_SUBST(MSGFMT)
680AC_SUBST(OWNER)
681AC_SUBST(PKGCONFIG)
682AC_SUBST(POOL)
683AC_SUBST(SNAPSHOTS)
0a62c911 684AC_SUBST(STATICDIR)
d0191583 685AC_SUBST(STATIC_LINK)
66e941e8 686AC_SUBST([LIB_PTHREAD])
68f2de6d
AK
687AC_SUBST(usrlibdir)
688AC_SUBST(usrsbindir)
8106cdd5 689
80992638 690################################################################################
d3a356b4 691dnl -- First and last lines should not contain files to generate in order to
8ce0cbda 692dnl -- keep utility scripts running properly
d3a356b4
JM
693AC_CONFIG_FILES([
694Makefile
695make.tmpl
d0191583
JM
696include/Makefile
697lib/Makefile
698man/Makefile
699po/Makefile
700dmeventd/Makefile
d3a356b4
JM
701daemons/Makefile
702daemons/clvmd/Makefile
d3a356b4 703dmeventd/mirror/Makefile
67961c7c 704dmeventd/snapshot/Makefile
d3a356b4 705doc/Makefile
d3a356b4
JM
706lib/format1/Makefile
707lib/format_pool/Makefile
708lib/locking/Makefile
709lib/mirror/Makefile
710lib/snapshot/Makefile
711test/Makefile
d3a356b4
JM
712scripts/Makefile
713tools/Makefile
714tools/version.h
7a197a62
AK
715])
716AC_OUTPUT
2dc95e1c
AK
717
718if test x$ODIRECT != xyes; then
ad6254c5 719 AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up)
2dc95e1c 720fi
809fae91
AK
721
722if test x$FSADM == xyes; then
ad6254c5 723 AC_MSG_WARN(fsadm support is untested)
809fae91 724fi
06f62ad1
AK
725
726if test x$DMEVENTD == xyes; then
727 AC_MSG_WARN(dmeventd support is untested)
728fi
This page took 0.134382 seconds and 5 git commands to generate.