Debian Codegraph @

configure

raw
1 #!/bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated automatically using autoconf.
4 # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
21 # [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
22 # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
23 # --with-PACKAGE unless this script has special code to handle it.
24
25 ##---------------------------------------------------------------##
26 ## NOTE: Modifications marked "JBV" were made by Jon B. Volkoff, ##
27 ## 11/1995 ([email protected]). ##
28 ##---------------------------------------------------------------##
29
30 for arg
31 do
32 # Handle --exec-prefix with a space before the argument.
33 if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
34 # Handle --host with a space before the argument.
35 elif test x$next_host = xyes; then next_host=
36 # Handle --prefix with a space before the argument.
37 elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
38 # Handle --srcdir with a space before the argument.
39 elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
40 else
41 case $arg in
42 # For backward compatibility, also recognize exact --exec_prefix.
43 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
44 exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
45 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
46 next_exec_prefix=yes ;;
47
48 -gas | --gas | --ga | --g) ;;
49
50 -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
51 -host | --host | --hos | --ho | --h)
52 next_host=yes ;;
53
54 -nfp | --nfp | --nf) ;;
55
56 -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
57 no_create=1 ;;
58
59 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
60 prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
61 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
62 next_prefix=yes ;;
63
64 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
65 srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
66 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
67 next_srcdir=yes ;;
68
69 -with-* | --with-*)
70 package=`echo $arg|sed 's/-*with-//'`
71 # Delete all the valid chars; see if any are left.
72 if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
73 echo "configure: $package: invalid package name" >&2; exit 1
74 fi
75 eval "with_`echo $package|sed s/-/_/g`=1" ;;
76
77 *) ;;
78 esac
79 fi
80 done
81
82 trap 'rm -f conftest* core; exit 1' 1 3 15
83
84 rm -f conftest*
85 compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
86
87 # A filename unique to this package, relative to the directory that
88 # configure is in, which we can look for to find out if srcdir is correct.
89 unique_file=bwb_cmd.c
90
91 # Find the source files, if location was not specified.
92 if test -z "$srcdir"; then
93 srcdirdefaulted=yes
94 # Try the directory containing this script, then `..'.
95 prog=$0
96 confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
97 test "X$confdir" = "X$prog" && confdir=.
98 srcdir=$confdir
99 if test ! -r $srcdir/$unique_file; then
100 srcdir=..
101 fi
102 fi
103 if test ! -r $srcdir/$unique_file; then
104 if test x$srcdirdefaulted = xyes; then
105 echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
106 else
107 echo "configure: Can not find sources in \`${srcdir}'." 1>&2
108 fi
109 exit 1
110 fi
111 # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
112 # But we can't avoid them for `..', to make subdirectories work.
113 case $srcdir in
114 .|/*|~*) ;;
115 *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
116 esac
117
118 if test -z "$CC"; then
119 echo checking for gcc
120 saveifs="$IFS"; IFS="${IFS}:"
121 for dir in $PATH; do
122 test -z "$dir" && dir=.
123 if test -f $dir/gcc; then
124 CC="gcc"
125 break
126 fi
127 done
128 IFS="$saveifs"
129 fi
130 test -z "$CC" && CC="cc"
131
132 # Find out if we are using GNU C, under whatever name.
133 cat > conftest.c <<EOF
134 #ifdef __GNUC__
135 yes
136 #endif
137 EOF
138 ${CC-cc} -E conftest.c > conftest.out 2>&1
139 if egrep yes conftest.out >/dev/null 2>&1; then
140 GCC=1 # For later tests.
141 fi
142 rm -f conftest*
143
144 echo checking how to run the C preprocessor
145 if test -z "$CPP"; then
146 CPP='${CC-cc} -E'
147 cat > conftest.c <<EOF
148 #include <stdio.h>
149 EOF
150 err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
151 if test -z "$err"; then
152 :
153 else
154 CPP=/lib/cpp
155 fi
156 rm -f conftest*
157 fi
158
159 # Make sure to not get the incompatible SysV /etc/install and
160 # /usr/sbin/install, which might be in PATH before a BSD-like install,
161 # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
162 # or the AFS install, which mishandles nonexistent args. (Sigh.)
163 if test -z "$INSTALL"; then
164 echo checking for install
165 saveifs="$IFS"; IFS="${IFS}:"
166 for dir in $PATH; do
167 test -z "$dir" && dir=.
168 case $dir in
169 /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
170 *)
171 if test -f $dir/install; then
172 if grep dspmsg $dir/install >/dev/null 2>&1; then
173 : # AIX
174 else
175 INSTALL="$dir/install -c"
176 INSTALL_PROGRAM='$(INSTALL)'
177 INSTALL_DATA='$(INSTALL) -m 644'
178 break
179 fi
180 fi
181 ;;
182 esac
183 done
184 IFS="$saveifs"
185 fi
186 INSTALL=${INSTALL-cp}
187 INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
188 INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
189
190 echo checking for size_t in sys/types.h
191 echo '#include <sys/types.h>' > conftest.c
192 eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
193 if egrep "size_t" conftest.out >/dev/null 2>&1; then
194 :
195 else
196 DEFS="$DEFS -Dsize_t=unsigned"
197 fi
198 rm -f conftest*
199
200 echo checking for string.h
201 cat > conftest.c <<EOF
202 #include <string.h>
203 EOF
204 err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
205 if test -z "$err"; then
206 DEFS="$DEFS -DHAVE_STRING=1"
207 fi
208 rm -f conftest*
209
210 echo checking for stdlib.h
211 cat > conftest.c <<EOF
212 #include <stdlib.h>
213 EOF
214 err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
215 if test -z "$err"; then
216 DEFS="$DEFS -DHAVE_STDLIB=1"
217 fi
218 rm -f conftest*
219
220 # unistd.h checking added by JBV
221 echo checking for unistd.h
222 cat > conftest.c <<EOF
223 #include <unistd.h>
224 EOF
225 err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
226 if test -z "$err"; then
227 DEFS="$DEFS -DHAVE_UNISTD=1"
228 fi
229 rm -f conftest*
230
231 echo checking for raise
232 cat > conftest.c <<EOF
233 #include <sys/types.h>
234 #include <signal.h>
235 main() { exit(0); }
236 t() { raise(1); }
237 EOF
238 if eval $compile; then
239 DEFS="$DEFS -DHAVE_RAISE=1"
240 fi
241 rm -f conftest*
242
243 if test -n "$prefix"; then
244 test -z "$exec_prefix" && exec_prefix='${prefix}'
245 prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%"
246 fi
247 if test -n "$exec_prefix"; then
248 prsub="$prsub
249 s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%\
250 exec_prefix\\1=\\2$exec_prefix%"
251 fi
252
253 trap 'rm -f config.status; exit 1' 1 3 15
254 echo creating config.status
255 rm -f config.status
256 cat > config.status <<EOF
257 #!/bin/sh
258 # Generated automatically by configure.
259 # Run this file to recreate the current configuration.
260 # This directory was configured as follows,
261 # on host `(hostname || uname -n) 2>/dev/null`:
262 #
263 # $0 $*
264
265 for arg
266 do
267 case "\$arg" in
268 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
269 exec /bin/sh $0 $* ;;
270 *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
271 esac
272 done
273
274 trap 'rm -f Makefile; exit 1' 1 3 15
275 CC='$CC'
276 CPP='$CPP'
277 INSTALL='$INSTALL'
278 INSTALL_PROGRAM='$INSTALL_PROGRAM'
279 INSTALL_DATA='$INSTALL_DATA'
280 LIBS='$LIBS'
281 srcdir='$srcdir'
282 DEFS='$DEFS'
283 prefix='$prefix'
284 exec_prefix='$exec_prefix'
285 prsub='$prsub'
286 EOF
287 cat >> config.status <<\EOF
288
289 top_srcdir=$srcdir
290 for file in .. Makefile; do if [ "x$file" != "x.." ]; then
291 srcdir=$top_srcdir
292 # Remove last slash and all that follows it. Not all systems have dirname.
293 dir=`echo $file|sed 's%/[^/][^/]*$%%'`
294 if test "$dir" != "$file"; then
295 test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
296 test ! -d $dir && mkdir $dir
297 fi
298 echo creating $file
299 rm -f $file
300 echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
301 sed -e "
302 $prsub
303 s%@CC@%$CC%g
304 s%@CPP@%$CPP%g
305 s%@INSTALL@%$INSTALL%g
306 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
307 s%@INSTALL_DATA@%$INSTALL_DATA%g
308 s%@LIBS@%$LIBS%g
309 s%@srcdir@%$srcdir%g
310 s%@DEFS@%$DEFS%
311 " $top_srcdir/${file}.in >> $file
312 fi; done
313
314 EOF
315 chmod +x config.status
316 test -n "$no_create" || ./config.status
317