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