]>
Commit | Line | Data |
---|---|---|
d0191583 | 1 | ############################################################################### |
ad6254c5 | 2 | ## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved. |
b6d7a484 | 3 | ## Copyright (C) 2004-2012 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 | |
b6d7a484 | 552 | CHECKCMAP=yes |
a946372e AK |
553 | fi |
554 | ||
edf47283 | 555 | dnl -- Look for corosync libraries if required. |
a946372e AK |
556 | if test x$BUILDCOROSYNC = xyes; then |
557 | PKG_CHECK_MODULES(QUORUM, libquorum, [HAVE_QUORUM=yes], $bailout) | |
558 | CHECKCPG=yes | |
559 | CHECKDLM=yes | |
560 | fi | |
561 | ||
562 | dnl -- Look for openais libraries if required. | |
563 | if test x$BUILDOPENAIS = xyes; then | |
564 | PKG_CHECK_MODULES(SALCK, libSaLck, [HAVE_SALCK=yes], $bailout) | |
565 | CHECKCPG=yes | |
566 | fi | |
567 | ||
568 | dnl -- Below are checks for libraries common to more than one build. | |
569 | ||
570 | dnl -- Check confdb library. | |
b6d7a484 | 571 | dnl -- mandatory for corosync < 2.0 build. |
a946372e AK |
572 | dnl -- optional for openais/cman build. |
573 | ||
574 | if test x$CHECKCONFDB = xyes; then | |
575 | PKG_CHECK_MODULES(CONFDB, libconfdb, | |
576 | [HAVE_CONFDB=yes], | |
577 | [HAVE_CONFDB=no]) | |
578 | ||
579 | AC_CHECK_HEADERS(corosync/confdb.h, | |
580 | [HAVE_CONFDB_H=yes], | |
581 | [HAVE_CONFDB_H=no]) | |
582 | ||
583 | if test x$HAVE_CONFDB != xyes && \ | |
584 | test x$HAVE_CONFDB_H = xyes; then | |
585 | check_lib_no_libs confdb confdb_initialize | |
586 | AC_MSG_RESULT([no pkg for confdb, using -lconfdb]) | |
587 | CONFDB_LIBS="-lconfdb" | |
588 | HAVE_CONFDB=yes | |
589 | fi | |
b6d7a484 AK |
590 | fi |
591 | ||
592 | dnl -- Check cmap library | |
593 | dnl -- mandatory for corosync >= 2.0 build. | |
594 | ||
595 | if test x$CHECKCMAP = xyes; then | |
596 | PKG_CHECK_MODULES(CMAP, libcmap, | |
597 | [HAVE_CMAP=yes], | |
598 | [HAVE_CMAP=no]) | |
a946372e | 599 | |
b6d7a484 AK |
600 | AC_CHECK_HEADERS(corosync/cmap.h, |
601 | [HAVE_CMAP_H=yes], | |
602 | [HAVE_CMAP_H=no]) | |
603 | ||
604 | if test x$HAVE_CMAP != xyes && \ | |
605 | test x$HAVE_CMAP_H = xyes; then | |
606 | check_lib_no_libs cmap cmap_initialize | |
607 | AC_MSG_RESULT([no pkg for cmap, using -lcmap]) | |
608 | CMAP_LIBS="-lcmap" | |
609 | HAVE_CMAP=yes | |
610 | fi | |
611 | fi | |
612 | ||
613 | if test x$BUILDCOROSYNC = xyes; then | |
614 | if test x$HAVE_CMAP != xyes && \ | |
615 | test x$HAVE_CONFDB != xyes && \ | |
a946372e | 616 | test x$CLVMD != xall; then |
b6d7a484 | 617 | AC_MSG_ERROR([bailing out... cmap (corosync >= 2.0) or confdb (corosync < 2.0) library is required]) |
a946372e AK |
618 | fi |
619 | fi | |
620 | ||
621 | dnl -- Check cpg library. | |
622 | if test x$CHECKCPG = xyes; then | |
623 | PKG_CHECK_MODULES(CPG, libcpg, [HAVE_CPG=yes], $bailout) | |
624 | fi | |
625 | ||
626 | dnl -- Check dlm library. | |
627 | if test x$CHECKDLM = xyes; then | |
628 | PKG_CHECK_MODULES(DLM, libdlm, [HAVE_DLM=yes], | |
629 | [NOTFOUND=0 | |
630 | AC_CHECK_HEADERS(libdlm.h,,$bailout) | |
631 | check_lib_no_libs dlm dlm_lock -lpthread | |
632 | if test $NOTFOUND = 0; then | |
633 | AC_MSG_RESULT([no pkg for libdlm, using -ldlm]) | |
634 | DLM_LIBS="-ldlm -lpthread" | |
635 | HAVE_DLM=yes | |
636 | fi]) | |
637 | fi | |
638 | ||
639 | dnl -- If we are autodetecting, we need to re-create | |
34b6075d FDN |
640 | dnl -- the depedencies checks and set a proper CLVMD, |
641 | dnl -- together with init script Required-Start/Stop entries. | |
a946372e | 642 | if test x$CLVMD = xall; then |
8c222979 | 643 | CLVMD=none |
34b6075d FDN |
644 | CLVMD_CMANAGERS="" |
645 | CLVMD_NEEDS_QDISKD=no | |
a946372e AK |
646 | if test x$HAVE_CMAN = xyes && \ |
647 | test x$HAVE_DLM = xyes; then | |
8c222979 FDN |
648 | AC_MSG_RESULT([Enabling clvmd cman cluster manager]) |
649 | CLVMD="$CLVMD,cman" | |
34b6075d FDN |
650 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman" |
651 | CLVMD_NEEDS_QDISKD=yes | |
a946372e AK |
652 | fi |
653 | if test x$HAVE_COROSYNC = xyes && \ | |
654 | test x$HAVE_QUORUM = xyes && \ | |
655 | test x$HAVE_CPG = xyes && \ | |
b6d7a484 AK |
656 | test x$HAVE_DLM = xyes; then |
657 | if test x$HAVE_CONFDB = xyes || test x$HAVE_CMAP = xyes; then | |
8c222979 FDN |
658 | AC_MSG_RESULT([Enabling clvmd corosync cluster manager]) |
659 | CLVMD="$CLVMD,corosync" | |
34b6075d | 660 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync" |
b6d7a484 | 661 | fi |
a946372e AK |
662 | fi |
663 | if test x$HAVE_COROSYNC = xyes && \ | |
664 | test x$HAVE_CPG = xyes && \ | |
665 | test x$HAVE_SALCK = xyes; then | |
8c222979 FDN |
666 | AC_MSG_RESULT([Enabling clvmd openais cluster manager]) |
667 | CLVMD="$CLVMD,openais" | |
34b6075d FDN |
668 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais" |
669 | fi | |
670 | if test x$CLVMD_NEEDS_QDISKD != xno; then | |
671 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd" | |
8c222979 FDN |
672 | fi |
673 | if test x$CLVMD = xnone; then | |
674 | AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.]) | |
a946372e | 675 | fi |
edf47283 AK |
676 | fi |
677 | ||
8c4e8a18 FDN |
678 | ################################################################################ |
679 | dnl -- clvmd pidfile | |
680 | if test "x$CLVMD" != xnone; then | |
681 | AC_ARG_WITH(clvmd-pidfile, | |
682 | AC_HELP_STRING([--with-clvmd-pidfile=PATH], | |
683 | [clvmd pidfile [[/var/run/clvmd.pid]]]), | |
684 | CLVMD_PIDFILE=$withval, | |
685 | CLVMD_PIDFILE="/var/run/clvmd.pid") | |
686 | AC_DEFINE_UNQUOTED(CLVMD_PIDFILE, ["$CLVMD_PIDFILE"], | |
687 | [Path to clvmd pidfile.]) | |
688 | fi | |
689 | ||
3c14bcca | 690 | ################################################################################ |
66fd4529 AK |
691 | dnl -- Build cluster mirror log daemon |
692 | AC_MSG_CHECKING(whether to build cluster mirror log daemon) | |
71082be4 ZK |
693 | AC_ARG_ENABLE(cmirrord, |
694 | AC_HELP_STRING([--enable-cmirrord], | |
695 | [enable the cluster mirror log daemon]), | |
696 | CMIRRORD=$enableval, CMIRRORD=no) | |
66fd4529 | 697 | AC_MSG_RESULT($CMIRRORD) |
3c14bcca | 698 | |
66fd4529 AK |
699 | BUILD_CMIRRORD=$CMIRRORD |
700 | ||
701 | ################################################################################ | |
702 | dnl -- cmirrord pidfile | |
66fd4529 AK |
703 | if test "x$BUILD_CMIRRORD" = xyes; then |
704 | AC_ARG_WITH(cmirrord-pidfile, | |
71082be4 ZK |
705 | AC_HELP_STRING([--with-cmirrord-pidfile=PATH], |
706 | [cmirrord pidfile [[/var/run/cmirrord.pid]]]), | |
707 | CMIRRORD_PIDFILE=$withval, | |
708 | CMIRRORD_PIDFILE="/var/run/cmirrord.pid") | |
709 | AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE, ["$CMIRRORD_PIDFILE"], | |
710 | [Path to cmirrord pidfile.]) | |
66fd4529 AK |
711 | fi |
712 | ||
713 | ################################################################################ | |
3c14bcca | 714 | dnl -- Look for corosync libraries if required. |
66fd4529 | 715 | if [[ "x$BUILD_CMIRRORD" = xyes ]]; then |
90c80887 AK |
716 | dnl -- init pkgconfig if required |
717 | if test x$PKGCONFIG_INIT != x1; then | |
718 | pkg_config_init | |
719 | fi | |
720 | PKG_CHECK_MODULES(SACKPT, libSaCkpt) | |
721 | if test x$HAVE_CPG != xyes; then | |
722 | PKG_CHECK_MODULES(CPG, libcpg) | |
723 | fi | |
3c14bcca JEB |
724 | fi |
725 | ||
80992638 | 726 | ################################################################################ |
8ce0cbda | 727 | dnl -- Enable debugging |
ad6254c5 | 728 | AC_MSG_CHECKING(whether to enable debugging) |
71082be4 ZK |
729 | AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debugging]), |
730 | DEBUG=$enableval, DEBUG=no) | |
ad6254c5 | 731 | AC_MSG_RESULT($DEBUG) |
8ef2b021 | 732 | |
8ce0cbda AK |
733 | dnl -- Normally turn off optimisation for debug builds |
734 | if test x$DEBUG = xyes; then | |
735 | COPTIMISE_FLAG= | |
8a2fc586 AK |
736 | else |
737 | CSCOPE_CMD= | |
8ce0cbda AK |
738 | fi |
739 | ||
740 | ################################################################################ | |
741 | dnl -- Override optimisation | |
ad6254c5 | 742 | AC_MSG_CHECKING(for C optimisation flag) |
8ce0cbda | 743 | AC_ARG_WITH(optimisation, |
71082be4 ZK |
744 | AC_HELP_STRING([--with-optimisation=OPT], |
745 | [C optimisation flag [[OPT=-O2]]]), | |
746 | COPTIMISE_FLAG=$withval) | |
ad6254c5 | 747 | AC_MSG_RESULT($COPTIMISE_FLAG) |
8ce0cbda | 748 | |
fddafd51 ZK |
749 | ################################################################################ |
750 | dnl -- Enable profiling | |
5556819a | 751 | AC_MSG_CHECKING(whether to gather gcov profiling data) |
fddafd51 | 752 | AC_ARG_ENABLE(profiling, |
71082be4 ZK |
753 | AC_HELP_STRING(--enable-profiling, [gather gcov profiling data]), |
754 | PROFILING=$enableval, PROFILING=no) | |
5556819a AK |
755 | AC_MSG_RESULT($PROFILING) |
756 | ||
757 | if test "x$PROFILING" = xyes; then | |
758 | COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage" | |
fd4728e1 ZK |
759 | AC_PATH_PROG(LCOV, lcov) |
760 | AC_PATH_PROG(GENHTML, genhtml) | |
761 | if test -z "$LCOV" -o -z "$GENHTML"; then | |
b145d876 ZK |
762 | AC_MSG_ERROR([lcov and genhtml are required for profiling]) |
763 | fi | |
fd4728e1 ZK |
764 | AC_PATH_PROG(GENPNG, genpng) |
765 | if test -n "$GENPNG"; then | |
766 | AC_MSG_CHECKING([whether $GENPNG has all required modules]) | |
767 | if $GENPNG --help > /dev/null 2>&1 ; then | |
768 | AC_MSG_RESULT(ok) | |
769 | GENHTML="$GENHTML --frames" | |
770 | else | |
771 | AC_MSG_RESULT(not supported) | |
772 | AC_MSG_WARN([GD.pm perl module is not installed]) | |
773 | GENPNG= | |
774 | fi | |
775 | fi | |
5556819a | 776 | fi |
fddafd51 | 777 | |
1033d120 JT |
778 | ################################################################################ |
779 | dnl -- Enable testing | |
780 | AC_MSG_CHECKING(whether to enable unit testing) | |
781 | AC_ARG_ENABLE(testing, | |
782 | AC_HELP_STRING(--enable-testing, [enable testing targets in the makefile]), | |
783 | TESTING=$enableval, TESTING=no) | |
784 | AC_MSG_RESULT($TESTING) | |
785 | ||
786 | if test "$TESTING" = yes; then | |
5da88e5b | 787 | PKG_CHECK_MODULES(CUNIT, cunit >= 2.0) |
1033d120 JT |
788 | fi |
789 | ||
52e1564f JT |
790 | ################################################################################ |
791 | dnl -- Enable valgrind awareness of memory pools | |
792 | AC_MSG_CHECKING(whether to enable valgrind awareness of pools) | |
793 | AC_ARG_ENABLE(valgrind_pool, | |
794 | AC_HELP_STRING(--enable-valgrind-pool, [enable valgrind awareness of pools]), | |
795 | VALGRIND_POOL=$enableval, VALGRIND_POOL=no) | |
796 | AC_MSG_RESULT($VALGRIND_POOL) | |
797 | ||
798 | if test "$VALGRIND_POOL" = yes; then | |
799 | AC_CHECK_HEADERS([valgrind/memcheck.h], , [AC_MSG_ERROR(bailing out)]) | |
800 | AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool]) | |
801 | fi | |
802 | ||
80992638 | 803 | ################################################################################ |
8ce0cbda | 804 | dnl -- Disable devmapper |
ad6254c5 | 805 | AC_MSG_CHECKING(whether to use device-mapper) |
71082be4 ZK |
806 | AC_ARG_ENABLE(devmapper, |
807 | AC_HELP_STRING([--disable-devmapper], | |
808 | [disable LVM2 device-mapper interaction]), | |
809 | DEVMAPPER=$enableval) | |
ad6254c5 | 810 | AC_MSG_RESULT($DEVMAPPER) |
199e490e | 811 | |
b896caa1 | 812 | if test x$DEVMAPPER = xyes; then |
f6fc418d | 813 | AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.]) |
b896caa1 AK |
814 | fi |
815 | ||
615534d3 PR |
816 | ################################################################################ |
817 | dnl -- Build lvmetad | |
818 | AC_MSG_CHECKING(whether to build LVMetaD) | |
819 | AC_ARG_ENABLE(lvmetad, | |
d38de32b AK |
820 | AC_HELP_STRING([--enable-lvmetad], |
821 | [enable the LVM Metadata Daemon]), | |
615534d3 PR |
822 | LVMETAD=$enableval) |
823 | AC_MSG_RESULT($LVMETAD) | |
824 | ||
825 | BUILD_LVMETAD=$LVMETAD | |
826 | ||
5d518f1f AK |
827 | ################################################################################ |
828 | dnl -- Enable udev synchronisation | |
829 | AC_MSG_CHECKING(whether to enable synchronisation with udev processing) | |
71082be4 ZK |
830 | AC_ARG_ENABLE(udev_sync, |
831 | AC_HELP_STRING([--enable-udev_sync], | |
832 | [enable synchronisation with udev processing]), | |
833 | UDEV_SYNC=$enableval, UDEV_SYNC=no) | |
5d518f1f AK |
834 | AC_MSG_RESULT($UDEV_SYNC) |
835 | ||
836 | if test x$UDEV_SYNC = xyes; then | |
86ba564a AK |
837 | dnl -- init pkgconfig if required |
838 | if test x$PKGCONFIG_INIT != x1; then | |
839 | pkg_config_init | |
840 | fi | |
71b29ddc | 841 | PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"]) |
5d518f1f AK |
842 | AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.]) |
843 | fi | |
844 | ||
845 | dnl -- Enable udev rules | |
846 | AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation) | |
71082be4 ZK |
847 | AC_ARG_ENABLE(udev_rules, |
848 | AC_HELP_STRING([--enable-udev_rules], | |
849 | [install rule files needed for udev synchronisation]), | |
850 | UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC) | |
5d518f1f AK |
851 | AC_MSG_RESULT($UDEV_RULES) |
852 | ||
f6fc418d AK |
853 | ################################################################################ |
854 | dnl -- Compatibility mode | |
71082be4 ZK |
855 | AC_ARG_ENABLE(compat, |
856 | AC_HELP_STRING([--enable-compat], | |
857 | [enable support for old device-mapper versions]), | |
858 | DM_COMPAT=$enableval, DM_COMPAT=no) | |
f6fc418d | 859 | |
2061c0ec AK |
860 | if test x$DM_COMPAT = xyes; then |
861 | AC_MSG_ERROR( | |
862 | [--enable-compat is not currently supported. | |
863 | Since device-mapper version 1.02.66, only one version (4) of the device-mapper | |
864 | ioctl protocol is supported.] | |
865 | ) | |
866 | fi | |
867 | ||
95eaa683 AK |
868 | ################################################################################ |
869 | dnl -- Compatible units suffix mode | |
870 | AC_ARG_ENABLE(units-compat, | |
71082be4 ZK |
871 | AC_HELP_STRING([--enable-units-compat], |
872 | [enable output compatibility with old versions that | |
873 | that do not use KiB-style unit suffixes]), | |
874 | UNITS_COMPAT=$enableval, UNITS_COMPAT=no) | |
95eaa683 AK |
875 | |
876 | if test x$UNITS_COMPAT = xyes; then | |
877 | AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.]) | |
878 | fi | |
879 | ||
f6fc418d AK |
880 | ################################################################################ |
881 | dnl -- Disable ioctl | |
71082be4 ZK |
882 | AC_ARG_ENABLE(ioctl, |
883 | AC_HELP_STRING([--disable-driver], | |
884 | [disable calls to device-mapper in the kernel]), | |
885 | DM_IOCTLS=$enableval) | |
f6fc418d | 886 | |
80992638 | 887 | ################################################################################ |
8ce0cbda | 888 | dnl -- Disable O_DIRECT |
ad6254c5 | 889 | AC_MSG_CHECKING(whether to enable O_DIRECT) |
71082be4 ZK |
890 | AC_ARG_ENABLE(o_direct, |
891 | AC_HELP_STRING([--disable-o_direct], [disable O_DIRECT]), | |
892 | ODIRECT=$enableval) | |
ad6254c5 | 893 | AC_MSG_RESULT($ODIRECT) |
2dc95e1c AK |
894 | |
895 | if test x$ODIRECT = xyes; then | |
72b2cb61 | 896 | AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.]) |
2dc95e1c AK |
897 | fi |
898 | ||
572fefeb AK |
899 | ################################################################################ |
900 | dnl -- Enable liblvm2app.so | |
901 | AC_MSG_CHECKING(whether to build liblvm2app.so application library) | |
902 | AC_ARG_ENABLE(applib, | |
71082be4 ZK |
903 | AC_HELP_STRING([--enable-applib], [build application library]), |
904 | APPLIB=$enableval, APPLIB=no) | |
572fefeb AK |
905 | AC_MSG_RESULT($APPLIB) |
906 | AC_SUBST([LVM2APP_LIB]) | |
907 | test x$APPLIB = xyes \ | |
908 | && LVM2APP_LIB=-llvm2app \ | |
909 | || LVM2APP_LIB= | |
910 | ||
80992638 | 911 | ################################################################################ |
8ce0cbda | 912 | dnl -- Enable cmdlib |
ad6254c5 | 913 | AC_MSG_CHECKING(whether to compile liblvm2cmd.so) |
71082be4 ZK |
914 | AC_ARG_ENABLE(cmdlib, |
915 | AC_HELP_STRING([--enable-cmdlib], [build shared command library]), | |
916 | CMDLIB=$enableval, CMDLIB=no) | |
ad6254c5 | 917 | AC_MSG_RESULT($CMDLIB) |
aa4d1e31 | 918 | AC_SUBST([LVM2CMD_LIB]) |
2a9a80c9 | 919 | test x$CMDLIB = xyes \ |
aa4d1e31 JM |
920 | && LVM2CMD_LIB=-llvm2cmd \ |
921 | || LVM2CMD_LIB= | |
8106cdd5 | 922 | |
f6fc418d AK |
923 | ################################################################################ |
924 | dnl -- Enable pkg-config | |
71082be4 ZK |
925 | AC_ARG_ENABLE(pkgconfig, |
926 | AC_HELP_STRING([--enable-pkgconfig], [install pkgconfig support]), | |
927 | PKGCONFIG=$enableval, PKGCONFIG=no) | |
2a9a80c9 | 928 | |
23b059e7 ZK |
929 | ################################################################################ |
930 | dnl -- Enable installation of writable files by user | |
71082be4 ZK |
931 | AC_ARG_ENABLE(write_install, |
932 | AC_HELP_STRING([--enable-write_install], | |
933 | [install user writable files]), | |
934 | WRITE_INSTALL=$enableval, WRITE_INSTALL=no) | |
23b059e7 | 935 | |
80992638 | 936 | ################################################################################ |
8ce0cbda | 937 | dnl -- Enable fsadm |
1995c9ff | 938 | AC_MSG_CHECKING(whether to install fsadm) |
71082be4 ZK |
939 | AC_ARG_ENABLE(fsadm, AC_HELP_STRING([--disable-fsadm], [disable fsadm]), |
940 | FSADM=$enableval) | |
ad6254c5 | 941 | AC_MSG_RESULT($FSADM) |
809fae91 | 942 | |
06f62ad1 AK |
943 | ################################################################################ |
944 | dnl -- enable dmeventd handling | |
945 | AC_MSG_CHECKING(whether to use dmeventd) | |
71082be4 ZK |
946 | AC_ARG_ENABLE(dmeventd, AC_HELP_STRING([--enable-dmeventd], |
947 | [enable the device-mapper event daemon]), | |
948 | DMEVENTD=$enableval) | |
06f62ad1 AK |
949 | AC_MSG_RESULT($DMEVENTD) |
950 | ||
f6fc418d AK |
951 | BUILD_DMEVENTD=$DMEVENTD |
952 | ||
06f62ad1 | 953 | dnl -- dmeventd currently requires internal mirror support |
2a9a80c9 PR |
954 | if test x$DMEVENTD = xyes; then |
955 | if test x$MIRRORS != xinternal; then | |
956 | AC_MSG_ERROR( | |
957 | --enable-dmeventd currently requires --with-mirrors=internal | |
958 | ) | |
959 | fi | |
960 | if test x$CMDLIB = xno; then | |
961 | AC_MSG_ERROR( | |
962 | --enable-dmeventd requires --enable-cmdlib to be used as well | |
963 | ) | |
964 | fi | |
06f62ad1 AK |
965 | fi |
966 | ||
15d91f5a | 967 | if test x$DMEVENTD = xyes; then |
72b2cb61 | 968 | AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.]) |
15d91f5a | 969 | fi |
f6fc418d AK |
970 | |
971 | ################################################################################ | |
972 | dnl -- getline included in recent libc | |
973 | ||
974 | AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1, | |
975 | [Define to 1 if getline is available.])) | |
976 | ||
977 | ################################################################################ | |
978 | dnl -- canonicalize_file_name included in recent libc | |
979 | ||
980 | AC_CHECK_LIB(c, canonicalize_file_name, | |
981 | AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1, | |
982 | [Define to 1 if canonicalize_file_name is available.])) | |
983 | ||
80992638 | 984 | ################################################################################ |
d0191583 | 985 | dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin |
795ca3e5 AK |
986 | if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]]; |
987 | then exec_prefix=""; | |
988 | fi; | |
989 | ||
80992638 | 990 | ################################################################################ |
8ce0cbda | 991 | dnl -- Check for dlopen |
19a2c6e0 | 992 | AC_CHECK_LIB(dl, dlopen, [ |
72b2cb61 | 993 | AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.]) |
19a2c6e0 ZK |
994 | DL_LIBS="-ldl" |
995 | HAVE_LIBDL=yes ], [ | |
996 | DL_LIBS= | |
997 | HAVE_LIBDL=no ]) | |
26e7f2e0 | 998 | |
80992638 | 999 | ################################################################################ |
8ce0cbda | 1000 | dnl -- Check for shared/static conflicts |
80992638 AK |
1001 | if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \ |
1002 | -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \ | |
cac52ca4 | 1003 | -o "x$RAID" = xshared \ |
4922197a | 1004 | \) -a "x$STATIC_LINK" = xyes ]]; |
d68a82ec | 1005 | then AC_MSG_ERROR( |
036f273a | 1006 | Features cannot be 'shared' when building statically |
d68a82ec | 1007 | ) |
036f273a AK |
1008 | fi |
1009 | ||
f30875db ZK |
1010 | ################################################################################ |
1011 | if [[ "$DMEVENTD" = yes -o "$CLVMD" != none ]] ; then | |
1012 | AC_CHECK_LIB([pthread], [pthread_mutex_lock], | |
1013 | [PTHREAD_LIBS="-lpthread"], hard_bailout) | |
1014 | fi | |
1015 | ||
d0191583 JM |
1016 | ################################################################################ |
1017 | dnl -- Disable selinux | |
1018 | AC_MSG_CHECKING(whether to enable selinux support) | |
71082be4 ZK |
1019 | AC_ARG_ENABLE(selinux, |
1020 | AC_HELP_STRING([--disable-selinux], [disable selinux support]), | |
1021 | SELINUX=$enableval) | |
d0191583 JM |
1022 | AC_MSG_RESULT($SELINUX) |
1023 | ||
80992638 | 1024 | ################################################################################ |
8a2fc586 | 1025 | dnl -- Check for selinux |
80992638 | 1026 | if test x$SELINUX = xyes; then |
f8f6ec92 ZK |
1027 | AC_CHECK_LIB([sepol], [sepol_check_context], [ |
1028 | AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.]) | |
1029 | SELINUX_LIBS="-lsepol"]) | |
8a2fc586 | 1030 | |
f8f6ec92 ZK |
1031 | AC_CHECK_LIB([selinux], [is_selinux_enabled], [ |
1032 | AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout) | |
7dfce0e4 | 1033 | AC_CHECK_HEADERS([selinux/label.h]) |
72b2cb61 | 1034 | AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.]) |
e1b8a236 | 1035 | SELINUX_LIBS="-lselinux $SELINUX_LIBS" |
f7f0854e | 1036 | SELINUX_PC="libselinux" |
f8f6ec92 | 1037 | HAVE_SELINUX=yes ], [ |
ad6254c5 | 1038 | AC_MSG_WARN(Disabling selinux) |
f8f6ec92 | 1039 | SELINUX_LIBS= |
f7f0854e | 1040 | SELINUX_PC= |
f8f6ec92 | 1041 | HAVE_SELINUX=no ]) |
036f273a | 1042 | fi |
d68a82ec | 1043 | |
8b1a3214 AK |
1044 | ################################################################################ |
1045 | dnl -- Check for realtime clock support | |
1046 | if test x$REALTIME = xyes; then | |
8b1a3214 | 1047 | AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no) |
8b1a3214 AK |
1048 | |
1049 | if test x$HAVE_REALTIME = xyes; then | |
1050 | AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.]) | |
1051 | LIBS="-lrt $LIBS" | |
1052 | else | |
1053 | AC_MSG_WARN(Disabling realtime clock) | |
1054 | fi | |
1055 | fi | |
1056 | ||
80992638 | 1057 | ################################################################################ |
8ce0cbda | 1058 | dnl -- Check for getopt |
d0191583 | 1059 | AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.])) |
b896caa1 | 1060 | |
80992638 | 1061 | ################################################################################ |
8ce0cbda | 1062 | dnl -- Check for readline (Shamelessly copied from parted 1.4.17) |
ea7cfb00 | 1063 | if test x$READLINE != xno; then |
539f4a77 ZK |
1064 | lvm_saved_libs=$LIBS |
1065 | AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib], | |
1066 | READLINE_LIBS=$ac_cv_search_tgetent, [ | |
1067 | if test "$READLINE" = yes; then | |
1068 | AC_MSG_ERROR( | |
1069 | [termcap could not be found which is required for the | |
1070 | --enable-readline option (which is enabled by default). Either disable readline | |
1071 | support with --disable-readline or download and install termcap from: | |
1072 | ftp.gnu.org/gnu/termcap | |
1073 | Note: if you are using precompiled packages you will also need the development | |
1074 | package as well (which may be called termcap-devel or something similar). | |
1075 | Note: (n)curses also seems to work as a substitute for termcap. This was | |
1076 | not found either - but you could try installing that as well.]) | |
1077 | fi]) | |
1078 | dnl -- Old systems may need extra termcap dependency explicitly in LIBS | |
1079 | AC_CHECK_LIB([readline], [readline], [ | |
1080 | AC_DEFINE([READLINE_SUPPORT], 1, | |
1081 | [Define to 1 to include the LVM readline shell.]) | |
1082 | dnl -- Try only with -lreadline and check for different symbol | |
1083 | LIBS=$lvm_saved_libs | |
1084 | AC_CHECK_LIB([readline], [rl_line_buffer], | |
1085 | [ READLINE_LIBS="-lreadline" ], [ | |
1086 | AC_MSG_RESULT([linking -lreadline with $READLINE_LIBS needed]) | |
1087 | READLINE_LIBS="-lreadline $READLINE_LIBS" | |
1088 | ]) ], [ | |
1089 | READLINE_LIBS= | |
1090 | if test "$READLINE" = yes; then | |
1091 | AC_MSG_ERROR( | |
1092 | [GNU Readline could not be found which is required for the | |
795ca3e5 AK |
1093 | --enable-readline option (which is enabled by default). Either disable readline |
1094 | support with --disable-readline or download and install readline from: | |
1095 | ftp.gnu.org/gnu/readline | |
1096 | Note: if you are using precompiled packages you will also need the development | |
539f4a77 ZK |
1097 | package as well (which may be called readline-devel or something similar).]) |
1098 | fi ]) | |
1099 | LIBS="$READLINE_LIBS $lvm_saved_libs" | |
1100 | AC_CHECK_FUNCS([rl_completion_matches]) | |
1101 | LIBS=$lvm_saved_libs | |
795ca3e5 AK |
1102 | fi |
1103 | ||
80992638 | 1104 | ################################################################################ |
8ce0cbda | 1105 | dnl -- Internationalisation stuff |
ad6254c5 | 1106 | AC_MSG_CHECKING(whether to enable internationalisation) |
71082be4 ZK |
1107 | AC_ARG_ENABLE(nls, |
1108 | AC_HELP_STRING([--enable-nls], [enable Native Language Support]), | |
1109 | INTL=$enableval, INTL=no) | |
ad6254c5 | 1110 | AC_MSG_RESULT($INTL) |
69792976 AK |
1111 | |
1112 | if test x$INTL = xyes; then | |
f6fc418d | 1113 | # FIXME - Move this - can be device-mapper too |
69792976 AK |
1114 | INTL_PACKAGE="lvm2" |
1115 | AC_PATH_PROG(MSGFMT, msgfmt) | |
1116 | if [[ "x$MSGFMT" == x ]]; | |
1117 | then AC_MSG_ERROR( | |
1118 | msgfmt not found in path $PATH | |
1119 | ) | |
69792976 AK |
1120 | fi; |
1121 | ||
1122 | AC_ARG_WITH(localedir, | |
71082be4 ZK |
1123 | AC_HELP_STRING([--with-localedir=DIR], |
1124 | [translation files in DIR | |
1125 | [[PREFIX/share/locale]]]), | |
1126 | LOCALEDIR=$withval, LOCALEDIR='${prefix}/share/locale') | |
69792976 AK |
1127 | fi |
1128 | ||
80992638 | 1129 | ################################################################################ |
4a7f3eb2 | 1130 | AC_ARG_WITH(confdir, |
71082be4 ZK |
1131 | AC_HELP_STRING([--with-confdir=DIR], |
1132 | [configuration files in DIR [[/etc]]]), | |
1133 | CONFDIR=$withval, CONFDIR="/etc") | |
0a62c911 AK |
1134 | |
1135 | AC_ARG_WITH(staticdir, | |
71082be4 ZK |
1136 | AC_HELP_STRING([--with-staticdir=DIR], |
1137 | [static binaries in DIR [[EPREFIX/sbin]]]), | |
1138 | STATICDIR=$withval, STATICDIR='${exec_prefix}/sbin') | |
0a62c911 | 1139 | |
68f2de6d | 1140 | AC_ARG_WITH(usrlibdir, |
71082be4 ZK |
1141 | AC_HELP_STRING([--with-usrlibdir=DIR], |
1142 | [usrlib in DIR [[PREFIX/lib]]]), | |
1143 | usrlibdir=$withval, usrlibdir='${prefix}/lib') | |
68f2de6d AK |
1144 | |
1145 | AC_ARG_WITH(usrsbindir, | |
71082be4 ZK |
1146 | AC_HELP_STRING([--with-usrsbindir=DIR], |
1147 | [usrsbin executables in DIR [[PREFIX/sbin]]]), | |
1148 | usrsbindir=$withval, usrsbindir='${prefix}/sbin') | |
68f2de6d | 1149 | |
5d518f1f AK |
1150 | ################################################################################ |
1151 | AC_ARG_WITH(udev_prefix, | |
71082be4 ZK |
1152 | AC_HELP_STRING([--with-udev-prefix=UPREFIX], |
1153 | [install udev rule files in UPREFIX [[EPREFIX]]]), | |
1154 | udev_prefix=$withval, udev_prefix='${exec_prefix}') | |
5d518f1f | 1155 | |
78ce7acc | 1156 | AC_ARG_WITH(udevdir, |
71082be4 ZK |
1157 | AC_HELP_STRING([--with-udevdir=DIR], |
1158 | [udev rules in DIR [[UPREFIX/lib/udev/rules.d]]]), | |
1159 | udevdir=$withval, udevdir='${udev_prefix}/lib/udev/rules.d') | |
5d518f1f | 1160 | |
ad6254c5 AK |
1161 | ################################################################################ |
1162 | dnl -- Ensure additional headers required | |
1163 | if test x$READLINE = xyes; then | |
1164 | AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out)) | |
1165 | fi | |
1166 | ||
5c7fc7c4 | 1167 | if test x$CLVMD != xnone; then |
ad6254c5 AK |
1168 | 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)) |
1169 | AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out)) | |
1170 | AC_FUNC_GETMNTENT | |
ad6254c5 AK |
1171 | AC_FUNC_SELECT_ARGTYPES |
1172 | fi | |
1173 | ||
ad6254c5 AK |
1174 | if test x$CLUSTER != xnone; then |
1175 | AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out)) | |
1176 | AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out)) | |
1177 | fi | |
1178 | ||
d911ec67 AK |
1179 | if test x$DMEVENTD = xyes; then |
1180 | AC_CHECK_HEADERS(arpa/inet.h,,AC_MSG_ERROR(bailing out)) | |
1181 | fi | |
1182 | ||
ad6254c5 AK |
1183 | if test x$HAVE_LIBDL = xyes; then |
1184 | AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out)) | |
1185 | fi | |
1186 | ||
1187 | if test x$INTL = xyes; then | |
1188 | AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out)) | |
1189 | fi | |
1190 | ||
5d518f1f AK |
1191 | if test x$UDEV_SYNC = xyes; then |
1192 | AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out)) | |
1193 | fi | |
1194 | ||
a653923f AK |
1195 | ################################################################################ |
1196 | AC_PATH_PROG(MODPROBE_CMD, modprobe) | |
1197 | ||
1198 | if test x$MODPROBE_CMD != x; then | |
72b2cb61 | 1199 | AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.]) |
a653923f AK |
1200 | fi |
1201 | ||
a9b601e2 ZK |
1202 | |
1203 | lvm_exec_prefix=$exec_prefix | |
1204 | test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$prefix | |
1205 | test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$ac_default_prefix | |
d2c11605 ZK |
1206 | LVM_PATH="$lvm_exec_prefix/sbin/lvm" |
1207 | AC_DEFINE_UNQUOTED(LVM_PATH, ["$LVM_PATH"], [Path to lvm binary.]) | |
b5c2529b ZK |
1208 | |
1209 | if test "$CLVMD" != none; then | |
1210 | clvmd_prefix=$ac_default_prefix | |
d2c11605 | 1211 | CLVMD_PATH="$clvmd_prefix/sbin/clvmd" |
b5c2529b | 1212 | test "$prefix" != NONE && clvmd_prefix=$prefix |
d2c11605 | 1213 | AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$CLVMD_PATH"], [Path to clvmd binary.]) |
b5c2529b ZK |
1214 | fi |
1215 | ||
80992638 | 1216 | ################################################################################ |
f6fc418d | 1217 | dnl -- dmeventd pidfile and executable path |
f6fc418d AK |
1218 | if test "$BUILD_DMEVENTD" = yes; then |
1219 | AC_ARG_WITH(dmeventd-pidfile, | |
71082be4 ZK |
1220 | AC_HELP_STRING([--with-dmeventd-pidfile=PATH], |
1221 | [dmeventd pidfile [[/var/run/dmeventd.pid]]]), | |
1222 | DMEVENTD_PIDFILE=$withval, | |
1223 | DMEVENTD_PIDFILE="/var/run/dmeventd.pid") | |
1224 | AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE, ["$DMEVENTD_PIDFILE"], | |
1225 | [Path to dmeventd pidfile.]) | |
f6fc418d AK |
1226 | fi |
1227 | ||
f6fc418d | 1228 | if test "$BUILD_DMEVENTD" = yes; then |
f6fc418d | 1229 | AC_ARG_WITH(dmeventd-path, |
71082be4 ZK |
1230 | AC_HELP_STRING([--with-dmeventd-path=PATH], |
1231 | [dmeventd path [[EPREFIX/sbin/dmeventd]]]), | |
1232 | DMEVENTD_PATH=$withval, | |
1233 | DMEVENTD_PATH="$lvm_exec_prefix/sbin/dmeventd") | |
1234 | AC_DEFINE_UNQUOTED(DMEVENTD_PATH, ["$DMEVENTD_PATH"], | |
1235 | [Path to dmeventd binary.]) | |
f6fc418d AK |
1236 | fi |
1237 | ||
8bae0a1e AK |
1238 | AH_TEMPLATE(DEFAULT_RUN_DIR, [Name of default run directory.]) |
1239 | AC_ARG_WITH(default-run-dir, | |
1240 | [ --with-default-run-dir=DIR Default run directory [[/var/run/lvm]] ], | |
1241 | [ DEFAULT_RUN_DIR="$withval" ], | |
1242 | [ DEFAULT_RUN_DIR="/var/run/lvm" ]) | |
1243 | AC_DEFINE_UNQUOTED(DEFAULT_RUN_DIR,["$DEFAULT_RUN_DIR"] ) | |
1244 | ||
3399ae32 AK |
1245 | ################################################################################ |
1246 | dnl -- various defaults | |
3399ae32 | 1247 | AC_ARG_WITH(default-system-dir, |
71082be4 ZK |
1248 | AC_HELP_STRING([--with-default-system-dir=DIR], |
1249 | [default LVM system directory [[/etc/lvm]]]), | |
1250 | DEFAULT_SYS_DIR=$withval, DEFAULT_SYS_DIR="/etc/lvm") | |
1251 | AC_DEFINE_UNQUOTED(DEFAULT_SYS_DIR, ["$DEFAULT_SYS_DIR"], | |
1252 | [Path to LVM system directory.]) | |
3399ae32 | 1253 | |
3399ae32 | 1254 | AC_ARG_WITH(default-archive-subdir, |
71082be4 ZK |
1255 | AC_HELP_STRING([--with-default-archive-subdir=SUBDIR], |
1256 | [default metadata archive subdir [[archive]]]), | |
1257 | DEFAULT_ARCHIVE_SUBDIR=$withval, DEFAULT_ARCHIVE_SUBDIR=archive) | |
1258 | AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE_SUBDIR, ["$DEFAULT_ARCHIVE_SUBDIR"], | |
1259 | [Name of default metadata archive subdirectory.]) | |
3399ae32 | 1260 | |
3399ae32 | 1261 | AC_ARG_WITH(default-backup-subdir, |
71082be4 ZK |
1262 | AC_HELP_STRING([--with-default-backup-subdir=SUBDIR], |
1263 | [default metadata backup subdir [[backup]]]), | |
1264 | DEFAULT_BACKUP_SUBDIR=$withval, DEFAULT_BACKUP_SUBDIR=backup) | |
1265 | AC_DEFINE_UNQUOTED(DEFAULT_BACKUP_SUBDIR, ["$DEFAULT_BACKUP_SUBDIR"], | |
1266 | [Name of default metadata backup subdirectory.]) | |
3399ae32 | 1267 | |
3399ae32 | 1268 | AC_ARG_WITH(default-cache-subdir, |
71082be4 ZK |
1269 | AC_HELP_STRING([--with-default-cache-subdir=SUBDIR], |
1270 | [default metadata cache subdir [[cache]]]), | |
1271 | DEFAULT_CACHE_SUBDIR=$withval, DEFAULT_CACHE_SUBDIR=cache) | |
1272 | AC_DEFINE_UNQUOTED(DEFAULT_CACHE_SUBDIR, ["$DEFAULT_CACHE_SUBDIR"], | |
1273 | [Name of default metadata cache subdirectory.]) | |
3399ae32 | 1274 | |
3399ae32 | 1275 | AC_ARG_WITH(default-locking-dir, |
71082be4 ZK |
1276 | AC_HELP_STRING([--with-default-locking-dir=DIR], |
1277 | [default locking directory [[/var/lock/lvm]]]), | |
1278 | DEFAULT_LOCK_DIR=$withval, DEFAULT_LOCK_DIR="/var/lock/lvm") | |
1279 | AC_DEFINE_UNQUOTED(DEFAULT_LOCK_DIR, ["$DEFAULT_LOCK_DIR"], | |
1280 | [Name of default locking directory.]) | |
3399ae32 | 1281 | |
7063efe1 MS |
1282 | ################################################################################ |
1283 | dnl -- Setup default data alignment | |
1284 | AC_ARG_WITH(default-data-alignment, | |
1285 | AC_HELP_STRING([--with-default-data-alignment=NUM], | |
1286 | [set the default data alignment in MiB [[1]]]), | |
1287 | DEFAULT_DATA_ALIGNMENT=$withval, DEFAULT_DATA_ALIGNMENT=1) | |
1288 | AC_DEFINE_UNQUOTED(DEFAULT_DATA_ALIGNMENT, [$DEFAULT_DATA_ALIGNMENT], | |
1289 | [Default data alignment.]) | |
1290 | ||
f6fc418d AK |
1291 | ################################################################################ |
1292 | dnl -- which kernel interface to use (ioctl only) | |
1293 | AC_MSG_CHECKING(for kernel interface choice) | |
1294 | AC_ARG_WITH(interface, | |
71082be4 ZK |
1295 | AC_HELP_STRING([--with-interface=IFACE], |
1296 | [choose kernel interface (ioctl) [[ioctl]]]), | |
1297 | interface=$withval, interface=ioctl) | |
f6fc418d AK |
1298 | if [[ "x$interface" != xioctl ]]; |
1299 | then | |
1300 | AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.) | |
1301 | fi | |
1302 | AC_MSG_RESULT($interface) | |
1303 | ||
1304 | ################################################################################ | |
db8b5af9 | 1305 | DM_LIB_VERSION="\"`cat "$srcdir"/VERSION_DM 2>/dev/null || echo Unknown`\"" |
f58b35b5 AK |
1306 | AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version]) |
1307 | ||
db8b5af9 | 1308 | DM_LIB_PATCHLEVEL=`cat "$srcdir"/VERSION_DM | $AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'` |
597c3f8e | 1309 | |
db8b5af9 | 1310 | LVM_VERSION="\"`cat "$srcdir"/VERSION 2>/dev/null || echo Unknown`\"" |
fae0c576 | 1311 | |
db8b5af9 | 1312 | VER=`cat "$srcdir"/VERSION` |
bf456146 | 1313 | LVM_RELEASE_DATE="\"`echo $VER | $SED 's/.* (//;s/).*//'`\"" |
ec6a6fbe AK |
1314 | VER=`echo "$VER" | $AWK '{print $1}'` |
1315 | LVM_RELEASE="\"`echo "$VER" | $AWK -F '-' '{print $2}'`\"" | |
1316 | VER=`echo "$VER" | $AWK -F '-' '{print $1}'` | |
1317 | LVM_MAJOR=`echo "$VER" | $AWK -F '.' '{print $1}'` | |
1318 | LVM_MINOR=`echo "$VER" | $AWK -F '.' '{print $2}'` | |
bf456146 AK |
1319 | LVM_PATCHLEVEL=`echo "$VER" | $AWK -F '[[(.]]' '{print $3}'` |
1320 | LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'` | |
ec6a6fbe | 1321 | |
80992638 | 1322 | ################################################################################ |
572fefeb | 1323 | AC_SUBST(APPLIB) |
aaa2e046 | 1324 | AC_SUBST(AWK) |
66fd4529 | 1325 | AC_SUBST(BUILD_CMIRRORD) |
d0191583 | 1326 | AC_SUBST(BUILD_DMEVENTD) |
615534d3 | 1327 | AC_SUBST(BUILD_LVMETAD) |
b896caa1 | 1328 | AC_SUBST(CFLAGS) |
d0191583 | 1329 | AC_SUBST(CFLOW_CMD) |
8106cdd5 | 1330 | AC_SUBST(CLDFLAGS) |
8106cdd5 | 1331 | AC_SUBST(CLDNOWHOLEARCHIVE) |
d0191583 JM |
1332 | AC_SUBST(CLDWHOLEARCHIVE) |
1333 | AC_SUBST(CLUSTER) | |
1334 | AC_SUBST(CLVMD) | |
34b6075d | 1335 | AC_SUBST(CLVMD_CMANAGERS) |
d2c11605 | 1336 | AC_SUBST(CLVMD_PATH) |
a946372e AK |
1337 | AC_SUBST(CMAN_CFLAGS) |
1338 | AC_SUBST(CMAN_LIBS) | |
b6d7a484 AK |
1339 | AC_SUBST(CMAP_CFLAGS) |
1340 | AC_SUBST(CMAP_LIBS) | |
d0191583 | 1341 | AC_SUBST(CMDLIB) |
edf47283 AK |
1342 | AC_SUBST(CONFDB_CFLAGS) |
1343 | AC_SUBST(CONFDB_LIBS) | |
1344 | AC_SUBST(CONFDIR) | |
d0191583 | 1345 | AC_SUBST(COPTIMISE_FLAG) |
edf47283 AK |
1346 | AC_SUBST(CPG_CFLAGS) |
1347 | AC_SUBST(CPG_LIBS) | |
d0191583 | 1348 | AC_SUBST(CSCOPE_CMD) |
8ef2b021 | 1349 | AC_SUBST(DEBUG) |
3399ae32 AK |
1350 | AC_SUBST(DEFAULT_SYS_DIR) |
1351 | AC_SUBST(DEFAULT_ARCHIVE_SUBDIR) | |
1352 | AC_SUBST(DEFAULT_BACKUP_SUBDIR) | |
1353 | AC_SUBST(DEFAULT_CACHE_SUBDIR) | |
7063efe1 | 1354 | AC_SUBST(DEFAULT_DATA_ALIGNMENT) |
3399ae32 | 1355 | AC_SUBST(DEFAULT_LOCK_DIR) |
b1f08e51 | 1356 | AC_SUBST(DEFAULT_RUN_DIR) |
199e490e | 1357 | AC_SUBST(DEVMAPPER) |
a946372e AK |
1358 | AC_SUBST(DLM_CFLAGS) |
1359 | AC_SUBST(DLM_LIBS) | |
19a2c6e0 | 1360 | AC_SUBST(DL_LIBS) |
d0191583 | 1361 | AC_SUBST(DMEVENTD) |
d1e8046f | 1362 | AC_SUBST(DMEVENTD_PATH) |
d0191583 JM |
1363 | AC_SUBST(DM_COMPAT) |
1364 | AC_SUBST(DM_DEVICE_GID) | |
1365 | AC_SUBST(DM_DEVICE_MODE) | |
1366 | AC_SUBST(DM_DEVICE_UID) | |
1367 | AC_SUBST(DM_IOCTLS) | |
1368 | AC_SUBST(DM_LIB_VERSION) | |
597c3f8e | 1369 | AC_SUBST(DM_LIB_PATCHLEVEL) |
bf09a320 | 1370 | AC_SUBST(ELDFLAGS) |
d0191583 | 1371 | AC_SUBST(FSADM) |
26e7f2e0 | 1372 | AC_SUBST(HAVE_LIBDL) |
8b1a3214 | 1373 | AC_SUBST(HAVE_REALTIME) |
d0191583 JM |
1374 | AC_SUBST(INTL) |
1375 | AC_SUBST(INTL_PACKAGE) | |
1376 | AC_SUBST(JOBS) | |
1377 | AC_SUBST(LDDEPS) | |
1378 | AC_SUBST(LIBS) | |
1379 | AC_SUBST(LIB_SUFFIX) | |
69792976 | 1380 | AC_SUBST(LOCALEDIR) |
d0191583 JM |
1381 | AC_SUBST(LVM1) |
1382 | AC_SUBST(LVM1_FALLBACK) | |
d0191583 | 1383 | AC_SUBST(LVM_VERSION) |
bf456146 | 1384 | AC_SUBST(LVM_LIBAPI) |
ec6a6fbe AK |
1385 | AC_SUBST(LVM_MAJOR) |
1386 | AC_SUBST(LVM_MINOR) | |
1387 | AC_SUBST(LVM_PATCHLEVEL) | |
d2c11605 | 1388 | AC_SUBST(LVM_PATH) |
ec6a6fbe AK |
1389 | AC_SUBST(LVM_RELEASE) |
1390 | AC_SUBST(LVM_RELEASE_DATE) | |
d0191583 | 1391 | AC_SUBST(MIRRORS) |
cac52ca4 | 1392 | AC_SUBST(MSGFMT) |
e40d44be | 1393 | AC_SUBST(OCF) |
349da06c | 1394 | AC_SUBST(OCFDIR) |
d0191583 JM |
1395 | AC_SUBST(PKGCONFIG) |
1396 | AC_SUBST(POOL) | |
f30875db | 1397 | AC_SUBST(PTHREAD_LIBS) |
edf47283 AK |
1398 | AC_SUBST(QUORUM_CFLAGS) |
1399 | AC_SUBST(QUORUM_LIBS) | |
cac52ca4 | 1400 | AC_SUBST(RAID) |
539f4a77 | 1401 | AC_SUBST(READLINE_LIBS) |
cac52ca4 | 1402 | AC_SUBST(REPLICATORS) |
90c80887 AK |
1403 | AC_SUBST(SACKPT_CFLAGS) |
1404 | AC_SUBST(SACKPT_LIBS) | |
a946372e AK |
1405 | AC_SUBST(SALCK_CFLAGS) |
1406 | AC_SUBST(SALCK_LIBS) | |
e1b8a236 | 1407 | AC_SUBST(SELINUX_LIBS) |
f7f0854e | 1408 | AC_SUBST(SELINUX_PC) |
d0191583 | 1409 | AC_SUBST(SNAPSHOTS) |
0a62c911 | 1410 | AC_SUBST(STATICDIR) |
d0191583 | 1411 | AC_SUBST(STATIC_LINK) |
1033d120 | 1412 | AC_SUBST(TESTING) |
3ba4a195 | 1413 | AC_SUBST(THIN) |
db724a44 | 1414 | AC_SUBST(UDEV_LIBS) |
f7f0854e | 1415 | AC_SUBST(UDEV_PC) |
5d518f1f | 1416 | AC_SUBST(UDEV_RULES) |
4df024c4 | 1417 | AC_SUBST(UDEV_SYNC) |
5da88e5b PR |
1418 | AC_SUBST(CUNIT_LIBS) |
1419 | AC_SUBST(CUNIT_CFLAGS) | |
23b059e7 | 1420 | AC_SUBST(WRITE_INSTALL) |
395d204d | 1421 | AC_SUBST(DMEVENTD_PIDFILE) |
f6fc418d AK |
1422 | AC_SUBST(interface) |
1423 | AC_SUBST(kerneldir) | |
1424 | AC_SUBST(missingkernel) | |
1425 | AC_SUBST(kernelvsn) | |
1426 | AC_SUBST(tmpdir) | |
5d518f1f AK |
1427 | AC_SUBST(udev_prefix) |
1428 | AC_SUBST(udevdir) | |
68f2de6d AK |
1429 | AC_SUBST(usrlibdir) |
1430 | AC_SUBST(usrsbindir) | |
8106cdd5 | 1431 | |
80992638 | 1432 | ################################################################################ |
d3a356b4 | 1433 | dnl -- First and last lines should not contain files to generate in order to |
8ce0cbda | 1434 | dnl -- keep utility scripts running properly |
d3a356b4 JM |
1435 | AC_CONFIG_FILES([ |
1436 | Makefile | |
1437 | make.tmpl | |
1438 | daemons/Makefile | |
1439 | daemons/clvmd/Makefile | |
5d311afb | 1440 | daemons/cmirrord/Makefile |
13dd3138 | 1441 | daemons/common/Makefile |
f6fc418d AK |
1442 | daemons/dmeventd/Makefile |
1443 | daemons/dmeventd/libdevmapper-event.pc | |
b7edb5bf | 1444 | daemons/dmeventd/plugins/Makefile |
d3d98fdc | 1445 | daemons/dmeventd/plugins/lvm2/Makefile |
3041b72f | 1446 | daemons/dmeventd/plugins/raid/Makefile |
f6fc418d AK |
1447 | daemons/dmeventd/plugins/mirror/Makefile |
1448 | daemons/dmeventd/plugins/snapshot/Makefile | |
2bc1d759 | 1449 | daemons/dmeventd/plugins/thin/Makefile |
615534d3 | 1450 | daemons/lvmetad/Makefile |
d3a356b4 | 1451 | doc/Makefile |
da05c479 | 1452 | doc/example.conf |
db8b5af9 | 1453 | include/.symlinks |
f6fc418d AK |
1454 | include/Makefile |
1455 | lib/Makefile | |
d3a356b4 JM |
1456 | lib/format1/Makefile |
1457 | lib/format_pool/Makefile | |
1458 | lib/locking/Makefile | |
1459 | lib/mirror/Makefile | |
8fea97b7 | 1460 | lib/replicator/Makefile |
ec6a6fbe | 1461 | lib/misc/lvm-version.h |
40dbaac8 | 1462 | lib/raid/Makefile |
d3a356b4 | 1463 | lib/snapshot/Makefile |
3ba4a195 | 1464 | lib/thin/Makefile |
f6fc418d AK |
1465 | libdm/Makefile |
1466 | libdm/libdevmapper.pc | |
e0c64c6c | 1467 | liblvm/Makefile |
70046623 | 1468 | liblvm/liblvm2app.pc |
f6fc418d AK |
1469 | man/Makefile |
1470 | po/Makefile | |
2de38033 | 1471 | scripts/clvmd_init_red_hat |
81410c8f | 1472 | scripts/cmirrord_init_red_hat |
595eaf92 | 1473 | scripts/lvm2_monitoring_init_red_hat |
395d204d PR |
1474 | scripts/dm_event_systemd_red_hat.service |
1475 | scripts/lvm2_monitoring_systemd_red_hat.service | |
d3a356b4 | 1476 | scripts/Makefile |
f6fc418d | 1477 | test/Makefile |
c7e363f9 | 1478 | test/api/Makefile |
d4fed285 | 1479 | test/unit/Makefile |
d3a356b4 | 1480 | tools/Makefile |
5d518f1f | 1481 | udev/Makefile |
66392e66 | 1482 | unit-tests/datastruct/Makefile |
15106c50 | 1483 | unit-tests/regex/Makefile |
52e1564f | 1484 | unit-tests/mm/Makefile |
7a197a62 AK |
1485 | ]) |
1486 | AC_OUTPUT | |
2dc95e1c AK |
1487 | |
1488 | if test x$ODIRECT != xyes; then | |
ad6254c5 | 1489 | AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up) |
2dc95e1c | 1490 | fi |