1 dnl $Id: configure.in,v 1.5 1999/10/11 13:31:04 stelian Exp $
8 AC_CONFIG_HEADER(config.h)
11 dnl Check for programs
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, :)
25 dnl Handle --enable-debug
27 AC_ARG_ENABLE([debug],
28 [ --enable-debug include debugging code],
29 if test "$enableval" = "no"
34 DUMPDEBUG="-DFDEBUG -DTDEBUG -DWRITEDEBUG -DDIRDEBUG"
35 RESTOREDEBUG="-DDIRDEBUG"
41 AC_SUBST(RESTOREDEBUG)
44 dnl Handle --enable-static
46 AC_ARG_ENABLE([static],
47 [ --enable-static link dump and restore statically],
48 if test "$enableval" = "no"
56 echo "Linking dump and restore dynamically by default"
61 dnl Handle --enable-rmt
64 [ --enable-rmt compile and install rmt],
65 if test "$enableval" = "no"
71 RMTMAKEFILE="rmt/Makefile"
75 echo "Not compiling rmt by default"
80 dnl set $(CC) from --with-cc=value
83 [ --with-cc=COMPILER select compiler to use],
84 AC_MSG_RESULT(CC=$withval)
86 if test -z "$CC" ; then CC=cc; fi
87 [AC_MSG_RESULT(CC defaults to $CC)])dnl
92 dnl set $(LD) from --with-linker=value
95 [ --with-linker=LINKER select linker to use],
96 AC_MSG_RESULT(LD=$withval)
98 if test -z "$LD" ; then LD=$CC; fi
99 [AC_MSG_RESULT(LD defaults to $LD)])dnl
104 dnl set $(CCOPTS) from --with-ccopts=value
106 AC_ARG_WITH([ccopts],
107 [ --with-ccopts=CCOPTS select compiler command line options],
108 AC_MSG_RESULT(CCOPTS is $withval)
110 CFLAGS="$CFLAGS $withval",
115 dnl set $(LDFLAGS) from --with-ldopts=value
117 AC_ARG_WITH([ldopts],
118 [ --with-ldopts=LDOPTS select linker command line options],
119 AC_MSG_RESULT(LDFLAGS is $withval)
125 dnl set $(BINOWNER) from --with-binowner
127 AC_ARG_WITH([binowner],
128 [ --with-binowner=USER select owner for binaries],
129 AC_MSG_RESULT(BINOWNER is $withval)
132 echo "BINOWNER defaults to $BINOWNER"
137 dnl set $(BINGRP) from --with-bingrp
139 AC_ARG_WITH([bingrp],
140 [ --with-bingrp=GROUP select group for binaries],
141 AC_MSG_RESULT(BINGRP is $withval)
144 echo "BINGRP defaults to $BINGRP"
149 dnl set $(BINMODE) from --with-binmode
151 AC_ARG_WITH([binmode],
152 [ --with-binmode=MODE select mode for binaries],
153 AC_MSG_RESULT(BINMODE is $withval)
156 echo "BINMODE defaults to $BINMODE"
161 dnl set $(MANOWNER) from --with-manowner
163 AC_ARG_WITH([manowner],
164 [ --with-manowner=USER select owner for manual pages],
165 AC_MSG_RESULT(MANOWNER is $withval)
168 echo "MANOWNER defaults to $MANOWNER"
173 dnl set $(MANGRP) from --with-mangrp
175 AC_ARG_WITH([mangrp],
176 [ --with-mangrp=group select group for manual pages],
177 AC_MSG_RESULT(MANGRP is $withval)
180 echo "MANGRP defaults to $MANGRP"
185 dnl set $(MANMODE) from --with-manmode
187 AC_ARG_WITH([manmode],
188 [ --with-manmode=MODE select mode for manual pages],
189 AC_MSG_RESULT(MANMODE is $withval)
192 echo "MANMODE defaults to $MANMODE"
197 dnl set $(DUMPDATESPATH) from --with-dumpdatespath
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"
206 AC_SUBST(DUMPDATESPATH)
209 dnl Check for Ext2fs headers and libraries
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)
218 dnl Check for library functions
220 AC_CHECK_FUNCS(err errx verr verrx vwarn vwarnx warn warnx realpath glob)
225 AC_CHECK_TYPE(quad_t, __s64)
226 AC_CHECK_TYPE(u_quad_t, __u64)
229 dnl Compute top_buildir
231 top_builddir=`cd .; pwd`
232 AC_SUBST(top_builddir)
235 dnl Create directories
237 test -d compat || mkdir compat
238 test -d compat/lib || mkdir compat/lib
243 AC_OUTPUT(MCONFIG Makefile common/Makefile compat/include/Makefile compat/lib/Makefile dump/Makefile restore/Makefile $RMTMAKEFILE)