]>
Commit | Line | Data |
---|---|---|
d0191583 | 1 | ############################################################################### |
ad6254c5 | 2 | ## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved. |
d0191583 | 3 | ## Copyright (C) 2004-2008 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 | ||
7a197a62 | 14 | AC_PREREQ(2.57) |
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*) | |
8ce0cbda | 31 | COPTIMISE_FLAG="-O2" |
80992638 | 32 | CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym" |
8106cdd5 AK |
33 | CLDWHOLEARCHIVE="-Wl,-whole-archive" |
34 | CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive" | |
80992638 AK |
35 | LDDEPS="$LDDEPS .export.sym" |
36 | LDFLAGS="$LDFLAGS -Wl,--export-dynamic" | |
d0191583 | 37 | LIB_SUFFIX=so |
8106cdd5 | 38 | DEVMAPPER=yes |
1a9ea74d | 39 | ODIRECT=yes |
d0191583 | 40 | DM_IOCTLS=yes |
80992638 | 41 | SELINUX=yes |
8b1a3214 | 42 | REALTIME=yes |
d3c8211f | 43 | CLUSTER=internal |
d0191583 JM |
44 | FSADM=no |
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 |
8b1a3214 | 57 | REALTIME=no |
d3c8211f | 58 | CLUSTER=none |
d0191583 JM |
59 | FSADM=no |
60 | ;; | |
b896caa1 AK |
61 | esac |
62 | ||
80992638 | 63 | ################################################################################ |
8ce0cbda | 64 | dnl -- Checks for programs. |
5951ef33 | 65 | AC_PROG_SED |
8ce0cbda AK |
66 | AC_PROG_AWK |
67 | AC_PROG_CC | |
d0191583 JM |
68 | |
69 | dnl probably no longer needed in 2008, but... | |
70 | AC_PROG_GCC_TRADITIONAL | |
8ce0cbda AK |
71 | AC_PROG_INSTALL |
72 | AC_PROG_LN_S | |
73 | AC_PROG_MAKE_SET | |
fddafd51 | 74 | AC_PROG_MKDIR_P |
5556819a | 75 | AC_PROG_RANLIB |
8a2fc586 AK |
76 | AC_PATH_PROG(CFLOW_CMD, cflow) |
77 | AC_PATH_PROG(CSCOPE_CMD, cscope) | |
8ce0cbda AK |
78 | |
79 | ################################################################################ | |
d0191583 | 80 | dnl -- Check for header files. |
80992638 AK |
81 | AC_HEADER_DIRENT |
82 | AC_HEADER_STDC | |
ad6254c5 AK |
83 | AC_HEADER_SYS_WAIT |
84 | AC_HEADER_TIME | |
85 | ||
d0191583 JM |
86 | AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \ |
87 | libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h sys/wait.h time.h], , | |
88 | [AC_MSG_ERROR(bailing out)]) | |
ad6254c5 AK |
89 | |
90 | case "$host_os" in | |
91 | linux*) | |
92 | AC_CHECK_HEADERS(asm/byteorder.h linux/fs.h malloc.h,,AC_MSG_ERROR(bailing out)) ;; | |
93 | darwin*) | |
94 | AC_CHECK_HEADERS(machine/endian.h sys/disk.h,,AC_MSG_ERROR(bailing out)) ;; | |
95 | esac | |
80992638 | 96 | |
d0191583 JM |
97 | AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \ |
98 | stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \ | |
99 | sys/types.h unistd.h], , [AC_MSG_ERROR(bailing out)]) | |
100 | AC_CHECK_HEADERS(termios.h sys/statvfs.h) | |
101 | ||
80992638 | 102 | ################################################################################ |
d0191583 | 103 | dnl -- Check for typedefs, structures, and compiler characteristics. |
80992638 AK |
104 | AC_C_CONST |
105 | AC_C_INLINE | |
d0191583 | 106 | AC_CHECK_MEMBERS([struct stat.st_rdev]) |
80992638 AK |
107 | AC_TYPE_OFF_T |
108 | AC_TYPE_PID_T | |
d0191583 | 109 | AC_TYPE_SIGNAL |
80992638 | 110 | AC_TYPE_SIZE_T |
ad6254c5 | 111 | AC_TYPE_MODE_T |
7a197a62 | 112 | AC_CHECK_MEMBERS([struct stat.st_rdev]) |
ad6254c5 AK |
113 | AC_STRUCT_TM |
114 | ||
115 | ################################################################################ | |
116 | dnl -- Check for functions | |
d0191583 JM |
117 | AC_CHECK_FUNCS([gethostname getpagesize memset mkdir rmdir munmap setlocale \ |
118 | strcasecmp strchr strdup strncasecmp strerror strrchr strstr strtol strtoul \ | |
119 | uname], , [AC_MSG_ERROR(bailing out)]) | |
ad6254c5 AK |
120 | AC_FUNC_ALLOCA |
121 | AC_FUNC_CLOSEDIR_VOID | |
122 | AC_FUNC_FORK | |
123 | AC_FUNC_LSTAT | |
124 | AC_FUNC_MALLOC | |
125 | AC_FUNC_MEMCMP | |
126 | AC_FUNC_MMAP | |
127 | AC_FUNC_STAT | |
128 | AC_FUNC_STRTOD | |
d0191583 | 129 | AC_FUNC_VPRINTF |
80992638 AK |
130 | |
131 | ################################################################################ | |
8ce0cbda | 132 | dnl -- Prefix is /usr by default, the exec_prefix default is setup later |
795ca3e5 AK |
133 | AC_PREFIX_DEFAULT(/usr) |
134 | ||
80992638 | 135 | ################################################################################ |
8ce0cbda | 136 | dnl -- Setup the ownership of the files |
ad6254c5 | 137 | AC_MSG_CHECKING(file owner) |
80992638 AK |
138 | OWNER="root" |
139 | ||
795ca3e5 | 140 | AC_ARG_WITH(user, |
d0191583 | 141 | [ --with-user=USER Set the owner of installed files [[USER=root]] ], |
a38df97f | 142 | [ OWNER="$withval" ]) |
ad6254c5 | 143 | AC_MSG_RESULT($OWNER) |
a38df97f AK |
144 | |
145 | if test x$OWNER != x; then | |
146 | OWNER="-o $OWNER" | |
147 | fi | |
795ca3e5 | 148 | |
80992638 | 149 | ################################################################################ |
8ce0cbda | 150 | dnl -- Setup the group ownership of the files |
ad6254c5 | 151 | AC_MSG_CHECKING(group owner) |
80992638 | 152 | GROUP="root" |
795ca3e5 | 153 | AC_ARG_WITH(group, |
d0191583 | 154 | [ --with-group=GROUP Set the group owner of installed files [[GROUP=root]] ], |
a38df97f | 155 | [ GROUP="$withval" ]) |
ad6254c5 | 156 | AC_MSG_RESULT($GROUP) |
a38df97f AK |
157 | |
158 | if test x$GROUP != x; then | |
159 | GROUP="-g $GROUP" | |
160 | fi | |
795ca3e5 | 161 | |
80992638 | 162 | ################################################################################ |
7d1552c9 | 163 | dnl -- LVM1 tool fallback option |
ad6254c5 | 164 | AC_MSG_CHECKING(whether to enable lvm1 fallback) |
7d1552c9 AK |
165 | AC_ARG_ENABLE(lvm1_fallback, [ --enable-lvm1_fallback Use this to fall back and use LVM1 binaries if |
166 | device-mapper is missing from the kernel], LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no) | |
ad6254c5 | 167 | AC_MSG_RESULT($LVM1_FALLBACK) |
7d1552c9 AK |
168 | |
169 | if test x$LVM1_FALLBACK = xyes; then | |
72b2cb61 | 170 | 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 |
171 | fi |
172 | ||
80992638 | 173 | ################################################################################ |
5a52dca9 | 174 | dnl -- format1 inclusion type |
ad6254c5 | 175 | AC_MSG_CHECKING(whether to include support for lvm1 metadata) |
5a52dca9 AK |
176 | AC_ARG_WITH(lvm1, |
177 | [ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none | |
178 | [TYPE=internal] ], | |
179 | [ LVM1="$withval" ], | |
180 | [ LVM1="internal" ]) | |
ad6254c5 | 181 | AC_MSG_RESULT($LVM1) |
5a52dca9 AK |
182 | |
183 | if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]]; | |
184 | then AC_MSG_ERROR( | |
185 | --with-lvm1 parameter invalid | |
186 | ) | |
5a52dca9 AK |
187 | fi; |
188 | ||
b896caa1 | 189 | if test x$LVM1 = xinternal; then |
72b2cb61 | 190 | AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.]) |
b896caa1 AK |
191 | fi |
192 | ||
80992638 | 193 | ################################################################################ |
d8ac0fbc | 194 | dnl -- format_pool inclusion type |
ad6254c5 | 195 | AC_MSG_CHECKING(whether to include support for GFS pool metadata) |
d8ac0fbc | 196 | AC_ARG_WITH(pool, |
60329273 | 197 | [ --with-pool=TYPE GFS pool read-only support: internal/shared/none |
d8ac0fbc AK |
198 | [TYPE=internal] ], |
199 | [ POOL="$withval" ], | |
200 | [ POOL="internal" ]) | |
ad6254c5 | 201 | AC_MSG_RESULT($POOL) |
d8ac0fbc AK |
202 | |
203 | if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]]; | |
204 | then AC_MSG_ERROR( | |
205 | --with-pool parameter invalid | |
206 | ) | |
d8ac0fbc AK |
207 | fi; |
208 | ||
209 | if test x$POOL = xinternal; then | |
72b2cb61 | 210 | AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.]) |
d8ac0fbc AK |
211 | fi |
212 | ||
80992638 | 213 | ################################################################################ |
d3c8211f | 214 | dnl -- cluster_locking inclusion type |
ad6254c5 | 215 | AC_MSG_CHECKING(whether to include support for cluster locking) |
d3c8211f AK |
216 | AC_ARG_WITH(cluster, |
217 | [ --with-cluster=TYPE Cluster LVM locking support: internal/shared/none | |
218 | [TYPE=internal] ], | |
219 | [ CLUSTER="$withval" ]) | |
ad6254c5 | 220 | AC_MSG_RESULT($CLUSTER) |
d3c8211f AK |
221 | |
222 | if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]]; | |
223 | then AC_MSG_ERROR( | |
224 | --with-cluster parameter invalid | |
225 | ) | |
d3c8211f AK |
226 | fi; |
227 | ||
228 | if test x$CLUSTER = xinternal; then | |
72b2cb61 | 229 | AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.]) |
d3c8211f | 230 | fi |
d8ac0fbc | 231 | |
80992638 | 232 | ################################################################################ |
4922197a | 233 | dnl -- snapshots inclusion type |
ad6254c5 | 234 | AC_MSG_CHECKING(whether to include snapshots) |
4922197a AK |
235 | AC_ARG_WITH(snapshots, |
236 | [ --with-snapshots=TYPE Snapshot support: internal/shared/none | |
237 | [TYPE=internal] ], | |
238 | [ SNAPSHOTS="$withval" ], | |
239 | [ SNAPSHOTS="internal" ]) | |
ad6254c5 | 240 | AC_MSG_RESULT($SNAPSHOTS) |
4922197a AK |
241 | |
242 | if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]]; | |
243 | then AC_MSG_ERROR( | |
244 | --with-snapshots parameter invalid | |
245 | ) | |
4922197a AK |
246 | fi; |
247 | ||
248 | if test x$SNAPSHOTS = xinternal; then | |
72b2cb61 | 249 | AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.]) |
4922197a AK |
250 | fi |
251 | ||
80992638 | 252 | ################################################################################ |
4922197a | 253 | dnl -- mirrors inclusion type |
ad6254c5 | 254 | AC_MSG_CHECKING(whether to include mirrors) |
4922197a AK |
255 | AC_ARG_WITH(mirrors, |
256 | [ --with-mirrors=TYPE Mirror support: internal/shared/none | |
257 | [TYPE=internal] ], | |
258 | [ MIRRORS="$withval" ], | |
259 | [ MIRRORS="internal" ]) | |
ad6254c5 | 260 | AC_MSG_RESULT($MIRRORS) |
4922197a AK |
261 | |
262 | if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]]; | |
263 | then AC_MSG_ERROR( | |
264 | --with-mirrors parameter invalid | |
265 | ) | |
4922197a AK |
266 | fi; |
267 | ||
268 | if test x$MIRRORS = xinternal; then | |
72b2cb61 | 269 | AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.]) |
4922197a AK |
270 | fi |
271 | ||
80992638 | 272 | ################################################################################ |
1b523347 | 273 | dnl -- Disable readline |
ad6254c5 | 274 | AC_MSG_CHECKING(whether to enable readline) |
2c189a57 | 275 | AC_ARG_ENABLE([readline], |
1b523347 | 276 | [ --disable-readline Disable readline support], |
ea7cfb00 | 277 | [READLINE=$enableval], [READLINE=maybe]) |
ad6254c5 | 278 | AC_MSG_RESULT($READLINE) |
795ca3e5 | 279 | |
8b1a3214 AK |
280 | ################################################################################ |
281 | dnl -- Disable realtime clock support | |
282 | AC_MSG_CHECKING(whether to enable realtime support) | |
3d978351 | 283 | AC_ARG_ENABLE(realtime, [ --disable-realtime Disable realtime clock support], |
8b1a3214 AK |
284 | REALTIME=$enableval) |
285 | AC_MSG_RESULT($REALTIME) | |
286 | ||
80992638 | 287 | ################################################################################ |
8ce0cbda | 288 | dnl -- Build cluster LVM daemon |
ad6254c5 | 289 | AC_MSG_CHECKING(whether to build cluster LVM daemon) |
a266258f | 290 | AC_ARG_WITH(clvmd, |
5c7fc7c4 | 291 | [ --with-clvmd=TYPE Build cluster LVM Daemon: cman/gulm/none/all |
a266258f AK |
292 | [TYPE=none] ], |
293 | [ CLVMD="$withval" ], | |
294 | [ CLVMD="none" ]) | |
295 | if test x$CLVMD = xyes; then | |
5c7fc7c4 | 296 | CLVMD=all |
b1098701 | 297 | fi |
ad6254c5 | 298 | AC_MSG_RESULT($CLVMD) |
80992638 | 299 | |
8ce0cbda | 300 | dnl -- If clvmd enabled without cluster locking, automagically include it |
a266258f | 301 | if test x$CLVMD != xnone && test x$CLUSTER = xnone; then |
d3c8211f AK |
302 | CLUSTER=internal |
303 | fi | |
d3c8211f | 304 | |
80992638 | 305 | ################################################################################ |
8ce0cbda | 306 | dnl -- Enable debugging |
ad6254c5 AK |
307 | AC_MSG_CHECKING(whether to enable debugging) |
308 | AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging], | |
d0191583 | 309 | DEBUG=$enableval, DEBUG=no) |
ad6254c5 | 310 | AC_MSG_RESULT($DEBUG) |
8ef2b021 | 311 | |
8ce0cbda AK |
312 | dnl -- Normally turn off optimisation for debug builds |
313 | if test x$DEBUG = xyes; then | |
314 | COPTIMISE_FLAG= | |
8a2fc586 AK |
315 | else |
316 | CSCOPE_CMD= | |
8ce0cbda AK |
317 | fi |
318 | ||
319 | ################################################################################ | |
320 | dnl -- Override optimisation | |
ad6254c5 | 321 | AC_MSG_CHECKING(for C optimisation flag) |
8ce0cbda | 322 | AC_ARG_WITH(optimisation, |
d0191583 | 323 | [ --with-optimisation=OPT C optimisation flag [[OPT=-O2]] ], |
8ce0cbda | 324 | [ COPTIMISE_FLAG="$withval" ]) |
ad6254c5 | 325 | AC_MSG_RESULT($COPTIMISE_FLAG) |
8ce0cbda | 326 | |
fddafd51 ZK |
327 | ################################################################################ |
328 | dnl -- Enable profiling | |
5556819a | 329 | AC_MSG_CHECKING(whether to gather gcov profiling data) |
fddafd51 | 330 | AC_ARG_ENABLE(profiling, |
5556819a AK |
331 | AC_HELP_STRING(--enable-profiling, [Gather gcov profiling data]), |
332 | PROFILING=$enableval, PROFILING=no) | |
333 | AC_MSG_RESULT($PROFILING) | |
334 | ||
335 | if test "x$PROFILING" = xyes; then | |
336 | COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage" | |
b145d876 ZK |
337 | AC_PATH_PROG(LCOV, lcov, no) |
338 | AC_PATH_PROG(GENHTML, genhtml, no) | |
339 | if test "$LCOV" = no -o "$GENHTML" = no ; then | |
340 | AC_MSG_ERROR([lcov and genhtml are required for profiling]) | |
341 | fi | |
5556819a | 342 | fi |
fddafd51 | 343 | |
80992638 | 344 | ################################################################################ |
8ce0cbda | 345 | dnl -- Disable devmapper |
ad6254c5 AK |
346 | AC_MSG_CHECKING(whether to use device-mapper) |
347 | AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable device-mapper interaction], | |
348 | DEVMAPPER=$enableval) | |
349 | AC_MSG_RESULT($DEVMAPPER) | |
199e490e | 350 | |
b896caa1 | 351 | if test x$DEVMAPPER = xyes; then |
72b2cb61 | 352 | AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable device-mapper interaction.]) |
b896caa1 AK |
353 | fi |
354 | ||
80992638 | 355 | ################################################################################ |
8ce0cbda | 356 | dnl -- Disable O_DIRECT |
ad6254c5 AK |
357 | AC_MSG_CHECKING(whether to enable O_DIRECT) |
358 | AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT], | |
359 | ODIRECT=$enableval) | |
360 | AC_MSG_RESULT($ODIRECT) | |
2dc95e1c AK |
361 | |
362 | if test x$ODIRECT = xyes; then | |
72b2cb61 | 363 | AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.]) |
2dc95e1c AK |
364 | fi |
365 | ||
80992638 | 366 | ################################################################################ |
8ce0cbda | 367 | dnl -- Enable cmdlib |
ad6254c5 AK |
368 | AC_MSG_CHECKING(whether to compile liblvm2cmd.so) |
369 | AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library], | |
370 | CMDLIB=$enableval, CMDLIB=no) | |
371 | AC_MSG_RESULT($CMDLIB) | |
aa4d1e31 | 372 | AC_SUBST([LVM2CMD_LIB]) |
2a9a80c9 | 373 | test x$CMDLIB = xyes \ |
aa4d1e31 JM |
374 | && LVM2CMD_LIB=-llvm2cmd \ |
375 | || LVM2CMD_LIB= | |
8106cdd5 | 376 | |
2a9a80c9 | 377 | |
80992638 | 378 | ################################################################################ |
8ce0cbda | 379 | dnl -- Enable fsadm |
1995c9ff | 380 | AC_MSG_CHECKING(whether to install fsadm) |
ad6254c5 AK |
381 | AC_ARG_ENABLE(fsadm, [ --enable-fsadm Enable fsadm], |
382 | FSADM=$enableval) | |
383 | AC_MSG_RESULT($FSADM) | |
809fae91 | 384 | |
06f62ad1 AK |
385 | ################################################################################ |
386 | dnl -- enable dmeventd handling | |
387 | AC_MSG_CHECKING(whether to use dmeventd) | |
388 | AC_ARG_ENABLE(dmeventd, [ --enable-dmeventd Enable the device-mapper event daemon], | |
389 | DMEVENTD=$enableval) | |
390 | AC_MSG_RESULT($DMEVENTD) | |
391 | ||
392 | dnl -- dmeventd currently requires internal mirror support | |
2a9a80c9 PR |
393 | if test x$DMEVENTD = xyes; then |
394 | if test x$MIRRORS != xinternal; then | |
395 | AC_MSG_ERROR( | |
396 | --enable-dmeventd currently requires --with-mirrors=internal | |
397 | ) | |
398 | fi | |
399 | if test x$CMDLIB = xno; then | |
400 | AC_MSG_ERROR( | |
401 | --enable-dmeventd requires --enable-cmdlib to be used as well | |
402 | ) | |
403 | fi | |
06f62ad1 AK |
404 | fi |
405 | ||
15d91f5a | 406 | if test x$DMEVENTD = xyes; then |
72b2cb61 | 407 | AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.]) |
15d91f5a | 408 | fi |
80992638 | 409 | ################################################################################ |
d0191583 | 410 | dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin |
795ca3e5 AK |
411 | if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]]; |
412 | then exec_prefix=""; | |
413 | fi; | |
414 | ||
80992638 | 415 | ################################################################################ |
8ce0cbda | 416 | dnl -- Check for termcap (Shamelessly copied from parted 1.4.17) |
ea7cfb00 JM |
417 | if test x$READLINE != xno; then |
418 | AC_SEARCH_LIBS([tgetent], [ncurses curses termcap termlib], | |
419 | [tg_found=yes], [tg_found=no]) | |
420 | test x$READLINE:$tg_found = xyes:no && | |
421 | AC_MSG_ERROR( | |
795ca3e5 AK |
422 | termcap could not be found which is required for the |
423 | --enable-readline option (which is enabled by default). Either disable readline | |
424 | support with --disable-readline or download and install termcap from: | |
425 | ftp.gnu.org/gnu/termcap | |
426 | Note: if you are using precompiled packages you will also need the development | |
427 | package as well (which may be called termcap-devel or something similar). | |
428 | Note: (n)curses also seems to work as a substitute for termcap. This was | |
429 | not found either - but you could try installing that as well. | |
430 | ) | |
795ca3e5 AK |
431 | fi |
432 | ||
80992638 | 433 | ################################################################################ |
8ce0cbda | 434 | dnl -- Check for dlopen |
26e7f2e0 AK |
435 | AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no) |
436 | ||
7e9e9502 | 437 | if [[ "x$HAVE_LIBDL" = xyes ]]; then |
72b2cb61 | 438 | AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.]) |
26e7f2e0 | 439 | LIBS="-ldl $LIBS" |
d68a82ec AK |
440 | else |
441 | HAVE_LIBDL=no | |
26e7f2e0 AK |
442 | fi |
443 | ||
80992638 | 444 | ################################################################################ |
8ce0cbda | 445 | dnl -- Check for shared/static conflicts |
80992638 AK |
446 | if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \ |
447 | -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \ | |
4922197a | 448 | \) -a "x$STATIC_LINK" = xyes ]]; |
d68a82ec | 449 | then AC_MSG_ERROR( |
036f273a | 450 | Features cannot be 'shared' when building statically |
d68a82ec | 451 | ) |
036f273a AK |
452 | fi |
453 | ||
d0191583 JM |
454 | ################################################################################ |
455 | dnl -- Enables statically-linked tools | |
456 | AC_MSG_CHECKING(whether to use static linking) | |
457 | AC_ARG_ENABLE(static_link, | |
458 | [ --enable-static_link Use this to link the tools to their libraries | |
459 | statically. Default is dynamic linking], | |
460 | STATIC_LINK=$enableval, STATIC_LINK=no) | |
461 | AC_MSG_RESULT($STATIC_LINK) | |
462 | ||
463 | ################################################################################ | |
464 | dnl -- Disable selinux | |
465 | AC_MSG_CHECKING(whether to enable selinux support) | |
466 | AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support], | |
467 | SELINUX=$enableval) | |
468 | AC_MSG_RESULT($SELINUX) | |
469 | ||
80992638 | 470 | ################################################################################ |
8a2fc586 | 471 | dnl -- Check for selinux |
80992638 | 472 | if test x$SELINUX = xyes; then |
8a2fc586 | 473 | AC_CHECK_LIB(sepol, sepol_check_context, HAVE_SEPOL=yes, HAVE_SEPOL=no) |
8a2fc586 AK |
474 | |
475 | if test x$HAVE_SEPOL = xyes; then | |
d0191583 JM |
476 | AC_DEFINE([HAVE_SEPOL], 1, |
477 | [Define to 1 if sepol_check_context is available.]) | |
8a2fc586 AK |
478 | LIBS="-lsepol $LIBS" |
479 | fi | |
480 | ||
80992638 AK |
481 | AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no) |
482 | ||
483 | if test x$HAVE_SELINUX = xyes; then | |
72b2cb61 | 484 | AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.]) |
80992638 AK |
485 | LIBS="-lselinux $LIBS" |
486 | else | |
ad6254c5 | 487 | AC_MSG_WARN(Disabling selinux) |
80992638 | 488 | fi |
66e941e8 | 489 | |
d0191583 | 490 | # With --enable-static_link and selinux enabled, linking |
66e941e8 JM |
491 | # fails on at least Debian unstable due to unsatisfied references |
492 | # to pthread_mutex_lock and _unlock. See if we need -lpthread. | |
493 | if test "$STATIC_LINK-$HAVE_SELINUX" = yes-yes; then | |
494 | lvm_saved_libs=$LIBS | |
495 | LIBS="$LIBS -static" | |
496 | AC_SEARCH_LIBS([pthread_mutex_lock], [pthread], | |
497 | [test "$ac_cv_search_pthread_mutex_lock" = "none required" || | |
498 | LIB_PTHREAD=-lpthread]) | |
499 | LIBS=$lvm_saved_libs | |
500 | fi | |
036f273a | 501 | fi |
d68a82ec | 502 | |
8b1a3214 AK |
503 | ################################################################################ |
504 | dnl -- Check for realtime clock support | |
505 | if test x$REALTIME = xyes; then | |
8b1a3214 | 506 | AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no) |
8b1a3214 AK |
507 | |
508 | if test x$HAVE_REALTIME = xyes; then | |
509 | AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.]) | |
510 | LIBS="-lrt $LIBS" | |
511 | else | |
512 | AC_MSG_WARN(Disabling realtime clock) | |
513 | fi | |
514 | fi | |
515 | ||
80992638 | 516 | ################################################################################ |
8ce0cbda | 517 | dnl -- Check for getopt |
d0191583 | 518 | AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.])) |
b896caa1 | 519 | |
80992638 | 520 | ################################################################################ |
8ce0cbda | 521 | dnl -- Check for readline (Shamelessly copied from parted 1.4.17) |
ea7cfb00 | 522 | if test x$READLINE != xno; then |
0ad6b7e2 JM |
523 | rl_found=yes |
524 | AC_CHECK_LIB([readline], [readline], , [rl_found=no]) | |
ea7cfb00 JM |
525 | test x$READLINE:$rl_found = xyes:no && |
526 | AC_MSG_ERROR( | |
795ca3e5 AK |
527 | GNU Readline could not be found which is required for the |
528 | --enable-readline option (which is enabled by default). Either disable readline | |
529 | support with --disable-readline or download and install readline from: | |
530 | ftp.gnu.org/gnu/readline | |
531 | Note: if you are using precompiled packages you will also need the development | |
532 | package as well (which may be called readline-devel or something similar). | |
533 | ) | |
ea7cfb00 | 534 | if test $rl_found = yes; then |
0ad6b7e2 | 535 | AC_CHECK_FUNCS([rl_completion_matches]) |
ea7cfb00 JM |
536 | AC_DEFINE([READLINE_SUPPORT], 1, |
537 | [Define to 1 to include the LVM readline shell.]) | |
538 | fi | |
795ca3e5 AK |
539 | fi |
540 | ||
80992638 | 541 | ################################################################################ |
8ce0cbda | 542 | dnl -- Internationalisation stuff |
ad6254c5 AK |
543 | AC_MSG_CHECKING(whether to enable internationalisation) |
544 | AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support], | |
545 | INTL=$enableval, INTL=no) | |
546 | AC_MSG_RESULT($INTL) | |
69792976 AK |
547 | |
548 | if test x$INTL = xyes; then | |
549 | INTL_PACKAGE="lvm2" | |
550 | AC_PATH_PROG(MSGFMT, msgfmt) | |
551 | if [[ "x$MSGFMT" == x ]]; | |
552 | then AC_MSG_ERROR( | |
553 | msgfmt not found in path $PATH | |
554 | ) | |
69792976 AK |
555 | fi; |
556 | ||
557 | AC_ARG_WITH(localedir, | |
d0191583 JM |
558 | [ --with-localedir=DIR Translation files in DIR [[PREFIX/share/locale]] ], |
559 | [ LOCALEDIR="$withval" ], | |
560 | [ LOCALEDIR='${prefix}/share/locale' ]) | |
69792976 AK |
561 | fi |
562 | ||
80992638 | 563 | ################################################################################ |
4a7f3eb2 | 564 | AC_ARG_WITH(confdir, |
0a62c911 | 565 | [ --with-confdir=DIR Configuration files in DIR [/etc]], |
d0191583 JM |
566 | [ CONFDIR="$withval" ], |
567 | [ CONFDIR='/etc' ]) | |
0a62c911 AK |
568 | |
569 | AC_ARG_WITH(staticdir, | |
570 | [ --with-staticdir=DIR Static binary in DIR [EXEC_PREFIX/sbin]], | |
d0191583 JM |
571 | [ STATICDIR="$withval" ], |
572 | [ STATICDIR='${exec_prefix}/sbin' ]) | |
0a62c911 | 573 | |
33f732c5 AK |
574 | AC_ARG_WITH(dmdir, |
575 | [ --with-dmdir=DIR Build against device-mapper source tree in DIR], | |
d0191583 | 576 | [ DMDIR="$withval" CPPFLAGS="$CPPFLAGS -I$DMDIR/include"], |
33f732c5 AK |
577 | [ DMDIR= ]) |
578 | ||
09339e2b | 579 | # Convert a relative dir name to absolute. |
25fbec5b AK |
580 | case $DMDIR in |
581 | /*) ;; | |
582 | *) DMDIR="`pwd`/$DMDIR" ;; | |
09339e2b JM |
583 | esac |
584 | ||
68f2de6d AK |
585 | AC_ARG_WITH(usrlibdir, |
586 | [ --with-usrlibdir=DIR], | |
587 | [ usrlibdir="$withval"], | |
588 | [ usrlibdir='${prefix}/lib' ]) | |
589 | ||
590 | AC_ARG_WITH(usrsbindir, | |
591 | [ --with-usrsbindir=DIR], | |
592 | [ usrsbindir="$withval"], | |
593 | [ usrsbindir='${prefix}/sbin' ]) | |
594 | ||
ad6254c5 AK |
595 | ################################################################################ |
596 | dnl -- Ensure additional headers required | |
597 | if test x$READLINE = xyes; then | |
598 | AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out)) | |
599 | fi | |
600 | ||
5c7fc7c4 | 601 | if test x$CLVMD != xnone; then |
ad6254c5 AK |
602 | 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)) |
603 | AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out)) | |
604 | AC_FUNC_GETMNTENT | |
605 | # AC_FUNC_REALLOC | |
606 | AC_FUNC_SELECT_ARGTYPES | |
607 | fi | |
608 | ||
ad6254c5 AK |
609 | if test x$CLUSTER != xnone; then |
610 | AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out)) | |
611 | AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out)) | |
612 | fi | |
613 | ||
614 | if test x$HAVE_LIBDL = xyes; then | |
615 | AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out)) | |
616 | fi | |
617 | ||
618 | if test x$INTL = xyes; then | |
619 | AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out)) | |
620 | fi | |
621 | ||
2293567c | 622 | AC_CHECK_HEADERS(libdevmapper.h,,AC_MSG_ERROR(bailing out)) |
ad6254c5 AK |
623 | |
624 | if test x$HAVE_SELINUX = xyes; then | |
625 | AC_CHECK_HEADERS(selinux/selinux.h,,AC_MSG_ERROR(bailing out)) | |
626 | fi | |
4a7f3eb2 | 627 | |
a653923f AK |
628 | ################################################################################ |
629 | AC_PATH_PROG(MODPROBE_CMD, modprobe) | |
630 | ||
631 | if test x$MODPROBE_CMD != x; then | |
72b2cb61 | 632 | AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.]) |
a653923f AK |
633 | fi |
634 | ||
80992638 | 635 | ################################################################################ |
d0191583 | 636 | LVM_VERSION="\"`cat VERSION 2>/dev/null || echo Unknown`\"" |
fae0c576 | 637 | |
80992638 | 638 | ################################################################################ |
d0191583 | 639 | AC_SUBST(BUILD_DMEVENTD) |
b896caa1 | 640 | AC_SUBST(CFLAGS) |
d0191583 | 641 | AC_SUBST(CFLOW_CMD) |
8106cdd5 | 642 | AC_SUBST(CLDFLAGS) |
8106cdd5 | 643 | AC_SUBST(CLDNOWHOLEARCHIVE) |
d0191583 JM |
644 | AC_SUBST(CLDWHOLEARCHIVE) |
645 | AC_SUBST(CLUSTER) | |
646 | AC_SUBST(CLVMD) | |
647 | AC_SUBST(CMDLIB) | |
648 | AC_SUBST(COPTIMISE_FLAG) | |
649 | AC_SUBST(CSCOPE_CMD) | |
8ef2b021 | 650 | AC_SUBST(DEBUG) |
199e490e | 651 | AC_SUBST(DEVMAPPER) |
d0191583 JM |
652 | AC_SUBST(DMDIR) |
653 | # FIXME: rename to LVM_USE_DMEVENTD | |
654 | AC_SUBST(DMEVENTD) | |
655 | AC_SUBST(DM_COMPAT) | |
656 | AC_SUBST(DM_DEVICE_GID) | |
657 | AC_SUBST(DM_DEVICE_MODE) | |
658 | AC_SUBST(DM_DEVICE_UID) | |
659 | AC_SUBST(DM_IOCTLS) | |
660 | AC_SUBST(DM_LIB_VERSION) | |
661 | AC_SUBST(FSADM) | |
662 | AC_SUBST(GROUP) | |
26e7f2e0 | 663 | AC_SUBST(HAVE_LIBDL) |
8b1a3214 | 664 | AC_SUBST(HAVE_REALTIME) |
d0191583 JM |
665 | AC_SUBST(HAVE_SELINUX) |
666 | AC_SUBST(INTL) | |
667 | AC_SUBST(INTL_PACKAGE) | |
668 | AC_SUBST(JOBS) | |
669 | AC_SUBST(LDDEPS) | |
670 | AC_SUBST(LIBS) | |
671 | AC_SUBST(LIB_SUFFIX) | |
69792976 | 672 | AC_SUBST(LOCALEDIR) |
d0191583 JM |
673 | AC_SUBST(LVM1) |
674 | AC_SUBST(LVM1_FALLBACK) | |
675 | # FIXME: rename to LVM_CONF_DIR | |
4a7f3eb2 | 676 | AC_SUBST(CONFDIR) |
d0191583 JM |
677 | AC_SUBST(LVM_VERSION) |
678 | AC_SUBST(MIRRORS) | |
679 | AC_SUBST(MSGFMT) | |
680 | AC_SUBST(OWNER) | |
681 | AC_SUBST(PKGCONFIG) | |
682 | AC_SUBST(POOL) | |
683 | AC_SUBST(SNAPSHOTS) | |
0a62c911 | 684 | AC_SUBST(STATICDIR) |
d0191583 | 685 | AC_SUBST(STATIC_LINK) |
66e941e8 | 686 | AC_SUBST([LIB_PTHREAD]) |
68f2de6d AK |
687 | AC_SUBST(usrlibdir) |
688 | AC_SUBST(usrsbindir) | |
8106cdd5 | 689 | |
80992638 | 690 | ################################################################################ |
d3a356b4 | 691 | dnl -- First and last lines should not contain files to generate in order to |
8ce0cbda | 692 | dnl -- keep utility scripts running properly |
d3a356b4 JM |
693 | AC_CONFIG_FILES([ |
694 | Makefile | |
695 | make.tmpl | |
d0191583 JM |
696 | include/Makefile |
697 | lib/Makefile | |
698 | man/Makefile | |
699 | po/Makefile | |
700 | dmeventd/Makefile | |
d3a356b4 JM |
701 | daemons/Makefile |
702 | daemons/clvmd/Makefile | |
d3a356b4 | 703 | dmeventd/mirror/Makefile |
67961c7c | 704 | dmeventd/snapshot/Makefile |
d3a356b4 | 705 | doc/Makefile |
d3a356b4 JM |
706 | lib/format1/Makefile |
707 | lib/format_pool/Makefile | |
708 | lib/locking/Makefile | |
709 | lib/mirror/Makefile | |
710 | lib/snapshot/Makefile | |
711 | test/Makefile | |
d3a356b4 JM |
712 | scripts/Makefile |
713 | tools/Makefile | |
714 | tools/version.h | |
7a197a62 AK |
715 | ]) |
716 | AC_OUTPUT | |
2dc95e1c AK |
717 | |
718 | if test x$ODIRECT != xyes; then | |
ad6254c5 | 719 | AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up) |
2dc95e1c | 720 | fi |
809fae91 AK |
721 | |
722 | if test x$FSADM == xyes; then | |
ad6254c5 | 723 | AC_MSG_WARN(fsadm support is untested) |
809fae91 | 724 | fi |
06f62ad1 AK |
725 | |
726 | if test x$DMEVENTD == xyes; then | |
727 | AC_MSG_WARN(dmeventd support is untested) | |
728 | fi |