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