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