]> sourceware.org Git - lvm2.git/blame - configure.in
cluster log daemon (clogd): Adjust for kernel CTR arg reordering
[lvm2.git] / configure.in
CommitLineData
d0191583 1###############################################################################
ad6254c5 2## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved.
ec6a6fbe 3## Copyright (C) 2004-2009 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*)
7f54ef36 31 CFLAGS="$CFLAGS"
8ce0cbda 32 COPTIMISE_FLAG="-O2"
80992638 33 CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
8106cdd5
AK
34 CLDWHOLEARCHIVE="-Wl,-whole-archive"
35 CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
80992638
AK
36 LDDEPS="$LDDEPS .export.sym"
37 LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
d0191583 38 LIB_SUFFIX=so
8106cdd5 39 DEVMAPPER=yes
1a9ea74d 40 ODIRECT=yes
d0191583 41 DM_IOCTLS=yes
80992638 42 SELINUX=yes
8b1a3214 43 REALTIME=yes
d3c8211f 44 CLUSTER=internal
f6fc418d 45 FSADM=yes
d0191583 46 ;;
8106cdd5 47 darwin*)
80992638 48 CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
8ce0cbda 49 COPTIMISE_FLAG="-O2"
80992638 50 CLDFLAGS="$CLDFLAGS"
8106cdd5
AK
51 CLDWHOLEARCHIVE="-all_load"
52 CLDNOWHOLEARCHIVE=
d0191583 53 LIB_SUFFIX=dylib
a653923f 54 DEVMAPPER=yes
1a9ea74d 55 ODIRECT=no
d0191583 56 DM_IOCTLS=no
80992638 57 SELINUX=no
8b1a3214 58 REALTIME=no
d3c8211f 59 CLUSTER=none
d0191583
JM
60 FSADM=no
61 ;;
b896caa1
AK
62esac
63
80992638 64################################################################################
8ce0cbda 65dnl -- Checks for programs.
162aefe8 66AC_PROG_SED
8ce0cbda
AK
67AC_PROG_AWK
68AC_PROG_CC
d0191583
JM
69
70dnl probably no longer needed in 2008, but...
71AC_PROG_GCC_TRADITIONAL
8ce0cbda
AK
72AC_PROG_INSTALL
73AC_PROG_LN_S
74AC_PROG_MAKE_SET
162aefe8 75AC_PROG_MKDIR_P
5556819a 76AC_PROG_RANLIB
8a2fc586
AK
77AC_PATH_PROG(CFLOW_CMD, cflow)
78AC_PATH_PROG(CSCOPE_CMD, cscope)
8ce0cbda
AK
79
80################################################################################
d0191583 81dnl -- Check for header files.
80992638
AK
82AC_HEADER_DIRENT
83AC_HEADER_STDC
ad6254c5
AK
84AC_HEADER_SYS_WAIT
85AC_HEADER_TIME
86
d0191583
JM
87AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \
88 libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h sys/wait.h time.h], ,
89 [AC_MSG_ERROR(bailing out)])
ad6254c5
AK
90
91case "$host_os" in
92 linux*)
93 AC_CHECK_HEADERS(asm/byteorder.h linux/fs.h malloc.h,,AC_MSG_ERROR(bailing out)) ;;
94 darwin*)
95 AC_CHECK_HEADERS(machine/endian.h sys/disk.h,,AC_MSG_ERROR(bailing out)) ;;
96esac
80992638 97
d0191583
JM
98AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \
99 stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \
100 sys/types.h unistd.h], , [AC_MSG_ERROR(bailing out)])
101AC_CHECK_HEADERS(termios.h sys/statvfs.h)
102
80992638 103################################################################################
d0191583 104dnl -- Check for typedefs, structures, and compiler characteristics.
80992638
AK
105AC_C_CONST
106AC_C_INLINE
d0191583 107AC_CHECK_MEMBERS([struct stat.st_rdev])
80992638
AK
108AC_TYPE_OFF_T
109AC_TYPE_PID_T
d0191583 110AC_TYPE_SIGNAL
80992638 111AC_TYPE_SIZE_T
ad6254c5 112AC_TYPE_MODE_T
7a197a62 113AC_CHECK_MEMBERS([struct stat.st_rdev])
ad6254c5
AK
114AC_STRUCT_TM
115
116################################################################################
117dnl -- Check for functions
d0191583
JM
118AC_CHECK_FUNCS([gethostname getpagesize memset mkdir rmdir munmap setlocale \
119 strcasecmp strchr strdup strncasecmp strerror strrchr strstr strtol strtoul \
120 uname], , [AC_MSG_ERROR(bailing out)])
ad6254c5
AK
121AC_FUNC_ALLOCA
122AC_FUNC_CLOSEDIR_VOID
123AC_FUNC_FORK
124AC_FUNC_LSTAT
125AC_FUNC_MALLOC
126AC_FUNC_MEMCMP
127AC_FUNC_MMAP
128AC_FUNC_STAT
129AC_FUNC_STRTOD
d0191583 130AC_FUNC_VPRINTF
80992638 131
9c961554
MB
132################################################################################
133dnl -- Enables statically-linked tools
134AC_MSG_CHECKING(whether to use static linking)
135AC_ARG_ENABLE(static_link,
136 [ --enable-static_link Use this to link the tools to their libraries
137 statically. Default is dynamic linking],
138 STATIC_LINK=$enableval, STATIC_LINK=no)
139AC_MSG_RESULT($STATIC_LINK)
140
80992638 141################################################################################
8ce0cbda 142dnl -- Prefix is /usr by default, the exec_prefix default is setup later
795ca3e5
AK
143AC_PREFIX_DEFAULT(/usr)
144
80992638 145################################################################################
8ce0cbda 146dnl -- Setup the ownership of the files
ad6254c5 147AC_MSG_CHECKING(file owner)
80992638
AK
148OWNER="root"
149
795ca3e5 150AC_ARG_WITH(user,
d0191583 151 [ --with-user=USER Set the owner of installed files [[USER=root]] ],
a38df97f 152 [ OWNER="$withval" ])
ad6254c5 153AC_MSG_RESULT($OWNER)
a38df97f
AK
154
155if test x$OWNER != x; then
156 OWNER="-o $OWNER"
157fi
795ca3e5 158
80992638 159################################################################################
8ce0cbda 160dnl -- Setup the group ownership of the files
ad6254c5 161AC_MSG_CHECKING(group owner)
80992638 162GROUP="root"
795ca3e5 163AC_ARG_WITH(group,
d0191583 164 [ --with-group=GROUP Set the group owner of installed files [[GROUP=root]] ],
a38df97f 165 [ GROUP="$withval" ])
ad6254c5 166AC_MSG_RESULT($GROUP)
a38df97f
AK
167
168if test x$GROUP != x; then
169 GROUP="-g $GROUP"
170fi
795ca3e5 171
0782ad50
AK
172################################################################################
173dnl -- Setup device node ownership
174AC_MSG_CHECKING(device node uid)
175
176AC_ARG_WITH(device-uid,
177 [ --with-device-uid=UID Set the owner used for new device nodes [[UID=0]] ],
178 [ DM_DEVICE_UID="$withval" ], [ DM_DEVICE_UID="0" ] )
179AC_MSG_RESULT($DM_DEVICE_UID)
180
181################################################################################
182dnl -- Setup device group ownership
183AC_MSG_CHECKING(device node gid)
184
185AC_ARG_WITH(device-gid,
186 [ --with-device-gid=UID Set the group used for new device nodes [[GID=0]] ],
187 [ DM_DEVICE_GID="$withval" ], [ DM_DEVICE_GID="0" ] )
188AC_MSG_RESULT($DM_DEVICE_GID)
189
f6fc418d
AK
190################################################################################
191dnl -- Setup device mode
192AC_MSG_CHECKING(device node mode)
193
194AC_ARG_WITH(device-mode,
195 [ --with-device-mode=MODE Set the mode used for new device nodes [[MODE=0600]] ],
196 [ DM_DEVICE_MODE="$withval" ], [ DM_DEVICE_MODE="0600" ] )
197AC_MSG_RESULT($DM_DEVICE_MODE)
198
80992638 199################################################################################
7d1552c9 200dnl -- LVM1 tool fallback option
ad6254c5 201AC_MSG_CHECKING(whether to enable lvm1 fallback)
7d1552c9
AK
202AC_ARG_ENABLE(lvm1_fallback, [ --enable-lvm1_fallback Use this to fall back and use LVM1 binaries if
203 device-mapper is missing from the kernel], LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
ad6254c5 204AC_MSG_RESULT($LVM1_FALLBACK)
7d1552c9
AK
205
206if test x$LVM1_FALLBACK = xyes; then
72b2cb61 207 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
208fi
209
80992638 210################################################################################
5a52dca9 211dnl -- format1 inclusion type
ad6254c5 212AC_MSG_CHECKING(whether to include support for lvm1 metadata)
5a52dca9
AK
213AC_ARG_WITH(lvm1,
214 [ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none
215 [TYPE=internal] ],
216 [ LVM1="$withval" ],
217 [ LVM1="internal" ])
ad6254c5 218AC_MSG_RESULT($LVM1)
5a52dca9
AK
219
220if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
221 then AC_MSG_ERROR(
222--with-lvm1 parameter invalid
223)
5a52dca9
AK
224fi;
225
b896caa1 226if test x$LVM1 = xinternal; then
72b2cb61 227 AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.])
b896caa1
AK
228fi
229
80992638 230################################################################################
d8ac0fbc 231dnl -- format_pool inclusion type
ad6254c5 232AC_MSG_CHECKING(whether to include support for GFS pool metadata)
d8ac0fbc 233AC_ARG_WITH(pool,
60329273 234 [ --with-pool=TYPE GFS pool read-only support: internal/shared/none
d8ac0fbc
AK
235 [TYPE=internal] ],
236 [ POOL="$withval" ],
237 [ POOL="internal" ])
ad6254c5 238AC_MSG_RESULT($POOL)
d8ac0fbc
AK
239
240if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]];
241 then AC_MSG_ERROR(
242--with-pool parameter invalid
243)
d8ac0fbc
AK
244fi;
245
246if test x$POOL = xinternal; then
72b2cb61 247 AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.])
d8ac0fbc
AK
248fi
249
80992638 250################################################################################
d3c8211f 251dnl -- cluster_locking inclusion type
ad6254c5 252AC_MSG_CHECKING(whether to include support for cluster locking)
d3c8211f
AK
253AC_ARG_WITH(cluster,
254 [ --with-cluster=TYPE Cluster LVM locking support: internal/shared/none
255 [TYPE=internal] ],
256 [ CLUSTER="$withval" ])
ad6254c5 257AC_MSG_RESULT($CLUSTER)
d3c8211f
AK
258
259if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]];
260 then AC_MSG_ERROR(
261--with-cluster parameter invalid
262)
d3c8211f
AK
263fi;
264
265if test x$CLUSTER = xinternal; then
72b2cb61 266 AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.])
d3c8211f 267fi
d8ac0fbc 268
80992638 269################################################################################
4922197a 270dnl -- snapshots inclusion type
ad6254c5 271AC_MSG_CHECKING(whether to include snapshots)
4922197a
AK
272AC_ARG_WITH(snapshots,
273 [ --with-snapshots=TYPE Snapshot support: internal/shared/none
274 [TYPE=internal] ],
275 [ SNAPSHOTS="$withval" ],
276 [ SNAPSHOTS="internal" ])
ad6254c5 277AC_MSG_RESULT($SNAPSHOTS)
4922197a
AK
278
279if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]];
280 then AC_MSG_ERROR(
281--with-snapshots parameter invalid
282)
4922197a
AK
283fi;
284
285if test x$SNAPSHOTS = xinternal; then
72b2cb61 286 AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.])
4922197a
AK
287fi
288
80992638 289################################################################################
4922197a 290dnl -- mirrors inclusion type
ad6254c5 291AC_MSG_CHECKING(whether to include mirrors)
4922197a
AK
292AC_ARG_WITH(mirrors,
293 [ --with-mirrors=TYPE Mirror support: internal/shared/none
294 [TYPE=internal] ],
295 [ MIRRORS="$withval" ],
296 [ MIRRORS="internal" ])
ad6254c5 297AC_MSG_RESULT($MIRRORS)
4922197a
AK
298
299if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]];
300 then AC_MSG_ERROR(
301--with-mirrors parameter invalid
302)
4922197a
AK
303fi;
304
305if test x$MIRRORS = xinternal; then
72b2cb61 306 AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])
4922197a
AK
307fi
308
80992638 309################################################################################
1b523347 310dnl -- Disable readline
ad6254c5 311AC_MSG_CHECKING(whether to enable readline)
2c189a57 312AC_ARG_ENABLE([readline],
1b523347 313 [ --disable-readline Disable readline support],
ea7cfb00 314 [READLINE=$enableval], [READLINE=maybe])
ad6254c5 315AC_MSG_RESULT($READLINE)
795ca3e5 316
8b1a3214
AK
317################################################################################
318dnl -- Disable realtime clock support
319AC_MSG_CHECKING(whether to enable realtime support)
3d978351 320AC_ARG_ENABLE(realtime, [ --disable-realtime Disable realtime clock support],
8b1a3214
AK
321REALTIME=$enableval)
322AC_MSG_RESULT($REALTIME)
323
80992638 324################################################################################
8ce0cbda 325dnl -- Build cluster LVM daemon
ad6254c5 326AC_MSG_CHECKING(whether to build cluster LVM daemon)
a266258f 327AC_ARG_WITH(clvmd,
4ff2b4ee 328 [ --with-clvmd=TYPE Build cluster LVM Daemon: cman/gulm/corosync/none/all
a266258f
AK
329 [TYPE=none] ],
330 [ CLVMD="$withval" ],
331 [ CLVMD="none" ])
332if test x$CLVMD = xyes; then
5c7fc7c4 333 CLVMD=all
b1098701 334fi
ad6254c5 335AC_MSG_RESULT($CLVMD)
80992638 336
8ce0cbda 337dnl -- If clvmd enabled without cluster locking, automagically include it
a266258f 338if test x$CLVMD != xnone && test x$CLUSTER = xnone; then
d3c8211f
AK
339 CLUSTER=internal
340fi
d3c8211f 341
edf47283 342dnl -- Look for corosync libraries if required.
f15a2320 343if [[ "x$CLVMD" = xall -o `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
edf47283
AK
344 PKG_CHECK_MODULES(QUORUM, libquorum, [],
345 [AC_MSG_RESULT([no pkg for quorum library, using -lquorum]);
346 QUORUM_LIBS="-lquorum"])
347 PKG_CHECK_MODULES(CONFDB, libconfdb, [],
348 [AC_MSG_RESULT([no pkg for confdb library, using -lconfdb]);
349 CONFDB_LIBS="-lconfdb"])
350 PKG_CHECK_MODULES(CPG, libcpg, [],
351 [AC_MSG_RESULT([no pkg for libcpg library, using -lcpg]);
352 CPG_LIBS="-lcpg"])
353fi
354
3c14bcca
JEB
355################################################################################
356dnl -- Build cluster log daemon
357AC_MSG_CHECKING(whether to build cluster log daemon)
358AC_ARG_ENABLE(clogd, [ --enable-clogd Enable the cluster log daemon],
359CLOGD=$enableval)
360AC_MSG_RESULT($CLOGD)
361
362dnl -- Look for corosync libraries if required.
363if [[ "x$CLOGD" = xall -o `expr x"$CLOGD" : '.*corosync.*'` != 0 ]]; then
364#
365# FIXME: ALSO NEED TO CHECK FOR CHECKPOINT MODULE
366#
367 PKG_CHECK_MODULES(CPG, libcpg, [],
368 [AC_MSG_RESULT([no pkg for libcpg library, using -lcpg]);
369 CPG_LIBS="-lcpg"])
370fi
371
80992638 372################################################################################
8ce0cbda 373dnl -- Enable debugging
ad6254c5
AK
374AC_MSG_CHECKING(whether to enable debugging)
375AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging],
d0191583 376 DEBUG=$enableval, DEBUG=no)
ad6254c5 377AC_MSG_RESULT($DEBUG)
8ef2b021 378
8ce0cbda
AK
379dnl -- Normally turn off optimisation for debug builds
380if test x$DEBUG = xyes; then
381 COPTIMISE_FLAG=
8a2fc586
AK
382else
383 CSCOPE_CMD=
8ce0cbda
AK
384fi
385
386################################################################################
387dnl -- Override optimisation
ad6254c5 388AC_MSG_CHECKING(for C optimisation flag)
8ce0cbda 389AC_ARG_WITH(optimisation,
d0191583 390 [ --with-optimisation=OPT C optimisation flag [[OPT=-O2]] ],
8ce0cbda 391 [ COPTIMISE_FLAG="$withval" ])
ad6254c5 392AC_MSG_RESULT($COPTIMISE_FLAG)
8ce0cbda 393
fddafd51
ZK
394################################################################################
395dnl -- Enable profiling
5556819a 396AC_MSG_CHECKING(whether to gather gcov profiling data)
fddafd51 397AC_ARG_ENABLE(profiling,
5556819a
AK
398 AC_HELP_STRING(--enable-profiling, [Gather gcov profiling data]),
399 PROFILING=$enableval, PROFILING=no)
400AC_MSG_RESULT($PROFILING)
401
402if test "x$PROFILING" = xyes; then
403 COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage"
b145d876
ZK
404 AC_PATH_PROG(LCOV, lcov, no)
405 AC_PATH_PROG(GENHTML, genhtml, no)
406 if test "$LCOV" = no -o "$GENHTML" = no ; then
407 AC_MSG_ERROR([lcov and genhtml are required for profiling])
408 fi
5556819a 409fi
fddafd51 410
80992638 411################################################################################
8ce0cbda 412dnl -- Disable devmapper
ad6254c5 413AC_MSG_CHECKING(whether to use device-mapper)
f6fc418d 414AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable LVM2 device-mapper interaction],
ad6254c5
AK
415DEVMAPPER=$enableval)
416AC_MSG_RESULT($DEVMAPPER)
199e490e 417
b896caa1 418if test x$DEVMAPPER = xyes; then
f6fc418d 419 AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
b896caa1
AK
420fi
421
5d518f1f
AK
422################################################################################
423dnl -- Enable udev synchronisation
424AC_MSG_CHECKING(whether to enable synchronisation with udev processing)
425AC_ARG_ENABLE(udev_sync, [ --enable-udev_sync Enable synchronisation with udev processing],
426UDEV_SYNC=$enableval, UDEV_SYNC=no)
427AC_MSG_RESULT($UDEV_SYNC)
428
429if test x$UDEV_SYNC = xyes; then
430 AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
431fi
432
433dnl -- Enable udev rules
434AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation)
435AC_ARG_ENABLE(udev_rules, [ --enable-udev_rules Install rule files needed for udev synchronisation],
436UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC)
437AC_MSG_RESULT($UDEV_RULES)
438
f6fc418d
AK
439################################################################################
440dnl -- Compatibility mode
441AC_ARG_ENABLE(compat, [ --enable-compat Enable support for old device-mapper versions],
442 DM_COMPAT=$enableval, DM_COMPAT=no)
443
444################################################################################
445dnl -- Disable ioctl
446AC_ARG_ENABLE(ioctl, [ --disable-driver Disable calls to device-mapper in the kernel],
447 DM_IOCTLS=$enableval)
448
80992638 449################################################################################
8ce0cbda 450dnl -- Disable O_DIRECT
ad6254c5
AK
451AC_MSG_CHECKING(whether to enable O_DIRECT)
452AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT],
453ODIRECT=$enableval)
454AC_MSG_RESULT($ODIRECT)
2dc95e1c
AK
455
456if test x$ODIRECT = xyes; then
72b2cb61 457 AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.])
2dc95e1c
AK
458fi
459
572fefeb
AK
460################################################################################
461dnl -- Enable liblvm2app.so
462AC_MSG_CHECKING(whether to build liblvm2app.so application library)
463AC_ARG_ENABLE(applib,
464 [ --enable-applib Build application library],
465 APPLIB=$enableval, APPLIB=no)
466AC_MSG_RESULT($APPLIB)
467AC_SUBST([LVM2APP_LIB])
468test x$APPLIB = xyes \
469 && LVM2APP_LIB=-llvm2app \
470 || LVM2APP_LIB=
471
80992638 472################################################################################
8ce0cbda 473dnl -- Enable cmdlib
ad6254c5
AK
474AC_MSG_CHECKING(whether to compile liblvm2cmd.so)
475AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library],
476CMDLIB=$enableval, CMDLIB=no)
477AC_MSG_RESULT($CMDLIB)
aa4d1e31 478AC_SUBST([LVM2CMD_LIB])
2a9a80c9 479test x$CMDLIB = xyes \
aa4d1e31
JM
480 && LVM2CMD_LIB=-llvm2cmd \
481 || LVM2CMD_LIB=
8106cdd5 482
f6fc418d
AK
483################################################################################
484dnl -- Enable pkg-config
485AC_ARG_ENABLE(pkgconfig, [ --enable-pkgconfig Install pkgconfig support],
486 PKGCONFIG=$enableval, PKGCONFIG=no)
2a9a80c9 487
80992638 488################################################################################
8ce0cbda 489dnl -- Enable fsadm
1995c9ff 490AC_MSG_CHECKING(whether to install fsadm)
ad6254c5
AK
491AC_ARG_ENABLE(fsadm, [ --enable-fsadm Enable fsadm],
492FSADM=$enableval)
493AC_MSG_RESULT($FSADM)
809fae91 494
06f62ad1
AK
495################################################################################
496dnl -- enable dmeventd handling
497AC_MSG_CHECKING(whether to use dmeventd)
498AC_ARG_ENABLE(dmeventd, [ --enable-dmeventd Enable the device-mapper event daemon],
499DMEVENTD=$enableval)
500AC_MSG_RESULT($DMEVENTD)
501
f6fc418d
AK
502BUILD_DMEVENTD=$DMEVENTD
503
06f62ad1 504dnl -- dmeventd currently requires internal mirror support
2a9a80c9
PR
505if test x$DMEVENTD = xyes; then
506 if test x$MIRRORS != xinternal; then
507 AC_MSG_ERROR(
508 --enable-dmeventd currently requires --with-mirrors=internal
509 )
510 fi
511 if test x$CMDLIB = xno; then
512 AC_MSG_ERROR(
513 --enable-dmeventd requires --enable-cmdlib to be used as well
514 )
515 fi
06f62ad1
AK
516fi
517
15d91f5a 518if test x$DMEVENTD = xyes; then
72b2cb61 519 AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])
15d91f5a 520fi
f6fc418d
AK
521
522################################################################################
523dnl -- getline included in recent libc
524
525AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1,
526 [Define to 1 if getline is available.]))
527
528################################################################################
529dnl -- canonicalize_file_name included in recent libc
530
531AC_CHECK_LIB(c, canonicalize_file_name,
532 AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1,
533 [Define to 1 if canonicalize_file_name is available.]))
534
80992638 535################################################################################
d0191583 536dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
795ca3e5
AK
537if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
538 then exec_prefix="";
539fi;
540
80992638 541################################################################################
8ce0cbda 542dnl -- Check for termcap (Shamelessly copied from parted 1.4.17)
ea7cfb00 543if test x$READLINE != xno; then
18dcfb69 544 AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib],
ea7cfb00
JM
545 [tg_found=yes], [tg_found=no])
546 test x$READLINE:$tg_found = xyes:no &&
547 AC_MSG_ERROR(
795ca3e5
AK
548termcap could not be found which is required for the
549--enable-readline option (which is enabled by default). Either disable readline
550support with --disable-readline or download and install termcap from:
551 ftp.gnu.org/gnu/termcap
552Note: if you are using precompiled packages you will also need the development
553 package as well (which may be called termcap-devel or something similar).
554Note: (n)curses also seems to work as a substitute for termcap. This was
555 not found either - but you could try installing that as well.
556)
795ca3e5
AK
557fi
558
80992638 559################################################################################
8ce0cbda 560dnl -- Check for dlopen
26e7f2e0
AK
561AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no)
562
7e9e9502 563if [[ "x$HAVE_LIBDL" = xyes ]]; then
72b2cb61 564 AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
26e7f2e0 565 LIBS="-ldl $LIBS"
d68a82ec
AK
566else
567 HAVE_LIBDL=no
26e7f2e0
AK
568fi
569
80992638 570################################################################################
8ce0cbda 571dnl -- Check for shared/static conflicts
80992638
AK
572if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \
573 -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
4922197a 574 \) -a "x$STATIC_LINK" = xyes ]];
d68a82ec 575 then AC_MSG_ERROR(
036f273a 576Features cannot be 'shared' when building statically
d68a82ec 577)
036f273a
AK
578fi
579
d0191583
JM
580################################################################################
581dnl -- Disable selinux
582AC_MSG_CHECKING(whether to enable selinux support)
583AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support],
584 SELINUX=$enableval)
585AC_MSG_RESULT($SELINUX)
586
80992638 587################################################################################
8a2fc586 588dnl -- Check for selinux
80992638 589if test x$SELINUX = xyes; then
8a2fc586 590 AC_CHECK_LIB(sepol, sepol_check_context, HAVE_SEPOL=yes, HAVE_SEPOL=no)
8a2fc586
AK
591
592 if test x$HAVE_SEPOL = xyes; then
d0191583
JM
593 AC_DEFINE([HAVE_SEPOL], 1,
594 [Define to 1 if sepol_check_context is available.])
8a2fc586
AK
595 LIBS="-lsepol $LIBS"
596 fi
597
80992638
AK
598 AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no)
599
600 if test x$HAVE_SELINUX = xyes; then
72b2cb61 601 AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
80992638
AK
602 LIBS="-lselinux $LIBS"
603 else
ad6254c5 604 AC_MSG_WARN(Disabling selinux)
80992638 605 fi
66e941e8 606
d0191583 607 # With --enable-static_link and selinux enabled, linking
66e941e8
JM
608 # fails on at least Debian unstable due to unsatisfied references
609 # to pthread_mutex_lock and _unlock. See if we need -lpthread.
610 if test "$STATIC_LINK-$HAVE_SELINUX" = yes-yes; then
611 lvm_saved_libs=$LIBS
612 LIBS="$LIBS -static"
613 AC_SEARCH_LIBS([pthread_mutex_lock], [pthread],
614 [test "$ac_cv_search_pthread_mutex_lock" = "none required" ||
615 LIB_PTHREAD=-lpthread])
616 LIBS=$lvm_saved_libs
617 fi
036f273a 618fi
d68a82ec 619
8b1a3214
AK
620################################################################################
621dnl -- Check for realtime clock support
622if test x$REALTIME = xyes; then
8b1a3214 623 AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no)
8b1a3214
AK
624
625 if test x$HAVE_REALTIME = xyes; then
626 AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.])
627 LIBS="-lrt $LIBS"
628 else
629 AC_MSG_WARN(Disabling realtime clock)
630 fi
631fi
632
80992638 633################################################################################
8ce0cbda 634dnl -- Check for getopt
d0191583 635AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.]))
b896caa1 636
80992638 637################################################################################
8ce0cbda 638dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
ea7cfb00 639if test x$READLINE != xno; then
0ad6b7e2
JM
640 rl_found=yes
641 AC_CHECK_LIB([readline], [readline], , [rl_found=no])
ea7cfb00
JM
642 test x$READLINE:$rl_found = xyes:no &&
643 AC_MSG_ERROR(
795ca3e5
AK
644GNU Readline could not be found which is required for the
645--enable-readline option (which is enabled by default). Either disable readline
646support with --disable-readline or download and install readline from:
647 ftp.gnu.org/gnu/readline
648Note: if you are using precompiled packages you will also need the development
649package as well (which may be called readline-devel or something similar).
650)
ea7cfb00 651 if test $rl_found = yes; then
0ad6b7e2 652 AC_CHECK_FUNCS([rl_completion_matches])
ea7cfb00
JM
653 AC_DEFINE([READLINE_SUPPORT], 1,
654 [Define to 1 to include the LVM readline shell.])
655 fi
795ca3e5
AK
656fi
657
80992638 658################################################################################
8ce0cbda 659dnl -- Internationalisation stuff
ad6254c5
AK
660AC_MSG_CHECKING(whether to enable internationalisation)
661AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support],
662 INTL=$enableval, INTL=no)
663AC_MSG_RESULT($INTL)
69792976
AK
664
665if test x$INTL = xyes; then
f6fc418d 666# FIXME - Move this - can be device-mapper too
69792976
AK
667 INTL_PACKAGE="lvm2"
668 AC_PATH_PROG(MSGFMT, msgfmt)
669 if [[ "x$MSGFMT" == x ]];
670 then AC_MSG_ERROR(
671 msgfmt not found in path $PATH
672 )
69792976
AK
673 fi;
674
675 AC_ARG_WITH(localedir,
d0191583
JM
676 [ --with-localedir=DIR Translation files in DIR [[PREFIX/share/locale]] ],
677 [ LOCALEDIR="$withval" ],
678 [ LOCALEDIR='${prefix}/share/locale' ])
69792976
AK
679fi
680
80992638 681################################################################################
4a7f3eb2 682AC_ARG_WITH(confdir,
5d518f1f 683 [ --with-confdir=DIR Configuration files in DIR [[/etc]]],
d0191583
JM
684 [ CONFDIR="$withval" ],
685 [ CONFDIR='/etc' ])
0a62c911
AK
686
687AC_ARG_WITH(staticdir,
5d518f1f 688 [ --with-staticdir=DIR Static binary in DIR [[EPREFIX/sbin]]],
d0191583
JM
689 [ STATICDIR="$withval" ],
690 [ STATICDIR='${exec_prefix}/sbin' ])
0a62c911 691
68f2de6d
AK
692AC_ARG_WITH(usrlibdir,
693 [ --with-usrlibdir=DIR],
694 [ usrlibdir="$withval"],
695 [ usrlibdir='${prefix}/lib' ])
696
697AC_ARG_WITH(usrsbindir,
698 [ --with-usrsbindir=DIR],
699 [ usrsbindir="$withval"],
700 [ usrsbindir='${prefix}/sbin' ])
701
5d518f1f
AK
702################################################################################
703AC_ARG_WITH(udev_prefix,
704 [ --with-udev-prefix=UPREFIX Install udev rule files in UPREFIX [[EPREFIX]]],
705 [ udev_prefix="$withval"],
706 [ udev_prefix='${exec_prefix}' ])
707
78ce7acc
AK
708AC_ARG_WITH(udevdir,
709 [ --with-udevdir=DIR udev rules in DIR [[UPREFIX/lib/udev/rules.d]]],
710 [ udevdir="$withval"],
711 [ udevdir='${udev_prefix}/lib/udev/rules.d' ])
5d518f1f 712
ad6254c5
AK
713################################################################################
714dnl -- Ensure additional headers required
715if test x$READLINE = xyes; then
716 AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out))
717fi
718
5c7fc7c4 719if test x$CLVMD != xnone; then
ad6254c5
AK
720 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))
721 AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out))
722 AC_FUNC_GETMNTENT
723# AC_FUNC_REALLOC
724 AC_FUNC_SELECT_ARGTYPES
725fi
726
ad6254c5
AK
727if test x$CLUSTER != xnone; then
728 AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out))
729 AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out))
730fi
731
732if test x$HAVE_LIBDL = xyes; then
733 AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out))
734fi
735
736if test x$INTL = xyes; then
737 AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out))
738fi
739
ad6254c5
AK
740if test x$HAVE_SELINUX = xyes; then
741 AC_CHECK_HEADERS(selinux/selinux.h,,AC_MSG_ERROR(bailing out))
742fi
4a7f3eb2 743
5d518f1f
AK
744if test x$UDEV_SYNC = xyes; then
745 AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out))
746fi
747
a653923f
AK
748################################################################################
749AC_PATH_PROG(MODPROBE_CMD, modprobe)
750
751if test x$MODPROBE_CMD != x; then
72b2cb61 752 AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
a653923f
AK
753fi
754
80992638 755################################################################################
f6fc418d
AK
756dnl -- dmeventd pidfile and executable path
757AH_TEMPLATE(DMEVENTD_PIDFILE, [Path to dmeventd pidfile.])
758if test "$BUILD_DMEVENTD" = yes; then
759 AC_ARG_WITH(dmeventd-pidfile,
760 [ --with-dmeventd-pidfile=PATH dmeventd pidfile [[/var/run/dmeventd.pid]] ],
761 [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"$withval") ],
762 [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"/var/run/dmeventd.pid") ])
763fi
764
765AH_TEMPLATE(DMEVENTD_PATH, [Path to dmeventd binary.])
766if test "$BUILD_DMEVENTD" = yes; then
767 dmeventd_prefix="$exec_prefix"
768 if test "x$dmeventd_prefix" = "xNONE"; then
769 dmeventd_prefix="$prefix"
770 fi
771 if test "x$dmeventd_prefix" = "xNONE"; then
772 dmeventd_prefix=""
773 fi
774 AC_ARG_WITH(dmeventd-path,
5d518f1f 775 [ --with-dmeventd-path=PATH dmeventd path [[EPREFIX/sbin/dmeventd]] ],
f6fc418d
AK
776 [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$withval") ],
777 [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$dmeventd_prefix/sbin/dmeventd") ])
778fi
779
780################################################################################
781dnl -- which kernel interface to use (ioctl only)
782AC_MSG_CHECKING(for kernel interface choice)
783AC_ARG_WITH(interface,
784 [ --with-interface=IFACE Choose kernel interface (ioctl) [[ioctl]] ],
785 [ interface="$withval" ],
786 [ interface=ioctl ])
787if [[ "x$interface" != xioctl ]];
788then
789 AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.)
790fi
791AC_MSG_RESULT($interface)
792
793################################################################################
2c44337b 794DM_LIB_VERSION="\"`cat VERSION_DM 2>/dev/null || echo Unknown`\""
f58b35b5
AK
795AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version])
796
ec6a6fbe 797DM_LIB_PATCHLEVEL=`cat VERSION_DM | $AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'`
597c3f8e 798
d0191583 799LVM_VERSION="\"`cat VERSION 2>/dev/null || echo Unknown`\""
fae0c576 800
ec6a6fbe 801VER=`cat VERSION`
bf456146 802LVM_RELEASE_DATE="\"`echo $VER | $SED 's/.* (//;s/).*//'`\""
ec6a6fbe
AK
803VER=`echo "$VER" | $AWK '{print $1}'`
804LVM_RELEASE="\"`echo "$VER" | $AWK -F '-' '{print $2}'`\""
805VER=`echo "$VER" | $AWK -F '-' '{print $1}'`
806LVM_MAJOR=`echo "$VER" | $AWK -F '.' '{print $1}'`
807LVM_MINOR=`echo "$VER" | $AWK -F '.' '{print $2}'`
bf456146
AK
808LVM_PATCHLEVEL=`echo "$VER" | $AWK -F '[[(.]]' '{print $3}'`
809LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'`
ec6a6fbe 810
80992638 811################################################################################
572fefeb 812AC_SUBST(APPLIB)
d0191583 813AC_SUBST(BUILD_DMEVENTD)
b896caa1 814AC_SUBST(CFLAGS)
d0191583 815AC_SUBST(CFLOW_CMD)
8106cdd5 816AC_SUBST(CLDFLAGS)
8106cdd5 817AC_SUBST(CLDNOWHOLEARCHIVE)
d0191583
JM
818AC_SUBST(CLDWHOLEARCHIVE)
819AC_SUBST(CLUSTER)
820AC_SUBST(CLVMD)
3c14bcca 821AC_SUBST(CLOGD)
d0191583 822AC_SUBST(CMDLIB)
edf47283
AK
823AC_SUBST(CONFDB_CFLAGS)
824AC_SUBST(CONFDB_LIBS)
825AC_SUBST(CONFDIR)
d0191583 826AC_SUBST(COPTIMISE_FLAG)
edf47283
AK
827AC_SUBST(CPG_CFLAGS)
828AC_SUBST(CPG_LIBS)
d0191583 829AC_SUBST(CSCOPE_CMD)
8ef2b021 830AC_SUBST(DEBUG)
199e490e 831AC_SUBST(DEVMAPPER)
d0191583
JM
832AC_SUBST(DMEVENTD)
833AC_SUBST(DM_COMPAT)
834AC_SUBST(DM_DEVICE_GID)
835AC_SUBST(DM_DEVICE_MODE)
836AC_SUBST(DM_DEVICE_UID)
837AC_SUBST(DM_IOCTLS)
838AC_SUBST(DM_LIB_VERSION)
597c3f8e 839AC_SUBST(DM_LIB_PATCHLEVEL)
d0191583
JM
840AC_SUBST(FSADM)
841AC_SUBST(GROUP)
26e7f2e0 842AC_SUBST(HAVE_LIBDL)
8b1a3214 843AC_SUBST(HAVE_REALTIME)
d0191583
JM
844AC_SUBST(HAVE_SELINUX)
845AC_SUBST(INTL)
846AC_SUBST(INTL_PACKAGE)
847AC_SUBST(JOBS)
848AC_SUBST(LDDEPS)
849AC_SUBST(LIBS)
850AC_SUBST(LIB_SUFFIX)
69792976 851AC_SUBST(LOCALEDIR)
d0191583
JM
852AC_SUBST(LVM1)
853AC_SUBST(LVM1_FALLBACK)
d0191583 854AC_SUBST(LVM_VERSION)
bf456146 855AC_SUBST(LVM_LIBAPI)
ec6a6fbe
AK
856AC_SUBST(LVM_MAJOR)
857AC_SUBST(LVM_MINOR)
858AC_SUBST(LVM_PATCHLEVEL)
859AC_SUBST(LVM_RELEASE)
860AC_SUBST(LVM_RELEASE_DATE)
d0191583
JM
861AC_SUBST(MIRRORS)
862AC_SUBST(MSGFMT)
863AC_SUBST(OWNER)
864AC_SUBST(PKGCONFIG)
865AC_SUBST(POOL)
edf47283
AK
866AC_SUBST(QUORUM_CFLAGS)
867AC_SUBST(QUORUM_LIBS)
d0191583 868AC_SUBST(SNAPSHOTS)
0a62c911 869AC_SUBST(STATICDIR)
d0191583 870AC_SUBST(STATIC_LINK)
5d518f1f 871AC_SUBST(UDEV_RULES)
66e941e8 872AC_SUBST([LIB_PTHREAD])
f6fc418d
AK
873AC_SUBST(interface)
874AC_SUBST(kerneldir)
875AC_SUBST(missingkernel)
876AC_SUBST(kernelvsn)
877AC_SUBST(tmpdir)
5d518f1f
AK
878AC_SUBST(udev_prefix)
879AC_SUBST(udevdir)
68f2de6d
AK
880AC_SUBST(usrlibdir)
881AC_SUBST(usrsbindir)
8106cdd5 882
80992638 883################################################################################
d3a356b4 884dnl -- First and last lines should not contain files to generate in order to
8ce0cbda 885dnl -- keep utility scripts running properly
d3a356b4
JM
886AC_CONFIG_FILES([
887Makefile
888make.tmpl
889daemons/Makefile
890daemons/clvmd/Makefile
3c14bcca 891daemons/clogd/Makefile
f6fc418d
AK
892daemons/dmeventd/Makefile
893daemons/dmeventd/libdevmapper-event.pc
b7edb5bf 894daemons/dmeventd/plugins/Makefile
f6fc418d
AK
895daemons/dmeventd/plugins/mirror/Makefile
896daemons/dmeventd/plugins/snapshot/Makefile
d3a356b4 897doc/Makefile
f6fc418d
AK
898include/Makefile
899lib/Makefile
d3a356b4
JM
900lib/format1/Makefile
901lib/format_pool/Makefile
902lib/locking/Makefile
903lib/mirror/Makefile
ec6a6fbe 904lib/misc/lvm-version.h
d3a356b4 905lib/snapshot/Makefile
f6fc418d
AK
906libdm/Makefile
907libdm/libdevmapper.pc
e0c64c6c 908liblvm/Makefile
70046623 909liblvm/liblvm2app.pc
f6fc418d
AK
910man/Makefile
911po/Makefile
2de38033 912scripts/clvmd_init_red_hat
d3a356b4 913scripts/Makefile
f6fc418d 914test/Makefile
c7e363f9 915test/api/Makefile
d3a356b4 916tools/Makefile
5d518f1f 917udev/Makefile
7a197a62
AK
918])
919AC_OUTPUT
2dc95e1c
AK
920
921if test x$ODIRECT != xyes; then
ad6254c5 922 AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up)
2dc95e1c 923fi
This page took 0.165695 seconds and 5 git commands to generate.