~registry/lvm2/master

118 by Alasdair Kergon
Makefiles & autoconf.
1
################################################################################
2
##
3
##    Copyright 1999-2000 Sistina Software, Inc.
4
##
5
##    This is free software released under the GNU General Public License.
6
##    There is no warranty for this software.  See the file COPYING for
7
##    details.
8
##
9
##    See the file CONTRIBUTORS for a list of contributors.
10
##
11
##    This file is maintained by:
12
##      AJ Lewis <lewis@sistina.com>
13
## 
14
##    File name: configure.in
15
##
16
##    Description: Input file for autoconf.  Generates the configure script 
17
##                 that tries to keep everything nice and portable.  It also
18
##                 simplifies distribution package building considerably.
19
################################################################################
20
21
dnl Process this file with autoconf to produce a configure script.
209 by Joe Thornber
o AC_INIT was pointing to an old file
22
AC_INIT(lib/device/dev-cache.h)
118 by Alasdair Kergon
Makefiles & autoconf.
23
24
dnl setup the directory where autoconf has auxilary files
25
AC_CONFIG_AUX_DIR(autoconf) 
26
27
dnl Checks for programs.
28
AC_PROG_AWK
29
AC_PROG_CC
30
AC_PROG_INSTALL
31
AC_PROG_LN_S
32
AC_PROG_MAKE_SET
33
AC_PROG_RANLIB
34
35
dnl Checks for header files.
36
AC_HEADER_DIRENT
37
AC_HEADER_STDC
38
AC_CHECK_HEADERS(fcntl.h malloc.h sys/ioctl.h unistd.h)
39
40
dnl Checks for typedefs, structures, and compiler characteristics.
41
AC_C_CONST
42
AC_C_INLINE
43
AC_TYPE_OFF_T
44
AC_TYPE_PID_T
45
AC_TYPE_SIZE_T
46
AC_STRUCT_ST_RDEV
47
AC_HEADER_TIME
48
961 by Alasdair Kergon
Improve build robustness.
49
dnl Get system type
50
AC_CANONICAL_SYSTEM
51
52
case "$host_os" in
53
	linux*)
54
		CFLAGS= ;;
55
esac
56
118 by Alasdair Kergon
Makefiles & autoconf.
57
dnl -- prefix is /usr by default, the exec_prefix default is setup later
58
AC_PREFIX_DEFAULT(/usr)
59
60
dnl -- setup the ownership of the files
61
AC_ARG_WITH(user,
62
  [  --with-user=USER        Set the owner of installed files ],
63
  [ OWNER="$withval" ],
64
  [ OWNER="root" ])
65
66
dnl -- setup the group ownership of the files
67
AC_ARG_WITH(group,
68
  [  --with-group=GROUP      Set the group owner of installed files ],
69
  [ GROUP="$withval" ],
70
  [ GROUP="root" ])
71
890 by Alasdair Kergon
Some new features.
72
dnl -- format1 inclusion type
73
AC_ARG_WITH(lvm1,
74
  [  --with-lvm1=TYPE        LVM1 metadata support: internal/shared/none
75
                          [TYPE=internal] ],
76
  [ LVM1="$withval" ],
77
  [ LVM1="internal" ])
78
79
if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
80
 then  AC_MSG_ERROR(
81
--with-lvm1 parameter invalid
82
)
83
 exit
84
fi;
85
961 by Alasdair Kergon
Improve build robustness.
86
if test x$LVM1 = xinternal; then
87
	CFLAGS="$CFLAGS -DLVM1_INTERNAL"
88
fi
89
916 by Alasdair Kergon
Default stripesize 64k & config file setting for it;
90
AC_ARG_ENABLE(jobs, [  --enable-jobs=NUM       Number of jobs to run simultaneously], JOBS=-j$enableval, JOBS=-j2)
118 by Alasdair Kergon
Makefiles & autoconf.
91
92
dnl Enables staticly linked tools
93
AC_ARG_ENABLE(static_link, [  --enable-static_link    Use this to link the tools to the liblvm library
94
                          statically.  Default is dynamic linking],  STATIC_LINK=$enableval, STATIC_LINK=no)
95
890 by Alasdair Kergon
Some new features.
96
dnl Enable readline
97
AC_ARG_ENABLE(readline, [  --enable-readline       Enable readline support],  \
98
READLINE=$enableval, READLINE=no)
118 by Alasdair Kergon
Makefiles & autoconf.
99
961 by Alasdair Kergon
Improve build robustness.
100
if test x$READLINE = xyes; then
101
	CFLAGS="$CFLAGS -DREADLINE_SUPPORT"
102
fi
103
916 by Alasdair Kergon
Default stripesize 64k & config file setting for it;
104
dnl Enable Debugging
105
AC_ARG_ENABLE(debug,    [  --enable-debug          Enable debugging],  \
106
DEBUG=yes, DEBUG=no)
107
926 by Alasdair Kergon
configure --disable-devmapper if you don't have libdevmapper
108
dnl Disable devmapper
109
AC_ARG_ENABLE(devmapper, [  --disable-devmapper     Disable device-mapper interaction],  \
110
DEVMAPPER=no, DEVMAPPER=yes)
111
961 by Alasdair Kergon
Improve build robustness.
112
if test x$DEVMAPPER = xyes; then
113
	CFLAGS="$CFLAGS -DDEVMAPPER_SUPPORT"
114
fi
115
1072 by Alasdair Kergon
Configuration-time O_DIRECT setting.
116
dnl Disable O_DIRECT
117
AC_ARG_ENABLE(o_direct, [  --disable-o_direct      Disable O_DIRECT],  \
118
ODIRECT=no, ODIRECT=yes)
119
120
if test x$ODIRECT = xyes; then
121
	CFLAGS="$CFLAGS -DO_DIRECT_SUPPORT"
122
fi
123
118 by Alasdair Kergon
Makefiles & autoconf.
124
dnl Mess with default exec_prefix
125
if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
126
 then  exec_prefix="";
127
fi;
128
129
dnl Checks for library functions.
130
AC_PROG_GCC_TRADITIONAL
131
AC_TYPE_SIGNAL
132
AC_FUNC_VPRINTF
133
AC_CHECK_FUNCS(mkdir rmdir uname)
134
135
dnl check for termcap (Shamelessly copied from parted 1.4.17)
136
if test x$READLINE = xyes; then
137
	AC_SEARCH_LIBS(tgetent, ncurses curses termcap termlib, ,
138
		AC_MSG_ERROR(
139
termcap could not be found which is required for the
140
--enable-readline option (which is enabled by default).  Either disable readline
141
support with --disable-readline or download and install termcap from:
142
	ftp.gnu.org/gnu/termcap
143
Note: if you are using precompiled packages you will also need the development
144
  package as well (which may be called termcap-devel or something similar).
145
Note: (n)curses also seems to work as a substitute for termcap.  This was
146
  not found either - but you could try installing that as well.
147
)
148
	exit
149
	)
150
fi
151
948 by Alasdair Kergon
Tidy various pre-processing incl. making libdl optional.
152
dnl Check for dlopen
153
AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no)
154
155
if test x$HAVE_LIBDL = xyes; then
961 by Alasdair Kergon
Improve build robustness.
156
	CFLAGS="$CFLAGS -DHAVE_LIBDL"
948 by Alasdair Kergon
Tidy various pre-processing incl. making libdl optional.
157
	LIBS="-ldl $LIBS"
158
fi
159
961 by Alasdair Kergon
Improve build robustness.
160
dnl Check for getopt
161
AC_CHECK_HEADERS(getopt.h, CFLAGS="$CFLAGS -DHAVE_GETOPTLONG")
162
118 by Alasdair Kergon
Makefiles & autoconf.
163
dnl Check for readline (Shamelessly copied from parted 1.4.17)
164
if test x$READLINE = xyes; then
165
	AC_CHECK_LIB(readline, readline, ,
166
		AC_MSG_ERROR(
167
GNU Readline could not be found which is required for the
168
--enable-readline option (which is enabled by default).  Either disable readline
169
support with --disable-readline or download and install readline from:
170
	ftp.gnu.org/gnu/readline
171
Note: if you are using precompiled packages you will also need the development
172
package as well (which may be called readline-devel or something similar).
173
)
174
		exit
175
	)
961 by Alasdair Kergon
Improve build robustness.
176
	AC_CHECK_FUNC(rl_completion_matches, CFLAGS="$CFLAGS -DHAVE_RL_COMPLETION_MATCHES")
177
		
118 by Alasdair Kergon
Makefiles & autoconf.
178
fi
179
574 by Alasdair Kergon
Support --version argument and 'version' shell command.
180
if test "-f VERSION"; then
181
  LVM_VERSION="\"`cat VERSION`\""
182
else
183
  LVM_VERSION="Unknown"
184
fi
185
118 by Alasdair Kergon
Makefiles & autoconf.
186
AC_SUBST(JOBS)
187
AC_SUBST(STATIC_LINK)
890 by Alasdair Kergon
Some new features.
188
AC_SUBST(LVM1)
118 by Alasdair Kergon
Makefiles & autoconf.
189
AC_SUBST(OWNER)
190
AC_SUBST(GROUP)
961 by Alasdair Kergon
Improve build robustness.
191
AC_SUBST(CFLAGS)
365 by Patrick Caulfield
Do substitution on LIBS so that those platforms that need -lncurses as well as
192
AC_SUBST(LIBS)
574 by Alasdair Kergon
Support --version argument and 'version' shell command.
193
AC_SUBST(LVM_VERSION)
916 by Alasdair Kergon
Default stripesize 64k & config file setting for it;
194
AC_SUBST(DEBUG)
926 by Alasdair Kergon
configure --disable-devmapper if you don't have libdevmapper
195
AC_SUBST(DEVMAPPER)
948 by Alasdair Kergon
Tidy various pre-processing incl. making libdl optional.
196
AC_SUBST(HAVE_LIBDL)
118 by Alasdair Kergon
Makefiles & autoconf.
197
dnl First and last lines should not contain files to generate in order to 
198
dnl keep utility scripts running properly
199
AC_OUTPUT( 								\
200
Makefile								\
201
make.tmpl                                                               \
141 by Alasdair Kergon
Create symlinks to .h files in an include directory
202
include/Makefile						 	\
118 by Alasdair Kergon
Makefiles & autoconf.
203
lib/Makefile							 	\
890 by Alasdair Kergon
Some new features.
204
lib/format1/Makefile						 	\
118 by Alasdair Kergon
Makefiles & autoconf.
205
man/Makefile							 	\
206
tools/Makefile							 	\
574 by Alasdair Kergon
Support --version argument and 'version' shell command.
207
tools/version.h								\
166 by Joe Thornber
o got dbg_malloc_t working, Alasdair could you look at the Makefile.in it
208
test/mm/Makefile							\
185 by Joe Thornber
o dev_cache_t program works
209
test/device/Makefile							\
181 by Joe Thornber
o makefile for read_vg_t
210
test/format1/Makefile							\
265 by Joe Thornber
o First pass at the regex code. lib/regex/matcher takes an array of regex's
211
test/regex/Makefile                                                     \
266 by Joe Thornber
o Filter for the dev cache that takes values from config file:
212
test/filters/Makefile                                                   \
118 by Alasdair Kergon
Makefiles & autoconf.
213
)
1072 by Alasdair Kergon
Configuration-time O_DIRECT setting.
214
215
if test x$ODIRECT != xyes; then
216
  echo
217
  echo Warning: O_DIRECT disabled.
218
  echo Use of pvmove may cause machine to lock up under low memory conditions.
219
  echo
220
fi