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 # -------------------------------------------
74 # check for cdrecord writer location
75 # get scsibus,target,lun
76 # -------------------------------------------
78 if test ! x$CDRECORD = x ; then
79 CDSTL=`${CDRECORD} -scanbus 2>/dev/null | grep CD-RW | ${AWK} '{print $1}'`
80 if test x${CDSTL} = x ; then
81 CDSTL=`${CDRECORD} -scanbus 2>/dev/null | grep CD+RW | ${AWK} '{print $1}'`
83 if test x${CDSTL} = x ; then
89 dnl# --------------------------------------------------------------------------
90 dnl# CHECKING COMMAND LINE OPTIONS
91 dnl# --------------------------------------------------------------------------
95 # ------------------------------------------
97 # ------------------------------------------
99 [ --with-iso=PATH specify path to iso (not implemented)],
101 if test "x$withval" != "xno" ; then
109 # ------------------------------------------
111 # ------------------------------------------
113 [ --with-cdrom=PATH specify path to cdrom],
115 if test "x$withval" != "xno" ; then
126 # ------------------------------------------
127 # Which kernel to take
128 # ------------------------------------------
130 [ --with-kernel=version specify complete kernel version (e.g. 2.6.14-2) ],
132 if test "x$withval" != "xno" ; then
140 # ------------------------------------------
141 # Where to get Bacula source
142 # ------------------------------------------
144 [ --with-bacula=PATH specify path to Bacula source],
146 if test "x$withval" != "xno" ; then
154 # ------------------------------------------
155 # Where to get static-bacula-fd
156 # ------------------------------------------
157 AC_ARG_WITH(static-fd,
158 [ --with-static-fd=PATH specify path to static FD],
160 if test "x$withval" != "xno" ; then
167 if test x${bacula} = x -a x${STATIC_FD} = x ; then
168 AC_MSG_ERROR(You must specify either --with-bacula=PATH or --with-static-fd=PATH)
172 # Finally we set appropriate distribution specific
173 # variables and defaults
175 # PFILES are platform specific files
179 hostname=`uname -n | cut -d '.' -f 1`
188 DISTVER=`uname -a |awk '{print $3}'`
191 DISTVER=`uname -a |awk '{print $3}'`
198 DISTVER=`cat /etc/debian_version`
201 DISTVER=`uname -a |awk '{print $3}'`
210 DISTVER=`uname -a |awk '{print $3}'`
213 DISTVER=`uname -a |awk '{print $3}'`
216 if test -f /etc/whitebox-release ; then
217 f=/etc/whitebox-release
219 f=/etc/redhat-release
221 if test `cat $f | grep release |\
222 cut -f 3 -d ' '`x = "Enterprise"x ; then
223 DISTVER="Enterprise "`cat $f | grep release |\
226 DISTVER=`cat /etc/redhat-release | grep release |\
229 hostname=`hostname -s`
232 DISTVER=`cat /etc/mandrake-release | grep release |\
236 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
239 DISTVER=`cat /etc/slackware-version`
245 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
256 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
265 dnl# common parts of the Makefile
266 MCOMMON=./autoconf/Make.common
267 AC_SUBST_FILE(MCOMMON)
271 autoconf/Make.common \
274 linux/cdrom/Makefile \
275 linux/cdrom/bacula/Makefile \
276 linux/cdrom/cdtree/boot/isolinux/boot.msg \
285 Configuration on `date`:
287 Host: $host -- ${DISTNAME} ${DISTVER}
288 Rescue version: ${VERSION} (${DATE})
289 Source code location: ${bacula}
290 Static FD location: ${STATIC_FD}
291 Specific kernel version: ${KERNEL}