]>
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 | 80 | AC_HEADER_DIRENT |
d911ec67 | 81 | AC_HEADER_MAJOR |
80992638 | 82 | AC_HEADER_STDC |
ad6254c5 AK |
83 | AC_HEADER_SYS_WAIT |
84 | AC_HEADER_TIME | |
85 | ||
d0191583 | 86 | AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \ |
d911ec67 AK |
87 | langinfo.h libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h \ |
88 | sys/wait.h time.h], , | |
d0191583 | 89 | [AC_MSG_ERROR(bailing out)]) |
ad6254c5 AK |
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 | |
80992638 | 97 | |
d0191583 JM |
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 | ||
80992638 | 103 | ################################################################################ |
d0191583 | 104 | dnl -- Check for typedefs, structures, and compiler characteristics. |
80992638 AK |
105 | AC_C_CONST |
106 | AC_C_INLINE | |
d0191583 | 107 | AC_CHECK_MEMBERS([struct stat.st_rdev]) |
80992638 AK |
108 | AC_TYPE_OFF_T |
109 | AC_TYPE_PID_T | |
d0191583 | 110 | AC_TYPE_SIGNAL |
80992638 | 111 | AC_TYPE_SIZE_T |
ad6254c5 | 112 | AC_TYPE_MODE_T |
d911ec67 AK |
113 | AC_TYPE_INT8_T |
114 | AC_TYPE_INT16_T | |
115 | AC_TYPE_INT32_T | |
116 | AC_TYPE_INT64_T | |
117 | AC_TYPE_SSIZE_T | |
118 | AC_TYPE_UID_T | |
119 | AC_TYPE_UINT8_T | |
120 | AC_TYPE_UINT16_T | |
121 | AC_TYPE_UINT32_T | |
122 | AC_TYPE_UINT64_T | |
7a197a62 | 123 | AC_CHECK_MEMBERS([struct stat.st_rdev]) |
ad6254c5 AK |
124 | AC_STRUCT_TM |
125 | ||
126 | ################################################################################ | |
127 | dnl -- Check for functions | |
7c9fd3ea | 128 | AC_CHECK_FUNCS([ftruncate gethostname getpagesize \ |
d911ec67 AK |
129 | gettimeofday memset mkdir mkfifo rmdir munmap nl_langinfo setenv setlocale \ |
130 | strcasecmp strchr strcspn strspn strdup strncasecmp strerror strrchr \ | |
131 | strstr strtol strtoul uname], , [AC_MSG_ERROR(bailing out)]) | |
a0f9708e | 132 | AC_CHECK_FUNCS(siginterrupt) |
ad6254c5 AK |
133 | AC_FUNC_ALLOCA |
134 | AC_FUNC_CLOSEDIR_VOID | |
d911ec67 | 135 | AC_FUNC_CHOWN |
ad6254c5 AK |
136 | AC_FUNC_FORK |
137 | AC_FUNC_LSTAT | |
138 | AC_FUNC_MALLOC | |
139 | AC_FUNC_MEMCMP | |
140 | AC_FUNC_MMAP | |
d911ec67 | 141 | AC_FUNC_REALLOC |
ad6254c5 AK |
142 | AC_FUNC_STAT |
143 | AC_FUNC_STRTOD | |
d0191583 | 144 | AC_FUNC_VPRINTF |
80992638 | 145 | |
9c961554 MB |
146 | ################################################################################ |
147 | dnl -- Enables statically-linked tools | |
148 | AC_MSG_CHECKING(whether to use static linking) | |
149 | AC_ARG_ENABLE(static_link, | |
71082be4 ZK |
150 | AC_HELP_STRING([--enable-static_link], |
151 | [use this to link the tools to their libraries | |
152 | statically (default is dynamic linking]), | |
153 | STATIC_LINK=$enableval, STATIC_LINK=no) | |
9c961554 MB |
154 | AC_MSG_RESULT($STATIC_LINK) |
155 | ||
80992638 | 156 | ################################################################################ |
8ce0cbda | 157 | dnl -- Prefix is /usr by default, the exec_prefix default is setup later |
795ca3e5 AK |
158 | AC_PREFIX_DEFAULT(/usr) |
159 | ||
80992638 | 160 | ################################################################################ |
8ce0cbda | 161 | dnl -- Setup the ownership of the files |
ad6254c5 | 162 | AC_MSG_CHECKING(file owner) |
795ca3e5 | 163 | AC_ARG_WITH(user, |
71082be4 ZK |
164 | AC_HELP_STRING([--with-user=USER], |
165 | [set the owner of installed files [[USER=]]]), | |
166 | OWNER=$withval) | |
ad6254c5 | 167 | AC_MSG_RESULT($OWNER) |
a38df97f AK |
168 | |
169 | if test x$OWNER != x; then | |
23b059e7 | 170 | INSTALL="$INSTALL -o $OWNER" |
a38df97f | 171 | fi |
795ca3e5 | 172 | |
80992638 | 173 | ################################################################################ |
8ce0cbda | 174 | dnl -- Setup the group ownership of the files |
ad6254c5 | 175 | AC_MSG_CHECKING(group owner) |
795ca3e5 | 176 | AC_ARG_WITH(group, |
71082be4 ZK |
177 | AC_HELP_STRING([--with-group=GROUP], |
178 | [set the group owner of installed files [[GROUP=]]]), | |
179 | GROUP=$withval) | |
ad6254c5 | 180 | AC_MSG_RESULT($GROUP) |
a38df97f AK |
181 | |
182 | if test x$GROUP != x; then | |
23b059e7 | 183 | INSTALL="$INSTALL -g $GROUP" |
a38df97f | 184 | fi |
795ca3e5 | 185 | |
0782ad50 AK |
186 | ################################################################################ |
187 | dnl -- Setup device node ownership | |
188 | AC_MSG_CHECKING(device node uid) | |
189 | ||
190 | AC_ARG_WITH(device-uid, | |
71082be4 ZK |
191 | AC_HELP_STRING([--with-device-uid=UID], |
192 | [set the owner used for new device nodes [[UID=0]]]), | |
193 | DM_DEVICE_UID=$withval, DM_DEVICE_UID=0) | |
0782ad50 AK |
194 | AC_MSG_RESULT($DM_DEVICE_UID) |
195 | ||
196 | ################################################################################ | |
197 | dnl -- Setup device group ownership | |
198 | AC_MSG_CHECKING(device node gid) | |
199 | ||
200 | AC_ARG_WITH(device-gid, | |
71082be4 ZK |
201 | AC_HELP_STRING([--with-device-gid=GID], |
202 | [set the group used for new device nodes [[GID=0]]]), | |
203 | DM_DEVICE_GID=$withval, DM_DEVICE_GID=0) | |
0782ad50 AK |
204 | AC_MSG_RESULT($DM_DEVICE_GID) |
205 | ||
f6fc418d AK |
206 | ################################################################################ |
207 | dnl -- Setup device mode | |
208 | AC_MSG_CHECKING(device node mode) | |
209 | ||
210 | AC_ARG_WITH(device-mode, | |
71082be4 ZK |
211 | AC_HELP_STRING([--with-device-mode=MODE], |
212 | [set the mode used for new device nodes [[MODE=0600]]]), | |
213 | DM_DEVICE_MODE=$withval, DM_DEVICE_MODE=0600) | |
f6fc418d AK |
214 | AC_MSG_RESULT($DM_DEVICE_MODE) |
215 | ||
80992638 | 216 | ################################################################################ |
7d1552c9 | 217 | dnl -- LVM1 tool fallback option |
ad6254c5 | 218 | AC_MSG_CHECKING(whether to enable lvm1 fallback) |
71082be4 ZK |
219 | AC_ARG_ENABLE(lvm1_fallback, |
220 | AC_HELP_STRING([--enable-lvm1_fallback], | |
221 | [use this to fall back and use LVM1 binaries if | |
222 | device-mapper is missing from the kernel]), | |
223 | LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no) | |
ad6254c5 | 224 | AC_MSG_RESULT($LVM1_FALLBACK) |
7d1552c9 AK |
225 | |
226 | if test x$LVM1_FALLBACK = xyes; then | |
72b2cb61 | 227 | 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 |
228 | fi |
229 | ||
80992638 | 230 | ################################################################################ |
5a52dca9 | 231 | dnl -- format1 inclusion type |
ad6254c5 | 232 | AC_MSG_CHECKING(whether to include support for lvm1 metadata) |
5a52dca9 | 233 | AC_ARG_WITH(lvm1, |
71082be4 ZK |
234 | AC_HELP_STRING([--with-lvm1=TYPE], |
235 | [LVM1 metadata support: internal/shared/none | |
236 | [[TYPE=internal]]]), | |
237 | LVM1=$withval, LVM1=internal) | |
ad6254c5 | 238 | AC_MSG_RESULT($LVM1) |
5a52dca9 AK |
239 | |
240 | if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]]; | |
241 | then AC_MSG_ERROR( | |
242 | --with-lvm1 parameter invalid | |
243 | ) | |
5a52dca9 AK |
244 | fi; |
245 | ||
b896caa1 | 246 | if test x$LVM1 = xinternal; then |
72b2cb61 | 247 | AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.]) |
b896caa1 AK |
248 | fi |
249 | ||
80992638 | 250 | ################################################################################ |
d8ac0fbc | 251 | dnl -- format_pool inclusion type |
ad6254c5 | 252 | AC_MSG_CHECKING(whether to include support for GFS pool metadata) |
d8ac0fbc | 253 | AC_ARG_WITH(pool, |
71082be4 ZK |
254 | AC_HELP_STRING([--with-pool=TYPE], |
255 | [GFS pool read-only support: internal/shared/none | |
256 | [[TYPE=internal]]]), | |
257 | POOL=$withval, POOL=internal) | |
ad6254c5 | 258 | AC_MSG_RESULT($POOL) |
d8ac0fbc AK |
259 | |
260 | if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]]; | |
261 | then AC_MSG_ERROR( | |
262 | --with-pool parameter invalid | |
263 | ) | |
d8ac0fbc AK |
264 | fi; |
265 | ||
266 | if test x$POOL = xinternal; then | |
72b2cb61 | 267 | AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.]) |
d8ac0fbc AK |
268 | fi |
269 | ||
80992638 | 270 | ################################################################################ |
d3c8211f | 271 | dnl -- cluster_locking inclusion type |
ad6254c5 | 272 | AC_MSG_CHECKING(whether to include support for cluster locking) |
d3c8211f | 273 | AC_ARG_WITH(cluster, |
71082be4 ZK |
274 | AC_HELP_STRING([--with-cluster=TYPE], |
275 | [cluster LVM locking support: internal/shared/none | |
276 | [[TYPE=internal]]]), | |
277 | CLUSTER=$withval) | |
ad6254c5 | 278 | AC_MSG_RESULT($CLUSTER) |
d3c8211f AK |
279 | |
280 | if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]]; | |
281 | then AC_MSG_ERROR( | |
282 | --with-cluster parameter invalid | |
283 | ) | |
d3c8211f AK |
284 | fi; |
285 | ||
286 | if test x$CLUSTER = xinternal; then | |
72b2cb61 | 287 | AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.]) |
d3c8211f | 288 | fi |
d8ac0fbc | 289 | |
80992638 | 290 | ################################################################################ |
4922197a | 291 | dnl -- snapshots inclusion type |
ad6254c5 | 292 | AC_MSG_CHECKING(whether to include snapshots) |
4922197a | 293 | AC_ARG_WITH(snapshots, |
71082be4 ZK |
294 | AC_HELP_STRING([--with-snapshots=TYPE], |
295 | [snapshot support: internal/shared/none | |
296 | [[TYPE=internal]]]), | |
297 | SNAPSHOTS=$withval, SNAPSHOTS=internal) | |
ad6254c5 | 298 | AC_MSG_RESULT($SNAPSHOTS) |
4922197a AK |
299 | |
300 | if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]]; | |
301 | then AC_MSG_ERROR( | |
302 | --with-snapshots parameter invalid | |
303 | ) | |
4922197a AK |
304 | fi; |
305 | ||
306 | if test x$SNAPSHOTS = xinternal; then | |
72b2cb61 | 307 | AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.]) |
4922197a AK |
308 | fi |
309 | ||
80992638 | 310 | ################################################################################ |
4922197a | 311 | dnl -- mirrors inclusion type |
ad6254c5 | 312 | AC_MSG_CHECKING(whether to include mirrors) |
4922197a | 313 | AC_ARG_WITH(mirrors, |
71082be4 ZK |
314 | AC_HELP_STRING([--with-mirrors=TYPE], |
315 | [mirror support: internal/shared/none | |
316 | [[TYPE=internal]]]), | |
317 | MIRRORS=$withval, MIRRORS=internal) | |
ad6254c5 | 318 | AC_MSG_RESULT($MIRRORS) |
4922197a AK |
319 | |
320 | if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]]; | |
321 | then AC_MSG_ERROR( | |
322 | --with-mirrors parameter invalid | |
323 | ) | |
4922197a AK |
324 | fi; |
325 | ||
326 | if test x$MIRRORS = xinternal; then | |
72b2cb61 | 327 | AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.]) |
4922197a AK |
328 | fi |
329 | ||
8fea97b7 ZK |
330 | ################################################################################ |
331 | dnl -- asynchronous volume replicator inclusion type | |
332 | AC_MSG_CHECKING(whether to include replicators) | |
71082be4 ZK |
333 | AC_ARG_WITH(replicators, |
334 | AC_HELP_STRING([--with-replicators=TYPE], | |
335 | [replicator support: internal/shared/none | |
336 | [[TYPE=none]]]), | |
337 | REPLICATORS=$withval, REPLICATORS=none) | |
8fea97b7 ZK |
338 | AC_MSG_RESULT($REPLICATORS) |
339 | ||
340 | case "$REPLICATORS" in | |
341 | none|shared) ;; | |
342 | internal) AC_DEFINE([REPLICATOR_INTERNAL], 1, | |
343 | [Define to 1 to include built-in support for replicators.]) ;; | |
344 | *) AC_MSG_ERROR([--with-replicators parameter invalid ($REPLICATORS)]) ;; | |
345 | esac | |
346 | ||
80992638 | 347 | ################################################################################ |
1b523347 | 348 | dnl -- Disable readline |
ad6254c5 | 349 | AC_MSG_CHECKING(whether to enable readline) |
2c189a57 | 350 | AC_ARG_ENABLE([readline], |
71082be4 ZK |
351 | AC_HELP_STRING([--disable-readline], [disable readline support]), |
352 | READLINE=$enableval, READLINE=maybe) | |
ad6254c5 | 353 | AC_MSG_RESULT($READLINE) |
795ca3e5 | 354 | |
8b1a3214 AK |
355 | ################################################################################ |
356 | dnl -- Disable realtime clock support | |
357 | AC_MSG_CHECKING(whether to enable realtime support) | |
71082be4 ZK |
358 | AC_ARG_ENABLE(realtime, |
359 | AC_HELP_STRING([--enable-realtime], [enable realtime clock support]), | |
360 | REALTIME=$enableval) | |
8b1a3214 AK |
361 | AC_MSG_RESULT($REALTIME) |
362 | ||
e40d44be ZK |
363 | ################################################################################ |
364 | dnl -- disable OCF resource agents | |
365 | AC_MSG_CHECKING(whether to enable OCF resource agents) | |
366 | AC_ARG_ENABLE(ocf, | |
367 | AC_HELP_STRING([--enable-ocf], | |
368 | [enable Open Cluster Framework (OCF) compliant resource agents]), | |
369 | OCF=$enableval, OCF=no) | |
370 | AC_MSG_RESULT($OCF) | |
349da06c ZK |
371 | AC_ARG_WITH(ocfdir, |
372 | AC_HELP_STRING([--with-ocfdir=DIR], | |
373 | [install OCF files in DIR [[PREFIX/lib/ocf/resource.d/lvm2]]]), | |
374 | OCFDIR=$withval, OCFDIR='${prefix}/lib/ocf/resource.d/lvm2') | |
e40d44be | 375 | |
90c80887 AK |
376 | ################################################################################ |
377 | dnl -- Init pkg-config with dummy invokation: | |
378 | dnl -- this is required because PKG_CHECK_MODULES macro is expanded | |
379 | dnl -- to initialize the pkg-config environment only at the first invokation, | |
380 | dnl -- that would be conditional in this configure.in. | |
381 | pkg_config_init() { | |
382 | PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [], | |
383 | [AC_MSG_RESULT([pkg-config initialized])]) | |
384 | PKGCONFIG_INIT=1 | |
385 | } | |
386 | ||
80992638 | 387 | ################################################################################ |
8ce0cbda | 388 | dnl -- Build cluster LVM daemon |
ad6254c5 | 389 | AC_MSG_CHECKING(whether to build cluster LVM daemon) |
a266258f | 390 | AC_ARG_WITH(clvmd, |
71082be4 | 391 | [ --with-clvmd=TYPE build cluster LVM Daemon |
8c222979 | 392 | The following cluster manager combinations are valid: |
a946372e AK |
393 | * cman,gulm (RHEL4 or equivalent) |
394 | * cman (RHEL5 or equivalent) | |
395 | * cman,corosync,openais (or selection of them) | |
649c4507 | 396 | * singlenode (localhost only) |
a946372e AK |
397 | * all (autodetect) |
398 | * none (disable build) | |
71082be4 ZK |
399 | [[TYPE=none]]], |
400 | CLVMD=$withval, CLVMD=none) | |
a266258f | 401 | if test x$CLVMD = xyes; then |
5c7fc7c4 | 402 | CLVMD=all |
b1098701 | 403 | fi |
ad6254c5 | 404 | AC_MSG_RESULT($CLVMD) |
80992638 | 405 | |
8ce0cbda | 406 | dnl -- If clvmd enabled without cluster locking, automagically include it |
a266258f | 407 | if test x$CLVMD != xnone && test x$CLUSTER = xnone; then |
d3c8211f AK |
408 | CLUSTER=internal |
409 | fi | |
d3c8211f | 410 | |
90c80887 | 411 | dnl -- init pkgconfig if required |
34b6075d | 412 | if test x$CLVMD != xnone && test x$PKGCONFIG_INIT != x1; then |
90c80887 AK |
413 | pkg_config_init |
414 | fi | |
415 | ||
34b6075d FDN |
416 | dnl -- Express clvmd init script Required-Start / Required-Stop |
417 | CLVMD_CMANAGERS="" | |
418 | dnl -- On RHEL4/RHEL5, qdiskd is started from a separate init script. | |
419 | dnl -- Enable if we are build for either cman or gulm. | |
420 | CLVMD_NEEDS_QDISKD=no | |
90c80887 | 421 | |
a946372e AK |
422 | dnl -- define build types |
423 | if [[ `expr x"$CLVMD" : '.*gulm.*'` != 0 ]]; then | |
424 | BUILDGULM=yes | |
34b6075d FDN |
425 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS lock_gulmd" |
426 | CLVMD_NEEDS_QDISKD=yes | |
427 | fi | |
428 | if [[ `expr x"$CLVMD" : '.*cman.*'` != 0 ]]; then | |
429 | BUILDCMAN=yes | |
430 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman" | |
431 | CLVMD_NEEDS_QDISKD=yes | |
a946372e AK |
432 | fi |
433 | if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then | |
434 | BUILDCOROSYNC=yes | |
34b6075d | 435 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync" |
a946372e AK |
436 | fi |
437 | if [[ `expr x"$CLVMD" : '.*openais.*'` != 0 ]]; then | |
438 | BUILDOPENAIS=yes | |
34b6075d | 439 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais" |
a946372e | 440 | fi |
34b6075d FDN |
441 | if test x$CLVMD_NEEDS_QDISKD != xno; then |
442 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd" | |
a946372e AK |
443 | fi |
444 | ||
445 | dnl -- sanity check around user selection | |
446 | if test x$BUILDGULM = xyes; then | |
447 | if test x$BUILDCOROSYNC = xyes || \ | |
448 | test x$BUILDOPENAIS = xyes; then | |
449 | AC_MSG_ERROR([requested clvmd configuration is not valid]) | |
450 | fi | |
451 | fi | |
452 | ||
a946372e AK |
453 | dnl -- define a soft bailout if we are autodetecting |
454 | soft_bailout() { | |
455 | NOTFOUND=1 | |
456 | } | |
457 | ||
458 | hard_bailout() { | |
459 | AC_MSG_ERROR([bailing out]) | |
460 | } | |
461 | ||
462 | dnl -- if clvmd=all then set soft_bailout (we don't want to error) | |
463 | dnl -- and set all builds to yes. We need to do this here | |
464 | dnl -- to skip the gulm + openais|corosync sanity check above. | |
465 | if test x$CLVMD = xall; then | |
466 | bailout=soft_bailout | |
467 | BUILDGULM=yes | |
468 | BUILDCMAN=yes | |
469 | BUILDCOROSYNC=yes | |
470 | BUILDOPENAIS=yes | |
471 | else | |
472 | bailout=hard_bailout | |
473 | fi | |
474 | ||
475 | dnl -- helper macro to check libs without adding them to LIBS | |
476 | check_lib_no_libs() { | |
477 | lib_no_libs_arg1=$1 | |
478 | shift | |
479 | lib_no_libs_arg2=$1 | |
480 | shift | |
481 | lib_no_libs_args=$@ | |
482 | AC_CHECK_LIB([$lib_no_libs_arg1], | |
483 | [$lib_no_libs_arg2],, | |
484 | [$bailout], | |
485 | [$lib_no_libs_args]) | |
486 | LIBS=$ac_check_lib_save_LIBS | |
487 | } | |
488 | ||
489 | dnl -- Look for gulm libraries if required. | |
490 | if test x$BUILDGULM = xyes; then | |
491 | PKG_CHECK_MODULES(CCS, libccs, [HAVE_CCS=yes], | |
492 | [NOTFOUND=0 | |
493 | AC_CHECK_HEADERS(ccs.h,,$bailout) | |
494 | check_lib_no_libs ccs ccs_connect | |
495 | if test $NOTFOUND = 0; then | |
496 | AC_MSG_RESULT([no pkg for libccs, using -lccs]) | |
497 | CCS_LIBS="-lccs" | |
498 | HAVE_CCS=yes | |
499 | fi]) | |
500 | PKG_CHECK_MODULES(GULM, libgulm, [HAVE_GULM=yes], | |
501 | [NOTFOUND=0 | |
502 | AC_CHECK_HEADERS(libgulm.h,,$bailout) | |
503 | check_lib_no_libs gulm lg_core_login | |
504 | if test $NOTFOUND = 0; then | |
505 | AC_MSG_RESULT([no pkg for libgulm, using -lgulm]) | |
506 | GULM_LIBS="-lgulm" | |
507 | HAVE_GULM=yes | |
508 | fi]) | |
509 | fi | |
510 | ||
511 | dnl -- Look for cman libraries if required. | |
512 | if test x$BUILDCMAN = xyes; then | |
513 | PKG_CHECK_MODULES(CMAN, libcman, [HAVE_CMAN=yes], | |
514 | [NOTFOUND=0 | |
515 | AC_CHECK_HEADERS(libcman.h,,$bailout) | |
516 | check_lib_no_libs cman cman_init | |
517 | if test $NOTFOUND = 0; then | |
518 | AC_MSG_RESULT([no pkg for libcman, using -lcman]) | |
519 | CMAN_LIBS="-lcman" | |
520 | HAVE_CMAN=yes | |
521 | fi]) | |
522 | CHECKCONFDB=yes | |
523 | CHECKDLM=yes | |
524 | fi | |
525 | ||
526 | dnl -- Look for corosync that's required also for openais build | |
527 | dnl -- only enough recent version of corosync ship pkg-config files. | |
528 | dnl -- We can safely rely on that to detect the correct bits. | |
529 | if test x$BUILDCOROSYNC = xyes || \ | |
530 | test x$BUILDOPENAIS = xyes; then | |
531 | PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout) | |
532 | CHECKCONFDB=yes | |
533 | fi | |
534 | ||
edf47283 | 535 | dnl -- Look for corosync libraries if required. |
a946372e AK |
536 | if test x$BUILDCOROSYNC = xyes; then |
537 | PKG_CHECK_MODULES(QUORUM, libquorum, [HAVE_QUORUM=yes], $bailout) | |
538 | CHECKCPG=yes | |
539 | CHECKDLM=yes | |
540 | fi | |
541 | ||
542 | dnl -- Look for openais libraries if required. | |
543 | if test x$BUILDOPENAIS = xyes; then | |
544 | PKG_CHECK_MODULES(SALCK, libSaLck, [HAVE_SALCK=yes], $bailout) | |
545 | CHECKCPG=yes | |
546 | fi | |
547 | ||
548 | dnl -- Below are checks for libraries common to more than one build. | |
549 | ||
550 | dnl -- Check confdb library. | |
551 | dnl -- mandatory for corosync build. | |
552 | dnl -- optional for openais/cman build. | |
553 | ||
554 | if test x$CHECKCONFDB = xyes; then | |
555 | PKG_CHECK_MODULES(CONFDB, libconfdb, | |
556 | [HAVE_CONFDB=yes], | |
557 | [HAVE_CONFDB=no]) | |
558 | ||
559 | AC_CHECK_HEADERS(corosync/confdb.h, | |
560 | [HAVE_CONFDB_H=yes], | |
561 | [HAVE_CONFDB_H=no]) | |
562 | ||
563 | if test x$HAVE_CONFDB != xyes && \ | |
564 | test x$HAVE_CONFDB_H = xyes; then | |
565 | check_lib_no_libs confdb confdb_initialize | |
566 | AC_MSG_RESULT([no pkg for confdb, using -lconfdb]) | |
567 | CONFDB_LIBS="-lconfdb" | |
568 | HAVE_CONFDB=yes | |
569 | fi | |
570 | ||
571 | if test x$BUILDCOROSYNC = xyes && \ | |
572 | test x$HAVE_CONFDB != xyes && | |
573 | test x$CLVMD != xall; then | |
574 | AC_MSG_ERROR([bailing out... confdb library is required]) | |
575 | fi | |
576 | fi | |
577 | ||
578 | dnl -- Check cpg library. | |
579 | if test x$CHECKCPG = xyes; then | |
580 | PKG_CHECK_MODULES(CPG, libcpg, [HAVE_CPG=yes], $bailout) | |
581 | fi | |
582 | ||
583 | dnl -- Check dlm library. | |
584 | if test x$CHECKDLM = xyes; then | |
585 | PKG_CHECK_MODULES(DLM, libdlm, [HAVE_DLM=yes], | |
586 | [NOTFOUND=0 | |
587 | AC_CHECK_HEADERS(libdlm.h,,$bailout) | |
588 | check_lib_no_libs dlm dlm_lock -lpthread | |
589 | if test $NOTFOUND = 0; then | |
590 | AC_MSG_RESULT([no pkg for libdlm, using -ldlm]) | |
591 | DLM_LIBS="-ldlm -lpthread" | |
592 | HAVE_DLM=yes | |
593 | fi]) | |
594 | fi | |
595 | ||
596 | dnl -- If we are autodetecting, we need to re-create | |
34b6075d FDN |
597 | dnl -- the depedencies checks and set a proper CLVMD, |
598 | dnl -- together with init script Required-Start/Stop entries. | |
a946372e | 599 | if test x$CLVMD = xall; then |
8c222979 | 600 | CLVMD=none |
34b6075d FDN |
601 | CLVMD_CMANAGERS="" |
602 | CLVMD_NEEDS_QDISKD=no | |
a946372e AK |
603 | if test x$HAVE_CCS = xyes && \ |
604 | test x$HAVE_GULM = xyes; then | |
8c222979 FDN |
605 | AC_MSG_RESULT([Enabling clvmd gulm cluster manager]) |
606 | CLVMD="$CLVMD,gulm" | |
34b6075d FDN |
607 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS lock_gulmd" |
608 | CLVMD_NEEDS_QDISKD=yes | |
a946372e AK |
609 | fi |
610 | if test x$HAVE_CMAN = xyes && \ | |
611 | test x$HAVE_DLM = xyes; then | |
8c222979 FDN |
612 | AC_MSG_RESULT([Enabling clvmd cman cluster manager]) |
613 | CLVMD="$CLVMD,cman" | |
34b6075d FDN |
614 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman" |
615 | CLVMD_NEEDS_QDISKD=yes | |
a946372e AK |
616 | fi |
617 | if test x$HAVE_COROSYNC = xyes && \ | |
618 | test x$HAVE_QUORUM = xyes && \ | |
619 | test x$HAVE_CPG = xyes && \ | |
620 | test x$HAVE_DLM = xyes && \ | |
621 | test x$HAVE_CONFDB = xyes; then | |
8c222979 FDN |
622 | AC_MSG_RESULT([Enabling clvmd corosync cluster manager]) |
623 | CLVMD="$CLVMD,corosync" | |
34b6075d | 624 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync" |
a946372e AK |
625 | fi |
626 | if test x$HAVE_COROSYNC = xyes && \ | |
627 | test x$HAVE_CPG = xyes && \ | |
628 | test x$HAVE_SALCK = xyes; then | |
8c222979 FDN |
629 | AC_MSG_RESULT([Enabling clvmd openais cluster manager]) |
630 | CLVMD="$CLVMD,openais" | |
34b6075d FDN |
631 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais" |
632 | fi | |
633 | if test x$CLVMD_NEEDS_QDISKD != xno; then | |
634 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd" | |
8c222979 FDN |
635 | fi |
636 | if test x$CLVMD = xnone; then | |
637 | AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.]) | |
a946372e | 638 | fi |
edf47283 AK |
639 | fi |
640 | ||
8c4e8a18 FDN |
641 | ################################################################################ |
642 | dnl -- clvmd pidfile | |
643 | if test "x$CLVMD" != xnone; then | |
644 | AC_ARG_WITH(clvmd-pidfile, | |
645 | AC_HELP_STRING([--with-clvmd-pidfile=PATH], | |
646 | [clvmd pidfile [[/var/run/clvmd.pid]]]), | |
647 | CLVMD_PIDFILE=$withval, | |
648 | CLVMD_PIDFILE="/var/run/clvmd.pid") | |
649 | AC_DEFINE_UNQUOTED(CLVMD_PIDFILE, ["$CLVMD_PIDFILE"], | |
650 | [Path to clvmd pidfile.]) | |
651 | fi | |
652 | ||
3c14bcca | 653 | ################################################################################ |
66fd4529 AK |
654 | dnl -- Build cluster mirror log daemon |
655 | AC_MSG_CHECKING(whether to build cluster mirror log daemon) | |
71082be4 ZK |
656 | AC_ARG_ENABLE(cmirrord, |
657 | AC_HELP_STRING([--enable-cmirrord], | |
658 | [enable the cluster mirror log daemon]), | |
659 | CMIRRORD=$enableval, CMIRRORD=no) | |
66fd4529 | 660 | AC_MSG_RESULT($CMIRRORD) |
3c14bcca | 661 | |
66fd4529 AK |
662 | BUILD_CMIRRORD=$CMIRRORD |
663 | ||
664 | ################################################################################ | |
665 | dnl -- cmirrord pidfile | |
66fd4529 AK |
666 | if test "x$BUILD_CMIRRORD" = xyes; then |
667 | AC_ARG_WITH(cmirrord-pidfile, | |
71082be4 ZK |
668 | AC_HELP_STRING([--with-cmirrord-pidfile=PATH], |
669 | [cmirrord pidfile [[/var/run/cmirrord.pid]]]), | |
670 | CMIRRORD_PIDFILE=$withval, | |
671 | CMIRRORD_PIDFILE="/var/run/cmirrord.pid") | |
672 | AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE, ["$CMIRRORD_PIDFILE"], | |
673 | [Path to cmirrord pidfile.]) | |
66fd4529 AK |
674 | fi |
675 | ||
676 | ################################################################################ | |
3c14bcca | 677 | dnl -- Look for corosync libraries if required. |
66fd4529 | 678 | if [[ "x$BUILD_CMIRRORD" = xyes ]]; then |
90c80887 AK |
679 | dnl -- init pkgconfig if required |
680 | if test x$PKGCONFIG_INIT != x1; then | |
681 | pkg_config_init | |
682 | fi | |
683 | PKG_CHECK_MODULES(SACKPT, libSaCkpt) | |
684 | if test x$HAVE_CPG != xyes; then | |
685 | PKG_CHECK_MODULES(CPG, libcpg) | |
686 | fi | |
3c14bcca JEB |
687 | fi |
688 | ||
80992638 | 689 | ################################################################################ |
8ce0cbda | 690 | dnl -- Enable debugging |
ad6254c5 | 691 | AC_MSG_CHECKING(whether to enable debugging) |
71082be4 ZK |
692 | AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debugging]), |
693 | DEBUG=$enableval, DEBUG=no) | |
ad6254c5 | 694 | AC_MSG_RESULT($DEBUG) |
8ef2b021 | 695 | |
8ce0cbda AK |
696 | dnl -- Normally turn off optimisation for debug builds |
697 | if test x$DEBUG = xyes; then | |
698 | COPTIMISE_FLAG= | |
8a2fc586 AK |
699 | else |
700 | CSCOPE_CMD= | |
8ce0cbda AK |
701 | fi |
702 | ||
703 | ################################################################################ | |
704 | dnl -- Override optimisation | |
ad6254c5 | 705 | AC_MSG_CHECKING(for C optimisation flag) |
8ce0cbda | 706 | AC_ARG_WITH(optimisation, |
71082be4 ZK |
707 | AC_HELP_STRING([--with-optimisation=OPT], |
708 | [C optimisation flag [[OPT=-O2]]]), | |
709 | COPTIMISE_FLAG=$withval) | |
ad6254c5 | 710 | AC_MSG_RESULT($COPTIMISE_FLAG) |
8ce0cbda | 711 | |
fddafd51 ZK |
712 | ################################################################################ |
713 | dnl -- Enable profiling | |
5556819a | 714 | AC_MSG_CHECKING(whether to gather gcov profiling data) |
fddafd51 | 715 | AC_ARG_ENABLE(profiling, |
71082be4 ZK |
716 | AC_HELP_STRING(--enable-profiling, [gather gcov profiling data]), |
717 | PROFILING=$enableval, PROFILING=no) | |
5556819a AK |
718 | AC_MSG_RESULT($PROFILING) |
719 | ||
720 | if test "x$PROFILING" = xyes; then | |
721 | COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage" | |
fd4728e1 ZK |
722 | AC_PATH_PROG(LCOV, lcov) |
723 | AC_PATH_PROG(GENHTML, genhtml) | |
724 | if test -z "$LCOV" -o -z "$GENHTML"; then | |
b145d876 ZK |
725 | AC_MSG_ERROR([lcov and genhtml are required for profiling]) |
726 | fi | |
fd4728e1 ZK |
727 | AC_PATH_PROG(GENPNG, genpng) |
728 | if test -n "$GENPNG"; then | |
729 | AC_MSG_CHECKING([whether $GENPNG has all required modules]) | |
730 | if $GENPNG --help > /dev/null 2>&1 ; then | |
731 | AC_MSG_RESULT(ok) | |
732 | GENHTML="$GENHTML --frames" | |
733 | else | |
734 | AC_MSG_RESULT(not supported) | |
735 | AC_MSG_WARN([GD.pm perl module is not installed]) | |
736 | GENPNG= | |
737 | fi | |
738 | fi | |
5556819a | 739 | fi |
fddafd51 | 740 | |
1033d120 JT |
741 | ################################################################################ |
742 | dnl -- Enable testing | |
743 | AC_MSG_CHECKING(whether to enable unit testing) | |
744 | AC_ARG_ENABLE(testing, | |
745 | AC_HELP_STRING(--enable-testing, [enable testing targets in the makefile]), | |
746 | TESTING=$enableval, TESTING=no) | |
747 | AC_MSG_RESULT($TESTING) | |
748 | ||
749 | if test "$TESTING" = yes; then | |
750 | AC_PATH_PROG(RUBY19, ruby1.9) | |
751 | AC_PATH_PROG(VALGRIND, valgrind) | |
752 | if test -z "$RUBY19" -o -z "$VALGRIND"; then | |
753 | AC_MSG_ERROR([ruby1.9 and valgrind are required for testing]) | |
754 | fi | |
755 | fi | |
756 | ||
52e1564f JT |
757 | ################################################################################ |
758 | dnl -- Enable valgrind awareness of memory pools | |
759 | AC_MSG_CHECKING(whether to enable valgrind awareness of pools) | |
760 | AC_ARG_ENABLE(valgrind_pool, | |
761 | AC_HELP_STRING(--enable-valgrind-pool, [enable valgrind awareness of pools]), | |
762 | VALGRIND_POOL=$enableval, VALGRIND_POOL=no) | |
763 | AC_MSG_RESULT($VALGRIND_POOL) | |
764 | ||
765 | if test "$VALGRIND_POOL" = yes; then | |
766 | AC_CHECK_HEADERS([valgrind/memcheck.h], , [AC_MSG_ERROR(bailing out)]) | |
767 | AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool]) | |
768 | fi | |
769 | ||
80992638 | 770 | ################################################################################ |
8ce0cbda | 771 | dnl -- Disable devmapper |
ad6254c5 | 772 | AC_MSG_CHECKING(whether to use device-mapper) |
71082be4 ZK |
773 | AC_ARG_ENABLE(devmapper, |
774 | AC_HELP_STRING([--disable-devmapper], | |
775 | [disable LVM2 device-mapper interaction]), | |
776 | DEVMAPPER=$enableval) | |
ad6254c5 | 777 | AC_MSG_RESULT($DEVMAPPER) |
199e490e | 778 | |
b896caa1 | 779 | if test x$DEVMAPPER = xyes; then |
f6fc418d | 780 | AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.]) |
b896caa1 AK |
781 | fi |
782 | ||
5d518f1f AK |
783 | ################################################################################ |
784 | dnl -- Enable udev synchronisation | |
785 | AC_MSG_CHECKING(whether to enable synchronisation with udev processing) | |
71082be4 ZK |
786 | AC_ARG_ENABLE(udev_sync, |
787 | AC_HELP_STRING([--enable-udev_sync], | |
788 | [enable synchronisation with udev processing]), | |
789 | UDEV_SYNC=$enableval, UDEV_SYNC=no) | |
5d518f1f AK |
790 | AC_MSG_RESULT($UDEV_SYNC) |
791 | ||
792 | if test x$UDEV_SYNC = xyes; then | |
f7f0854e ZK |
793 | AC_CHECK_LIB(udev, udev_queue_get_udev_is_active, |
794 | [UDEV_PC="libudev"; UDEV_LIBS="-ludev"], | |
795 | [AC_MSG_ERROR([bailing out... libudev library is required])]) | |
5d518f1f AK |
796 | AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.]) |
797 | fi | |
798 | ||
799 | dnl -- Enable udev rules | |
800 | AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation) | |
71082be4 ZK |
801 | AC_ARG_ENABLE(udev_rules, |
802 | AC_HELP_STRING([--enable-udev_rules], | |
803 | [install rule files needed for udev synchronisation]), | |
804 | UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC) | |
5d518f1f AK |
805 | AC_MSG_RESULT($UDEV_RULES) |
806 | ||
f6fc418d AK |
807 | ################################################################################ |
808 | dnl -- Compatibility mode | |
71082be4 ZK |
809 | AC_ARG_ENABLE(compat, |
810 | AC_HELP_STRING([--enable-compat], | |
811 | [enable support for old device-mapper versions]), | |
812 | DM_COMPAT=$enableval, DM_COMPAT=no) | |
f6fc418d | 813 | |
95eaa683 AK |
814 | ################################################################################ |
815 | dnl -- Compatible units suffix mode | |
816 | AC_ARG_ENABLE(units-compat, | |
71082be4 ZK |
817 | AC_HELP_STRING([--enable-units-compat], |
818 | [enable output compatibility with old versions that | |
819 | that do not use KiB-style unit suffixes]), | |
820 | UNITS_COMPAT=$enableval, UNITS_COMPAT=no) | |
95eaa683 AK |
821 | |
822 | if test x$UNITS_COMPAT = xyes; then | |
823 | AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.]) | |
824 | fi | |
825 | ||
f6fc418d AK |
826 | ################################################################################ |
827 | dnl -- Disable ioctl | |
71082be4 ZK |
828 | AC_ARG_ENABLE(ioctl, |
829 | AC_HELP_STRING([--disable-driver], | |
830 | [disable calls to device-mapper in the kernel]), | |
831 | DM_IOCTLS=$enableval) | |
f6fc418d | 832 | |
80992638 | 833 | ################################################################################ |
8ce0cbda | 834 | dnl -- Disable O_DIRECT |
ad6254c5 | 835 | AC_MSG_CHECKING(whether to enable O_DIRECT) |
71082be4 ZK |
836 | AC_ARG_ENABLE(o_direct, |
837 | AC_HELP_STRING([--disable-o_direct], [disable O_DIRECT]), | |
838 | ODIRECT=$enableval) | |
ad6254c5 | 839 | AC_MSG_RESULT($ODIRECT) |
2dc95e1c AK |
840 | |
841 | if test x$ODIRECT = xyes; then | |
72b2cb61 | 842 | AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.]) |
2dc95e1c AK |
843 | fi |
844 | ||
572fefeb AK |
845 | ################################################################################ |
846 | dnl -- Enable liblvm2app.so | |
847 | AC_MSG_CHECKING(whether to build liblvm2app.so application library) | |
848 | AC_ARG_ENABLE(applib, | |
71082be4 ZK |
849 | AC_HELP_STRING([--enable-applib], [build application library]), |
850 | APPLIB=$enableval, APPLIB=no) | |
572fefeb AK |
851 | AC_MSG_RESULT($APPLIB) |
852 | AC_SUBST([LVM2APP_LIB]) | |
853 | test x$APPLIB = xyes \ | |
854 | && LVM2APP_LIB=-llvm2app \ | |
855 | || LVM2APP_LIB= | |
856 | ||
80992638 | 857 | ################################################################################ |
8ce0cbda | 858 | dnl -- Enable cmdlib |
ad6254c5 | 859 | AC_MSG_CHECKING(whether to compile liblvm2cmd.so) |
71082be4 ZK |
860 | AC_ARG_ENABLE(cmdlib, |
861 | AC_HELP_STRING([--enable-cmdlib], [build shared command library]), | |
862 | CMDLIB=$enableval, CMDLIB=no) | |
ad6254c5 | 863 | AC_MSG_RESULT($CMDLIB) |
aa4d1e31 | 864 | AC_SUBST([LVM2CMD_LIB]) |
2a9a80c9 | 865 | test x$CMDLIB = xyes \ |
aa4d1e31 JM |
866 | && LVM2CMD_LIB=-llvm2cmd \ |
867 | || LVM2CMD_LIB= | |
8106cdd5 | 868 | |
f6fc418d AK |
869 | ################################################################################ |
870 | dnl -- Enable pkg-config | |
71082be4 ZK |
871 | AC_ARG_ENABLE(pkgconfig, |
872 | AC_HELP_STRING([--enable-pkgconfig], [install pkgconfig support]), | |
873 | PKGCONFIG=$enableval, PKGCONFIG=no) | |
2a9a80c9 | 874 | |
23b059e7 ZK |
875 | ################################################################################ |
876 | dnl -- Enable installation of writable files by user | |
71082be4 ZK |
877 | AC_ARG_ENABLE(write_install, |
878 | AC_HELP_STRING([--enable-write_install], | |
879 | [install user writable files]), | |
880 | WRITE_INSTALL=$enableval, WRITE_INSTALL=no) | |
23b059e7 | 881 | |
80992638 | 882 | ################################################################################ |
8ce0cbda | 883 | dnl -- Enable fsadm |
1995c9ff | 884 | AC_MSG_CHECKING(whether to install fsadm) |
71082be4 ZK |
885 | AC_ARG_ENABLE(fsadm, AC_HELP_STRING([--disable-fsadm], [disable fsadm]), |
886 | FSADM=$enableval) | |
ad6254c5 | 887 | AC_MSG_RESULT($FSADM) |
809fae91 | 888 | |
06f62ad1 AK |
889 | ################################################################################ |
890 | dnl -- enable dmeventd handling | |
891 | AC_MSG_CHECKING(whether to use dmeventd) | |
71082be4 ZK |
892 | AC_ARG_ENABLE(dmeventd, AC_HELP_STRING([--enable-dmeventd], |
893 | [enable the device-mapper event daemon]), | |
894 | DMEVENTD=$enableval) | |
06f62ad1 AK |
895 | AC_MSG_RESULT($DMEVENTD) |
896 | ||
f6fc418d AK |
897 | BUILD_DMEVENTD=$DMEVENTD |
898 | ||
06f62ad1 | 899 | dnl -- dmeventd currently requires internal mirror support |
2a9a80c9 PR |
900 | if test x$DMEVENTD = xyes; then |
901 | if test x$MIRRORS != xinternal; then | |
902 | AC_MSG_ERROR( | |
903 | --enable-dmeventd currently requires --with-mirrors=internal | |
904 | ) | |
905 | fi | |
906 | if test x$CMDLIB = xno; then | |
907 | AC_MSG_ERROR( | |
908 | --enable-dmeventd requires --enable-cmdlib to be used as well | |
909 | ) | |
910 | fi | |
06f62ad1 AK |
911 | fi |
912 | ||
15d91f5a | 913 | if test x$DMEVENTD = xyes; then |
72b2cb61 | 914 | AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.]) |
15d91f5a | 915 | fi |
f6fc418d AK |
916 | |
917 | ################################################################################ | |
918 | dnl -- getline included in recent libc | |
919 | ||
920 | AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1, | |
921 | [Define to 1 if getline is available.])) | |
922 | ||
923 | ################################################################################ | |
924 | dnl -- canonicalize_file_name included in recent libc | |
925 | ||
926 | AC_CHECK_LIB(c, canonicalize_file_name, | |
927 | AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1, | |
928 | [Define to 1 if canonicalize_file_name is available.])) | |
929 | ||
80992638 | 930 | ################################################################################ |
d0191583 | 931 | dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin |
795ca3e5 AK |
932 | if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]]; |
933 | then exec_prefix=""; | |
934 | fi; | |
935 | ||
80992638 | 936 | ################################################################################ |
8ce0cbda | 937 | dnl -- Check for dlopen |
19a2c6e0 | 938 | AC_CHECK_LIB(dl, dlopen, [ |
72b2cb61 | 939 | AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.]) |
19a2c6e0 ZK |
940 | DL_LIBS="-ldl" |
941 | HAVE_LIBDL=yes ], [ | |
942 | DL_LIBS= | |
943 | HAVE_LIBDL=no ]) | |
26e7f2e0 | 944 | |
80992638 | 945 | ################################################################################ |
8ce0cbda | 946 | dnl -- Check for shared/static conflicts |
80992638 AK |
947 | if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \ |
948 | -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \ | |
4922197a | 949 | \) -a "x$STATIC_LINK" = xyes ]]; |
d68a82ec | 950 | then AC_MSG_ERROR( |
036f273a | 951 | Features cannot be 'shared' when building statically |
d68a82ec | 952 | ) |
036f273a AK |
953 | fi |
954 | ||
f30875db ZK |
955 | ################################################################################ |
956 | if [[ "$DMEVENTD" = yes -o "$CLVMD" != none ]] ; then | |
957 | AC_CHECK_LIB([pthread], [pthread_mutex_lock], | |
958 | [PTHREAD_LIBS="-lpthread"], hard_bailout) | |
959 | fi | |
960 | ||
d0191583 JM |
961 | ################################################################################ |
962 | dnl -- Disable selinux | |
963 | AC_MSG_CHECKING(whether to enable selinux support) | |
71082be4 ZK |
964 | AC_ARG_ENABLE(selinux, |
965 | AC_HELP_STRING([--disable-selinux], [disable selinux support]), | |
966 | SELINUX=$enableval) | |
d0191583 JM |
967 | AC_MSG_RESULT($SELINUX) |
968 | ||
80992638 | 969 | ################################################################################ |
8a2fc586 | 970 | dnl -- Check for selinux |
80992638 | 971 | if test x$SELINUX = xyes; then |
f8f6ec92 ZK |
972 | AC_CHECK_LIB([sepol], [sepol_check_context], [ |
973 | AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.]) | |
974 | SELINUX_LIBS="-lsepol"]) | |
8a2fc586 | 975 | |
f8f6ec92 ZK |
976 | AC_CHECK_LIB([selinux], [is_selinux_enabled], [ |
977 | AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout) | |
7dfce0e4 | 978 | AC_CHECK_HEADERS([selinux/label.h]) |
72b2cb61 | 979 | AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.]) |
e1b8a236 | 980 | SELINUX_LIBS="-lselinux $SELINUX_LIBS" |
f7f0854e | 981 | SELINUX_PC="libselinux" |
f8f6ec92 | 982 | HAVE_SELINUX=yes ], [ |
ad6254c5 | 983 | AC_MSG_WARN(Disabling selinux) |
f8f6ec92 | 984 | SELINUX_LIBS= |
f7f0854e | 985 | SELINUX_PC= |
f8f6ec92 | 986 | HAVE_SELINUX=no ]) |
036f273a | 987 | fi |
d68a82ec | 988 | |
8b1a3214 AK |
989 | ################################################################################ |
990 | dnl -- Check for realtime clock support | |
991 | if test x$REALTIME = xyes; then | |
8b1a3214 | 992 | AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no) |
8b1a3214 AK |
993 | |
994 | if test x$HAVE_REALTIME = xyes; then | |
995 | AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.]) | |
996 | LIBS="-lrt $LIBS" | |
997 | else | |
998 | AC_MSG_WARN(Disabling realtime clock) | |
999 | fi | |
1000 | fi | |
1001 | ||
80992638 | 1002 | ################################################################################ |
8ce0cbda | 1003 | dnl -- Check for getopt |
d0191583 | 1004 | AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.])) |
b896caa1 | 1005 | |
80992638 | 1006 | ################################################################################ |
8ce0cbda | 1007 | dnl -- Check for readline (Shamelessly copied from parted 1.4.17) |
ea7cfb00 | 1008 | if test x$READLINE != xno; then |
539f4a77 ZK |
1009 | lvm_saved_libs=$LIBS |
1010 | AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib], | |
1011 | READLINE_LIBS=$ac_cv_search_tgetent, [ | |
1012 | if test "$READLINE" = yes; then | |
1013 | AC_MSG_ERROR( | |
1014 | [termcap could not be found which is required for the | |
1015 | --enable-readline option (which is enabled by default). Either disable readline | |
1016 | support with --disable-readline or download and install termcap from: | |
1017 | ftp.gnu.org/gnu/termcap | |
1018 | Note: if you are using precompiled packages you will also need the development | |
1019 | package as well (which may be called termcap-devel or something similar). | |
1020 | Note: (n)curses also seems to work as a substitute for termcap. This was | |
1021 | not found either - but you could try installing that as well.]) | |
1022 | fi]) | |
1023 | dnl -- Old systems may need extra termcap dependency explicitly in LIBS | |
1024 | AC_CHECK_LIB([readline], [readline], [ | |
1025 | AC_DEFINE([READLINE_SUPPORT], 1, | |
1026 | [Define to 1 to include the LVM readline shell.]) | |
1027 | dnl -- Try only with -lreadline and check for different symbol | |
1028 | LIBS=$lvm_saved_libs | |
1029 | AC_CHECK_LIB([readline], [rl_line_buffer], | |
1030 | [ READLINE_LIBS="-lreadline" ], [ | |
1031 | AC_MSG_RESULT([linking -lreadline with $READLINE_LIBS needed]) | |
1032 | READLINE_LIBS="-lreadline $READLINE_LIBS" | |
1033 | ]) ], [ | |
1034 | READLINE_LIBS= | |
1035 | if test "$READLINE" = yes; then | |
1036 | AC_MSG_ERROR( | |
1037 | [GNU Readline could not be found which is required for the | |
795ca3e5 AK |
1038 | --enable-readline option (which is enabled by default). Either disable readline |
1039 | support with --disable-readline or download and install readline from: | |
1040 | ftp.gnu.org/gnu/readline | |
1041 | Note: if you are using precompiled packages you will also need the development | |
539f4a77 ZK |
1042 | package as well (which may be called readline-devel or something similar).]) |
1043 | fi ]) | |
1044 | LIBS="$READLINE_LIBS $lvm_saved_libs" | |
1045 | AC_CHECK_FUNCS([rl_completion_matches]) | |
1046 | LIBS=$lvm_saved_libs | |
795ca3e5 AK |
1047 | fi |
1048 | ||
80992638 | 1049 | ################################################################################ |
8ce0cbda | 1050 | dnl -- Internationalisation stuff |
ad6254c5 | 1051 | AC_MSG_CHECKING(whether to enable internationalisation) |
71082be4 ZK |
1052 | AC_ARG_ENABLE(nls, |
1053 | AC_HELP_STRING([--enable-nls], [enable Native Language Support]), | |
1054 | INTL=$enableval, INTL=no) | |
ad6254c5 | 1055 | AC_MSG_RESULT($INTL) |
69792976 AK |
1056 | |
1057 | if test x$INTL = xyes; then | |
f6fc418d | 1058 | # FIXME - Move this - can be device-mapper too |
69792976 AK |
1059 | INTL_PACKAGE="lvm2" |
1060 | AC_PATH_PROG(MSGFMT, msgfmt) | |
1061 | if [[ "x$MSGFMT" == x ]]; | |
1062 | then AC_MSG_ERROR( | |
1063 | msgfmt not found in path $PATH | |
1064 | ) | |
69792976 AK |
1065 | fi; |
1066 | ||
1067 | AC_ARG_WITH(localedir, | |
71082be4 ZK |
1068 | AC_HELP_STRING([--with-localedir=DIR], |
1069 | [translation files in DIR | |
1070 | [[PREFIX/share/locale]]]), | |
1071 | LOCALEDIR=$withval, LOCALEDIR='${prefix}/share/locale') | |
69792976 AK |
1072 | fi |
1073 | ||
80992638 | 1074 | ################################################################################ |
4a7f3eb2 | 1075 | AC_ARG_WITH(confdir, |
71082be4 ZK |
1076 | AC_HELP_STRING([--with-confdir=DIR], |
1077 | [configuration files in DIR [[/etc]]]), | |
1078 | CONFDIR=$withval, CONFDIR="/etc") | |
0a62c911 AK |
1079 | |
1080 | AC_ARG_WITH(staticdir, | |
71082be4 ZK |
1081 | AC_HELP_STRING([--with-staticdir=DIR], |
1082 | [static binaries in DIR [[EPREFIX/sbin]]]), | |
1083 | STATICDIR=$withval, STATICDIR='${exec_prefix}/sbin') | |
0a62c911 | 1084 | |
68f2de6d | 1085 | AC_ARG_WITH(usrlibdir, |
71082be4 ZK |
1086 | AC_HELP_STRING([--with-usrlibdir=DIR], |
1087 | [usrlib in DIR [[PREFIX/lib]]]), | |
1088 | usrlibdir=$withval, usrlibdir='${prefix}/lib') | |
68f2de6d AK |
1089 | |
1090 | AC_ARG_WITH(usrsbindir, | |
71082be4 ZK |
1091 | AC_HELP_STRING([--with-usrsbindir=DIR], |
1092 | [usrsbin executables in DIR [[PREFIX/sbin]]]), | |
1093 | usrsbindir=$withval, usrsbindir='${prefix}/sbin') | |
68f2de6d | 1094 | |
5d518f1f AK |
1095 | ################################################################################ |
1096 | AC_ARG_WITH(udev_prefix, | |
71082be4 ZK |
1097 | AC_HELP_STRING([--with-udev-prefix=UPREFIX], |
1098 | [install udev rule files in UPREFIX [[EPREFIX]]]), | |
1099 | udev_prefix=$withval, udev_prefix='${exec_prefix}') | |
5d518f1f | 1100 | |
78ce7acc | 1101 | AC_ARG_WITH(udevdir, |
71082be4 ZK |
1102 | AC_HELP_STRING([--with-udevdir=DIR], |
1103 | [udev rules in DIR [[UPREFIX/lib/udev/rules.d]]]), | |
1104 | udevdir=$withval, udevdir='${udev_prefix}/lib/udev/rules.d') | |
5d518f1f | 1105 | |
ad6254c5 AK |
1106 | ################################################################################ |
1107 | dnl -- Ensure additional headers required | |
1108 | if test x$READLINE = xyes; then | |
1109 | AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out)) | |
1110 | fi | |
1111 | ||
5c7fc7c4 | 1112 | if test x$CLVMD != xnone; then |
ad6254c5 AK |
1113 | 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)) |
1114 | AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out)) | |
1115 | AC_FUNC_GETMNTENT | |
ad6254c5 AK |
1116 | AC_FUNC_SELECT_ARGTYPES |
1117 | fi | |
1118 | ||
ad6254c5 AK |
1119 | if test x$CLUSTER != xnone; then |
1120 | AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out)) | |
1121 | AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out)) | |
1122 | fi | |
1123 | ||
d911ec67 AK |
1124 | if test x$DMEVENTD = xyes; then |
1125 | AC_CHECK_HEADERS(arpa/inet.h,,AC_MSG_ERROR(bailing out)) | |
1126 | fi | |
1127 | ||
ad6254c5 AK |
1128 | if test x$HAVE_LIBDL = xyes; then |
1129 | AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out)) | |
1130 | fi | |
1131 | ||
1132 | if test x$INTL = xyes; then | |
1133 | AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out)) | |
1134 | fi | |
1135 | ||
5d518f1f AK |
1136 | if test x$UDEV_SYNC = xyes; then |
1137 | AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out)) | |
1138 | fi | |
1139 | ||
a653923f AK |
1140 | ################################################################################ |
1141 | AC_PATH_PROG(MODPROBE_CMD, modprobe) | |
1142 | ||
1143 | if test x$MODPROBE_CMD != x; then | |
72b2cb61 | 1144 | AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.]) |
a653923f AK |
1145 | fi |
1146 | ||
a9b601e2 ZK |
1147 | |
1148 | lvm_exec_prefix=$exec_prefix | |
1149 | test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$prefix | |
1150 | test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$ac_default_prefix | |
1151 | AC_DEFINE_UNQUOTED(LVM_PATH, ["$lvm_exec_prefix/sbin/lvm"], [Path to lvm binary.]) | |
b5c2529b ZK |
1152 | |
1153 | if test "$CLVMD" != none; then | |
1154 | clvmd_prefix=$ac_default_prefix | |
1155 | test "$prefix" != NONE && clvmd_prefix=$prefix | |
71082be4 ZK |
1156 | AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$clvmd_prefix/sbin/clvmd"], |
1157 | [Path to clvmd binary.]) | |
b5c2529b ZK |
1158 | fi |
1159 | ||
80992638 | 1160 | ################################################################################ |
f6fc418d | 1161 | dnl -- dmeventd pidfile and executable path |
f6fc418d AK |
1162 | if test "$BUILD_DMEVENTD" = yes; then |
1163 | AC_ARG_WITH(dmeventd-pidfile, | |
71082be4 ZK |
1164 | AC_HELP_STRING([--with-dmeventd-pidfile=PATH], |
1165 | [dmeventd pidfile [[/var/run/dmeventd.pid]]]), | |
1166 | DMEVENTD_PIDFILE=$withval, | |
1167 | DMEVENTD_PIDFILE="/var/run/dmeventd.pid") | |
1168 | AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE, ["$DMEVENTD_PIDFILE"], | |
1169 | [Path to dmeventd pidfile.]) | |
f6fc418d AK |
1170 | fi |
1171 | ||
f6fc418d | 1172 | if test "$BUILD_DMEVENTD" = yes; then |
f6fc418d | 1173 | AC_ARG_WITH(dmeventd-path, |
71082be4 ZK |
1174 | AC_HELP_STRING([--with-dmeventd-path=PATH], |
1175 | [dmeventd path [[EPREFIX/sbin/dmeventd]]]), | |
1176 | DMEVENTD_PATH=$withval, | |
1177 | DMEVENTD_PATH="$lvm_exec_prefix/sbin/dmeventd") | |
1178 | AC_DEFINE_UNQUOTED(DMEVENTD_PATH, ["$DMEVENTD_PATH"], | |
1179 | [Path to dmeventd binary.]) | |
f6fc418d AK |
1180 | fi |
1181 | ||
8bae0a1e AK |
1182 | AH_TEMPLATE(DEFAULT_RUN_DIR, [Name of default run directory.]) |
1183 | AC_ARG_WITH(default-run-dir, | |
1184 | [ --with-default-run-dir=DIR Default run directory [[/var/run/lvm]] ], | |
1185 | [ DEFAULT_RUN_DIR="$withval" ], | |
1186 | [ DEFAULT_RUN_DIR="/var/run/lvm" ]) | |
1187 | AC_DEFINE_UNQUOTED(DEFAULT_RUN_DIR,["$DEFAULT_RUN_DIR"] ) | |
1188 | ||
3399ae32 AK |
1189 | ################################################################################ |
1190 | dnl -- various defaults | |
3399ae32 | 1191 | AC_ARG_WITH(default-system-dir, |
71082be4 ZK |
1192 | AC_HELP_STRING([--with-default-system-dir=DIR], |
1193 | [default LVM system directory [[/etc/lvm]]]), | |
1194 | DEFAULT_SYS_DIR=$withval, DEFAULT_SYS_DIR="/etc/lvm") | |
1195 | AC_DEFINE_UNQUOTED(DEFAULT_SYS_DIR, ["$DEFAULT_SYS_DIR"], | |
1196 | [Path to LVM system directory.]) | |
3399ae32 | 1197 | |
3399ae32 | 1198 | AC_ARG_WITH(default-archive-subdir, |
71082be4 ZK |
1199 | AC_HELP_STRING([--with-default-archive-subdir=SUBDIR], |
1200 | [default metadata archive subdir [[archive]]]), | |
1201 | DEFAULT_ARCHIVE_SUBDIR=$withval, DEFAULT_ARCHIVE_SUBDIR=archive) | |
1202 | AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE_SUBDIR, ["$DEFAULT_ARCHIVE_SUBDIR"], | |
1203 | [Name of default metadata archive subdirectory.]) | |
3399ae32 | 1204 | |
3399ae32 | 1205 | AC_ARG_WITH(default-backup-subdir, |
71082be4 ZK |
1206 | AC_HELP_STRING([--with-default-backup-subdir=SUBDIR], |
1207 | [default metadata backup subdir [[backup]]]), | |
1208 | DEFAULT_BACKUP_SUBDIR=$withval, DEFAULT_BACKUP_SUBDIR=backup) | |
1209 | AC_DEFINE_UNQUOTED(DEFAULT_BACKUP_SUBDIR, ["$DEFAULT_BACKUP_SUBDIR"], | |
1210 | [Name of default metadata backup subdirectory.]) | |
3399ae32 | 1211 | |
3399ae32 | 1212 | AC_ARG_WITH(default-cache-subdir, |
71082be4 ZK |
1213 | AC_HELP_STRING([--with-default-cache-subdir=SUBDIR], |
1214 | [default metadata cache subdir [[cache]]]), | |
1215 | DEFAULT_CACHE_SUBDIR=$withval, DEFAULT_CACHE_SUBDIR=cache) | |
1216 | AC_DEFINE_UNQUOTED(DEFAULT_CACHE_SUBDIR, ["$DEFAULT_CACHE_SUBDIR"], | |
1217 | [Name of default metadata cache subdirectory.]) | |
3399ae32 | 1218 | |
3399ae32 | 1219 | AC_ARG_WITH(default-locking-dir, |
71082be4 ZK |
1220 | AC_HELP_STRING([--with-default-locking-dir=DIR], |
1221 | [default locking directory [[/var/lock/lvm]]]), | |
1222 | DEFAULT_LOCK_DIR=$withval, DEFAULT_LOCK_DIR="/var/lock/lvm") | |
1223 | AC_DEFINE_UNQUOTED(DEFAULT_LOCK_DIR, ["$DEFAULT_LOCK_DIR"], | |
1224 | [Name of default locking directory.]) | |
3399ae32 | 1225 | |
7063efe1 MS |
1226 | ################################################################################ |
1227 | dnl -- Setup default data alignment | |
1228 | AC_ARG_WITH(default-data-alignment, | |
1229 | AC_HELP_STRING([--with-default-data-alignment=NUM], | |
1230 | [set the default data alignment in MiB [[1]]]), | |
1231 | DEFAULT_DATA_ALIGNMENT=$withval, DEFAULT_DATA_ALIGNMENT=1) | |
1232 | AC_DEFINE_UNQUOTED(DEFAULT_DATA_ALIGNMENT, [$DEFAULT_DATA_ALIGNMENT], | |
1233 | [Default data alignment.]) | |
1234 | ||
f6fc418d AK |
1235 | ################################################################################ |
1236 | dnl -- which kernel interface to use (ioctl only) | |
1237 | AC_MSG_CHECKING(for kernel interface choice) | |
1238 | AC_ARG_WITH(interface, | |
71082be4 ZK |
1239 | AC_HELP_STRING([--with-interface=IFACE], |
1240 | [choose kernel interface (ioctl) [[ioctl]]]), | |
1241 | interface=$withval, interface=ioctl) | |
f6fc418d AK |
1242 | if [[ "x$interface" != xioctl ]]; |
1243 | then | |
1244 | AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.) | |
1245 | fi | |
1246 | AC_MSG_RESULT($interface) | |
1247 | ||
1248 | ################################################################################ | |
db8b5af9 | 1249 | DM_LIB_VERSION="\"`cat "$srcdir"/VERSION_DM 2>/dev/null || echo Unknown`\"" |
f58b35b5 AK |
1250 | AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version]) |
1251 | ||
db8b5af9 | 1252 | DM_LIB_PATCHLEVEL=`cat "$srcdir"/VERSION_DM | $AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'` |
597c3f8e | 1253 | |
db8b5af9 | 1254 | LVM_VERSION="\"`cat "$srcdir"/VERSION 2>/dev/null || echo Unknown`\"" |
fae0c576 | 1255 | |
db8b5af9 | 1256 | VER=`cat "$srcdir"/VERSION` |
bf456146 | 1257 | LVM_RELEASE_DATE="\"`echo $VER | $SED 's/.* (//;s/).*//'`\"" |
ec6a6fbe AK |
1258 | VER=`echo "$VER" | $AWK '{print $1}'` |
1259 | LVM_RELEASE="\"`echo "$VER" | $AWK -F '-' '{print $2}'`\"" | |
1260 | VER=`echo "$VER" | $AWK -F '-' '{print $1}'` | |
1261 | LVM_MAJOR=`echo "$VER" | $AWK -F '.' '{print $1}'` | |
1262 | LVM_MINOR=`echo "$VER" | $AWK -F '.' '{print $2}'` | |
bf456146 AK |
1263 | LVM_PATCHLEVEL=`echo "$VER" | $AWK -F '[[(.]]' '{print $3}'` |
1264 | LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'` | |
ec6a6fbe | 1265 | |
80992638 | 1266 | ################################################################################ |
572fefeb | 1267 | AC_SUBST(APPLIB) |
aaa2e046 | 1268 | AC_SUBST(AWK) |
66fd4529 | 1269 | AC_SUBST(BUILD_CMIRRORD) |
d0191583 | 1270 | AC_SUBST(BUILD_DMEVENTD) |
a946372e AK |
1271 | AC_SUBST(CCS_CFLAGS) |
1272 | AC_SUBST(CCS_LIBS) | |
b896caa1 | 1273 | AC_SUBST(CFLAGS) |
d0191583 | 1274 | AC_SUBST(CFLOW_CMD) |
8106cdd5 | 1275 | AC_SUBST(CLDFLAGS) |
8106cdd5 | 1276 | AC_SUBST(CLDNOWHOLEARCHIVE) |
d0191583 JM |
1277 | AC_SUBST(CLDWHOLEARCHIVE) |
1278 | AC_SUBST(CLUSTER) | |
1279 | AC_SUBST(CLVMD) | |
34b6075d | 1280 | AC_SUBST(CLVMD_CMANAGERS) |
a946372e AK |
1281 | AC_SUBST(CMAN_CFLAGS) |
1282 | AC_SUBST(CMAN_LIBS) | |
d0191583 | 1283 | AC_SUBST(CMDLIB) |
edf47283 AK |
1284 | AC_SUBST(CONFDB_CFLAGS) |
1285 | AC_SUBST(CONFDB_LIBS) | |
1286 | AC_SUBST(CONFDIR) | |
d0191583 | 1287 | AC_SUBST(COPTIMISE_FLAG) |
edf47283 AK |
1288 | AC_SUBST(CPG_CFLAGS) |
1289 | AC_SUBST(CPG_LIBS) | |
d0191583 | 1290 | AC_SUBST(CSCOPE_CMD) |
8ef2b021 | 1291 | AC_SUBST(DEBUG) |
3399ae32 AK |
1292 | AC_SUBST(DEFAULT_SYS_DIR) |
1293 | AC_SUBST(DEFAULT_ARCHIVE_SUBDIR) | |
1294 | AC_SUBST(DEFAULT_BACKUP_SUBDIR) | |
1295 | AC_SUBST(DEFAULT_CACHE_SUBDIR) | |
7063efe1 | 1296 | AC_SUBST(DEFAULT_DATA_ALIGNMENT) |
3399ae32 | 1297 | AC_SUBST(DEFAULT_LOCK_DIR) |
b1f08e51 | 1298 | AC_SUBST(DEFAULT_RUN_DIR) |
199e490e | 1299 | AC_SUBST(DEVMAPPER) |
a946372e AK |
1300 | AC_SUBST(DLM_CFLAGS) |
1301 | AC_SUBST(DLM_LIBS) | |
19a2c6e0 | 1302 | AC_SUBST(DL_LIBS) |
d0191583 | 1303 | AC_SUBST(DMEVENTD) |
d1e8046f | 1304 | AC_SUBST(DMEVENTD_PATH) |
d0191583 JM |
1305 | AC_SUBST(DM_COMPAT) |
1306 | AC_SUBST(DM_DEVICE_GID) | |
1307 | AC_SUBST(DM_DEVICE_MODE) | |
1308 | AC_SUBST(DM_DEVICE_UID) | |
1309 | AC_SUBST(DM_IOCTLS) | |
1310 | AC_SUBST(DM_LIB_VERSION) | |
597c3f8e | 1311 | AC_SUBST(DM_LIB_PATCHLEVEL) |
d0191583 | 1312 | AC_SUBST(FSADM) |
a946372e AK |
1313 | AC_SUBST(GULM_CFLAGS) |
1314 | AC_SUBST(GULM_LIBS) | |
26e7f2e0 | 1315 | AC_SUBST(HAVE_LIBDL) |
8b1a3214 | 1316 | AC_SUBST(HAVE_REALTIME) |
d0191583 JM |
1317 | AC_SUBST(INTL) |
1318 | AC_SUBST(INTL_PACKAGE) | |
1319 | AC_SUBST(JOBS) | |
1320 | AC_SUBST(LDDEPS) | |
1321 | AC_SUBST(LIBS) | |
1322 | AC_SUBST(LIB_SUFFIX) | |
69792976 | 1323 | AC_SUBST(LOCALEDIR) |
d0191583 JM |
1324 | AC_SUBST(LVM1) |
1325 | AC_SUBST(LVM1_FALLBACK) | |
d0191583 | 1326 | AC_SUBST(LVM_VERSION) |
bf456146 | 1327 | AC_SUBST(LVM_LIBAPI) |
ec6a6fbe AK |
1328 | AC_SUBST(LVM_MAJOR) |
1329 | AC_SUBST(LVM_MINOR) | |
1330 | AC_SUBST(LVM_PATCHLEVEL) | |
1331 | AC_SUBST(LVM_RELEASE) | |
1332 | AC_SUBST(LVM_RELEASE_DATE) | |
d0191583 | 1333 | AC_SUBST(MIRRORS) |
e40d44be | 1334 | AC_SUBST(OCF) |
349da06c | 1335 | AC_SUBST(OCFDIR) |
8fea97b7 | 1336 | AC_SUBST(REPLICATORS) |
d0191583 | 1337 | AC_SUBST(MSGFMT) |
d0191583 JM |
1338 | AC_SUBST(PKGCONFIG) |
1339 | AC_SUBST(POOL) | |
f30875db | 1340 | AC_SUBST(PTHREAD_LIBS) |
edf47283 AK |
1341 | AC_SUBST(QUORUM_CFLAGS) |
1342 | AC_SUBST(QUORUM_LIBS) | |
539f4a77 | 1343 | AC_SUBST(READLINE_LIBS) |
90c80887 AK |
1344 | AC_SUBST(SACKPT_CFLAGS) |
1345 | AC_SUBST(SACKPT_LIBS) | |
a946372e AK |
1346 | AC_SUBST(SALCK_CFLAGS) |
1347 | AC_SUBST(SALCK_LIBS) | |
e1b8a236 | 1348 | AC_SUBST(SELINUX_LIBS) |
f7f0854e | 1349 | AC_SUBST(SELINUX_PC) |
d0191583 | 1350 | AC_SUBST(SNAPSHOTS) |
0a62c911 | 1351 | AC_SUBST(STATICDIR) |
d0191583 | 1352 | AC_SUBST(STATIC_LINK) |
1033d120 | 1353 | AC_SUBST(TESTING) |
db724a44 | 1354 | AC_SUBST(UDEV_LIBS) |
f7f0854e | 1355 | AC_SUBST(UDEV_PC) |
5d518f1f | 1356 | AC_SUBST(UDEV_RULES) |
4df024c4 | 1357 | AC_SUBST(UDEV_SYNC) |
23b059e7 | 1358 | AC_SUBST(WRITE_INSTALL) |
f6fc418d AK |
1359 | AC_SUBST(interface) |
1360 | AC_SUBST(kerneldir) | |
1361 | AC_SUBST(missingkernel) | |
1362 | AC_SUBST(kernelvsn) | |
1363 | AC_SUBST(tmpdir) | |
5d518f1f AK |
1364 | AC_SUBST(udev_prefix) |
1365 | AC_SUBST(udevdir) | |
68f2de6d AK |
1366 | AC_SUBST(usrlibdir) |
1367 | AC_SUBST(usrsbindir) | |
8106cdd5 | 1368 | |
80992638 | 1369 | ################################################################################ |
d3a356b4 | 1370 | dnl -- First and last lines should not contain files to generate in order to |
8ce0cbda | 1371 | dnl -- keep utility scripts running properly |
d3a356b4 JM |
1372 | AC_CONFIG_FILES([ |
1373 | Makefile | |
1374 | make.tmpl | |
1375 | daemons/Makefile | |
1376 | daemons/clvmd/Makefile | |
5d311afb | 1377 | daemons/cmirrord/Makefile |
f6fc418d AK |
1378 | daemons/dmeventd/Makefile |
1379 | daemons/dmeventd/libdevmapper-event.pc | |
b7edb5bf | 1380 | daemons/dmeventd/plugins/Makefile |
d3d98fdc | 1381 | daemons/dmeventd/plugins/lvm2/Makefile |
f6fc418d AK |
1382 | daemons/dmeventd/plugins/mirror/Makefile |
1383 | daemons/dmeventd/plugins/snapshot/Makefile | |
d3a356b4 | 1384 | doc/Makefile |
da05c479 | 1385 | doc/example.conf |
db8b5af9 | 1386 | include/.symlinks |
f6fc418d AK |
1387 | include/Makefile |
1388 | lib/Makefile | |
d3a356b4 JM |
1389 | lib/format1/Makefile |
1390 | lib/format_pool/Makefile | |
1391 | lib/locking/Makefile | |
1392 | lib/mirror/Makefile | |
8fea97b7 | 1393 | lib/replicator/Makefile |
ec6a6fbe | 1394 | lib/misc/lvm-version.h |
d3a356b4 | 1395 | lib/snapshot/Makefile |
f6fc418d AK |
1396 | libdm/Makefile |
1397 | libdm/libdevmapper.pc | |
e0c64c6c | 1398 | liblvm/Makefile |
70046623 | 1399 | liblvm/liblvm2app.pc |
f6fc418d AK |
1400 | man/Makefile |
1401 | po/Makefile | |
2de38033 | 1402 | scripts/clvmd_init_red_hat |
81410c8f | 1403 | scripts/cmirrord_init_red_hat |
595eaf92 | 1404 | scripts/lvm2_monitoring_init_red_hat |
d3a356b4 | 1405 | scripts/Makefile |
f6fc418d | 1406 | test/Makefile |
c7e363f9 | 1407 | test/api/Makefile |
d3a356b4 | 1408 | tools/Makefile |
5d518f1f | 1409 | udev/Makefile |
66392e66 | 1410 | unit-tests/datastruct/Makefile |
15106c50 | 1411 | unit-tests/regex/Makefile |
52e1564f | 1412 | unit-tests/mm/Makefile |
7a197a62 AK |
1413 | ]) |
1414 | AC_OUTPUT | |
2dc95e1c AK |
1415 | |
1416 | if test x$ODIRECT != xyes; then | |
ad6254c5 | 1417 | AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up) |
2dc95e1c | 1418 | fi |