]> sourceware.org Git - lvm2.git/blame - configure.in
Clear message buffer before use.
[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
20dnl Process this file with autoconf to produce a configure script.
13c7b701 21AC_INIT(lib/device/dev-cache.h)
795ca3e5
AK
22
23dnl setup the directory where autoconf has auxilary files
24AC_CONFIG_AUX_DIR(autoconf)
25
26dnl Checks for programs.
27AC_PROG_AWK
28AC_PROG_CC
29AC_PROG_INSTALL
30AC_PROG_LN_S
31AC_PROG_MAKE_SET
32AC_PROG_RANLIB
33
34dnl Checks for header files.
35AC_HEADER_DIRENT
36AC_HEADER_STDC
37AC_CHECK_HEADERS(fcntl.h malloc.h sys/ioctl.h unistd.h)
38
39dnl Checks for typedefs, structures, and compiler characteristics.
40AC_C_CONST
41AC_C_INLINE
42AC_TYPE_OFF_T
43AC_TYPE_PID_T
44AC_TYPE_SIZE_T
45AC_STRUCT_ST_RDEV
46AC_HEADER_TIME
47
b896caa1
AK
48dnl Get system type
49AC_CANONICAL_SYSTEM
50
51case "$host_os" in
52 linux*)
8106cdd5
AK
53 CFLAGS=
54 CLDFLAGS="-Wl,--version-script,.export.sym"
55 CLDWHOLEARCHIVE="-Wl,-whole-archive"
56 CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
57 LD_DEPS=".export.sym"
d68a82ec 58 LD_FLAGS="-Wl,--export-dynamic"
8106cdd5
AK
59 SOFLAG="-shared"
60 DEVMAPPER=yes
61 ODIRECT=yes ;;
62 darwin*)
63 CFLAGS="-no-cpp-precomp -fno-common"
64 CLDFLAGS=
65 CLDWHOLEARCHIVE="-all_load"
66 CLDNOWHOLEARCHIVE=
67 LD_DEPS=
d68a82ec 68 LD_FLAGS=
8106cdd5
AK
69 SOFLAG="-dynamiclib"
70 DEVMAPPER=no
71 ODIRECT=no ;;
b896caa1
AK
72esac
73
795ca3e5
AK
74dnl -- prefix is /usr by default, the exec_prefix default is setup later
75AC_PREFIX_DEFAULT(/usr)
76
a38df97f
AK
77OWNER="root"
78GROUP="root"
79
795ca3e5
AK
80dnl -- setup the ownership of the files
81AC_ARG_WITH(user,
82 [ --with-user=USER Set the owner of installed files ],
a38df97f
AK
83 [ OWNER="$withval" ])
84
85if test x$OWNER != x; then
86 OWNER="-o $OWNER"
87fi
795ca3e5
AK
88
89dnl -- setup the group ownership of the files
90AC_ARG_WITH(group,
91 [ --with-group=GROUP Set the group owner of installed files ],
a38df97f
AK
92 [ GROUP="$withval" ])
93
94if test x$GROUP != x; then
95 GROUP="-g $GROUP"
96fi
795ca3e5 97
7d1552c9
AK
98dnl -- LVM1 tool fallback option
99AC_ARG_ENABLE(lvm1_fallback, [ --enable-lvm1_fallback Use this to fall back and use LVM1 binaries if
100 device-mapper is missing from the kernel], LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
101
102if test x$LVM1_FALLBACK = xyes; then
103 CFLAGS="$CFLAGS -DLVM1_FALLBACK"
104fi
105
5a52dca9
AK
106dnl -- format1 inclusion type
107AC_ARG_WITH(lvm1,
108 [ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none
109 [TYPE=internal] ],
110 [ LVM1="$withval" ],
111 [ LVM1="internal" ])
112
113if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
114 then AC_MSG_ERROR(
115--with-lvm1 parameter invalid
116)
117 exit
118fi;
119
b896caa1
AK
120if test x$LVM1 = xinternal; then
121 CFLAGS="$CFLAGS -DLVM1_INTERNAL"
122fi
123
d8ac0fbc
AK
124dnl -- format_pool inclusion type
125AC_ARG_WITH(pool,
60329273 126 [ --with-pool=TYPE GFS pool read-only support: internal/shared/none
d8ac0fbc
AK
127 [TYPE=internal] ],
128 [ POOL="$withval" ],
129 [ POOL="internal" ])
130
131if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]];
132 then AC_MSG_ERROR(
133--with-pool parameter invalid
134)
135 exit
136fi;
137
138if test x$POOL = xinternal; then
139 CFLAGS="$CFLAGS -DPOOL_INTERNAL"
140fi
141
142
8ef2b021 143AC_ARG_ENABLE(jobs, [ --enable-jobs=NUM Number of jobs to run simultaneously], JOBS=-j$enableval, JOBS=-j2)
795ca3e5 144
4922197a
AK
145dnl -- snapshots inclusion type
146AC_ARG_WITH(snapshots,
147 [ --with-snapshots=TYPE Snapshot support: internal/shared/none
148 [TYPE=internal] ],
149 [ SNAPSHOTS="$withval" ],
150 [ SNAPSHOTS="internal" ])
151
152if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]];
153 then AC_MSG_ERROR(
154--with-snapshots parameter invalid
155)
156 exit
157fi;
158
159if test x$SNAPSHOTS = xinternal; then
160 CFLAGS="$CFLAGS -DSNAPSHOT_INTERNAL"
161fi
162
163dnl -- mirrors inclusion type
164AC_ARG_WITH(mirrors,
165 [ --with-mirrors=TYPE Mirror support: internal/shared/none
166 [TYPE=internal] ],
167 [ MIRRORS="$withval" ],
168 [ MIRRORS="internal" ])
169
170if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]];
171 then AC_MSG_ERROR(
172--with-mirrors parameter invalid
173)
174 exit
175fi;
176
177if test x$MIRRORS = xinternal; then
178 CFLAGS="$CFLAGS -DMIRRORED_INTERNAL"
179fi
180
8106cdd5
AK
181dnl Enables staticly-linked tools
182AC_ARG_ENABLE(static_link, [ --enable-static_link Use this to link the tools to their libraries
795ca3e5
AK
183 statically. Default is dynamic linking], STATIC_LINK=$enableval, STATIC_LINK=no)
184
5a52dca9
AK
185dnl Enable readline
186AC_ARG_ENABLE(readline, [ --enable-readline Enable readline support], \
187READLINE=$enableval, READLINE=no)
795ca3e5 188
b896caa1
AK
189if test x$READLINE = xyes; then
190 CFLAGS="$CFLAGS -DREADLINE_SUPPORT"
191fi
192
69792976 193echo $ac_n "checking whether to enable debugging""... $ac_c" 1>&6
8ef2b021
AK
194dnl Enable Debugging
195AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging], \
196DEBUG=yes, DEBUG=no)
69792976 197echo "$ac_t""$DEBUG" 1>&6
8ef2b021 198
69792976 199echo $ac_n "checking whether to enable device-mapper""... $ac_c" 1>&6
199e490e
AK
200dnl Disable devmapper
201AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable device-mapper interaction], \
8106cdd5 202DEVMAPPER=no)
69792976 203echo "$ac_t""$DEVMAPPER" 1>&6
199e490e 204
b896caa1
AK
205if test x$DEVMAPPER = xyes; then
206 CFLAGS="$CFLAGS -DDEVMAPPER_SUPPORT"
207fi
208
69792976 209echo $ac_n "checking whether to enable O_DIRECT""... $ac_c" 1>&6
2dc95e1c
AK
210dnl Disable O_DIRECT
211AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT], \
8106cdd5 212ODIRECT=no)
69792976 213echo "$ac_t""$ODIRECT" 1>&6
2dc95e1c
AK
214
215if test x$ODIRECT = xyes; then
216 CFLAGS="$CFLAGS -DO_DIRECT_SUPPORT"
217fi
218
8106cdd5
AK
219echo $ac_n "checking whether to compile liblvm2cmd.so""... $ac_c" 1>&6
220dnl Enable cmdlib
221AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library], \
222CMDLIB=yes, CMDLIB=no)
223echo "$ac_t""$CMDLIB" 1>&6
224
225if test x$CMDLIB = xyes; then
226 CFLAGS="$CFLAGS -DCMDLIB"
227fi
228
795ca3e5
AK
229dnl Mess with default exec_prefix
230if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
231 then exec_prefix="";
232fi;
233
234dnl Checks for library functions.
235AC_PROG_GCC_TRADITIONAL
236AC_TYPE_SIGNAL
237AC_FUNC_VPRINTF
238AC_CHECK_FUNCS(mkdir rmdir uname)
239
240dnl check for termcap (Shamelessly copied from parted 1.4.17)
241if test x$READLINE = xyes; then
242 AC_SEARCH_LIBS(tgetent, ncurses curses termcap termlib, ,
243 AC_MSG_ERROR(
244termcap could not be found which is required for the
245--enable-readline option (which is enabled by default). Either disable readline
246support with --disable-readline or download and install termcap from:
247 ftp.gnu.org/gnu/termcap
248Note: if you are using precompiled packages you will also need the development
249 package as well (which may be called termcap-devel or something similar).
250Note: (n)curses also seems to work as a substitute for termcap. This was
251 not found either - but you could try installing that as well.
252)
253 exit
254 )
255fi
256
26e7f2e0
AK
257dnl Check for dlopen
258AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no)
259
74583a91 260if [[ "x$HAVE_LIBDL" = xyes -a "x$STATIC_LINK" = xno ]]; then
b896caa1 261 CFLAGS="$CFLAGS -DHAVE_LIBDL"
26e7f2e0 262 LIBS="-ldl $LIBS"
d68a82ec
AK
263else
264 HAVE_LIBDL=no
26e7f2e0
AK
265fi
266
d68a82ec 267dnl Check for shared/static conflicts
d8ac0fbc 268if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o \
4922197a
AK
269 "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
270 \) -a "x$STATIC_LINK" = xyes ]];
d68a82ec 271 then AC_MSG_ERROR(
036f273a 272Features cannot be 'shared' when building statically
d68a82ec
AK
273)
274 exit
036f273a
AK
275fi
276
277dnl Check for is_selinux_enabled
278AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no)
279
280if test x$HAVE_SELINUX = xyes; then
281 CFLAGS="$CFLAGS -DHAVE_SELINUX"
282 LIBS="-lselinux $LIBS"
283fi
d68a82ec 284
b896caa1
AK
285dnl Check for getopt
286AC_CHECK_HEADERS(getopt.h, CFLAGS="$CFLAGS -DHAVE_GETOPTLONG")
287
795ca3e5
AK
288dnl Check for readline (Shamelessly copied from parted 1.4.17)
289if test x$READLINE = xyes; then
290 AC_CHECK_LIB(readline, readline, ,
291 AC_MSG_ERROR(
292GNU Readline could not be found which is required for the
293--enable-readline option (which is enabled by default). Either disable readline
294support with --disable-readline or download and install readline from:
295 ftp.gnu.org/gnu/readline
296Note: if you are using precompiled packages you will also need the development
297package as well (which may be called readline-devel or something similar).
298)
299 exit
300 )
b896caa1
AK
301 AC_CHECK_FUNC(rl_completion_matches, CFLAGS="$CFLAGS -DHAVE_RL_COMPLETION_MATCHES")
302
795ca3e5
AK
303fi
304
69792976
AK
305echo $ac_n "checking whether to enable internationalisation""... $ac_c" 1>&6
306dnl Internationalisation stuff
307AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support],\
308 INTL=yes, INTL=no)
309echo "$ac_t""$INTL" 1>&6
310
311if test x$INTL = xyes; then
312 INTL_PACKAGE="lvm2"
313 AC_PATH_PROG(MSGFMT, msgfmt)
314 if [[ "x$MSGFMT" == x ]];
315 then AC_MSG_ERROR(
316 msgfmt not found in path $PATH
317 )
318 exit
319 fi;
320
321 AC_ARG_WITH(localedir,
322 [ --with-localedir=DIR Translation files in DIR [PREFIX/share/locale]],
323 [ LOCALEDIR="$withval" ],
324 [ LOCALEDIR='${prefix}/share/locale' ])
325fi
326
4a7f3eb2 327AC_ARG_WITH(confdir,
0a62c911 328 [ --with-confdir=DIR Configuration files in DIR [/etc]],
4a7f3eb2 329 [ CONFDIR="$withval" ],
0a62c911
AK
330 [ CONFDIR='/etc' ])
331
332AC_ARG_WITH(staticdir,
333 [ --with-staticdir=DIR Static binary in DIR [EXEC_PREFIX/sbin]],
334 [ STATICDIR="$withval" ],
335 [ STATICDIR='${exec_prefix}/sbin' ])
336
4a7f3eb2 337
fae0c576
AK
338if test "-f VERSION"; then
339 LVM_VERSION="\"`cat VERSION`\""
340else
341 LVM_VERSION="Unknown"
342fi
343
795ca3e5
AK
344AC_SUBST(JOBS)
345AC_SUBST(STATIC_LINK)
5a52dca9 346AC_SUBST(LVM1)
d8ac0fbc 347AC_SUBST(POOL)
4922197a
AK
348AC_SUBST(SNAPSHOTS)
349AC_SUBST(MIRRORS)
795ca3e5
AK
350AC_SUBST(OWNER)
351AC_SUBST(GROUP)
b896caa1 352AC_SUBST(CFLAGS)
8106cdd5
AK
353AC_SUBST(CLDFLAGS)
354AC_SUBST(CLDWHOLEARCHIVE)
355AC_SUBST(CLDNOWHOLEARCHIVE)
356AC_SUBST(LD_DEPS)
d68a82ec 357AC_SUBST(LD_FLAGS)
8106cdd5 358AC_SUBST(SOFLAG)
5f68d858 359AC_SUBST(LIBS)
fae0c576 360AC_SUBST(LVM_VERSION)
7d1552c9 361AC_SUBST(LVM1_FALLBACK)
8ef2b021 362AC_SUBST(DEBUG)
199e490e 363AC_SUBST(DEVMAPPER)
26e7f2e0 364AC_SUBST(HAVE_LIBDL)
036f273a 365AC_SUBST(HAVE_SELINUX)
8106cdd5 366AC_SUBST(CMDLIB)
69792976
AK
367AC_SUBST(MSGFMT)
368AC_SUBST(LOCALEDIR)
4a7f3eb2 369AC_SUBST(CONFDIR)
0a62c911 370AC_SUBST(STATICDIR)
69792976
AK
371AC_SUBST(INTL_PACKAGE)
372AC_SUBST(INTL)
8106cdd5 373
795ca3e5
AK
374dnl First and last lines should not contain files to generate in order to
375dnl keep utility scripts running properly
376AC_OUTPUT( \
377Makefile \
378make.tmpl \
4a7f3eb2 379doc/Makefile \
fa42e649 380include/Makefile \
795ca3e5 381lib/Makefile \
5a52dca9 382lib/format1/Makefile \
d8ac0fbc 383lib/format_pool/Makefile \
4922197a
AK
384lib/mirror/Makefile \
385lib/snapshot/Makefile \
795ca3e5 386man/Makefile \
69792976 387po/Makefile \
795ca3e5 388tools/Makefile \
fae0c576 389tools/version.h \
e6efb2b0 390test/mm/Makefile \
43b7b8cf 391test/device/Makefile \
e0304b58 392test/format1/Makefile \
d1b28647 393test/regex/Makefile \
291ec3b6 394test/filters/Makefile \
795ca3e5 395)
2dc95e1c
AK
396
397if test x$ODIRECT != xyes; then
398 echo
399 echo Warning: O_DIRECT disabled.
400 echo Use of pvmove may cause machine to lock up under low memory conditions.
401 echo
402fi
This page took 0.113145 seconds and 5 git commands to generate.