]>
Commit | Line | Data |
---|---|---|
1227625a SP |
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 | ||
1227625a SP |
22 | dnl |
23 | dnl Handle --enable-debug | |
24 | dnl | |
25 | AC_ARG_ENABLE([debug], | |
d8574d45 | 26 | [ --enable-debug include debugging code], |
1227625a SP |
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], | |
d8574d45 | 45 | [ --enable-static link dump and restore statically], |
1227625a SP |
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], | |
d8574d45 | 62 | [ --enable-rmt compile and install rmt], |
1227625a SP |
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 | ||
2ed89fda SP |
77 | dnl |
78 | dnl Handle --enable-kerberos | |
79 | dnl | |
80 | AC_ARG_ENABLE([kerberos], | |
d8574d45 | 81 | [ --enable-kerberos compile kerberos extensions], |
2ed89fda SP |
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 | ||
c38e5b6a SP |
94 | dnl |
95 | dnl Handle --enable-readline | |
96 | dnl | |
97 | AC_ARG_ENABLE([readline], | |
d8574d45 | 98 | [ --enable-readline enable readline support in restore], |
c38e5b6a SP |
99 | if test "$enableval" = "no" |
100 | then | |
101 | READLINE="" | |
102 | else | |
5e04cc92 | 103 | READLINE="-lreadline -ltermcap" |
c38e5b6a SP |
104 | AC_DEFINE(HAVE_READLINE) |
105 | fi | |
106 | , | |
107 | READLINE="" | |
108 | echo "Not including readline support by default" | |
109 | ) | |
110 | AC_SUBST(READLINE) | |
111 | ||
d8574d45 SP |
112 | dnl |
113 | dnl Handle --enable-oldsylefscript | |
114 | dnl | |
115 | AC_ARG_ENABLE([oldstylefscript], | |
116 | [ --enable-oldstylefscript enable old style F script (no arguments)], | |
117 | if test "$enableval" = "yes" | |
118 | then | |
119 | AC_DEFINE(OLD_STYLE_FSCRIPT) | |
120 | fi | |
121 | , | |
122 | echo "Using new style F script" | |
123 | ) | |
124 | ||
d6967896 SP |
125 | dnl |
126 | dnl Handle --enable-largefile | |
127 | dnl | |
128 | AC_ARG_ENABLE([largefile], | |
129 | [ --enable-largefile enable Large File System support (your glibc needs to support it)], | |
130 | if test "$enableval" = "yes" | |
131 | then | |
132 | AC_DEFINE(_FILE_OFFSET_BITS,64) | |
133 | fi | |
134 | , | |
135 | echo "Not enabling Large File System support" | |
136 | ) | |
137 | ||
1227625a SP |
138 | dnl |
139 | dnl set $(CC) from --with-cc=value | |
140 | dnl | |
141 | AC_ARG_WITH([cc], | |
d8574d45 | 142 | [ --with-cc=COMPILER select compiler to use], |
1227625a SP |
143 | AC_MSG_RESULT(CC=$withval) |
144 | CC=$withval, | |
145 | if test -z "$CC" ; then CC=cc; fi | |
146 | [AC_MSG_RESULT(CC defaults to $CC)])dnl | |
147 | export CC | |
148 | AC_SUBST([CC]) | |
149 | ||
150 | dnl | |
151 | dnl set $(LD) from --with-linker=value | |
152 | dnl | |
153 | AC_ARG_WITH([linker], | |
d8574d45 | 154 | [ --with-linker=LINKER select linker to use], |
1227625a SP |
155 | AC_MSG_RESULT(LD=$withval) |
156 | LD=$withval, | |
157 | if test -z "$LD" ; then LD=$CC; fi | |
158 | [AC_MSG_RESULT(LD defaults to $LD)])dnl | |
159 | export LD | |
160 | AC_SUBST([LD]) | |
161 | ||
162 | dnl | |
163 | dnl set $(CCOPTS) from --with-ccopts=value | |
164 | dnl | |
165 | AC_ARG_WITH([ccopts], | |
d8574d45 | 166 | [ --with-ccopts=CCOPTS select compiler command line options], |
1227625a SP |
167 | AC_MSG_RESULT(CCOPTS is $withval) |
168 | CCOPTS=$withval | |
169 | CFLAGS="$CFLAGS $withval", | |
170 | CCOPTS=)dnl | |
171 | AC_SUBST(CCOPTS) | |
172 | ||
173 | dnl | |
174 | dnl set $(LDFLAGS) from --with-ldopts=value | |
175 | dnl | |
176 | AC_ARG_WITH([ldopts], | |
d8574d45 | 177 | [ --with-ldopts=LDOPTS select linker command line options], |
1227625a SP |
178 | AC_MSG_RESULT(LDFLAGS is $withval) |
179 | LDFLAGS=$withval, | |
180 | LDFLAGS=)dnl | |
181 | AC_SUBST(LDFLAGS) | |
182 | ||
183 | dnl | |
184 | dnl set $(BINOWNER) from --with-binowner | |
185 | dnl | |
186 | AC_ARG_WITH([binowner], | |
d8574d45 | 187 | [ --with-binowner=USER select owner for binaries], |
1227625a SP |
188 | AC_MSG_RESULT(BINOWNER is $withval) |
189 | BINOWNER=$withval, | |
190 | BINOWNER=root | |
191 | echo "BINOWNER defaults to $BINOWNER" | |
192 | )dnl | |
193 | AC_SUBST(BINOWNER) | |
194 | ||
195 | dnl | |
196 | dnl set $(BINGRP) from --with-bingrp | |
197 | dnl | |
198 | AC_ARG_WITH([bingrp], | |
d8574d45 | 199 | [ --with-bingrp=GROUP select group for binaries], |
1227625a SP |
200 | AC_MSG_RESULT(BINGRP is $withval) |
201 | BINGRP=$withval, | |
202 | BINGRP=tty | |
203 | echo "BINGRP defaults to $BINGRP" | |
204 | )dnl | |
205 | AC_SUBST(BINGRP) | |
206 | ||
207 | dnl | |
208 | dnl set $(BINMODE) from --with-binmode | |
209 | dnl | |
210 | AC_ARG_WITH([binmode], | |
d8574d45 | 211 | [ --with-binmode=MODE select mode for binaries], |
1227625a SP |
212 | AC_MSG_RESULT(BINMODE is $withval) |
213 | BINMODE=$withval, | |
882090d1 | 214 | BINMODE=0755 |
1227625a SP |
215 | echo "BINMODE defaults to $BINMODE" |
216 | )dnl | |
217 | AC_SUBST(BINMODE) | |
218 | ||
219 | dnl | |
220 | dnl set $(MANOWNER) from --with-manowner | |
221 | dnl | |
222 | AC_ARG_WITH([manowner], | |
d8574d45 | 223 | [ --with-manowner=USER select owner for manual pages], |
1227625a SP |
224 | AC_MSG_RESULT(MANOWNER is $withval) |
225 | MANOWNER=$withval, | |
226 | MANOWNER=man | |
227 | echo "MANOWNER defaults to $MANOWNER" | |
228 | )dnl | |
229 | AC_SUBST(MANOWNER) | |
230 | ||
231 | dnl | |
232 | dnl set $(MANGRP) from --with-mangrp | |
233 | dnl | |
234 | AC_ARG_WITH([mangrp], | |
d8574d45 | 235 | [ --with-mangrp=GROUP select group for manual pages], |
1227625a SP |
236 | AC_MSG_RESULT(MANGRP is $withval) |
237 | MANGRP=$withval, | |
238 | MANGRP=tty | |
239 | echo "MANGRP defaults to $MANGRP" | |
240 | )dnl | |
241 | AC_SUBST(MANGRP) | |
242 | ||
243 | dnl | |
244 | dnl set $(MANMODE) from --with-manmode | |
245 | dnl | |
246 | AC_ARG_WITH([manmode], | |
d8574d45 | 247 | [ --with-manmode=MODE select mode for manual pages], |
1227625a SP |
248 | AC_MSG_RESULT(MANMODE is $withval) |
249 | MANMODE=$withval, | |
882090d1 | 250 | MANMODE=0644 |
1227625a SP |
251 | echo "MANMODE defaults to $MANMODE" |
252 | )dnl | |
253 | AC_SUBST(MANMODE) | |
254 | ||
8d4197bb SP |
255 | dnl |
256 | dnl set $(DUMPDATESPATH) from --with-dumpdatespath | |
257 | dnl | |
258 | AC_ARG_WITH([dumpdatespath], | |
d8574d45 | 259 | [ --with-dumpdatespath=PATH select path for dumpdates file], |
8d4197bb SP |
260 | AC_MSG_RESULT(DUMPDATESPATH is $withval) |
261 | DUMPDATESPATH=$withval, | |
262 | DUMPDATESPATH="/etc/dumpdates" | |
263 | echo "DUMPDATESPATH defaults to $DUMPDATESPATH" | |
264 | )dnl | |
265 | AC_SUBST(DUMPDATESPATH) | |
266 | ||
1227625a SP |
267 | dnl |
268 | dnl Check for Ext2fs headers and libraries | |
269 | dnl | |
270 | AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no]) | |
271 | AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err]) | |
272 | if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then | |
d3393043 | 273 | AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first - hint: make install-libs) |
1227625a SP |
274 | fi |
275 | ||
3e815572 SP |
276 | dnl |
277 | dnl Check for termcap libraries | |
278 | dnl | |
279 | AC_CHECK_LIB(termcap, tgetent, [termcap_lib=yes], [termcap_lib=no]) | |
280 | if test "$termcap_lib" = no; then | |
281 | if test "$READLINE" = "-lreadline -ltermcap"; then | |
282 | AC_MSG_ERROR(You need to install the GNU termcap libraries first) | |
283 | fi | |
284 | fi | |
285 | ||
c38e5b6a SP |
286 | dnl |
287 | dnl Check for readline headers and libraries | |
288 | dnl | |
289 | AC_CHECK_HEADER(readline/readline.h, [readline_h=yes], [readline_h=no]) | |
3e815572 | 290 | AC_CHECK_LIB(readline, readline, [readline_lib=yes], [readline_lib=no], "-ltermcap") |
c38e5b6a | 291 | if test "$readline_h" = no -o "$readline_lib" = no; then |
3e815572 | 292 | if test "$READLINE" = "-lreadline -ltermcap"; then |
c38e5b6a SP |
293 | AC_MSG_ERROR(You need to install the GNU readline libraries first) |
294 | fi | |
295 | fi | |
296 | ||
1227625a SP |
297 | dnl |
298 | dnl Check for library functions | |
299 | dnl | |
5c1faba5 SP |
300 | AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath lchown) |
301 | AC_CHECK_FUNC(glob) | |
302 | ||
303 | dnl | |
304 | dnl Check for GLOB_ALTDIRFUNC | |
305 | dnl | |
306 | if test "$ac_cv_func_glob" = "yes"; then | |
307 | AC_EGREP_CPP(yes, | |
308 | [ | |
309 | # include <glob.h> | |
310 | # ifdef GLOB_ALTDIRFUNC | |
311 | yes | |
312 | # endif | |
313 | ], AC_DEFINE(HAVE_GLOB), noglob=yes) | |
314 | if test "$noglob" = "yes"; then | |
315 | echo "Your system does not support extended glob, will use the internal routines" | |
316 | fi | |
317 | fi | |
1227625a SP |
318 | |
319 | dnl | |
320 | dnl Check for types | |
321 | dnl | |
322 | AC_CHECK_TYPE(quad_t, __s64) | |
323 | AC_CHECK_TYPE(u_quad_t, __u64) | |
324 | ||
325 | dnl | |
326 | dnl Compute top_buildir | |
327 | dnl | |
328 | top_builddir=`cd .; pwd` | |
329 | AC_SUBST(top_builddir) | |
330 | ||
331 | dnl | |
332 | dnl Create directories | |
333 | dnl | |
334 | test -d compat || mkdir compat | |
335 | test -d compat/lib || mkdir compat/lib | |
336 | ||
337 | dnl | |
338 | dnl Output files | |
339 | dnl | |
8d4197bb | 340 | AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE) |