]> git.wh0rd.org - dump.git/blob - configure.in
Added the prompt command in restore interactive mode.
[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 set $(CC) from --with-cc=value
96 dnl
97 AC_ARG_WITH([cc],
98 [ --with-cc=COMPILER select compiler to use],
99 AC_MSG_RESULT(CC=$withval)
100 CC=$withval,
101 if test -z "$CC" ; then CC=cc; fi
102 [AC_MSG_RESULT(CC defaults to $CC)])dnl
103 export CC
104 AC_SUBST([CC])
105
106 dnl
107 dnl set $(LD) from --with-linker=value
108 dnl
109 AC_ARG_WITH([linker],
110 [ --with-linker=LINKER select linker to use],
111 AC_MSG_RESULT(LD=$withval)
112 LD=$withval,
113 if test -z "$LD" ; then LD=$CC; fi
114 [AC_MSG_RESULT(LD defaults to $LD)])dnl
115 export LD
116 AC_SUBST([LD])
117
118 dnl
119 dnl set $(CCOPTS) from --with-ccopts=value
120 dnl
121 AC_ARG_WITH([ccopts],
122 [ --with-ccopts=CCOPTS select compiler command line options],
123 AC_MSG_RESULT(CCOPTS is $withval)
124 CCOPTS=$withval
125 CFLAGS="$CFLAGS $withval",
126 CCOPTS=)dnl
127 AC_SUBST(CCOPTS)
128
129 dnl
130 dnl set $(LDFLAGS) from --with-ldopts=value
131 dnl
132 AC_ARG_WITH([ldopts],
133 [ --with-ldopts=LDOPTS select linker command line options],
134 AC_MSG_RESULT(LDFLAGS is $withval)
135 LDFLAGS=$withval,
136 LDFLAGS=)dnl
137 AC_SUBST(LDFLAGS)
138
139 dnl
140 dnl set $(BINOWNER) from --with-binowner
141 dnl
142 AC_ARG_WITH([binowner],
143 [ --with-binowner=USER select owner for binaries],
144 AC_MSG_RESULT(BINOWNER is $withval)
145 BINOWNER=$withval,
146 BINOWNER=root
147 echo "BINOWNER defaults to $BINOWNER"
148 )dnl
149 AC_SUBST(BINOWNER)
150
151 dnl
152 dnl set $(BINGRP) from --with-bingrp
153 dnl
154 AC_ARG_WITH([bingrp],
155 [ --with-bingrp=GROUP select group for binaries],
156 AC_MSG_RESULT(BINGRP is $withval)
157 BINGRP=$withval,
158 BINGRP=tty
159 echo "BINGRP defaults to $BINGRP"
160 )dnl
161 AC_SUBST(BINGRP)
162
163 dnl
164 dnl set $(BINMODE) from --with-binmode
165 dnl
166 AC_ARG_WITH([binmode],
167 [ --with-binmode=MODE select mode for binaries],
168 AC_MSG_RESULT(BINMODE is $withval)
169 BINMODE=$withval,
170 BINMODE=6555
171 echo "BINMODE defaults to $BINMODE"
172 )dnl
173 AC_SUBST(BINMODE)
174
175 dnl
176 dnl set $(MANOWNER) from --with-manowner
177 dnl
178 AC_ARG_WITH([manowner],
179 [ --with-manowner=USER select owner for manual pages],
180 AC_MSG_RESULT(MANOWNER is $withval)
181 MANOWNER=$withval,
182 MANOWNER=man
183 echo "MANOWNER defaults to $MANOWNER"
184 )dnl
185 AC_SUBST(MANOWNER)
186
187 dnl
188 dnl set $(MANGRP) from --with-mangrp
189 dnl
190 AC_ARG_WITH([mangrp],
191 [ --with-mangrp=group select group for manual pages],
192 AC_MSG_RESULT(MANGRP is $withval)
193 MANGRP=$withval,
194 MANGRP=tty
195 echo "MANGRP defaults to $MANGRP"
196 )dnl
197 AC_SUBST(MANGRP)
198
199 dnl
200 dnl set $(MANMODE) from --with-manmode
201 dnl
202 AC_ARG_WITH([manmode],
203 [ --with-manmode=MODE select mode for manual pages],
204 AC_MSG_RESULT(MANMODE is $withval)
205 MANMODE=$withval,
206 MANMODE=0444
207 echo "MANMODE defaults to $MANMODE"
208 )dnl
209 AC_SUBST(MANMODE)
210
211 dnl
212 dnl set $(DUMPDATESPATH) from --with-dumpdatespath
213 dnl
214 AC_ARG_WITH([dumpdatespath],
215 [ --with-dumpdatespath=path select path for dumpdates file],
216 AC_MSG_RESULT(DUMPDATESPATH is $withval)
217 DUMPDATESPATH=$withval,
218 DUMPDATESPATH="/etc/dumpdates"
219 echo "DUMPDATESPATH defaults to $DUMPDATESPATH"
220 )dnl
221 AC_SUBST(DUMPDATESPATH)
222
223 dnl
224 dnl Check for Ext2fs headers and libraries
225 dnl
226 AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no])
227 AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err])
228 if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
229 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs)
230 fi
231
232 dnl
233 dnl Check for library functions
234 dnl
235 AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown)
236 AC_CHECK_FUNC(glob)
237
238 dnl
239 dnl Check for GLOB_ALTDIRFUNC
240 dnl
241 if test "$ac_cv_func_glob" = "yes"; then
242 AC_EGREP_CPP(yes,
243 [
244 # include <glob.h>
245 # ifdef GLOB_ALTDIRFUNC
246 yes
247 # endif
248 ], AC_DEFINE(HAVE_GLOB), noglob=yes)
249 if test "$noglob" = "yes"; then
250 echo "Your system does not support extended glob, will use the internal routines"
251 fi
252 fi
253
254 dnl
255 dnl Check for types
256 dnl
257 AC_CHECK_TYPE(quad_t, __s64)
258 AC_CHECK_TYPE(u_quad_t, __u64)
259
260 dnl
261 dnl Compute top_buildir
262 dnl
263 top_builddir=`cd .; pwd`
264 AC_SUBST(top_builddir)
265
266 dnl
267 dnl Create directories
268 dnl
269 test -d compat || mkdir compat
270 test -d compat/lib || mkdir compat/lib
271
272 dnl
273 dnl Output files
274 dnl
275 AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)