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