]> sourceware.org Git - lvm2.git/blame - configure.in
Shorten prompt for pvchange and vgextend.
[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
e24fb506 14AC_PREREQ(2.61)
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
d3c8211f 43 CLUSTER=internal
f6fc418d 44 FSADM=yes
d0191583 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
d3c8211f 57 CLUSTER=none
d0191583
JM
58 FSADM=no
59 ;;
b896caa1
AK
60esac
61
80992638 62################################################################################
8ce0cbda 63dnl -- Checks for programs.
162aefe8 64AC_PROG_SED
8ce0cbda
AK
65AC_PROG_AWK
66AC_PROG_CC
d0191583
JM
67
68dnl probably no longer needed in 2008, but...
69AC_PROG_GCC_TRADITIONAL
8ce0cbda
AK
70AC_PROG_INSTALL
71AC_PROG_LN_S
72AC_PROG_MAKE_SET
162aefe8 73AC_PROG_MKDIR_P
5556819a 74AC_PROG_RANLIB
8a2fc586
AK
75AC_PATH_PROG(CFLOW_CMD, cflow)
76AC_PATH_PROG(CSCOPE_CMD, cscope)
8ce0cbda
AK
77
78################################################################################
d0191583 79dnl -- Check for header files.
80992638 80AC_HEADER_DIRENT
d911ec67 81AC_HEADER_MAJOR
80992638 82AC_HEADER_STDC
ad6254c5
AK
83AC_HEADER_SYS_WAIT
84AC_HEADER_TIME
85
d0191583 86AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \
d911ec67
AK
87 langinfo.h libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h \
88 sys/wait.h time.h], ,
d0191583 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
d911ec67
AK
113AC_TYPE_INT8_T
114AC_TYPE_INT16_T
115AC_TYPE_INT32_T
116AC_TYPE_INT64_T
117AC_TYPE_SSIZE_T
118AC_TYPE_UID_T
119AC_TYPE_UINT8_T
120AC_TYPE_UINT16_T
121AC_TYPE_UINT32_T
122AC_TYPE_UINT64_T
7a197a62 123AC_CHECK_MEMBERS([struct stat.st_rdev])
ad6254c5
AK
124AC_STRUCT_TM
125
126################################################################################
127dnl -- Check for functions
d911ec67
AK
128AC_SEARCH_LIBS([floor], [m], , [AC_MSG_ERROR(bailing out)])
129AC_CHECK_FUNCS([floor ftruncate gethostname getpagesize \
130 gettimeofday memset mkdir mkfifo rmdir munmap nl_langinfo setenv setlocale \
131 strcasecmp strchr strcspn strspn strdup strncasecmp strerror strrchr \
132 strstr strtol strtoul uname], , [AC_MSG_ERROR(bailing out)])
a0f9708e 133AC_CHECK_FUNCS(siginterrupt)
ad6254c5
AK
134AC_FUNC_ALLOCA
135AC_FUNC_CLOSEDIR_VOID
d911ec67 136AC_FUNC_CHOWN
ad6254c5
AK
137AC_FUNC_FORK
138AC_FUNC_LSTAT
139AC_FUNC_MALLOC
140AC_FUNC_MEMCMP
141AC_FUNC_MMAP
d911ec67 142AC_FUNC_REALLOC
ad6254c5
AK
143AC_FUNC_STAT
144AC_FUNC_STRTOD
d0191583 145AC_FUNC_VPRINTF
80992638 146
9c961554
MB
147################################################################################
148dnl -- Enables statically-linked tools
149AC_MSG_CHECKING(whether to use static linking)
150AC_ARG_ENABLE(static_link,
151 [ --enable-static_link Use this to link the tools to their libraries
152 statically. Default is dynamic linking],
153 STATIC_LINK=$enableval, STATIC_LINK=no)
154AC_MSG_RESULT($STATIC_LINK)
155
80992638 156################################################################################
8ce0cbda 157dnl -- Prefix is /usr by default, the exec_prefix default is setup later
795ca3e5
AK
158AC_PREFIX_DEFAULT(/usr)
159
80992638 160################################################################################
8ce0cbda 161dnl -- Setup the ownership of the files
ad6254c5 162AC_MSG_CHECKING(file owner)
795ca3e5 163AC_ARG_WITH(user,
39dabc84 164 [ --with-user=USER Set the owner of installed files [[USER=]] ],
a38df97f 165 [ OWNER="$withval" ])
ad6254c5 166AC_MSG_RESULT($OWNER)
a38df97f
AK
167
168if test x$OWNER != x; then
23b059e7 169 INSTALL="$INSTALL -o $OWNER"
a38df97f 170fi
795ca3e5 171
80992638 172################################################################################
8ce0cbda 173dnl -- Setup the group ownership of the files
ad6254c5 174AC_MSG_CHECKING(group owner)
795ca3e5 175AC_ARG_WITH(group,
39dabc84 176 [ --with-group=GROUP Set the group owner of installed files [[GROUP=]] ],
a38df97f 177 [ GROUP="$withval" ])
ad6254c5 178AC_MSG_RESULT($GROUP)
a38df97f
AK
179
180if test x$GROUP != x; then
23b059e7 181 INSTALL="$INSTALL -g $GROUP"
a38df97f 182fi
795ca3e5 183
0782ad50
AK
184################################################################################
185dnl -- Setup device node ownership
186AC_MSG_CHECKING(device node uid)
187
188AC_ARG_WITH(device-uid,
189 [ --with-device-uid=UID Set the owner used for new device nodes [[UID=0]] ],
190 [ DM_DEVICE_UID="$withval" ], [ DM_DEVICE_UID="0" ] )
191AC_MSG_RESULT($DM_DEVICE_UID)
192
193################################################################################
194dnl -- Setup device group ownership
195AC_MSG_CHECKING(device node gid)
196
197AC_ARG_WITH(device-gid,
198 [ --with-device-gid=UID Set the group used for new device nodes [[GID=0]] ],
199 [ DM_DEVICE_GID="$withval" ], [ DM_DEVICE_GID="0" ] )
200AC_MSG_RESULT($DM_DEVICE_GID)
201
f6fc418d
AK
202################################################################################
203dnl -- Setup device mode
204AC_MSG_CHECKING(device node mode)
205
206AC_ARG_WITH(device-mode,
207 [ --with-device-mode=MODE Set the mode used for new device nodes [[MODE=0600]] ],
208 [ DM_DEVICE_MODE="$withval" ], [ DM_DEVICE_MODE="0600" ] )
209AC_MSG_RESULT($DM_DEVICE_MODE)
210
80992638 211################################################################################
7d1552c9 212dnl -- LVM1 tool fallback option
ad6254c5 213AC_MSG_CHECKING(whether to enable lvm1 fallback)
7d1552c9
AK
214AC_ARG_ENABLE(lvm1_fallback, [ --enable-lvm1_fallback Use this to fall back and use LVM1 binaries if
215 device-mapper is missing from the kernel], LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
ad6254c5 216AC_MSG_RESULT($LVM1_FALLBACK)
7d1552c9
AK
217
218if test x$LVM1_FALLBACK = xyes; then
72b2cb61 219 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
220fi
221
80992638 222################################################################################
5a52dca9 223dnl -- format1 inclusion type
ad6254c5 224AC_MSG_CHECKING(whether to include support for lvm1 metadata)
5a52dca9
AK
225AC_ARG_WITH(lvm1,
226 [ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none
227 [TYPE=internal] ],
228 [ LVM1="$withval" ],
229 [ LVM1="internal" ])
ad6254c5 230AC_MSG_RESULT($LVM1)
5a52dca9
AK
231
232if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
233 then AC_MSG_ERROR(
234--with-lvm1 parameter invalid
235)
5a52dca9
AK
236fi;
237
b896caa1 238if test x$LVM1 = xinternal; then
72b2cb61 239 AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.])
b896caa1
AK
240fi
241
80992638 242################################################################################
d8ac0fbc 243dnl -- format_pool inclusion type
ad6254c5 244AC_MSG_CHECKING(whether to include support for GFS pool metadata)
d8ac0fbc 245AC_ARG_WITH(pool,
60329273 246 [ --with-pool=TYPE GFS pool read-only support: internal/shared/none
d8ac0fbc
AK
247 [TYPE=internal] ],
248 [ POOL="$withval" ],
249 [ POOL="internal" ])
ad6254c5 250AC_MSG_RESULT($POOL)
d8ac0fbc
AK
251
252if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]];
253 then AC_MSG_ERROR(
254--with-pool parameter invalid
255)
d8ac0fbc
AK
256fi;
257
258if test x$POOL = xinternal; then
72b2cb61 259 AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.])
d8ac0fbc
AK
260fi
261
80992638 262################################################################################
d3c8211f 263dnl -- cluster_locking inclusion type
ad6254c5 264AC_MSG_CHECKING(whether to include support for cluster locking)
d3c8211f
AK
265AC_ARG_WITH(cluster,
266 [ --with-cluster=TYPE Cluster LVM locking support: internal/shared/none
267 [TYPE=internal] ],
268 [ CLUSTER="$withval" ])
ad6254c5 269AC_MSG_RESULT($CLUSTER)
d3c8211f
AK
270
271if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]];
272 then AC_MSG_ERROR(
273--with-cluster parameter invalid
274)
d3c8211f
AK
275fi;
276
277if test x$CLUSTER = xinternal; then
72b2cb61 278 AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.])
d3c8211f 279fi
d8ac0fbc 280
80992638 281################################################################################
4922197a 282dnl -- snapshots inclusion type
ad6254c5 283AC_MSG_CHECKING(whether to include snapshots)
4922197a
AK
284AC_ARG_WITH(snapshots,
285 [ --with-snapshots=TYPE Snapshot support: internal/shared/none
286 [TYPE=internal] ],
287 [ SNAPSHOTS="$withval" ],
288 [ SNAPSHOTS="internal" ])
ad6254c5 289AC_MSG_RESULT($SNAPSHOTS)
4922197a
AK
290
291if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]];
292 then AC_MSG_ERROR(
293--with-snapshots parameter invalid
294)
4922197a
AK
295fi;
296
297if test x$SNAPSHOTS = xinternal; then
72b2cb61 298 AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.])
4922197a
AK
299fi
300
80992638 301################################################################################
4922197a 302dnl -- mirrors inclusion type
ad6254c5 303AC_MSG_CHECKING(whether to include mirrors)
4922197a
AK
304AC_ARG_WITH(mirrors,
305 [ --with-mirrors=TYPE Mirror support: internal/shared/none
306 [TYPE=internal] ],
307 [ MIRRORS="$withval" ],
308 [ MIRRORS="internal" ])
ad6254c5 309AC_MSG_RESULT($MIRRORS)
4922197a
AK
310
311if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]];
312 then AC_MSG_ERROR(
313--with-mirrors parameter invalid
314)
4922197a
AK
315fi;
316
317if test x$MIRRORS = xinternal; then
72b2cb61 318 AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])
4922197a
AK
319fi
320
8fea97b7
ZK
321################################################################################
322dnl -- asynchronous volume replicator inclusion type
323AC_MSG_CHECKING(whether to include replicators)
324AC_ARG_WITH(replicators, AC_HELP_STRING([--with-replicators=TYPE],
325 [Replicator support: internal/shared/none [TYPE=none] ]),
326 [REPLICATORS=$withval], [REPLICATORS="none"])
327AC_MSG_RESULT($REPLICATORS)
328
329case "$REPLICATORS" in
330 none|shared) ;;
331 internal) AC_DEFINE([REPLICATOR_INTERNAL], 1,
332 [Define to 1 to include built-in support for replicators.]) ;;
333 *) AC_MSG_ERROR([--with-replicators parameter invalid ($REPLICATORS)]) ;;
334esac
335
80992638 336################################################################################
1b523347 337dnl -- Disable readline
ad6254c5 338AC_MSG_CHECKING(whether to enable readline)
2c189a57 339AC_ARG_ENABLE([readline],
1b523347 340 [ --disable-readline Disable readline support],
ea7cfb00 341 [READLINE=$enableval], [READLINE=maybe])
ad6254c5 342AC_MSG_RESULT($READLINE)
795ca3e5 343
8b1a3214
AK
344################################################################################
345dnl -- Disable realtime clock support
346AC_MSG_CHECKING(whether to enable realtime support)
89044bc0 347AC_ARG_ENABLE(realtime, [ --enable-realtime Enable realtime clock support],
8b1a3214
AK
348REALTIME=$enableval)
349AC_MSG_RESULT($REALTIME)
350
90c80887
AK
351################################################################################
352dnl -- Init pkg-config with dummy invokation:
353dnl -- this is required because PKG_CHECK_MODULES macro is expanded
354dnl -- to initialize the pkg-config environment only at the first invokation,
355dnl -- that would be conditional in this configure.in.
356pkg_config_init() {
357 PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [],
358 [AC_MSG_RESULT([pkg-config initialized])])
359 PKGCONFIG_INIT=1
360}
361
80992638 362################################################################################
8ce0cbda 363dnl -- Build cluster LVM daemon
ad6254c5 364AC_MSG_CHECKING(whether to build cluster LVM daemon)
a266258f 365AC_ARG_WITH(clvmd,
a946372e 366 [ --with-clvmd=TYPE Build cluster LVM Daemon.
8c222979 367 The following cluster manager combinations are valid:
a946372e
AK
368 * cman,gulm (RHEL4 or equivalent)
369 * cman (RHEL5 or equivalent)
370 * cman,corosync,openais (or selection of them)
649c4507 371 * singlenode (localhost only)
a946372e
AK
372 * all (autodetect)
373 * none (disable build)
a266258f
AK
374 [TYPE=none] ],
375 [ CLVMD="$withval" ],
376 [ CLVMD="none" ])
377if test x$CLVMD = xyes; then
5c7fc7c4 378 CLVMD=all
b1098701 379fi
ad6254c5 380AC_MSG_RESULT($CLVMD)
80992638 381
8ce0cbda 382dnl -- If clvmd enabled without cluster locking, automagically include it
a266258f 383if test x$CLVMD != xnone && test x$CLUSTER = xnone; then
d3c8211f
AK
384 CLUSTER=internal
385fi
d3c8211f 386
90c80887
AK
387dnl -- init pkgconfig if required
388if test x$CLVMD != xnone && test x$PKGCONFIG_INIT != x1; then
389 pkg_config_init
390fi
391
392
a946372e
AK
393dnl -- define build types
394if [[ `expr x"$CLVMD" : '.*gulm.*'` != 0 ]]; then
395 BUILDGULM=yes
396fi
397if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
398 BUILDCOROSYNC=yes
399fi
400if [[ `expr x"$CLVMD" : '.*openais.*'` != 0 ]]; then
401 BUILDOPENAIS=yes
402fi
403if [[ `expr x"$CLVMD" : '.*cman.*'` != 0 ]]; then
404 BUILDCMAN=yes
405fi
406
407dnl -- sanity check around user selection
408if test x$BUILDGULM = xyes; then
409 if test x$BUILDCOROSYNC = xyes || \
410 test x$BUILDOPENAIS = xyes; then
411 AC_MSG_ERROR([requested clvmd configuration is not valid])
412 fi
413fi
414
a946372e
AK
415dnl -- define a soft bailout if we are autodetecting
416soft_bailout() {
417 NOTFOUND=1
418}
419
420hard_bailout() {
421 AC_MSG_ERROR([bailing out])
422}
423
424dnl -- if clvmd=all then set soft_bailout (we don't want to error)
425dnl -- and set all builds to yes. We need to do this here
426dnl -- to skip the gulm + openais|corosync sanity check above.
427if test x$CLVMD = xall; then
428 bailout=soft_bailout
429 BUILDGULM=yes
430 BUILDCMAN=yes
431 BUILDCOROSYNC=yes
432 BUILDOPENAIS=yes
433else
434 bailout=hard_bailout
435fi
436
437dnl -- helper macro to check libs without adding them to LIBS
438check_lib_no_libs() {
439 lib_no_libs_arg1=$1
440 shift
441 lib_no_libs_arg2=$1
442 shift
443 lib_no_libs_args=$@
444 AC_CHECK_LIB([$lib_no_libs_arg1],
445 [$lib_no_libs_arg2],,
446 [$bailout],
447 [$lib_no_libs_args])
448 LIBS=$ac_check_lib_save_LIBS
449}
450
451dnl -- Look for gulm libraries if required.
452if test x$BUILDGULM = xyes; then
453 PKG_CHECK_MODULES(CCS, libccs, [HAVE_CCS=yes],
454 [NOTFOUND=0
455 AC_CHECK_HEADERS(ccs.h,,$bailout)
456 check_lib_no_libs ccs ccs_connect
457 if test $NOTFOUND = 0; then
458 AC_MSG_RESULT([no pkg for libccs, using -lccs])
459 CCS_LIBS="-lccs"
460 HAVE_CCS=yes
461 fi])
462 PKG_CHECK_MODULES(GULM, libgulm, [HAVE_GULM=yes],
463 [NOTFOUND=0
464 AC_CHECK_HEADERS(libgulm.h,,$bailout)
465 check_lib_no_libs gulm lg_core_login
466 if test $NOTFOUND = 0; then
467 AC_MSG_RESULT([no pkg for libgulm, using -lgulm])
468 GULM_LIBS="-lgulm"
469 HAVE_GULM=yes
470 fi])
471fi
472
473dnl -- Look for cman libraries if required.
474if test x$BUILDCMAN = xyes; then
475 PKG_CHECK_MODULES(CMAN, libcman, [HAVE_CMAN=yes],
476 [NOTFOUND=0
477 AC_CHECK_HEADERS(libcman.h,,$bailout)
478 check_lib_no_libs cman cman_init
479 if test $NOTFOUND = 0; then
480 AC_MSG_RESULT([no pkg for libcman, using -lcman])
481 CMAN_LIBS="-lcman"
482 HAVE_CMAN=yes
483 fi])
484 CHECKCONFDB=yes
485 CHECKDLM=yes
486fi
487
488dnl -- Look for corosync that's required also for openais build
489dnl -- only enough recent version of corosync ship pkg-config files.
490dnl -- We can safely rely on that to detect the correct bits.
491if test x$BUILDCOROSYNC = xyes || \
492 test x$BUILDOPENAIS = xyes; then
493 PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout)
494 CHECKCONFDB=yes
495fi
496
edf47283 497dnl -- Look for corosync libraries if required.
a946372e
AK
498if test x$BUILDCOROSYNC = xyes; then
499 PKG_CHECK_MODULES(QUORUM, libquorum, [HAVE_QUORUM=yes], $bailout)
500 CHECKCPG=yes
501 CHECKDLM=yes
502fi
503
504dnl -- Look for openais libraries if required.
505if test x$BUILDOPENAIS = xyes; then
506 PKG_CHECK_MODULES(SALCK, libSaLck, [HAVE_SALCK=yes], $bailout)
507 CHECKCPG=yes
508fi
509
510dnl -- Below are checks for libraries common to more than one build.
511
512dnl -- Check confdb library.
513dnl -- mandatory for corosync build.
514dnl -- optional for openais/cman build.
515
516if test x$CHECKCONFDB = xyes; then
517 PKG_CHECK_MODULES(CONFDB, libconfdb,
518 [HAVE_CONFDB=yes],
519 [HAVE_CONFDB=no])
520
521 AC_CHECK_HEADERS(corosync/confdb.h,
522 [HAVE_CONFDB_H=yes],
523 [HAVE_CONFDB_H=no])
524
525 if test x$HAVE_CONFDB != xyes && \
526 test x$HAVE_CONFDB_H = xyes; then
527 check_lib_no_libs confdb confdb_initialize
528 AC_MSG_RESULT([no pkg for confdb, using -lconfdb])
529 CONFDB_LIBS="-lconfdb"
530 HAVE_CONFDB=yes
531 fi
532
533 if test x$BUILDCOROSYNC = xyes && \
534 test x$HAVE_CONFDB != xyes &&
535 test x$CLVMD != xall; then
536 AC_MSG_ERROR([bailing out... confdb library is required])
537 fi
538fi
539
540dnl -- Check cpg library.
541if test x$CHECKCPG = xyes; then
542 PKG_CHECK_MODULES(CPG, libcpg, [HAVE_CPG=yes], $bailout)
543fi
544
545dnl -- Check dlm library.
546if test x$CHECKDLM = xyes; then
547 PKG_CHECK_MODULES(DLM, libdlm, [HAVE_DLM=yes],
548 [NOTFOUND=0
549 AC_CHECK_HEADERS(libdlm.h,,$bailout)
550 check_lib_no_libs dlm dlm_lock -lpthread
551 if test $NOTFOUND = 0; then
552 AC_MSG_RESULT([no pkg for libdlm, using -ldlm])
553 DLM_LIBS="-ldlm -lpthread"
554 HAVE_DLM=yes
555 fi])
556fi
557
558dnl -- If we are autodetecting, we need to re-create
559dnl -- the depedencies checks and set a proper CLVMD.
560if test x$CLVMD = xall; then
8c222979 561 CLVMD=none
a946372e
AK
562 if test x$HAVE_CCS = xyes && \
563 test x$HAVE_GULM = xyes; then
8c222979
FDN
564 AC_MSG_RESULT([Enabling clvmd gulm cluster manager])
565 CLVMD="$CLVMD,gulm"
a946372e
AK
566 fi
567 if test x$HAVE_CMAN = xyes && \
568 test x$HAVE_DLM = xyes; then
8c222979
FDN
569 AC_MSG_RESULT([Enabling clvmd cman cluster manager])
570 CLVMD="$CLVMD,cman"
a946372e
AK
571 fi
572 if test x$HAVE_COROSYNC = xyes && \
573 test x$HAVE_QUORUM = xyes && \
574 test x$HAVE_CPG = xyes && \
575 test x$HAVE_DLM = xyes && \
576 test x$HAVE_CONFDB = xyes; then
8c222979
FDN
577 AC_MSG_RESULT([Enabling clvmd corosync cluster manager])
578 CLVMD="$CLVMD,corosync"
a946372e
AK
579 fi
580 if test x$HAVE_COROSYNC = xyes && \
581 test x$HAVE_CPG = xyes && \
582 test x$HAVE_SALCK = xyes; then
8c222979
FDN
583 AC_MSG_RESULT([Enabling clvmd openais cluster manager])
584 CLVMD="$CLVMD,openais"
585 fi
586 if test x$CLVMD = xnone; then
587 AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.])
a946372e 588 fi
edf47283
AK
589fi
590
3c14bcca 591################################################################################
66fd4529
AK
592dnl -- Build cluster mirror log daemon
593AC_MSG_CHECKING(whether to build cluster mirror log daemon)
594AC_ARG_ENABLE(cmirrord, [ --enable-cmirrord Enable the cluster mirror log daemon],
595CMIRRORD=$enableval, CMIRRORD=no)
596AC_MSG_RESULT($CMIRRORD)
3c14bcca 597
66fd4529
AK
598BUILD_CMIRRORD=$CMIRRORD
599
600################################################################################
601dnl -- cmirrord pidfile
602AH_TEMPLATE(CMIRRORD_PIDFILE, [Path to cmirrord pidfile.])
603if test "x$BUILD_CMIRRORD" = xyes; then
604 AC_ARG_WITH(cmirrord-pidfile,
605 [ --with-cmirrord-pidfile=PATH cmirrord pidfile [[/var/run/cmirrord.pid]] ],
606 [ AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE,"$withval") ],
607 [ AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE,"/var/run/cmirrord.pid") ])
608fi
609
610################################################################################
3c14bcca 611dnl -- Look for corosync libraries if required.
66fd4529 612if [[ "x$BUILD_CMIRRORD" = xyes ]]; then
90c80887
AK
613 dnl -- init pkgconfig if required
614 if test x$PKGCONFIG_INIT != x1; then
615 pkg_config_init
616 fi
617 PKG_CHECK_MODULES(SACKPT, libSaCkpt)
618 if test x$HAVE_CPG != xyes; then
619 PKG_CHECK_MODULES(CPG, libcpg)
620 fi
3c14bcca
JEB
621fi
622
80992638 623################################################################################
8ce0cbda 624dnl -- Enable debugging
ad6254c5
AK
625AC_MSG_CHECKING(whether to enable debugging)
626AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging],
d0191583 627 DEBUG=$enableval, DEBUG=no)
ad6254c5 628AC_MSG_RESULT($DEBUG)
8ef2b021 629
8ce0cbda
AK
630dnl -- Normally turn off optimisation for debug builds
631if test x$DEBUG = xyes; then
632 COPTIMISE_FLAG=
8a2fc586
AK
633else
634 CSCOPE_CMD=
8ce0cbda
AK
635fi
636
637################################################################################
638dnl -- Override optimisation
ad6254c5 639AC_MSG_CHECKING(for C optimisation flag)
8ce0cbda 640AC_ARG_WITH(optimisation,
d0191583 641 [ --with-optimisation=OPT C optimisation flag [[OPT=-O2]] ],
8ce0cbda 642 [ COPTIMISE_FLAG="$withval" ])
ad6254c5 643AC_MSG_RESULT($COPTIMISE_FLAG)
8ce0cbda 644
fddafd51
ZK
645################################################################################
646dnl -- Enable profiling
5556819a 647AC_MSG_CHECKING(whether to gather gcov profiling data)
fddafd51 648AC_ARG_ENABLE(profiling,
5556819a
AK
649 AC_HELP_STRING(--enable-profiling, [Gather gcov profiling data]),
650 PROFILING=$enableval, PROFILING=no)
651AC_MSG_RESULT($PROFILING)
652
653if test "x$PROFILING" = xyes; then
654 COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage"
fd4728e1
ZK
655 AC_PATH_PROG(LCOV, lcov)
656 AC_PATH_PROG(GENHTML, genhtml)
657 if test -z "$LCOV" -o -z "$GENHTML"; then
b145d876
ZK
658 AC_MSG_ERROR([lcov and genhtml are required for profiling])
659 fi
fd4728e1
ZK
660 AC_PATH_PROG(GENPNG, genpng)
661 if test -n "$GENPNG"; then
662 AC_MSG_CHECKING([whether $GENPNG has all required modules])
663 if $GENPNG --help > /dev/null 2>&1 ; then
664 AC_MSG_RESULT(ok)
665 GENHTML="$GENHTML --frames"
666 else
667 AC_MSG_RESULT(not supported)
668 AC_MSG_WARN([GD.pm perl module is not installed])
669 GENPNG=
670 fi
671 fi
5556819a 672fi
fddafd51 673
80992638 674################################################################################
8ce0cbda 675dnl -- Disable devmapper
ad6254c5 676AC_MSG_CHECKING(whether to use device-mapper)
f6fc418d 677AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable LVM2 device-mapper interaction],
ad6254c5
AK
678DEVMAPPER=$enableval)
679AC_MSG_RESULT($DEVMAPPER)
199e490e 680
b896caa1 681if test x$DEVMAPPER = xyes; then
f6fc418d 682 AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
b896caa1
AK
683fi
684
5d518f1f
AK
685################################################################################
686dnl -- Enable udev synchronisation
687AC_MSG_CHECKING(whether to enable synchronisation with udev processing)
688AC_ARG_ENABLE(udev_sync, [ --enable-udev_sync Enable synchronisation with udev processing],
689UDEV_SYNC=$enableval, UDEV_SYNC=no)
690AC_MSG_RESULT($UDEV_SYNC)
691
692if test x$UDEV_SYNC = xyes; then
f7f0854e
ZK
693 AC_CHECK_LIB(udev, udev_queue_get_udev_is_active,
694 [UDEV_PC="libudev"; UDEV_LIBS="-ludev"],
695 [AC_MSG_ERROR([bailing out... libudev library is required])])
5d518f1f
AK
696 AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
697fi
698
699dnl -- Enable udev rules
700AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation)
701AC_ARG_ENABLE(udev_rules, [ --enable-udev_rules Install rule files needed for udev synchronisation],
702UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC)
703AC_MSG_RESULT($UDEV_RULES)
704
f6fc418d
AK
705################################################################################
706dnl -- Compatibility mode
707AC_ARG_ENABLE(compat, [ --enable-compat Enable support for old device-mapper versions],
708 DM_COMPAT=$enableval, DM_COMPAT=no)
709
95eaa683
AK
710################################################################################
711dnl -- Compatible units suffix mode
712AC_ARG_ENABLE(units-compat,
713 [ --enable-units-compat Enable output compatibility with old versions that
714 that don't use KiB-style unit suffixes],
715 UNITS_COMPAT=$enableval, UNITS_COMPAT=no)
716
717if test x$UNITS_COMPAT = xyes; then
718 AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.])
719fi
720
f6fc418d
AK
721################################################################################
722dnl -- Disable ioctl
723AC_ARG_ENABLE(ioctl, [ --disable-driver Disable calls to device-mapper in the kernel],
724 DM_IOCTLS=$enableval)
725
80992638 726################################################################################
8ce0cbda 727dnl -- Disable O_DIRECT
ad6254c5
AK
728AC_MSG_CHECKING(whether to enable O_DIRECT)
729AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT],
730ODIRECT=$enableval)
731AC_MSG_RESULT($ODIRECT)
2dc95e1c
AK
732
733if test x$ODIRECT = xyes; then
72b2cb61 734 AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.])
2dc95e1c
AK
735fi
736
572fefeb
AK
737################################################################################
738dnl -- Enable liblvm2app.so
739AC_MSG_CHECKING(whether to build liblvm2app.so application library)
740AC_ARG_ENABLE(applib,
741 [ --enable-applib Build application library],
742 APPLIB=$enableval, APPLIB=no)
743AC_MSG_RESULT($APPLIB)
744AC_SUBST([LVM2APP_LIB])
745test x$APPLIB = xyes \
746 && LVM2APP_LIB=-llvm2app \
747 || LVM2APP_LIB=
748
80992638 749################################################################################
8ce0cbda 750dnl -- Enable cmdlib
ad6254c5
AK
751AC_MSG_CHECKING(whether to compile liblvm2cmd.so)
752AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library],
753CMDLIB=$enableval, CMDLIB=no)
754AC_MSG_RESULT($CMDLIB)
aa4d1e31 755AC_SUBST([LVM2CMD_LIB])
2a9a80c9 756test x$CMDLIB = xyes \
aa4d1e31
JM
757 && LVM2CMD_LIB=-llvm2cmd \
758 || LVM2CMD_LIB=
8106cdd5 759
f6fc418d
AK
760################################################################################
761dnl -- Enable pkg-config
762AC_ARG_ENABLE(pkgconfig, [ --enable-pkgconfig Install pkgconfig support],
763 PKGCONFIG=$enableval, PKGCONFIG=no)
2a9a80c9 764
23b059e7
ZK
765################################################################################
766dnl -- Enable installation of writable files by user
767AC_ARG_ENABLE(write_install, AC_HELP_STRING([--enable-write_install],
768 [Install user writable files]),
769 [WRITE_INSTALL=$enableval], [WRITE_INSTALL=no])
770
80992638 771################################################################################
8ce0cbda 772dnl -- Enable fsadm
1995c9ff 773AC_MSG_CHECKING(whether to install fsadm)
c9274524
ZK
774AC_ARG_ENABLE(fsadm, [AC_HELP_STRING([--disable-fsadm], [Disable fsadm])],
775 FSADM=$enableval)
ad6254c5 776AC_MSG_RESULT($FSADM)
809fae91 777
06f62ad1
AK
778################################################################################
779dnl -- enable dmeventd handling
780AC_MSG_CHECKING(whether to use dmeventd)
781AC_ARG_ENABLE(dmeventd, [ --enable-dmeventd Enable the device-mapper event daemon],
782DMEVENTD=$enableval)
783AC_MSG_RESULT($DMEVENTD)
784
f6fc418d
AK
785BUILD_DMEVENTD=$DMEVENTD
786
06f62ad1 787dnl -- dmeventd currently requires internal mirror support
2a9a80c9
PR
788if test x$DMEVENTD = xyes; then
789 if test x$MIRRORS != xinternal; then
790 AC_MSG_ERROR(
791 --enable-dmeventd currently requires --with-mirrors=internal
792 )
793 fi
794 if test x$CMDLIB = xno; then
795 AC_MSG_ERROR(
796 --enable-dmeventd requires --enable-cmdlib to be used as well
797 )
798 fi
06f62ad1
AK
799fi
800
15d91f5a 801if test x$DMEVENTD = xyes; then
72b2cb61 802 AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])
15d91f5a 803fi
f6fc418d
AK
804
805################################################################################
806dnl -- getline included in recent libc
807
808AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1,
809 [Define to 1 if getline is available.]))
810
811################################################################################
812dnl -- canonicalize_file_name included in recent libc
813
814AC_CHECK_LIB(c, canonicalize_file_name,
815 AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1,
816 [Define to 1 if canonicalize_file_name is available.]))
817
80992638 818################################################################################
d0191583 819dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
795ca3e5
AK
820if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
821 then exec_prefix="";
822fi;
823
80992638 824################################################################################
8ce0cbda 825dnl -- Check for dlopen
19a2c6e0 826AC_CHECK_LIB(dl, dlopen, [
72b2cb61 827 AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
19a2c6e0
ZK
828 DL_LIBS="-ldl"
829 HAVE_LIBDL=yes ], [
830 DL_LIBS=
831 HAVE_LIBDL=no ])
26e7f2e0 832
80992638 833################################################################################
8ce0cbda 834dnl -- Check for shared/static conflicts
80992638
AK
835if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \
836 -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
4922197a 837 \) -a "x$STATIC_LINK" = xyes ]];
d68a82ec 838 then AC_MSG_ERROR(
036f273a 839Features cannot be 'shared' when building statically
d68a82ec 840)
036f273a
AK
841fi
842
f30875db
ZK
843################################################################################
844if [[ "$DMEVENTD" = yes -o "$CLVMD" != none ]] ; then
845 AC_CHECK_LIB([pthread], [pthread_mutex_lock],
846 [PTHREAD_LIBS="-lpthread"], hard_bailout)
847fi
848
d0191583
JM
849################################################################################
850dnl -- Disable selinux
851AC_MSG_CHECKING(whether to enable selinux support)
852AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support],
853 SELINUX=$enableval)
854AC_MSG_RESULT($SELINUX)
855
80992638 856################################################################################
8a2fc586 857dnl -- Check for selinux
80992638 858if test x$SELINUX = xyes; then
f8f6ec92
ZK
859 AC_CHECK_LIB([sepol], [sepol_check_context], [
860 AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
861 SELINUX_LIBS="-lsepol"])
8a2fc586 862
f8f6ec92
ZK
863 AC_CHECK_LIB([selinux], [is_selinux_enabled], [
864 AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
72b2cb61 865 AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
e1b8a236 866 SELINUX_LIBS="-lselinux $SELINUX_LIBS"
f7f0854e 867 SELINUX_PC="libselinux"
f8f6ec92 868 HAVE_SELINUX=yes ], [
ad6254c5 869 AC_MSG_WARN(Disabling selinux)
f8f6ec92 870 SELINUX_LIBS=
f7f0854e 871 SELINUX_PC=
f8f6ec92 872 HAVE_SELINUX=no ])
036f273a 873fi
d68a82ec 874
8b1a3214
AK
875################################################################################
876dnl -- Check for realtime clock support
877if test x$REALTIME = xyes; then
8b1a3214 878 AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no)
8b1a3214
AK
879
880 if test x$HAVE_REALTIME = xyes; then
881 AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.])
882 LIBS="-lrt $LIBS"
883 else
884 AC_MSG_WARN(Disabling realtime clock)
885 fi
886fi
887
80992638 888################################################################################
8ce0cbda 889dnl -- Check for getopt
d0191583 890AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.]))
b896caa1 891
80992638 892################################################################################
8ce0cbda 893dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
ea7cfb00 894if test x$READLINE != xno; then
539f4a77
ZK
895 lvm_saved_libs=$LIBS
896 AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib],
897 READLINE_LIBS=$ac_cv_search_tgetent, [
898 if test "$READLINE" = yes; then
899 AC_MSG_ERROR(
900[termcap could not be found which is required for the
901--enable-readline option (which is enabled by default). Either disable readline
902support with --disable-readline or download and install termcap from:
903 ftp.gnu.org/gnu/termcap
904Note: if you are using precompiled packages you will also need the development
905 package as well (which may be called termcap-devel or something similar).
906Note: (n)curses also seems to work as a substitute for termcap. This was
907 not found either - but you could try installing that as well.])
908 fi])
909 dnl -- Old systems may need extra termcap dependency explicitly in LIBS
910 AC_CHECK_LIB([readline], [readline], [
911 AC_DEFINE([READLINE_SUPPORT], 1,
912 [Define to 1 to include the LVM readline shell.])
913 dnl -- Try only with -lreadline and check for different symbol
914 LIBS=$lvm_saved_libs
915 AC_CHECK_LIB([readline], [rl_line_buffer],
916 [ READLINE_LIBS="-lreadline" ], [
917 AC_MSG_RESULT([linking -lreadline with $READLINE_LIBS needed])
918 READLINE_LIBS="-lreadline $READLINE_LIBS"
919 ]) ], [
920 READLINE_LIBS=
921 if test "$READLINE" = yes; then
922 AC_MSG_ERROR(
923[GNU Readline could not be found which is required for the
795ca3e5
AK
924--enable-readline option (which is enabled by default). Either disable readline
925support with --disable-readline or download and install readline from:
926 ftp.gnu.org/gnu/readline
927Note: if you are using precompiled packages you will also need the development
539f4a77
ZK
928package as well (which may be called readline-devel or something similar).])
929 fi ])
930 LIBS="$READLINE_LIBS $lvm_saved_libs"
931 AC_CHECK_FUNCS([rl_completion_matches])
932 LIBS=$lvm_saved_libs
795ca3e5
AK
933fi
934
80992638 935################################################################################
8ce0cbda 936dnl -- Internationalisation stuff
ad6254c5
AK
937AC_MSG_CHECKING(whether to enable internationalisation)
938AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support],
939 INTL=$enableval, INTL=no)
940AC_MSG_RESULT($INTL)
69792976
AK
941
942if test x$INTL = xyes; then
f6fc418d 943# FIXME - Move this - can be device-mapper too
69792976
AK
944 INTL_PACKAGE="lvm2"
945 AC_PATH_PROG(MSGFMT, msgfmt)
946 if [[ "x$MSGFMT" == x ]];
947 then AC_MSG_ERROR(
948 msgfmt not found in path $PATH
949 )
69792976
AK
950 fi;
951
952 AC_ARG_WITH(localedir,
d0191583
JM
953 [ --with-localedir=DIR Translation files in DIR [[PREFIX/share/locale]] ],
954 [ LOCALEDIR="$withval" ],
955 [ LOCALEDIR='${prefix}/share/locale' ])
69792976
AK
956fi
957
80992638 958################################################################################
4a7f3eb2 959AC_ARG_WITH(confdir,
5d518f1f 960 [ --with-confdir=DIR Configuration files in DIR [[/etc]]],
d0191583
JM
961 [ CONFDIR="$withval" ],
962 [ CONFDIR='/etc' ])
0a62c911
AK
963
964AC_ARG_WITH(staticdir,
5d518f1f 965 [ --with-staticdir=DIR Static binary in DIR [[EPREFIX/sbin]]],
d0191583
JM
966 [ STATICDIR="$withval" ],
967 [ STATICDIR='${exec_prefix}/sbin' ])
0a62c911 968
68f2de6d
AK
969AC_ARG_WITH(usrlibdir,
970 [ --with-usrlibdir=DIR],
971 [ usrlibdir="$withval"],
972 [ usrlibdir='${prefix}/lib' ])
973
974AC_ARG_WITH(usrsbindir,
975 [ --with-usrsbindir=DIR],
976 [ usrsbindir="$withval"],
977 [ usrsbindir='${prefix}/sbin' ])
978
5d518f1f
AK
979################################################################################
980AC_ARG_WITH(udev_prefix,
981 [ --with-udev-prefix=UPREFIX Install udev rule files in UPREFIX [[EPREFIX]]],
982 [ udev_prefix="$withval"],
983 [ udev_prefix='${exec_prefix}' ])
984
78ce7acc
AK
985AC_ARG_WITH(udevdir,
986 [ --with-udevdir=DIR udev rules in DIR [[UPREFIX/lib/udev/rules.d]]],
987 [ udevdir="$withval"],
988 [ udevdir='${udev_prefix}/lib/udev/rules.d' ])
5d518f1f 989
ad6254c5
AK
990################################################################################
991dnl -- Ensure additional headers required
992if test x$READLINE = xyes; then
993 AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out))
994fi
995
5c7fc7c4 996if test x$CLVMD != xnone; then
ad6254c5
AK
997 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))
998 AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out))
999 AC_FUNC_GETMNTENT
ad6254c5
AK
1000 AC_FUNC_SELECT_ARGTYPES
1001fi
1002
ad6254c5
AK
1003if test x$CLUSTER != xnone; then
1004 AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out))
1005 AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out))
1006fi
1007
d911ec67
AK
1008if test x$DMEVENTD = xyes; then
1009 AC_CHECK_HEADERS(arpa/inet.h,,AC_MSG_ERROR(bailing out))
1010fi
1011
ad6254c5
AK
1012if test x$HAVE_LIBDL = xyes; then
1013 AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out))
1014fi
1015
1016if test x$INTL = xyes; then
1017 AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out))
1018fi
1019
5d518f1f
AK
1020if test x$UDEV_SYNC = xyes; then
1021 AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out))
1022fi
1023
a653923f
AK
1024################################################################################
1025AC_PATH_PROG(MODPROBE_CMD, modprobe)
1026
1027if test x$MODPROBE_CMD != x; then
72b2cb61 1028 AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
a653923f
AK
1029fi
1030
a9b601e2
ZK
1031
1032lvm_exec_prefix=$exec_prefix
1033test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$prefix
1034test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$ac_default_prefix
1035AC_DEFINE_UNQUOTED(LVM_PATH, ["$lvm_exec_prefix/sbin/lvm"], [Path to lvm binary.])
b5c2529b
ZK
1036
1037if test "$CLVMD" != none; then
1038 clvmd_prefix=$ac_default_prefix
1039 test "$prefix" != NONE && clvmd_prefix=$prefix
1040 AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$clvmd_prefix/sbin/clvmd"], [Path to clvmd binary.])
1041fi
1042
80992638 1043################################################################################
f6fc418d
AK
1044dnl -- dmeventd pidfile and executable path
1045AH_TEMPLATE(DMEVENTD_PIDFILE, [Path to dmeventd pidfile.])
1046if test "$BUILD_DMEVENTD" = yes; then
1047 AC_ARG_WITH(dmeventd-pidfile,
1048 [ --with-dmeventd-pidfile=PATH dmeventd pidfile [[/var/run/dmeventd.pid]] ],
1049 [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"$withval") ],
1050 [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"/var/run/dmeventd.pid") ])
1051fi
1052
1053AH_TEMPLATE(DMEVENTD_PATH, [Path to dmeventd binary.])
1054if test "$BUILD_DMEVENTD" = yes; then
f6fc418d 1055 AC_ARG_WITH(dmeventd-path,
5d518f1f 1056 [ --with-dmeventd-path=PATH dmeventd path [[EPREFIX/sbin/dmeventd]] ],
f6fc418d 1057 [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$withval") ],
a9b601e2 1058 [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$lvm_exec_prefix/sbin/dmeventd") ])
f6fc418d
AK
1059fi
1060
3399ae32
AK
1061################################################################################
1062dnl -- various defaults
1063AH_TEMPLATE(DEFAULT_SYS_DIR, [Path to LVM system directory.])
1064AC_ARG_WITH(default-system-dir,
1065 [ --with-default-system-dir=DIR Default LVM system directory [[/etc/lvm]] ],
1066 [ DEFAULT_SYS_DIR="$withval" ],
1067 [ DEFAULT_SYS_DIR="/etc/lvm" ])
1068AC_DEFINE_UNQUOTED(DEFAULT_SYS_DIR,["$DEFAULT_SYS_DIR"] )
1069
1070AH_TEMPLATE(DEFAULT_ARCHIVE_SUBDIR, [Name of default metadata archive subdirectory.])
1071AC_ARG_WITH(default-archive-subdir,
1072 [ --with-default-archive-subdir=SUBDIR Default metadata archive subdir [[archive]] ],
1073 [ DEFAULT_ARCHIVE_SUBDIR="$withval" ],
1074 [ DEFAULT_ARCHIVE_SUBDIR="archive" ])
1075AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE_SUBDIR,["$DEFAULT_ARCHIVE_SUBDIR"])
1076
1077AH_TEMPLATE(DEFAULT_BACKUP_SUBDIR, [Name of default metadata backup subdirectory.])
1078AC_ARG_WITH(default-backup-subdir,
1079 [ --with-default-backup-subdir=SUBDIR Default metadata backup subdir [[backup]] ],
1080 [ DEFAULT_BACKUP_SUBDIR="$withval" ],
1081 [ DEFAULT_BACKUP_SUBDIR="backup" ])
1082AC_DEFINE_UNQUOTED(DEFAULT_BACKUP_SUBDIR,["$DEFAULT_BACKUP_SUBDIR"] )
1083
21c56e37 1084AH_TEMPLATE(DEFAULT_CACHE_SUBDIR, [Name of default metadata cache subdirectory.])
3399ae32
AK
1085AC_ARG_WITH(default-cache-subdir,
1086 [ --with-default-cache-subdir=SUBDIR Default metadata cache subdir [[cache]] ],
1087 [ DEFAULT_CACHE_SUBDIR="$withval" ],
1088 [ DEFAULT_CACHE_SUBDIR="cache" ])
1089AC_DEFINE_UNQUOTED(DEFAULT_CACHE_SUBDIR,["$DEFAULT_CACHE_SUBDIR"] )
1090
1091AH_TEMPLATE(DEFAULT_LOCK_DIR, [Name of default locking directory.])
1092AC_ARG_WITH(default-locking-dir,
1093 [ --with-default-locking-dir=DIR Default locking directory [[/var/lock/lvm]] ],
1094 [ DEFAULT_LOCK_DIR="$withval" ],
1095 [ DEFAULT_LOCK_DIR="/var/lock/lvm" ])
1096AC_DEFINE_UNQUOTED(DEFAULT_LOCK_DIR,["$DEFAULT_LOCK_DIR"] )
1097
f6fc418d
AK
1098################################################################################
1099dnl -- which kernel interface to use (ioctl only)
1100AC_MSG_CHECKING(for kernel interface choice)
1101AC_ARG_WITH(interface,
1102 [ --with-interface=IFACE Choose kernel interface (ioctl) [[ioctl]] ],
1103 [ interface="$withval" ],
1104 [ interface=ioctl ])
1105if [[ "x$interface" != xioctl ]];
1106then
1107 AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.)
1108fi
1109AC_MSG_RESULT($interface)
1110
1111################################################################################
db8b5af9 1112DM_LIB_VERSION="\"`cat "$srcdir"/VERSION_DM 2>/dev/null || echo Unknown`\""
f58b35b5
AK
1113AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version])
1114
db8b5af9 1115DM_LIB_PATCHLEVEL=`cat "$srcdir"/VERSION_DM | $AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'`
597c3f8e 1116
db8b5af9 1117LVM_VERSION="\"`cat "$srcdir"/VERSION 2>/dev/null || echo Unknown`\""
fae0c576 1118
db8b5af9 1119VER=`cat "$srcdir"/VERSION`
bf456146 1120LVM_RELEASE_DATE="\"`echo $VER | $SED 's/.* (//;s/).*//'`\""
ec6a6fbe
AK
1121VER=`echo "$VER" | $AWK '{print $1}'`
1122LVM_RELEASE="\"`echo "$VER" | $AWK -F '-' '{print $2}'`\""
1123VER=`echo "$VER" | $AWK -F '-' '{print $1}'`
1124LVM_MAJOR=`echo "$VER" | $AWK -F '.' '{print $1}'`
1125LVM_MINOR=`echo "$VER" | $AWK -F '.' '{print $2}'`
bf456146
AK
1126LVM_PATCHLEVEL=`echo "$VER" | $AWK -F '[[(.]]' '{print $3}'`
1127LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'`
ec6a6fbe 1128
80992638 1129################################################################################
572fefeb 1130AC_SUBST(APPLIB)
aaa2e046 1131AC_SUBST(AWK)
66fd4529 1132AC_SUBST(BUILD_CMIRRORD)
d0191583 1133AC_SUBST(BUILD_DMEVENTD)
a946372e
AK
1134AC_SUBST(CCS_CFLAGS)
1135AC_SUBST(CCS_LIBS)
b896caa1 1136AC_SUBST(CFLAGS)
d0191583 1137AC_SUBST(CFLOW_CMD)
8106cdd5 1138AC_SUBST(CLDFLAGS)
8106cdd5 1139AC_SUBST(CLDNOWHOLEARCHIVE)
d0191583
JM
1140AC_SUBST(CLDWHOLEARCHIVE)
1141AC_SUBST(CLUSTER)
1142AC_SUBST(CLVMD)
a946372e
AK
1143AC_SUBST(CMAN_CFLAGS)
1144AC_SUBST(CMAN_LIBS)
d0191583 1145AC_SUBST(CMDLIB)
edf47283
AK
1146AC_SUBST(CONFDB_CFLAGS)
1147AC_SUBST(CONFDB_LIBS)
1148AC_SUBST(CONFDIR)
d0191583 1149AC_SUBST(COPTIMISE_FLAG)
edf47283
AK
1150AC_SUBST(CPG_CFLAGS)
1151AC_SUBST(CPG_LIBS)
d0191583 1152AC_SUBST(CSCOPE_CMD)
8ef2b021 1153AC_SUBST(DEBUG)
3399ae32
AK
1154AC_SUBST(DEFAULT_SYS_DIR)
1155AC_SUBST(DEFAULT_ARCHIVE_SUBDIR)
1156AC_SUBST(DEFAULT_BACKUP_SUBDIR)
1157AC_SUBST(DEFAULT_CACHE_SUBDIR)
1158AC_SUBST(DEFAULT_LOCK_DIR)
199e490e 1159AC_SUBST(DEVMAPPER)
a946372e
AK
1160AC_SUBST(DLM_CFLAGS)
1161AC_SUBST(DLM_LIBS)
19a2c6e0 1162AC_SUBST(DL_LIBS)
d0191583
JM
1163AC_SUBST(DMEVENTD)
1164AC_SUBST(DM_COMPAT)
1165AC_SUBST(DM_DEVICE_GID)
1166AC_SUBST(DM_DEVICE_MODE)
1167AC_SUBST(DM_DEVICE_UID)
1168AC_SUBST(DM_IOCTLS)
1169AC_SUBST(DM_LIB_VERSION)
597c3f8e 1170AC_SUBST(DM_LIB_PATCHLEVEL)
d0191583 1171AC_SUBST(FSADM)
a946372e
AK
1172AC_SUBST(GULM_CFLAGS)
1173AC_SUBST(GULM_LIBS)
26e7f2e0 1174AC_SUBST(HAVE_LIBDL)
8b1a3214 1175AC_SUBST(HAVE_REALTIME)
d0191583
JM
1176AC_SUBST(INTL)
1177AC_SUBST(INTL_PACKAGE)
1178AC_SUBST(JOBS)
1179AC_SUBST(LDDEPS)
1180AC_SUBST(LIBS)
1181AC_SUBST(LIB_SUFFIX)
69792976 1182AC_SUBST(LOCALEDIR)
d0191583
JM
1183AC_SUBST(LVM1)
1184AC_SUBST(LVM1_FALLBACK)
d0191583 1185AC_SUBST(LVM_VERSION)
bf456146 1186AC_SUBST(LVM_LIBAPI)
ec6a6fbe
AK
1187AC_SUBST(LVM_MAJOR)
1188AC_SUBST(LVM_MINOR)
1189AC_SUBST(LVM_PATCHLEVEL)
1190AC_SUBST(LVM_RELEASE)
1191AC_SUBST(LVM_RELEASE_DATE)
d0191583 1192AC_SUBST(MIRRORS)
8fea97b7 1193AC_SUBST(REPLICATORS)
d0191583 1194AC_SUBST(MSGFMT)
d0191583
JM
1195AC_SUBST(PKGCONFIG)
1196AC_SUBST(POOL)
f30875db 1197AC_SUBST(PTHREAD_LIBS)
edf47283
AK
1198AC_SUBST(QUORUM_CFLAGS)
1199AC_SUBST(QUORUM_LIBS)
539f4a77 1200AC_SUBST(READLINE_LIBS)
90c80887
AK
1201AC_SUBST(SACKPT_CFLAGS)
1202AC_SUBST(SACKPT_LIBS)
a946372e
AK
1203AC_SUBST(SALCK_CFLAGS)
1204AC_SUBST(SALCK_LIBS)
e1b8a236 1205AC_SUBST(SELINUX_LIBS)
f7f0854e 1206AC_SUBST(SELINUX_PC)
d0191583 1207AC_SUBST(SNAPSHOTS)
0a62c911 1208AC_SUBST(STATICDIR)
d0191583 1209AC_SUBST(STATIC_LINK)
db724a44 1210AC_SUBST(UDEV_LIBS)
f7f0854e 1211AC_SUBST(UDEV_PC)
5d518f1f 1212AC_SUBST(UDEV_RULES)
4df024c4 1213AC_SUBST(UDEV_SYNC)
23b059e7 1214AC_SUBST(WRITE_INSTALL)
f6fc418d
AK
1215AC_SUBST(interface)
1216AC_SUBST(kerneldir)
1217AC_SUBST(missingkernel)
1218AC_SUBST(kernelvsn)
1219AC_SUBST(tmpdir)
5d518f1f
AK
1220AC_SUBST(udev_prefix)
1221AC_SUBST(udevdir)
68f2de6d
AK
1222AC_SUBST(usrlibdir)
1223AC_SUBST(usrsbindir)
8106cdd5 1224
80992638 1225################################################################################
d3a356b4 1226dnl -- First and last lines should not contain files to generate in order to
8ce0cbda 1227dnl -- keep utility scripts running properly
d3a356b4
JM
1228AC_CONFIG_FILES([
1229Makefile
1230make.tmpl
1231daemons/Makefile
1232daemons/clvmd/Makefile
5d311afb 1233daemons/cmirrord/Makefile
f6fc418d
AK
1234daemons/dmeventd/Makefile
1235daemons/dmeventd/libdevmapper-event.pc
b7edb5bf 1236daemons/dmeventd/plugins/Makefile
d3d98fdc 1237daemons/dmeventd/plugins/lvm2/Makefile
f6fc418d
AK
1238daemons/dmeventd/plugins/mirror/Makefile
1239daemons/dmeventd/plugins/snapshot/Makefile
d3a356b4 1240doc/Makefile
da05c479 1241doc/example.conf
db8b5af9 1242include/.symlinks
f6fc418d
AK
1243include/Makefile
1244lib/Makefile
d3a356b4
JM
1245lib/format1/Makefile
1246lib/format_pool/Makefile
1247lib/locking/Makefile
1248lib/mirror/Makefile
8fea97b7 1249lib/replicator/Makefile
ec6a6fbe 1250lib/misc/lvm-version.h
d3a356b4 1251lib/snapshot/Makefile
f6fc418d
AK
1252libdm/Makefile
1253libdm/libdevmapper.pc
e0c64c6c 1254liblvm/Makefile
70046623 1255liblvm/liblvm2app.pc
f6fc418d
AK
1256man/Makefile
1257po/Makefile
2de38033 1258scripts/clvmd_init_red_hat
81410c8f 1259scripts/cmirrord_init_red_hat
595eaf92 1260scripts/lvm2_monitoring_init_red_hat
d3a356b4 1261scripts/Makefile
f6fc418d 1262test/Makefile
c7e363f9 1263test/api/Makefile
d3a356b4 1264tools/Makefile
5d518f1f 1265udev/Makefile
7a197a62
AK
1266])
1267AC_OUTPUT
2dc95e1c
AK
1268
1269if test x$ODIRECT != xyes; then
ad6254c5 1270 AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up)
2dc95e1c 1271fi
This page took 0.222601 seconds and 5 git commands to generate.