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