]> icculus.org git repositories - theoddone33/hhexen.git/blob - configure
Round 1: $HOME/.hhexen/ for configs and savegames.
[theoddone33/hhexen.git] / configure
1 #! /bin/sh
2
3 # From configure.in configure.in 1.00
4 # Guess values for system-dependent variables and create Makefiles.
5 # Generated automatically using autoconf version 2.13 
6 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
7 #
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10
11 # Defaults:
12 ac_help=
13 ac_default_prefix=/usr/local
14 # Any additions from configure.in:
15 ac_help="$ac_help
16   --enable-gl                   Enable OpenGL mode"
17 ac_help="$ac_help
18   --enable-gl-mesa              Enable OpenGL mode for Mesa 3d acceleration"
19 ac_help="$ac_help
20   --enable-demowad              Enable compilation with the demo wadfile"
21 ac_help="$ac_help
22   --enable-userconfig          Make HHexen store it's config in users' home directories"
23 ac_help="$ac_help
24   --disable-assassin            Compile HHexen without support for the assassin"
25
26 # Initialize some variables set by options.
27 # The variables have the same names as the options, with
28 # dashes changed to underlines.
29 build=NONE
30 cache_file=./config.cache
31 exec_prefix=NONE
32 host=NONE
33 no_create=
34 nonopt=NONE
35 no_recursion=
36 prefix=NONE
37 program_prefix=NONE
38 program_suffix=NONE
39 program_transform_name=s,x,x,
40 silent=
41 site=
42 srcdir=
43 target=NONE
44 verbose=
45 x_includes=NONE
46 x_libraries=NONE
47 bindir='${exec_prefix}/bin'
48 sbindir='${exec_prefix}/sbin'
49 libexecdir='${exec_prefix}/libexec'
50 datadir='${prefix}/share'
51 sysconfdir='${prefix}/etc'
52 sharedstatedir='${prefix}/com'
53 localstatedir='${prefix}/var'
54 libdir='${exec_prefix}/lib'
55 includedir='${prefix}/include'
56 oldincludedir='/usr/include'
57 infodir='${prefix}/info'
58 mandir='${prefix}/man'
59
60 # Initialize some other variables.
61 subdirs=
62 MFLAGS= MAKEFLAGS=
63 SHELL=${CONFIG_SHELL-/bin/sh}
64 # Maximum number of lines to put in a shell here document.
65 ac_max_here_lines=12
66
67 ac_prev=
68 for ac_option
69 do
70
71   # If the previous option needs an argument, assign it.
72   if test -n "$ac_prev"; then
73     eval "$ac_prev=\$ac_option"
74     ac_prev=
75     continue
76   fi
77
78   case "$ac_option" in
79   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
80   *) ac_optarg= ;;
81   esac
82
83   # Accept the important Cygnus configure options, so we can diagnose typos.
84
85   case "$ac_option" in
86
87   -bindir | --bindir | --bindi | --bind | --bin | --bi)
88     ac_prev=bindir ;;
89   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
90     bindir="$ac_optarg" ;;
91
92   -build | --build | --buil | --bui | --bu)
93     ac_prev=build ;;
94   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
95     build="$ac_optarg" ;;
96
97   -cache-file | --cache-file | --cache-fil | --cache-fi \
98   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
99     ac_prev=cache_file ;;
100   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
101   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
102     cache_file="$ac_optarg" ;;
103
104   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
105     ac_prev=datadir ;;
106   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
107   | --da=*)
108     datadir="$ac_optarg" ;;
109
110   -disable-* | --disable-*)
111     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
112     # Reject names that are not valid shell variable names.
113     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
114       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
115     fi
116     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
117     eval "enable_${ac_feature}=no" ;;
118
119   -enable-* | --enable-*)
120     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
121     # Reject names that are not valid shell variable names.
122     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
123       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
124     fi
125     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
126     case "$ac_option" in
127       *=*) ;;
128       *) ac_optarg=yes ;;
129     esac
130     eval "enable_${ac_feature}='$ac_optarg'" ;;
131
132   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
133   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
134   | --exec | --exe | --ex)
135     ac_prev=exec_prefix ;;
136   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
137   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
138   | --exec=* | --exe=* | --ex=*)
139     exec_prefix="$ac_optarg" ;;
140
141   -gas | --gas | --ga | --g)
142     # Obsolete; use --with-gas.
143     with_gas=yes ;;
144
145   -help | --help | --hel | --he)
146     # Omit some internal or obsolete options to make the list less imposing.
147     # This message is too long to be a string in the A/UX 3.1 sh.
148     cat << EOF
149 Usage: configure [options] [host]
150 Options: [defaults in brackets after descriptions]
151 Configuration:
152   --cache-file=FILE       cache test results in FILE
153   --help                  print this message
154   --no-create             do not create output files
155   --quiet, --silent       do not print \`checking...' messages
156   --version               print the version of autoconf that created configure
157 Directory and file names:
158   --prefix=PREFIX         install architecture-independent files in PREFIX
159                           [$ac_default_prefix]
160   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
161                           [same as prefix]
162   --bindir=DIR            user executables in DIR [EPREFIX/bin]
163   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
164   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
165   --datadir=DIR           read-only architecture-independent data in DIR
166                           [PREFIX/share]
167   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
168   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
169                           [PREFIX/com]
170   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
171   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
172   --includedir=DIR        C header files in DIR [PREFIX/include]
173   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
174   --infodir=DIR           info documentation in DIR [PREFIX/info]
175   --mandir=DIR            man documentation in DIR [PREFIX/man]
176   --srcdir=DIR            find the sources in DIR [configure dir or ..]
177   --program-prefix=PREFIX prepend PREFIX to installed program names
178   --program-suffix=SUFFIX append SUFFIX to installed program names
179   --program-transform-name=PROGRAM
180                           run sed PROGRAM on installed program names
181 EOF
182     cat << EOF
183 Host type:
184   --build=BUILD           configure for building on BUILD [BUILD=HOST]
185   --host=HOST             configure for HOST [guessed]
186   --target=TARGET         configure for TARGET [TARGET=HOST]
187 Features and packages:
188   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
189   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
190   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
191   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
192   --x-includes=DIR        X include files are in DIR
193   --x-libraries=DIR       X library files are in DIR
194 EOF
195     if test -n "$ac_help"; then
196       echo "--enable and --with options recognized:$ac_help"
197     fi
198     exit 0 ;;
199
200   -host | --host | --hos | --ho)
201     ac_prev=host ;;
202   -host=* | --host=* | --hos=* | --ho=*)
203     host="$ac_optarg" ;;
204
205   -includedir | --includedir | --includedi | --included | --include \
206   | --includ | --inclu | --incl | --inc)
207     ac_prev=includedir ;;
208   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
209   | --includ=* | --inclu=* | --incl=* | --inc=*)
210     includedir="$ac_optarg" ;;
211
212   -infodir | --infodir | --infodi | --infod | --info | --inf)
213     ac_prev=infodir ;;
214   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
215     infodir="$ac_optarg" ;;
216
217   -libdir | --libdir | --libdi | --libd)
218     ac_prev=libdir ;;
219   -libdir=* | --libdir=* | --libdi=* | --libd=*)
220     libdir="$ac_optarg" ;;
221
222   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
223   | --libexe | --libex | --libe)
224     ac_prev=libexecdir ;;
225   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
226   | --libexe=* | --libex=* | --libe=*)
227     libexecdir="$ac_optarg" ;;
228
229   -localstatedir | --localstatedir | --localstatedi | --localstated \
230   | --localstate | --localstat | --localsta | --localst \
231   | --locals | --local | --loca | --loc | --lo)
232     ac_prev=localstatedir ;;
233   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
234   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
235   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
236     localstatedir="$ac_optarg" ;;
237
238   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
239     ac_prev=mandir ;;
240   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
241     mandir="$ac_optarg" ;;
242
243   -nfp | --nfp | --nf)
244     # Obsolete; use --without-fp.
245     with_fp=no ;;
246
247   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
248   | --no-cr | --no-c)
249     no_create=yes ;;
250
251   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
252   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
253     no_recursion=yes ;;
254
255   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
256   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
257   | --oldin | --oldi | --old | --ol | --o)
258     ac_prev=oldincludedir ;;
259   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
260   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
261   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
262     oldincludedir="$ac_optarg" ;;
263
264   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
265     ac_prev=prefix ;;
266   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
267     prefix="$ac_optarg" ;;
268
269   -program-prefix | --program-prefix | --program-prefi | --program-pref \
270   | --program-pre | --program-pr | --program-p)
271     ac_prev=program_prefix ;;
272   -program-prefix=* | --program-prefix=* | --program-prefi=* \
273   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
274     program_prefix="$ac_optarg" ;;
275
276   -program-suffix | --program-suffix | --program-suffi | --program-suff \
277   | --program-suf | --program-su | --program-s)
278     ac_prev=program_suffix ;;
279   -program-suffix=* | --program-suffix=* | --program-suffi=* \
280   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
281     program_suffix="$ac_optarg" ;;
282
283   -program-transform-name | --program-transform-name \
284   | --program-transform-nam | --program-transform-na \
285   | --program-transform-n | --program-transform- \
286   | --program-transform | --program-transfor \
287   | --program-transfo | --program-transf \
288   | --program-trans | --program-tran \
289   | --progr-tra | --program-tr | --program-t)
290     ac_prev=program_transform_name ;;
291   -program-transform-name=* | --program-transform-name=* \
292   | --program-transform-nam=* | --program-transform-na=* \
293   | --program-transform-n=* | --program-transform-=* \
294   | --program-transform=* | --program-transfor=* \
295   | --program-transfo=* | --program-transf=* \
296   | --program-trans=* | --program-tran=* \
297   | --progr-tra=* | --program-tr=* | --program-t=*)
298     program_transform_name="$ac_optarg" ;;
299
300   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
301   | -silent | --silent | --silen | --sile | --sil)
302     silent=yes ;;
303
304   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
305     ac_prev=sbindir ;;
306   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
307   | --sbi=* | --sb=*)
308     sbindir="$ac_optarg" ;;
309
310   -sharedstatedir | --sharedstatedir | --sharedstatedi \
311   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
312   | --sharedst | --shareds | --shared | --share | --shar \
313   | --sha | --sh)
314     ac_prev=sharedstatedir ;;
315   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
316   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
317   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
318   | --sha=* | --sh=*)
319     sharedstatedir="$ac_optarg" ;;
320
321   -site | --site | --sit)
322     ac_prev=site ;;
323   -site=* | --site=* | --sit=*)
324     site="$ac_optarg" ;;
325
326   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
327     ac_prev=srcdir ;;
328   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
329     srcdir="$ac_optarg" ;;
330
331   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
332   | --syscon | --sysco | --sysc | --sys | --sy)
333     ac_prev=sysconfdir ;;
334   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
335   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
336     sysconfdir="$ac_optarg" ;;
337
338   -target | --target | --targe | --targ | --tar | --ta | --t)
339     ac_prev=target ;;
340   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
341     target="$ac_optarg" ;;
342
343   -v | -verbose | --verbose | --verbos | --verbo | --verb)
344     verbose=yes ;;
345
346   -version | --version | --versio | --versi | --vers)
347     echo "configure generated by autoconf version 2.13"
348     exit 0 ;;
349
350   -with-* | --with-*)
351     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
352     # Reject names that are not valid shell variable names.
353     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
354       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
355     fi
356     ac_package=`echo $ac_package| sed 's/-/_/g'`
357     case "$ac_option" in
358       *=*) ;;
359       *) ac_optarg=yes ;;
360     esac
361     eval "with_${ac_package}='$ac_optarg'" ;;
362
363   -without-* | --without-*)
364     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
365     # Reject names that are not valid shell variable names.
366     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
367       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
368     fi
369     ac_package=`echo $ac_package| sed 's/-/_/g'`
370     eval "with_${ac_package}=no" ;;
371
372   --x)
373     # Obsolete; use --with-x.
374     with_x=yes ;;
375
376   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
377   | --x-incl | --x-inc | --x-in | --x-i)
378     ac_prev=x_includes ;;
379   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
380   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
381     x_includes="$ac_optarg" ;;
382
383   -x-libraries | --x-libraries | --x-librarie | --x-librari \
384   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
385     ac_prev=x_libraries ;;
386   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
387   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
388     x_libraries="$ac_optarg" ;;
389
390   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
391     ;;
392
393   *)
394     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
395       echo "configure: warning: $ac_option: invalid host type" 1>&2
396     fi
397     if test "x$nonopt" != xNONE; then
398       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
399     fi
400     nonopt="$ac_option"
401     ;;
402
403   esac
404 done
405
406 if test -n "$ac_prev"; then
407   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
408 fi
409
410 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
411
412 # File descriptor usage:
413 # 0 standard input
414 # 1 file creation
415 # 2 errors and warnings
416 # 3 some systems may open it to /dev/tty
417 # 4 used on the Kubota Titan
418 # 6 checking for... messages and results
419 # 5 compiler messages saved in config.log
420 if test "$silent" = yes; then
421   exec 6>/dev/null
422 else
423   exec 6>&1
424 fi
425 exec 5>./config.log
426
427 echo "\
428 This file contains any messages produced by compilers while
429 running configure, to aid debugging if configure makes a mistake.
430 " 1>&5
431
432 # Strip out --no-create and --no-recursion so they do not pile up.
433 # Also quote any args containing shell metacharacters.
434 ac_configure_args=
435 for ac_arg
436 do
437   case "$ac_arg" in
438   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
439   | --no-cr | --no-c) ;;
440   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
441   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
442   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
443   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
444   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
445   esac
446 done
447
448 # NLS nuisances.
449 # Only set these to C if already set.  These must not be set unconditionally
450 # because not all systems understand e.g. LANG=C (notably SCO).
451 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
452 # Non-C LC_CTYPE values break the ctype check.
453 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
454 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
455 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
456 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
457
458 # confdefs.h avoids OS command line length limits that DEFS can exceed.
459 rm -rf conftest* confdefs.h
460 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
461 echo > confdefs.h
462
463 # A filename unique to this package, relative to the directory that
464 # configure is in, which we can look for to find out if srcdir is correct.
465 ac_unique_file=base/a_action.c
466
467 # Find the source files, if location was not specified.
468 if test -z "$srcdir"; then
469   ac_srcdir_defaulted=yes
470   # Try the directory containing this script, then its parent.
471   ac_prog=$0
472   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
473   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
474   srcdir=$ac_confdir
475   if test ! -r $srcdir/$ac_unique_file; then
476     srcdir=..
477   fi
478 else
479   ac_srcdir_defaulted=no
480 fi
481 if test ! -r $srcdir/$ac_unique_file; then
482   if test "$ac_srcdir_defaulted" = yes; then
483     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
484   else
485     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
486   fi
487 fi
488 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
489
490 # Prefer explicitly selected file to automatically selected ones.
491 if test -z "$CONFIG_SITE"; then
492   if test "x$prefix" != xNONE; then
493     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
494   else
495     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
496   fi
497 fi
498 for ac_site_file in $CONFIG_SITE; do
499   if test -r "$ac_site_file"; then
500     echo "loading site script $ac_site_file"
501     . "$ac_site_file"
502   fi
503 done
504
505 if test -r "$cache_file"; then
506   echo "loading cache $cache_file"
507   . $cache_file
508 else
509   echo "creating cache $cache_file"
510   > $cache_file
511 fi
512
513 ac_ext=c
514 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
515 ac_cpp='$CPP $CPPFLAGS'
516 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
517 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
518 cross_compiling=$ac_cv_prog_cc_cross
519
520 ac_exeext=
521 ac_objext=o
522 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
523   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
524   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
525     ac_n= ac_c='
526 ' ac_t='        '
527   else
528     ac_n=-n ac_c= ac_t=
529   fi
530 else
531   ac_n= ac_c='\c' ac_t=
532 fi
533
534                 
535
536
537 # We want these before the checks, so the checks can modify their values.
538
539
540 GLHEXEN="false"
541 GLLIBS=""
542 BASELIBS=""
543 SVGALIBS=""
544 LIBS="-L/usr/X11R6/lib"
545 HAVESVGA="no"
546 HAVEX11="yes"
547 HAVEGL="yes"
548 FORCEMESAGL="no"
549
550 # Check whether --enable-gl or --disable-gl was given.
551 if test "${enable_gl+set}" = set; then
552   enableval="$enable_gl"
553   GLHEXEN="true"; cat >> confdefs.h <<\EOF
554 #define RENDER3D 1
555 EOF
556
557 fi
558
559
560 # Check whether --enable-gl-mesa or --disable-gl-mesa was given.
561 if test "${enable_gl_mesa+set}" = set; then
562   enableval="$enable_gl_mesa"
563   GLHEXEN="true"; FORCEMESAGL="yes" ;cat >> confdefs.h <<\EOF
564 #define RENDER3D 1
565 EOF
566
567 fi
568
569
570 # Check whether --enable-demowad or --disable-demowad was given.
571 if test "${enable_demowad+set}" = set; then
572   enableval="$enable_demowad"
573    cat >> confdefs.h <<\EOF
574 #define DEMO_WAD 1
575 EOF
576
577 fi
578
579
580 # Check whether --enable-userconfig or --disable-userconfig was given.
581 if test "${enable_userconfig+set}" = set; then
582   enableval="$enable_userconfig"
583    cat >> confdefs.h <<\EOF
584 #define USERCONFIG 1
585 EOF
586
587 fi
588
589
590 # Check whether --enable-assassin or --disable-assassin was given.
591 if test "${enable_assassin+set}" = set; then
592   enableval="$enable_assassin"
593   :
594 else
595   cat >> confdefs.h <<\EOF
596 #define ASSASSIN 1
597 EOF
598
599 fi
600
601
602
603
604
605 cat >> confdefs.h <<\EOF
606 #define _REENTRANT 1
607 EOF
608
609 cat >> confdefs.h <<\EOF
610 #define NORANGECHECKING 1
611 EOF
612
613
614
615 # Extract the first word of "gcc", so it can be a program name with args.
616 set dummy gcc; ac_word=$2
617 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
618 echo "configure:619: checking for $ac_word" >&5
619 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
620   echo $ac_n "(cached) $ac_c" 1>&6
621 else
622   if test -n "$CC"; then
623   ac_cv_prog_CC="$CC" # Let the user override the test.
624 else
625   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
626   ac_dummy="$PATH"
627   for ac_dir in $ac_dummy; do
628     test -z "$ac_dir" && ac_dir=.
629     if test -f $ac_dir/$ac_word; then
630       ac_cv_prog_CC="gcc"
631       break
632     fi
633   done
634   IFS="$ac_save_ifs"
635 fi
636 fi
637 CC="$ac_cv_prog_CC"
638 if test -n "$CC"; then
639   echo "$ac_t""$CC" 1>&6
640 else
641   echo "$ac_t""no" 1>&6
642 fi
643
644 if test -z "$CC"; then
645   # Extract the first word of "cc", so it can be a program name with args.
646 set dummy cc; ac_word=$2
647 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
648 echo "configure:649: checking for $ac_word" >&5
649 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
650   echo $ac_n "(cached) $ac_c" 1>&6
651 else
652   if test -n "$CC"; then
653   ac_cv_prog_CC="$CC" # Let the user override the test.
654 else
655   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
656   ac_prog_rejected=no
657   ac_dummy="$PATH"
658   for ac_dir in $ac_dummy; do
659     test -z "$ac_dir" && ac_dir=.
660     if test -f $ac_dir/$ac_word; then
661       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
662         ac_prog_rejected=yes
663         continue
664       fi
665       ac_cv_prog_CC="cc"
666       break
667     fi
668   done
669   IFS="$ac_save_ifs"
670 if test $ac_prog_rejected = yes; then
671   # We found a bogon in the path, so make sure we never use it.
672   set dummy $ac_cv_prog_CC
673   shift
674   if test $# -gt 0; then
675     # We chose a different compiler from the bogus one.
676     # However, it has the same basename, so the bogon will be chosen
677     # first if we set CC to just the basename; use the full file name.
678     shift
679     set dummy "$ac_dir/$ac_word" "$@"
680     shift
681     ac_cv_prog_CC="$@"
682   fi
683 fi
684 fi
685 fi
686 CC="$ac_cv_prog_CC"
687 if test -n "$CC"; then
688   echo "$ac_t""$CC" 1>&6
689 else
690   echo "$ac_t""no" 1>&6
691 fi
692
693   if test -z "$CC"; then
694     case "`uname -s`" in
695     *win32* | *WIN32*)
696       # Extract the first word of "cl", so it can be a program name with args.
697 set dummy cl; ac_word=$2
698 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
699 echo "configure:700: checking for $ac_word" >&5
700 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
701   echo $ac_n "(cached) $ac_c" 1>&6
702 else
703   if test -n "$CC"; then
704   ac_cv_prog_CC="$CC" # Let the user override the test.
705 else
706   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
707   ac_dummy="$PATH"
708   for ac_dir in $ac_dummy; do
709     test -z "$ac_dir" && ac_dir=.
710     if test -f $ac_dir/$ac_word; then
711       ac_cv_prog_CC="cl"
712       break
713     fi
714   done
715   IFS="$ac_save_ifs"
716 fi
717 fi
718 CC="$ac_cv_prog_CC"
719 if test -n "$CC"; then
720   echo "$ac_t""$CC" 1>&6
721 else
722   echo "$ac_t""no" 1>&6
723 fi
724  ;;
725     esac
726   fi
727   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
728 fi
729
730 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
731 echo "configure:732: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
732
733 ac_ext=c
734 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
735 ac_cpp='$CPP $CPPFLAGS'
736 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
737 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
738 cross_compiling=$ac_cv_prog_cc_cross
739
740 cat > conftest.$ac_ext << EOF
741
742 #line 743 "configure"
743 #include "confdefs.h"
744
745 main(){return(0);}
746 EOF
747 if { (eval echo configure:748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
748   ac_cv_prog_cc_works=yes
749   # If we can't run a trivial program, we are probably using a cross compiler.
750   if (./conftest; exit) 2>/dev/null; then
751     ac_cv_prog_cc_cross=no
752   else
753     ac_cv_prog_cc_cross=yes
754   fi
755 else
756   echo "configure: failed program was:" >&5
757   cat conftest.$ac_ext >&5
758   ac_cv_prog_cc_works=no
759 fi
760 rm -fr conftest*
761 ac_ext=c
762 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
763 ac_cpp='$CPP $CPPFLAGS'
764 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
765 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
766 cross_compiling=$ac_cv_prog_cc_cross
767
768 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
769 if test $ac_cv_prog_cc_works = no; then
770   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
771 fi
772 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
773 echo "configure:774: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
774 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
775 cross_compiling=$ac_cv_prog_cc_cross
776
777 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
778 echo "configure:779: checking whether we are using GNU C" >&5
779 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
780   echo $ac_n "(cached) $ac_c" 1>&6
781 else
782   cat > conftest.c <<EOF
783 #ifdef __GNUC__
784   yes;
785 #endif
786 EOF
787 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:788: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
788   ac_cv_prog_gcc=yes
789 else
790   ac_cv_prog_gcc=no
791 fi
792 fi
793
794 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
795
796 if test $ac_cv_prog_gcc = yes; then
797   GCC=yes
798 else
799   GCC=
800 fi
801
802 ac_test_CFLAGS="${CFLAGS+set}"
803 ac_save_CFLAGS="$CFLAGS"
804 CFLAGS=
805 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
806 echo "configure:807: checking whether ${CC-cc} accepts -g" >&5
807 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
808   echo $ac_n "(cached) $ac_c" 1>&6
809 else
810   echo 'void f(){}' > conftest.c
811 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
812   ac_cv_prog_cc_g=yes
813 else
814   ac_cv_prog_cc_g=no
815 fi
816 rm -f conftest*
817
818 fi
819
820 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
821 if test "$ac_test_CFLAGS" = set; then
822   CFLAGS="$ac_save_CFLAGS"
823 elif test $ac_cv_prog_cc_g = yes; then
824   if test "$GCC" = yes; then
825     CFLAGS="-g -O2"
826   else
827     CFLAGS="-g"
828   fi
829 else
830   if test "$GCC" = yes; then
831     CFLAGS="-O2"
832   else
833     CFLAGS=
834   fi
835 fi
836
837 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
838 echo "configure:839: checking how to run the C preprocessor" >&5
839 # On Suns, sometimes $CPP names a directory.
840 if test -n "$CPP" && test -d "$CPP"; then
841   CPP=
842 fi
843 if test -z "$CPP"; then
844 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
845   echo $ac_n "(cached) $ac_c" 1>&6
846 else
847     # This must be in double quotes, not single quotes, because CPP may get
848   # substituted into the Makefile and "${CC-cc}" will confuse make.
849   CPP="${CC-cc} -E"
850   # On the NeXT, cc -E runs the code through the compiler's parser,
851   # not just through cpp.
852   cat > conftest.$ac_ext <<EOF
853 #line 854 "configure"
854 #include "confdefs.h"
855 #include <assert.h>
856 Syntax Error
857 EOF
858 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
859 { (eval echo configure:860: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
860 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
861 if test -z "$ac_err"; then
862   :
863 else
864   echo "$ac_err" >&5
865   echo "configure: failed program was:" >&5
866   cat conftest.$ac_ext >&5
867   rm -rf conftest*
868   CPP="${CC-cc} -E -traditional-cpp"
869   cat > conftest.$ac_ext <<EOF
870 #line 871 "configure"
871 #include "confdefs.h"
872 #include <assert.h>
873 Syntax Error
874 EOF
875 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
876 { (eval echo configure:877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
877 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
878 if test -z "$ac_err"; then
879   :
880 else
881   echo "$ac_err" >&5
882   echo "configure: failed program was:" >&5
883   cat conftest.$ac_ext >&5
884   rm -rf conftest*
885   CPP="${CC-cc} -nologo -E"
886   cat > conftest.$ac_ext <<EOF
887 #line 888 "configure"
888 #include "confdefs.h"
889 #include <assert.h>
890 Syntax Error
891 EOF
892 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
893 { (eval echo configure:894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
894 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
895 if test -z "$ac_err"; then
896   :
897 else
898   echo "$ac_err" >&5
899   echo "configure: failed program was:" >&5
900   cat conftest.$ac_ext >&5
901   rm -rf conftest*
902   CPP=/lib/cpp
903 fi
904 rm -f conftest*
905 fi
906 rm -f conftest*
907 fi
908 rm -f conftest*
909   ac_cv_prog_CPP="$CPP"
910 fi
911   CPP="$ac_cv_prog_CPP"
912 else
913   ac_cv_prog_CPP="$CPP"
914 fi
915 echo "$ac_t""$CPP" 1>&6
916
917
918
919 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
920 echo "configure:921: checking for pthread_create in -lpthread" >&5
921 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
922 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
923   echo $ac_n "(cached) $ac_c" 1>&6
924 else
925   ac_save_LIBS="$LIBS"
926 LIBS="-lpthread  $LIBS"
927 cat > conftest.$ac_ext <<EOF
928 #line 929 "configure"
929 #include "confdefs.h"
930 /* Override any gcc2 internal prototype to avoid an error.  */
931 /* We use char because int might match the return type of a gcc2
932     builtin and then its argument prototype would still apply.  */
933 char pthread_create();
934
935 int main() {
936 pthread_create()
937 ; return 0; }
938 EOF
939 if { (eval echo configure:940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
940   rm -rf conftest*
941   eval "ac_cv_lib_$ac_lib_var=yes"
942 else
943   echo "configure: failed program was:" >&5
944   cat conftest.$ac_ext >&5
945   rm -rf conftest*
946   eval "ac_cv_lib_$ac_lib_var=no"
947 fi
948 rm -f conftest*
949 LIBS="$ac_save_LIBS"
950
951 fi
952 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
953   echo "$ac_t""yes" 1>&6
954   BASELIBS="-lpthread"
955 else
956   echo "$ac_t""no" 1>&6
957 fi
958
959
960
961 echo $ac_n "checking for vga_setmode in -lvga""... $ac_c" 1>&6
962 echo "configure:963: checking for vga_setmode in -lvga" >&5
963 ac_lib_var=`echo vga'_'vga_setmode | sed 'y%./+-%__p_%'`
964 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
965   echo $ac_n "(cached) $ac_c" 1>&6
966 else
967   ac_save_LIBS="$LIBS"
968 LIBS="-lvga  $LIBS"
969 cat > conftest.$ac_ext <<EOF
970 #line 971 "configure"
971 #include "confdefs.h"
972 /* Override any gcc2 internal prototype to avoid an error.  */
973 /* We use char because int might match the return type of a gcc2
974     builtin and then its argument prototype would still apply.  */
975 char vga_setmode();
976
977 int main() {
978 vga_setmode()
979 ; return 0; }
980 EOF
981 if { (eval echo configure:982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
982   rm -rf conftest*
983   eval "ac_cv_lib_$ac_lib_var=yes"
984 else
985   echo "configure: failed program was:" >&5
986   cat conftest.$ac_ext >&5
987   rm -rf conftest*
988   eval "ac_cv_lib_$ac_lib_var=no"
989 fi
990 rm -f conftest*
991 LIBS="$ac_save_LIBS"
992
993 fi
994 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
995   echo "$ac_t""yes" 1>&6
996   SVGALIBS="-lvga"; HAVESVGA="yes"
997 else
998   echo "$ac_t""no" 1>&6
999 fi
1000
1001
1002 echo $ac_n "checking for XShmQueryExtension in -lXext""... $ac_c" 1>&6
1003 echo "configure:1004: checking for XShmQueryExtension in -lXext" >&5
1004 ac_lib_var=`echo Xext'_'XShmQueryExtension | sed 'y%./+-%__p_%'`
1005 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1006   echo $ac_n "(cached) $ac_c" 1>&6
1007 else
1008   ac_save_LIBS="$LIBS"
1009 LIBS="-lXext  $LIBS"
1010 cat > conftest.$ac_ext <<EOF
1011 #line 1012 "configure"
1012 #include "confdefs.h"
1013 /* Override any gcc2 internal prototype to avoid an error.  */
1014 /* We use char because int might match the return type of a gcc2
1015     builtin and then its argument prototype would still apply.  */
1016 char XShmQueryExtension();
1017
1018 int main() {
1019 XShmQueryExtension()
1020 ; return 0; }
1021 EOF
1022 if { (eval echo configure:1023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1023   rm -rf conftest*
1024   eval "ac_cv_lib_$ac_lib_var=yes"
1025 else
1026   echo "configure: failed program was:" >&5
1027   cat conftest.$ac_ext >&5
1028   rm -rf conftest*
1029   eval "ac_cv_lib_$ac_lib_var=no"
1030 fi
1031 rm -f conftest*
1032 LIBS="$ac_save_LIBS"
1033
1034 fi
1035 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1036   echo "$ac_t""yes" 1>&6
1037   LIBS="$LIBS -lXext"
1038 else
1039   echo "$ac_t""no" 1>&6
1040 HAVEX11="no"
1041 fi
1042
1043 echo $ac_n "checking for main in -lX11""... $ac_c" 1>&6
1044 echo "configure:1045: checking for main in -lX11" >&5
1045 ac_lib_var=`echo X11'_'main | sed 'y%./+-%__p_%'`
1046 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1047   echo $ac_n "(cached) $ac_c" 1>&6
1048 else
1049   ac_save_LIBS="$LIBS"
1050 LIBS="-lX11  $LIBS"
1051 cat > conftest.$ac_ext <<EOF
1052 #line 1053 "configure"
1053 #include "confdefs.h"
1054
1055 int main() {
1056 main()
1057 ; return 0; }
1058 EOF
1059 if { (eval echo configure:1060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1060   rm -rf conftest*
1061   eval "ac_cv_lib_$ac_lib_var=yes"
1062 else
1063   echo "configure: failed program was:" >&5
1064   cat conftest.$ac_ext >&5
1065   rm -rf conftest*
1066   eval "ac_cv_lib_$ac_lib_var=no"
1067 fi
1068 rm -f conftest*
1069 LIBS="$ac_save_LIBS"
1070
1071 fi
1072 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1073   echo "$ac_t""yes" 1>&6
1074   LIBS="$LIBS -lX11"
1075 else
1076   echo "$ac_t""no" 1>&6
1077 HAVEX11="no"
1078 fi
1079
1080 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
1081 echo "configure:1082: checking for dlopen in -ldl" >&5
1082 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
1083 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1084   echo $ac_n "(cached) $ac_c" 1>&6
1085 else
1086   ac_save_LIBS="$LIBS"
1087 LIBS="-ldl  $LIBS"
1088 cat > conftest.$ac_ext <<EOF
1089 #line 1090 "configure"
1090 #include "confdefs.h"
1091 /* Override any gcc2 internal prototype to avoid an error.  */
1092 /* We use char because int might match the return type of a gcc2
1093     builtin and then its argument prototype would still apply.  */
1094 char dlopen();
1095
1096 int main() {
1097 dlopen()
1098 ; return 0; }
1099 EOF
1100 if { (eval echo configure:1101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1101   rm -rf conftest*
1102   eval "ac_cv_lib_$ac_lib_var=yes"
1103 else
1104   echo "configure: failed program was:" >&5
1105   cat conftest.$ac_ext >&5
1106   rm -rf conftest*
1107   eval "ac_cv_lib_$ac_lib_var=no"
1108 fi
1109 rm -f conftest*
1110 LIBS="$ac_save_LIBS"
1111
1112 fi
1113 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1114   echo "$ac_t""yes" 1>&6
1115     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1116     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1117   cat >> confdefs.h <<EOF
1118 #define $ac_tr_lib 1
1119 EOF
1120
1121   LIBS="-ldl $LIBS"
1122
1123 else
1124   echo "$ac_t""no" 1>&6
1125 fi
1126
1127 echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6
1128 echo "configure:1129: checking for sqrt in -lm" >&5
1129 ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'`
1130 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1131   echo $ac_n "(cached) $ac_c" 1>&6
1132 else
1133   ac_save_LIBS="$LIBS"
1134 LIBS="-lm  $LIBS"
1135 cat > conftest.$ac_ext <<EOF
1136 #line 1137 "configure"
1137 #include "confdefs.h"
1138 /* Override any gcc2 internal prototype to avoid an error.  */
1139 /* We use char because int might match the return type of a gcc2
1140     builtin and then its argument prototype would still apply.  */
1141 char sqrt();
1142
1143 int main() {
1144 sqrt()
1145 ; return 0; }
1146 EOF
1147 if { (eval echo configure:1148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1148   rm -rf conftest*
1149   eval "ac_cv_lib_$ac_lib_var=yes"
1150 else
1151   echo "configure: failed program was:" >&5
1152   cat conftest.$ac_ext >&5
1153   rm -rf conftest*
1154   eval "ac_cv_lib_$ac_lib_var=no"
1155 fi
1156 rm -f conftest*
1157 LIBS="$ac_save_LIBS"
1158
1159 fi
1160 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1161   echo "$ac_t""yes" 1>&6
1162     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1163     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1164   cat >> confdefs.h <<EOF
1165 #define $ac_tr_lib 1
1166 EOF
1167
1168   LIBS="-lm $LIBS"
1169
1170 else
1171   echo "$ac_t""no" 1>&6
1172 fi
1173
1174
1175
1176 if test "$GLHEXEN" = "true"
1177 then
1178   if test "$FORCEMESAGL" = "yes"
1179   then
1180     echo $ac_n "checking for glBindTexture in -lMesaGL""... $ac_c" 1>&6
1181 echo "configure:1182: checking for glBindTexture in -lMesaGL" >&5
1182 ac_lib_var=`echo MesaGL'_'glBindTexture | sed 'y%./+-%__p_%'`
1183 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1184   echo $ac_n "(cached) $ac_c" 1>&6
1185 else
1186   ac_save_LIBS="$LIBS"
1187 LIBS="-lMesaGL  $LIBS"
1188 cat > conftest.$ac_ext <<EOF
1189 #line 1190 "configure"
1190 #include "confdefs.h"
1191 /* Override any gcc2 internal prototype to avoid an error.  */
1192 /* We use char because int might match the return type of a gcc2
1193     builtin and then its argument prototype would still apply.  */
1194 char glBindTexture();
1195
1196 int main() {
1197 glBindTexture()
1198 ; return 0; }
1199 EOF
1200 if { (eval echo configure:1201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1201   rm -rf conftest*
1202   eval "ac_cv_lib_$ac_lib_var=yes"
1203 else
1204   echo "configure: failed program was:" >&5
1205   cat conftest.$ac_ext >&5
1206   rm -rf conftest*
1207   eval "ac_cv_lib_$ac_lib_var=no"
1208 fi
1209 rm -f conftest*
1210 LIBS="$ac_save_LIBS"
1211
1212 fi
1213 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1214   echo "$ac_t""yes" 1>&6
1215     ac_tr_lib=HAVE_LIB`echo MesaGL | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1216     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1217   cat >> confdefs.h <<EOF
1218 #define $ac_tr_lib 1
1219 EOF
1220
1221   LIBS="-lMesaGL $LIBS"
1222
1223 else
1224   echo "$ac_t""no" 1>&6
1225 HAVEGL="no"
1226 fi
1227
1228     echo $ac_n "checking for gluOrtho2D in -lMesaGLU""... $ac_c" 1>&6
1229 echo "configure:1230: checking for gluOrtho2D in -lMesaGLU" >&5
1230 ac_lib_var=`echo MesaGLU'_'gluOrtho2D | sed 'y%./+-%__p_%'`
1231 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1232   echo $ac_n "(cached) $ac_c" 1>&6
1233 else
1234   ac_save_LIBS="$LIBS"
1235 LIBS="-lMesaGLU  $LIBS"
1236 cat > conftest.$ac_ext <<EOF
1237 #line 1238 "configure"
1238 #include "confdefs.h"
1239 /* Override any gcc2 internal prototype to avoid an error.  */
1240 /* We use char because int might match the return type of a gcc2
1241     builtin and then its argument prototype would still apply.  */
1242 char gluOrtho2D();
1243
1244 int main() {
1245 gluOrtho2D()
1246 ; return 0; }
1247 EOF
1248 if { (eval echo configure:1249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1249   rm -rf conftest*
1250   eval "ac_cv_lib_$ac_lib_var=yes"
1251 else
1252   echo "configure: failed program was:" >&5
1253   cat conftest.$ac_ext >&5
1254   rm -rf conftest*
1255   eval "ac_cv_lib_$ac_lib_var=no"
1256 fi
1257 rm -f conftest*
1258 LIBS="$ac_save_LIBS"
1259
1260 fi
1261 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1262   echo "$ac_t""yes" 1>&6
1263     ac_tr_lib=HAVE_LIB`echo MesaGLU | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1264     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1265   cat >> confdefs.h <<EOF
1266 #define $ac_tr_lib 1
1267 EOF
1268
1269   LIBS="-lMesaGLU $LIBS"
1270
1271 else
1272   echo "$ac_t""no" 1>&6
1273 HAVEGL="no"
1274 fi
1275
1276   else
1277     echo $ac_n "checking for glBindTexture in -lGL""... $ac_c" 1>&6
1278 echo "configure:1279: checking for glBindTexture in -lGL" >&5
1279 ac_lib_var=`echo GL'_'glBindTexture | sed 'y%./+-%__p_%'`
1280 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1281   echo $ac_n "(cached) $ac_c" 1>&6
1282 else
1283   ac_save_LIBS="$LIBS"
1284 LIBS="-lGL  $LIBS"
1285 cat > conftest.$ac_ext <<EOF
1286 #line 1287 "configure"
1287 #include "confdefs.h"
1288 /* Override any gcc2 internal prototype to avoid an error.  */
1289 /* We use char because int might match the return type of a gcc2
1290     builtin and then its argument prototype would still apply.  */
1291 char glBindTexture();
1292
1293 int main() {
1294 glBindTexture()
1295 ; return 0; }
1296 EOF
1297 if { (eval echo configure:1298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1298   rm -rf conftest*
1299   eval "ac_cv_lib_$ac_lib_var=yes"
1300 else
1301   echo "configure: failed program was:" >&5
1302   cat conftest.$ac_ext >&5
1303   rm -rf conftest*
1304   eval "ac_cv_lib_$ac_lib_var=no"
1305 fi
1306 rm -f conftest*
1307 LIBS="$ac_save_LIBS"
1308
1309 fi
1310 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1311   echo "$ac_t""yes" 1>&6
1312   LIBS="$LIBS -lGL";
1313       echo $ac_n "checking for gluOrtho2D in -lGLU""... $ac_c" 1>&6
1314 echo "configure:1315: checking for gluOrtho2D in -lGLU" >&5
1315 ac_lib_var=`echo GLU'_'gluOrtho2D | sed 'y%./+-%__p_%'`
1316 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1317   echo $ac_n "(cached) $ac_c" 1>&6
1318 else
1319   ac_save_LIBS="$LIBS"
1320 LIBS="-lGLU  $LIBS"
1321 cat > conftest.$ac_ext <<EOF
1322 #line 1323 "configure"
1323 #include "confdefs.h"
1324 /* Override any gcc2 internal prototype to avoid an error.  */
1325 /* We use char because int might match the return type of a gcc2
1326     builtin and then its argument prototype would still apply.  */
1327 char gluOrtho2D();
1328
1329 int main() {
1330 gluOrtho2D()
1331 ; return 0; }
1332 EOF
1333 if { (eval echo configure:1334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1334   rm -rf conftest*
1335   eval "ac_cv_lib_$ac_lib_var=yes"
1336 else
1337   echo "configure: failed program was:" >&5
1338   cat conftest.$ac_ext >&5
1339   rm -rf conftest*
1340   eval "ac_cv_lib_$ac_lib_var=no"
1341 fi
1342 rm -f conftest*
1343 LIBS="$ac_save_LIBS"
1344
1345 fi
1346 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1347   echo "$ac_t""yes" 1>&6
1348     ac_tr_lib=HAVE_LIB`echo GLU | sed -e 's/^a-zA-Z0-9_/_/g' \
1349     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1350   cat >> confdefs.h <<EOF
1351 #define $ac_tr_lib 1
1352 EOF
1353
1354   LIBS="-lGLU $LIBS"
1355
1356 else
1357   echo "$ac_t""no" 1>&6
1358 echo $ac_n "checking for glBindTexture in -lMesaGL""... $ac_c" 1>&6
1359 echo "configure:1360: checking for glBindTexture in -lMesaGL" >&5
1360 ac_lib_var=`echo MesaGL'_'glBindTexture | sed 'y%./+-%__p_%'`
1361 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1362   echo $ac_n "(cached) $ac_c" 1>&6
1363 else
1364   ac_save_LIBS="$LIBS"
1365 LIBS="-lMesaGL  $LIBS"
1366 cat > conftest.$ac_ext <<EOF
1367 #line 1368 "configure"
1368 #include "confdefs.h"
1369 /* Override any gcc2 internal prototype to avoid an error.  */
1370 /* We use char because int might match the return type of a gcc2
1371     builtin and then its argument prototype would still apply.  */
1372 char glBindTexture();
1373
1374 int main() {
1375 glBindTexture()
1376 ; return 0; }
1377 EOF
1378 if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1379   rm -rf conftest*
1380   eval "ac_cv_lib_$ac_lib_var=yes"
1381 else
1382   echo "configure: failed program was:" >&5
1383   cat conftest.$ac_ext >&5
1384   rm -rf conftest*
1385   eval "ac_cv_lib_$ac_lib_var=no"
1386 fi
1387 rm -f conftest*
1388 LIBS="$ac_save_LIBS"
1389
1390 fi
1391 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1392   echo "$ac_t""yes" 1>&6
1393   LIBS="$LIBS -lMesaGL";
1394           echo $ac_n "checking for gluOrtho2D in -lMesaGLU""... $ac_c" 1>&6
1395 echo "configure:1396: checking for gluOrtho2D in -lMesaGLU" >&5
1396 ac_lib_var=`echo MesaGLU'_'gluOrtho2D | sed 'y%./+-%__p_%'`
1397 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1398   echo $ac_n "(cached) $ac_c" 1>&6
1399 else
1400   ac_save_LIBS="$LIBS"
1401 LIBS="-lMesaGLU  $LIBS"
1402 cat > conftest.$ac_ext <<EOF
1403 #line 1404 "configure"
1404 #include "confdefs.h"
1405 /* Override any gcc2 internal prototype to avoid an error.  */
1406 /* We use char because int might match the return type of a gcc2
1407     builtin and then its argument prototype would still apply.  */
1408 char gluOrtho2D();
1409
1410 int main() {
1411 gluOrtho2D()
1412 ; return 0; }
1413 EOF
1414 if { (eval echo configure:1415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1415   rm -rf conftest*
1416   eval "ac_cv_lib_$ac_lib_var=yes"
1417 else
1418   echo "configure: failed program was:" >&5
1419   cat conftest.$ac_ext >&5
1420   rm -rf conftest*
1421   eval "ac_cv_lib_$ac_lib_var=no"
1422 fi
1423 rm -f conftest*
1424 LIBS="$ac_save_LIBS"
1425
1426 fi
1427 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1428   echo "$ac_t""yes" 1>&6
1429     ac_tr_lib=HAVE_LIB`echo MesaGLU | sed -e 's/^a-zA-Z0-9_/_/g' \
1430     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1431   cat >> confdefs.h <<EOF
1432 #define $ac_tr_lib 1
1433 EOF
1434
1435   LIBS="-lMesaGLU $LIBS"
1436
1437 else
1438   echo "$ac_t""no" 1>&6
1439 HAVEGL="no"
1440 fi
1441
1442 else
1443   echo "$ac_t""no" 1>&6
1444 HAVEGL="no"
1445 fi
1446
1447         
1448 fi
1449
1450 else
1451   echo "$ac_t""no" 1>&6
1452 echo $ac_n "checking for glBindTexture in -lMesaGL""... $ac_c" 1>&6
1453 echo "configure:1454: checking for glBindTexture in -lMesaGL" >&5
1454 ac_lib_var=`echo MesaGL'_'glBindTexture | sed 'y%./+-%__p_%'`
1455 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1456   echo $ac_n "(cached) $ac_c" 1>&6
1457 else
1458   ac_save_LIBS="$LIBS"
1459 LIBS="-lMesaGL  $LIBS"
1460 cat > conftest.$ac_ext <<EOF
1461 #line 1462 "configure"
1462 #include "confdefs.h"
1463 /* Override any gcc2 internal prototype to avoid an error.  */
1464 /* We use char because int might match the return type of a gcc2
1465     builtin and then its argument prototype would still apply.  */
1466 char glBindTexture();
1467
1468 int main() {
1469 glBindTexture()
1470 ; return 0; }
1471 EOF
1472 if { (eval echo configure:1473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1473   rm -rf conftest*
1474   eval "ac_cv_lib_$ac_lib_var=yes"
1475 else
1476   echo "configure: failed program was:" >&5
1477   cat conftest.$ac_ext >&5
1478   rm -rf conftest*
1479   eval "ac_cv_lib_$ac_lib_var=no"
1480 fi
1481 rm -f conftest*
1482 LIBS="$ac_save_LIBS"
1483
1484 fi
1485 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1486   echo "$ac_t""yes" 1>&6
1487   LIBS="$LIBS -lMesaGL";
1488           echo $ac_n "checking for gluOrtho2D in -lMesaGLU""... $ac_c" 1>&6
1489 echo "configure:1490: checking for gluOrtho2D in -lMesaGLU" >&5
1490 ac_lib_var=`echo MesaGLU'_'gluOrtho2D | sed 'y%./+-%__p_%'`
1491 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1492   echo $ac_n "(cached) $ac_c" 1>&6
1493 else
1494   ac_save_LIBS="$LIBS"
1495 LIBS="-lMesaGLU  $LIBS"
1496 cat > conftest.$ac_ext <<EOF
1497 #line 1498 "configure"
1498 #include "confdefs.h"
1499 /* Override any gcc2 internal prototype to avoid an error.  */
1500 /* We use char because int might match the return type of a gcc2
1501     builtin and then its argument prototype would still apply.  */
1502 char gluOrtho2D();
1503
1504 int main() {
1505 gluOrtho2D()
1506 ; return 0; }
1507 EOF
1508 if { (eval echo configure:1509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1509   rm -rf conftest*
1510   eval "ac_cv_lib_$ac_lib_var=yes"
1511 else
1512   echo "configure: failed program was:" >&5
1513   cat conftest.$ac_ext >&5
1514   rm -rf conftest*
1515   eval "ac_cv_lib_$ac_lib_var=no"
1516 fi
1517 rm -f conftest*
1518 LIBS="$ac_save_LIBS"
1519
1520 fi
1521 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1522   echo "$ac_t""yes" 1>&6
1523     ac_tr_lib=HAVE_LIB`echo MesaGLU | sed -e 's/^a-zA-Z0-9_/_/g' \
1524     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1525   cat >> confdefs.h <<EOF
1526 #define $ac_tr_lib 1
1527 EOF
1528
1529   LIBS="-lMesaGLU $LIBS"
1530
1531 else
1532   echo "$ac_t""no" 1>&6
1533 HAVEGL="no"
1534 fi
1535
1536 else
1537   echo "$ac_t""no" 1>&6
1538 HAVEGL="no"
1539 fi
1540
1541     
1542 fi
1543
1544   fi
1545 fi
1546
1547
1548 if test "x${GCC}" = "xyes"
1549 then
1550   CFLAGS="$CFLAGS -Wall"
1551   echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6
1552 echo "configure:1553: checking "for gcc strength-reduce bug"" >&5
1553 if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then
1554   echo $ac_n "(cached) $ac_c" 1>&6
1555 else
1556   if test "$cross_compiling" = yes; then
1557   ac_cv_c_gcc_strength_bug="yes"
1558 else
1559   cat > conftest.$ac_ext <<EOF
1560 #line 1561 "configure"
1561 #include "confdefs.h"
1562
1563 int main(void) {
1564   static int Array[3];
1565   unsigned int B = 3;
1566   int i;
1567   for(i=0; i<B; i++) Array[i] = i - 3;
1568   exit( Array[1] != -2 );
1569 }
1570 EOF
1571 if { (eval echo configure:1572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1572 then
1573   ac_cv_c_gcc_strength_bug="no"
1574 else
1575   echo "configure: failed program was:" >&5
1576   cat conftest.$ac_ext >&5
1577   rm -fr conftest*
1578   ac_cv_c_gcc_strength_bug="yes"
1579 fi
1580 rm -fr conftest*
1581 fi
1582  
1583 fi
1584
1585 echo "$ac_t""$ac_cv_c_gcc_strength_bug" 1>&6
1586   if test "$ac_cv_c_gcc_strength_bug" = "yes"
1587   then
1588     CFLAGS="$CFLAGS -fno-strength-reduce"
1589   fi
1590 fi
1591
1592
1593 echo $ac_n "checking "whether external symbols need an underscore prefix"""... $ac_c" 1>&6
1594 echo "configure:1595: checking "whether external symbols need an underscore prefix"" >&5
1595 if eval "test \"`echo '$''{'ac_cv_c_extern_prefix'+set}'`\" = set"; then
1596   echo $ac_n "(cached) $ac_c" 1>&6
1597 else
1598   saved_libs=$LIBS
1599 LIBS="conftest_asm.s $LIBS"
1600 cat > conftest_asm.s <<EOF
1601         .globl _ac_test
1602 _ac_test:
1603         .long 0
1604 EOF
1605 cat > conftest.$ac_ext <<EOF
1606 #line 1607 "configure"
1607 #include "confdefs.h"
1608 extern int ac_test;
1609 int main() {
1610 if (ac_test) return 1
1611 ; return 0; }
1612 EOF
1613 if { (eval echo configure:1614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1614   rm -rf conftest*
1615   ac_cv_c_extern_prefix="yes"
1616 else
1617   echo "configure: failed program was:" >&5
1618   cat conftest.$ac_ext >&5
1619   rm -rf conftest*
1620   ac_cv_c_extern_prefix="no"
1621 fi
1622 rm -f conftest*
1623 LIBS=$saved_libs
1624 fi
1625
1626 echo "$ac_t""$ac_cv_c_extern_prefix" 1>&6
1627
1628
1629
1630
1631 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
1632 # for constant arguments.  Useless!
1633 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
1634 echo "configure:1635: checking for working alloca.h" >&5
1635 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
1636   echo $ac_n "(cached) $ac_c" 1>&6
1637 else
1638   cat > conftest.$ac_ext <<EOF
1639 #line 1640 "configure"
1640 #include "confdefs.h"
1641 #include <alloca.h>
1642 int main() {
1643 char *p = alloca(2 * sizeof(int));
1644 ; return 0; }
1645 EOF
1646 if { (eval echo configure:1647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1647   rm -rf conftest*
1648   ac_cv_header_alloca_h=yes
1649 else
1650   echo "configure: failed program was:" >&5
1651   cat conftest.$ac_ext >&5
1652   rm -rf conftest*
1653   ac_cv_header_alloca_h=no
1654 fi
1655 rm -f conftest*
1656 fi
1657
1658 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
1659 if test $ac_cv_header_alloca_h = yes; then
1660   cat >> confdefs.h <<\EOF
1661 #define HAVE_ALLOCA_H 1
1662 EOF
1663
1664 fi
1665
1666 echo $ac_n "checking for alloca""... $ac_c" 1>&6
1667 echo "configure:1668: checking for alloca" >&5
1668 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
1669   echo $ac_n "(cached) $ac_c" 1>&6
1670 else
1671   cat > conftest.$ac_ext <<EOF
1672 #line 1673 "configure"
1673 #include "confdefs.h"
1674
1675 #ifdef __GNUC__
1676 # define alloca __builtin_alloca
1677 #else
1678 # ifdef _MSC_VER
1679 #  include <malloc.h>
1680 #  define alloca _alloca
1681 # else
1682 #  if HAVE_ALLOCA_H
1683 #   include <alloca.h>
1684 #  else
1685 #   ifdef _AIX
1686  #pragma alloca
1687 #   else
1688 #    ifndef alloca /* predefined by HP cc +Olibcalls */
1689 char *alloca ();
1690 #    endif
1691 #   endif
1692 #  endif
1693 # endif
1694 #endif
1695
1696 int main() {
1697 char *p = (char *) alloca(1);
1698 ; return 0; }
1699 EOF
1700 if { (eval echo configure:1701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1701   rm -rf conftest*
1702   ac_cv_func_alloca_works=yes
1703 else
1704   echo "configure: failed program was:" >&5
1705   cat conftest.$ac_ext >&5
1706   rm -rf conftest*
1707   ac_cv_func_alloca_works=no
1708 fi
1709 rm -f conftest*
1710 fi
1711
1712 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
1713 if test $ac_cv_func_alloca_works = yes; then
1714   cat >> confdefs.h <<\EOF
1715 #define HAVE_ALLOCA 1
1716 EOF
1717
1718 fi
1719
1720 if test $ac_cv_func_alloca_works = no; then
1721   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
1722   # that cause trouble.  Some versions do not even contain alloca or
1723   # contain a buggy version.  If you still want to use their alloca,
1724   # use ar to extract alloca.o from them instead of compiling alloca.c.
1725   ALLOCA=alloca.${ac_objext}
1726   cat >> confdefs.h <<\EOF
1727 #define C_ALLOCA 1
1728 EOF
1729
1730
1731 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
1732 echo "configure:1733: checking whether alloca needs Cray hooks" >&5
1733 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
1734   echo $ac_n "(cached) $ac_c" 1>&6
1735 else
1736   cat > conftest.$ac_ext <<EOF
1737 #line 1738 "configure"
1738 #include "confdefs.h"
1739 #if defined(CRAY) && ! defined(CRAY2)
1740 webecray
1741 #else
1742 wenotbecray
1743 #endif
1744
1745 EOF
1746 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1747   egrep "webecray" >/dev/null 2>&1; then
1748   rm -rf conftest*
1749   ac_cv_os_cray=yes
1750 else
1751   rm -rf conftest*
1752   ac_cv_os_cray=no
1753 fi
1754 rm -f conftest*
1755
1756 fi
1757
1758 echo "$ac_t""$ac_cv_os_cray" 1>&6
1759 if test $ac_cv_os_cray = yes; then
1760 for ac_func in _getb67 GETB67 getb67; do
1761   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1762 echo "configure:1763: checking for $ac_func" >&5
1763 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1764   echo $ac_n "(cached) $ac_c" 1>&6
1765 else
1766   cat > conftest.$ac_ext <<EOF
1767 #line 1768 "configure"
1768 #include "confdefs.h"
1769 /* System header to define __stub macros and hopefully few prototypes,
1770     which can conflict with char $ac_func(); below.  */
1771 #include <assert.h>
1772 /* Override any gcc2 internal prototype to avoid an error.  */
1773 /* We use char because int might match the return type of a gcc2
1774     builtin and then its argument prototype would still apply.  */
1775 char $ac_func();
1776
1777 int main() {
1778
1779 /* The GNU C library defines this for functions which it implements
1780     to always fail with ENOSYS.  Some functions are actually named
1781     something starting with __ and the normal name is an alias.  */
1782 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1783 choke me
1784 #else
1785 $ac_func();
1786 #endif
1787
1788 ; return 0; }
1789 EOF
1790 if { (eval echo configure:1791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1791   rm -rf conftest*
1792   eval "ac_cv_func_$ac_func=yes"
1793 else
1794   echo "configure: failed program was:" >&5
1795   cat conftest.$ac_ext >&5
1796   rm -rf conftest*
1797   eval "ac_cv_func_$ac_func=no"
1798 fi
1799 rm -f conftest*
1800 fi
1801
1802 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1803   echo "$ac_t""yes" 1>&6
1804   cat >> confdefs.h <<EOF
1805 #define CRAY_STACKSEG_END $ac_func
1806 EOF
1807
1808   break
1809 else
1810   echo "$ac_t""no" 1>&6
1811 fi
1812
1813 done
1814 fi
1815
1816 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
1817 echo "configure:1818: checking stack direction for C alloca" >&5
1818 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
1819   echo $ac_n "(cached) $ac_c" 1>&6
1820 else
1821   if test "$cross_compiling" = yes; then
1822   ac_cv_c_stack_direction=0
1823 else
1824   cat > conftest.$ac_ext <<EOF
1825 #line 1826 "configure"
1826 #include "confdefs.h"
1827 find_stack_direction ()
1828 {
1829   static char *addr = 0;
1830   auto char dummy;
1831   if (addr == 0)
1832     {
1833       addr = &dummy;
1834       return find_stack_direction ();
1835     }
1836   else
1837     return (&dummy > addr) ? 1 : -1;
1838 }
1839 main ()
1840 {
1841   exit (find_stack_direction() < 0);
1842 }
1843 EOF
1844 if { (eval echo configure:1845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1845 then
1846   ac_cv_c_stack_direction=1
1847 else
1848   echo "configure: failed program was:" >&5
1849   cat conftest.$ac_ext >&5
1850   rm -fr conftest*
1851   ac_cv_c_stack_direction=-1
1852 fi
1853 rm -fr conftest*
1854 fi
1855
1856 fi
1857
1858 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
1859 cat >> confdefs.h <<EOF
1860 #define STACK_DIRECTION $ac_cv_c_stack_direction
1861 EOF
1862
1863 fi
1864
1865
1866
1867 for ac_hdr in \
1868         linux/cdrom.h \
1869
1870 do
1871 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1872 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1873 echo "configure:1874: checking for $ac_hdr" >&5
1874 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1875   echo $ac_n "(cached) $ac_c" 1>&6
1876 else
1877   cat > conftest.$ac_ext <<EOF
1878 #line 1879 "configure"
1879 #include "confdefs.h"
1880 #include <$ac_hdr>
1881 EOF
1882 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1883 { (eval echo configure:1884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1884 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1885 if test -z "$ac_err"; then
1886   rm -rf conftest*
1887   eval "ac_cv_header_$ac_safe=yes"
1888 else
1889   echo "$ac_err" >&5
1890   echo "configure: failed program was:" >&5
1891   cat conftest.$ac_ext >&5
1892   rm -rf conftest*
1893   eval "ac_cv_header_$ac_safe=no"
1894 fi
1895 rm -f conftest*
1896 fi
1897 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1898   echo "$ac_t""yes" 1>&6
1899     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1900   cat >> confdefs.h <<EOF
1901 #define $ac_tr_hdr 1
1902 EOF
1903  
1904 else
1905   echo "$ac_t""no" 1>&6
1906 fi
1907 done
1908
1909 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
1910 echo "configure:1911: checking whether stat file-mode macros are broken" >&5
1911 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
1912   echo $ac_n "(cached) $ac_c" 1>&6
1913 else
1914   cat > conftest.$ac_ext <<EOF
1915 #line 1916 "configure"
1916 #include "confdefs.h"
1917 #include <sys/types.h>
1918 #include <sys/stat.h>
1919
1920 #if defined(S_ISBLK) && defined(S_IFDIR)
1921 # if S_ISBLK (S_IFDIR)
1922 You lose.
1923 # endif
1924 #endif
1925
1926 #if defined(S_ISBLK) && defined(S_IFCHR)
1927 # if S_ISBLK (S_IFCHR)
1928 You lose.
1929 # endif
1930 #endif
1931
1932 #if defined(S_ISLNK) && defined(S_IFREG)
1933 # if S_ISLNK (S_IFREG)
1934 You lose.
1935 # endif
1936 #endif
1937
1938 #if defined(S_ISSOCK) && defined(S_IFREG)
1939 # if S_ISSOCK (S_IFREG)
1940 You lose.
1941 # endif
1942 #endif
1943
1944 EOF
1945 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1946   egrep "You lose" >/dev/null 2>&1; then
1947   rm -rf conftest*
1948   ac_cv_header_stat_broken=yes
1949 else
1950   rm -rf conftest*
1951   ac_cv_header_stat_broken=no
1952 fi
1953 rm -f conftest*
1954
1955 fi
1956
1957 echo "$ac_t""$ac_cv_header_stat_broken" 1>&6
1958 if test $ac_cv_header_stat_broken = yes; then
1959   cat >> confdefs.h <<\EOF
1960 #define STAT_MACROS_BROKEN 1
1961 EOF
1962
1963 fi
1964
1965
1966
1967 echo $ac_n "checking for working const""... $ac_c" 1>&6
1968 echo "configure:1969: checking for working const" >&5
1969 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1970   echo $ac_n "(cached) $ac_c" 1>&6
1971 else
1972   cat > conftest.$ac_ext <<EOF
1973 #line 1974 "configure"
1974 #include "confdefs.h"
1975
1976 int main() {
1977
1978 /* Ultrix mips cc rejects this.  */
1979 typedef int charset[2]; const charset x;
1980 /* SunOS 4.1.1 cc rejects this.  */
1981 char const *const *ccp;
1982 char **p;
1983 /* NEC SVR4.0.2 mips cc rejects this.  */
1984 struct point {int x, y;};
1985 static struct point const zero = {0,0};
1986 /* AIX XL C 1.02.0.0 rejects this.
1987    It does not let you subtract one const X* pointer from another in an arm
1988    of an if-expression whose if-part is not a constant expression */
1989 const char *g = "string";
1990 ccp = &g + (g ? g-g : 0);
1991 /* HPUX 7.0 cc rejects these. */
1992 ++ccp;
1993 p = (char**) ccp;
1994 ccp = (char const *const *) p;
1995 { /* SCO 3.2v4 cc rejects this.  */
1996   char *t;
1997   char const *s = 0 ? (char *) 0 : (char const *) 0;
1998
1999   *t++ = 0;
2000 }
2001 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
2002   int x[] = {25, 17};
2003   const int *foo = &x[0];
2004   ++foo;
2005 }
2006 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
2007   typedef const int *iptr;
2008   iptr p = 0;
2009   ++p;
2010 }
2011 { /* AIX XL C 1.02.0.0 rejects this saying
2012      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
2013   struct s { int j; const int *ap[3]; };
2014   struct s *b; b->j = 5;
2015 }
2016 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
2017   const int foo = 10;
2018 }
2019
2020 ; return 0; }
2021 EOF
2022 if { (eval echo configure:2023: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2023   rm -rf conftest*
2024   ac_cv_c_const=yes
2025 else
2026   echo "configure: failed program was:" >&5
2027   cat conftest.$ac_ext >&5
2028   rm -rf conftest*
2029   ac_cv_c_const=no
2030 fi
2031 rm -f conftest*
2032 fi
2033
2034 echo "$ac_t""$ac_cv_c_const" 1>&6
2035 if test $ac_cv_c_const = no; then
2036   cat >> confdefs.h <<\EOF
2037 #define const 
2038 EOF
2039
2040 fi
2041
2042 echo $ac_n "checking for inline""... $ac_c" 1>&6
2043 echo "configure:2044: checking for inline" >&5
2044 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
2045   echo $ac_n "(cached) $ac_c" 1>&6
2046 else
2047   ac_cv_c_inline=no
2048 for ac_kw in inline __inline__ __inline; do
2049   cat > conftest.$ac_ext <<EOF
2050 #line 2051 "configure"
2051 #include "confdefs.h"
2052
2053 int main() {
2054 } $ac_kw foo() {
2055 ; return 0; }
2056 EOF
2057 if { (eval echo configure:2058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2058   rm -rf conftest*
2059   ac_cv_c_inline=$ac_kw; break
2060 else
2061   echo "configure: failed program was:" >&5
2062   cat conftest.$ac_ext >&5
2063 fi
2064 rm -f conftest*
2065 done
2066
2067 fi
2068
2069 echo "$ac_t""$ac_cv_c_inline" 1>&6
2070 case "$ac_cv_c_inline" in
2071   inline | yes) ;;
2072   no) cat >> confdefs.h <<\EOF
2073 #define inline 
2074 EOF
2075  ;;
2076   *)  cat >> confdefs.h <<EOF
2077 #define inline $ac_cv_c_inline
2078 EOF
2079  ;;
2080 esac
2081
2082 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
2083 echo "configure:2084: checking for ANSI C header files" >&5
2084 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
2085   echo $ac_n "(cached) $ac_c" 1>&6
2086 else
2087   cat > conftest.$ac_ext <<EOF
2088 #line 2089 "configure"
2089 #include "confdefs.h"
2090 #include <stdlib.h>
2091 #include <stdarg.h>
2092 #include <string.h>
2093 #include <float.h>
2094 EOF
2095 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2096 { (eval echo configure:2097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2097 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2098 if test -z "$ac_err"; then
2099   rm -rf conftest*
2100   ac_cv_header_stdc=yes
2101 else
2102   echo "$ac_err" >&5
2103   echo "configure: failed program was:" >&5
2104   cat conftest.$ac_ext >&5
2105   rm -rf conftest*
2106   ac_cv_header_stdc=no
2107 fi
2108 rm -f conftest*
2109
2110 if test $ac_cv_header_stdc = yes; then
2111   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
2112 cat > conftest.$ac_ext <<EOF
2113 #line 2114 "configure"
2114 #include "confdefs.h"
2115 #include <string.h>
2116 EOF
2117 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2118   egrep "memchr" >/dev/null 2>&1; then
2119   :
2120 else
2121   rm -rf conftest*
2122   ac_cv_header_stdc=no
2123 fi
2124 rm -f conftest*
2125
2126 fi
2127
2128 if test $ac_cv_header_stdc = yes; then
2129   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
2130 cat > conftest.$ac_ext <<EOF
2131 #line 2132 "configure"
2132 #include "confdefs.h"
2133 #include <stdlib.h>
2134 EOF
2135 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2136   egrep "free" >/dev/null 2>&1; then
2137   :
2138 else
2139   rm -rf conftest*
2140   ac_cv_header_stdc=no
2141 fi
2142 rm -f conftest*
2143
2144 fi
2145
2146 if test $ac_cv_header_stdc = yes; then
2147   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
2148 if test "$cross_compiling" = yes; then
2149   :
2150 else
2151   cat > conftest.$ac_ext <<EOF
2152 #line 2153 "configure"
2153 #include "confdefs.h"
2154 #include <ctype.h>
2155 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
2156 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
2157 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
2158 int main () { int i; for (i = 0; i < 256; i++)
2159 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
2160 exit (0); }
2161
2162 EOF
2163 if { (eval echo configure:2164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2164 then
2165   :
2166 else
2167   echo "configure: failed program was:" >&5
2168   cat conftest.$ac_ext >&5
2169   rm -fr conftest*
2170   ac_cv_header_stdc=no
2171 fi
2172 rm -fr conftest*
2173 fi
2174
2175 fi
2176 fi
2177
2178 echo "$ac_t""$ac_cv_header_stdc" 1>&6
2179 if test $ac_cv_header_stdc = yes; then
2180   cat >> confdefs.h <<\EOF
2181 #define STDC_HEADERS 1
2182 EOF
2183
2184 fi
2185
2186 echo $ac_n "checking for size_t""... $ac_c" 1>&6
2187 echo "configure:2188: checking for size_t" >&5
2188 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
2189   echo $ac_n "(cached) $ac_c" 1>&6
2190 else
2191   cat > conftest.$ac_ext <<EOF
2192 #line 2193 "configure"
2193 #include "confdefs.h"
2194 #include <sys/types.h>
2195 #if STDC_HEADERS
2196 #include <stdlib.h>
2197 #include <stddef.h>
2198 #endif
2199 EOF
2200 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2201   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
2202   rm -rf conftest*
2203   ac_cv_type_size_t=yes
2204 else
2205   rm -rf conftest*
2206   ac_cv_type_size_t=no
2207 fi
2208 rm -f conftest*
2209
2210 fi
2211 echo "$ac_t""$ac_cv_type_size_t" 1>&6
2212 if test $ac_cv_type_size_t = no; then
2213   cat >> confdefs.h <<\EOF
2214 #define size_t unsigned
2215 EOF
2216
2217 fi
2218
2219 echo $ac_n "checking size of long long""... $ac_c" 1>&6
2220 echo "configure:2221: checking size of long long" >&5
2221 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
2222   echo $ac_n "(cached) $ac_c" 1>&6
2223 else
2224   if test "$cross_compiling" = yes; then
2225   ac_cv_sizeof_long_long=0
2226 else
2227   cat > conftest.$ac_ext <<EOF
2228 #line 2229 "configure"
2229 #include "confdefs.h"
2230 #include <stdio.h>
2231 main()
2232 {
2233   FILE *f=fopen("conftestval", "w");
2234   if (!f) exit(1);
2235   fprintf(f, "%d\n", sizeof(long long));
2236   exit(0);
2237 }
2238 EOF
2239 if { (eval echo configure:2240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2240 then
2241   ac_cv_sizeof_long_long=`cat conftestval`
2242 else
2243   echo "configure: failed program was:" >&5
2244   cat conftest.$ac_ext >&5
2245   rm -fr conftest*
2246   ac_cv_sizeof_long_long=0
2247 fi
2248 rm -fr conftest*
2249 fi
2250
2251 fi
2252 echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
2253 cat >> confdefs.h <<EOF
2254 #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
2255 EOF
2256
2257
2258
2259
2260 MAKE_NAME=Makefile
2261
2262
2263 trap '' 1 2 15
2264 cat > confcache <<\EOF
2265 # This file is a shell script that caches the results of configure
2266 # tests run on this system so they can be shared between configure
2267 # scripts and configure runs.  It is not useful on other systems.
2268 # If it contains results you don't want to keep, you may remove or edit it.
2269 #
2270 # By default, configure uses ./config.cache as the cache file,
2271 # creating it if it does not exist already.  You can give configure
2272 # the --cache-file=FILE option to use a different cache file; that is
2273 # what configure does when it calls configure scripts in
2274 # subdirectories, so they share the cache.
2275 # Giving --cache-file=/dev/null disables caching, for debugging configure.
2276 # config.status only pays attention to the cache file if you give it the
2277 # --recheck option to rerun configure.
2278 #
2279 EOF
2280 # The following way of writing the cache mishandles newlines in values,
2281 # but we know of no workaround that is simple, portable, and efficient.
2282 # So, don't put newlines in cache variables' values.
2283 # Ultrix sh set writes to stderr and can't be redirected directly,
2284 # and sets the high bit in the cache file unless we assign to the vars.
2285 (set) 2>&1 |
2286   case `(ac_space=' '; set | grep ac_space) 2>&1` in
2287   *ac_space=\ *)
2288     # `set' does not quote correctly, so add quotes (double-quote substitution
2289     # turns \\\\ into \\, and sed turns \\ into \).
2290     sed -n \
2291       -e "s/'/'\\\\''/g" \
2292       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2293     ;;
2294   *)
2295     # `set' quotes correctly as required by POSIX, so do not add quotes.
2296     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2297     ;;
2298   esac >> confcache
2299 if cmp -s $cache_file confcache; then
2300   :
2301 else
2302   if test -w $cache_file; then
2303     echo "updating cache $cache_file"
2304     cat confcache > $cache_file
2305   else
2306     echo "not updating unwritable cache $cache_file"
2307   fi
2308 fi
2309 rm -f confcache
2310
2311 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
2312
2313 test "x$prefix" = xNONE && prefix=$ac_default_prefix
2314 # Let make expand exec_prefix.
2315 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
2316
2317 # Any assignment to VPATH causes Sun make to only execute
2318 # the first set of double-colon rules, so remove it if not needed.
2319 # If there is a colon in the path, we need to keep it.
2320 if test "x$srcdir" = x.; then
2321   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
2322 fi
2323
2324 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
2325
2326 DEFS=-DHAVE_CONFIG_H
2327
2328 # Without the "./", some shells look in PATH for config.status.
2329 : ${CONFIG_STATUS=./config.status}
2330
2331 echo creating $CONFIG_STATUS
2332 rm -f $CONFIG_STATUS
2333 cat > $CONFIG_STATUS <<EOF
2334 #! /bin/sh
2335 # Generated automatically by configure.
2336 # Run this file to recreate the current configuration.
2337 # This directory was configured as follows,
2338 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2339 #
2340 # $0 $ac_configure_args
2341 #
2342 # Compiler output produced by configure, useful for debugging
2343 # configure, is in ./config.log if it exists.
2344
2345 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
2346 for ac_option
2347 do
2348   case "\$ac_option" in
2349   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
2350     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
2351     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
2352   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
2353     echo "$CONFIG_STATUS generated by autoconf version 2.13"
2354     exit 0 ;;
2355   -help | --help | --hel | --he | --h)
2356     echo "\$ac_cs_usage"; exit 0 ;;
2357   *) echo "\$ac_cs_usage"; exit 1 ;;
2358   esac
2359 done
2360
2361 ac_given_srcdir=$srcdir
2362
2363 trap 'rm -fr `echo "Makefile include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
2364 EOF
2365 cat >> $CONFIG_STATUS <<EOF
2366
2367 # Protect against being on the right side of a sed subst in config.status.
2368 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
2369  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
2370 $ac_vpsub
2371 $extrasub
2372 s%@SHELL@%$SHELL%g
2373 s%@CFLAGS@%$CFLAGS%g
2374 s%@CPPFLAGS@%$CPPFLAGS%g
2375 s%@CXXFLAGS@%$CXXFLAGS%g
2376 s%@FFLAGS@%$FFLAGS%g
2377 s%@DEFS@%$DEFS%g
2378 s%@LDFLAGS@%$LDFLAGS%g
2379 s%@LIBS@%$LIBS%g
2380 s%@exec_prefix@%$exec_prefix%g
2381 s%@prefix@%$prefix%g
2382 s%@program_transform_name@%$program_transform_name%g
2383 s%@bindir@%$bindir%g
2384 s%@sbindir@%$sbindir%g
2385 s%@libexecdir@%$libexecdir%g
2386 s%@datadir@%$datadir%g
2387 s%@sysconfdir@%$sysconfdir%g
2388 s%@sharedstatedir@%$sharedstatedir%g
2389 s%@localstatedir@%$localstatedir%g
2390 s%@libdir@%$libdir%g
2391 s%@includedir@%$includedir%g
2392 s%@oldincludedir@%$oldincludedir%g
2393 s%@infodir@%$infodir%g
2394 s%@mandir@%$mandir%g
2395 s%@GLHEXEN@%$GLHEXEN%g
2396 s%@SVGALIBS@%$SVGALIBS%g
2397 s%@CC@%$CC%g
2398 s%@CPP@%$CPP%g
2399 s%@BASELIBS@%$BASELIBS%g
2400 s%@ALLOCA@%$ALLOCA%g
2401 /@MAKE_RULES@/r $MAKE_RULES
2402 s%@MAKE_RULES@%%g
2403
2404 CEOF
2405 EOF
2406
2407 cat >> $CONFIG_STATUS <<\EOF
2408
2409 # Split the substitutions into bite-sized pieces for seds with
2410 # small command number limits, like on Digital OSF/1 and HP-UX.
2411 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
2412 ac_file=1 # Number of current file.
2413 ac_beg=1 # First line for current file.
2414 ac_end=$ac_max_sed_cmds # Line after last line for current file.
2415 ac_more_lines=:
2416 ac_sed_cmds=""
2417 while $ac_more_lines; do
2418   if test $ac_beg -gt 1; then
2419     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
2420   else
2421     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
2422   fi
2423   if test ! -s conftest.s$ac_file; then
2424     ac_more_lines=false
2425     rm -f conftest.s$ac_file
2426   else
2427     if test -z "$ac_sed_cmds"; then
2428       ac_sed_cmds="sed -f conftest.s$ac_file"
2429     else
2430       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
2431     fi
2432     ac_file=`expr $ac_file + 1`
2433     ac_beg=$ac_end
2434     ac_end=`expr $ac_end + $ac_max_sed_cmds`
2435   fi
2436 done
2437 if test -z "$ac_sed_cmds"; then
2438   ac_sed_cmds=cat
2439 fi
2440 EOF
2441
2442 cat >> $CONFIG_STATUS <<EOF
2443
2444 CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
2445 EOF
2446 cat >> $CONFIG_STATUS <<\EOF
2447 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
2448   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2449   case "$ac_file" in
2450   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2451        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2452   *) ac_file_in="${ac_file}.in" ;;
2453   esac
2454
2455   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
2456
2457   # Remove last slash and all that follows it.  Not all systems have dirname.
2458   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2459   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2460     # The file is in a subdirectory.
2461     test ! -d "$ac_dir" && mkdir "$ac_dir"
2462     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
2463     # A "../" for each directory in $ac_dir_suffix.
2464     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2465   else
2466     ac_dir_suffix= ac_dots=
2467   fi
2468
2469   case "$ac_given_srcdir" in
2470   .)  srcdir=.
2471       if test -z "$ac_dots"; then top_srcdir=.
2472       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2473   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2474   *) # Relative path.
2475     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2476     top_srcdir="$ac_dots$ac_given_srcdir" ;;
2477   esac
2478
2479
2480   echo creating "$ac_file"
2481   rm -f "$ac_file"
2482   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
2483   case "$ac_file" in
2484   *Makefile*) ac_comsub="1i\\
2485 # $configure_input" ;;
2486   *) ac_comsub= ;;
2487   esac
2488
2489   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2490   sed -e "$ac_comsub
2491 s%@configure_input@%$configure_input%g
2492 s%@srcdir@%$srcdir%g
2493 s%@top_srcdir@%$top_srcdir%g
2494 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
2495 fi; done
2496 rm -f conftest.s*
2497
2498 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
2499 # NAME is the cpp macro being defined and VALUE is the value it is being given.
2500 #
2501 # ac_d sets the value in "#define NAME VALUE" lines.
2502 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
2503 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
2504 ac_dC='\3'
2505 ac_dD='%g'
2506 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
2507 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
2508 ac_uB='\([      ]\)%\1#\2define\3'
2509 ac_uC=' '
2510 ac_uD='\4%g'
2511 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
2512 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
2513 ac_eB='$%\1#\2define\3'
2514 ac_eC=' '
2515 ac_eD='%g'
2516
2517 if test "${CONFIG_HEADERS+set}" != set; then
2518 EOF
2519 cat >> $CONFIG_STATUS <<EOF
2520   CONFIG_HEADERS="include/config.h"
2521 EOF
2522 cat >> $CONFIG_STATUS <<\EOF
2523 fi
2524 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
2525   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2526   case "$ac_file" in
2527   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2528        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2529   *) ac_file_in="${ac_file}.in" ;;
2530   esac
2531
2532   echo creating $ac_file
2533
2534   rm -f conftest.frag conftest.in conftest.out
2535   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2536   cat $ac_file_inputs > conftest.in
2537
2538 EOF
2539
2540 # Transform confdefs.h into a sed script conftest.vals that substitutes
2541 # the proper values into config.h.in to produce config.h.  And first:
2542 # Protect against being on the right side of a sed subst in config.status.
2543 # Protect against being in an unquoted here document in config.status.
2544 rm -f conftest.vals
2545 cat > conftest.hdr <<\EOF
2546 s/[\\&%]/\\&/g
2547 s%[\\$`]%\\&%g
2548 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
2549 s%ac_d%ac_u%gp
2550 s%ac_u%ac_e%gp
2551 EOF
2552 sed -n -f conftest.hdr confdefs.h > conftest.vals
2553 rm -f conftest.hdr
2554
2555 # This sed command replaces #undef with comments.  This is necessary, for
2556 # example, in the case of _POSIX_SOURCE, which is predefined and required
2557 # on some systems where configure will not decide to define it.
2558 cat >> conftest.vals <<\EOF
2559 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
2560 EOF
2561
2562 # Break up conftest.vals because some shells have a limit on
2563 # the size of here documents, and old seds have small limits too.
2564
2565 rm -f conftest.tail
2566 while :
2567 do
2568   ac_lines=`grep -c . conftest.vals`
2569   # grep -c gives empty output for an empty file on some AIX systems.
2570   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
2571   # Write a limited-size here document to conftest.frag.
2572   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
2573   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
2574   echo 'CEOF
2575   sed -f conftest.frag conftest.in > conftest.out
2576   rm -f conftest.in
2577   mv conftest.out conftest.in
2578 ' >> $CONFIG_STATUS
2579   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
2580   rm -f conftest.vals
2581   mv conftest.tail conftest.vals
2582 done
2583 rm -f conftest.vals
2584
2585 cat >> $CONFIG_STATUS <<\EOF
2586   rm -f conftest.frag conftest.h
2587   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
2588   cat conftest.in >> conftest.h
2589   rm -f conftest.in
2590   if cmp -s $ac_file conftest.h 2>/dev/null; then
2591     echo "$ac_file is unchanged"
2592     rm -f conftest.h
2593   else
2594     # Remove last slash and all that follows it.  Not all systems have dirname.
2595       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2596       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2597       # The file is in a subdirectory.
2598       test ! -d "$ac_dir" && mkdir "$ac_dir"
2599     fi
2600     rm -f $ac_file
2601     mv conftest.h $ac_file
2602   fi
2603 fi; done
2604
2605 EOF
2606 cat >> $CONFIG_STATUS <<EOF
2607
2608 EOF
2609 cat >> $CONFIG_STATUS <<\EOF
2610
2611 exit 0
2612 EOF
2613 chmod +x $CONFIG_STATUS
2614 rm -fr confdefs* $ac_clean_files
2615 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
2616
2617
2618 if test "$HAVESVGA" = "no"
2619 then
2620   echo
2621   echo "Warning: It appears that you do not have SvgaLib installed on your system"
2622   echo "         If you want to compile with SvgaLib support, you will need to"
2623   echo "         download the library from 'http://www.svgalib.org'."
2624 fi
2625
2626 if test "$HAVEX11" = "no"
2627 then
2628   echo
2629   echo "Warning: Configure did not find some necessary libraries for an X11"
2630   echo "         build.  Perhaps you do not have X11 installed correctly."
2631   echo "         Until this problem is resolved, you won't be able to compile"
2632   echo "         the X11 or OpenGL versions."
2633   HAVEGL="yes"
2634 fi
2635
2636 if test "$HAVEGL" = "no"
2637 then
2638     echo
2639     echo "Warning: Configure was not able to find your OpenGL libraries."
2640     echo "         Perhaps you do not have them installed correctly. Until"
2641     echo "         this problem is resolved, you won't be able to compile"
2642     echo "         the OpenGL version of HHexen."
2643 fi
2644
2645 if test "$GLHEXEN" = "true"
2646 then
2647   echo
2648   echo "Configure finished.  Do 'make clean', then 'make' to build the OpenGL version."
2649   echo
2650 else
2651   echo
2652   echo "Configure finished. Do 'make clean', then 'make x11' or 'make svgalib' to build"
2653   echo
2654 fi