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],
145 if test "x$withval" != "xno" ; then
155 # Finally we set appropriate distribution specific
156 # variables and defaults
158 # PFILES are platform specific files
162 hostname=`uname -n | cut -d '.' -f 1`
171 DISTVER=`uname -a |awk '{print $3}'`
174 DISTVER=`uname -a |awk '{print $3}'`
181 DISTVER=`cat /etc/debian_version`
184 DISTVER=`uname -a |awk '{print $3}'`
193 DISTVER=`uname -a |awk '{print $3}'`
196 DISTVER=`uname -a |awk '{print $3}'`
199 if test -f /etc/whitebox-release ; then
200 f=/etc/whitebox-release
202 f=/etc/redhat-release
204 if test `cat $f | grep release |\
205 cut -f 3 -d ' '`x = "Enterprise"x ; then
206 DISTVER="Enterprise "`cat $f | grep release |\
209 DISTVER=`cat /etc/redhat-release | grep release |\
212 hostname=`hostname -s`
215 DISTVER=`cat /etc/mandrake-release | grep release |\
219 DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
222 DISTVER=`cat /etc/slackware-version`
228 DISTVER=`cat /etc/SuSE-release |grep VERSION|\
239 echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
248 dnl# common parts of the Makefile
249 MCOMMON=./autoconf/Make.common
250 AC_SUBST_FILE(MCOMMON)
254 autoconf/Make.common \
257 linux/floppy/Makefile \
258 linux/cdrom/Makefile \
259 linux/cdrom/bacula/Makefile \
268 Configuration on `date`:
270 Host: $host -- ${DISTNAME} ${DISTVER}
271 Rescue version: ${VERSION} (${DATE})
272 Source code location: ${bacula}
273 Rescue disk image type: ${type}
274 Rescue disk image location: ${where}