]>
Commit | Line | Data |
---|---|---|
d0191583 | 1 | ############################################################################### |
ad6254c5 | 2 | ## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved. |
ec6a6fbe | 3 | ## Copyright (C) 2004-2009 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 | ||
e24fb506 | 14 | AC_PREREQ(2.61) |
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*) | |
7f54ef36 | 31 | CFLAGS="$CFLAGS" |
8ce0cbda | 32 | COPTIMISE_FLAG="-O2" |
80992638 | 33 | CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym" |
8106cdd5 AK |
34 | CLDWHOLEARCHIVE="-Wl,-whole-archive" |
35 | CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive" | |
80992638 AK |
36 | LDDEPS="$LDDEPS .export.sym" |
37 | LDFLAGS="$LDFLAGS -Wl,--export-dynamic" | |
d0191583 | 38 | LIB_SUFFIX=so |
8106cdd5 | 39 | DEVMAPPER=yes |
1a9ea74d | 40 | ODIRECT=yes |
d0191583 | 41 | DM_IOCTLS=yes |
80992638 | 42 | SELINUX=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 |
d3c8211f | 57 | CLUSTER=none |
d0191583 JM |
58 | FSADM=no |
59 | ;; | |
b896caa1 AK |
60 | esac |
61 | ||
80992638 | 62 | ################################################################################ |
8ce0cbda | 63 | dnl -- Checks for programs. |
162aefe8 | 64 | AC_PROG_SED |
8ce0cbda AK |
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 | |
162aefe8 | 73 | AC_PROG_MKDIR_P |
5556819a | 74 | AC_PROG_RANLIB |
8a2fc586 AK |
75 | AC_PATH_PROG(CFLOW_CMD, cflow) |
76 | AC_PATH_PROG(CSCOPE_CMD, cscope) | |
8ce0cbda AK |
77 | |
78 | ################################################################################ | |
d0191583 | 79 | dnl -- Check for header files. |
80992638 AK |
80 | AC_HEADER_DIRENT |
81 | AC_HEADER_STDC | |
ad6254c5 AK |
82 | AC_HEADER_SYS_WAIT |
83 | AC_HEADER_TIME | |
84 | ||
d0191583 JM |
85 | AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \ |
86 | libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h sys/wait.h time.h], , | |
87 | [AC_MSG_ERROR(bailing out)]) | |
ad6254c5 AK |
88 | |
89 | case "$host_os" in | |
90 | linux*) | |
91 | AC_CHECK_HEADERS(asm/byteorder.h linux/fs.h malloc.h,,AC_MSG_ERROR(bailing out)) ;; | |
92 | darwin*) | |
93 | AC_CHECK_HEADERS(machine/endian.h sys/disk.h,,AC_MSG_ERROR(bailing out)) ;; | |
94 | esac | |
80992638 | 95 | |
d0191583 JM |
96 | AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \ |
97 | stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \ | |
98 | sys/types.h unistd.h], , [AC_MSG_ERROR(bailing out)]) | |
99 | AC_CHECK_HEADERS(termios.h sys/statvfs.h) | |
100 | ||
80992638 | 101 | ################################################################################ |
d0191583 | 102 | dnl -- Check for typedefs, structures, and compiler characteristics. |
80992638 AK |
103 | AC_C_CONST |
104 | AC_C_INLINE | |
d0191583 | 105 | AC_CHECK_MEMBERS([struct stat.st_rdev]) |
80992638 AK |
106 | AC_TYPE_OFF_T |
107 | AC_TYPE_PID_T | |
d0191583 | 108 | AC_TYPE_SIGNAL |
80992638 | 109 | AC_TYPE_SIZE_T |
ad6254c5 | 110 | AC_TYPE_MODE_T |
7a197a62 | 111 | AC_CHECK_MEMBERS([struct stat.st_rdev]) |
ad6254c5 AK |
112 | AC_STRUCT_TM |
113 | ||
114 | ################################################################################ | |
115 | dnl -- Check for functions | |
d0191583 JM |
116 | AC_CHECK_FUNCS([gethostname getpagesize memset mkdir rmdir munmap setlocale \ |
117 | strcasecmp strchr strdup strncasecmp strerror strrchr strstr strtol strtoul \ | |
118 | uname], , [AC_MSG_ERROR(bailing out)]) | |
a0f9708e | 119 | AC_CHECK_FUNCS(siginterrupt) |
ad6254c5 AK |
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 | |
d0191583 | 129 | AC_FUNC_VPRINTF |
80992638 | 130 | |
9c961554 MB |
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 | ||
80992638 | 140 | ################################################################################ |
8ce0cbda | 141 | dnl -- Prefix is /usr by default, the exec_prefix default is setup later |
795ca3e5 AK |
142 | AC_PREFIX_DEFAULT(/usr) |
143 | ||
80992638 | 144 | ################################################################################ |
8ce0cbda | 145 | dnl -- Setup the ownership of the files |
ad6254c5 | 146 | AC_MSG_CHECKING(file owner) |
39dabc84 | 147 | OWNER="" |
80992638 | 148 | |
795ca3e5 | 149 | AC_ARG_WITH(user, |
39dabc84 | 150 | [ --with-user=USER Set the owner of installed files [[USER=]] ], |
a38df97f | 151 | [ OWNER="$withval" ]) |
ad6254c5 | 152 | AC_MSG_RESULT($OWNER) |
a38df97f AK |
153 | |
154 | if test x$OWNER != x; then | |
155 | OWNER="-o $OWNER" | |
156 | fi | |
795ca3e5 | 157 | |
80992638 | 158 | ################################################################################ |
8ce0cbda | 159 | dnl -- Setup the group ownership of the files |
ad6254c5 | 160 | AC_MSG_CHECKING(group owner) |
39dabc84 | 161 | GROUP="" |
795ca3e5 | 162 | AC_ARG_WITH(group, |
39dabc84 | 163 | [ --with-group=GROUP Set the group owner of installed files [[GROUP=]] ], |
a38df97f | 164 | [ GROUP="$withval" ]) |
ad6254c5 | 165 | AC_MSG_RESULT($GROUP) |
a38df97f AK |
166 | |
167 | if test x$GROUP != x; then | |
168 | GROUP="-g $GROUP" | |
169 | fi | |
795ca3e5 | 170 | |
0782ad50 AK |
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 | ||
f6fc418d AK |
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 | ||
80992638 | 198 | ################################################################################ |
7d1552c9 | 199 | dnl -- LVM1 tool fallback option |
ad6254c5 | 200 | AC_MSG_CHECKING(whether to enable lvm1 fallback) |
7d1552c9 AK |
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) | |
ad6254c5 | 203 | AC_MSG_RESULT($LVM1_FALLBACK) |
7d1552c9 AK |
204 | |
205 | if test x$LVM1_FALLBACK = xyes; then | |
72b2cb61 | 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]) |
7d1552c9 AK |
207 | fi |
208 | ||
80992638 | 209 | ################################################################################ |
5a52dca9 | 210 | dnl -- format1 inclusion type |
ad6254c5 | 211 | AC_MSG_CHECKING(whether to include support for lvm1 metadata) |
5a52dca9 AK |
212 | AC_ARG_WITH(lvm1, |
213 | [ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none | |
214 | [TYPE=internal] ], | |
215 | [ LVM1="$withval" ], | |
216 | [ LVM1="internal" ]) | |
ad6254c5 | 217 | AC_MSG_RESULT($LVM1) |
5a52dca9 AK |
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 | ) | |
5a52dca9 AK |
223 | fi; |
224 | ||
b896caa1 | 225 | if test x$LVM1 = xinternal; then |
72b2cb61 | 226 | AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.]) |
b896caa1 AK |
227 | fi |
228 | ||
80992638 | 229 | ################################################################################ |
d8ac0fbc | 230 | dnl -- format_pool inclusion type |
ad6254c5 | 231 | AC_MSG_CHECKING(whether to include support for GFS pool metadata) |
d8ac0fbc | 232 | AC_ARG_WITH(pool, |
60329273 | 233 | [ --with-pool=TYPE GFS pool read-only support: internal/shared/none |
d8ac0fbc AK |
234 | [TYPE=internal] ], |
235 | [ POOL="$withval" ], | |
236 | [ POOL="internal" ]) | |
ad6254c5 | 237 | AC_MSG_RESULT($POOL) |
d8ac0fbc AK |
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 | ) | |
d8ac0fbc AK |
243 | fi; |
244 | ||
245 | if test x$POOL = xinternal; then | |
72b2cb61 | 246 | AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.]) |
d8ac0fbc AK |
247 | fi |
248 | ||
80992638 | 249 | ################################################################################ |
d3c8211f | 250 | dnl -- cluster_locking inclusion type |
ad6254c5 | 251 | AC_MSG_CHECKING(whether to include support for cluster locking) |
d3c8211f AK |
252 | AC_ARG_WITH(cluster, |
253 | [ --with-cluster=TYPE Cluster LVM locking support: internal/shared/none | |
254 | [TYPE=internal] ], | |
255 | [ CLUSTER="$withval" ]) | |
ad6254c5 | 256 | AC_MSG_RESULT($CLUSTER) |
d3c8211f AK |
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 | ) | |
d3c8211f AK |
262 | fi; |
263 | ||
264 | if test x$CLUSTER = xinternal; then | |
72b2cb61 | 265 | AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.]) |
d3c8211f | 266 | fi |
d8ac0fbc | 267 | |
80992638 | 268 | ################################################################################ |
4922197a | 269 | dnl -- snapshots inclusion type |
ad6254c5 | 270 | AC_MSG_CHECKING(whether to include snapshots) |
4922197a AK |
271 | AC_ARG_WITH(snapshots, |
272 | [ --with-snapshots=TYPE Snapshot support: internal/shared/none | |
273 | [TYPE=internal] ], | |
274 | [ SNAPSHOTS="$withval" ], | |
275 | [ SNAPSHOTS="internal" ]) | |
ad6254c5 | 276 | AC_MSG_RESULT($SNAPSHOTS) |
4922197a AK |
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 | ) | |
4922197a AK |
282 | fi; |
283 | ||
284 | if test x$SNAPSHOTS = xinternal; then | |
72b2cb61 | 285 | AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.]) |
4922197a AK |
286 | fi |
287 | ||
80992638 | 288 | ################################################################################ |
4922197a | 289 | dnl -- mirrors inclusion type |
ad6254c5 | 290 | AC_MSG_CHECKING(whether to include mirrors) |
4922197a AK |
291 | AC_ARG_WITH(mirrors, |
292 | [ --with-mirrors=TYPE Mirror support: internal/shared/none | |
293 | [TYPE=internal] ], | |
294 | [ MIRRORS="$withval" ], | |
295 | [ MIRRORS="internal" ]) | |
ad6254c5 | 296 | AC_MSG_RESULT($MIRRORS) |
4922197a AK |
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 | ) | |
4922197a AK |
302 | fi; |
303 | ||
304 | if test x$MIRRORS = xinternal; then | |
72b2cb61 | 305 | AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.]) |
4922197a AK |
306 | fi |
307 | ||
80992638 | 308 | ################################################################################ |
1b523347 | 309 | dnl -- Disable readline |
ad6254c5 | 310 | AC_MSG_CHECKING(whether to enable readline) |
2c189a57 | 311 | AC_ARG_ENABLE([readline], |
1b523347 | 312 | [ --disable-readline Disable readline support], |
ea7cfb00 | 313 | [READLINE=$enableval], [READLINE=maybe]) |
ad6254c5 | 314 | AC_MSG_RESULT($READLINE) |
795ca3e5 | 315 | |
8b1a3214 AK |
316 | ################################################################################ |
317 | dnl -- Disable realtime clock support | |
318 | AC_MSG_CHECKING(whether to enable realtime support) | |
89044bc0 | 319 | AC_ARG_ENABLE(realtime, [ --enable-realtime Enable realtime clock support], |
8b1a3214 AK |
320 | REALTIME=$enableval) |
321 | AC_MSG_RESULT($REALTIME) | |
322 | ||
90c80887 AK |
323 | ################################################################################ |
324 | dnl -- Init pkg-config with dummy invokation: | |
325 | dnl -- this is required because PKG_CHECK_MODULES macro is expanded | |
326 | dnl -- to initialize the pkg-config environment only at the first invokation, | |
327 | dnl -- that would be conditional in this configure.in. | |
328 | pkg_config_init() { | |
329 | PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [], | |
330 | [AC_MSG_RESULT([pkg-config initialized])]) | |
331 | PKGCONFIG_INIT=1 | |
332 | } | |
333 | ||
80992638 | 334 | ################################################################################ |
8ce0cbda | 335 | dnl -- Build cluster LVM daemon |
ad6254c5 | 336 | AC_MSG_CHECKING(whether to build cluster LVM daemon) |
a266258f | 337 | AC_ARG_WITH(clvmd, |
a946372e | 338 | [ --with-clvmd=TYPE Build cluster LVM Daemon. |
8c222979 | 339 | The following cluster manager combinations are valid: |
a946372e AK |
340 | * cman,gulm (RHEL4 or equivalent) |
341 | * cman (RHEL5 or equivalent) | |
342 | * cman,corosync,openais (or selection of them) | |
343 | * all (autodetect) | |
344 | * none (disable build) | |
a266258f AK |
345 | [TYPE=none] ], |
346 | [ CLVMD="$withval" ], | |
347 | [ CLVMD="none" ]) | |
348 | if test x$CLVMD = xyes; then | |
5c7fc7c4 | 349 | CLVMD=all |
b1098701 | 350 | fi |
ad6254c5 | 351 | AC_MSG_RESULT($CLVMD) |
80992638 | 352 | |
8ce0cbda | 353 | dnl -- If clvmd enabled without cluster locking, automagically include it |
a266258f | 354 | if test x$CLVMD != xnone && test x$CLUSTER = xnone; then |
d3c8211f AK |
355 | CLUSTER=internal |
356 | fi | |
d3c8211f | 357 | |
90c80887 AK |
358 | dnl -- init pkgconfig if required |
359 | if test x$CLVMD != xnone && test x$PKGCONFIG_INIT != x1; then | |
360 | pkg_config_init | |
361 | fi | |
362 | ||
363 | ||
a946372e AK |
364 | dnl -- define build types |
365 | if [[ `expr x"$CLVMD" : '.*gulm.*'` != 0 ]]; then | |
366 | BUILDGULM=yes | |
367 | fi | |
368 | if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then | |
369 | BUILDCOROSYNC=yes | |
370 | fi | |
371 | if [[ `expr x"$CLVMD" : '.*openais.*'` != 0 ]]; then | |
372 | BUILDOPENAIS=yes | |
373 | fi | |
374 | if [[ `expr x"$CLVMD" : '.*cman.*'` != 0 ]]; then | |
375 | BUILDCMAN=yes | |
376 | fi | |
377 | ||
378 | dnl -- sanity check around user selection | |
379 | if test x$BUILDGULM = xyes; then | |
380 | if test x$BUILDCOROSYNC = xyes || \ | |
381 | test x$BUILDOPENAIS = xyes; then | |
382 | AC_MSG_ERROR([requested clvmd configuration is not valid]) | |
383 | fi | |
384 | fi | |
385 | ||
a946372e AK |
386 | dnl -- define a soft bailout if we are autodetecting |
387 | soft_bailout() { | |
388 | NOTFOUND=1 | |
389 | } | |
390 | ||
391 | hard_bailout() { | |
392 | AC_MSG_ERROR([bailing out]) | |
393 | } | |
394 | ||
395 | dnl -- if clvmd=all then set soft_bailout (we don't want to error) | |
396 | dnl -- and set all builds to yes. We need to do this here | |
397 | dnl -- to skip the gulm + openais|corosync sanity check above. | |
398 | if test x$CLVMD = xall; then | |
399 | bailout=soft_bailout | |
400 | BUILDGULM=yes | |
401 | BUILDCMAN=yes | |
402 | BUILDCOROSYNC=yes | |
403 | BUILDOPENAIS=yes | |
404 | else | |
405 | bailout=hard_bailout | |
406 | fi | |
407 | ||
408 | dnl -- helper macro to check libs without adding them to LIBS | |
409 | check_lib_no_libs() { | |
410 | lib_no_libs_arg1=$1 | |
411 | shift | |
412 | lib_no_libs_arg2=$1 | |
413 | shift | |
414 | lib_no_libs_args=$@ | |
415 | AC_CHECK_LIB([$lib_no_libs_arg1], | |
416 | [$lib_no_libs_arg2],, | |
417 | [$bailout], | |
418 | [$lib_no_libs_args]) | |
419 | LIBS=$ac_check_lib_save_LIBS | |
420 | } | |
421 | ||
422 | dnl -- Look for gulm libraries if required. | |
423 | if test x$BUILDGULM = xyes; then | |
424 | PKG_CHECK_MODULES(CCS, libccs, [HAVE_CCS=yes], | |
425 | [NOTFOUND=0 | |
426 | AC_CHECK_HEADERS(ccs.h,,$bailout) | |
427 | check_lib_no_libs ccs ccs_connect | |
428 | if test $NOTFOUND = 0; then | |
429 | AC_MSG_RESULT([no pkg for libccs, using -lccs]) | |
430 | CCS_LIBS="-lccs" | |
431 | HAVE_CCS=yes | |
432 | fi]) | |
433 | PKG_CHECK_MODULES(GULM, libgulm, [HAVE_GULM=yes], | |
434 | [NOTFOUND=0 | |
435 | AC_CHECK_HEADERS(libgulm.h,,$bailout) | |
436 | check_lib_no_libs gulm lg_core_login | |
437 | if test $NOTFOUND = 0; then | |
438 | AC_MSG_RESULT([no pkg for libgulm, using -lgulm]) | |
439 | GULM_LIBS="-lgulm" | |
440 | HAVE_GULM=yes | |
441 | fi]) | |
442 | fi | |
443 | ||
444 | dnl -- Look for cman libraries if required. | |
445 | if test x$BUILDCMAN = xyes; then | |
446 | PKG_CHECK_MODULES(CMAN, libcman, [HAVE_CMAN=yes], | |
447 | [NOTFOUND=0 | |
448 | AC_CHECK_HEADERS(libcman.h,,$bailout) | |
449 | check_lib_no_libs cman cman_init | |
450 | if test $NOTFOUND = 0; then | |
451 | AC_MSG_RESULT([no pkg for libcman, using -lcman]) | |
452 | CMAN_LIBS="-lcman" | |
453 | HAVE_CMAN=yes | |
454 | fi]) | |
455 | CHECKCONFDB=yes | |
456 | CHECKDLM=yes | |
457 | fi | |
458 | ||
459 | dnl -- Look for corosync that's required also for openais build | |
460 | dnl -- only enough recent version of corosync ship pkg-config files. | |
461 | dnl -- We can safely rely on that to detect the correct bits. | |
462 | if test x$BUILDCOROSYNC = xyes || \ | |
463 | test x$BUILDOPENAIS = xyes; then | |
464 | PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout) | |
465 | CHECKCONFDB=yes | |
466 | fi | |
467 | ||
edf47283 | 468 | dnl -- Look for corosync libraries if required. |
a946372e AK |
469 | if test x$BUILDCOROSYNC = xyes; then |
470 | PKG_CHECK_MODULES(QUORUM, libquorum, [HAVE_QUORUM=yes], $bailout) | |
471 | CHECKCPG=yes | |
472 | CHECKDLM=yes | |
473 | fi | |
474 | ||
475 | dnl -- Look for openais libraries if required. | |
476 | if test x$BUILDOPENAIS = xyes; then | |
477 | PKG_CHECK_MODULES(SALCK, libSaLck, [HAVE_SALCK=yes], $bailout) | |
478 | CHECKCPG=yes | |
479 | fi | |
480 | ||
481 | dnl -- Below are checks for libraries common to more than one build. | |
482 | ||
483 | dnl -- Check confdb library. | |
484 | dnl -- mandatory for corosync build. | |
485 | dnl -- optional for openais/cman build. | |
486 | ||
487 | if test x$CHECKCONFDB = xyes; then | |
488 | PKG_CHECK_MODULES(CONFDB, libconfdb, | |
489 | [HAVE_CONFDB=yes], | |
490 | [HAVE_CONFDB=no]) | |
491 | ||
492 | AC_CHECK_HEADERS(corosync/confdb.h, | |
493 | [HAVE_CONFDB_H=yes], | |
494 | [HAVE_CONFDB_H=no]) | |
495 | ||
496 | if test x$HAVE_CONFDB != xyes && \ | |
497 | test x$HAVE_CONFDB_H = xyes; then | |
498 | check_lib_no_libs confdb confdb_initialize | |
499 | AC_MSG_RESULT([no pkg for confdb, using -lconfdb]) | |
500 | CONFDB_LIBS="-lconfdb" | |
501 | HAVE_CONFDB=yes | |
502 | fi | |
503 | ||
504 | if test x$BUILDCOROSYNC = xyes && \ | |
505 | test x$HAVE_CONFDB != xyes && | |
506 | test x$CLVMD != xall; then | |
507 | AC_MSG_ERROR([bailing out... confdb library is required]) | |
508 | fi | |
509 | fi | |
510 | ||
511 | dnl -- Check cpg library. | |
512 | if test x$CHECKCPG = xyes; then | |
513 | PKG_CHECK_MODULES(CPG, libcpg, [HAVE_CPG=yes], $bailout) | |
514 | fi | |
515 | ||
516 | dnl -- Check dlm library. | |
517 | if test x$CHECKDLM = xyes; then | |
518 | PKG_CHECK_MODULES(DLM, libdlm, [HAVE_DLM=yes], | |
519 | [NOTFOUND=0 | |
520 | AC_CHECK_HEADERS(libdlm.h,,$bailout) | |
521 | check_lib_no_libs dlm dlm_lock -lpthread | |
522 | if test $NOTFOUND = 0; then | |
523 | AC_MSG_RESULT([no pkg for libdlm, using -ldlm]) | |
524 | DLM_LIBS="-ldlm -lpthread" | |
525 | HAVE_DLM=yes | |
526 | fi]) | |
527 | fi | |
528 | ||
529 | dnl -- If we are autodetecting, we need to re-create | |
530 | dnl -- the depedencies checks and set a proper CLVMD. | |
531 | if test x$CLVMD = xall; then | |
8c222979 | 532 | CLVMD=none |
a946372e AK |
533 | if test x$HAVE_CCS = xyes && \ |
534 | test x$HAVE_GULM = xyes; then | |
8c222979 FDN |
535 | AC_MSG_RESULT([Enabling clvmd gulm cluster manager]) |
536 | CLVMD="$CLVMD,gulm" | |
a946372e AK |
537 | fi |
538 | if test x$HAVE_CMAN = xyes && \ | |
539 | test x$HAVE_DLM = xyes; then | |
8c222979 FDN |
540 | AC_MSG_RESULT([Enabling clvmd cman cluster manager]) |
541 | CLVMD="$CLVMD,cman" | |
a946372e AK |
542 | fi |
543 | if test x$HAVE_COROSYNC = xyes && \ | |
544 | test x$HAVE_QUORUM = xyes && \ | |
545 | test x$HAVE_CPG = xyes && \ | |
546 | test x$HAVE_DLM = xyes && \ | |
547 | test x$HAVE_CONFDB = xyes; then | |
8c222979 FDN |
548 | AC_MSG_RESULT([Enabling clvmd corosync cluster manager]) |
549 | CLVMD="$CLVMD,corosync" | |
a946372e AK |
550 | fi |
551 | if test x$HAVE_COROSYNC = xyes && \ | |
552 | test x$HAVE_CPG = xyes && \ | |
553 | test x$HAVE_SALCK = xyes; then | |
8c222979 FDN |
554 | AC_MSG_RESULT([Enabling clvmd openais cluster manager]) |
555 | CLVMD="$CLVMD,openais" | |
556 | fi | |
557 | if test x$CLVMD = xnone; then | |
558 | AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.]) | |
a946372e | 559 | fi |
edf47283 AK |
560 | fi |
561 | ||
3c14bcca | 562 | ################################################################################ |
66fd4529 AK |
563 | dnl -- Build cluster mirror log daemon |
564 | AC_MSG_CHECKING(whether to build cluster mirror log daemon) | |
565 | AC_ARG_ENABLE(cmirrord, [ --enable-cmirrord Enable the cluster mirror log daemon], | |
566 | CMIRRORD=$enableval, CMIRRORD=no) | |
567 | AC_MSG_RESULT($CMIRRORD) | |
3c14bcca | 568 | |
66fd4529 AK |
569 | BUILD_CMIRRORD=$CMIRRORD |
570 | ||
571 | ################################################################################ | |
572 | dnl -- cmirrord pidfile | |
573 | AH_TEMPLATE(CMIRRORD_PIDFILE, [Path to cmirrord pidfile.]) | |
574 | if test "x$BUILD_CMIRRORD" = xyes; then | |
575 | AC_ARG_WITH(cmirrord-pidfile, | |
576 | [ --with-cmirrord-pidfile=PATH cmirrord pidfile [[/var/run/cmirrord.pid]] ], | |
577 | [ AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE,"$withval") ], | |
578 | [ AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE,"/var/run/cmirrord.pid") ]) | |
579 | fi | |
580 | ||
581 | ################################################################################ | |
3c14bcca | 582 | dnl -- Look for corosync libraries if required. |
66fd4529 | 583 | if [[ "x$BUILD_CMIRRORD" = xyes ]]; then |
90c80887 AK |
584 | dnl -- init pkgconfig if required |
585 | if test x$PKGCONFIG_INIT != x1; then | |
586 | pkg_config_init | |
587 | fi | |
588 | PKG_CHECK_MODULES(SACKPT, libSaCkpt) | |
589 | if test x$HAVE_CPG != xyes; then | |
590 | PKG_CHECK_MODULES(CPG, libcpg) | |
591 | fi | |
3c14bcca JEB |
592 | fi |
593 | ||
80992638 | 594 | ################################################################################ |
8ce0cbda | 595 | dnl -- Enable debugging |
ad6254c5 AK |
596 | AC_MSG_CHECKING(whether to enable debugging) |
597 | AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging], | |
d0191583 | 598 | DEBUG=$enableval, DEBUG=no) |
ad6254c5 | 599 | AC_MSG_RESULT($DEBUG) |
8ef2b021 | 600 | |
8ce0cbda AK |
601 | dnl -- Normally turn off optimisation for debug builds |
602 | if test x$DEBUG = xyes; then | |
603 | COPTIMISE_FLAG= | |
8a2fc586 AK |
604 | else |
605 | CSCOPE_CMD= | |
8ce0cbda AK |
606 | fi |
607 | ||
608 | ################################################################################ | |
609 | dnl -- Override optimisation | |
ad6254c5 | 610 | AC_MSG_CHECKING(for C optimisation flag) |
8ce0cbda | 611 | AC_ARG_WITH(optimisation, |
d0191583 | 612 | [ --with-optimisation=OPT C optimisation flag [[OPT=-O2]] ], |
8ce0cbda | 613 | [ COPTIMISE_FLAG="$withval" ]) |
ad6254c5 | 614 | AC_MSG_RESULT($COPTIMISE_FLAG) |
8ce0cbda | 615 | |
fddafd51 ZK |
616 | ################################################################################ |
617 | dnl -- Enable profiling | |
5556819a | 618 | AC_MSG_CHECKING(whether to gather gcov profiling data) |
fddafd51 | 619 | AC_ARG_ENABLE(profiling, |
5556819a AK |
620 | AC_HELP_STRING(--enable-profiling, [Gather gcov profiling data]), |
621 | PROFILING=$enableval, PROFILING=no) | |
622 | AC_MSG_RESULT($PROFILING) | |
623 | ||
624 | if test "x$PROFILING" = xyes; then | |
625 | COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage" | |
b145d876 ZK |
626 | AC_PATH_PROG(LCOV, lcov, no) |
627 | AC_PATH_PROG(GENHTML, genhtml, no) | |
628 | if test "$LCOV" = no -o "$GENHTML" = no ; then | |
629 | AC_MSG_ERROR([lcov and genhtml are required for profiling]) | |
630 | fi | |
5556819a | 631 | fi |
fddafd51 | 632 | |
80992638 | 633 | ################################################################################ |
8ce0cbda | 634 | dnl -- Disable devmapper |
ad6254c5 | 635 | AC_MSG_CHECKING(whether to use device-mapper) |
f6fc418d | 636 | AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable LVM2 device-mapper interaction], |
ad6254c5 AK |
637 | DEVMAPPER=$enableval) |
638 | AC_MSG_RESULT($DEVMAPPER) | |
199e490e | 639 | |
b896caa1 | 640 | if test x$DEVMAPPER = xyes; then |
f6fc418d | 641 | AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.]) |
b896caa1 AK |
642 | fi |
643 | ||
5d518f1f AK |
644 | ################################################################################ |
645 | dnl -- Enable udev synchronisation | |
646 | AC_MSG_CHECKING(whether to enable synchronisation with udev processing) | |
647 | AC_ARG_ENABLE(udev_sync, [ --enable-udev_sync Enable synchronisation with udev processing], | |
648 | UDEV_SYNC=$enableval, UDEV_SYNC=no) | |
649 | AC_MSG_RESULT($UDEV_SYNC) | |
650 | ||
651 | if test x$UDEV_SYNC = xyes; then | |
652 | AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.]) | |
653 | fi | |
654 | ||
655 | dnl -- Enable udev rules | |
656 | AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation) | |
657 | AC_ARG_ENABLE(udev_rules, [ --enable-udev_rules Install rule files needed for udev synchronisation], | |
658 | UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC) | |
659 | AC_MSG_RESULT($UDEV_RULES) | |
660 | ||
fd856332 PR |
661 | ################################################################################ |
662 | dnl -- Check for libudev's udev_queue_get_udev_is_active function when udev synchronisation is enabled | |
663 | ||
664 | if test x$UDEV_SYNC = xyes; then | |
665 | AC_CHECK_LIB(udev, udev_queue_get_udev_is_active, HAVE_UDEV_QUEUE_GET_UDEV_IS_ACTIVE=yes, | |
666 | HAVE_UDEV_QUEUE_GET_UDEV_IS_ACTIVE=no) | |
667 | ||
668 | if test x$HAVE_UDEV_QUEUE_GET_UDEV_IS_ACTIVE = xyes; then | |
669 | AC_DEFINE([HAVE_UDEV_QUEUE_GET_UDEV_IS_ACTIVE], 1, | |
670 | [Define to 1 if libudev's udev_queue_get_udev_is_active function is available.]) | |
671 | LIBS="-ludev $LIBS" | |
55313cb6 PR |
672 | else |
673 | AC_MSG_WARN(It won't be possible to get udev state. We will assume that udev is not running.) | |
fd856332 PR |
674 | fi |
675 | fi | |
676 | ||
f6fc418d AK |
677 | ################################################################################ |
678 | dnl -- Compatibility mode | |
679 | AC_ARG_ENABLE(compat, [ --enable-compat Enable support for old device-mapper versions], | |
680 | DM_COMPAT=$enableval, DM_COMPAT=no) | |
681 | ||
95eaa683 AK |
682 | ################################################################################ |
683 | dnl -- Compatible units suffix mode | |
684 | AC_ARG_ENABLE(units-compat, | |
685 | [ --enable-units-compat Enable output compatibility with old versions that | |
686 | that don't use KiB-style unit suffixes], | |
687 | UNITS_COMPAT=$enableval, UNITS_COMPAT=no) | |
688 | ||
689 | if test x$UNITS_COMPAT = xyes; then | |
690 | AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.]) | |
691 | fi | |
692 | ||
f6fc418d AK |
693 | ################################################################################ |
694 | dnl -- Disable ioctl | |
695 | AC_ARG_ENABLE(ioctl, [ --disable-driver Disable calls to device-mapper in the kernel], | |
696 | DM_IOCTLS=$enableval) | |
697 | ||
80992638 | 698 | ################################################################################ |
8ce0cbda | 699 | dnl -- Disable O_DIRECT |
ad6254c5 AK |
700 | AC_MSG_CHECKING(whether to enable O_DIRECT) |
701 | AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT], | |
702 | ODIRECT=$enableval) | |
703 | AC_MSG_RESULT($ODIRECT) | |
2dc95e1c AK |
704 | |
705 | if test x$ODIRECT = xyes; then | |
72b2cb61 | 706 | AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.]) |
2dc95e1c AK |
707 | fi |
708 | ||
572fefeb AK |
709 | ################################################################################ |
710 | dnl -- Enable liblvm2app.so | |
711 | AC_MSG_CHECKING(whether to build liblvm2app.so application library) | |
712 | AC_ARG_ENABLE(applib, | |
713 | [ --enable-applib Build application library], | |
714 | APPLIB=$enableval, APPLIB=no) | |
715 | AC_MSG_RESULT($APPLIB) | |
716 | AC_SUBST([LVM2APP_LIB]) | |
717 | test x$APPLIB = xyes \ | |
718 | && LVM2APP_LIB=-llvm2app \ | |
719 | || LVM2APP_LIB= | |
720 | ||
80992638 | 721 | ################################################################################ |
8ce0cbda | 722 | dnl -- Enable cmdlib |
ad6254c5 AK |
723 | AC_MSG_CHECKING(whether to compile liblvm2cmd.so) |
724 | AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library], | |
725 | CMDLIB=$enableval, CMDLIB=no) | |
726 | AC_MSG_RESULT($CMDLIB) | |
aa4d1e31 | 727 | AC_SUBST([LVM2CMD_LIB]) |
2a9a80c9 | 728 | test x$CMDLIB = xyes \ |
aa4d1e31 JM |
729 | && LVM2CMD_LIB=-llvm2cmd \ |
730 | || LVM2CMD_LIB= | |
8106cdd5 | 731 | |
f6fc418d AK |
732 | ################################################################################ |
733 | dnl -- Enable pkg-config | |
734 | AC_ARG_ENABLE(pkgconfig, [ --enable-pkgconfig Install pkgconfig support], | |
735 | PKGCONFIG=$enableval, PKGCONFIG=no) | |
2a9a80c9 | 736 | |
80992638 | 737 | ################################################################################ |
8ce0cbda | 738 | dnl -- Enable fsadm |
1995c9ff | 739 | AC_MSG_CHECKING(whether to install fsadm) |
c9274524 ZK |
740 | AC_ARG_ENABLE(fsadm, [AC_HELP_STRING([--disable-fsadm], [Disable fsadm])], |
741 | FSADM=$enableval) | |
ad6254c5 | 742 | AC_MSG_RESULT($FSADM) |
809fae91 | 743 | |
06f62ad1 AK |
744 | ################################################################################ |
745 | dnl -- enable dmeventd handling | |
746 | AC_MSG_CHECKING(whether to use dmeventd) | |
747 | AC_ARG_ENABLE(dmeventd, [ --enable-dmeventd Enable the device-mapper event daemon], | |
748 | DMEVENTD=$enableval) | |
749 | AC_MSG_RESULT($DMEVENTD) | |
750 | ||
f6fc418d AK |
751 | BUILD_DMEVENTD=$DMEVENTD |
752 | ||
06f62ad1 | 753 | dnl -- dmeventd currently requires internal mirror support |
2a9a80c9 PR |
754 | if test x$DMEVENTD = xyes; then |
755 | if test x$MIRRORS != xinternal; then | |
756 | AC_MSG_ERROR( | |
757 | --enable-dmeventd currently requires --with-mirrors=internal | |
758 | ) | |
759 | fi | |
760 | if test x$CMDLIB = xno; then | |
761 | AC_MSG_ERROR( | |
762 | --enable-dmeventd requires --enable-cmdlib to be used as well | |
763 | ) | |
764 | fi | |
06f62ad1 AK |
765 | fi |
766 | ||
15d91f5a | 767 | if test x$DMEVENTD = xyes; then |
72b2cb61 | 768 | AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.]) |
15d91f5a | 769 | fi |
f6fc418d AK |
770 | |
771 | ################################################################################ | |
772 | dnl -- getline included in recent libc | |
773 | ||
774 | AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1, | |
775 | [Define to 1 if getline is available.])) | |
776 | ||
777 | ################################################################################ | |
778 | dnl -- canonicalize_file_name included in recent libc | |
779 | ||
780 | AC_CHECK_LIB(c, canonicalize_file_name, | |
781 | AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1, | |
782 | [Define to 1 if canonicalize_file_name is available.])) | |
783 | ||
80992638 | 784 | ################################################################################ |
d0191583 | 785 | dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin |
795ca3e5 AK |
786 | if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]]; |
787 | then exec_prefix=""; | |
788 | fi; | |
789 | ||
80992638 | 790 | ################################################################################ |
8ce0cbda | 791 | dnl -- Check for dlopen |
26e7f2e0 AK |
792 | AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no) |
793 | ||
7e9e9502 | 794 | if [[ "x$HAVE_LIBDL" = xyes ]]; then |
72b2cb61 | 795 | AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.]) |
26e7f2e0 | 796 | LIBS="-ldl $LIBS" |
d68a82ec AK |
797 | else |
798 | HAVE_LIBDL=no | |
26e7f2e0 AK |
799 | fi |
800 | ||
80992638 | 801 | ################################################################################ |
8ce0cbda | 802 | dnl -- Check for shared/static conflicts |
80992638 AK |
803 | if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \ |
804 | -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \ | |
4922197a | 805 | \) -a "x$STATIC_LINK" = xyes ]]; |
d68a82ec | 806 | then AC_MSG_ERROR( |
036f273a | 807 | Features cannot be 'shared' when building statically |
d68a82ec | 808 | ) |
036f273a AK |
809 | fi |
810 | ||
f30875db ZK |
811 | ################################################################################ |
812 | if [[ "$DMEVENTD" = yes -o "$CLVMD" != none ]] ; then | |
813 | AC_CHECK_LIB([pthread], [pthread_mutex_lock], | |
814 | [PTHREAD_LIBS="-lpthread"], hard_bailout) | |
815 | fi | |
816 | ||
d0191583 JM |
817 | ################################################################################ |
818 | dnl -- Disable selinux | |
819 | AC_MSG_CHECKING(whether to enable selinux support) | |
820 | AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support], | |
821 | SELINUX=$enableval) | |
822 | AC_MSG_RESULT($SELINUX) | |
823 | ||
80992638 | 824 | ################################################################################ |
8a2fc586 | 825 | dnl -- Check for selinux |
80992638 | 826 | if test x$SELINUX = xyes; then |
f8f6ec92 ZK |
827 | AC_CHECK_LIB([sepol], [sepol_check_context], [ |
828 | AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.]) | |
829 | SELINUX_LIBS="-lsepol"]) | |
8a2fc586 | 830 | |
f8f6ec92 ZK |
831 | AC_CHECK_LIB([selinux], [is_selinux_enabled], [ |
832 | AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout) | |
72b2cb61 | 833 | AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.]) |
e1b8a236 | 834 | SELINUX_LIBS="-lselinux $SELINUX_LIBS" |
f8f6ec92 | 835 | HAVE_SELINUX=yes ], [ |
ad6254c5 | 836 | AC_MSG_WARN(Disabling selinux) |
f8f6ec92 ZK |
837 | SELINUX_LIBS= |
838 | HAVE_SELINUX=no ]) | |
036f273a | 839 | fi |
d68a82ec | 840 | |
8b1a3214 AK |
841 | ################################################################################ |
842 | dnl -- Check for realtime clock support | |
843 | if test x$REALTIME = xyes; then | |
8b1a3214 | 844 | AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no) |
8b1a3214 AK |
845 | |
846 | if test x$HAVE_REALTIME = xyes; then | |
847 | AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.]) | |
848 | LIBS="-lrt $LIBS" | |
849 | else | |
850 | AC_MSG_WARN(Disabling realtime clock) | |
851 | fi | |
852 | fi | |
853 | ||
80992638 | 854 | ################################################################################ |
8ce0cbda | 855 | dnl -- Check for getopt |
d0191583 | 856 | AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.])) |
b896caa1 | 857 | |
80992638 | 858 | ################################################################################ |
8ce0cbda | 859 | dnl -- Check for readline (Shamelessly copied from parted 1.4.17) |
ea7cfb00 | 860 | if test x$READLINE != xno; then |
539f4a77 ZK |
861 | lvm_saved_libs=$LIBS |
862 | AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib], | |
863 | READLINE_LIBS=$ac_cv_search_tgetent, [ | |
864 | if test "$READLINE" = yes; then | |
865 | AC_MSG_ERROR( | |
866 | [termcap could not be found which is required for the | |
867 | --enable-readline option (which is enabled by default). Either disable readline | |
868 | support with --disable-readline or download and install termcap from: | |
869 | ftp.gnu.org/gnu/termcap | |
870 | Note: if you are using precompiled packages you will also need the development | |
871 | package as well (which may be called termcap-devel or something similar). | |
872 | Note: (n)curses also seems to work as a substitute for termcap. This was | |
873 | not found either - but you could try installing that as well.]) | |
874 | fi]) | |
875 | dnl -- Old systems may need extra termcap dependency explicitly in LIBS | |
876 | AC_CHECK_LIB([readline], [readline], [ | |
877 | AC_DEFINE([READLINE_SUPPORT], 1, | |
878 | [Define to 1 to include the LVM readline shell.]) | |
879 | dnl -- Try only with -lreadline and check for different symbol | |
880 | LIBS=$lvm_saved_libs | |
881 | AC_CHECK_LIB([readline], [rl_line_buffer], | |
882 | [ READLINE_LIBS="-lreadline" ], [ | |
883 | AC_MSG_RESULT([linking -lreadline with $READLINE_LIBS needed]) | |
884 | READLINE_LIBS="-lreadline $READLINE_LIBS" | |
885 | ]) ], [ | |
886 | READLINE_LIBS= | |
887 | if test "$READLINE" = yes; then | |
888 | AC_MSG_ERROR( | |
889 | [GNU Readline could not be found which is required for the | |
795ca3e5 AK |
890 | --enable-readline option (which is enabled by default). Either disable readline |
891 | support with --disable-readline or download and install readline from: | |
892 | ftp.gnu.org/gnu/readline | |
893 | Note: if you are using precompiled packages you will also need the development | |
539f4a77 ZK |
894 | package as well (which may be called readline-devel or something similar).]) |
895 | fi ]) | |
896 | LIBS="$READLINE_LIBS $lvm_saved_libs" | |
897 | AC_CHECK_FUNCS([rl_completion_matches]) | |
898 | LIBS=$lvm_saved_libs | |
795ca3e5 AK |
899 | fi |
900 | ||
80992638 | 901 | ################################################################################ |
8ce0cbda | 902 | dnl -- Internationalisation stuff |
ad6254c5 AK |
903 | AC_MSG_CHECKING(whether to enable internationalisation) |
904 | AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support], | |
905 | INTL=$enableval, INTL=no) | |
906 | AC_MSG_RESULT($INTL) | |
69792976 AK |
907 | |
908 | if test x$INTL = xyes; then | |
f6fc418d | 909 | # FIXME - Move this - can be device-mapper too |
69792976 AK |
910 | INTL_PACKAGE="lvm2" |
911 | AC_PATH_PROG(MSGFMT, msgfmt) | |
912 | if [[ "x$MSGFMT" == x ]]; | |
913 | then AC_MSG_ERROR( | |
914 | msgfmt not found in path $PATH | |
915 | ) | |
69792976 AK |
916 | fi; |
917 | ||
918 | AC_ARG_WITH(localedir, | |
d0191583 JM |
919 | [ --with-localedir=DIR Translation files in DIR [[PREFIX/share/locale]] ], |
920 | [ LOCALEDIR="$withval" ], | |
921 | [ LOCALEDIR='${prefix}/share/locale' ]) | |
69792976 AK |
922 | fi |
923 | ||
80992638 | 924 | ################################################################################ |
4a7f3eb2 | 925 | AC_ARG_WITH(confdir, |
5d518f1f | 926 | [ --with-confdir=DIR Configuration files in DIR [[/etc]]], |
d0191583 JM |
927 | [ CONFDIR="$withval" ], |
928 | [ CONFDIR='/etc' ]) | |
0a62c911 AK |
929 | |
930 | AC_ARG_WITH(staticdir, | |
5d518f1f | 931 | [ --with-staticdir=DIR Static binary in DIR [[EPREFIX/sbin]]], |
d0191583 JM |
932 | [ STATICDIR="$withval" ], |
933 | [ STATICDIR='${exec_prefix}/sbin' ]) | |
0a62c911 | 934 | |
68f2de6d AK |
935 | AC_ARG_WITH(usrlibdir, |
936 | [ --with-usrlibdir=DIR], | |
937 | [ usrlibdir="$withval"], | |
938 | [ usrlibdir='${prefix}/lib' ]) | |
939 | ||
940 | AC_ARG_WITH(usrsbindir, | |
941 | [ --with-usrsbindir=DIR], | |
942 | [ usrsbindir="$withval"], | |
943 | [ usrsbindir='${prefix}/sbin' ]) | |
944 | ||
5d518f1f AK |
945 | ################################################################################ |
946 | AC_ARG_WITH(udev_prefix, | |
947 | [ --with-udev-prefix=UPREFIX Install udev rule files in UPREFIX [[EPREFIX]]], | |
948 | [ udev_prefix="$withval"], | |
949 | [ udev_prefix='${exec_prefix}' ]) | |
950 | ||
78ce7acc AK |
951 | AC_ARG_WITH(udevdir, |
952 | [ --with-udevdir=DIR udev rules in DIR [[UPREFIX/lib/udev/rules.d]]], | |
953 | [ udevdir="$withval"], | |
954 | [ udevdir='${udev_prefix}/lib/udev/rules.d' ]) | |
5d518f1f | 955 | |
ad6254c5 AK |
956 | ################################################################################ |
957 | dnl -- Ensure additional headers required | |
958 | if test x$READLINE = xyes; then | |
959 | AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out)) | |
960 | fi | |
961 | ||
5c7fc7c4 | 962 | if test x$CLVMD != xnone; then |
ad6254c5 AK |
963 | 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)) |
964 | AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out)) | |
965 | AC_FUNC_GETMNTENT | |
966 | # AC_FUNC_REALLOC | |
967 | AC_FUNC_SELECT_ARGTYPES | |
968 | fi | |
969 | ||
ad6254c5 AK |
970 | if test x$CLUSTER != xnone; then |
971 | AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out)) | |
972 | AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out)) | |
973 | fi | |
974 | ||
975 | if test x$HAVE_LIBDL = xyes; then | |
976 | AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out)) | |
977 | fi | |
978 | ||
979 | if test x$INTL = xyes; then | |
980 | AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out)) | |
981 | fi | |
982 | ||
5d518f1f AK |
983 | if test x$UDEV_SYNC = xyes; then |
984 | AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out)) | |
985 | fi | |
986 | ||
a653923f AK |
987 | ################################################################################ |
988 | AC_PATH_PROG(MODPROBE_CMD, modprobe) | |
989 | ||
990 | if test x$MODPROBE_CMD != x; then | |
72b2cb61 | 991 | AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.]) |
a653923f AK |
992 | fi |
993 | ||
80992638 | 994 | ################################################################################ |
f6fc418d AK |
995 | dnl -- dmeventd pidfile and executable path |
996 | AH_TEMPLATE(DMEVENTD_PIDFILE, [Path to dmeventd pidfile.]) | |
997 | if test "$BUILD_DMEVENTD" = yes; then | |
998 | AC_ARG_WITH(dmeventd-pidfile, | |
999 | [ --with-dmeventd-pidfile=PATH dmeventd pidfile [[/var/run/dmeventd.pid]] ], | |
1000 | [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"$withval") ], | |
1001 | [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"/var/run/dmeventd.pid") ]) | |
1002 | fi | |
1003 | ||
1004 | AH_TEMPLATE(DMEVENTD_PATH, [Path to dmeventd binary.]) | |
1005 | if test "$BUILD_DMEVENTD" = yes; then | |
1006 | dmeventd_prefix="$exec_prefix" | |
1007 | if test "x$dmeventd_prefix" = "xNONE"; then | |
1008 | dmeventd_prefix="$prefix" | |
1009 | fi | |
1010 | if test "x$dmeventd_prefix" = "xNONE"; then | |
1011 | dmeventd_prefix="" | |
1012 | fi | |
1013 | AC_ARG_WITH(dmeventd-path, | |
5d518f1f | 1014 | [ --with-dmeventd-path=PATH dmeventd path [[EPREFIX/sbin/dmeventd]] ], |
f6fc418d AK |
1015 | [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$withval") ], |
1016 | [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$dmeventd_prefix/sbin/dmeventd") ]) | |
1017 | fi | |
1018 | ||
1019 | ################################################################################ | |
1020 | dnl -- which kernel interface to use (ioctl only) | |
1021 | AC_MSG_CHECKING(for kernel interface choice) | |
1022 | AC_ARG_WITH(interface, | |
1023 | [ --with-interface=IFACE Choose kernel interface (ioctl) [[ioctl]] ], | |
1024 | [ interface="$withval" ], | |
1025 | [ interface=ioctl ]) | |
1026 | if [[ "x$interface" != xioctl ]]; | |
1027 | then | |
1028 | AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.) | |
1029 | fi | |
1030 | AC_MSG_RESULT($interface) | |
1031 | ||
1032 | ################################################################################ | |
db8b5af9 | 1033 | DM_LIB_VERSION="\"`cat "$srcdir"/VERSION_DM 2>/dev/null || echo Unknown`\"" |
f58b35b5 AK |
1034 | AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version]) |
1035 | ||
db8b5af9 | 1036 | DM_LIB_PATCHLEVEL=`cat "$srcdir"/VERSION_DM | $AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'` |
597c3f8e | 1037 | |
db8b5af9 | 1038 | LVM_VERSION="\"`cat "$srcdir"/VERSION 2>/dev/null || echo Unknown`\"" |
fae0c576 | 1039 | |
db8b5af9 | 1040 | VER=`cat "$srcdir"/VERSION` |
bf456146 | 1041 | LVM_RELEASE_DATE="\"`echo $VER | $SED 's/.* (//;s/).*//'`\"" |
ec6a6fbe AK |
1042 | VER=`echo "$VER" | $AWK '{print $1}'` |
1043 | LVM_RELEASE="\"`echo "$VER" | $AWK -F '-' '{print $2}'`\"" | |
1044 | VER=`echo "$VER" | $AWK -F '-' '{print $1}'` | |
1045 | LVM_MAJOR=`echo "$VER" | $AWK -F '.' '{print $1}'` | |
1046 | LVM_MINOR=`echo "$VER" | $AWK -F '.' '{print $2}'` | |
bf456146 AK |
1047 | LVM_PATCHLEVEL=`echo "$VER" | $AWK -F '[[(.]]' '{print $3}'` |
1048 | LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'` | |
ec6a6fbe | 1049 | |
80992638 | 1050 | ################################################################################ |
572fefeb | 1051 | AC_SUBST(APPLIB) |
66fd4529 | 1052 | AC_SUBST(BUILD_CMIRRORD) |
d0191583 | 1053 | AC_SUBST(BUILD_DMEVENTD) |
a946372e AK |
1054 | AC_SUBST(CCS_CFLAGS) |
1055 | AC_SUBST(CCS_LIBS) | |
b896caa1 | 1056 | AC_SUBST(CFLAGS) |
d0191583 | 1057 | AC_SUBST(CFLOW_CMD) |
8106cdd5 | 1058 | AC_SUBST(CLDFLAGS) |
8106cdd5 | 1059 | AC_SUBST(CLDNOWHOLEARCHIVE) |
d0191583 JM |
1060 | AC_SUBST(CLDWHOLEARCHIVE) |
1061 | AC_SUBST(CLUSTER) | |
1062 | AC_SUBST(CLVMD) | |
a946372e AK |
1063 | AC_SUBST(CMAN_CFLAGS) |
1064 | AC_SUBST(CMAN_LIBS) | |
d0191583 | 1065 | AC_SUBST(CMDLIB) |
edf47283 AK |
1066 | AC_SUBST(CONFDB_CFLAGS) |
1067 | AC_SUBST(CONFDB_LIBS) | |
1068 | AC_SUBST(CONFDIR) | |
d0191583 | 1069 | AC_SUBST(COPTIMISE_FLAG) |
edf47283 AK |
1070 | AC_SUBST(CPG_CFLAGS) |
1071 | AC_SUBST(CPG_LIBS) | |
d0191583 | 1072 | AC_SUBST(CSCOPE_CMD) |
8ef2b021 | 1073 | AC_SUBST(DEBUG) |
199e490e | 1074 | AC_SUBST(DEVMAPPER) |
a946372e AK |
1075 | AC_SUBST(DLM_CFLAGS) |
1076 | AC_SUBST(DLM_LIBS) | |
d0191583 JM |
1077 | AC_SUBST(DMEVENTD) |
1078 | AC_SUBST(DM_COMPAT) | |
1079 | AC_SUBST(DM_DEVICE_GID) | |
1080 | AC_SUBST(DM_DEVICE_MODE) | |
1081 | AC_SUBST(DM_DEVICE_UID) | |
1082 | AC_SUBST(DM_IOCTLS) | |
1083 | AC_SUBST(DM_LIB_VERSION) | |
597c3f8e | 1084 | AC_SUBST(DM_LIB_PATCHLEVEL) |
d0191583 JM |
1085 | AC_SUBST(FSADM) |
1086 | AC_SUBST(GROUP) | |
a946372e AK |
1087 | AC_SUBST(GULM_CFLAGS) |
1088 | AC_SUBST(GULM_LIBS) | |
26e7f2e0 | 1089 | AC_SUBST(HAVE_LIBDL) |
8b1a3214 | 1090 | AC_SUBST(HAVE_REALTIME) |
d0191583 JM |
1091 | AC_SUBST(INTL) |
1092 | AC_SUBST(INTL_PACKAGE) | |
1093 | AC_SUBST(JOBS) | |
1094 | AC_SUBST(LDDEPS) | |
1095 | AC_SUBST(LIBS) | |
1096 | AC_SUBST(LIB_SUFFIX) | |
69792976 | 1097 | AC_SUBST(LOCALEDIR) |
d0191583 JM |
1098 | AC_SUBST(LVM1) |
1099 | AC_SUBST(LVM1_FALLBACK) | |
d0191583 | 1100 | AC_SUBST(LVM_VERSION) |
bf456146 | 1101 | AC_SUBST(LVM_LIBAPI) |
ec6a6fbe AK |
1102 | AC_SUBST(LVM_MAJOR) |
1103 | AC_SUBST(LVM_MINOR) | |
1104 | AC_SUBST(LVM_PATCHLEVEL) | |
1105 | AC_SUBST(LVM_RELEASE) | |
1106 | AC_SUBST(LVM_RELEASE_DATE) | |
d0191583 JM |
1107 | AC_SUBST(MIRRORS) |
1108 | AC_SUBST(MSGFMT) | |
1109 | AC_SUBST(OWNER) | |
1110 | AC_SUBST(PKGCONFIG) | |
1111 | AC_SUBST(POOL) | |
f30875db | 1112 | AC_SUBST(PTHREAD_LIBS) |
edf47283 AK |
1113 | AC_SUBST(QUORUM_CFLAGS) |
1114 | AC_SUBST(QUORUM_LIBS) | |
539f4a77 | 1115 | AC_SUBST(READLINE_LIBS) |
90c80887 AK |
1116 | AC_SUBST(SACKPT_CFLAGS) |
1117 | AC_SUBST(SACKPT_LIBS) | |
a946372e AK |
1118 | AC_SUBST(SALCK_CFLAGS) |
1119 | AC_SUBST(SALCK_LIBS) | |
e1b8a236 | 1120 | AC_SUBST(SELINUX_LIBS) |
d0191583 | 1121 | AC_SUBST(SNAPSHOTS) |
0a62c911 | 1122 | AC_SUBST(STATICDIR) |
d0191583 | 1123 | AC_SUBST(STATIC_LINK) |
5d518f1f | 1124 | AC_SUBST(UDEV_RULES) |
4df024c4 | 1125 | AC_SUBST(UDEV_SYNC) |
f6fc418d AK |
1126 | AC_SUBST(interface) |
1127 | AC_SUBST(kerneldir) | |
1128 | AC_SUBST(missingkernel) | |
1129 | AC_SUBST(kernelvsn) | |
1130 | AC_SUBST(tmpdir) | |
5d518f1f AK |
1131 | AC_SUBST(udev_prefix) |
1132 | AC_SUBST(udevdir) | |
68f2de6d AK |
1133 | AC_SUBST(usrlibdir) |
1134 | AC_SUBST(usrsbindir) | |
8106cdd5 | 1135 | |
80992638 | 1136 | ################################################################################ |
d3a356b4 | 1137 | dnl -- First and last lines should not contain files to generate in order to |
8ce0cbda | 1138 | dnl -- keep utility scripts running properly |
d3a356b4 JM |
1139 | AC_CONFIG_FILES([ |
1140 | Makefile | |
1141 | make.tmpl | |
1142 | daemons/Makefile | |
1143 | daemons/clvmd/Makefile | |
5d311afb | 1144 | daemons/cmirrord/Makefile |
f6fc418d AK |
1145 | daemons/dmeventd/Makefile |
1146 | daemons/dmeventd/libdevmapper-event.pc | |
b7edb5bf | 1147 | daemons/dmeventd/plugins/Makefile |
d3d98fdc | 1148 | daemons/dmeventd/plugins/lvm2/Makefile |
f6fc418d AK |
1149 | daemons/dmeventd/plugins/mirror/Makefile |
1150 | daemons/dmeventd/plugins/snapshot/Makefile | |
d3a356b4 | 1151 | doc/Makefile |
db8b5af9 | 1152 | include/.symlinks |
f6fc418d AK |
1153 | include/Makefile |
1154 | lib/Makefile | |
d3a356b4 JM |
1155 | lib/format1/Makefile |
1156 | lib/format_pool/Makefile | |
1157 | lib/locking/Makefile | |
1158 | lib/mirror/Makefile | |
ec6a6fbe | 1159 | lib/misc/lvm-version.h |
d3a356b4 | 1160 | lib/snapshot/Makefile |
f6fc418d AK |
1161 | libdm/Makefile |
1162 | libdm/libdevmapper.pc | |
e0c64c6c | 1163 | liblvm/Makefile |
70046623 | 1164 | liblvm/liblvm2app.pc |
f6fc418d AK |
1165 | man/Makefile |
1166 | po/Makefile | |
2de38033 | 1167 | scripts/clvmd_init_red_hat |
81410c8f | 1168 | scripts/cmirrord_init_red_hat |
595eaf92 | 1169 | scripts/lvm2_monitoring_init_red_hat |
d3a356b4 | 1170 | scripts/Makefile |
f6fc418d | 1171 | test/Makefile |
c7e363f9 | 1172 | test/api/Makefile |
d3a356b4 | 1173 | tools/Makefile |
5d518f1f | 1174 | udev/Makefile |
7a197a62 AK |
1175 | ]) |
1176 | AC_OUTPUT | |
2dc95e1c AK |
1177 | |
1178 | if test x$ODIRECT != xyes; then | |
ad6254c5 | 1179 | AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up) |
2dc95e1c | 1180 | fi |