]>
Commit | Line | Data |
---|---|---|
795ca3e5 | 1 | ## |
ad6254c5 AK |
2 | ## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved. |
3 | ## Copyright (C) 2004 Red Hat, Inc. All rights reserved. | |
795ca3e5 | 4 | ## |
ad6254c5 | 5 | ## This file is part of the LVM2. |
795ca3e5 | 6 | ## |
ad6254c5 AK |
7 | ## This copyrighted material is made available to anyone wishing to use, |
8 | ## modify, copy, or redistribute it subject to the terms and conditions | |
9 | ## of the GNU General Public License v.2. | |
795ca3e5 | 10 | ## |
ad6254c5 AK |
11 | ## You should have received a copy of the GNU General Public License |
12 | ## along with this program; if not, write to the Free Software Foundation, | |
13 | ## Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
795ca3e5 AK |
14 | ################################################################################ |
15 | ||
ad6254c5 | 16 | AC_PREREQ(2.53) |
80992638 | 17 | ################################################################################ |
8ce0cbda | 18 | dnl -- Process this file with autoconf to produce a configure script. |
13c7b701 | 19 | AC_INIT(lib/device/dev-cache.h) |
795ca3e5 | 20 | |
80992638 | 21 | ################################################################################ |
ad6254c5 | 22 | dnl -- Setup the directory where autoconf has auxilary files |
795ca3e5 AK |
23 | AC_CONFIG_AUX_DIR(autoconf) |
24 | ||
80992638 | 25 | ################################################################################ |
8ce0cbda | 26 | dnl -- Get system type |
b896caa1 AK |
27 | AC_CANONICAL_SYSTEM |
28 | ||
29 | case "$host_os" in | |
30 | linux*) | |
80992638 | 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" | |
e4c11ad1 | 38 | LIB_SUFFIX="so" |
8106cdd5 | 39 | DEVMAPPER=yes |
1a9ea74d | 40 | ODIRECT=yes |
80992638 | 41 | SELINUX=yes |
d3c8211f | 42 | CLUSTER=internal |
809fae91 | 43 | FSADM=no ;; |
8106cdd5 | 44 | darwin*) |
80992638 | 45 | CFLAGS="$CFLAGS -no-cpp-precomp -fno-common" |
8ce0cbda | 46 | COPTIMISE_FLAG="-O2" |
80992638 | 47 | CLDFLAGS="$CLDFLAGS" |
8106cdd5 AK |
48 | CLDWHOLEARCHIVE="-all_load" |
49 | CLDNOWHOLEARCHIVE= | |
80992638 AK |
50 | LDDEPS="$LDDEPS" |
51 | LDFLAGS="$LDFLAGS" | |
e4c11ad1 | 52 | LIB_SUFFIX="dylib" |
a653923f | 53 | DEVMAPPER=yes |
1a9ea74d | 54 | ODIRECT=no |
80992638 | 55 | SELINUX=no |
d3c8211f | 56 | CLUSTER=none |
1a9ea74d | 57 | FSADM=no ;; |
b896caa1 AK |
58 | esac |
59 | ||
80992638 | 60 | ################################################################################ |
8ce0cbda AK |
61 | dnl -- Checks for programs. |
62 | AC_PROG_AWK | |
63 | AC_PROG_CC | |
64 | AC_PROG_INSTALL | |
65 | AC_PROG_LN_S | |
66 | AC_PROG_MAKE_SET | |
67 | AC_PROG_RANLIB | |
8a2fc586 AK |
68 | AC_PATH_PROG(CFLOW_CMD, cflow) |
69 | AC_PATH_PROG(CSCOPE_CMD, cscope) | |
8ce0cbda AK |
70 | |
71 | ################################################################################ | |
72 | dnl -- Checks for header files. | |
80992638 AK |
73 | AC_HEADER_DIRENT |
74 | AC_HEADER_STDC | |
ad6254c5 AK |
75 | AC_HEADER_SYS_WAIT |
76 | AC_HEADER_TIME | |
77 | ||
78 | AC_CHECK_HEADERS(fcntl.h limits.h locale.h stddef.h syslog.h sys/file.h sys/ioctl.h sys/param.h sys/time.h,,AC_MSG_ERROR(bailing out)) | |
79 | AC_CHECK_HEADERS(assert.h ctype.h libgen.h signal.h stdio.h sys/mman.h sys/resource.h sys/stat.h sys/types.h sys/utsname.h sys/wait.h time.h,,AC_MSG_ERROR(bailing out)) | |
80 | ||
81 | case "$host_os" in | |
82 | linux*) | |
83 | AC_CHECK_HEADERS(asm/byteorder.h linux/fs.h malloc.h,,AC_MSG_ERROR(bailing out)) ;; | |
84 | darwin*) | |
85 | AC_CHECK_HEADERS(machine/endian.h sys/disk.h,,AC_MSG_ERROR(bailing out)) ;; | |
86 | esac | |
80992638 AK |
87 | |
88 | ################################################################################ | |
8ce0cbda | 89 | dnl -- Checks for typedefs, structures, and compiler characteristics. |
80992638 AK |
90 | AC_C_CONST |
91 | AC_C_INLINE | |
92 | AC_TYPE_OFF_T | |
93 | AC_TYPE_PID_T | |
94 | AC_TYPE_SIZE_T | |
ad6254c5 | 95 | AC_TYPE_MODE_T |
80992638 | 96 | AC_STRUCT_ST_RDEV |
ad6254c5 AK |
97 | AC_STRUCT_TM |
98 | ||
99 | ################################################################################ | |
100 | dnl -- Check for functions | |
101 | AC_CHECK_FUNCS(gethostname getpagesize memset munmap setlocale strcasecmp strchr strdup strncasecmp strerror strrchr strstr strtol strtoul,,AC_MSG_ERROR(bailing out)) | |
102 | AC_FUNC_ALLOCA | |
103 | AC_FUNC_CLOSEDIR_VOID | |
104 | AC_FUNC_FORK | |
105 | AC_FUNC_LSTAT | |
106 | AC_FUNC_MALLOC | |
107 | AC_FUNC_MEMCMP | |
108 | AC_FUNC_MMAP | |
109 | AC_FUNC_STAT | |
110 | AC_FUNC_STRTOD | |
80992638 AK |
111 | |
112 | ################################################################################ | |
8ce0cbda | 113 | dnl -- Prefix is /usr by default, the exec_prefix default is setup later |
795ca3e5 AK |
114 | AC_PREFIX_DEFAULT(/usr) |
115 | ||
80992638 AK |
116 | ################################################################################ |
117 | dnl -- Parallel make jobs? | |
118 | AC_ARG_ENABLE(jobs, [ --enable-jobs=NUM Number of jobs to run simultaneously], JOBS=-j$enableval, JOBS=-j2) | |
a38df97f | 119 | |
80992638 | 120 | ################################################################################ |
8ce0cbda | 121 | dnl -- Setup the ownership of the files |
ad6254c5 | 122 | AC_MSG_CHECKING(file owner) |
80992638 AK |
123 | OWNER="root" |
124 | ||
795ca3e5 AK |
125 | AC_ARG_WITH(user, |
126 | [ --with-user=USER Set the owner of installed files ], | |
a38df97f | 127 | [ OWNER="$withval" ]) |
ad6254c5 | 128 | AC_MSG_RESULT($OWNER) |
a38df97f AK |
129 | |
130 | if test x$OWNER != x; then | |
131 | OWNER="-o $OWNER" | |
132 | fi | |
795ca3e5 | 133 | |
80992638 | 134 | ################################################################################ |
8ce0cbda | 135 | dnl -- Setup the group ownership of the files |
ad6254c5 | 136 | AC_MSG_CHECKING(group owner) |
80992638 | 137 | GROUP="root" |
795ca3e5 AK |
138 | AC_ARG_WITH(group, |
139 | [ --with-group=GROUP Set the group owner of installed files ], | |
a38df97f | 140 | [ GROUP="$withval" ]) |
ad6254c5 | 141 | AC_MSG_RESULT($GROUP) |
a38df97f AK |
142 | |
143 | if test x$GROUP != x; then | |
144 | GROUP="-g $GROUP" | |
145 | fi | |
795ca3e5 | 146 | |
80992638 | 147 | ################################################################################ |
7d1552c9 | 148 | dnl -- LVM1 tool fallback option |
ad6254c5 | 149 | AC_MSG_CHECKING(whether to enable lvm1 fallback) |
7d1552c9 AK |
150 | AC_ARG_ENABLE(lvm1_fallback, [ --enable-lvm1_fallback Use this to fall back and use LVM1 binaries if |
151 | device-mapper is missing from the kernel], LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no) | |
ad6254c5 | 152 | AC_MSG_RESULT($LVM1_FALLBACK) |
7d1552c9 AK |
153 | |
154 | if test x$LVM1_FALLBACK = xyes; then | |
8a2fc586 | 155 | LVM_DEFS="$LVM_DEFS -DLVM1_FALLBACK" |
7d1552c9 AK |
156 | fi |
157 | ||
80992638 | 158 | ################################################################################ |
5a52dca9 | 159 | dnl -- format1 inclusion type |
ad6254c5 | 160 | AC_MSG_CHECKING(whether to include support for lvm1 metadata) |
5a52dca9 AK |
161 | AC_ARG_WITH(lvm1, |
162 | [ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none | |
163 | [TYPE=internal] ], | |
164 | [ LVM1="$withval" ], | |
165 | [ LVM1="internal" ]) | |
ad6254c5 | 166 | AC_MSG_RESULT($LVM1) |
5a52dca9 AK |
167 | |
168 | if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]]; | |
169 | then AC_MSG_ERROR( | |
170 | --with-lvm1 parameter invalid | |
171 | ) | |
5a52dca9 AK |
172 | fi; |
173 | ||
b896caa1 | 174 | if test x$LVM1 = xinternal; then |
8a2fc586 | 175 | LVM_DEFS="$LVM_DEFS -DLVM1_INTERNAL" |
b896caa1 AK |
176 | fi |
177 | ||
80992638 | 178 | ################################################################################ |
d8ac0fbc | 179 | dnl -- format_pool inclusion type |
ad6254c5 | 180 | AC_MSG_CHECKING(whether to include support for GFS pool metadata) |
d8ac0fbc | 181 | AC_ARG_WITH(pool, |
60329273 | 182 | [ --with-pool=TYPE GFS pool read-only support: internal/shared/none |
d8ac0fbc AK |
183 | [TYPE=internal] ], |
184 | [ POOL="$withval" ], | |
185 | [ POOL="internal" ]) | |
ad6254c5 | 186 | AC_MSG_RESULT($POOL) |
d8ac0fbc AK |
187 | |
188 | if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]]; | |
189 | then AC_MSG_ERROR( | |
190 | --with-pool parameter invalid | |
191 | ) | |
d8ac0fbc AK |
192 | fi; |
193 | ||
194 | if test x$POOL = xinternal; then | |
8a2fc586 | 195 | LVM_DEFS="$LVM_DEFS -DPOOL_INTERNAL" |
d8ac0fbc AK |
196 | fi |
197 | ||
80992638 | 198 | ################################################################################ |
d3c8211f | 199 | dnl -- cluster_locking inclusion type |
ad6254c5 | 200 | AC_MSG_CHECKING(whether to include support for cluster locking) |
d3c8211f AK |
201 | AC_ARG_WITH(cluster, |
202 | [ --with-cluster=TYPE Cluster LVM locking support: internal/shared/none | |
203 | [TYPE=internal] ], | |
204 | [ CLUSTER="$withval" ]) | |
ad6254c5 | 205 | AC_MSG_RESULT($CLUSTER) |
d3c8211f AK |
206 | |
207 | if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]]; | |
208 | then AC_MSG_ERROR( | |
209 | --with-cluster parameter invalid | |
210 | ) | |
d3c8211f AK |
211 | fi; |
212 | ||
213 | if test x$CLUSTER = xinternal; then | |
8a2fc586 | 214 | LVM_DEFS="$LVM_DEFS -DCLUSTER_LOCKING_INTERNAL" |
d3c8211f | 215 | fi |
d8ac0fbc | 216 | |
80992638 | 217 | ################################################################################ |
4922197a | 218 | dnl -- snapshots inclusion type |
ad6254c5 | 219 | AC_MSG_CHECKING(whether to include snapshots) |
4922197a AK |
220 | AC_ARG_WITH(snapshots, |
221 | [ --with-snapshots=TYPE Snapshot support: internal/shared/none | |
222 | [TYPE=internal] ], | |
223 | [ SNAPSHOTS="$withval" ], | |
224 | [ SNAPSHOTS="internal" ]) | |
ad6254c5 | 225 | AC_MSG_RESULT($SNAPSHOTS) |
4922197a AK |
226 | |
227 | if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]]; | |
228 | then AC_MSG_ERROR( | |
229 | --with-snapshots parameter invalid | |
230 | ) | |
4922197a AK |
231 | fi; |
232 | ||
233 | if test x$SNAPSHOTS = xinternal; then | |
8a2fc586 | 234 | LVM_DEFS="$LVM_DEFS -DSNAPSHOT_INTERNAL" |
4922197a AK |
235 | fi |
236 | ||
80992638 | 237 | ################################################################################ |
4922197a | 238 | dnl -- mirrors inclusion type |
ad6254c5 | 239 | AC_MSG_CHECKING(whether to include mirrors) |
4922197a AK |
240 | AC_ARG_WITH(mirrors, |
241 | [ --with-mirrors=TYPE Mirror support: internal/shared/none | |
242 | [TYPE=internal] ], | |
243 | [ MIRRORS="$withval" ], | |
244 | [ MIRRORS="internal" ]) | |
ad6254c5 | 245 | AC_MSG_RESULT($MIRRORS) |
4922197a AK |
246 | |
247 | if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]]; | |
248 | then AC_MSG_ERROR( | |
249 | --with-mirrors parameter invalid | |
250 | ) | |
4922197a AK |
251 | fi; |
252 | ||
253 | if test x$MIRRORS = xinternal; then | |
8a2fc586 | 254 | LVM_DEFS="$LVM_DEFS -DMIRRORED_INTERNAL" |
4922197a AK |
255 | fi |
256 | ||
80992638 | 257 | ################################################################################ |
8ce0cbda | 258 | dnl -- Enables staticly-linked tools |
ad6254c5 | 259 | AC_MSG_CHECKING(whether to use static linking) |
8106cdd5 | 260 | AC_ARG_ENABLE(static_link, [ --enable-static_link Use this to link the tools to their libraries |
795ca3e5 | 261 | statically. Default is dynamic linking], STATIC_LINK=$enableval, STATIC_LINK=no) |
ad6254c5 | 262 | AC_MSG_RESULT($STATIC_LINK) |
795ca3e5 | 263 | |
80992638 | 264 | ################################################################################ |
8ce0cbda | 265 | dnl -- Enable readline |
ad6254c5 AK |
266 | AC_MSG_CHECKING(whether to enable readline) |
267 | AC_ARG_ENABLE(readline, [ --enable-readline Enable readline support], | |
5a52dca9 | 268 | READLINE=$enableval, READLINE=no) |
ad6254c5 | 269 | AC_MSG_RESULT($READLINE) |
795ca3e5 | 270 | |
b896caa1 | 271 | if test x$READLINE = xyes; then |
8a2fc586 | 272 | LVM_DEFS="$LVM_DEFS -DREADLINE_SUPPORT" |
b896caa1 AK |
273 | fi |
274 | ||
80992638 | 275 | ################################################################################ |
8ce0cbda | 276 | dnl -- Disable selinux |
ad6254c5 AK |
277 | AC_MSG_CHECKING(whether to enable selinux support) |
278 | AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support], | |
80992638 | 279 | SELINUX=$enableval) |
ad6254c5 | 280 | AC_MSG_RESULT($SELINUX) |
80992638 AK |
281 | |
282 | ################################################################################ | |
8ce0cbda | 283 | dnl -- Build cluster LVM daemon |
ad6254c5 | 284 | AC_MSG_CHECKING(whether to build cluster LVM daemon) |
a266258f | 285 | AC_ARG_WITH(clvmd, |
5c7fc7c4 | 286 | [ --with-clvmd=TYPE Build cluster LVM Daemon: cman/gulm/none/all |
a266258f AK |
287 | [TYPE=none] ], |
288 | [ CLVMD="$withval" ], | |
289 | [ CLVMD="none" ]) | |
290 | if test x$CLVMD = xyes; then | |
5c7fc7c4 | 291 | CLVMD=all |
b1098701 | 292 | fi |
ad6254c5 | 293 | AC_MSG_RESULT($CLVMD) |
80992638 | 294 | |
8ce0cbda | 295 | dnl -- If clvmd enabled without cluster locking, automagically include it |
a266258f | 296 | if test x$CLVMD != xnone && test x$CLUSTER = xnone; then |
d3c8211f AK |
297 | CLUSTER=internal |
298 | fi | |
d3c8211f | 299 | |
80992638 | 300 | ################################################################################ |
8ce0cbda | 301 | dnl -- Enable debugging |
ad6254c5 AK |
302 | AC_MSG_CHECKING(whether to enable debugging) |
303 | AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging], | |
304 | DEBUG=$enableval, DEBUG=no) | |
305 | AC_MSG_RESULT($DEBUG) | |
8ef2b021 | 306 | |
8ce0cbda AK |
307 | dnl -- Normally turn off optimisation for debug builds |
308 | if test x$DEBUG = xyes; then | |
309 | COPTIMISE_FLAG= | |
8a2fc586 AK |
310 | else |
311 | CSCOPE_CMD= | |
8ce0cbda AK |
312 | fi |
313 | ||
314 | ################################################################################ | |
315 | dnl -- Override optimisation | |
ad6254c5 | 316 | AC_MSG_CHECKING(for C optimisation flag) |
8ce0cbda AK |
317 | AC_ARG_WITH(optimisation, |
318 | [ --with-optimisation=OPT C optimisation flag [OPT=-O2] ], | |
319 | [ COPTIMISE_FLAG="$withval" ]) | |
ad6254c5 | 320 | AC_MSG_RESULT($COPTIMISE_FLAG) |
8ce0cbda | 321 | |
80992638 | 322 | ################################################################################ |
8ce0cbda | 323 | dnl -- Disable devmapper |
ad6254c5 AK |
324 | AC_MSG_CHECKING(whether to use device-mapper) |
325 | AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable device-mapper interaction], | |
326 | DEVMAPPER=$enableval) | |
327 | AC_MSG_RESULT($DEVMAPPER) | |
199e490e | 328 | |
b896caa1 | 329 | if test x$DEVMAPPER = xyes; then |
8a2fc586 | 330 | LVM_DEFS="$LVM_DEFS -DDEVMAPPER_SUPPORT" |
b896caa1 AK |
331 | fi |
332 | ||
80992638 | 333 | ################################################################################ |
8ce0cbda | 334 | dnl -- Disable O_DIRECT |
ad6254c5 AK |
335 | AC_MSG_CHECKING(whether to enable O_DIRECT) |
336 | AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT], | |
337 | ODIRECT=$enableval) | |
338 | AC_MSG_RESULT($ODIRECT) | |
2dc95e1c AK |
339 | |
340 | if test x$ODIRECT = xyes; then | |
8a2fc586 | 341 | LVM_DEFS="$LVM_DEFS -DO_DIRECT_SUPPORT" |
2dc95e1c AK |
342 | fi |
343 | ||
80992638 | 344 | ################################################################################ |
8ce0cbda | 345 | dnl -- Enable cmdlib |
ad6254c5 AK |
346 | AC_MSG_CHECKING(whether to compile liblvm2cmd.so) |
347 | AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library], | |
348 | CMDLIB=$enableval, CMDLIB=no) | |
349 | AC_MSG_RESULT($CMDLIB) | |
8106cdd5 | 350 | |
59376640 | 351 | if test x$CMDLIB = xyes; then |
8a2fc586 | 352 | LVM_DEFS="$LVM_DEFS -DCMDLIB" |
8106cdd5 AK |
353 | fi |
354 | ||
80992638 | 355 | ################################################################################ |
8ce0cbda | 356 | dnl -- Enable fsadm |
ad6254c5 AK |
357 | AC_MSG_CHECKING(whether to build fsadm) |
358 | AC_ARG_ENABLE(fsadm, [ --enable-fsadm Enable fsadm], | |
359 | FSADM=$enableval) | |
360 | AC_MSG_RESULT($FSADM) | |
809fae91 | 361 | |
06f62ad1 AK |
362 | ################################################################################ |
363 | dnl -- enable dmeventd handling | |
364 | AC_MSG_CHECKING(whether to use dmeventd) | |
365 | AC_ARG_ENABLE(dmeventd, [ --enable-dmeventd Enable the device-mapper event daemon], | |
366 | DMEVENTD=$enableval) | |
367 | AC_MSG_RESULT($DMEVENTD) | |
368 | ||
369 | dnl -- dmeventd currently requires internal mirror support | |
370 | if test x$DMEVENTD = xyes && test x$MIRRORS != xinternal; then | |
371 | AC_MSG_ERROR( | |
372 | --enable-dmeventd currently requires --with-mirrors=internal | |
373 | ) | |
374 | fi | |
375 | ||
15d91f5a | 376 | if test x$DMEVENTD = xyes; then |
8a2fc586 | 377 | LVM_DEFS="$LVM_DEFS -DDMEVENTD" |
15d91f5a | 378 | fi |
80992638 | 379 | ################################################################################ |
8ce0cbda | 380 | dnl -- Mess with default exec_prefix |
795ca3e5 AK |
381 | if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]]; |
382 | then exec_prefix=""; | |
383 | fi; | |
384 | ||
80992638 | 385 | ################################################################################ |
8ce0cbda | 386 | dnl -- Checks for library functions. |
795ca3e5 AK |
387 | AC_PROG_GCC_TRADITIONAL |
388 | AC_TYPE_SIGNAL | |
389 | AC_FUNC_VPRINTF | |
ad6254c5 | 390 | AC_CHECK_FUNCS(mkdir rmdir uname,,AC_MSG_ERROR(bailing out)) |
795ca3e5 | 391 | |
80992638 | 392 | ################################################################################ |
8ce0cbda | 393 | dnl -- Check for termcap (Shamelessly copied from parted 1.4.17) |
795ca3e5 AK |
394 | if test x$READLINE = xyes; then |
395 | AC_SEARCH_LIBS(tgetent, ncurses curses termcap termlib, , | |
396 | AC_MSG_ERROR( | |
397 | termcap could not be found which is required for the | |
398 | --enable-readline option (which is enabled by default). Either disable readline | |
399 | support with --disable-readline or download and install termcap from: | |
400 | ftp.gnu.org/gnu/termcap | |
401 | Note: if you are using precompiled packages you will also need the development | |
402 | package as well (which may be called termcap-devel or something similar). | |
403 | Note: (n)curses also seems to work as a substitute for termcap. This was | |
404 | not found either - but you could try installing that as well. | |
405 | ) | |
795ca3e5 AK |
406 | ) |
407 | fi | |
408 | ||
80992638 | 409 | ################################################################################ |
8ce0cbda | 410 | dnl -- Check for dlopen |
26e7f2e0 AK |
411 | AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no) |
412 | ||
7e9e9502 | 413 | if [[ "x$HAVE_LIBDL" = xyes ]]; then |
8a2fc586 | 414 | LVM_DEFS="$LVM_DEFS -DHAVE_LIBDL" |
26e7f2e0 | 415 | LIBS="-ldl $LIBS" |
d68a82ec AK |
416 | else |
417 | HAVE_LIBDL=no | |
26e7f2e0 AK |
418 | fi |
419 | ||
80992638 | 420 | ################################################################################ |
8ce0cbda | 421 | dnl -- Check for shared/static conflicts |
80992638 AK |
422 | if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \ |
423 | -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \ | |
4922197a | 424 | \) -a "x$STATIC_LINK" = xyes ]]; |
d68a82ec | 425 | then AC_MSG_ERROR( |
036f273a | 426 | Features cannot be 'shared' when building statically |
d68a82ec | 427 | ) |
036f273a AK |
428 | fi |
429 | ||
80992638 | 430 | ################################################################################ |
8a2fc586 | 431 | dnl -- Check for selinux |
80992638 | 432 | if test x$SELINUX = xyes; then |
8a2fc586 AK |
433 | AC_MSG_CHECKING(for sepol_check_context function) |
434 | AC_CHECK_LIB(sepol, sepol_check_context, HAVE_SEPOL=yes, HAVE_SEPOL=no) | |
435 | AC_MSG_RESULT($HAVE_SEPOL) | |
436 | ||
437 | if test x$HAVE_SEPOL = xyes; then | |
438 | LIBS="-lsepol $LIBS" | |
439 | fi | |
440 | ||
ad6254c5 | 441 | AC_MSG_CHECKING(for is_selinux_enabled function) |
80992638 | 442 | AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no) |
ad6254c5 | 443 | AC_MSG_RESULT($HAVE_SELINUX) |
80992638 AK |
444 | |
445 | if test x$HAVE_SELINUX = xyes; then | |
8a2fc586 | 446 | LVM_DEFS="$LVM_DEFS -DHAVE_SELINUX" |
80992638 AK |
447 | LIBS="-lselinux $LIBS" |
448 | else | |
ad6254c5 | 449 | AC_MSG_WARN(Disabling selinux) |
80992638 | 450 | fi |
036f273a | 451 | fi |
d68a82ec | 452 | |
80992638 | 453 | ################################################################################ |
8ce0cbda | 454 | dnl -- Check for getopt |
8a2fc586 | 455 | AC_CHECK_HEADERS(getopt.h, LVM_DEFS="$LVM_DEFS -DHAVE_GETOPTLONG") |
b896caa1 | 456 | |
80992638 | 457 | ################################################################################ |
8ce0cbda | 458 | dnl -- Check for readline (Shamelessly copied from parted 1.4.17) |
795ca3e5 AK |
459 | if test x$READLINE = xyes; then |
460 | AC_CHECK_LIB(readline, readline, , | |
461 | AC_MSG_ERROR( | |
462 | GNU Readline could not be found which is required for the | |
463 | --enable-readline option (which is enabled by default). Either disable readline | |
464 | support with --disable-readline or download and install readline from: | |
465 | ftp.gnu.org/gnu/readline | |
466 | Note: if you are using precompiled packages you will also need the development | |
467 | package as well (which may be called readline-devel or something similar). | |
468 | ) | |
795ca3e5 | 469 | ) |
8a2fc586 | 470 | AC_CHECK_FUNC(rl_completion_matches, LVM_DEFS="$LVM_DEFS -DHAVE_RL_COMPLETION_MATCHES") |
b896caa1 | 471 | |
795ca3e5 AK |
472 | fi |
473 | ||
80992638 | 474 | ################################################################################ |
8ce0cbda | 475 | dnl -- Internationalisation stuff |
ad6254c5 AK |
476 | AC_MSG_CHECKING(whether to enable internationalisation) |
477 | AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support], | |
478 | INTL=$enableval, INTL=no) | |
479 | AC_MSG_RESULT($INTL) | |
69792976 AK |
480 | |
481 | if test x$INTL = xyes; then | |
482 | INTL_PACKAGE="lvm2" | |
483 | AC_PATH_PROG(MSGFMT, msgfmt) | |
484 | if [[ "x$MSGFMT" == x ]]; | |
485 | then AC_MSG_ERROR( | |
486 | msgfmt not found in path $PATH | |
487 | ) | |
69792976 AK |
488 | fi; |
489 | ||
490 | AC_ARG_WITH(localedir, | |
491 | [ --with-localedir=DIR Translation files in DIR [PREFIX/share/locale]], | |
492 | [ LOCALEDIR="$withval" ], | |
493 | [ LOCALEDIR='${prefix}/share/locale' ]) | |
494 | fi | |
495 | ||
80992638 | 496 | ################################################################################ |
4a7f3eb2 | 497 | AC_ARG_WITH(confdir, |
0a62c911 | 498 | [ --with-confdir=DIR Configuration files in DIR [/etc]], |
4a7f3eb2 | 499 | [ CONFDIR="$withval" ], |
0a62c911 AK |
500 | [ CONFDIR='/etc' ]) |
501 | ||
502 | AC_ARG_WITH(staticdir, | |
503 | [ --with-staticdir=DIR Static binary in DIR [EXEC_PREFIX/sbin]], | |
504 | [ STATICDIR="$withval" ], | |
505 | [ STATICDIR='${exec_prefix}/sbin' ]) | |
506 | ||
ad6254c5 AK |
507 | ################################################################################ |
508 | dnl -- Ensure additional headers required | |
509 | if test x$READLINE = xyes; then | |
510 | AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out)) | |
511 | fi | |
512 | ||
5c7fc7c4 | 513 | if test x$CLVMD != xnone; then |
ad6254c5 AK |
514 | 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)) |
515 | AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out)) | |
516 | AC_FUNC_GETMNTENT | |
517 | # AC_FUNC_REALLOC | |
518 | AC_FUNC_SELECT_ARGTYPES | |
519 | fi | |
520 | ||
521 | if test x$FSADM = xyes; then | |
522 | AC_CHECK_HEADERS(fstab.h sys/mount.h sys/vfs.h,,AC_MSG_ERROR(bailing out)) | |
523 | AC_CHECK_FUNCS(memmove,,AC_MSG_ERROR(bailing out)) | |
524 | fi | |
525 | ||
526 | if test x$CLUSTER != xnone; then | |
527 | AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out)) | |
528 | AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out)) | |
529 | fi | |
530 | ||
531 | if test x$HAVE_LIBDL = xyes; then | |
532 | AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out)) | |
533 | fi | |
534 | ||
535 | if test x$INTL = xyes; then | |
536 | AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out)) | |
537 | fi | |
538 | ||
539 | if test x$DEVMAPPER = xyes; then | |
540 | AC_CHECK_HEADERS(libdevmapper.h,,AC_MSG_ERROR(bailing out)) | |
541 | fi | |
542 | ||
543 | if test x$HAVE_SELINUX = xyes; then | |
544 | AC_CHECK_HEADERS(selinux/selinux.h,,AC_MSG_ERROR(bailing out)) | |
545 | fi | |
4a7f3eb2 | 546 | |
a653923f AK |
547 | ################################################################################ |
548 | AC_PATH_PROG(MODPROBE_CMD, modprobe) | |
549 | ||
550 | if test x$MODPROBE_CMD != x; then | |
8a2fc586 | 551 | LVM_DEFS="$LVM_DEFS -DMODPROBE_CMD=\\\"$MODPROBE_CMD\\\"" |
a653923f AK |
552 | fi |
553 | ||
80992638 | 554 | ################################################################################ |
fae0c576 AK |
555 | if test "-f VERSION"; then |
556 | LVM_VERSION="\"`cat VERSION`\"" | |
557 | else | |
558 | LVM_VERSION="Unknown" | |
559 | fi | |
560 | ||
80992638 | 561 | ################################################################################ |
795ca3e5 AK |
562 | AC_SUBST(JOBS) |
563 | AC_SUBST(STATIC_LINK) | |
5a52dca9 | 564 | AC_SUBST(LVM1) |
d8ac0fbc | 565 | AC_SUBST(POOL) |
4922197a AK |
566 | AC_SUBST(SNAPSHOTS) |
567 | AC_SUBST(MIRRORS) | |
795ca3e5 AK |
568 | AC_SUBST(OWNER) |
569 | AC_SUBST(GROUP) | |
b896caa1 | 570 | AC_SUBST(CFLAGS) |
8a2fc586 | 571 | AC_SUBST(LVM_DEFS) |
8ce0cbda | 572 | AC_SUBST(COPTIMISE_FLAG) |
8106cdd5 AK |
573 | AC_SUBST(CLDFLAGS) |
574 | AC_SUBST(CLDWHOLEARCHIVE) | |
575 | AC_SUBST(CLDNOWHOLEARCHIVE) | |
80992638 AK |
576 | AC_SUBST(LDDEPS) |
577 | AC_SUBST(LDFLAGS) | |
c1c065a3 | 578 | AC_SUBST(LIB_SUFFIX) |
5f68d858 | 579 | AC_SUBST(LIBS) |
fae0c576 | 580 | AC_SUBST(LVM_VERSION) |
7d1552c9 | 581 | AC_SUBST(LVM1_FALLBACK) |
8ef2b021 | 582 | AC_SUBST(DEBUG) |
199e490e | 583 | AC_SUBST(DEVMAPPER) |
26e7f2e0 | 584 | AC_SUBST(HAVE_LIBDL) |
036f273a | 585 | AC_SUBST(HAVE_SELINUX) |
8106cdd5 | 586 | AC_SUBST(CMDLIB) |
69792976 AK |
587 | AC_SUBST(MSGFMT) |
588 | AC_SUBST(LOCALEDIR) | |
4a7f3eb2 | 589 | AC_SUBST(CONFDIR) |
0a62c911 | 590 | AC_SUBST(STATICDIR) |
69792976 AK |
591 | AC_SUBST(INTL_PACKAGE) |
592 | AC_SUBST(INTL) | |
d3c8211f AK |
593 | AC_SUBST(CLVMD) |
594 | AC_SUBST(CLUSTER) | |
1a9ea74d | 595 | AC_SUBST(FSADM) |
06f62ad1 | 596 | AC_SUBST(DMEVENTD) |
8a2fc586 AK |
597 | AC_SUBST(CFLOW_CMD) |
598 | AC_SUBST(CSCOPE_CMD) | |
8106cdd5 | 599 | |
80992638 | 600 | ################################################################################ |
8ce0cbda AK |
601 | dnl -- First and last lines should not contain files to generate in order to |
602 | dnl -- keep utility scripts running properly | |
795ca3e5 AK |
603 | AC_OUTPUT( \ |
604 | Makefile \ | |
80992638 | 605 | make.tmpl \ |
d3c8211f AK |
606 | daemons/Makefile \ |
607 | daemons/clvmd/Makefile \ | |
06f62ad1 AK |
608 | dmeventd/Makefile \ |
609 | dmeventd/mirror/Makefile \ | |
4a7f3eb2 | 610 | doc/Makefile \ |
fa42e649 | 611 | include/Makefile \ |
795ca3e5 | 612 | lib/Makefile \ |
5a52dca9 | 613 | lib/format1/Makefile \ |
d8ac0fbc | 614 | lib/format_pool/Makefile \ |
d3c8211f | 615 | lib/locking/Makefile \ |
4922197a AK |
616 | lib/mirror/Makefile \ |
617 | lib/snapshot/Makefile \ | |
795ca3e5 | 618 | man/Makefile \ |
69792976 | 619 | po/Makefile \ |
795ca3e5 | 620 | tools/Makefile \ |
fae0c576 | 621 | tools/version.h \ |
1a9ea74d | 622 | tools/fsadm/Makefile \ |
e6efb2b0 | 623 | test/mm/Makefile \ |
43b7b8cf | 624 | test/device/Makefile \ |
e0304b58 | 625 | test/format1/Makefile \ |
d1b28647 | 626 | test/regex/Makefile \ |
291ec3b6 | 627 | test/filters/Makefile \ |
795ca3e5 | 628 | ) |
2dc95e1c AK |
629 | |
630 | if test x$ODIRECT != xyes; then | |
ad6254c5 | 631 | AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up) |
2dc95e1c | 632 | fi |
809fae91 AK |
633 | |
634 | if test x$FSADM == xyes; then | |
ad6254c5 | 635 | AC_MSG_WARN(fsadm support is untested) |
809fae91 | 636 | fi |
06f62ad1 AK |
637 | |
638 | if test x$DMEVENTD == xyes; then | |
639 | AC_MSG_WARN(dmeventd support is untested) | |
640 | fi |