]> sourceware.org Git - lvm2.git/blame - configure.in
Fix status overflow check in kernel patches.
[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
77dnl -- setup the ownership of the files
78AC_ARG_WITH(user,
79 [ --with-user=USER Set the owner of installed files ],
80 [ OWNER="$withval" ],
81 [ OWNER="root" ])
82
83dnl -- setup the group ownership of the files
84AC_ARG_WITH(group,
85 [ --with-group=GROUP Set the group owner of installed files ],
86 [ GROUP="$withval" ],
87 [ GROUP="root" ])
88
5a52dca9
AK
89dnl -- format1 inclusion type
90AC_ARG_WITH(lvm1,
91 [ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none
92 [TYPE=internal] ],
93 [ LVM1="$withval" ],
94 [ LVM1="internal" ])
95
96if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
97 then AC_MSG_ERROR(
98--with-lvm1 parameter invalid
99)
100 exit
101fi;
102
b896caa1
AK
103if test x$LVM1 = xinternal; then
104 CFLAGS="$CFLAGS -DLVM1_INTERNAL"
105fi
106
8ef2b021 107AC_ARG_ENABLE(jobs, [ --enable-jobs=NUM Number of jobs to run simultaneously], JOBS=-j$enableval, JOBS=-j2)
795ca3e5 108
8106cdd5
AK
109dnl Enables staticly-linked tools
110AC_ARG_ENABLE(static_link, [ --enable-static_link Use this to link the tools to their libraries
795ca3e5
AK
111 statically. Default is dynamic linking], STATIC_LINK=$enableval, STATIC_LINK=no)
112
5a52dca9
AK
113dnl Enable readline
114AC_ARG_ENABLE(readline, [ --enable-readline Enable readline support], \
115READLINE=$enableval, READLINE=no)
795ca3e5 116
b896caa1
AK
117if test x$READLINE = xyes; then
118 CFLAGS="$CFLAGS -DREADLINE_SUPPORT"
119fi
120
69792976 121echo $ac_n "checking whether to enable debugging""... $ac_c" 1>&6
8ef2b021
AK
122dnl Enable Debugging
123AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging], \
124DEBUG=yes, DEBUG=no)
69792976 125echo "$ac_t""$DEBUG" 1>&6
8ef2b021 126
69792976 127echo $ac_n "checking whether to enable device-mapper""... $ac_c" 1>&6
199e490e
AK
128dnl Disable devmapper
129AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable device-mapper interaction], \
8106cdd5 130DEVMAPPER=no)
69792976 131echo "$ac_t""$DEVMAPPER" 1>&6
199e490e 132
b896caa1
AK
133if test x$DEVMAPPER = xyes; then
134 CFLAGS="$CFLAGS -DDEVMAPPER_SUPPORT"
135fi
136
69792976 137echo $ac_n "checking whether to enable O_DIRECT""... $ac_c" 1>&6
2dc95e1c
AK
138dnl Disable O_DIRECT
139AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT], \
8106cdd5 140ODIRECT=no)
69792976 141echo "$ac_t""$ODIRECT" 1>&6
2dc95e1c
AK
142
143if test x$ODIRECT = xyes; then
144 CFLAGS="$CFLAGS -DO_DIRECT_SUPPORT"
145fi
146
8106cdd5
AK
147echo $ac_n "checking whether to compile liblvm2cmd.so""... $ac_c" 1>&6
148dnl Enable cmdlib
149AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library], \
150CMDLIB=yes, CMDLIB=no)
151echo "$ac_t""$CMDLIB" 1>&6
152
153if test x$CMDLIB = xyes; then
154 CFLAGS="$CFLAGS -DCMDLIB"
155fi
156
795ca3e5
AK
157dnl Mess with default exec_prefix
158if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
159 then exec_prefix="";
160fi;
161
162dnl Checks for library functions.
163AC_PROG_GCC_TRADITIONAL
164AC_TYPE_SIGNAL
165AC_FUNC_VPRINTF
166AC_CHECK_FUNCS(mkdir rmdir uname)
167
168dnl check for termcap (Shamelessly copied from parted 1.4.17)
169if test x$READLINE = xyes; then
170 AC_SEARCH_LIBS(tgetent, ncurses curses termcap termlib, ,
171 AC_MSG_ERROR(
172termcap could not be found which is required for the
173--enable-readline option (which is enabled by default). Either disable readline
174support with --disable-readline or download and install termcap from:
175 ftp.gnu.org/gnu/termcap
176Note: if you are using precompiled packages you will also need the development
177 package as well (which may be called termcap-devel or something similar).
178Note: (n)curses also seems to work as a substitute for termcap. This was
179 not found either - but you could try installing that as well.
180)
181 exit
182 )
183fi
184
26e7f2e0
AK
185dnl Check for dlopen
186AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no)
187
d68a82ec 188if [[ "x$HAVE_LIBDL" = xyes -a "xSTATIC_LINK" = xno ]]; then
b896caa1 189 CFLAGS="$CFLAGS -DHAVE_LIBDL"
26e7f2e0 190 LIBS="-ldl $LIBS"
d68a82ec
AK
191else
192 HAVE_LIBDL=no
26e7f2e0
AK
193fi
194
d68a82ec
AK
195dnl Check for shared/static conflicts
196if [[ "x$LVM1" = xshared -a "x$STATIC_LINK" = xyes ]];
197 then AC_MSG_ERROR(
198Features cannot be \"shared\" when building statically
199)
200 exit
201fi;
202
b896caa1
AK
203dnl Check for getopt
204AC_CHECK_HEADERS(getopt.h, CFLAGS="$CFLAGS -DHAVE_GETOPTLONG")
205
795ca3e5
AK
206dnl Check for readline (Shamelessly copied from parted 1.4.17)
207if test x$READLINE = xyes; then
208 AC_CHECK_LIB(readline, readline, ,
209 AC_MSG_ERROR(
210GNU Readline could not be found which is required for the
211--enable-readline option (which is enabled by default). Either disable readline
212support with --disable-readline or download and install readline from:
213 ftp.gnu.org/gnu/readline
214Note: if you are using precompiled packages you will also need the development
215package as well (which may be called readline-devel or something similar).
216)
217 exit
218 )
b896caa1
AK
219 AC_CHECK_FUNC(rl_completion_matches, CFLAGS="$CFLAGS -DHAVE_RL_COMPLETION_MATCHES")
220
795ca3e5
AK
221fi
222
69792976
AK
223echo $ac_n "checking whether to enable internationalisation""... $ac_c" 1>&6
224dnl Internationalisation stuff
225AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support],\
226 INTL=yes, INTL=no)
227echo "$ac_t""$INTL" 1>&6
228
229if test x$INTL = xyes; then
230 INTL_PACKAGE="lvm2"
231 AC_PATH_PROG(MSGFMT, msgfmt)
232 if [[ "x$MSGFMT" == x ]];
233 then AC_MSG_ERROR(
234 msgfmt not found in path $PATH
235 )
236 exit
237 fi;
238
239 AC_ARG_WITH(localedir,
240 [ --with-localedir=DIR Translation files in DIR [PREFIX/share/locale]],
241 [ LOCALEDIR="$withval" ],
242 [ LOCALEDIR='${prefix}/share/locale' ])
243fi
244
fae0c576
AK
245if test "-f VERSION"; then
246 LVM_VERSION="\"`cat VERSION`\""
247else
248 LVM_VERSION="Unknown"
249fi
250
795ca3e5
AK
251AC_SUBST(JOBS)
252AC_SUBST(STATIC_LINK)
5a52dca9 253AC_SUBST(LVM1)
795ca3e5
AK
254AC_SUBST(OWNER)
255AC_SUBST(GROUP)
b896caa1 256AC_SUBST(CFLAGS)
8106cdd5
AK
257AC_SUBST(CLDFLAGS)
258AC_SUBST(CLDWHOLEARCHIVE)
259AC_SUBST(CLDNOWHOLEARCHIVE)
260AC_SUBST(LD_DEPS)
d68a82ec 261AC_SUBST(LD_FLAGS)
8106cdd5 262AC_SUBST(SOFLAG)
5f68d858 263AC_SUBST(LIBS)
fae0c576 264AC_SUBST(LVM_VERSION)
8ef2b021 265AC_SUBST(DEBUG)
199e490e 266AC_SUBST(DEVMAPPER)
26e7f2e0 267AC_SUBST(HAVE_LIBDL)
8106cdd5 268AC_SUBST(CMDLIB)
69792976
AK
269AC_SUBST(MSGFMT)
270AC_SUBST(LOCALEDIR)
271AC_SUBST(INTL_PACKAGE)
272AC_SUBST(INTL)
8106cdd5 273
795ca3e5
AK
274dnl First and last lines should not contain files to generate in order to
275dnl keep utility scripts running properly
276AC_OUTPUT( \
277Makefile \
278make.tmpl \
fa42e649 279include/Makefile \
795ca3e5 280lib/Makefile \
5a52dca9 281lib/format1/Makefile \
795ca3e5 282man/Makefile \
69792976 283po/Makefile \
795ca3e5 284tools/Makefile \
fae0c576 285tools/version.h \
e6efb2b0 286test/mm/Makefile \
43b7b8cf 287test/device/Makefile \
e0304b58 288test/format1/Makefile \
d1b28647 289test/regex/Makefile \
291ec3b6 290test/filters/Makefile \
795ca3e5 291)
2dc95e1c
AK
292
293if test x$ODIRECT != xyes; then
294 echo
295 echo Warning: O_DIRECT disabled.
296 echo Use of pvmove may cause machine to lock up under low memory conditions.
297 echo
298fi
This page took 0.058807 seconds and 5 git commands to generate.