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