]> sourceware.org Git - lvm2.git/blame - configure.in
post-release (retrospective)
[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
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
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
0782ad50
AK
162################################################################################
163dnl -- Setup device node ownership
164AC_MSG_CHECKING(device node uid)
165
166AC_ARG_WITH(device-uid,
167 [ --with-device-uid=UID Set the owner used for new device nodes [[UID=0]] ],
168 [ DM_DEVICE_UID="$withval" ], [ DM_DEVICE_UID="0" ] )
169AC_MSG_RESULT($DM_DEVICE_UID)
170
171################################################################################
172dnl -- Setup device group ownership
173AC_MSG_CHECKING(device node gid)
174
175AC_ARG_WITH(device-gid,
176 [ --with-device-gid=UID Set the group used for new device nodes [[GID=0]] ],
177 [ DM_DEVICE_GID="$withval" ], [ DM_DEVICE_GID="0" ] )
178AC_MSG_RESULT($DM_DEVICE_GID)
179
f6fc418d
AK
180################################################################################
181dnl -- Setup device mode
182AC_MSG_CHECKING(device node mode)
183
184AC_ARG_WITH(device-mode,
185 [ --with-device-mode=MODE Set the mode used for new device nodes [[MODE=0600]] ],
186 [ DM_DEVICE_MODE="$withval" ], [ DM_DEVICE_MODE="0600" ] )
187AC_MSG_RESULT($DM_DEVICE_MODE)
188
80992638 189################################################################################
7d1552c9 190dnl -- LVM1 tool fallback option
ad6254c5 191AC_MSG_CHECKING(whether to enable lvm1 fallback)
7d1552c9
AK
192AC_ARG_ENABLE(lvm1_fallback, [ --enable-lvm1_fallback Use this to fall back and use LVM1 binaries if
193 device-mapper is missing from the kernel], LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
ad6254c5 194AC_MSG_RESULT($LVM1_FALLBACK)
7d1552c9
AK
195
196if test x$LVM1_FALLBACK = xyes; then
72b2cb61 197 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
198fi
199
80992638 200################################################################################
5a52dca9 201dnl -- format1 inclusion type
ad6254c5 202AC_MSG_CHECKING(whether to include support for lvm1 metadata)
5a52dca9
AK
203AC_ARG_WITH(lvm1,
204 [ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none
205 [TYPE=internal] ],
206 [ LVM1="$withval" ],
207 [ LVM1="internal" ])
ad6254c5 208AC_MSG_RESULT($LVM1)
5a52dca9
AK
209
210if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
211 then AC_MSG_ERROR(
212--with-lvm1 parameter invalid
213)
5a52dca9
AK
214fi;
215
b896caa1 216if test x$LVM1 = xinternal; then
72b2cb61 217 AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.])
b896caa1
AK
218fi
219
80992638 220################################################################################
d8ac0fbc 221dnl -- format_pool inclusion type
ad6254c5 222AC_MSG_CHECKING(whether to include support for GFS pool metadata)
d8ac0fbc 223AC_ARG_WITH(pool,
60329273 224 [ --with-pool=TYPE GFS pool read-only support: internal/shared/none
d8ac0fbc
AK
225 [TYPE=internal] ],
226 [ POOL="$withval" ],
227 [ POOL="internal" ])
ad6254c5 228AC_MSG_RESULT($POOL)
d8ac0fbc
AK
229
230if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]];
231 then AC_MSG_ERROR(
232--with-pool parameter invalid
233)
d8ac0fbc
AK
234fi;
235
236if test x$POOL = xinternal; then
72b2cb61 237 AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.])
d8ac0fbc
AK
238fi
239
80992638 240################################################################################
d3c8211f 241dnl -- cluster_locking inclusion type
ad6254c5 242AC_MSG_CHECKING(whether to include support for cluster locking)
d3c8211f
AK
243AC_ARG_WITH(cluster,
244 [ --with-cluster=TYPE Cluster LVM locking support: internal/shared/none
245 [TYPE=internal] ],
246 [ CLUSTER="$withval" ])
ad6254c5 247AC_MSG_RESULT($CLUSTER)
d3c8211f
AK
248
249if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]];
250 then AC_MSG_ERROR(
251--with-cluster parameter invalid
252)
d3c8211f
AK
253fi;
254
255if test x$CLUSTER = xinternal; then
72b2cb61 256 AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.])
d3c8211f 257fi
d8ac0fbc 258
80992638 259################################################################################
4922197a 260dnl -- snapshots inclusion type
ad6254c5 261AC_MSG_CHECKING(whether to include snapshots)
4922197a
AK
262AC_ARG_WITH(snapshots,
263 [ --with-snapshots=TYPE Snapshot support: internal/shared/none
264 [TYPE=internal] ],
265 [ SNAPSHOTS="$withval" ],
266 [ SNAPSHOTS="internal" ])
ad6254c5 267AC_MSG_RESULT($SNAPSHOTS)
4922197a
AK
268
269if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]];
270 then AC_MSG_ERROR(
271--with-snapshots parameter invalid
272)
4922197a
AK
273fi;
274
275if test x$SNAPSHOTS = xinternal; then
72b2cb61 276 AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.])
4922197a
AK
277fi
278
80992638 279################################################################################
4922197a 280dnl -- mirrors inclusion type
ad6254c5 281AC_MSG_CHECKING(whether to include mirrors)
4922197a
AK
282AC_ARG_WITH(mirrors,
283 [ --with-mirrors=TYPE Mirror support: internal/shared/none
284 [TYPE=internal] ],
285 [ MIRRORS="$withval" ],
286 [ MIRRORS="internal" ])
ad6254c5 287AC_MSG_RESULT($MIRRORS)
4922197a
AK
288
289if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]];
290 then AC_MSG_ERROR(
291--with-mirrors parameter invalid
292)
4922197a
AK
293fi;
294
295if test x$MIRRORS = xinternal; then
72b2cb61 296 AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])
4922197a
AK
297fi
298
80992638 299################################################################################
1b523347 300dnl -- Disable readline
ad6254c5 301AC_MSG_CHECKING(whether to enable readline)
2c189a57 302AC_ARG_ENABLE([readline],
1b523347 303 [ --disable-readline Disable readline support],
ea7cfb00 304 [READLINE=$enableval], [READLINE=maybe])
ad6254c5 305AC_MSG_RESULT($READLINE)
795ca3e5 306
8b1a3214
AK
307################################################################################
308dnl -- Disable realtime clock support
309AC_MSG_CHECKING(whether to enable realtime support)
3d978351 310AC_ARG_ENABLE(realtime, [ --disable-realtime Disable realtime clock support],
8b1a3214
AK
311REALTIME=$enableval)
312AC_MSG_RESULT($REALTIME)
313
80992638 314################################################################################
8ce0cbda 315dnl -- Build cluster LVM daemon
ad6254c5 316AC_MSG_CHECKING(whether to build cluster LVM daemon)
a266258f 317AC_ARG_WITH(clvmd,
5c7fc7c4 318 [ --with-clvmd=TYPE Build cluster LVM Daemon: cman/gulm/none/all
a266258f
AK
319 [TYPE=none] ],
320 [ CLVMD="$withval" ],
321 [ CLVMD="none" ])
322if test x$CLVMD = xyes; then
5c7fc7c4 323 CLVMD=all
b1098701 324fi
ad6254c5 325AC_MSG_RESULT($CLVMD)
80992638 326
8ce0cbda 327dnl -- If clvmd enabled without cluster locking, automagically include it
a266258f 328if test x$CLVMD != xnone && test x$CLUSTER = xnone; then
d3c8211f
AK
329 CLUSTER=internal
330fi
d3c8211f 331
80992638 332################################################################################
8ce0cbda 333dnl -- Enable debugging
ad6254c5
AK
334AC_MSG_CHECKING(whether to enable debugging)
335AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging],
d0191583 336 DEBUG=$enableval, DEBUG=no)
ad6254c5 337AC_MSG_RESULT($DEBUG)
8ef2b021 338
8ce0cbda
AK
339dnl -- Normally turn off optimisation for debug builds
340if test x$DEBUG = xyes; then
341 COPTIMISE_FLAG=
8a2fc586
AK
342else
343 CSCOPE_CMD=
8ce0cbda
AK
344fi
345
346################################################################################
347dnl -- Override optimisation
ad6254c5 348AC_MSG_CHECKING(for C optimisation flag)
8ce0cbda 349AC_ARG_WITH(optimisation,
d0191583 350 [ --with-optimisation=OPT C optimisation flag [[OPT=-O2]] ],
8ce0cbda 351 [ COPTIMISE_FLAG="$withval" ])
ad6254c5 352AC_MSG_RESULT($COPTIMISE_FLAG)
8ce0cbda 353
fddafd51
ZK
354################################################################################
355dnl -- Enable profiling
5556819a 356AC_MSG_CHECKING(whether to gather gcov profiling data)
fddafd51 357AC_ARG_ENABLE(profiling,
5556819a
AK
358 AC_HELP_STRING(--enable-profiling, [Gather gcov profiling data]),
359 PROFILING=$enableval, PROFILING=no)
360AC_MSG_RESULT($PROFILING)
361
362if test "x$PROFILING" = xyes; then
363 COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage"
b145d876
ZK
364 AC_PATH_PROG(LCOV, lcov, no)
365 AC_PATH_PROG(GENHTML, genhtml, no)
366 if test "$LCOV" = no -o "$GENHTML" = no ; then
367 AC_MSG_ERROR([lcov and genhtml are required for profiling])
368 fi
5556819a 369fi
fddafd51 370
80992638 371################################################################################
8ce0cbda 372dnl -- Disable devmapper
ad6254c5 373AC_MSG_CHECKING(whether to use device-mapper)
f6fc418d 374AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable LVM2 device-mapper interaction],
ad6254c5
AK
375DEVMAPPER=$enableval)
376AC_MSG_RESULT($DEVMAPPER)
199e490e 377
b896caa1 378if test x$DEVMAPPER = xyes; then
f6fc418d 379 AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
b896caa1
AK
380fi
381
f6fc418d
AK
382################################################################################
383dnl -- Compatibility mode
384AC_ARG_ENABLE(compat, [ --enable-compat Enable support for old device-mapper versions],
385 DM_COMPAT=$enableval, DM_COMPAT=no)
386
387################################################################################
388dnl -- Disable ioctl
389AC_ARG_ENABLE(ioctl, [ --disable-driver Disable calls to device-mapper in the kernel],
390 DM_IOCTLS=$enableval)
391
80992638 392################################################################################
8ce0cbda 393dnl -- Disable O_DIRECT
ad6254c5
AK
394AC_MSG_CHECKING(whether to enable O_DIRECT)
395AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT],
396ODIRECT=$enableval)
397AC_MSG_RESULT($ODIRECT)
2dc95e1c
AK
398
399if test x$ODIRECT = xyes; then
72b2cb61 400 AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.])
2dc95e1c
AK
401fi
402
80992638 403################################################################################
8ce0cbda 404dnl -- Enable cmdlib
ad6254c5
AK
405AC_MSG_CHECKING(whether to compile liblvm2cmd.so)
406AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library],
407CMDLIB=$enableval, CMDLIB=no)
408AC_MSG_RESULT($CMDLIB)
aa4d1e31 409AC_SUBST([LVM2CMD_LIB])
2a9a80c9 410test x$CMDLIB = xyes \
aa4d1e31
JM
411 && LVM2CMD_LIB=-llvm2cmd \
412 || LVM2CMD_LIB=
8106cdd5 413
f6fc418d
AK
414################################################################################
415dnl -- Enable pkg-config
416AC_ARG_ENABLE(pkgconfig, [ --enable-pkgconfig Install pkgconfig support],
417 PKGCONFIG=$enableval, PKGCONFIG=no)
2a9a80c9 418
80992638 419################################################################################
8ce0cbda 420dnl -- Enable fsadm
1995c9ff 421AC_MSG_CHECKING(whether to install fsadm)
ad6254c5
AK
422AC_ARG_ENABLE(fsadm, [ --enable-fsadm Enable fsadm],
423FSADM=$enableval)
424AC_MSG_RESULT($FSADM)
809fae91 425
06f62ad1
AK
426################################################################################
427dnl -- enable dmeventd handling
428AC_MSG_CHECKING(whether to use dmeventd)
429AC_ARG_ENABLE(dmeventd, [ --enable-dmeventd Enable the device-mapper event daemon],
430DMEVENTD=$enableval)
431AC_MSG_RESULT($DMEVENTD)
432
f6fc418d
AK
433BUILD_DMEVENTD=$DMEVENTD
434
06f62ad1 435dnl -- dmeventd currently requires internal mirror support
2a9a80c9
PR
436if test x$DMEVENTD = xyes; then
437 if test x$MIRRORS != xinternal; then
438 AC_MSG_ERROR(
439 --enable-dmeventd currently requires --with-mirrors=internal
440 )
441 fi
442 if test x$CMDLIB = xno; then
443 AC_MSG_ERROR(
444 --enable-dmeventd requires --enable-cmdlib to be used as well
445 )
446 fi
06f62ad1
AK
447fi
448
15d91f5a 449if test x$DMEVENTD = xyes; then
72b2cb61 450 AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])
15d91f5a 451fi
f6fc418d
AK
452
453################################################################################
454dnl -- getline included in recent libc
455
456AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1,
457 [Define to 1 if getline is available.]))
458
459################################################################################
460dnl -- canonicalize_file_name included in recent libc
461
462AC_CHECK_LIB(c, canonicalize_file_name,
463 AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1,
464 [Define to 1 if canonicalize_file_name is available.]))
465
80992638 466################################################################################
d0191583 467dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
795ca3e5
AK
468if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
469 then exec_prefix="";
470fi;
471
80992638 472################################################################################
8ce0cbda 473dnl -- Check for termcap (Shamelessly copied from parted 1.4.17)
ea7cfb00
JM
474if test x$READLINE != xno; then
475 AC_SEARCH_LIBS([tgetent], [ncurses curses termcap termlib],
476 [tg_found=yes], [tg_found=no])
477 test x$READLINE:$tg_found = xyes:no &&
478 AC_MSG_ERROR(
795ca3e5
AK
479termcap could not be found which is required for the
480--enable-readline option (which is enabled by default). Either disable readline
481support with --disable-readline or download and install termcap from:
482 ftp.gnu.org/gnu/termcap
483Note: if you are using precompiled packages you will also need the development
484 package as well (which may be called termcap-devel or something similar).
485Note: (n)curses also seems to work as a substitute for termcap. This was
486 not found either - but you could try installing that as well.
487)
795ca3e5
AK
488fi
489
80992638 490################################################################################
8ce0cbda 491dnl -- Check for dlopen
26e7f2e0
AK
492AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no)
493
7e9e9502 494if [[ "x$HAVE_LIBDL" = xyes ]]; then
72b2cb61 495 AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
26e7f2e0 496 LIBS="-ldl $LIBS"
d68a82ec
AK
497else
498 HAVE_LIBDL=no
26e7f2e0
AK
499fi
500
80992638 501################################################################################
8ce0cbda 502dnl -- Check for shared/static conflicts
80992638
AK
503if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \
504 -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
4922197a 505 \) -a "x$STATIC_LINK" = xyes ]];
d68a82ec 506 then AC_MSG_ERROR(
036f273a 507Features cannot be 'shared' when building statically
d68a82ec 508)
036f273a
AK
509fi
510
d0191583
JM
511################################################################################
512dnl -- Enables statically-linked tools
513AC_MSG_CHECKING(whether to use static linking)
514AC_ARG_ENABLE(static_link,
515 [ --enable-static_link Use this to link the tools to their libraries
516 statically. Default is dynamic linking],
517 STATIC_LINK=$enableval, STATIC_LINK=no)
518AC_MSG_RESULT($STATIC_LINK)
519
520################################################################################
521dnl -- Disable selinux
522AC_MSG_CHECKING(whether to enable selinux support)
523AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support],
524 SELINUX=$enableval)
525AC_MSG_RESULT($SELINUX)
526
80992638 527################################################################################
8a2fc586 528dnl -- Check for selinux
80992638 529if test x$SELINUX = xyes; then
8a2fc586 530 AC_CHECK_LIB(sepol, sepol_check_context, HAVE_SEPOL=yes, HAVE_SEPOL=no)
8a2fc586
AK
531
532 if test x$HAVE_SEPOL = xyes; then
d0191583
JM
533 AC_DEFINE([HAVE_SEPOL], 1,
534 [Define to 1 if sepol_check_context is available.])
8a2fc586
AK
535 LIBS="-lsepol $LIBS"
536 fi
537
80992638
AK
538 AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no)
539
540 if test x$HAVE_SELINUX = xyes; then
72b2cb61 541 AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
80992638
AK
542 LIBS="-lselinux $LIBS"
543 else
ad6254c5 544 AC_MSG_WARN(Disabling selinux)
80992638 545 fi
66e941e8 546
d0191583 547 # With --enable-static_link and selinux enabled, linking
66e941e8
JM
548 # fails on at least Debian unstable due to unsatisfied references
549 # to pthread_mutex_lock and _unlock. See if we need -lpthread.
550 if test "$STATIC_LINK-$HAVE_SELINUX" = yes-yes; then
551 lvm_saved_libs=$LIBS
552 LIBS="$LIBS -static"
553 AC_SEARCH_LIBS([pthread_mutex_lock], [pthread],
554 [test "$ac_cv_search_pthread_mutex_lock" = "none required" ||
555 LIB_PTHREAD=-lpthread])
556 LIBS=$lvm_saved_libs
557 fi
036f273a 558fi
d68a82ec 559
8b1a3214
AK
560################################################################################
561dnl -- Check for realtime clock support
562if test x$REALTIME = xyes; then
8b1a3214 563 AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no)
8b1a3214
AK
564
565 if test x$HAVE_REALTIME = xyes; then
566 AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.])
567 LIBS="-lrt $LIBS"
568 else
569 AC_MSG_WARN(Disabling realtime clock)
570 fi
571fi
572
80992638 573################################################################################
8ce0cbda 574dnl -- Check for getopt
d0191583 575AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.]))
b896caa1 576
80992638 577################################################################################
8ce0cbda 578dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
ea7cfb00 579if test x$READLINE != xno; then
0ad6b7e2
JM
580 rl_found=yes
581 AC_CHECK_LIB([readline], [readline], , [rl_found=no])
ea7cfb00
JM
582 test x$READLINE:$rl_found = xyes:no &&
583 AC_MSG_ERROR(
795ca3e5
AK
584GNU Readline could not be found which is required for the
585--enable-readline option (which is enabled by default). Either disable readline
586support with --disable-readline or download and install readline from:
587 ftp.gnu.org/gnu/readline
588Note: if you are using precompiled packages you will also need the development
589package as well (which may be called readline-devel or something similar).
590)
ea7cfb00 591 if test $rl_found = yes; then
0ad6b7e2 592 AC_CHECK_FUNCS([rl_completion_matches])
ea7cfb00
JM
593 AC_DEFINE([READLINE_SUPPORT], 1,
594 [Define to 1 to include the LVM readline shell.])
595 fi
795ca3e5
AK
596fi
597
80992638 598################################################################################
8ce0cbda 599dnl -- Internationalisation stuff
ad6254c5
AK
600AC_MSG_CHECKING(whether to enable internationalisation)
601AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support],
602 INTL=$enableval, INTL=no)
603AC_MSG_RESULT($INTL)
69792976
AK
604
605if test x$INTL = xyes; then
f6fc418d 606# FIXME - Move this - can be device-mapper too
69792976
AK
607 INTL_PACKAGE="lvm2"
608 AC_PATH_PROG(MSGFMT, msgfmt)
609 if [[ "x$MSGFMT" == x ]];
610 then AC_MSG_ERROR(
611 msgfmt not found in path $PATH
612 )
69792976
AK
613 fi;
614
615 AC_ARG_WITH(localedir,
d0191583
JM
616 [ --with-localedir=DIR Translation files in DIR [[PREFIX/share/locale]] ],
617 [ LOCALEDIR="$withval" ],
618 [ LOCALEDIR='${prefix}/share/locale' ])
69792976
AK
619fi
620
80992638 621################################################################################
4a7f3eb2 622AC_ARG_WITH(confdir,
0a62c911 623 [ --with-confdir=DIR Configuration files in DIR [/etc]],
d0191583
JM
624 [ CONFDIR="$withval" ],
625 [ CONFDIR='/etc' ])
0a62c911
AK
626
627AC_ARG_WITH(staticdir,
628 [ --with-staticdir=DIR Static binary in DIR [EXEC_PREFIX/sbin]],
d0191583
JM
629 [ STATICDIR="$withval" ],
630 [ STATICDIR='${exec_prefix}/sbin' ])
0a62c911 631
68f2de6d
AK
632AC_ARG_WITH(usrlibdir,
633 [ --with-usrlibdir=DIR],
634 [ usrlibdir="$withval"],
635 [ usrlibdir='${prefix}/lib' ])
636
637AC_ARG_WITH(usrsbindir,
638 [ --with-usrsbindir=DIR],
639 [ usrsbindir="$withval"],
640 [ usrsbindir='${prefix}/sbin' ])
641
ad6254c5
AK
642################################################################################
643dnl -- Ensure additional headers required
644if test x$READLINE = xyes; then
645 AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out))
646fi
647
5c7fc7c4 648if test x$CLVMD != xnone; then
ad6254c5
AK
649 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))
650 AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out))
651 AC_FUNC_GETMNTENT
652# AC_FUNC_REALLOC
653 AC_FUNC_SELECT_ARGTYPES
654fi
655
ad6254c5
AK
656if test x$CLUSTER != xnone; then
657 AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out))
658 AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out))
659fi
660
661if test x$HAVE_LIBDL = xyes; then
662 AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out))
663fi
664
665if test x$INTL = xyes; then
666 AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out))
667fi
668
ad6254c5
AK
669if test x$HAVE_SELINUX = xyes; then
670 AC_CHECK_HEADERS(selinux/selinux.h,,AC_MSG_ERROR(bailing out))
671fi
4a7f3eb2 672
a653923f
AK
673################################################################################
674AC_PATH_PROG(MODPROBE_CMD, modprobe)
675
676if test x$MODPROBE_CMD != x; then
72b2cb61 677 AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
a653923f
AK
678fi
679
80992638 680################################################################################
f6fc418d
AK
681dnl -- dmeventd pidfile and executable path
682AH_TEMPLATE(DMEVENTD_PIDFILE, [Path to dmeventd pidfile.])
683if test "$BUILD_DMEVENTD" = yes; then
684 AC_ARG_WITH(dmeventd-pidfile,
685 [ --with-dmeventd-pidfile=PATH dmeventd pidfile [[/var/run/dmeventd.pid]] ],
686 [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"$withval") ],
687 [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"/var/run/dmeventd.pid") ])
688fi
689
690AH_TEMPLATE(DMEVENTD_PATH, [Path to dmeventd binary.])
691if test "$BUILD_DMEVENTD" = yes; then
692 dmeventd_prefix="$exec_prefix"
693 if test "x$dmeventd_prefix" = "xNONE"; then
694 dmeventd_prefix="$prefix"
695 fi
696 if test "x$dmeventd_prefix" = "xNONE"; then
697 dmeventd_prefix=""
698 fi
699 AC_ARG_WITH(dmeventd-path,
700 [ --with-dmeventd-path=PATH dmeventd path [[${exec_prefix}/sbin/dmeventd]] ],
701 [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$withval") ],
702 [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$dmeventd_prefix/sbin/dmeventd") ])
703fi
704
705################################################################################
706dnl -- which kernel interface to use (ioctl only)
707AC_MSG_CHECKING(for kernel interface choice)
708AC_ARG_WITH(interface,
709 [ --with-interface=IFACE Choose kernel interface (ioctl) [[ioctl]] ],
710 [ interface="$withval" ],
711 [ interface=ioctl ])
712if [[ "x$interface" != xioctl ]];
713then
714 AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.)
715fi
716AC_MSG_RESULT($interface)
717
718################################################################################
2c44337b 719DM_LIB_VERSION="\"`cat VERSION_DM 2>/dev/null || echo Unknown`\""
f58b35b5
AK
720AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version])
721
2c44337b 722DM_LIB_PATCHLEVEL=`cat VERSION_DM | awk -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'`
597c3f8e 723
d0191583 724LVM_VERSION="\"`cat VERSION 2>/dev/null || echo Unknown`\""
fae0c576 725
80992638 726################################################################################
d0191583 727AC_SUBST(BUILD_DMEVENTD)
b896caa1 728AC_SUBST(CFLAGS)
d0191583 729AC_SUBST(CFLOW_CMD)
8106cdd5 730AC_SUBST(CLDFLAGS)
8106cdd5 731AC_SUBST(CLDNOWHOLEARCHIVE)
d0191583
JM
732AC_SUBST(CLDWHOLEARCHIVE)
733AC_SUBST(CLUSTER)
734AC_SUBST(CLVMD)
735AC_SUBST(CMDLIB)
736AC_SUBST(COPTIMISE_FLAG)
737AC_SUBST(CSCOPE_CMD)
8ef2b021 738AC_SUBST(DEBUG)
199e490e 739AC_SUBST(DEVMAPPER)
d0191583
JM
740AC_SUBST(DMEVENTD)
741AC_SUBST(DM_COMPAT)
742AC_SUBST(DM_DEVICE_GID)
743AC_SUBST(DM_DEVICE_MODE)
744AC_SUBST(DM_DEVICE_UID)
745AC_SUBST(DM_IOCTLS)
746AC_SUBST(DM_LIB_VERSION)
597c3f8e 747AC_SUBST(DM_LIB_PATCHLEVEL)
d0191583
JM
748AC_SUBST(FSADM)
749AC_SUBST(GROUP)
26e7f2e0 750AC_SUBST(HAVE_LIBDL)
8b1a3214 751AC_SUBST(HAVE_REALTIME)
d0191583
JM
752AC_SUBST(HAVE_SELINUX)
753AC_SUBST(INTL)
754AC_SUBST(INTL_PACKAGE)
755AC_SUBST(JOBS)
756AC_SUBST(LDDEPS)
757AC_SUBST(LIBS)
758AC_SUBST(LIB_SUFFIX)
69792976 759AC_SUBST(LOCALEDIR)
d0191583
JM
760AC_SUBST(LVM1)
761AC_SUBST(LVM1_FALLBACK)
4a7f3eb2 762AC_SUBST(CONFDIR)
d0191583
JM
763AC_SUBST(LVM_VERSION)
764AC_SUBST(MIRRORS)
765AC_SUBST(MSGFMT)
766AC_SUBST(OWNER)
767AC_SUBST(PKGCONFIG)
768AC_SUBST(POOL)
769AC_SUBST(SNAPSHOTS)
0a62c911 770AC_SUBST(STATICDIR)
d0191583 771AC_SUBST(STATIC_LINK)
66e941e8 772AC_SUBST([LIB_PTHREAD])
f6fc418d
AK
773AC_SUBST(interface)
774AC_SUBST(kerneldir)
775AC_SUBST(missingkernel)
776AC_SUBST(kernelvsn)
777AC_SUBST(tmpdir)
68f2de6d
AK
778AC_SUBST(usrlibdir)
779AC_SUBST(usrsbindir)
8106cdd5 780
80992638 781################################################################################
d3a356b4 782dnl -- First and last lines should not contain files to generate in order to
8ce0cbda 783dnl -- keep utility scripts running properly
d3a356b4
JM
784AC_CONFIG_FILES([
785Makefile
786make.tmpl
787daemons/Makefile
788daemons/clvmd/Makefile
f6fc418d
AK
789daemons/dmeventd/Makefile
790daemons/dmeventd/libdevmapper-event.pc
b7edb5bf 791daemons/dmeventd/plugins/Makefile
f6fc418d
AK
792daemons/dmeventd/plugins/mirror/Makefile
793daemons/dmeventd/plugins/snapshot/Makefile
d3a356b4 794doc/Makefile
f6fc418d
AK
795include/Makefile
796lib/Makefile
d3a356b4
JM
797lib/format1/Makefile
798lib/format_pool/Makefile
799lib/locking/Makefile
800lib/mirror/Makefile
801lib/snapshot/Makefile
f6fc418d
AK
802libdm/Makefile
803libdm/libdevmapper.pc
804man/Makefile
805po/Makefile
d3a356b4 806scripts/Makefile
f6fc418d 807test/Makefile
d3a356b4
JM
808tools/Makefile
809tools/version.h
7a197a62
AK
810])
811AC_OUTPUT
2dc95e1c
AK
812
813if test x$ODIRECT != xyes; then
ad6254c5 814 AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up)
2dc95e1c 815fi
This page took 0.153101 seconds and 5 git commands to generate.