]> git.sur5r.net Git - bacula/bacula/blob - gui/autoconf/configure.in
1fb827068ac6e5552aaadea74f49f587b6defc21
[bacula/bacula] / gui / autoconf / configure.in
1 lal#
2 dnl#
3 dnl# Process this file with autoconf to produce a configure script.
4 dnl#
5 AC_INIT(autoconf/configure.in)
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 Bacula 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 Bacula $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
55 dnl --------------------------------------------------
56 dnl OP Sys determination (see aclocal.m4)
57 dnl --------------------------------------------------
58 BA_CHECK_OPSYS
59
60 # -----------------------------------------------------------
61 dnl OPSys Distribution determination (see aclocal.m4)
62 # ----------------------------------------------------------
63 BA_CHECK_OPSYS_DISTNAME
64
65 # -------------------------------------------------------------------------
66 #  If the user has not set --exec-prefix, we default to ${prefix}
67 # -------------------------------------------------------------------------
68 if test x${exec_prefix} = xNONE ; then
69     exec_prefix=${prefix}
70 fi
71
72
73 dnl# --------------------------------------------------------------------------
74 dnl# CHECKING COMMAND LINE OPTIONS
75 dnl# --------------------------------------------------------------------------
76
77 # ------------------------------------------
78 # Where to get Bacula source
79 # ------------------------------------------
80 AC_ARG_WITH(bacula,
81    [  --with-bacula=PATH    specify path to Bacula source],
82    [
83        if test "x$withval" != "xno" ; then     
84           bacula=$withval
85        fi
86    ]
87 )
88
89 AC_SUBST(bacula)
90
91
92 #
93 # Finally we set appropriate distribution specific
94 #  variables and defaults
95 #
96 # PFILES are platform specific files
97 PFILES=""
98 WIN32=
99 MACOSX=
100 hostname=`uname -n | cut -d '.' -f 1`
101 case "$DISTNAME" in
102 aix)
103         DISTVER=`uname -r`
104   ;;      
105 alpha)
106         DISTVER=`uname -r`
107   ;;
108 bsdi)
109         DISTVER=`uname -a |awk '{print $3}'`
110   ;;
111 cygwin)
112         DISTVER=`uname -a |awk '{print $3}'`
113         WIN32=win32
114   ;;
115 darwin)
116         DISTVER=`uname -r`
117   ;;
118 debian)
119         DISTVER=`cat /etc/debian_version`
120   ;;
121 freebsd)
122         DISTVER=`uname -a |awk '{print $3}'`
123   ;;
124 hpux)
125         DISTVER=`uname -r`
126   ;;
127 irix)
128         DISTVER=`uname -r`
129   ;;
130 netbsd)
131         DISTVER=`uname -a |awk '{print $3}'`
132   ;;
133 openbsd)
134         DISTVER=`uname -a |awk '{print $3}'`
135   ;;
136 redhat)
137         if test -f /etc/whitebox-release ; then
138            f=/etc/whitebox-release
139         else
140            f=/etc/redhat-release
141         fi
142         if test `cat $f | grep release |\
143                    cut -f 3 -d ' '`x = "Enterprise"x ; then
144            DISTVER="Enterprise "`cat $f | grep release |\
145                     cut -f 6 -d ' '`
146         else
147             DISTVER=`cat /etc/redhat-release | grep release |\
148                      cut -f 5 -d ' '`
149         fi
150         hostname=`hostname -s`
151   ;;
152 mandrake)
153         DISTVER=`cat /etc/mandrake-release | grep release |\
154            cut -f 5 -d ' '`
155   ;;
156 gentoo)
157         DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release`
158   ;;
159 slackware)
160         DISTVER=`cat /etc/slackware-version`
161   ;;
162 solaris)
163         DISTVER=`uname -r`
164   ;;
165 suse)
166         DISTVER=`cat /etc/SuSE-release |grep VERSION|\
167             cut -f 3 -d ' '`
168   ;;
169 suse5)
170         DISTNAME=suse
171         DISTVER=5.x
172   ;;
173 unknown)
174         DISTVER=unknown
175   ;;
176 *)
177   echo " === Something went wrong. Unknown DISTNAME $DISTNAME ==="
178   ;;
179 esac  
180
181 AC_SUBST(hostname)
182
183 AC_SUBST(DISTNAME)
184 AC_SUBST(DISTVER)
185
186 dnl# common parts of the Makefile
187 MCOMMON=./autoconf/Make.common
188 AC_SUBST_FILE(MCOMMON)
189
190
191 AC_OUTPUT([    \
192            autoconf/Make.common \
193            Makefile \
194            bimagemgr/Makefile \
195            $PFILES ],  
196           [ ]
197 )
198
199
200 echo "
201 Configuration on `date`:
202
203   Host:                       $host -- ${DISTNAME} ${DISTVER}
204   Bacula version:             ${VERSION} (${DATE})
205   Source code location:       ${bacula}
206
207   " > config.out
208
209 cat config.out