]> git.sur5r.net Git - bacula/rescue/blob - rescue/autoconf/configure.in
Put version in boot.msg
[bacula/rescue] / rescue / autoconf / configure.in
1 lal#
2 dnl#
3 dnl# Process this file with autoconf to produce a configure script.
4 dnl#
5 AC_INIT(version.h)
6 BUILD_DIR=`pwd`
7 cd ..
8 TOP_DIR=`pwd`
9 cd ${BUILD_DIR}
10 AC_SUBST(BUILD_DIR)
11 AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf)
12
13 dnl require a recent autoconf
14 AC_PREREQ(2.13)
15
16
17 dnl search for true and false programs.
18 AC_PATH_PROGS(TRUEPRG, true, :)
19 AC_PATH_PROGS(FALSEPRG, false, :)
20
21 AC_PROG_AWK
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 :;
27 else
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    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!])
32 fi
33 THE_AWK=$AWK
34 AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK)
35
36
37 dnl Rescue version
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`
40 AC_SUBST(VERSION)dnl 
41 AC_SUBST(DATE)dnl 
42 echo "configuring for Rescue $VERSION ($DATE)"
43
44
45 dnl -------------------------------------------------------
46 dnl# Check for programs.
47 dnl ------------------------------------------------------
48 AC_PROG_INSTALL
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)
55
56 dnl --------------------------------------------------
57 dnl OP Sys determination (see aclocal.m4)
58 dnl --------------------------------------------------
59 BA_CHECK_OPSYS
60
61 # -----------------------------------------------------------
62 dnl OPSys Distribution determination (see aclocal.m4)
63 # ----------------------------------------------------------
64 BA_CHECK_OPSYS_DISTNAME
65
66 # -------------------------------------------------------------------------
67 #  If the user has not set --exec-prefix, we default to ${prefix}
68 # -------------------------------------------------------------------------
69 if test x${exec_prefix} = xNONE ; then
70     exec_prefix=${prefix}
71 fi
72
73 # -------------------------------------------
74 # check for cdrecord writer location
75 # get scsibus,target,lun
76 # -------------------------------------------
77 CDSTL="3,0,0"
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}'`
82    fi
83    if test x${CDSTL} = x ; then
84       CDSTL="3,0,0"
85    fi
86 fi
87 AC_SUBST(CDSTL)
88
89 dnl# --------------------------------------------------------------------------
90 dnl# CHECKING COMMAND LINE OPTIONS
91 dnl# --------------------------------------------------------------------------
92
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
99      support_static_fd=yes
100    fi])
101
102 STATIC_FD=
103 if test x$support_static_fd = xyes; then
104    STATIC_FD="static-bacula-fd"
105 fi
106 AC_SUBST(STATIC_FD)
107
108 where=
109 # ------------------------------------------
110 # Where to get iso
111 # ------------------------------------------
112 AC_ARG_WITH(iso,
113    [  --with-iso=PATH    specify path to iso],
114    [
115        if test "x$withval" != "xno" ; then     
116            where=$withval
117            type=iso
118        fi
119    ]
120 )
121 AC_SUBST(iso)
122
123 # ------------------------------------------
124 # Where to get cdrom
125 # ------------------------------------------
126 AC_ARG_WITH(cdrom,
127    [  --with-cdrom=PATH    specify path to cdrom],
128    [
129        if test "x$withval" != "xno" ; then     
130           where=$withval
131           type=cdrom
132        fi
133    ]
134 )
135
136 AC_SUBST(where)
137 AC_SUBST(type)
138
139 # ------------------------------------------
140 # Where to get Bacula source
141 # ------------------------------------------
142 AC_ARG_WITH(bacula,
143    [  --with-bacula=PATH    specify path to bacula],
144    [
145        if test "x$withval" != "xno" ; then     
146           bacula=$withval
147        fi
148    ]
149 )
150
151 AC_SUBST(bacula)
152
153
154 #
155 # Finally we set appropriate distribution specific
156 #  variables and defaults
157 #
158 # PFILES are platform specific files
159 PFILES=""
160 WIN32=
161 MACOSX=
162 hostname=`uname -n | cut -d '.' -f 1`
163 case "$DISTNAME" in
164 aix)
165         DISTVER=`uname -r`
166   ;;      
167 alpha)
168         DISTVER=`uname -r`
169   ;;
170 bsdi)
171         DISTVER=`uname -a |awk '{print $3}'`
172   ;;
173 cygwin)
174         DISTVER=`uname -a |awk '{print $3}'`
175         WIN32=win32
176   ;;
177 darwin)
178         DISTVER=`uname -r`
179   ;;
180 debian)
181         DISTVER=`cat /etc/debian_version`
182   ;;
183 freebsd)
184         DISTVER=`uname -a |awk '{print $3}'`
185   ;;
186 hpux)
187         DISTVER=`uname -r`
188   ;;
189 irix)
190         DISTVER=`uname -r`
191   ;;
192 netbsd)
193         DISTVER=`uname -a |awk '{print $3}'`
194   ;;
195 openbsd)
196         DISTVER=`uname -a |awk '{print $3}'`
197   ;;
198 redhat)
199         if test -f /etc/whitebox-release ; then
200            f=/etc/whitebox-release
201         else
202            f=/etc/redhat-release
203         fi
204         if test `cat $f | grep release |\
205                    cut -f 3 -d ' '`x = "Enterprise"x ; then
206            DISTVER="Enterprise "`cat $f | grep release |\
207                     cut -f 6 -d ' '`
208         else
209             DISTVER=`cat /etc/redhat-release | grep release |\
210                      cut -f 5 -d ' '`
211         fi
212         hostname=`hostname -s`
213   ;;
214 mandrake)
215         DISTVER=`cat /etc/mandrake-release | grep release |\
216            cut -f 5 -d ' '`
217   ;;
218 gentoo)
219         DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
220   ;;
221 slackware)
222         DISTVER=`cat /etc/slackware-version`
223   ;;
224 solaris)
225         DISTVER=`uname -r`
226   ;;
227 suse)
228         DISTVER=`cat /etc/SuSE-release |grep VERSION|\
229             cut -f 3 -d ' '`
230   ;;
231 suse5)
232         DISTNAME=suse
233         DISTVER=5.x
234   ;;
235 unknown)
236         DISTVER=unknown
237   ;;
238 *)
239   echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
240   ;;
241 esac  
242
243 AC_SUBST(hostname)
244
245 AC_SUBST(DISTNAME)
246 AC_SUBST(DISTVER)
247
248 dnl# common parts of the Makefile
249 MCOMMON=./autoconf/Make.common
250 AC_SUBST_FILE(MCOMMON)
251
252
253 AC_OUTPUT([    \
254            autoconf/Make.common \
255            Makefile \
256            linux/Makefile \
257            linux/floppy/Makefile \
258            linux/cdrom/Makefile \
259            linux/cdrom/bacula/Makefile \
260            linux/cdrom/cdtree/boot/isolinux/boot.msg \
261            freebsd/Makefile \
262            solaris/Makefile \
263            $PFILES ],  
264           [ ]
265 )
266
267
268 echo "
269 Configuration on `date`:
270
271   Host:                       $host -- ${DISTNAME} ${DISTVER}
272   Rescue version:             ${VERSION} (${DATE})
273   Source code location:       ${bacula}
274   Rescue disk image type:     ${type}
275   Rescue disk image location: ${where}
276
277
278   " > config.out
279
280 cat config.out