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# --------------------------------------------------------------------------
93 # -------------------------------------------
94 # static-fd (default off)
95 # -------------------------------------------
96 AC_ARG_ENABLE(static-fd,
97 [ --enable-static-fd enable static File daemon [disabled]],
98 [if test x$enableval = xyes; then
103 if test x$support_static_fd = xyes; then
104 STATIC_FD="static-bacula-fd"
109 # ------------------------------------------
111 # ------------------------------------------
113 [ --with-iso=PATH specify path to iso],
115 if test "x$withval" != "xno" ; then
123 # ------------------------------------------
125 # ------------------------------------------
127 [ --with-cdrom=PATH specify path to cdrom],
129 if test "x$withval" != "xno" ; then
139 # ------------------------------------------
140 # Where to get Bacula source
141 # ------------------------------------------
143 [ --with-bacula=PATH specify path to Bacula source],
145 if test "x$withval" != "xno" ; then
151 if test x${bacula} = x; then
152 AC_MSG_ERROR(Missing --with-bacula=PATH)
159 # Finally we set appropriate distribution specific
160 # variables and defaults
162 # PFILES are platform specific files
166 hostname=`uname -n | cut -d '.' -f 1`
175 DISTVER=`uname -a |awk '{print $3}'`
178 DISTVER=`uname -a |awk '{print $3}'`
185 DISTVER=`cat /etc/debian_version`
188 DISTVER=`uname -a |awk '{print $3}'`
197 DISTVER=`uname -a |awk '{print $3}'`
200 DISTVER=`uname -a |awk '{print $3}'`
203 if test -f /etc/whitebox-release ; then
204 f=/etc/whitebox-release
206 f=/etc/redhat-release
208 if test `cat $f | grep release |\
209 cut -f 3 -d ' '`x = "Enterprise"x ; then
210 DISTVER="Enterprise "`cat $f | grep release |\
213 DISTVER=`cat /etc/redhat-release | grep release |\
216 hostname=`hostname -s`
219 DISTVER=`cat /etc/mandrake-release | grep release |\
223 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
226 DISTVER=`cat /etc/slackware-version`
232 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
243 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
252 dnl# common parts of the Makefile
253 MCOMMON=./autoconf/Make.common
254 AC_SUBST_FILE(MCOMMON)
258 autoconf/Make.common \
261 linux/cdrom/Makefile \
262 linux/cdrom/bacula/Makefile \
263 linux/cdrom/cdtree/boot/isolinux/boot.msg \
272 Configuration on `date`:
274 Host: $host -- ${DISTNAME} ${DISTVER}
275 Rescue version: ${VERSION} (${DATE})
276 Source code location: ${bacula}
277 Rescue disk image type: ${type}
278 Rescue disk image location: ${where}