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