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