]> sourceware.org Git - lvm2.git/blame - configure.in
Reduce severity of setlocale failure message (ie suppress during boot).
[lvm2.git] / configure.in
CommitLineData
795ca3e5
AK
1##
2## Copyright 1999-2000 Sistina Software, Inc.
3##
4## This is free software released under the GNU General Public License.
5## There is no warranty for this software. See the file COPYING for
6## details.
7##
8## See the file CONTRIBUTORS for a list of contributors.
9##
10## This file is maintained by:
11## AJ Lewis <lewis@sistina.com>
12##
13## File name: configure.in
14##
15## Description: Input file for autoconf. Generates the configure script
16## that tries to keep everything nice and portable. It also
17## simplifies distribution package building considerably.
18################################################################################
19
80992638 20################################################################################
795ca3e5 21dnl Process this file with autoconf to produce a configure script.
13c7b701 22AC_INIT(lib/device/dev-cache.h)
795ca3e5 23
80992638 24################################################################################
795ca3e5
AK
25dnl setup the directory where autoconf has auxilary files
26AC_CONFIG_AUX_DIR(autoconf)
27
80992638 28################################################################################
795ca3e5
AK
29dnl Checks for programs.
30AC_PROG_AWK
31AC_PROG_CC
32AC_PROG_INSTALL
33AC_PROG_LN_S
34AC_PROG_MAKE_SET
35AC_PROG_RANLIB
36
80992638 37################################################################################
b896caa1
AK
38dnl Get system type
39AC_CANONICAL_SYSTEM
40
41case "$host_os" in
42 linux*)
80992638
AK
43 CFLAGS="$CFLAGS"
44 CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
8106cdd5
AK
45 CLDWHOLEARCHIVE="-Wl,-whole-archive"
46 CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
80992638
AK
47 LDDEPS="$LDDEPS .export.sym"
48 LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
8106cdd5
AK
49 SOFLAG="-shared"
50 DEVMAPPER=yes
1a9ea74d 51 ODIRECT=yes
80992638 52 SELINUX=yes
d3c8211f 53 CLUSTER=internal
809fae91 54 FSADM=no ;;
8106cdd5 55 darwin*)
80992638
AK
56 CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
57 CLDFLAGS="$CLDFLAGS"
8106cdd5
AK
58 CLDWHOLEARCHIVE="-all_load"
59 CLDNOWHOLEARCHIVE=
80992638
AK
60 LDDEPS="$LDDEPS"
61 LDFLAGS="$LDFLAGS"
8106cdd5
AK
62 SOFLAG="-dynamiclib"
63 DEVMAPPER=no
1a9ea74d 64 ODIRECT=no
80992638 65 SELINUX=no
d3c8211f 66 CLUSTER=none
1a9ea74d 67 FSADM=no ;;
b896caa1
AK
68esac
69
80992638
AK
70################################################################################
71dnl Checks for header files.
72AC_HEADER_DIRENT
73AC_HEADER_STDC
74AC_CHECK_HEADERS(fcntl.h malloc.h sys/ioctl.h unistd.h)
75
76################################################################################
77dnl Checks for typedefs, structures, and compiler characteristics.
78AC_C_CONST
79AC_C_INLINE
80AC_TYPE_OFF_T
81AC_TYPE_PID_T
82AC_TYPE_SIZE_T
83AC_STRUCT_ST_RDEV
84AC_HEADER_TIME
85
86################################################################################
795ca3e5
AK
87dnl -- prefix is /usr by default, the exec_prefix default is setup later
88AC_PREFIX_DEFAULT(/usr)
89
80992638
AK
90################################################################################
91dnl -- Parallel make jobs?
92AC_ARG_ENABLE(jobs, [ --enable-jobs=NUM Number of jobs to run simultaneously], JOBS=-j$enableval, JOBS=-j2)
a38df97f 93
80992638 94################################################################################
795ca3e5 95dnl -- setup the ownership of the files
80992638
AK
96echo $ac_n "Setting file owner to""... $ac_c" 1>&6
97OWNER="root"
98
795ca3e5
AK
99AC_ARG_WITH(user,
100 [ --with-user=USER Set the owner of installed files ],
a38df97f 101 [ OWNER="$withval" ])
80992638 102echo "$ac_t""$OWNER" 1>&6
a38df97f
AK
103
104if test x$OWNER != x; then
105 OWNER="-o $OWNER"
106fi
795ca3e5 107
80992638 108################################################################################
795ca3e5 109dnl -- setup the group ownership of the files
80992638
AK
110echo $ac_n "Setting group owner to""... $ac_c" 1>&6
111GROUP="root"
795ca3e5
AK
112AC_ARG_WITH(group,
113 [ --with-group=GROUP Set the group owner of installed files ],
a38df97f 114 [ GROUP="$withval" ])
80992638 115echo "$ac_t""$GROUP" 1>&6
a38df97f
AK
116
117if test x$GROUP != x; then
118 GROUP="-g $GROUP"
119fi
795ca3e5 120
80992638 121################################################################################
7d1552c9 122dnl -- LVM1 tool fallback option
80992638 123echo $ac_n "checking whether to enable lvm1 fallback""... $ac_c" 1>&6
7d1552c9
AK
124AC_ARG_ENABLE(lvm1_fallback, [ --enable-lvm1_fallback Use this to fall back and use LVM1 binaries if
125 device-mapper is missing from the kernel], LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
80992638 126echo "$ac_t""$LVM1_FALLBACK" 1>&6
7d1552c9
AK
127
128if test x$LVM1_FALLBACK = xyes; then
129 CFLAGS="$CFLAGS -DLVM1_FALLBACK"
130fi
131
80992638 132################################################################################
5a52dca9 133dnl -- format1 inclusion type
80992638 134echo $ac_n "checking whether to include support for lvm1 metadata""... $ac_c" 1>&6
5a52dca9
AK
135AC_ARG_WITH(lvm1,
136 [ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none
137 [TYPE=internal] ],
138 [ LVM1="$withval" ],
139 [ LVM1="internal" ])
80992638 140echo "$ac_t""$LVM1" 1>&6
5a52dca9
AK
141
142if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
143 then AC_MSG_ERROR(
144--with-lvm1 parameter invalid
145)
146 exit
147fi;
148
b896caa1
AK
149if test x$LVM1 = xinternal; then
150 CFLAGS="$CFLAGS -DLVM1_INTERNAL"
151fi
152
80992638 153################################################################################
d8ac0fbc 154dnl -- format_pool inclusion type
80992638 155echo $ac_n "checking whether to include support for GFS pool metadata""... $ac_c" 1>&6
d8ac0fbc 156AC_ARG_WITH(pool,
60329273 157 [ --with-pool=TYPE GFS pool read-only support: internal/shared/none
d8ac0fbc
AK
158 [TYPE=internal] ],
159 [ POOL="$withval" ],
160 [ POOL="internal" ])
80992638 161echo "$ac_t""$POOL" 1>&6
d8ac0fbc
AK
162
163if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]];
164 then AC_MSG_ERROR(
165--with-pool parameter invalid
166)
167 exit
168fi;
169
170if test x$POOL = xinternal; then
171 CFLAGS="$CFLAGS -DPOOL_INTERNAL"
172fi
173
80992638 174################################################################################
d3c8211f 175dnl -- cluster_locking inclusion type
80992638 176echo $ac_n "checking whether to include support for cluster locking""... $ac_c" 1>&6
d3c8211f
AK
177AC_ARG_WITH(cluster,
178 [ --with-cluster=TYPE Cluster LVM locking support: internal/shared/none
179 [TYPE=internal] ],
180 [ CLUSTER="$withval" ])
80992638 181echo "$ac_t""$CLUSTER" 1>&6
d3c8211f
AK
182
183if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]];
184 then AC_MSG_ERROR(
185--with-cluster parameter invalid
186)
187 exit
188fi;
189
190if test x$CLUSTER = xinternal; then
191 CFLAGS="$CFLAGS -DCLUSTER_LOCKING_INTERNAL"
192fi
d8ac0fbc 193
80992638 194################################################################################
4922197a 195dnl -- snapshots inclusion type
80992638 196echo $ac_n "checking whether to include snapshots""... $ac_c" 1>&6
4922197a
AK
197AC_ARG_WITH(snapshots,
198 [ --with-snapshots=TYPE Snapshot support: internal/shared/none
199 [TYPE=internal] ],
200 [ SNAPSHOTS="$withval" ],
201 [ SNAPSHOTS="internal" ])
80992638 202echo "$ac_t""$SNAPSHOTS" 1>&6
4922197a
AK
203
204if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]];
205 then AC_MSG_ERROR(
206--with-snapshots parameter invalid
207)
208 exit
209fi;
210
211if test x$SNAPSHOTS = xinternal; then
212 CFLAGS="$CFLAGS -DSNAPSHOT_INTERNAL"
213fi
214
80992638 215################################################################################
4922197a 216dnl -- mirrors inclusion type
80992638 217echo $ac_n "checking whether to include mirrors""... $ac_c" 1>&6
4922197a
AK
218AC_ARG_WITH(mirrors,
219 [ --with-mirrors=TYPE Mirror support: internal/shared/none
220 [TYPE=internal] ],
221 [ MIRRORS="$withval" ],
222 [ MIRRORS="internal" ])
80992638 223echo "$ac_t""$MIRRORS" 1>&6
4922197a
AK
224
225if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]];
226 then AC_MSG_ERROR(
227--with-mirrors parameter invalid
228)
229 exit
230fi;
231
232if test x$MIRRORS = xinternal; then
233 CFLAGS="$CFLAGS -DMIRRORED_INTERNAL"
234fi
235
80992638 236################################################################################
8106cdd5 237dnl Enables staticly-linked tools
80992638 238echo $ac_n "checking whether to use static linking""... $ac_c" 1>&6
8106cdd5 239AC_ARG_ENABLE(static_link, [ --enable-static_link Use this to link the tools to their libraries
795ca3e5 240 statically. Default is dynamic linking], STATIC_LINK=$enableval, STATIC_LINK=no)
80992638 241echo "$ac_t""$STATIC_LINK" 1>&6
795ca3e5 242
80992638 243################################################################################
5a52dca9 244dnl Enable readline
80992638 245echo $ac_n "checking whether to enable readline""... $ac_c" 1>&6
5a52dca9
AK
246AC_ARG_ENABLE(readline, [ --enable-readline Enable readline support], \
247READLINE=$enableval, READLINE=no)
80992638 248echo "$ac_t""$READLINE" 1>&6
795ca3e5 249
b896caa1
AK
250if test x$READLINE = xyes; then
251 CFLAGS="$CFLAGS -DREADLINE_SUPPORT"
252fi
253
80992638
AK
254################################################################################
255dnl Disable selinux
256echo $ac_n "checking whether to enable selinux support""... $ac_c" 1>&6
257AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support], \
258SELINUX=$enableval)
259echo "$ac_t""$SELINUX" 1>&6
260
261################################################################################
d3c8211f 262dnl Build cluster LVM daemon
80992638 263echo $ac_n "checking whether to build cluster LVM daemon""... $ac_c" 1>&6
d3c8211f
AK
264AC_ARG_WITH(clvmd, [ --with-clvmd Build cluster LVM Daemon], \
265CLVMD=$withval, CLVMD=no)
80992638
AK
266echo "$ac_t""$CLVMD" 1>&6
267
d3c8211f
AK
268dnl If clvmd enabled and not cluster locking, automgically include the locking.
269if test x$CLVMD = xyes && test x$CLUSTER = xnone; then
270 CLUSTER=internal
271fi
d3c8211f 272
80992638 273################################################################################
8ef2b021 274dnl Enable Debugging
80992638 275echo $ac_n "checking whether to enable debugging""... $ac_c" 1>&6
8ef2b021
AK
276AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging], \
277DEBUG=yes, DEBUG=no)
69792976 278echo "$ac_t""$DEBUG" 1>&6
8ef2b021 279
80992638 280################################################################################
199e490e 281dnl Disable devmapper
80992638 282echo $ac_n "checking whether to use device-mapper""... $ac_c" 1>&6
199e490e 283AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable device-mapper interaction], \
8106cdd5 284DEVMAPPER=no)
69792976 285echo "$ac_t""$DEVMAPPER" 1>&6
199e490e 286
b896caa1
AK
287if test x$DEVMAPPER = xyes; then
288 CFLAGS="$CFLAGS -DDEVMAPPER_SUPPORT"
289fi
290
80992638 291################################################################################
2dc95e1c 292dnl Disable O_DIRECT
80992638 293echo $ac_n "checking whether to enable O_DIRECT""... $ac_c" 1>&6
2dc95e1c 294AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT], \
8106cdd5 295ODIRECT=no)
69792976 296echo "$ac_t""$ODIRECT" 1>&6
2dc95e1c
AK
297
298if test x$ODIRECT = xyes; then
299 CFLAGS="$CFLAGS -DO_DIRECT_SUPPORT"
300fi
301
80992638 302################################################################################
8106cdd5 303dnl Enable cmdlib
80992638 304echo $ac_n "checking whether to compile liblvm2cmd.so""... $ac_c" 1>&6
8106cdd5
AK
305AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library], \
306CMDLIB=yes, CMDLIB=no)
307echo "$ac_t""$CMDLIB" 1>&6
308
309if test x$CMDLIB = xyes; then
310 CFLAGS="$CFLAGS -DCMDLIB"
311fi
312
80992638 313################################################################################
809fae91 314dnl Enable fsadm
80992638 315echo $ac_n "checking whether to build fsadm""... $ac_c" 1>&6
809fae91
AK
316AC_ARG_ENABLE(fsadm, [ --enable-fsadm Enable fsadm], FSADM=yes)
317echo "$ac_t""$FSADM" 1>&6
318
80992638 319################################################################################
795ca3e5
AK
320dnl Mess with default exec_prefix
321if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
322 then exec_prefix="";
323fi;
324
80992638 325################################################################################
795ca3e5
AK
326dnl Checks for library functions.
327AC_PROG_GCC_TRADITIONAL
328AC_TYPE_SIGNAL
329AC_FUNC_VPRINTF
330AC_CHECK_FUNCS(mkdir rmdir uname)
331
80992638 332################################################################################
795ca3e5
AK
333dnl check for termcap (Shamelessly copied from parted 1.4.17)
334if test x$READLINE = xyes; then
335 AC_SEARCH_LIBS(tgetent, ncurses curses termcap termlib, ,
336 AC_MSG_ERROR(
337termcap could not be found which is required for the
338--enable-readline option (which is enabled by default). Either disable readline
339support with --disable-readline or download and install termcap from:
340 ftp.gnu.org/gnu/termcap
341Note: if you are using precompiled packages you will also need the development
342 package as well (which may be called termcap-devel or something similar).
343Note: (n)curses also seems to work as a substitute for termcap. This was
344 not found either - but you could try installing that as well.
345)
346 exit
347 )
348fi
349
80992638 350################################################################################
26e7f2e0
AK
351dnl Check for dlopen
352AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no)
353
74583a91 354if [[ "x$HAVE_LIBDL" = xyes -a "x$STATIC_LINK" = xno ]]; then
b896caa1 355 CFLAGS="$CFLAGS -DHAVE_LIBDL"
26e7f2e0 356 LIBS="-ldl $LIBS"
d68a82ec
AK
357else
358 HAVE_LIBDL=no
26e7f2e0
AK
359fi
360
80992638 361################################################################################
d68a82ec 362dnl Check for shared/static conflicts
80992638
AK
363if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \
364 -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
4922197a 365 \) -a "x$STATIC_LINK" = xyes ]];
d68a82ec 366 then AC_MSG_ERROR(
036f273a 367Features cannot be 'shared' when building statically
d68a82ec
AK
368)
369 exit
036f273a
AK
370fi
371
80992638 372################################################################################
036f273a 373dnl Check for is_selinux_enabled
80992638
AK
374if test x$SELINUX = xyes; then
375 AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no)
376
377 if test x$HAVE_SELINUX = xyes; then
378 CFLAGS="$CFLAGS -DHAVE_SELINUX"
379 LIBS="-lselinux $LIBS"
380 else
381 echo "Disabling selinux" 1>&6
382 fi
036f273a 383fi
d68a82ec 384
80992638 385################################################################################
b896caa1
AK
386dnl Check for getopt
387AC_CHECK_HEADERS(getopt.h, CFLAGS="$CFLAGS -DHAVE_GETOPTLONG")
388
80992638 389################################################################################
795ca3e5
AK
390dnl Check for readline (Shamelessly copied from parted 1.4.17)
391if test x$READLINE = xyes; then
392 AC_CHECK_LIB(readline, readline, ,
393 AC_MSG_ERROR(
394GNU Readline could not be found which is required for the
395--enable-readline option (which is enabled by default). Either disable readline
396support with --disable-readline or download and install readline from:
397 ftp.gnu.org/gnu/readline
398Note: if you are using precompiled packages you will also need the development
399package as well (which may be called readline-devel or something similar).
400)
401 exit
402 )
b896caa1
AK
403 AC_CHECK_FUNC(rl_completion_matches, CFLAGS="$CFLAGS -DHAVE_RL_COMPLETION_MATCHES")
404
795ca3e5
AK
405fi
406
80992638 407################################################################################
69792976
AK
408echo $ac_n "checking whether to enable internationalisation""... $ac_c" 1>&6
409dnl Internationalisation stuff
410AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support],\
411 INTL=yes, INTL=no)
412echo "$ac_t""$INTL" 1>&6
413
414if test x$INTL = xyes; then
415 INTL_PACKAGE="lvm2"
416 AC_PATH_PROG(MSGFMT, msgfmt)
417 if [[ "x$MSGFMT" == x ]];
418 then AC_MSG_ERROR(
419 msgfmt not found in path $PATH
420 )
421 exit
422 fi;
423
424 AC_ARG_WITH(localedir,
425 [ --with-localedir=DIR Translation files in DIR [PREFIX/share/locale]],
426 [ LOCALEDIR="$withval" ],
427 [ LOCALEDIR='${prefix}/share/locale' ])
428fi
429
80992638 430################################################################################
4a7f3eb2 431AC_ARG_WITH(confdir,
0a62c911 432 [ --with-confdir=DIR Configuration files in DIR [/etc]],
4a7f3eb2 433 [ CONFDIR="$withval" ],
0a62c911
AK
434 [ CONFDIR='/etc' ])
435
436AC_ARG_WITH(staticdir,
437 [ --with-staticdir=DIR Static binary in DIR [EXEC_PREFIX/sbin]],
438 [ STATICDIR="$withval" ],
439 [ STATICDIR='${exec_prefix}/sbin' ])
440
4a7f3eb2 441
80992638 442################################################################################
fae0c576
AK
443if test "-f VERSION"; then
444 LVM_VERSION="\"`cat VERSION`\""
445else
446 LVM_VERSION="Unknown"
447fi
448
80992638 449################################################################################
795ca3e5
AK
450AC_SUBST(JOBS)
451AC_SUBST(STATIC_LINK)
5a52dca9 452AC_SUBST(LVM1)
d8ac0fbc 453AC_SUBST(POOL)
4922197a
AK
454AC_SUBST(SNAPSHOTS)
455AC_SUBST(MIRRORS)
795ca3e5
AK
456AC_SUBST(OWNER)
457AC_SUBST(GROUP)
b896caa1 458AC_SUBST(CFLAGS)
8106cdd5
AK
459AC_SUBST(CLDFLAGS)
460AC_SUBST(CLDWHOLEARCHIVE)
461AC_SUBST(CLDNOWHOLEARCHIVE)
80992638
AK
462AC_SUBST(LDDEPS)
463AC_SUBST(LDFLAGS)
8106cdd5 464AC_SUBST(SOFLAG)
5f68d858 465AC_SUBST(LIBS)
fae0c576 466AC_SUBST(LVM_VERSION)
7d1552c9 467AC_SUBST(LVM1_FALLBACK)
8ef2b021 468AC_SUBST(DEBUG)
199e490e 469AC_SUBST(DEVMAPPER)
26e7f2e0 470AC_SUBST(HAVE_LIBDL)
036f273a 471AC_SUBST(HAVE_SELINUX)
8106cdd5 472AC_SUBST(CMDLIB)
69792976
AK
473AC_SUBST(MSGFMT)
474AC_SUBST(LOCALEDIR)
4a7f3eb2 475AC_SUBST(CONFDIR)
0a62c911 476AC_SUBST(STATICDIR)
69792976
AK
477AC_SUBST(INTL_PACKAGE)
478AC_SUBST(INTL)
d3c8211f
AK
479AC_SUBST(CLVMD)
480AC_SUBST(CLUSTER)
1a9ea74d 481AC_SUBST(FSADM)
8106cdd5 482
80992638 483################################################################################
795ca3e5
AK
484dnl First and last lines should not contain files to generate in order to
485dnl keep utility scripts running properly
486AC_OUTPUT( \
487Makefile \
80992638 488make.tmpl \
d3c8211f
AK
489daemons/Makefile \
490daemons/clvmd/Makefile \
4a7f3eb2 491doc/Makefile \
fa42e649 492include/Makefile \
795ca3e5 493lib/Makefile \
5a52dca9 494lib/format1/Makefile \
d8ac0fbc 495lib/format_pool/Makefile \
d3c8211f 496lib/locking/Makefile \
4922197a
AK
497lib/mirror/Makefile \
498lib/snapshot/Makefile \
795ca3e5 499man/Makefile \
69792976 500po/Makefile \
795ca3e5 501tools/Makefile \
fae0c576 502tools/version.h \
1a9ea74d 503tools/fsadm/Makefile \
e6efb2b0 504test/mm/Makefile \
43b7b8cf 505test/device/Makefile \
e0304b58 506test/format1/Makefile \
d1b28647 507test/regex/Makefile \
291ec3b6 508test/filters/Makefile \
795ca3e5 509)
2dc95e1c
AK
510
511if test x$ODIRECT != xyes; then
512 echo
513 echo Warning: O_DIRECT disabled.
514 echo Use of pvmove may cause machine to lock up under low memory conditions.
515 echo
516fi
809fae91
AK
517
518if test x$FSADM == xyes; then
519 echo
520 echo Warning: fsadm support is untested.
521 echo
522fi
This page took 0.581569 seconds and 5 git commands to generate.