3 dnl# Process this file with autoconf to produce a configure script.
11 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
13 dnl require a recent autoconf
17 dnl search for true and false programs.
18 AC_PATH_PROGS(TRUEPRG, true, :)
19 AC_PATH_PROGS(FALSEPRG, false, :)
22 # Some AWK programs fail, so test it and warn the user
23 if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 }
24 { if ((prog == $2) || (("(" prog ")") == $2) ||
25 (("[" prog "]") == $2) ||
26 ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :;
28 AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!!
29 The regex engine of $AWK is too broken to be used you
30 might want to install GNU AWK.
31 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
34 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
38 VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/version.h`
39 DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/version.h`
42 echo "configuring for Rescue $VERSION ($DATE)"
45 dnl -------------------------------------------------------
46 dnl# Check for programs.
47 dnl ------------------------------------------------------
49 AC_PATH_PROG(MV, mv, mv)
50 AC_PATH_PROG(RM, rm, rm)
51 AC_PATH_PROG(CP, cp, cp)
52 AC_PATH_PROG(ECHO, echo, echo)
53 AC_PATH_PROG(AR, ar, ar)
54 AC_PATH_PROG(CDRECORD, cdrecord, cdrecord)
56 dnl --------------------------------------------------
57 dnl OP Sys determination (see aclocal.m4)
58 dnl --------------------------------------------------
61 # -----------------------------------------------------------
62 dnl OPSys Distribution determination (see aclocal.m4)
63 # ----------------------------------------------------------
64 BA_CHECK_OPSYS_DISTNAME
66 # -------------------------------------------------------------------------
67 # If the user has not set --exec-prefix, we default to ${prefix}
68 # -------------------------------------------------------------------------
69 if test x${exec_prefix} = xNONE ; then
73 # ------------------------------------------
75 # ------------------------------------------
78 [ --with-dev=DEVICE specify device (e.g. /dev/hdc)],
80 if test "x$withval" != "xno" ; then
86 # -------------------------------------------
87 # if no --with-dev given check for cdrecord writer location
88 # get scsibus,target,lun
89 # -------------------------------------------
90 if test x$DEV = x ; then
92 if test ! x$CDRECORD = x ; then
93 CDSTL=`${CDRECORD} -scanbus 2>/dev/null | grep CD-RW | ${AWK} '{print $1}'`
94 if test x${CDSTL} = x ; then
95 CDSTL=`${CDRECORD} -scanbus 2>/dev/null | grep CD+RW | ${AWK} '{print $1}'`
97 if test x${CDSTL} = x ; then
105 dnl# --------------------------------------------------------------------------
106 dnl# CHECKING COMMAND LINE OPTIONS
107 dnl# --------------------------------------------------------------------------
111 # ------------------------------------------
113 # ------------------------------------------
115 [ --with-iso=PATH specify path to iso image],
117 if test "x$withval" != "xno" ; then
126 # ------------------------------------------
128 # ------------------------------------------
130 [ --with-cdrom=PATH specify path to cdrom],
132 if test "x$withval" != "xno" ; then
143 # ------------------------------------------
144 # Which kernel to take
145 # ------------------------------------------
147 [ --with-kernel=version specify complete kernel version (e.g. 2.6.14-2) ],
149 if test "x$withval" != "xno" ; then
157 # ------------------------------------------
158 # Where to get Bacula source
159 # ------------------------------------------
161 [ --with-bacula=PATH specify path to Bacula source],
163 if test "x$withval" != "xno" ; then
171 # ------------------------------------------
172 # Where to get static-bacula-fd
173 # ------------------------------------------
174 AC_ARG_WITH(static-fd,
175 [ --with-static-fd=PATH specify path to static FD],
177 if test "x$withval" != "xno" ; then
185 # ------------------------------------------
186 # Where to get Bacula binaries
187 # ------------------------------------------
188 AC_ARG_WITH(bacula-bin,
189 [ --with-bacula-bin=PATH specify path to bacula binaries (NOT IMPLEMENTED)],
191 if test "x$withval" != "xno" ; then
199 # ------------------------------------------
200 # Where to get Bacula scripts
201 # ------------------------------------------
202 AC_ARG_WITH(bacula-scripts,
203 [ --with-bacula-scripts=PATH specify path to bacula scripts],
205 if test "x$withval" != "xno" ; then
206 BACULA_SCRIPTS=$withval
210 AC_SUBST(BACULA_SCRIPTS)
214 if test x${bacula} = x -a x${STATIC_FD} = x ; then
215 AC_MSG_ERROR(You must specify either --with-bacula=PATH or --with-static-fd=PATH)
219 # Finally we set appropriate distribution specific
220 # variables and defaults
222 # PFILES are platform specific files
226 hostname=`uname -n | cut -d '.' -f 1`
235 DISTVER=`uname -a |awk '{print $3}'`
238 DISTVER=`uname -a |awk '{print $3}'`
245 DISTVER=`cat /etc/debian_version`
248 DISTVER=`uname -a |awk '{print $3}'`
257 DISTVER=`uname -a |awk '{print $3}'`
260 DISTVER=`uname -a |awk '{print $3}'`
263 if test -f /etc/whitebox-release ; then
264 f=/etc/whitebox-release
266 f=/etc/redhat-release
268 if test `cat $f | grep release |\
269 cut -f 3 -d ' '`x = "Enterprise"x ; then
270 DISTVER="Enterprise "`cat $f | grep release |\
273 DISTVER=`cat /etc/redhat-release | grep release |\
276 hostname=`hostname -s`
279 DISTVER=`cat /etc/mandrake-release | grep release |\
283 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
286 DISTVER=`cat /etc/slackware-version`
292 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
303 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
312 dnl# common parts of the Makefile
313 MCOMMON=./autoconf/Make.common
314 AC_SUBST_FILE(MCOMMON)
318 autoconf/Make.common \
321 linux/cdrom/Makefile \
322 linux/cdrom/bacula/Makefile \
323 linux/cdrom/cdtree/boot/isolinux/boot.msg \
324 knoppix/cdrom/Makefile \
325 knoppix/cdrom/bacula/Makefile \
335 Configuration on `date`:
337 Host: $host -- ${DISTNAME} ${DISTVER}
338 Rescue version: ${VERSION} (${DATE})
339 Bacula scripts location: ${BACULA_SCRIPTS}
340 Source code location: ${bacula}
341 Static FD location: ${STATIC_FD}
342 Specific kernel version: ${KERNEL}