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