]> git.wh0rd.org - dump.git/blob - configure.in
00038cdae2a7e98f36fd63227ade9ab0e1ffb677
[dump.git] / configure.in
1 AC_INIT(dump/dump.h)
2
3 MCONFIG=./MCONFIG
4 AC_SUBST_FILE(MCONFIG)
5
6 AC_CONFIG_HEADER(config.h)
7
8 dnl
9 dnl Check for programs
10 dnl
11 AC_PROG_MAKE_SET
12 AC_PROG_LN_S
13 AC_PATH_PROG(CP, cp, cp)
14 AC_PATH_PROG(MV, mv, mv)
15 AC_PATH_PROG(RM, rm, rm)
16 AC_CHECK_TOOL(AR, ar, ar)
17 AC_CHECK_TOOL(RANLIB, ranlib, :)
18 AC_CHECK_TOOL(PATCH, patch, :)
19 AC_PROG_CC
20 AC_PROG_INSTALL
21
22 dnl
23 dnl Handle --enable-debug
24 dnl
25 AC_ARG_ENABLE([debug],
26 [ --enable-debug include debugging code],
27 if test "$enableval" = "no"
28 then
29 DUMPDEBUG=""
30 RESTOREDEBUG=""
31 else
32 DUMPDEBUG="-DFDEBUG -DTDEBUG -DWRITEDEBUG -DDIRDEBUG"
33 RESTOREDEBUG="-DDIRDEBUG"
34 fi,
35 DUMPDEBUG=""
36 RESTOREDEBUG=""
37 )
38 AC_SUBST(DUMPDEBUG)
39 AC_SUBST(RESTOREDEBUG)
40
41 dnl
42 dnl Handle --enable-static
43 dnl
44 AC_ARG_ENABLE([static],
45 [ --enable-static link dump and restore statically],
46 if test "$enableval" = "no"
47 then
48 STATIC=""
49 else
50 STATIC="-static"
51 fi
52 ,
53 STATIC=""
54 echo "Linking dump and restore dynamically by default"
55 )
56 AC_SUBST(STATIC)
57
58 dnl
59 dnl Handle --enable-rmt
60 dnl
61 AC_ARG_ENABLE([rmt],
62 [ --enable-rmt compile and install rmt],
63 if test "$enableval" = "no"
64 then
65 RMTDIR=""
66 RMTMAKEFILE=""
67 else
68 RMTDIR="rmt"
69 RMTMAKEFILE="rmt/Makefile"
70 fi
71 ,
72 RMTDIR=""
73 echo "Not compiling rmt by default"
74 )
75 AC_SUBST(RMTDIR)
76
77 dnl
78 dnl Handle --enable-kerberos
79 dnl
80 AC_ARG_ENABLE([kerberos],
81 [ --enable-kerberos compile kerberos extensions],
82 if test "$enableval" = "yes"
83 then
84 OPTDEFS="-DKERBEROS"
85 else
86 OPTDEFS=""
87 fi
88 ,
89 OPTDEFS=""
90 echo "Not compiling kerberos extensions by default"
91 )
92 AC_SUBST(OPTDEFS)
93
94 dnl
95 dnl Handle --enable-readline
96 dnl
97 AC_ARG_ENABLE([readline],
98 [ --enable-readline enable readline support in restore],
99 if test "$enableval" = "no"
100 then
101 READLINE=""
102 else
103 READLINE="-lreadline"
104 AC_DEFINE(HAVE_READLINE)
105 fi
106 ,
107 READLINE=""
108 echo "Not including readline support by default"
109 )
110 AC_SUBST(READLINE)
111
112 dnl
113 dnl set $(CC) from --with-cc=value
114 dnl
115 AC_ARG_WITH([cc],
116 [ --with-cc=COMPILER select compiler to use],
117 AC_MSG_RESULT(CC=$withval)
118 CC=$withval,
119 if test -z "$CC" ; then CC=cc; fi
120 [AC_MSG_RESULT(CC defaults to $CC)])dnl
121 export CC
122 AC_SUBST([CC])
123
124 dnl
125 dnl set $(LD) from --with-linker=value
126 dnl
127 AC_ARG_WITH([linker],
128 [ --with-linker=LINKER select linker to use],
129 AC_MSG_RESULT(LD=$withval)
130 LD=$withval,
131 if test -z "$LD" ; then LD=$CC; fi
132 [AC_MSG_RESULT(LD defaults to $LD)])dnl
133 export LD
134 AC_SUBST([LD])
135
136 dnl
137 dnl set $(CCOPTS) from --with-ccopts=value
138 dnl
139 AC_ARG_WITH([ccopts],
140 [ --with-ccopts=CCOPTS select compiler command line options],
141 AC_MSG_RESULT(CCOPTS is $withval)
142 CCOPTS=$withval
143 CFLAGS="$CFLAGS $withval",
144 CCOPTS=)dnl
145 AC_SUBST(CCOPTS)
146
147 dnl
148 dnl set $(LDFLAGS) from --with-ldopts=value
149 dnl
150 AC_ARG_WITH([ldopts],
151 [ --with-ldopts=LDOPTS select linker command line options],
152 AC_MSG_RESULT(LDFLAGS is $withval)
153 LDFLAGS=$withval,
154 LDFLAGS=)dnl
155 AC_SUBST(LDFLAGS)
156
157 dnl
158 dnl set $(BINOWNER) from --with-binowner
159 dnl
160 AC_ARG_WITH([binowner],
161 [ --with-binowner=USER select owner for binaries],
162 AC_MSG_RESULT(BINOWNER is $withval)
163 BINOWNER=$withval,
164 BINOWNER=root
165 echo "BINOWNER defaults to $BINOWNER"
166 )dnl
167 AC_SUBST(BINOWNER)
168
169 dnl
170 dnl set $(BINGRP) from --with-bingrp
171 dnl
172 AC_ARG_WITH([bingrp],
173 [ --with-bingrp=GROUP select group for binaries],
174 AC_MSG_RESULT(BINGRP is $withval)
175 BINGRP=$withval,
176 BINGRP=tty
177 echo "BINGRP defaults to $BINGRP"
178 )dnl
179 AC_SUBST(BINGRP)
180
181 dnl
182 dnl set $(BINMODE) from --with-binmode
183 dnl
184 AC_ARG_WITH([binmode],
185 [ --with-binmode=MODE select mode for binaries],
186 AC_MSG_RESULT(BINMODE is $withval)
187 BINMODE=$withval,
188 BINMODE=6555
189 echo "BINMODE defaults to $BINMODE"
190 )dnl
191 AC_SUBST(BINMODE)
192
193 dnl
194 dnl set $(MANOWNER) from --with-manowner
195 dnl
196 AC_ARG_WITH([manowner],
197 [ --with-manowner=USER select owner for manual pages],
198 AC_MSG_RESULT(MANOWNER is $withval)
199 MANOWNER=$withval,
200 MANOWNER=man
201 echo "MANOWNER defaults to $MANOWNER"
202 )dnl
203 AC_SUBST(MANOWNER)
204
205 dnl
206 dnl set $(MANGRP) from --with-mangrp
207 dnl
208 AC_ARG_WITH([mangrp],
209 [ --with-mangrp=group select group for manual pages],
210 AC_MSG_RESULT(MANGRP is $withval)
211 MANGRP=$withval,
212 MANGRP=tty
213 echo "MANGRP defaults to $MANGRP"
214 )dnl
215 AC_SUBST(MANGRP)
216
217 dnl
218 dnl set $(MANMODE) from --with-manmode
219 dnl
220 AC_ARG_WITH([manmode],
221 [ --with-manmode=MODE select mode for manual pages],
222 AC_MSG_RESULT(MANMODE is $withval)
223 MANMODE=$withval,
224 MANMODE=0444
225 echo "MANMODE defaults to $MANMODE"
226 )dnl
227 AC_SUBST(MANMODE)
228
229 dnl
230 dnl set $(DUMPDATESPATH) from --with-dumpdatespath
231 dnl
232 AC_ARG_WITH([dumpdatespath],
233 [ --with-dumpdatespath=path select path for dumpdates file],
234 AC_MSG_RESULT(DUMPDATESPATH is $withval)
235 DUMPDATESPATH=$withval,
236 DUMPDATESPATH="/etc/dumpdates"
237 echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
238 )dnl
239 AC_SUBST(DUMPDATESPATH)
240
241 dnl
242 dnl Check for Ext2fs headers and libraries
243 dnl
244 AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no])
245 AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err])
246 if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
247 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs)
248 fi
249
250 dnl
251 dnl Check for readline headers and libraries
252 dnl
253 AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no])
254 AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no])
255 if test "$readline_h" = no -o "$readline_lib" = no; then
256 if test "$READLINE" = "-lreadline"; then
257 AC_MSG_ERROR(You need to install the GNU readline libraries first)
258 fi
259 fi
260
261 dnl
262 dnl Check for library functions
263 dnl
264 AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown)
265 AC_CHECK_FUNC(glob)
266
267 dnl
268 dnl Check for GLOB_ALTDIRFUNC
269 dnl
270 if test "$ac_cv_func_glob" = "yes"; then
271 AC_EGREP_CPP(yes,
272 [
273 # include <glob.h>
274 # ifdef GLOB_ALTDIRFUNC
275 yes
276 # endif
277 ], AC_DEFINE(HAVE_GLOB), noglob=yes)
278 if test "$noglob" = "yes"; then
279 echo "Your system does not support extended glob, will use the internal routines"
280 fi
281 fi
282
283 dnl
284 dnl Check for types
285 dnl
286 AC_CHECK_TYPE(quad_t, __s64)
287 AC_CHECK_TYPE(u_quad_t, __u64)
288
289 dnl
290 dnl Compute top_buildir
291 dnl
292 top_builddir=`cd .; pwd`
293 AC_SUBST(top_builddir)
294
295 dnl
296 dnl Create directories
297 dnl
298 test -d compat || mkdir compat
299 test -d compat/lib || mkdir compat/lib
300
301 dnl
302 dnl Output files
303 dnl
304 AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)