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