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