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