]> sourceware.org Git - lvm2.git/blob - configure.in
Fix problems with static build
[lvm2.git] / configure.in
1 ###############################################################################
2 ## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved.
3 ## Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
4 ##
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.
8 ##
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
12 ################################################################################
13
14 AC_PREREQ(2.57)
15 ################################################################################
16 dnl -- Process this file with autoconf to produce a configure script.
17 AC_INIT
18 AC_CONFIG_SRCDIR([lib/device/dev-cache.h])
19 AC_CONFIG_HEADERS([lib/misc/configure.h])
20
21 ################################################################################
22 dnl -- Setup the directory where autoconf has auxilary files
23 AC_CONFIG_AUX_DIR(autoconf)
24
25 ################################################################################
26 dnl -- Get system type
27 AC_CANONICAL_TARGET([])
28
29 case "$host_os" in
30 linux*)
31 COPTIMISE_FLAG="-O2"
32 CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
33 CLDWHOLEARCHIVE="-Wl,-whole-archive"
34 CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
35 LDDEPS="$LDDEPS .export.sym"
36 LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
37 LIB_SUFFIX=so
38 DEVMAPPER=yes
39 ODIRECT=yes
40 DM_IOCTLS=yes
41 SELINUX=yes
42 REALTIME=yes
43 CLUSTER=internal
44 FSADM=yes
45 ;;
46 darwin*)
47 CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
48 COPTIMISE_FLAG="-O2"
49 CLDFLAGS="$CLDFLAGS"
50 CLDWHOLEARCHIVE="-all_load"
51 CLDNOWHOLEARCHIVE=
52 LIB_SUFFIX=dylib
53 DEVMAPPER=yes
54 ODIRECT=no
55 DM_IOCTLS=no
56 SELINUX=no
57 REALTIME=no
58 CLUSTER=none
59 FSADM=no
60 ;;
61 esac
62
63 ################################################################################
64 dnl -- Checks for programs.
65 AC_PROG_SED
66 AC_PROG_AWK
67 AC_PROG_CC
68
69 dnl probably no longer needed in 2008, but...
70 AC_PROG_GCC_TRADITIONAL
71 AC_PROG_INSTALL
72 AC_PROG_LN_S
73 AC_PROG_MAKE_SET
74 AC_PROG_MKDIR_P
75 AC_PROG_RANLIB
76 AC_PATH_PROG(CFLOW_CMD, cflow)
77 AC_PATH_PROG(CSCOPE_CMD, cscope)
78
79 ################################################################################
80 dnl -- Check for header files.
81 AC_HEADER_DIRENT
82 AC_HEADER_STDC
83 AC_HEADER_SYS_WAIT
84 AC_HEADER_TIME
85
86 AC_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)])
89
90 case "$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)) ;;
95 esac
96
97 AC_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)])
100 AC_CHECK_HEADERS(termios.h sys/statvfs.h)
101
102 ################################################################################
103 dnl -- Check for typedefs, structures, and compiler characteristics.
104 AC_C_CONST
105 AC_C_INLINE
106 AC_CHECK_MEMBERS([struct stat.st_rdev])
107 AC_TYPE_OFF_T
108 AC_TYPE_PID_T
109 AC_TYPE_SIGNAL
110 AC_TYPE_SIZE_T
111 AC_TYPE_MODE_T
112 AC_CHECK_MEMBERS([struct stat.st_rdev])
113 AC_STRUCT_TM
114
115 ################################################################################
116 dnl -- Check for functions
117 AC_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)])
120 AC_FUNC_ALLOCA
121 AC_FUNC_CLOSEDIR_VOID
122 AC_FUNC_FORK
123 AC_FUNC_LSTAT
124 AC_FUNC_MALLOC
125 AC_FUNC_MEMCMP
126 AC_FUNC_MMAP
127 AC_FUNC_STAT
128 AC_FUNC_STRTOD
129 AC_FUNC_VPRINTF
130
131 ################################################################################
132 dnl -- Enables statically-linked tools
133 AC_MSG_CHECKING(whether to use static linking)
134 AC_ARG_ENABLE(static_link,
135 [ --enable-static_link Use this to link the tools to their libraries
136 statically. Default is dynamic linking],
137 STATIC_LINK=$enableval, STATIC_LINK=no)
138 AC_MSG_RESULT($STATIC_LINK)
139
140 ################################################################################
141 dnl -- Prefix is /usr by default, the exec_prefix default is setup later
142 AC_PREFIX_DEFAULT(/usr)
143
144 ################################################################################
145 dnl -- Setup the ownership of the files
146 AC_MSG_CHECKING(file owner)
147 OWNER="root"
148
149 AC_ARG_WITH(user,
150 [ --with-user=USER Set the owner of installed files [[USER=root]] ],
151 [ OWNER="$withval" ])
152 AC_MSG_RESULT($OWNER)
153
154 if test x$OWNER != x; then
155 OWNER="-o $OWNER"
156 fi
157
158 ################################################################################
159 dnl -- Setup the group ownership of the files
160 AC_MSG_CHECKING(group owner)
161 GROUP="root"
162 AC_ARG_WITH(group,
163 [ --with-group=GROUP Set the group owner of installed files [[GROUP=root]] ],
164 [ GROUP="$withval" ])
165 AC_MSG_RESULT($GROUP)
166
167 if test x$GROUP != x; then
168 GROUP="-g $GROUP"
169 fi
170
171 ################################################################################
172 dnl -- Setup device node ownership
173 AC_MSG_CHECKING(device node uid)
174
175 AC_ARG_WITH(device-uid,
176 [ --with-device-uid=UID Set the owner used for new device nodes [[UID=0]] ],
177 [ DM_DEVICE_UID="$withval" ], [ DM_DEVICE_UID="0" ] )
178 AC_MSG_RESULT($DM_DEVICE_UID)
179
180 ################################################################################
181 dnl -- Setup device group ownership
182 AC_MSG_CHECKING(device node gid)
183
184 AC_ARG_WITH(device-gid,
185 [ --with-device-gid=UID Set the group used for new device nodes [[GID=0]] ],
186 [ DM_DEVICE_GID="$withval" ], [ DM_DEVICE_GID="0" ] )
187 AC_MSG_RESULT($DM_DEVICE_GID)
188
189 ################################################################################
190 dnl -- Setup device mode
191 AC_MSG_CHECKING(device node mode)
192
193 AC_ARG_WITH(device-mode,
194 [ --with-device-mode=MODE Set the mode used for new device nodes [[MODE=0600]] ],
195 [ DM_DEVICE_MODE="$withval" ], [ DM_DEVICE_MODE="0600" ] )
196 AC_MSG_RESULT($DM_DEVICE_MODE)
197
198 ################################################################################
199 dnl -- LVM1 tool fallback option
200 AC_MSG_CHECKING(whether to enable lvm1 fallback)
201 AC_ARG_ENABLE(lvm1_fallback, [ --enable-lvm1_fallback Use this to fall back and use LVM1 binaries if
202 device-mapper is missing from the kernel], LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
203 AC_MSG_RESULT($LVM1_FALLBACK)
204
205 if test x$LVM1_FALLBACK = xyes; then
206 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])
207 fi
208
209 ################################################################################
210 dnl -- format1 inclusion type
211 AC_MSG_CHECKING(whether to include support for lvm1 metadata)
212 AC_ARG_WITH(lvm1,
213 [ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none
214 [TYPE=internal] ],
215 [ LVM1="$withval" ],
216 [ LVM1="internal" ])
217 AC_MSG_RESULT($LVM1)
218
219 if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
220 then AC_MSG_ERROR(
221 --with-lvm1 parameter invalid
222 )
223 fi;
224
225 if test x$LVM1 = xinternal; then
226 AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.])
227 fi
228
229 ################################################################################
230 dnl -- format_pool inclusion type
231 AC_MSG_CHECKING(whether to include support for GFS pool metadata)
232 AC_ARG_WITH(pool,
233 [ --with-pool=TYPE GFS pool read-only support: internal/shared/none
234 [TYPE=internal] ],
235 [ POOL="$withval" ],
236 [ POOL="internal" ])
237 AC_MSG_RESULT($POOL)
238
239 if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]];
240 then AC_MSG_ERROR(
241 --with-pool parameter invalid
242 )
243 fi;
244
245 if test x$POOL = xinternal; then
246 AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.])
247 fi
248
249 ################################################################################
250 dnl -- cluster_locking inclusion type
251 AC_MSG_CHECKING(whether to include support for cluster locking)
252 AC_ARG_WITH(cluster,
253 [ --with-cluster=TYPE Cluster LVM locking support: internal/shared/none
254 [TYPE=internal] ],
255 [ CLUSTER="$withval" ])
256 AC_MSG_RESULT($CLUSTER)
257
258 if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]];
259 then AC_MSG_ERROR(
260 --with-cluster parameter invalid
261 )
262 fi;
263
264 if test x$CLUSTER = xinternal; then
265 AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.])
266 fi
267
268 ################################################################################
269 dnl -- snapshots inclusion type
270 AC_MSG_CHECKING(whether to include snapshots)
271 AC_ARG_WITH(snapshots,
272 [ --with-snapshots=TYPE Snapshot support: internal/shared/none
273 [TYPE=internal] ],
274 [ SNAPSHOTS="$withval" ],
275 [ SNAPSHOTS="internal" ])
276 AC_MSG_RESULT($SNAPSHOTS)
277
278 if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]];
279 then AC_MSG_ERROR(
280 --with-snapshots parameter invalid
281 )
282 fi;
283
284 if test x$SNAPSHOTS = xinternal; then
285 AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.])
286 fi
287
288 ################################################################################
289 dnl -- mirrors inclusion type
290 AC_MSG_CHECKING(whether to include mirrors)
291 AC_ARG_WITH(mirrors,
292 [ --with-mirrors=TYPE Mirror support: internal/shared/none
293 [TYPE=internal] ],
294 [ MIRRORS="$withval" ],
295 [ MIRRORS="internal" ])
296 AC_MSG_RESULT($MIRRORS)
297
298 if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]];
299 then AC_MSG_ERROR(
300 --with-mirrors parameter invalid
301 )
302 fi;
303
304 if test x$MIRRORS = xinternal; then
305 AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])
306 fi
307
308 ################################################################################
309 dnl -- Disable readline
310 AC_MSG_CHECKING(whether to enable readline)
311 AC_ARG_ENABLE([readline],
312 [ --disable-readline Disable readline support],
313 [READLINE=$enableval], [READLINE=maybe])
314 AC_MSG_RESULT($READLINE)
315
316 ################################################################################
317 dnl -- Disable realtime clock support
318 AC_MSG_CHECKING(whether to enable realtime support)
319 AC_ARG_ENABLE(realtime, [ --disable-realtime Disable realtime clock support],
320 REALTIME=$enableval)
321 AC_MSG_RESULT($REALTIME)
322
323 ################################################################################
324 dnl -- Build cluster LVM daemon
325 AC_MSG_CHECKING(whether to build cluster LVM daemon)
326 AC_ARG_WITH(clvmd,
327 [ --with-clvmd=TYPE Build cluster LVM Daemon: cman/gulm/none/all
328 [TYPE=none] ],
329 [ CLVMD="$withval" ],
330 [ CLVMD="none" ])
331 if test x$CLVMD = xyes; then
332 CLVMD=all
333 fi
334 AC_MSG_RESULT($CLVMD)
335
336 dnl -- If clvmd enabled without cluster locking, automagically include it
337 if test x$CLVMD != xnone && test x$CLUSTER = xnone; then
338 CLUSTER=internal
339 fi
340
341 ################################################################################
342 dnl -- Enable debugging
343 AC_MSG_CHECKING(whether to enable debugging)
344 AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging],
345 DEBUG=$enableval, DEBUG=no)
346 AC_MSG_RESULT($DEBUG)
347
348 dnl -- Normally turn off optimisation for debug builds
349 if test x$DEBUG = xyes; then
350 COPTIMISE_FLAG=
351 else
352 CSCOPE_CMD=
353 fi
354
355 ################################################################################
356 dnl -- Override optimisation
357 AC_MSG_CHECKING(for C optimisation flag)
358 AC_ARG_WITH(optimisation,
359 [ --with-optimisation=OPT C optimisation flag [[OPT=-O2]] ],
360 [ COPTIMISE_FLAG="$withval" ])
361 AC_MSG_RESULT($COPTIMISE_FLAG)
362
363 ################################################################################
364 dnl -- Enable profiling
365 AC_MSG_CHECKING(whether to gather gcov profiling data)
366 AC_ARG_ENABLE(profiling,
367 AC_HELP_STRING(--enable-profiling, [Gather gcov profiling data]),
368 PROFILING=$enableval, PROFILING=no)
369 AC_MSG_RESULT($PROFILING)
370
371 if test "x$PROFILING" = xyes; then
372 COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage"
373 AC_PATH_PROG(LCOV, lcov, no)
374 AC_PATH_PROG(GENHTML, genhtml, no)
375 if test "$LCOV" = no -o "$GENHTML" = no ; then
376 AC_MSG_ERROR([lcov and genhtml are required for profiling])
377 fi
378 fi
379
380 ################################################################################
381 dnl -- Disable devmapper
382 AC_MSG_CHECKING(whether to use device-mapper)
383 AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable LVM2 device-mapper interaction],
384 DEVMAPPER=$enableval)
385 AC_MSG_RESULT($DEVMAPPER)
386
387 if test x$DEVMAPPER = xyes; then
388 AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
389 fi
390
391 ################################################################################
392 dnl -- Compatibility mode
393 AC_ARG_ENABLE(compat, [ --enable-compat Enable support for old device-mapper versions],
394 DM_COMPAT=$enableval, DM_COMPAT=no)
395
396 ################################################################################
397 dnl -- Disable ioctl
398 AC_ARG_ENABLE(ioctl, [ --disable-driver Disable calls to device-mapper in the kernel],
399 DM_IOCTLS=$enableval)
400
401 ################################################################################
402 dnl -- Disable O_DIRECT
403 AC_MSG_CHECKING(whether to enable O_DIRECT)
404 AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT],
405 ODIRECT=$enableval)
406 AC_MSG_RESULT($ODIRECT)
407
408 if test x$ODIRECT = xyes; then
409 AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.])
410 fi
411
412 ################################################################################
413 dnl -- Enable cmdlib
414 AC_MSG_CHECKING(whether to compile liblvm2cmd.so)
415 AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library],
416 CMDLIB=$enableval, CMDLIB=no)
417 AC_MSG_RESULT($CMDLIB)
418 AC_SUBST([LVM2CMD_LIB])
419 test x$CMDLIB = xyes \
420 && LVM2CMD_LIB=-llvm2cmd \
421 || LVM2CMD_LIB=
422
423 ################################################################################
424 dnl -- Enable pkg-config
425 AC_ARG_ENABLE(pkgconfig, [ --enable-pkgconfig Install pkgconfig support],
426 PKGCONFIG=$enableval, PKGCONFIG=no)
427
428 ################################################################################
429 dnl -- Enable fsadm
430 AC_MSG_CHECKING(whether to install fsadm)
431 AC_ARG_ENABLE(fsadm, [ --enable-fsadm Enable fsadm],
432 FSADM=$enableval)
433 AC_MSG_RESULT($FSADM)
434
435 ################################################################################
436 dnl -- enable dmeventd handling
437 AC_MSG_CHECKING(whether to use dmeventd)
438 AC_ARG_ENABLE(dmeventd, [ --enable-dmeventd Enable the device-mapper event daemon],
439 DMEVENTD=$enableval)
440 AC_MSG_RESULT($DMEVENTD)
441
442 BUILD_DMEVENTD=$DMEVENTD
443
444 dnl -- dmeventd currently requires internal mirror support
445 if test x$DMEVENTD = xyes; then
446 if test x$MIRRORS != xinternal; then
447 AC_MSG_ERROR(
448 --enable-dmeventd currently requires --with-mirrors=internal
449 )
450 fi
451 if test x$CMDLIB = xno; then
452 AC_MSG_ERROR(
453 --enable-dmeventd requires --enable-cmdlib to be used as well
454 )
455 fi
456 fi
457
458 if test x$DMEVENTD = xyes; then
459 AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])
460 fi
461
462 ################################################################################
463 dnl -- getline included in recent libc
464
465 AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1,
466 [Define to 1 if getline is available.]))
467
468 ################################################################################
469 dnl -- canonicalize_file_name included in recent libc
470
471 AC_CHECK_LIB(c, canonicalize_file_name,
472 AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1,
473 [Define to 1 if canonicalize_file_name is available.]))
474
475 ################################################################################
476 dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
477 if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
478 then exec_prefix="";
479 fi;
480
481 ################################################################################
482 dnl -- Check for termcap (Shamelessly copied from parted 1.4.17)
483 if test x$READLINE != xno; then
484 AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib],
485 [tg_found=yes], [tg_found=no])
486 test x$READLINE:$tg_found = xyes:no &&
487 AC_MSG_ERROR(
488 termcap could not be found which is required for the
489 --enable-readline option (which is enabled by default). Either disable readline
490 support with --disable-readline or download and install termcap from:
491 ftp.gnu.org/gnu/termcap
492 Note: if you are using precompiled packages you will also need the development
493 package as well (which may be called termcap-devel or something similar).
494 Note: (n)curses also seems to work as a substitute for termcap. This was
495 not found either - but you could try installing that as well.
496 )
497 fi
498
499 ################################################################################
500 dnl -- Check for dlopen
501 AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no)
502
503 if [[ "x$HAVE_LIBDL" = xyes ]]; then
504 AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
505 LIBS="-ldl $LIBS"
506 else
507 HAVE_LIBDL=no
508 fi
509
510 ################################################################################
511 dnl -- Check for shared/static conflicts
512 if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \
513 -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
514 \) -a "x$STATIC_LINK" = xyes ]];
515 then AC_MSG_ERROR(
516 Features cannot be 'shared' when building statically
517 )
518 fi
519
520 ################################################################################
521 dnl -- Disable selinux
522 AC_MSG_CHECKING(whether to enable selinux support)
523 AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support],
524 SELINUX=$enableval)
525 AC_MSG_RESULT($SELINUX)
526
527 ################################################################################
528 dnl -- Check for selinux
529 if test x$SELINUX = xyes; then
530 AC_CHECK_LIB(sepol, sepol_check_context, HAVE_SEPOL=yes, HAVE_SEPOL=no)
531
532 if test x$HAVE_SEPOL = xyes; then
533 AC_DEFINE([HAVE_SEPOL], 1,
534 [Define to 1 if sepol_check_context is available.])
535 LIBS="-lsepol $LIBS"
536 fi
537
538 AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no)
539
540 if test x$HAVE_SELINUX = xyes; then
541 AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
542 LIBS="-lselinux $LIBS"
543 else
544 AC_MSG_WARN(Disabling selinux)
545 fi
546
547 # With --enable-static_link and selinux enabled, linking
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
558 fi
559
560 ################################################################################
561 dnl -- Check for realtime clock support
562 if test x$REALTIME = xyes; then
563 AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no)
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
571 fi
572
573 ################################################################################
574 dnl -- Check for getopt
575 AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.]))
576
577 ################################################################################
578 dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
579 if test x$READLINE != xno; then
580 rl_found=yes
581 AC_CHECK_LIB([readline], [readline], , [rl_found=no])
582 test x$READLINE:$rl_found = xyes:no &&
583 AC_MSG_ERROR(
584 GNU Readline could not be found which is required for the
585 --enable-readline option (which is enabled by default). Either disable readline
586 support with --disable-readline or download and install readline from:
587 ftp.gnu.org/gnu/readline
588 Note: if you are using precompiled packages you will also need the development
589 package as well (which may be called readline-devel or something similar).
590 )
591 if test $rl_found = yes; then
592 AC_CHECK_FUNCS([rl_completion_matches])
593 AC_DEFINE([READLINE_SUPPORT], 1,
594 [Define to 1 to include the LVM readline shell.])
595 fi
596 fi
597
598 ################################################################################
599 dnl -- Internationalisation stuff
600 AC_MSG_CHECKING(whether to enable internationalisation)
601 AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support],
602 INTL=$enableval, INTL=no)
603 AC_MSG_RESULT($INTL)
604
605 if test x$INTL = xyes; then
606 # FIXME - Move this - can be device-mapper too
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 )
613 fi;
614
615 AC_ARG_WITH(localedir,
616 [ --with-localedir=DIR Translation files in DIR [[PREFIX/share/locale]] ],
617 [ LOCALEDIR="$withval" ],
618 [ LOCALEDIR='${prefix}/share/locale' ])
619 fi
620
621 ################################################################################
622 AC_ARG_WITH(confdir,
623 [ --with-confdir=DIR Configuration files in DIR [/etc]],
624 [ CONFDIR="$withval" ],
625 [ CONFDIR='/etc' ])
626
627 AC_ARG_WITH(staticdir,
628 [ --with-staticdir=DIR Static binary in DIR [EXEC_PREFIX/sbin]],
629 [ STATICDIR="$withval" ],
630 [ STATICDIR='${exec_prefix}/sbin' ])
631
632 AC_ARG_WITH(usrlibdir,
633 [ --with-usrlibdir=DIR],
634 [ usrlibdir="$withval"],
635 [ usrlibdir='${prefix}/lib' ])
636
637 AC_ARG_WITH(usrsbindir,
638 [ --with-usrsbindir=DIR],
639 [ usrsbindir="$withval"],
640 [ usrsbindir='${prefix}/sbin' ])
641
642 ################################################################################
643 dnl -- Ensure additional headers required
644 if test x$READLINE = xyes; then
645 AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out))
646 fi
647
648 if test x$CLVMD != xnone; then
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
654 fi
655
656 if 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))
659 fi
660
661 if test x$HAVE_LIBDL = xyes; then
662 AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out))
663 fi
664
665 if test x$INTL = xyes; then
666 AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out))
667 fi
668
669 if test x$HAVE_SELINUX = xyes; then
670 AC_CHECK_HEADERS(selinux/selinux.h,,AC_MSG_ERROR(bailing out))
671 fi
672
673 ################################################################################
674 AC_PATH_PROG(MODPROBE_CMD, modprobe)
675
676 if test x$MODPROBE_CMD != x; then
677 AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
678 fi
679
680 ################################################################################
681 dnl -- dmeventd pidfile and executable path
682 AH_TEMPLATE(DMEVENTD_PIDFILE, [Path to dmeventd pidfile.])
683 if 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") ])
688 fi
689
690 AH_TEMPLATE(DMEVENTD_PATH, [Path to dmeventd binary.])
691 if 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") ])
703 fi
704
705 ################################################################################
706 dnl -- which kernel interface to use (ioctl only)
707 AC_MSG_CHECKING(for kernel interface choice)
708 AC_ARG_WITH(interface,
709 [ --with-interface=IFACE Choose kernel interface (ioctl) [[ioctl]] ],
710 [ interface="$withval" ],
711 [ interface=ioctl ])
712 if [[ "x$interface" != xioctl ]];
713 then
714 AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.)
715 fi
716 AC_MSG_RESULT($interface)
717
718 ################################################################################
719 DM_LIB_VERSION="\"`cat VERSION_DM 2>/dev/null || echo Unknown`\""
720 AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version])
721
722 DM_LIB_PATCHLEVEL=`cat VERSION_DM | awk -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'`
723
724 LVM_VERSION="\"`cat VERSION 2>/dev/null || echo Unknown`\""
725
726 ################################################################################
727 AC_SUBST(BUILD_DMEVENTD)
728 AC_SUBST(CFLAGS)
729 AC_SUBST(CFLOW_CMD)
730 AC_SUBST(CLDFLAGS)
731 AC_SUBST(CLDNOWHOLEARCHIVE)
732 AC_SUBST(CLDWHOLEARCHIVE)
733 AC_SUBST(CLUSTER)
734 AC_SUBST(CLVMD)
735 AC_SUBST(CMDLIB)
736 AC_SUBST(COPTIMISE_FLAG)
737 AC_SUBST(CSCOPE_CMD)
738 AC_SUBST(DEBUG)
739 AC_SUBST(DEVMAPPER)
740 AC_SUBST(DMEVENTD)
741 AC_SUBST(DM_COMPAT)
742 AC_SUBST(DM_DEVICE_GID)
743 AC_SUBST(DM_DEVICE_MODE)
744 AC_SUBST(DM_DEVICE_UID)
745 AC_SUBST(DM_IOCTLS)
746 AC_SUBST(DM_LIB_VERSION)
747 AC_SUBST(DM_LIB_PATCHLEVEL)
748 AC_SUBST(FSADM)
749 AC_SUBST(GROUP)
750 AC_SUBST(HAVE_LIBDL)
751 AC_SUBST(HAVE_REALTIME)
752 AC_SUBST(HAVE_SELINUX)
753 AC_SUBST(INTL)
754 AC_SUBST(INTL_PACKAGE)
755 AC_SUBST(JOBS)
756 AC_SUBST(LDDEPS)
757 AC_SUBST(LIBS)
758 AC_SUBST(LIB_SUFFIX)
759 AC_SUBST(LOCALEDIR)
760 AC_SUBST(LVM1)
761 AC_SUBST(LVM1_FALLBACK)
762 AC_SUBST(CONFDIR)
763 AC_SUBST(LVM_VERSION)
764 AC_SUBST(MIRRORS)
765 AC_SUBST(MSGFMT)
766 AC_SUBST(OWNER)
767 AC_SUBST(PKGCONFIG)
768 AC_SUBST(POOL)
769 AC_SUBST(SNAPSHOTS)
770 AC_SUBST(STATICDIR)
771 AC_SUBST(STATIC_LINK)
772 AC_SUBST([LIB_PTHREAD])
773 AC_SUBST(interface)
774 AC_SUBST(kerneldir)
775 AC_SUBST(missingkernel)
776 AC_SUBST(kernelvsn)
777 AC_SUBST(tmpdir)
778 AC_SUBST(usrlibdir)
779 AC_SUBST(usrsbindir)
780
781 ################################################################################
782 dnl -- First and last lines should not contain files to generate in order to
783 dnl -- keep utility scripts running properly
784 AC_CONFIG_FILES([
785 Makefile
786 make.tmpl
787 daemons/Makefile
788 daemons/clvmd/Makefile
789 daemons/dmeventd/Makefile
790 daemons/dmeventd/libdevmapper-event.pc
791 daemons/dmeventd/plugins/Makefile
792 daemons/dmeventd/plugins/mirror/Makefile
793 daemons/dmeventd/plugins/snapshot/Makefile
794 doc/Makefile
795 include/Makefile
796 lib/Makefile
797 lib/format1/Makefile
798 lib/format_pool/Makefile
799 lib/locking/Makefile
800 lib/mirror/Makefile
801 lib/snapshot/Makefile
802 libdm/Makefile
803 libdm/libdevmapper.pc
804 man/Makefile
805 po/Makefile
806 scripts/clvmd_init_red_hat
807 scripts/Makefile
808 test/Makefile
809 test/api/Makefile
810 tools/Makefile
811 tools/version.h
812 ])
813 AC_OUTPUT
814
815 if test x$ODIRECT != xyes; then
816 AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up)
817 fi
This page took 0.072642 seconds and 6 git commands to generate.