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