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