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