]> git.wh0rd.org - dump.git/blame - configure.in
Version 0.4b6.
[dump.git] / configure.in
CommitLineData
1227625a
SP
1AC_INIT(dump/dump.h)
2
3MCONFIG=./MCONFIG
4AC_SUBST_FILE(MCONFIG)
5
6AC_CONFIG_HEADER(config.h)
7
8dnl
9dnl Check for programs
10dnl
11AC_PROG_MAKE_SET
12AC_PROG_LN_S
13AC_PATH_PROG(CP, cp, cp)
14AC_PATH_PROG(MV, mv, mv)
15AC_PATH_PROG(RM, rm, rm)
16AC_CHECK_TOOL(AR, ar, ar)
17AC_CHECK_TOOL(RANLIB, ranlib, :)
18AC_CHECK_TOOL(PATCH, patch, :)
19AC_PROG_CC
20AC_PROG_INSTALL
21
22dnl
23dnl Handle --enable-dumpdates-patch
24dnl
25AC_ARG_ENABLE([dumpdates-patch],
26[ --enable-dumpdates-patch apply the dumpdates patch from Debian],
27if test "$enableval" = "yes"
28then
29 if test "$PATCH" = ":"
30 then
31 AC_MSG_ERROR(The patch program was not found on your system)
32 fi
33 (cd $srcdir; $PATCH -p < debian-patch)
34fi
35,
36)
37
38dnl
39dnl Handle --enable-debug
40dnl
41AC_ARG_ENABLE([debug],
42[ --enable-debug include debugging code],
43if test "$enableval" = "no"
44then
45 DUMPDEBUG=""
46 RESTOREDEBUG=""
47else
48 DUMPDEBUG="-DFDEBUG -DTDEBUG -DWRITEDEBUG -DDIRDEBUG"
49 RESTOREDEBUG="-DDIRDEBUG"
50fi,
51DUMPDEBUG=""
52RESTOREDEBUG=""
53)
54AC_SUBST(DUMPDEBUG)
55AC_SUBST(RESTOREDEBUG)
56
57dnl
58dnl Handle --enable-static
59dnl
60AC_ARG_ENABLE([static],
61[ --enable-static link dump and restore statically],
62if test "$enableval" = "no"
63then
64 STATIC=""
65else
66 STATIC="-static"
67fi
68,
69STATIC=""
70echo "Linking dump and restore dynamically by default"
71)
72AC_SUBST(STATIC)
73
74dnl
75dnl Handle --enable-rmt
76dnl
77AC_ARG_ENABLE([rmt],
78[ --enable-rmt compile and install rmt],
79if test "$enableval" = "no"
80then
81 RMTDIR=""
82 RMTMAKEFILE=""
83else
84 RMTDIR="rmt"
85 RMTMAKEFILE="rmt/Makefile"
86fi
87,
88RMTDIR=""
89echo "Not compiling rmt by default"
90)
91AC_SUBST(RMTDIR)
92
93dnl
94dnl set $(CC) from --with-cc=value
95dnl
96AC_ARG_WITH([cc],
97[ --with-cc=COMPILER select compiler to use],
98AC_MSG_RESULT(CC=$withval)
99CC=$withval,
100if test -z "$CC" ; then CC=cc; fi
101[AC_MSG_RESULT(CC defaults to $CC)])dnl
102export CC
103AC_SUBST([CC])
104
105dnl
106dnl set $(LD) from --with-linker=value
107dnl
108AC_ARG_WITH([linker],
109[ --with-linker=LINKER select linker to use],
110AC_MSG_RESULT(LD=$withval)
111LD=$withval,
112if test -z "$LD" ; then LD=$CC; fi
113[AC_MSG_RESULT(LD defaults to $LD)])dnl
114export LD
115AC_SUBST([LD])
116
117dnl
118dnl set $(CCOPTS) from --with-ccopts=value
119dnl
120AC_ARG_WITH([ccopts],
121[ --with-ccopts=CCOPTS select compiler command line options],
122AC_MSG_RESULT(CCOPTS is $withval)
123CCOPTS=$withval
124CFLAGS="$CFLAGS $withval",
125CCOPTS=)dnl
126AC_SUBST(CCOPTS)
127
128dnl
129dnl set $(LDFLAGS) from --with-ldopts=value
130dnl
131AC_ARG_WITH([ldopts],
132[ --with-ldopts=LDOPTS select linker command line options],
133AC_MSG_RESULT(LDFLAGS is $withval)
134LDFLAGS=$withval,
135LDFLAGS=)dnl
136AC_SUBST(LDFLAGS)
137
138dnl
139dnl set $(BINOWNER) from --with-binowner
140dnl
141AC_ARG_WITH([binowner],
142[ --with-binowner=USER select owner for binaries],
143AC_MSG_RESULT(BINOWNER is $withval)
144BINOWNER=$withval,
145BINOWNER=root
146echo "BINOWNER defaults to $BINOWNER"
147)dnl
148AC_SUBST(BINOWNER)
149
150dnl
151dnl set $(BINGRP) from --with-bingrp
152dnl
153AC_ARG_WITH([bingrp],
154[ --with-bingrp=GROUP select group for binaries],
155AC_MSG_RESULT(BINGRP is $withval)
156BINGRP=$withval,
157BINGRP=tty
158echo "BINGRP defaults to $BINGRP"
159)dnl
160AC_SUBST(BINGRP)
161
162dnl
163dnl set $(BINMODE) from --with-binmode
164dnl
165AC_ARG_WITH([binmode],
166[ --with-binmode=MODE select mode for binaries],
167AC_MSG_RESULT(BINMODE is $withval)
168BINMODE=$withval,
169BINMODE=6555
170echo "BINMODE defaults to $BINMODE"
171)dnl
172AC_SUBST(BINMODE)
173
174dnl
175dnl set $(MANOWNER) from --with-manowner
176dnl
177AC_ARG_WITH([manowner],
178[ --with-manowner=USER select owner for manual pages],
179AC_MSG_RESULT(MANOWNER is $withval)
180MANOWNER=$withval,
181MANOWNER=man
182echo "MANOWNER defaults to $MANOWNER"
183)dnl
184AC_SUBST(MANOWNER)
185
186dnl
187dnl set $(MANGRP) from --with-mangrp
188dnl
189AC_ARG_WITH([mangrp],
190[ --with-mangrp=group select group for manual pages],
191AC_MSG_RESULT(MANGRP is $withval)
192MANGRP=$withval,
193MANGRP=tty
194echo "MANGRP defaults to $MANGRP"
195)dnl
196AC_SUBST(MANGRP)
197
198dnl
199dnl set $(MANMODE) from --with-manmode
200dnl
201AC_ARG_WITH([manmode],
202[ --with-manmode=MODE select mode for manual pages],
203AC_MSG_RESULT(MANMODE is $withval)
204MANMODE=$withval,
205MANMODE=0444
206echo "MANMODE defaults to $MANMODE"
207)dnl
208AC_SUBST(MANMODE)
209
210dnl
211dnl Check for Ext2fs headers and libraries
212dnl
213AC_CHECK_HEADER(ext2fs/ext2fs.h, [ext2fs_h=yes], [ext2fs_h=no])
214AC_CHECK_LIB(ext2fs, ext2fs_open, [ext2fs_lib=yes], [ext2fs_lib=no], [-lcom_err])
215if test "$ext2fs_h" = no -o "$ext2fs_lib" = no; then
216 AC_MSG_ERROR(You need to install the Ext2fs libraries from the E2fsprogs distribution first)
217fi
218
219dnl
220dnl Check for library functions
221dnl
ddd2ef55 222AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath glob)
1227625a
SP
223
224dnl
225dnl Check for types
226dnl
227AC_CHECK_TYPE(quad_t, __s64)
228AC_CHECK_TYPE(u_quad_t, __u64)
229
230dnl
231dnl Compute top_buildir
232dnl
233top_builddir=`cd .; pwd`
234AC_SUBST(top_builddir)
235
236dnl
237dnl Create directories
238dnl
239test -d compat || mkdir compat
240test -d compat/lib || mkdir compat/lib
241
242dnl
243dnl Output files
244dnl
245AC_OUTPUT(MCONFIG Makefile common/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)