[project @ 2000-09-07 11:23:59 by rrt]
[ghc-hetmet.git] / ghc / rts / gmp / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.129
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using Autoconf version 2.14a.
5 # Copyright (C) 1992, 93, 94, 95, 96, 98, 99, 2000
6 # 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_default_prefix=/usr/local
13 # Any additions from configure.in:
14
15 # Initialize some variables set by options.
16 ac_init_help=false
17 ac_init_version=false
18 # The variables have the same names as the options, with
19 # dashes changed to underlines.
20 build=NONE
21 cache_file=./config.cache
22 exec_prefix=NONE
23 host=NONE
24 no_create=
25 nonopt=NONE
26 no_recursion=
27 prefix=NONE
28 program_prefix=NONE
29 program_suffix=NONE
30 program_transform_name=s,x,x,
31 silent=
32 site=
33 srcdir=
34 target=NONE
35 verbose=
36 x_includes=NONE
37 x_libraries=NONE
38 bindir='${exec_prefix}/bin'
39 sbindir='${exec_prefix}/sbin'
40 libexecdir='${exec_prefix}/libexec'
41 datadir='${prefix}/share'
42 sysconfdir='${prefix}/etc'
43 sharedstatedir='${prefix}/com'
44 localstatedir='${prefix}/var'
45 libdir='${exec_prefix}/lib'
46 includedir='${prefix}/include'
47 oldincludedir='/usr/include'
48 infodir='${prefix}/info'
49 mandir='${prefix}/man'
50
51 # Initialize some other variables.
52 subdirs=
53 MFLAGS= MAKEFLAGS=
54 SHELL=${CONFIG_SHELL-/bin/sh}
55 # Maximum number of lines to put in a shell here document.
56 : ${ac_max_here_lines=48}
57 # Sed expression to map a string onto a valid sh and CPP variable names.
58 ac_tr_sh='sed -e y%*+%pp%;s%[^a-zA-Z0-9_]%_%g'
59 ac_tr_cpp='sed -e y%*abcdefghijklmnopqrstuvwxyz%PABCDEFGHIJKLMNOPQRSTUVWXYZ%;s%[^A-Z0-9_]%_%g'
60
61 ac_prev=
62 for ac_option
63 do
64   # If the previous option needs an argument, assign it.
65   if test -n "$ac_prev"; then
66     eval "$ac_prev=\$ac_option"
67     ac_prev=
68     continue
69   fi
70
71   ac_optarg=`echo "$ac_option" | sed -n 's/^[^=]*=//p'`
72
73   # Accept the important Cygnus configure options, so we can diagnose typos.
74
75   case "$ac_option" in
76
77   -bindir | --bindir | --bindi | --bind | --bin | --bi)
78     ac_prev=bindir ;;
79   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
80     bindir="$ac_optarg" ;;
81
82   -build | --build | --buil | --bui | --bu)
83     ac_prev=build ;;
84   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
85     build="$ac_optarg" ;;
86
87   -cache-file | --cache-file | --cache-fil | --cache-fi \
88   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
89     ac_prev=cache_file ;;
90   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
91   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
92     cache_file="$ac_optarg" ;;
93
94   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
95     ac_prev=datadir ;;
96   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
97   | --da=*)
98     datadir="$ac_optarg" ;;
99
100   -disable-* | --disable-*)
101     ac_feature=`echo "$ac_option"|sed -e 's/-*disable-//'`
102     # Reject names that are not valid shell variable names.
103     if echo "$ac_feature" | grep '[^-a-zA-Z0-9_]' >/dev/null 2>&1; then
104       { echo "configure: error: invalid feature: $ac_feature" 1>&2; exit 1; }
105     fi
106     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
107     eval "enable_${ac_feature}=no" ;;
108
109   -enable-* | --enable-*)
110     ac_feature=`echo "$ac_option"|sed -e 's/-*enable-//' -e 's/=.*//'`
111     # Reject names that are not valid shell variable names.
112     if echo "$ac_feature" | grep '[^-a-zA-Z0-9_]' >/dev/null 2>&1; then
113       { echo "configure: error: invalid feature: $ac_feature" 1>&2; exit 1; }
114     fi
115     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
116     case "$ac_option" in
117       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
118       *) ac_optarg=yes ;;
119     esac
120     eval "enable_${ac_feature}='$ac_optarg'" ;;
121
122   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
123   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
124   | --exec | --exe | --ex)
125     ac_prev=exec_prefix ;;
126   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
127   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
128   | --exec=* | --exe=* | --ex=*)
129     exec_prefix="$ac_optarg" ;;
130
131   -gas | --gas | --ga | --g)
132     # Obsolete; use --with-gas.
133     with_gas=yes ;;
134
135   -help | --help | --hel | --he | -h)
136     ac_init_help=: ;;
137   -host | --host | --hos | --ho)
138     ac_prev=host ;;
139   -host=* | --host=* | --hos=* | --ho=*)
140     host="$ac_optarg" ;;
141
142   -includedir | --includedir | --includedi | --included | --include \
143   | --includ | --inclu | --incl | --inc)
144     ac_prev=includedir ;;
145   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
146   | --includ=* | --inclu=* | --incl=* | --inc=*)
147     includedir="$ac_optarg" ;;
148
149   -infodir | --infodir | --infodi | --infod | --info | --inf)
150     ac_prev=infodir ;;
151   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
152     infodir="$ac_optarg" ;;
153
154   -libdir | --libdir | --libdi | --libd)
155     ac_prev=libdir ;;
156   -libdir=* | --libdir=* | --libdi=* | --libd=*)
157     libdir="$ac_optarg" ;;
158
159   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
160   | --libexe | --libex | --libe)
161     ac_prev=libexecdir ;;
162   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
163   | --libexe=* | --libex=* | --libe=*)
164     libexecdir="$ac_optarg" ;;
165
166   -localstatedir | --localstatedir | --localstatedi | --localstated \
167   | --localstate | --localstat | --localsta | --localst \
168   | --locals | --local | --loca | --loc | --lo)
169     ac_prev=localstatedir ;;
170   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
171   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
172   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
173     localstatedir="$ac_optarg" ;;
174
175   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
176     ac_prev=mandir ;;
177   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
178     mandir="$ac_optarg" ;;
179
180   -nfp | --nfp | --nf)
181     # Obsolete; use --without-fp.
182     with_fp=no ;;
183
184   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
185   | --no-cr | --no-c)
186     no_create=yes ;;
187
188   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
189   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
190     no_recursion=yes ;;
191
192   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
193   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
194   | --oldin | --oldi | --old | --ol | --o)
195     ac_prev=oldincludedir ;;
196   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
197   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
198   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
199     oldincludedir="$ac_optarg" ;;
200
201   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
202     ac_prev=prefix ;;
203   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
204     prefix="$ac_optarg" ;;
205
206   -program-prefix | --program-prefix | --program-prefi | --program-pref \
207   | --program-pre | --program-pr | --program-p)
208     ac_prev=program_prefix ;;
209   -program-prefix=* | --program-prefix=* | --program-prefi=* \
210   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
211     program_prefix="$ac_optarg" ;;
212
213   -program-suffix | --program-suffix | --program-suffi | --program-suff \
214   | --program-suf | --program-su | --program-s)
215     ac_prev=program_suffix ;;
216   -program-suffix=* | --program-suffix=* | --program-suffi=* \
217   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
218     program_suffix="$ac_optarg" ;;
219
220   -program-transform-name | --program-transform-name \
221   | --program-transform-nam | --program-transform-na \
222   | --program-transform-n | --program-transform- \
223   | --program-transform | --program-transfor \
224   | --program-transfo | --program-transf \
225   | --program-trans | --program-tran \
226   | --progr-tra | --program-tr | --program-t)
227     ac_prev=program_transform_name ;;
228   -program-transform-name=* | --program-transform-name=* \
229   | --program-transform-nam=* | --program-transform-na=* \
230   | --program-transform-n=* | --program-transform-=* \
231   | --program-transform=* | --program-transfor=* \
232   | --program-transfo=* | --program-transf=* \
233   | --program-trans=* | --program-tran=* \
234   | --progr-tra=* | --program-tr=* | --program-t=*)
235     program_transform_name="$ac_optarg" ;;
236
237   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
238   | -silent | --silent | --silen | --sile | --sil)
239     silent=yes ;;
240
241   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
242     ac_prev=sbindir ;;
243   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
244   | --sbi=* | --sb=*)
245     sbindir="$ac_optarg" ;;
246
247   -sharedstatedir | --sharedstatedir | --sharedstatedi \
248   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
249   | --sharedst | --shareds | --shared | --share | --shar \
250   | --sha | --sh)
251     ac_prev=sharedstatedir ;;
252   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
253   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
254   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
255   | --sha=* | --sh=*)
256     sharedstatedir="$ac_optarg" ;;
257
258   -site | --site | --sit)
259     ac_prev=site ;;
260   -site=* | --site=* | --sit=*)
261     site="$ac_optarg" ;;
262
263   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
264     ac_prev=srcdir ;;
265   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
266     srcdir="$ac_optarg" ;;
267
268   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
269   | --syscon | --sysco | --sysc | --sys | --sy)
270     ac_prev=sysconfdir ;;
271   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
272   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
273     sysconfdir="$ac_optarg" ;;
274
275   -target | --target | --targe | --targ | --tar | --ta | --t)
276     ac_prev=target ;;
277   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
278     target="$ac_optarg" ;;
279
280   -v | -verbose | --verbose | --verbos | --verbo | --verb)
281     verbose=yes ;;
282
283   -version | --version | --versio | --versi | --vers | -V)
284     ac_init_version=: ;;
285
286   -with-* | --with-*)
287     ac_package=`echo "$ac_option"|sed -e 's/-*with-//' -e 's/=.*//'`
288     # Reject names that are not valid shell variable names.
289     if echo "$ac_package" | grep '[^-a-zA-Z0-9_]' >/dev/null 2>&1; then
290       { echo "configure: error: invalid package: $ac_package" 1>&2; exit 1; }
291     fi
292     ac_package=`echo $ac_package| sed 's/-/_/g'`
293     case "$ac_option" in
294       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
295       *) ac_optarg=yes ;;
296     esac
297     eval "with_${ac_package}='$ac_optarg'" ;;
298
299   -without-* | --without-*)
300     ac_package=`echo "$ac_option"|sed -e 's/-*without-//'`
301     # Reject names that are not valid shell variable names.
302     if echo "$ac_package" | grep '[^-a-zA-Z0-9_]' >/dev/null 2>&1; then
303       { echo "configure: error: invalid package: $ac_package" 1>&2; exit 1; }
304     fi
305     ac_package=`echo $ac_package| sed 's/-/_/g'`
306     eval "with_${ac_package}=no" ;;
307
308   --x)
309     # Obsolete; use --with-x.
310     with_x=yes ;;
311
312   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
313   | --x-incl | --x-inc | --x-in | --x-i)
314     ac_prev=x_includes ;;
315   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
316   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
317     x_includes="$ac_optarg" ;;
318
319   -x-libraries | --x-libraries | --x-librarie | --x-librari \
320   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
321     ac_prev=x_libraries ;;
322   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
323   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
324     x_libraries="$ac_optarg" ;;
325
326   -*) { echo "configure: error: unrecognized option: $ac_option
327 Try \`configure --help' for more information." 1>&2; exit 1; }
328     ;;
329
330   *=*)
331     ac_envvar=`echo "$ac_option" | sed -e 's/=.*//'`
332     # Reject names that are not valid shell variable names.
333     if echo "$ac_envvar" | grep '[^a-zA-Z0-9_]' >/dev/null 2>&1; then
334       { echo "configure: error: invalid variable name: $ac_envvar" 1>&2; exit 1; }
335     fi
336     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
337     eval "$ac_envvar='$ac_optarg'"
338     export $ac_envvar ;;
339
340   *)
341     if echo "$ac_option" | grep '[^-a-zA-Z0-9.]' >/dev/null 2>&1; then
342       echo "configure: warning: invalid host type: $ac_option" 1>&2
343     fi
344     if test "x$nonopt" != xNONE; then
345       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
346     fi
347     nonopt="$ac_option"
348     ;;
349
350   esac
351 done
352
353 if test -n "$ac_prev"; then
354   { echo "configure: error: missing argument to --\`echo $ac_prev | sed 's/_/-/g'\`" 1>&2; exit 1; }
355 fi
356 if $ac_init_help; then
357   # Omit some internal or obsolete options to make the list less imposing.
358   # This message is too long to be a string in the A/UX 3.1 sh.
359   cat <<\EOF
360 `configure' configures software source code packages to adapt to many kinds
361 of systems.
362
363 Usage: configure [OPTION]... [VAR=VALUE]... [HOST]
364
365 To safely assign special values to environment variables (e.g., CC,
366 CFLAGS...), give to `configure' the definition as VAR=VALUE.
367
368 Defaults for the options are specified in brackets.
369
370 Configuration:
371   -h, --help              print this message
372   -V, --version           print the version of autoconf that created configure
373   -q, --quiet, --silent   do not print `checking...' messages
374       --cache-file=FILE   cache test results in FILE
375   -n, --no-create         do not create output files
376
377 EOF
378
379   cat <<EOF
380 Directories:
381   --prefix=PREFIX         install architecture-independent files in PREFIX
382                           [$ac_default_prefix]
383   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
384                           [same as prefix]
385   --bindir=DIR            user executables in DIR [EPREFIX/bin]
386   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
387   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
388   --datadir=DIR           read-only architecture-independent data in DIR
389                           [PREFIX/share]
390   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
391   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
392                           [PREFIX/com]
393   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
394   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
395   --includedir=DIR        C header files in DIR [PREFIX/include]
396   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
397   --infodir=DIR           info documentation in DIR [PREFIX/info]
398   --mandir=DIR            man documentation in DIR [PREFIX/man]
399   --srcdir=DIR            find the sources in DIR [configure dir or ..]
400 EOF
401
402   cat <<\EOF
403
404 Host type:
405   --build=BUILD      configure for building on BUILD [BUILD=HOST]
406   --host=HOST        configure for HOST [guessed]
407   --target=TARGET    configure for TARGET [TARGET=HOST]
408 EOF
409
410   cat <<\EOF
411
412 Program names:
413   --program-prefix=PREFIX            prepend PREFIX to installed program names
414   --program-suffix=SUFFIX            append SUFFIX to installed program names
415   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
416
417 Optional Features:
418   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
419   --enable-FEATURE=ARG  include FEATURE ARG=yes
420   --disable-dependency-tracking Speeds up one-time builds
421   --enable-dependency-tracking  Do not reject slow dependency extractors
422   --enable-maintainer-mode enable make rules and dependencies not useful
423                           (and sometimes confusing) to the casual installer
424   --enable-assert         enable ASSERT checking default=no
425   --enable-alloca         use alloca for temp space default=yes
426   --enable-fft            enable FFTs for multiplication default=no
427   --enable-mpbsd          build Berkley MP compatibility library default=no
428   --enable-mpfr           build MPFR default=no
429   --enable-shared=PKGS  build shared libraries default=yes
430   --enable-static=PKGS  build static libraries default=yes
431   --enable-fast-install=PKGS  optimize for fast installation default=yes
432   --disable-libtool-lock  avoid locking (might break parallel builds)
433
434 Optional Packages:
435   --with-PACKAGE=ARG    use PACKAGE ARG=yes
436   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
437   --with-gnu-ld           assume the C compiler uses GNU ld default=no
438   --with-pic              try to use only PIC/non-PIC objects default=use both
439 EOF
440   exit 0
441 fi
442 if $ac_init_version; then
443   cat <<\EOF
444 Generated automatically using Autoconf version 2.14a.
445 Copyright (C) 1992, 93, 94, 95, 96, 98, 99, 2000
446 Free Software Foundation, Inc.
447
448 This configure script is free software; the Free Software Foundation
449 gives unlimited permission to copy, distribute and modify it.
450 EOF
451   exit 0
452 fi
453 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
454
455 # Keep a trace of the command line.
456 # Strip out --no-create and --no-recursion so they do not pile up.
457 # Also quote any args containing shell meta-characters.
458 ac_configure_args=
459 for ac_arg
460 do
461   case "$ac_arg" in
462   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
463   | --no-cr | --no-c) ;;
464   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
465   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
466   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
467   ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
468   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
469   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
470   esac
471 done
472
473 # File descriptor usage:
474 # 0 standard input
475 # 1 file creation
476 # 2 errors and warnings
477 # 3 some systems may open it to /dev/tty
478 # 4 used on the Kubota Titan
479 # 6 checking for... messages and results
480 # 5 compiler messages saved in config.log
481 if test "$silent" = yes; then
482   exec 6>/dev/null
483 else
484   exec 6>&1
485 fi
486 exec 5>./config.log
487
488 echo "\
489 This file contains any messages produced by compilers while
490 running configure, to aid debugging if configure makes a mistake.
491
492 It was created by configure version 2.14a, executed with
493  > $0 $ac_configure_args
494 " 1>&5
495
496 # NLS nuisances.
497 # Only set these to C if already set.  These must not be set unconditionally
498 # because not all systems understand e.g. LANG=C (notably SCO).
499 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
500 # Non-C LC_CTYPE values break the ctype check.
501 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
502 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
503 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
504 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
505
506 # confdefs.h avoids OS command line length limits that DEFS can exceed.
507 rm -rf conftest* confdefs.h
508 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
509 echo >confdefs.h
510
511 # A filename unique to this package, relative to the directory that
512 # configure is in, which we can look for to find out if srcdir is correct.
513 ac_unique_file=
514
515 # Find the source files, if location was not specified.
516 if test -z "$srcdir"; then
517   ac_srcdir_defaulted=yes
518   # Try the directory containing this script, then its parent.
519   ac_prog=$0
520   ac_confdir=`echo "$ac_prog" | sed 's%/[^/][^/]*$%%'`
521   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
522   srcdir=$ac_confdir
523   if test ! -r $srcdir/$ac_unique_file; then
524     srcdir=..
525   fi
526 else
527   ac_srcdir_defaulted=no
528 fi
529 if test ! -r $srcdir/$ac_unique_file; then
530   if test "$ac_srcdir_defaulted" = yes; then
531     { echo "configure: error: cannot find sources in $ac_confdir or .." 1>&2; exit 1; }
532   else
533     { echo "configure: error: cannot find sources in $srcdir" 1>&2; exit 1; }
534   fi
535 fi
536 srcdir=`echo "$srcdir" | sed 's%\([^/]\)/*$%\1%'`
537
538 # Prefer explicitly selected file to automatically selected ones.
539 if test -z "$CONFIG_SITE"; then
540   if test "x$prefix" != xNONE; then
541     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
542   else
543     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
544   fi
545 fi
546 for ac_site_file in $CONFIG_SITE; do
547   if test -r "$ac_site_file"; then
548     echo "loading site script $ac_site_file"
549     . "$ac_site_file"
550   fi
551 done
552
553 if test -r "$cache_file"; then
554   echo "loading cache $cache_file"
555       test -f "$cache_file" && . $cache_file
556 else
557   echo "creating cache $cache_file"
558   >$cache_file
559 fi
560
561 ac_ext=c
562 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
563 ac_cpp='$CPP $CPPFLAGS'
564 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
565 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
566 cross_compiling=$ac_cv_prog_cc_cross
567
568 ac_exeext=
569 ac_objext=o
570 # Factoring default headers for most tests.
571 ac_includes_default="\
572 #include <stdio.h>
573 #include <sys/types.h>
574 #if STDC_HEADERS
575 # include <stdlib.h>
576 # include <stddef.h>
577 #else
578 # if HAVE_STDLIB_H
579 #  include <stdlib.h>
580 # endif
581 #endif
582 #if HAVE_STRING_H
583 # if !STDC_HEADERS && HAVE_MEMORY_H
584 #  include <memory.h>
585 # endif
586 # include <string.h>
587 #else
588 # if HAVE_STRINGS_H
589 #  include <strings.h>
590 # endif
591 #endif
592 #if HAVE_INTTYPES_H
593 # include <inttypes.h>
594 #endif
595 #if HAVE_UNISTD_H
596 # include <unistd.h>
597 #endif"
598
599 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
600   # Stardent Vistra SVR4 grep lacks -e, says Kaveh R. Ghazi.
601   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
602     ECHO_N= ECHO_C='
603 ' ECHO_T='      '
604   else
605     ECHO_N=-n ECHO_C= ECHO_T=
606   fi
607 else
608   ECHO_N= ECHO_C='\c' ECHO_T=
609 fi
610
611 ac_aux_dir=
612 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
613   if test -f $ac_dir/install-sh; then
614     ac_aux_dir=$ac_dir
615     ac_install_sh="$ac_aux_dir/install-sh -c"
616     break
617   elif test -f $ac_dir/install.sh; then
618     ac_aux_dir=$ac_dir
619     ac_install_sh="$ac_aux_dir/install.sh -c"
620     break
621   elif test -f $ac_dir/shtool; then
622     ac_aux_dir=$ac_dir
623     ac_install_sh="$ac_aux_dir/shtool install -c"
624     break
625   fi
626 done
627 if test -z "$ac_aux_dir"; then
628   { echo "configure: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
629 fi
630 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
631 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
632 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
633
634 echo $ECHO_N "checking host system type... $ECHO_C" 1>&6
635 echo "configure:636: checking host system type" 1>&5
636 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
637
638   # Make sure we can run config.sub.
639   if $ac_config_sub sun4 >/dev/null 2>&1; then :; else
640     { echo "configure: error: cannot run $ac_config_sub" 1>&2; exit 1; }
641   fi
642
643   ac_cv_host_alias=$host
644   case "$ac_cv_host_alias" in
645   NONE)
646     case $nonopt in
647     NONE)
648       if ac_cv_host_alias=`$ac_config_guess`; then :
649       else { echo "configure: error: cannot guess host type; you must specify one" 1>&2; exit 1; }
650       fi ;;    *) ac_cv_host_alias=$nonopt ;;
651     esac ;;
652   esac
653
654   ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || exit 1
655   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
656   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
657   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
658 else
659   echo $ECHO_N "(cached) $ECHO_C" 1>&6
660 fi
661
662 echo "$ECHO_T""$ac_cv_host" 1>&6
663
664 host=$ac_cv_host
665 host_alias=$ac_cv_host_alias
666 host_cpu=$ac_cv_host_cpu
667 host_vendor=$ac_cv_host_vendor
668 host_os=$ac_cv_host_os
669
670 echo $ECHO_N "checking target system type... $ECHO_C" 1>&6
671 echo "configure:672: checking target system type" 1>&5
672 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
673
674   # Make sure we can run config.sub.
675   if $ac_config_sub sun4 >/dev/null 2>&1; then :; else
676     { echo "configure: error: cannot run $ac_config_sub" 1>&2; exit 1; }
677   fi
678
679   ac_cv_target_alias=$target
680   case "$ac_cv_target_alias" in
681   NONE)
682     case $nonopt in
683     NONE)
684       ac_cv_target_alias=$host_alias ;;
685     *) ac_cv_target_alias=$nonopt ;;
686     esac ;;
687   esac
688
689   ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || exit 1
690   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
691   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
692   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
693 else
694   echo $ECHO_N "(cached) $ECHO_C" 1>&6
695 fi
696
697 echo "$ECHO_T""$ac_cv_target" 1>&6
698
699 target=$ac_cv_target
700 target_alias=$ac_cv_target_alias
701 target_cpu=$ac_cv_target_cpu
702 target_vendor=$ac_cv_target_vendor
703 target_os=$ac_cv_target_os
704
705 echo $ECHO_N "checking build system type... $ECHO_C" 1>&6
706 echo "configure:707: checking build system type" 1>&5
707 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
708
709   # Make sure we can run config.sub.
710   if $ac_config_sub sun4 >/dev/null 2>&1; then :; else
711     { echo "configure: error: cannot run $ac_config_sub" 1>&2; exit 1; }
712   fi
713
714   ac_cv_build_alias=$build
715   case "$ac_cv_build_alias" in
716   NONE)
717     case $nonopt in
718     NONE)
719       ac_cv_build_alias=$host_alias ;;
720     *) ac_cv_build_alias=$nonopt ;;
721     esac ;;
722   esac
723
724   ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || exit 1
725   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
726   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
727   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
728 else
729   echo $ECHO_N "(cached) $ECHO_C" 1>&6
730 fi
731
732 echo "$ECHO_T""$ac_cv_build" 1>&6
733
734 build=$ac_cv_build
735 build_alias=$ac_cv_build_alias
736 build_cpu=$ac_cv_build_cpu
737 build_vendor=$ac_cv_build_vendor
738 build_os=$ac_cv_build_os
739
740 # Do some error checking and defaulting for the host and target type.
741 # The inputs are:
742 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
743 #
744 # The rules are:
745 # 1. You are not allowed to specify --host, --target, and nonopt at the
746 #    same time.
747 # 2. Host defaults to nonopt.
748 # 3. If nonopt is not specified, then host defaults to the current host,
749 #    as determined by config.guess.
750 # 4. Target and build default to nonopt.
751 # 5. If nonopt is not specified, then target and build default to host.
752
753 # The aliases save the names the user supplied, while $host etc.
754 # will get canonicalized.
755 case $host---$target---$nonopt in
756 NONE---*---* | *---NONE---* | *---*---NONE) ;;
757 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
758 esac
759
760 test "$host_alias" != "$target_alias" &&
761   test "$program_prefix$program_suffix$program_transform_name" = \
762     NONENONEs,x,x, &&
763   program_prefix=${target_alias}-
764
765 # Find a good install program.  We prefer a C program (faster),
766 # so one script is as good as another.  But avoid the broken or
767 # incompatible versions:
768 # SysV /etc/install, /usr/sbin/install
769 # SunOS /usr/etc/install
770 # IRIX /sbin/install
771 # AIX /bin/install
772 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
773 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
774 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
775 # ./install, which can be erroneously created by make from ./install.sh.
776 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" 1>&6
777 echo "configure:778: checking for a BSD compatible install" 1>&5
778 if test -z "$INSTALL"; then
779 if test "${ac_cv_path_install+set}" = set; then
780   echo $ECHO_N "(cached) $ECHO_C" 1>&6
781 else
782     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
783   for ac_dir in $PATH; do
784     # Account for people who put trailing slashes in PATH elements.
785     case "$ac_dir/" in
786     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
787     *)
788       # OSF1 and SCO ODT 3.0 have their own names for install.
789       # Don't use installbsd from OSF since it installs stuff as root
790       # by default.
791       for ac_prog in ginstall scoinst install; do
792         if test -f $ac_dir/$ac_prog; then
793           if test $ac_prog = install &&
794             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
795             # AIX install.  It has an incompatible calling convention.
796             :
797           elif test $ac_prog = install &&
798             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
799             # program-specific install script used by HP pwplus--don't use.
800             :
801           else
802             ac_cv_path_install="$ac_dir/$ac_prog -c"
803             break 2
804           fi
805         fi
806       done
807       ;;
808     esac
809   done
810   IFS="$ac_save_IFS"
811
812 fi
813   if test "${ac_cv_path_install+set}" = set; then
814     INSTALL="$ac_cv_path_install"
815   else
816     # As a last resort, use the slow shell script.  We don't cache a
817     # path for INSTALL within a source directory, because that will
818     # break other packages using the cache if that directory is
819     # removed, or if the path is relative.
820     INSTALL="$ac_install_sh"
821   fi
822 fi
823 echo "$ECHO_T""$INSTALL" 1>&6
824
825 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
826 # It thinks the first close brace ends the variable substitution.
827 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
828
829 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
830
831 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
832
833 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" 1>&6
834 echo "configure:835: checking whether build environment is sane" 1>&5
835 # Just in case
836 sleep 1
837 echo timestamp > conftestfile
838 # Do `set' in a subshell so we don't clobber the current shell's
839 # arguments.  Must try -L first in case configure is actually a
840 # symlink; some systems play weird games with the mod time of symlinks
841 # (eg FreeBSD returns the mod time of the symlink's containing
842 # directory).
843 if (
844    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
845    if test "$*" = "X"; then
846       # -L didn't work.
847       set X `ls -t $srcdir/configure conftestfile`
848    fi
849    if test "$*" != "X $srcdir/configure conftestfile" \
850       && test "$*" != "X conftestfile $srcdir/configure"; then
851
852       # If neither matched, then we have a broken ls.  This can happen
853       # if, for instance, CONFIG_SHELL is bash and it inherits a
854       # broken ls alias from the environment.  This has actually
855       # happened.  Such a system could not be considered "sane".
856       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
857 alias in your environment" 1>&2; exit 1; }
858    fi
859
860    test "$2" = conftestfile
861    )
862 then
863    # Ok.
864    :
865 else
866    { echo "configure: error: newly created file is older than distributed files!
867 Check your system clock" 1>&2; exit 1; }
868 fi
869 rm -f conftest*
870 echo "$ECHO_T""yes" 1>&6
871 if test "$program_transform_name" = s,x,x,; then
872   program_transform_name=
873 else
874   # Double any \ or $.  echo might interpret backslashes.
875   cat <<\EOF >conftestsed
876 s,\\,\\\\,g; s,\$,$$,g
877 EOF
878   program_transform_name=`echo $program_transform_name | sed -f conftestsed`
879   rm -f conftestsed
880 fi
881 test "$program_prefix" != NONE &&
882   program_transform_name="s,^,${program_prefix},;$program_transform_name"
883 # Use a double $ so make ignores it.
884 test "$program_suffix" != NONE &&
885   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
886
887 # sed with no file args requires a program.
888 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
889
890 test x"${MISSING+set}" = xset || \
891   MISSING="\${SHELL} `CDPATH=: && cd $ac_aux_dir && pwd`/missing"
892 if eval "$MISSING --run :"; then
893   am_missing_run="$MISSING --run "
894 else
895   am_missing_run=
896   am_backtick='`'
897   echo "configure: warning: ${am_backtick}missing' script is too old or missing" 1>&2
898 fi
899
900 for ac_prog in mawk gawk nawk awk
901 do
902 # Extract the first word of "$ac_prog", so it can be a program name with args.
903 set dummy $ac_prog; ac_word=$2
904 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
905 echo "configure:906: checking for $ac_word" 1>&5
906 if test "${ac_cv_prog_AWK+set}" = set; then
907   echo $ECHO_N "(cached) $ECHO_C" 1>&6
908 else
909   if test -n "$AWK"; then
910   ac_cv_prog_AWK="$AWK" # Let the user override the test.
911 else
912   for ac_path in `IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
913 ac_dummy="$PATH"
914 for ac_dir in $ac_dummy; do
915   test -z "$ac_dir" && ac_dir=.
916   if test -f $ac_dir/$ac_word; then
917     echo "$ac_dir/$ac_word"
918   fi
919 done
920 IFS="$ac_save_ifs"
921 `; do
922     ac_cv_prog_AWK="$ac_prog"
923     break
924   done
925 fi
926 fi
927 AWK="$ac_cv_prog_AWK"
928 if test -n "$AWK"; then
929   echo "$ECHO_T""$AWK" 1>&6
930 else
931   echo "$ECHO_T""no" 1>&6
932 fi
933
934 test -n "$AWK" && break
935 done
936
937 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" 1>&6
938 echo "configure:939: checking whether ${MAKE-make} sets \${MAKE}" 1>&5
939 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
940 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
941   echo $ECHO_N "(cached) $ECHO_C" 1>&6
942 else
943   cat >conftestmake <<\EOF
944 all:
945         @echo 'ac_maketemp="${MAKE}"'
946 EOF
947 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
948 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
949 if test -n "$ac_maketemp"; then
950   eval ac_cv_prog_make_${ac_make}_set=yes
951 else
952   eval ac_cv_prog_make_${ac_make}_set=no
953 fi
954 rm -f conftestmake
955 fi
956 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
957   echo "$ECHO_T""yes" 1>&6
958   SET_MAKE=
959 else
960   echo "$ECHO_T""no" 1>&6
961   SET_MAKE="MAKE=${MAKE-make}"
962 fi
963
964 # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
965 if test "${enable_dependency_tracking+set}" = set; then
966   enableval="$enable_dependency_tracking"
967
968 fi
969 if test "x$enable_dependency_tracking" = xno; then
970   AMDEP="#"
971 else
972   am_depcomp="$ac_aux_dir/depcomp"
973   if test ! -f "$am_depcomp"; then
974     AMDEP="#"
975   else
976     AMDEP=
977   fi
978 fi
979
980 if test -z "$AMDEP"; then
981   AMDEPBACKSLASH='\'
982 else
983   AMDEPBACKSLASH=
984 fi
985
986 if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
987   DEPDIR=.deps
988 else
989   DEPDIR=_deps
990 fi
991
992 PACKAGE=gmp
993
994 VERSION=3.1
995
996 if test "`CDPATH=: && cd $srcdir && pwd`" != "`pwd`" &&
997    test -f $srcdir/config.status; then
998   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
999 fi
1000 cat >>confdefs.h <<EOF
1001 #define PACKAGE "$PACKAGE"
1002 EOF
1003
1004 cat >>confdefs.h <<EOF
1005 #define VERSION "$VERSION"
1006 EOF
1007
1008 ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"}
1009
1010 AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
1011
1012 AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake"}
1013
1014 AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
1015
1016 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
1017
1018 AMTAR=${AMTAR-"${am_missing_run}tar"}
1019
1020 if test -z "$install_sh"; then
1021    install_sh="$ac_aux_dir/install-sh"
1022    test -f "$install_sh" || install_sh="$ac_aux_dir/install.sh"
1023    test -f "$install_sh" || install_sh="${am_missing_run}${ac_auxdir}/install-sh"
1024          install_sh="`echo $install_sh | sed -e 's/\${SHELL}//'`"
1025 fi
1026
1027 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" 1>&6
1028 echo "configure:1029: checking whether to enable maintainer-specific portions of Makefiles" 1>&5
1029     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
1030 if test "${enable_maintainer_mode+set}" = set; then
1031   enableval="$enable_maintainer_mode"
1032   USE_MAINTAINER_MODE=$enableval
1033 else
1034   USE_MAINTAINER_MODE=no
1035 fi
1036   echo "$ECHO_T""$USE_MAINTAINER_MODE" 1>&6
1037
1038 if test $USE_MAINTAINER_MODE = yes; then
1039   MAINTAINER_MODE_TRUE=
1040   MAINTAINER_MODE_FALSE='#'
1041 else
1042   MAINTAINER_MODE_TRUE='#'
1043   MAINTAINER_MODE_FALSE=
1044 fi
1045   MAINT=$MAINTAINER_MODE_TRUE
1046
1047 gmp_configm4="config.m4"
1048 gmp_tmpconfigm4=cnfm4.tmp
1049 gmp_tmpconfigm4i=cnfm4i.tmp
1050 gmp_tmpconfigm4p=cnfm4p.tmp
1051 test -f $gmp_tmpconfigm4 && rm $gmp_tmpconfigm4
1052 test -f $gmp_tmpconfigm4i && rm $gmp_tmpconfigm4i
1053 test -f $gmp_tmpconfigm4p && rm $gmp_tmpconfigm4p
1054
1055 # Check whether --enable-assert or --disable-assert was given.
1056 if test "${enable_assert+set}" = set; then
1057   enableval="$enable_assert"
1058   case "${enableval}" in
1059 yes|no) ;;
1060 *) { echo "configure: error: bad value ${enableval} for --enable-assert, need yes or no" 1>&2; exit 1; } ;;
1061 esac
1062 else
1063   enable_assert=no
1064 fi
1065
1066 if test "$enable_assert" = "yes"; then
1067   cat >>confdefs.h <<\EOF
1068 #define WANT_ASSERT 1
1069 EOF
1070
1071 fi
1072
1073 # Check whether --enable-alloca or --disable-alloca was given.
1074 if test "${enable_alloca+set}" = set; then
1075   enableval="$enable_alloca"
1076   case "${enableval}" in
1077 yes|no) ;;
1078 *) { echo "configure: error: bad value ${enableval} for --enable-alloca, need yes or no" 1>&2; exit 1; } ;;
1079 esac
1080 else
1081   enable_alloca=yes
1082 fi
1083
1084 if test "$enable_alloca" = "no"; then
1085   cat >>confdefs.h <<\EOF
1086 #define USE_STACK_ALLOC 1
1087 EOF
1088
1089 fi
1090
1091 # Check whether --enable-fft or --disable-fft was given.
1092 if test "${enable_fft+set}" = set; then
1093   enableval="$enable_fft"
1094   case "${enableval}" in
1095 yes|no) ;;
1096 *) { echo "configure: error: bad value ${enableval} for --enable-fft, need yes or no" 1>&2; exit 1; } ;;
1097 esac
1098 else
1099   enable_fft=no
1100 fi
1101
1102 if test "$enable_fft" = "yes"; then
1103   cat >>confdefs.h <<\EOF
1104 #define WANT_FFT 1
1105 EOF
1106
1107 fi
1108
1109 # Check whether --enable-mpbsd or --disable-mpbsd was given.
1110 if test "${enable_mpbsd+set}" = set; then
1111   enableval="$enable_mpbsd"
1112   case "${enableval}" in
1113 yes|no) ;;
1114 *) { echo "configure: error: bad value ${enableval} for --enable-mpbsd, need yes or no" 1>&2; exit 1; } ;;
1115 esac
1116 else
1117   enable_mpbsd=no
1118 fi
1119
1120 if test "$enable_mpbsd" = "yes"; then
1121   WANT_MPBSD_TRUE=
1122   WANT_MPBSD_FALSE='#'
1123 else
1124   WANT_MPBSD_TRUE='#'
1125   WANT_MPBSD_FALSE=
1126 fi
1127
1128 # Check whether --enable-mpfr or --disable-mpfr was given.
1129 if test "${enable_mpfr+set}" = set; then
1130   enableval="$enable_mpfr"
1131   case "${enableval}" in
1132 yes|no) ;;
1133 *) { echo "configure: error: bad value ${enableval} for --enable-mpfr, need yes or no" 1>&2; exit 1; } ;;
1134 esac
1135 else
1136   enable_mpfr=no
1137 fi
1138
1139 if test "$enable_mpfr" = "yes"; then
1140   WANT_MPFR_TRUE=
1141   WANT_MPFR_FALSE='#'
1142 else
1143   WANT_MPFR_TRUE='#'
1144   WANT_MPFR_FALSE=
1145 fi
1146
1147 os_64bit="no"
1148 cclist="gcc cc"         # FIXME: Prefer c89 to cc.
1149 gmp_cflags_gcc="-g -O2"
1150 gmp_cflags64_gcc="-g -O2"
1151 gmp_cflags_cc="-g"
1152 gmp_cflags64_cc="-g"
1153
1154 case "$target" in
1155   # Alpha
1156   alpha*-cray-unicos*)
1157     # Don't perform any assembly syntax tests on this beast.
1158     gmp_no_asm_syntax_testing=yes
1159     cclist=cc
1160     gmp_cflags_cc="$gmp_cflags_cc -O"
1161     ;;
1162   alpha*-*-osf*)
1163     flavour=`echo $target_cpu | sed 's/^alpha//g'`
1164     if test -n "$flavour"; then
1165       case $flavour in     # compilers don't seem to understand `ev67' and such.
1166         ev6? | ev7*) flavour=ev6;;
1167       esac
1168       gmp_optcflags_gcc="-mcpu=$flavour"
1169       # FIXME: We shouldn't fail fatally if none of these work, but that's
1170       # how xoptcflags work and we don't have any other mechanism right now.
1171       # Why do we need this here and not for alpha*-*-* below?
1172       gmp_xoptcflags_gcc="-Wa,-arch,${flavour} -Wa,-m${flavour}"
1173       gmp_optcflags_cc="-arch $flavour -tune $flavour"
1174     fi
1175     ;;
1176   alpha*-*-*)
1177     cclist="gcc"
1178     flavour=`echo $target_cpu | sed 's/^alpha//g'`
1179     if test -n "$flavour"; then
1180       case $flavour in
1181         ev6? | ev7*) flavour=ev6;;
1182       esac
1183       gmp_optcflags_gcc="-mcpu=$flavour"
1184     fi
1185     ;;
1186   # Cray vector machines.  This must come after alpha* so that we can
1187   # recognize present and future vector processors with a wildcard.
1188   *-cray-unicos*)
1189     # Don't perform any assembly syntax tests on this beast.
1190     gmp_no_asm_syntax_testing=yes
1191     cclist=cc
1192     # Don't inherit default gmp_cflags_cc value; it comes with -g which
1193     # disables all optimization on Cray vector systems
1194     gmp_cflags_cc="-O"
1195     ;;
1196
1197   # AMD and Intel x86 configurations
1198   i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-*)
1199     # Rumour has it -O2 used to give worse register allocation than just -O.
1200     gmp_cflags_gcc="-g -O -fomit-frame-pointer"
1201
1202     case "${target}" in
1203       i386*-*-*)    gmp_optcflags_gcc="-mcpu=i386 -march=i386";;
1204       i486*-*-*)    gmp_optcflags_gcc="-mcpu=i486 -march=i486";;
1205       i586*-*-* | pentium-*-* | pentiummmx-*-*)
1206                     gmp_optcflags_gcc="-mcpu=pentium -march=pentium";;
1207
1208       # -march=pentiumpro not used because mpz/powm.c (swox cvs rev 1.4)
1209       # tickles a bug in gcc 2.95.2 (believed fixed in 2.96).
1210       i686*-*-* | pentiumpro-*-* | pentium[23]-*-*)
1211                     gmp_optcflags_gcc="-mcpu=pentiumpro";;
1212
1213       k6*-*-*)      gmp_optcflags_gcc="-mcpu=k6 -march=k6";;
1214
1215       # Athlon instruction costs are close to p6: 3 cycle load latency, 4-6
1216       # cycle mul, 40 cycle div, pairable adc, ...
1217       # FIXME: Change this when gcc gets something specific for Athlon.
1218       # -march=pentiumpro not used, per i686 above.
1219       athlon-*-*)   gmp_optcflags_gcc="-mcpu=pentiumpro";;
1220     esac
1221     ;;
1222
1223   # Sparc
1224   ultrasparc*-*-solaris2.[7-9] | sparcv9-*-solaris2.[7-9])
1225     os_64bit=yes
1226     gmp_cflags_gcc="$gmp_cflags_gcc -Wa,-xarch=v8plus"
1227     gmp_xoptcflags_gcc="-mcpu=v9 -mcpu=v8 -mv8"
1228     gmp_cflags64_gcc="$gmp_cflags64_gcc -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9"
1229     gmp_cflags_cc="-xtarget=native -xarch=v8 -xO4"
1230     gmp_cflags64_cc="-xtarget=native -xarch=v9 -xO4"
1231     ;;
1232   sparc64-*-linux*)
1233     os_64bit=yes
1234     gmp_cflags64_gcc="$gmp_cflags64_gcc -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9"
1235     gmp_cflags_gcc="$gmp_cflags_gcc -m32"
1236     gmp_xoptflags_gcc="-mcpu=ultrasparc -mvis"
1237     ;;
1238   ultrasparc*-*-* | sparcv9-*-*)
1239     gmp_cflags_gcc="$gmp_cflags_gcc -Wa,-xarch=v8plus"
1240     gmp_xoptcflags_gcc="-mcpu=v9 -mcpu=v8 -mv8"
1241     gmp_cflags_cc="-xtarget=native -xarch=v8 -xO4"
1242     ;;
1243   sparcv8*-*-solaris2.* | microsparc*-*-solaris2.*)
1244     gmp_cflags_gcc="$gmp_cflags_gcc"
1245     gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
1246     gmp_cflags_cc="-xtarget=native -xarch=v8 -xO4"
1247     ;;
1248   sparcv8*-*-* | microsparc*-*-*)               # SunOS, Linux, *BSD
1249     cclist="gcc acc cc"
1250     gmp_cflags_gcc="$gmp_cflags_gcc"
1251     gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
1252     gmp_cflags_acc="-g -O2 -cg92"
1253     gmp_cflags_cc="-O2"         # FIXME: Flag for v8?
1254     ;;
1255   supersparc*-*-solaris2.*)
1256     gmp_cflags_gcc="$gmp_cflags_gcc -DSUPERSPARC"
1257     gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
1258     gmp_cflags_cc="-xtarget=native -xarch=v8 -xO4 -DSUPERSPARC"
1259     ;;
1260   supersparc*-*-*)              # SunOS, Linux, *BSD
1261     cclist="gcc acc cc"
1262     gmp_cflags_gcc="$gmp_cflags_gcc -DSUPERSPARC"
1263     gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
1264     gmp_cflags_acc="-g -O2 -cg92 -DSUPERSPARC"
1265     gmp_cflags_cc="-O2 -DSUPERSPARC"    # FIXME: Flag for v8?
1266     ;;
1267   *sparc*-*-*)
1268     cclist="gcc acc cc"
1269     gmp_cflags_acc="-g -O2"
1270     gmp_cflags_cc="-g -O2"
1271     ;;
1272
1273   # POWER/PowerPC
1274   powerpc64-*-aix*)
1275     cclist="gcc xlc"
1276     gmp_cflags_gcc="$gmp_cflags_gcc -maix64 -mpowerpc64"
1277     gmp_cflags_xlc="-g -O2 -q64 -qtune=pwr3"
1278     ;;
1279   powerpc*-*-aix*)
1280     cclist="gcc xlc"
1281     gmp_cflags_gcc="$gmp_cflags_gcc -mpowerpc"
1282     gmp_cflags_xlc="$gmp_cflags_cc -qarch=ppc -O2"
1283     ;;
1284   power-*-aix*)
1285     cclist="gcc xlc"
1286     gmp_cflags_gcc="$gmp_cflags_gcc -mpower"
1287     gmp_cflags_xlc="$gmp_cflags_cc -qarch=pwr -O2"
1288     ;;
1289   powerpc64*-*-*)
1290     gmp_cflags_gcc="$gmp_cflags_gcc -mpowerpc64"
1291     cat >>confdefs.h <<\EOF
1292 #define _LONG_LONG_LIMB 1
1293 EOF
1294             ;;
1295   powerpc*-*-*)
1296     gmp_cflags_gcc="$gmp_cflags_gcc -mpowerpc"
1297     ;;
1298
1299   # MIPS
1300   mips-sgi-irix6.*)
1301     os_64bit=yes
1302     gmp_cflags64_gcc="-g -O2 -mabi=n32"
1303     gmp_cflags64_cc="$gmp_cflags64_cc -O2 -n32"
1304     ;;
1305
1306   # Motorola 68k family
1307   m88110*-*-*)
1308     gmp_cflags_gcc="-g -O -m88110"          ;;
1309   m68*-*-*)
1310     gmp_cflags_gcc="$gmp_cflags_gcc -fomit-frame-pointer"
1311     ;;
1312
1313   # HP
1314   hppa1.0*-*-*)
1315     cclist="gcc c89 cc"
1316     gmp_cflags_c89="$gmp_cflags_cc +O2"
1317     gmp_cflags_cc="$gmp_cflags_cc +O2"
1318     ;;
1319   hppa2.0w*-*-*)
1320     cclist="c89 cc"
1321     gmp_cflags_c89="+DD64 +O3"
1322     gmp_cflags_cc="+DD64 +O3"
1323     ;;
1324   hppa2.0*-*-*)
1325     os_64bit=yes
1326     cclist="gcc c89 cc"
1327     gmp_cflags64_gcc="$gmp_cflags64_gcc -mWHAT -D_LONG_LONG_LIMB"
1328     # +O2 to cc triggers bug in mpz/powm.c (1.4)
1329     gmp_cflags64_c89="+DA2.0 +e +O3 -D_LONG_LONG_LIMB"
1330     gmp_cflags64_cc="+DA2.0 +e +O3 -D_LONG_LONG_LIMB"
1331     gmp_cflags_c89="$gmp_cflags_cc +O2"
1332     gmp_cflags_cc="$gmp_cflags_cc +O2"
1333     ;;
1334
1335   # VAX
1336   vax*-*-*)
1337     gmp_cflags_gcc="$gmp_cflags_gcc -fomit-frame-pointer"
1338     ;;
1339
1340   # Fujitsu
1341   f30[01]-fujitsu-sysv*)
1342     cclist="gcc vcc"
1343     gmp_cflags_vcc="-g"         # FIXME: flags for vcc?
1344     ;;
1345 esac
1346
1347 case "${target}" in
1348   *-*-mingw32) gmp_cflags_gcc="$gmp_cflags_gcc -mno-cygwin";;
1349 esac
1350
1351 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" 1>&6
1352 echo "configure:1349: checking for BSD-compatible nm" 1>&5
1353 if test "${ac_cv_path_NM+set}" = set; then
1354   echo $ECHO_N "(cached) $ECHO_C" 1>&6
1355 else
1356   if test -n "$NM"; then
1357   # Let the user override the test.
1358   ac_cv_path_NM="$NM"
1359 else
1360   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1361   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1362     test -z "$ac_dir" && ac_dir=.
1363     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
1364       # Check to see if the nm accepts a BSD-compat flag.
1365       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1366       #   nm: unknown option "B" ignored
1367       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1368         ac_cv_path_NM="$ac_dir/nm -B"
1369         break
1370       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1371         ac_cv_path_NM="$ac_dir/nm -p"
1372         break
1373       else
1374         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
1375         continue # so that we can try to find one that supports BSD flags
1376       fi
1377     fi
1378   done
1379   IFS="$ac_save_ifs"
1380   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1381 fi
1382 fi
1383
1384 NM="$ac_cv_path_NM"
1385 echo "$ECHO_T""$NM" 1>&6
1386         # nm on 64-bit AIX needs to know the object file format
1387 case "$target" in
1388   powerpc64*-*-aix*)
1389     NM="$NM -X 64"
1390     ;;
1391 esac
1392
1393 # Save CFLAGS given on command line.
1394 gmp_user_CFLAGS="$CFLAGS"
1395
1396 if test -z "$CC"; then
1397   # Find compiler.
1398
1399 if test $host != $build; then
1400   ac_tool_prefix=${host_alias}-
1401 else
1402   ac_tool_prefix=
1403 fi
1404
1405 gmp_cc_list="$cclist"
1406 gmp_req_64bit_cc="$os_64bit"
1407
1408 CC32=
1409 CC64=
1410 for c in $gmp_cc_list; do
1411   # Avoid cache hits.
1412   unset CC
1413   unset ac_cv_prog_CC
1414
1415 # Extract the first word of "${ac_tool_prefix}$c", so it can be a program name with args.
1416 set dummy ${ac_tool_prefix}$c; ac_word=$2
1417 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
1418 echo "configure:1415: checking for $ac_word" 1>&5
1419 if test "${ac_cv_prog_CC+set}" = set; then
1420   echo $ECHO_N "(cached) $ECHO_C" 1>&6
1421 else
1422   if test -n "$CC"; then
1423   ac_cv_prog_CC="$CC" # Let the user override the test.
1424 else
1425   for ac_path in `IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1426 ac_dummy="$PATH"
1427 for ac_dir in $ac_dummy; do
1428   test -z "$ac_dir" && ac_dir=.
1429   if test -f $ac_dir/$ac_word; then
1430     echo "$ac_dir/$ac_word"
1431   fi
1432 done
1433 IFS="$ac_save_ifs"
1434 `; do
1435     ac_cv_prog_CC="${ac_tool_prefix}$c"
1436     break
1437   done
1438 fi
1439 fi
1440 CC="$ac_cv_prog_CC"
1441 if test -n "$CC"; then
1442   echo "$ECHO_T""$CC" 1>&6
1443 else
1444   echo "$ECHO_T""no" 1>&6
1445 fi
1446
1447 if test -z "$ac_cv_prog_CC"; then
1448   if test -n "$ac_tool_prefix"; then
1449     # Extract the first word of "$c", so it can be a program name with args.
1450 set dummy $c; ac_word=$2
1451 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
1452 echo "configure:1449: checking for $ac_word" 1>&5
1453 if test "${ac_cv_prog_CC+set}" = set; then
1454   echo $ECHO_N "(cached) $ECHO_C" 1>&6
1455 else
1456   if test -n "$CC"; then
1457   ac_cv_prog_CC="$CC" # Let the user override the test.
1458 else
1459   for ac_path in `IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1460 ac_dummy="$PATH"
1461 for ac_dir in $ac_dummy; do
1462   test -z "$ac_dir" && ac_dir=.
1463   if test -f $ac_dir/$ac_word; then
1464     echo "$ac_dir/$ac_word"
1465   fi
1466 done
1467 IFS="$ac_save_ifs"
1468 `; do
1469     ac_cv_prog_CC="$c"
1470     break
1471   done
1472   test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="$c"
1473 fi
1474 fi
1475 CC="$ac_cv_prog_CC"
1476 if test -n "$CC"; then
1477   echo "$ECHO_T""$CC" 1>&6
1478 else
1479   echo "$ECHO_T""no" 1>&6
1480 fi
1481
1482   else
1483     CC="$c"
1484   fi
1485 fi
1486
1487   if test -n "$CC"; then
1488     eval c_flags=\$gmp_cflags_$c
1489     ac_ext=c
1490 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1491 ac_cpp='$CPP $CPPFLAGS'
1492 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1493 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1494 cross_compiling=$ac_cv_prog_cc_cross
1495         CC="$CC"
1496 CFLAGS="$c_flags"
1497 echo $ECHO_N "checking if the C compiler ($CC) works with flags $CFLAGS... $ECHO_C" 1>&6
1498 echo "configure:1495: checking if the C compiler ($CC) works with flags $CFLAGS" 1>&5
1499
1500 # Simple test for all targets.
1501 cat >conftest.$ac_ext <<EOF
1502
1503 #line 1500 "configure"
1504 #include "confdefs.h"
1505
1506 int main(){return(0);}
1507 EOF
1508 if { (eval echo configure:1505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1509   tmp_works=yes
1510   # If we can't run a trivial program, we are probably using a cross compiler.
1511   if (./conftest; exit) 2>/dev/null; then
1512     tmp_cross=no
1513   else
1514     tmp_cross=yes
1515   fi
1516 else
1517   echo "configure: failed program was:" >&5
1518   cat conftest.$ac_ext >&5
1519   tmp_works=no
1520 fi
1521 rm -fr conftest*
1522
1523 # Target specific tests.
1524 if test "$tmp_works" = "yes"; then
1525   case "$target" in
1526     *-*-aix*)   # Returning a funcptr.
1527       cat >conftest.$ac_ext <<EOF
1528 #line 1525 "configure"
1529 #include "confdefs.h"
1530
1531 int
1532 main ()
1533 {
1534 } void *g(); void *f() { return g(); } int bar(){
1535   ;
1536   return 0;
1537 }
1538 EOF
1539 if { (eval echo configure:1536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1540   rm -rf conftest*
1541   tmp_works=yes
1542 else
1543   echo "configure: failed program was:" >&5
1544   cat conftest.$ac_ext >&5
1545   rm -rf conftest*
1546   tmp_works=no
1547 fi
1548 rm -f conftest*
1549       ;;
1550   esac
1551 fi
1552
1553 if test "$tmp_works" = "yes"; then
1554   gmp_prog_cc_works=yes
1555 else
1556   gmp_prog_cc_works=no
1557 fi
1558
1559 echo "$ECHO_T""$tmp_works" 1>&6
1560
1561     if test "$gmp_prog_cc_works" != "yes"; then
1562       continue
1563     fi
1564
1565     # Save first working compiler, whether 32- or 64-bit capable.
1566     if test -z "$CC32"; then
1567       CC32="$CC"
1568     fi
1569     if test "$gmp_req_64bit_cc" = "yes"; then
1570       eval c_flags=\$gmp_cflags64_$c
1571
1572       # Verify that the compiler works in 64-bit mode as well.
1573       # /usr/ucb/cc on Solaris 7 can *compile* in 64-bit mode, but not link.
1574       ac_ext=c
1575 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1576 ac_cpp='$CPP $CPPFLAGS'
1577 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1578 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1579 cross_compiling=$ac_cv_prog_cc_cross
1580         CC="$c"
1581 CFLAGS="$c_flags"
1582 echo $ECHO_N "checking if the C compiler ($CC) works with flags $CFLAGS... $ECHO_C" 1>&6
1583 echo "configure:1580: checking if the C compiler ($CC) works with flags $CFLAGS" 1>&5
1584
1585 # Simple test for all targets.
1586 cat >conftest.$ac_ext <<EOF
1587
1588 #line 1585 "configure"
1589 #include "confdefs.h"
1590
1591 int main(){return(0);}
1592 EOF
1593 if { (eval echo configure:1590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1594   tmp_works=yes
1595   # If we can't run a trivial program, we are probably using a cross compiler.
1596   if (./conftest; exit) 2>/dev/null; then
1597     tmp_cross=no
1598   else
1599     tmp_cross=yes
1600   fi
1601 else
1602   echo "configure: failed program was:" >&5
1603   cat conftest.$ac_ext >&5
1604   tmp_works=no
1605 fi
1606 rm -fr conftest*
1607
1608 # Target specific tests.
1609 if test "$tmp_works" = "yes"; then
1610   case "$target" in
1611     *-*-aix*)   # Returning a funcptr.
1612       cat >conftest.$ac_ext <<EOF
1613 #line 1610 "configure"
1614 #include "confdefs.h"
1615
1616 int
1617 main ()
1618 {
1619 } void *g(); void *f() { return g(); } int bar(){
1620   ;
1621   return 0;
1622 }
1623 EOF
1624 if { (eval echo configure:1621: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1625   rm -rf conftest*
1626   tmp_works=yes
1627 else
1628   echo "configure: failed program was:" >&5
1629   cat conftest.$ac_ext >&5
1630   rm -rf conftest*
1631   tmp_works=no
1632 fi
1633 rm -f conftest*
1634       ;;
1635   esac
1636 fi
1637
1638 if test "$tmp_works" = "yes"; then
1639   gmp_prog_cc_works=yes
1640 else
1641   gmp_prog_cc_works=no
1642 fi
1643
1644 echo "$ECHO_T""$tmp_works" 1>&6
1645
1646       if test "$gmp_prog_cc_works" = "yes"; then
1647
1648   gmp_tmp_CC_save="$CC"
1649   CC="$c"
1650   echo $ECHO_N "checking whether the C compiler ($CC) is 64-bit capable... $ECHO_C" 1>&6
1651 echo "configure:1648: checking whether the C compiler ($CC) is 64-bit capable" 1>&5
1652   if test -z "$NM"; then
1653     echo; echo "configure: GMP_CHECK_CC_64BIT: fatal: need nm"
1654     exit 1
1655   fi
1656   gmp_tmp_CFLAGS_save="$CFLAGS"
1657   CFLAGS="$c_flags"
1658
1659   case "$target" in
1660     hppa2.0*-*-*)
1661       # FIXME: If gcc is installed under another name than "gcc", we will
1662       # test the wrong thing.
1663       if test "$CC" != "gcc"; then
1664                                                 echo >conftest.c
1665         gmp_tmp_vs=`$CC $CFLAGS -V -c -o conftest.o conftest.c 2>&1 | grep "^ccom:"`
1666         rm conftest*
1667         gmp_tmp_v1=`echo $gmp_tmp_vs | sed 's/.* .\.\(.*\)\..*\..* HP C.*/\1/'`
1668         gmp_tmp_v2=`echo $gmp_tmp_vs | sed 's/.* .\..*\.\(.*\)\..* HP C.*/\1/'`
1669         gmp_tmp_v3=`echo $gmp_tmp_vs | sed 's/.* .\..*\..*\.\(.*\) HP C.*/\1/'`
1670         gmp_cv_cc_64bit=no
1671         test -n "$gmp_tmp_v1" && test "$gmp_tmp_v1" -ge "10" \
1672           && test -n "$gmp_tmp_v2" && test "$gmp_tmp_v2" -ge "32" \
1673           && test -n "$gmp_tmp_v3" && test "$gmp_tmp_v3" -ge "30" \
1674           && gmp_cv_cc_64bit=yes
1675       else      # gcc
1676         # FIXME: Compile a minimal file and determine if the resulting object
1677         # file is an ELF file.  If so, gcc can produce 64-bit code.
1678         # Do we have file(1) for target?
1679         gmp_cv_cc_64bit=no
1680       fi
1681       ;;
1682     mips-sgi-irix6.*)
1683       # We use `-n32' to cc and `-mabi=n32' to gcc, resulting in 64-bit
1684       # arithmetic but not 64-bit pointers, so the general test for sizeof
1685       # (void *) is not valid.
1686       # Simply try to compile an empty main.  If that succeeds return
1687       # true.
1688       cat >conftest.$ac_ext <<EOF
1689 #line 1686 "configure"
1690 #include "confdefs.h"
1691
1692 int
1693 main ()
1694 {
1695
1696   ;
1697   return 0;
1698 }
1699 EOF
1700 if { (eval echo configure:1697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1701   rm -rf conftest*
1702   gmp_cv_cc_64bit=yes
1703 else
1704   echo "configure: failed program was:" >&5
1705   cat conftest.$ac_ext >&5
1706   rm -rf conftest*
1707   gmp_cv_cc_64bit=no
1708 fi
1709 rm -f conftest*
1710       ;;
1711     *-*-*)
1712       # Allocate an array of size sizeof (void *) and use nm to determine its
1713       # size.  We depend on the first declared variable being put at address 0.
1714       cat >conftest.c <<EOF
1715 char arr[sizeof (void *)]={0};
1716 char post=0;
1717 EOF
1718       gmp_compile="$CC $CFLAGS -c conftest.c 1>&5"
1719       if { (eval echo configure:1716: \"$gmp_compile\") 1>&5; (eval $gmp_compile) 2>&5; }; then
1720                 gmp_tmp_val=`$NM conftest.o | grep post | sed -e 's;[[][0-9][]]\(.*\);\1;' \
1721           -e 's;[^1-9]*\([0-9]*\).*;\1;'`
1722                 if test "$gmp_tmp_val" = "8"; then
1723           gmp_cv_cc_64bit=yes
1724         else
1725           gmp_cv_cc_64bit=no
1726         fi
1727       else
1728         echo "configure: failed program was:" >&5
1729         cat conftest.$ac_ext >&5
1730         gmp_cv_cc_64bit=no
1731       fi
1732       rm -f conftest*
1733       ;;
1734   esac
1735
1736   CC="$gmp_tmp_CC_save"
1737   CFLAGS="$gmp_tmp_CFLAGS_save"
1738   echo "$ECHO_T""$gmp_cv_cc_64bit" 1>&6
1739
1740         if test "$gmp_cv_cc_64bit" = "yes"; then
1741           test -z "$CC64" && CC64="$c"
1742           test -z "$CFLAGS64" && CFLAGS64="$c_flags"
1743           # We have CC64 so we're done.
1744           break
1745         fi
1746       fi
1747     else
1748       # We have CC32, and we don't need a 64-bit compiler so we're done.
1749       break
1750     fi
1751   fi
1752 done
1753 CC="$CC32"
1754
1755   # If 64-bit OS and we have a 64-bit compiler, use it.
1756   if test -n "$os_64bit" && test -n "$CC64"; then
1757     CC=$CC64
1758     CFLAGS=$CFLAGS64
1759   else
1760     eval CFLAGS=\$gmp_cflags_$CC
1761   fi
1762
1763   # Try compiler flags that may work with only some compiler versions.
1764   # gmp_optcflags: All or nothing.
1765   eval optcflags=\$gmp_optcflags_$CC
1766   if test -n "$optcflags"; then
1767     CFLAGS_save="$CFLAGS"
1768     CFLAGS="$CFLAGS $optcflags"
1769     echo $ECHO_N "checking whether $CC accepts $optcflags... $ECHO_C" 1>&6
1770 echo "configure:1767: checking whether $CC accepts $optcflags" 1>&5
1771     ac_ext=c
1772 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1773 ac_cpp='$CPP $CPPFLAGS'
1774 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1775 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1776 cross_compiling=$ac_cv_prog_cc_cross
1777
1778     cat >conftest.$ac_ext <<EOF
1779
1780 #line 1777 "configure"
1781 #include "confdefs.h"
1782
1783 int main(){return(0);}
1784 EOF
1785 if { (eval echo configure:1782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1786   optok=yes
1787   # If we can't run a trivial program, we are probably using a cross compiler.
1788   if (./conftest; exit) 2>/dev/null; then
1789     cross=no
1790   else
1791     cross=yes
1792   fi
1793 else
1794   echo "configure: failed program was:" >&5
1795   cat conftest.$ac_ext >&5
1796   optok=no
1797 fi
1798 rm -fr conftest*
1799     if test "$optok" = "yes"; then
1800       echo "$ECHO_T""yes" 1>&6
1801     else
1802       echo "$ECHO_T""no" 1>&6
1803       CFLAGS="$CFLAGS_save"
1804     fi
1805   fi
1806   # gmp_xoptcflags: First is best, one has to work.
1807   eval xoptcflags=\$gmp_xoptcflags_$CC
1808   if test -n "$xoptcflags"; then
1809     gmp_found="no"
1810     for xopt in $xoptcflags; do
1811       CFLAGS_save="$CFLAGS"
1812       CFLAGS="$CFLAGS $xopt"
1813       echo $ECHO_N "checking whether $CC accepts $xopt... $ECHO_C" 1>&6
1814 echo "configure:1811: checking whether $CC accepts $xopt" 1>&5
1815       ac_ext=c
1816 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1817 ac_cpp='$CPP $CPPFLAGS'
1818 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1819 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1820 cross_compiling=$ac_cv_prog_cc_cross
1821
1822       cat >conftest.$ac_ext <<EOF
1823
1824 #line 1821 "configure"
1825 #include "confdefs.h"
1826
1827 int main(){return(0);}
1828 EOF
1829 if { (eval echo configure:1826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1830   optok=yes
1831   # If we can't run a trivial program, we are probably using a cross compiler.
1832   if (./conftest; exit) 2>/dev/null; then
1833     cross=no
1834   else
1835     cross=yes
1836   fi
1837 else
1838   echo "configure: failed program was:" >&5
1839   cat conftest.$ac_ext >&5
1840   optok=no
1841 fi
1842 rm -fr conftest*
1843       if test "$optok" = "yes"; then
1844         echo "$ECHO_T""yes" 1>&6
1845         gmp_found="yes"
1846         break
1847       else
1848         echo "$ECHO_T""no" 1>&6
1849         CFLAGS="$CFLAGS_save"
1850       fi
1851     done
1852     if test "$gmp_found" = "no"; then
1853       echo "$0: fatal: need a compiler that understands one of $xoptcflags"
1854       exit 1
1855     fi
1856   fi
1857 fi
1858
1859 # Restore CFLAGS given on command line.
1860 # FIXME: We've run through quite some unnecessary code looking for a
1861 # nice compiler and working flags for it, just to spoil that with user
1862 # supplied flags.
1863 test -n "$gmp_user_CFLAGS" && CFLAGS="$gmp_user_CFLAGS"
1864
1865 # Select chosen compiler.
1866
1867 echo $ECHO_N "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works... $ECHO_C" 1>&6
1868 echo "configure:1865: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" 1>&5
1869
1870 ac_ext=c
1871 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1872 ac_cpp='$CPP $CPPFLAGS'
1873 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1874 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1875 cross_compiling=$ac_cv_prog_cc_cross
1876
1877 cat >conftest.$ac_ext <<EOF
1878
1879 #line 1876 "configure"
1880 #include "confdefs.h"
1881
1882 int main(){return(0);}
1883 EOF
1884 if { (eval echo configure:1881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1885   ac_cv_prog_cc_works=yes
1886   # If we can't run a trivial program, we are probably using a cross compiler.
1887   if (./conftest; exit) 2>/dev/null; then
1888     ac_cv_prog_cc_cross=no
1889   else
1890     ac_cv_prog_cc_cross=yes
1891   fi
1892 else
1893   echo "configure: failed program was:" >&5
1894   cat conftest.$ac_ext >&5
1895   ac_cv_prog_cc_works=no
1896 fi
1897 rm -fr conftest*
1898 ac_ext=c
1899 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1900 ac_cpp='$CPP $CPPFLAGS'
1901 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1902 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1903 cross_compiling=$ac_cv_prog_cc_cross
1904
1905 echo "$ECHO_T""$ac_cv_prog_cc_works" 1>&6
1906 if test $ac_cv_prog_cc_works = no; then
1907   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 77; }
1908 fi
1909 echo $ECHO_N "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler... $ECHO_C" 1>&6
1910 echo "configure:1907: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" 1>&5
1911 echo "$ECHO_T""$ac_cv_prog_cc_cross" 1>&6
1912 cross_compiling=$ac_cv_prog_cc_cross
1913
1914 echo $ECHO_N "checking whether we are using GNU C... $ECHO_C" 1>&6
1915 echo "configure:1912: checking whether we are using GNU C" 1>&5
1916 if test "${ac_cv_prog_gcc+set}" = set; then
1917   echo $ECHO_N "(cached) $ECHO_C" 1>&6
1918 else
1919   cat >conftest.c <<EOF
1920 #ifdef __GNUC__
1921   yes;
1922 #endif
1923 EOF
1924 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1925   ac_cv_prog_gcc=yes
1926 else
1927   ac_cv_prog_gcc=no
1928 fi
1929 fi
1930 echo "$ECHO_T""$ac_cv_prog_gcc" 1>&6
1931
1932 if test "$ac_cv_prog_gcc" = "yes"; then
1933   GCC=yes
1934 else
1935   GCC=
1936 fi
1937
1938 # Set CFLAGS if not already set.
1939 if test -z "$CFLAGS"; then
1940   CFLAGS="-g"
1941   if test "$GCC" = "yes"; then
1942     CFLAGS="$CFLAGS -O2"
1943   fi
1944 fi
1945
1946 if test "${ac_cv_prog_CC+set}" = set; then
1947   echo $ECHO_N "(cached) $ECHO_C" 1>&6
1948 else
1949   ac_cv_prog_CC="$CC"
1950 fi
1951
1952 # How to assemble.
1953 CCAS="$CC -c"
1954
1955 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" 1>&6
1956 echo "configure:1953: checking how to run the C preprocessor" 1>&5
1957 # On Suns, sometimes $CPP names a directory.
1958 if test -n "$CPP" && test -d "$CPP"; then
1959   CPP=
1960 fi
1961 if test -z "$CPP"; then
1962 if test "${ac_cv_prog_CPP+set}" = set; then
1963   echo $ECHO_N "(cached) $ECHO_C" 1>&6
1964 else
1965     # This must be in double quotes, not single quotes, because CPP may get
1966   # substituted into the Makefile and "${CC-cc}" will confuse make.
1967   CPP="${CC-cc} -E"
1968   # On the NeXT, cc -E runs the code through the compiler's parser,
1969   # not just through cpp.
1970
1971 cat >conftest.$ac_ext <<EOF
1972 #line 1969 "configure"
1973 #include "confdefs.h"
1974 #include <assert.h>
1975 Syntax Error
1976 EOF
1977 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1978 { (eval echo configure:1975: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1979 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1980 if test -z "$ac_err"; then
1981   :
1982 else
1983   echo "$ac_err" >&5
1984   echo "configure: failed program was:" >&5
1985   cat conftest.$ac_ext >&5
1986   rm -rf conftest*
1987   CPP="${CC-cc} -E -traditional-cpp"
1988
1989 cat >conftest.$ac_ext <<EOF
1990 #line 1987 "configure"
1991 #include "confdefs.h"
1992 #include <assert.h>
1993 Syntax Error
1994 EOF
1995 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1996 { (eval echo configure:1993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1997 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1998 if test -z "$ac_err"; then
1999   :
2000 else
2001   echo "$ac_err" >&5
2002   echo "configure: failed program was:" >&5
2003   cat conftest.$ac_ext >&5
2004   rm -rf conftest*
2005   CPP="${CC-cc} -nologo -E"
2006
2007 cat >conftest.$ac_ext <<EOF
2008 #line 2005 "configure"
2009 #include "confdefs.h"
2010 #include <assert.h>
2011 Syntax Error
2012 EOF
2013 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2014 { (eval echo configure:2011: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2015 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2016 if test -z "$ac_err"; then
2017   :
2018 else
2019   echo "$ac_err" >&5
2020   echo "configure: failed program was:" >&5
2021   cat conftest.$ac_ext >&5
2022   rm -rf conftest*
2023   CPP=/lib/cpp
2024 fi
2025 rm -f conftest*
2026 fi
2027 rm -f conftest*
2028 fi
2029 rm -f conftest*
2030   ac_cv_prog_CPP="$CPP"
2031 fi
2032   CPP="$ac_cv_prog_CPP"
2033 else
2034   ac_cv_prog_CPP="$CPP"
2035 fi
2036 echo "$ECHO_T""$CPP" 1>&6
2037
2038 # Find a good install program.  We prefer a C program (faster),
2039 # so one script is as good as another.  But avoid the broken or
2040 # incompatible versions:
2041 # SysV /etc/install, /usr/sbin/install
2042 # SunOS /usr/etc/install
2043 # IRIX /sbin/install
2044 # AIX /bin/install
2045 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2046 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2047 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2048 # ./install, which can be erroneously created by make from ./install.sh.
2049 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" 1>&6
2050 echo "configure:2047: checking for a BSD compatible install" 1>&5
2051 if test -z "$INSTALL"; then
2052 if test "${ac_cv_path_install+set}" = set; then
2053   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2054 else
2055     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
2056   for ac_dir in $PATH; do
2057     # Account for people who put trailing slashes in PATH elements.
2058     case "$ac_dir/" in
2059     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2060     *)
2061       # OSF1 and SCO ODT 3.0 have their own names for install.
2062       # Don't use installbsd from OSF since it installs stuff as root
2063       # by default.
2064       for ac_prog in ginstall scoinst install; do
2065         if test -f $ac_dir/$ac_prog; then
2066           if test $ac_prog = install &&
2067             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2068             # AIX install.  It has an incompatible calling convention.
2069             :
2070           elif test $ac_prog = install &&
2071             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
2072             # program-specific install script used by HP pwplus--don't use.
2073             :
2074           else
2075             ac_cv_path_install="$ac_dir/$ac_prog -c"
2076             break 2
2077           fi
2078         fi
2079       done
2080       ;;
2081     esac
2082   done
2083   IFS="$ac_save_IFS"
2084
2085 fi
2086   if test "${ac_cv_path_install+set}" = set; then
2087     INSTALL="$ac_cv_path_install"
2088   else
2089     # As a last resort, use the slow shell script.  We don't cache a
2090     # path for INSTALL within a source directory, because that will
2091     # break other packages using the cache if that directory is
2092     # removed, or if the path is relative.
2093     INSTALL="$ac_install_sh"
2094   fi
2095 fi
2096 echo "$ECHO_T""$INSTALL" 1>&6
2097
2098 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2099 # It thinks the first close brace ends the variable substitution.
2100 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2101
2102 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2103
2104 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2105
2106 echo $ECHO_N "checking whether ln -s works... $ECHO_C" 1>&6
2107 echo "configure:2104: checking whether ln -s works" 1>&5
2108 if test "${ac_cv_prog_LN_S+set}" = set; then
2109   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2110 else
2111   rm -f conftestdata
2112 if ln -s X conftestdata 2>/dev/null
2113 then
2114   rm -f conftestdata
2115   ac_cv_prog_LN_S="ln -s"
2116 else
2117   ac_cv_prog_LN_S=ln
2118 fi
2119 fi
2120 LN_S="$ac_cv_prog_LN_S"
2121 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2122   echo "$ECHO_T""yes" 1>&6
2123 else
2124   echo "$ECHO_T""no" 1>&6
2125 fi
2126
2127 echo $ECHO_N "checking for suitable m4... $ECHO_C" 1>&6
2128 echo "configure:2125: checking for suitable m4" 1>&5
2129 if test "${gmp_cv_prog_m4+set}" = set; then
2130   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2131 else
2132   if test -n "$M4"; then
2133   gmp_cv_prog_m4="$M4"
2134 else
2135   cat >conftest.m4 <<\EOF
2136 define(dollarhash,``$#'')dnl
2137 ifelse(dollarhash(x),1,`define(t1,Y)',
2138 ``bad: $# not supported (SunOS /usr/bin/m4)
2139 '')dnl
2140 ifelse(eval(89),89,`define(t2,Y)',
2141 `bad: eval() doesnt support 8 or 9 in a constant (OpenBSD 2.6 m4)
2142 ')dnl
2143 ifelse(t1`'t2,YY,`good
2144 ')dnl
2145 EOF
2146   echo "trying m4" 1>&5
2147   gmp_tmp_val="`(m4 conftest.m4) 2>&5`"
2148   echo "$gmp_tmp_val" 1>&5
2149   if test "$gmp_tmp_val" = good; then
2150     gmp_cv_prog_m4="m4"
2151   else
2152     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS=":"
2153     ac_dummy="$PATH:/usr/5bin"
2154     for ac_dir in $ac_dummy; do
2155       test -z "$ac_dir" && ac_dir=.
2156       echo "trying $ac_dir/m4" 1>&5
2157       gmp_tmp_val="`($ac_dir/m4 conftest.m4) 2>&5`"
2158       echo "$gmp_tmp_val" 1>&5
2159       if test "$gmp_tmp_val" = good; then
2160         gmp_cv_prog_m4="$ac_dir/m4"
2161         break
2162       fi
2163     done
2164     IFS="$ac_save_ifs"
2165     if test -z "$gmp_cv_prog_m4"; then
2166       { echo "configure: error: No usable m4 in \$PATH or /usr/5bin (see config.log for reasons)." 1>&2; exit 1; }
2167     fi
2168   fi
2169   rm -f conftest.m4
2170 fi
2171 fi
2172 echo "$ECHO_T""$gmp_cv_prog_m4" 1>&6
2173 M4="$gmp_cv_prog_m4"
2174
2175 # Extract the first word of "ar", so it can be a program name with args.
2176 set dummy ar; ac_word=$2
2177 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
2178 echo "configure:2175: checking for $ac_word" 1>&5
2179 if test "${ac_cv_prog_AR+set}" = set; then
2180   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2181 else
2182   if test -n "$AR"; then
2183   ac_cv_prog_AR="$AR" # Let the user override the test.
2184 else
2185   for ac_path in `IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2186 ac_dummy="$PATH"
2187 for ac_dir in $ac_dummy; do
2188   test -z "$ac_dir" && ac_dir=.
2189   if test -f $ac_dir/$ac_word; then
2190     echo "$ac_dir/$ac_word"
2191   fi
2192 done
2193 IFS="$ac_save_ifs"
2194 `; do
2195     ac_cv_prog_AR="ar"
2196     break
2197   done
2198 fi
2199 fi
2200 AR="$ac_cv_prog_AR"
2201 if test -n "$AR"; then
2202   echo "$ECHO_T""$AR" 1>&6
2203 else
2204   echo "$ECHO_T""no" 1>&6
2205 fi
2206
2207 # ar on AIX needs to know the object file format
2208 case "$target" in
2209   powerpc64*-*-aix*)
2210     AR="$AR -X 64"
2211     ;;
2212 esac
2213
2214 if test "$gmp_no_asm_syntax_testing" != "yes"; then
2215   echo $ECHO_N "checking how to switch to text section... $ECHO_C" 1>&6
2216 echo "configure:2213: checking how to switch to text section" 1>&5
2217 if test "${gmp_cv_check_asm_text+set}" = set; then
2218   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2219 else
2220   case "$target" in
2221   *-*-aix*)
2222
2223     gmp_cv_check_asm_text=".csect .text[PR]"
2224
2225     ;;
2226   *-*-hpux*) gmp_cv_check_asm_text=".code" ;;
2227   *) gmp_cv_check_asm_text=".text" ;;
2228 esac
2229
2230 fi
2231 echo "$ECHO_T""$gmp_cv_check_asm_text" 1>&6
2232 echo "define(<TEXT>, <$gmp_cv_check_asm_text>)" >> $gmp_tmpconfigm4
2233
2234   echo $ECHO_N "checking how to switch to data section... $ECHO_C" 1>&6
2235 echo "configure:2232: checking how to switch to data section" 1>&5
2236 if test "${gmp_cv_check_asm_data+set}" = set; then
2237   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2238 else
2239   case "$target" in
2240   *-*-aix*)
2241
2242     gmp_cv_check_asm_data=".csect .data[RW]"
2243
2244     ;;
2245   *) gmp_cv_check_asm_data=".data" ;;
2246 esac
2247
2248 fi
2249 echo "$ECHO_T""$gmp_cv_check_asm_data" 1>&6
2250 echo "define(<DATA>, <$gmp_cv_check_asm_data>)" >> $gmp_tmpconfigm4
2251
2252   echo $ECHO_N "checking how to export a symbol... $ECHO_C" 1>&6
2253 echo "configure:2250: checking how to export a symbol" 1>&5
2254 if test "${gmp_cv_check_asm_globl+set}" = set; then
2255   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2256 else
2257   case "$target" in
2258   *-*-hpux*) gmp_cv_check_asm_globl=".export" ;;
2259   *) gmp_cv_check_asm_globl=".globl" ;;
2260 esac
2261
2262 fi
2263 echo "$ECHO_T""$gmp_cv_check_asm_globl" 1>&6
2264 echo "define(<GLOBL>, <$gmp_cv_check_asm_globl>)" >> $gmp_tmpconfigm4
2265
2266   echo $ECHO_N "checking what assembly label suffix to use... $ECHO_C" 1>&6
2267 echo "configure:2264: checking what assembly label suffix to use" 1>&5
2268 if test "${gmp_cv_check_asm_label_suffix+set}" = set; then
2269   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2270 else
2271   case "$target" in
2272   *-*-hpux*) gmp_cv_check_asm_label_suffix="" ;;
2273   *) gmp_cv_check_asm_label_suffix=":" ;;
2274 esac
2275
2276 fi
2277 echo "$ECHO_T""$gmp_cv_check_asm_label_suffix" 1>&6
2278 echo "define(<LABEL_SUFFIX>, <\$1$gmp_cv_check_asm_label_suffix>)" >> $gmp_tmpconfigm4
2279
2280   echo $ECHO_N "checking how the .type assembly directive should be used... $ECHO_C" 1>&6
2281 echo "configure:2278: checking how the .type assembly directive should be used" 1>&5
2282 if test "${gmp_cv_check_asm_type+set}" = set; then
2283   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2284 else
2285   ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
2286 for gmp_tmp_prefix in @ \# %; do
2287   echo "        .type   sym,${gmp_tmp_prefix}function" > conftest.s
2288   if { (eval echo configure:2285: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
2289     gmp_cv_check_asm_type=".type        \$1,${gmp_tmp_prefix}\$2"
2290     break
2291   fi
2292 done
2293 if test -z "$gmp_cv_check_asm_type"; then
2294   gmp_cv_check_asm_type="dnl"
2295 fi
2296
2297 fi
2298 echo "$ECHO_T""$gmp_cv_check_asm_type" 1>&6
2299 echo "define(<TYPE>, <$gmp_cv_check_asm_type>)" >> $gmp_tmpconfigm4
2300
2301   echo $ECHO_N "checking if the .size assembly directive works... $ECHO_C" 1>&6
2302 echo "configure:2299: checking if the .size assembly directive works" 1>&5
2303 if test "${gmp_cv_check_asm_size+set}" = set; then
2304   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2305 else
2306   ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
2307 echo '  .size   sym,1' > conftest.s
2308 if { (eval echo configure:2305: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
2309   gmp_cv_check_asm_size=".size  \$1,\$2"
2310 else
2311   gmp_cv_check_asm_size="dnl"
2312 fi
2313
2314 fi
2315 echo "$ECHO_T""$gmp_cv_check_asm_size" 1>&6
2316 echo "define(<SIZE>, <$gmp_cv_check_asm_size>)" >> $gmp_tmpconfigm4
2317
2318 echo $ECHO_N "checking what prefix to use for a local label... $ECHO_C" 1>&6
2319 echo "configure:2316: checking what prefix to use for a local label" 1>&5
2320 if test "${gmp_cv_check_asm_lsym_prefix+set}" = set; then
2321   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2322 else
2323   if test -z "$NM"; then
2324   echo; echo "GMP_CHECK_ASM_LSYM_PREFIX: fatal: need nm"
2325   exit 1
2326 fi
2327 ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
2328 gmp_cv_check_asm_lsym_prefix="L"
2329 for gmp_tmp_pre in L .L $ L$; do
2330   cat > conftest.s <<EOF
2331 dummy${gmp_cv_check_asm_label_suffix}
2332 ${gmp_tmp_pre}gurkmacka${gmp_cv_check_asm_label_suffix}
2333         .byte 0
2334 EOF
2335   if { (eval echo configure:2332: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
2336     $NM conftest.o >/dev/null 2>&1
2337     gmp_rc=$?
2338     if test "$gmp_rc" != "0"; then
2339       echo "configure: $NM failure, using default"
2340       break
2341     fi
2342     if $NM conftest.o | grep gurkmacka >/dev/null; then true; else
2343       gmp_cv_check_asm_lsym_prefix="$gmp_tmp_pre"
2344       break
2345     fi
2346   else
2347     echo "configure: failed program was:" >&5
2348     cat conftest.s >&5
2349     # Use default.
2350   fi
2351 done
2352 rm -f conftest*
2353
2354 fi
2355 echo "$ECHO_T""$gmp_cv_check_asm_lsym_prefix" 1>&6
2356 echo "define(<LSYM_PREFIX>, <${gmp_cv_check_asm_lsym_prefix}>)" >> $gmp_tmpconfigm4
2357
2358 echo $ECHO_N "checking how to define a 32-bit word... $ECHO_C" 1>&6
2359 echo "configure:2356: checking how to [define] a 32-bit word" 1>&5
2360 if test "${gmp_cv_check_asm_w32+set}" = set; then
2361   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2362 else
2363   if test -z "$NM"; then
2364   echo; echo "configure: GMP_CHECK_ASM_W32: fatal: need nm"
2365   exit 1
2366 fi
2367
2368 # FIXME: HPUX puts first symbol at 0x40000000, breaking our assumption
2369 # that it's at 0x0.  We'll have to declare another symbol before the
2370 # .long/.word and look at the distance between the two symbols.  The
2371 # only problem is that the sed expression(s) barfs (on Solaris, for
2372 # example) for the symbol with value 0.  For now, HPUX uses .word.
2373
2374 case "$target" in
2375   *-*-hpux*)
2376     gmp_cv_check_asm_w32=".word"
2377     ;;
2378   *-*-*)
2379     ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
2380     for gmp_tmp_op in .long .word; do
2381       cat > conftest.s <<EOF
2382         $gmp_cv_check_asm_data
2383         $gmp_cv_check_asm_globl foo
2384         $gmp_tmp_op     0
2385 foo${gmp_cv_check_asm_label_suffix}
2386         .byte   0
2387 EOF
2388       if { (eval echo configure:2385: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
2389
2390         gmp_tmp_val=`$NM conftest.o | grep foo | sed -e 's;[[][0-9][]]\(.*\);\1;' \
2391              -e 's;[^1-9]*\([0-9]*\).*;\1;'`
2392                 if test "$gmp_tmp_val" = "4"; then
2393           gmp_cv_check_asm_w32="$gmp_tmp_op"
2394           break
2395         fi
2396       fi
2397     done
2398     ;;
2399 esac
2400
2401 if test -z "$gmp_cv_check_asm_w32"; then
2402   echo; echo "configure: GMP_CHECK_ASM_W32: fatal: do not know how to define a 32-bit word"
2403   exit 1
2404 fi
2405 rm -f conftest*
2406
2407 fi
2408 echo "$ECHO_T""$gmp_cv_check_asm_w32" 1>&6
2409 echo "define(<W32>, <$gmp_cv_check_asm_w32>)" >> $gmp_tmpconfigm4
2410
2411   echo $ECHO_N "checking if symbols are prefixed by underscore... $ECHO_C" 1>&6
2412 echo "configure:2409: checking if symbols are prefixed by underscore" 1>&5
2413 if test "${gmp_cv_check_asm_underscore+set}" = set; then
2414   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2415 else
2416   cat > conftest.$ac_ext <<EOF
2417 #line 2414 "configure"
2418 #include "confdefs.h"
2419 int underscore_test() {
2420 return; }
2421 EOF
2422 if { (eval echo configure:2419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2423   if grep _underscore_test conftest* >/dev/null; then
2424     gmp_cv_check_asm_underscore=yes
2425   else
2426     gmp_cv_check_asm_underscore=no
2427   fi
2428 else
2429   echo "configure: failed program was:" >&5
2430   cat conftest.$ac_ext >&5
2431 fi
2432 rm -f conftest*
2433
2434 fi
2435 echo "$ECHO_T""$gmp_cv_check_asm_underscore" 1>&6
2436 if test "$gmp_cv_check_asm_underscore" = "yes"; then
2437
2438 echo 'define(<GSYM_PREFIX>, <_>)' >> $gmp_tmpconfigm4
2439
2440   underscore=yes
2441 else
2442
2443 echo 'define(<GSYM_PREFIX>, <>)' >> $gmp_tmpconfigm4
2444
2445   underscore=no
2446 fi
2447
2448 echo $ECHO_N "checking if .align assembly directive is logarithmic... $ECHO_C" 1>&6
2449 echo "configure:2446: checking if .align assembly directive is logarithmic" 1>&5
2450 if test "${gmp_cv_check_asm_align_log+set}" = set; then
2451   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2452 else
2453   if test -z "$NM"; then
2454   echo; echo "configure: GMP_CHECK_ASM_ALIGN_LOG: fatal: need nm"
2455   exit 1
2456 fi
2457 cat > conftest.s <<EOF
2458         $gmp_cv_check_asm_data
2459         .align  4
2460         $gmp_cv_check_asm_globl foo
2461         .byte   1
2462         .align  4
2463 foo$gmp_cv_check_asm_label_suffix
2464         .byte   2
2465 EOF
2466 ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
2467 if { (eval echo configure:2464: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
2468
2469   gmp_tmp_val=`$NM conftest.o | grep foo | sed -e 's;[[][0-9][]]\(.*\);\1;' \
2470        -e 's;[^1-9]*\([0-9]*\).*;\1;'`
2471     if test "$gmp_tmp_val" = "10" || test "$gmp_tmp_val" = "16"; then
2472     gmp_cv_check_asm_align_log=yes
2473   else
2474     gmp_cv_check_asm_align_log=no
2475   fi
2476 else
2477   echo "configure: failed program was:" >&5
2478   cat conftest.s >&5
2479 fi
2480 rm -f conftest*
2481
2482 fi
2483 echo "$ECHO_T""$gmp_cv_check_asm_align_log" 1>&6
2484
2485 echo "define(<ALIGN_LOGARITHMIC>,<$gmp_cv_check_asm_align_log>)" >> $gmp_tmpconfigm4
2486
2487 if test "$gmp_cv_check_asm_align_log" = "yes"; then
2488   asm_align=log
2489 else
2490   asm_align=nolog
2491 fi
2492
2493 fi
2494
2495 family=generic
2496
2497 case ${target} in
2498   arm*-*-*)
2499     path="arm"
2500     ;;
2501   sparcv9*-*-solaris2.[789]* | sparc64*-*-solaris2.[789]* | ultrasparc*-*-solaris2.[789]*)
2502     if test -n "$CC64"; then
2503       path="sparc64"
2504     else
2505       path="sparc32/v9 sparc32/v8 sparc32"
2506     fi
2507     ;;
2508   sparc64-*-linux*)
2509     path="sparc64"
2510     ;;
2511   sparcv8*-*-* | microsparc*-*-*)
2512         path="sparc32/v8 sparc32"
2513         if test x${floating_point} = xno
2514           then extra_functions="udiv_nfp"
2515           else extra_functions="udiv_fp"
2516         fi
2517         ;;
2518   sparcv9*-*-* | ultrasparc*-*-*)
2519         path="sparc32/v9 sparc32/v8 sparc32"
2520         extra_functions="udiv_fp"
2521         ;;
2522   supersparc*-*-*)
2523         path="sparc32/v8/supersparc sparc32/v8 sparc32"
2524         extra_functions="udiv"
2525         ;;
2526   sparc*-*-*) path="sparc32"
2527         if test x${floating_point} = xno
2528           then extra_functions="udiv_nfp"
2529           else extra_functions="udiv_fp"
2530         fi
2531         ;;
2532   hppa7000*-*-*)
2533     path="hppa/hppa1_1 hppa"
2534     extra_functions="udiv_qrnnd"
2535     ;;
2536   hppa1.0*-*-*)
2537     path="hppa"
2538     extra_functions="udiv_qrnnd"
2539     ;;
2540   hppa2.0w-*-*)
2541     path="pa64w"
2542     extra_functions="umul_ppmm udiv_qrnnd"
2543     ;;
2544   hppa2.0*-*-*)
2545     if test -n "$CC64"; then
2546       path="pa64"
2547       extra_functions="umul_ppmm udiv_qrnnd"
2548       # We need to use the system compiler, or actually the system assembler,
2549       # since GAS has not been ported to understand the 2.0 instructions.
2550       CCAS="$CC64 -c"
2551     else
2552       # FIXME: path should be "hppa/hppa2_0 hppa/hppa1_1 hppa"
2553       path="hppa/hppa1_1 hppa"
2554       extra_functions="udiv_qrnnd"
2555     fi
2556     ;;
2557   hppa*-*-*)                                    #assume pa7100
2558     path="hppa/hppa1_1/pa7100 hppa/hppa1_1 hppa"
2559     extra_functions="udiv_qrnnd";;
2560   f30[01]-fujitsu-sysv*)
2561     path=fujitsu;;
2562   alphaev6*-*-*) path="alpha/ev6 alpha"; extra_functions="invert_limb cntlz";;
2563   alphaev5*-*-*) path="alpha/ev5 alpha"; extra_functions="invert_limb cntlz";;
2564   alpha*-*-*) path="alpha"; extra_functions="invert_limb cntlz";;
2565   # Cray vector machines.  This must come after alpha* so that we can
2566   # recognize present and future vector processors with a wildcard.
2567   *-cray-unicos*)
2568     path="cray"
2569     extra_functions="mulww";;
2570   am29000*-*-*) path="a29k";;
2571   a29k*-*-*) path="a29k";;
2572
2573   # AMD and Intel x86 configurations
2574
2575   i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-*)
2576     gmp_m4postinc="x86/x86-defs.m4"
2577     extra_functions="udiv umul"
2578     CALLING_CONVENTIONS_OBJS="x86call.o x86check.o"
2579
2580 echo $ECHO_N "checking if the assembler takes cl with shldl... $ECHO_C" 1>&6
2581 echo "configure:2578: checking if the assembler takes cl with shldl" 1>&5
2582 if test "${gmp_cv_check_asm_shldl_cl+set}" = set; then
2583   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2584 else
2585   cat > conftest.s <<EOF
2586         $gmp_cv_check_asm_text
2587         shldl   %cl, %eax, %ebx
2588 EOF
2589 ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
2590 if { (eval echo configure:2587: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
2591   gmp_cv_check_asm_shldl_cl=yes
2592 else
2593   gmp_cv_check_asm_shldl_cl=no
2594 fi
2595 rm -f conftest*
2596
2597 fi
2598 echo "$ECHO_T""$gmp_cv_check_asm_shldl_cl" 1>&6
2599 if test "$gmp_cv_check_asm_shldl_cl" = "yes"; then
2600
2601 echo 'define(<WANT_SHLDL_CL>, <1>)' >> $gmp_tmpconfigm4
2602
2603 else
2604
2605 echo 'define(<WANT_SHLDL_CL>, <0>)' >> $gmp_tmpconfigm4
2606
2607 fi
2608
2609     echo $ECHO_N "checking if the .align directive accepts an 0x90 fill in .text... $ECHO_C" 1>&6
2610 echo "configure:2607: checking if the .align directive accepts an 0x90 fill in .text" 1>&5
2611 if test "${gmp_cv_check_asm_align_fill_0x90+set}" = set; then
2612   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2613 else
2614
2615 cat > conftest.s <<EOF
2616         $gmp_cv_check_asm_text
2617         .align  4, 0x90
2618         .byte   0
2619         .align  4, 0x90
2620 EOF
2621 gmp_tmp_val="`$CCAS $CFLAGS conftest.s 2>&1`"
2622 if test $? = 0; then
2623   echo "$gmp_tmp_val" 1>&5
2624   if echo "$gmp_tmp_val" | grep "Warning: Fill parameter ignored for executable section"; then
2625     echo "Supressing this warning by omitting 0x90" 1>&5
2626     gmp_cv_check_asm_align_fill_0x90=no
2627   else
2628     gmp_cv_check_asm_align_fill_0x90=yes
2629   fi
2630 else
2631   echo "Non-zero exit code" 1>&5
2632   echo "$gmp_tmp_val" 1>&5
2633   gmp_cv_check_asm_align_fill_0x90=no
2634 fi
2635 rm -f conftest*
2636
2637 fi
2638 echo "$ECHO_T""$gmp_cv_check_asm_align_fill_0x90" 1>&6
2639
2640 echo "define(<ALIGN_FILL_0x90>,<$gmp_cv_check_asm_align_fill_0x90>)" >> $gmp_tmpconfigm4
2641
2642     # the CPUs below wanting to know about mmx
2643     case ${target} in
2644       pentiummmx-*-* | pentium[23]-*-* | k6*-*-* | athlon-*-*)
2645
2646 echo $ECHO_N "checking if the assembler knows about MMX instructions... $ECHO_C" 1>&6
2647 echo "configure:2644: checking if the assembler knows about MMX instructions" 1>&5
2648 if test "${gmp_cv_check_asm_mmx+set}" = set; then
2649   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2650 else
2651   cat > conftest.s <<EOF
2652         $gmp_cv_check_asm_text
2653         por     %mm0, %mm0
2654 EOF
2655 ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
2656 if { (eval echo configure:2653: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
2657   gmp_cv_check_asm_mmx=yes
2658 else
2659   gmp_cv_check_asm_mmx=no
2660 fi
2661 rm -f conftest*
2662
2663 fi
2664 echo "$ECHO_T""$gmp_cv_check_asm_mmx" 1>&6
2665 if test "$gmp_cv_check_asm_mmx" = "yes"; then
2666   tmp_mmx=yes
2667 else
2668   echo "configure: warning: +----------------------------------------------------------" 1>&2
2669   echo "configure: warning: | WARNING WARNING WARNING" 1>&2
2670   echo "configure: warning: | Target CPU has MMX code, but it can't be assembled by" 1>&2
2671   echo "configure: warning: |     $CCAS $CFLAGS" 1>&2
2672   echo "configure: warning: | Non-MMX replacements will be used." 1>&2
2673   echo "configure: warning: | This will be an inferior build." 1>&2
2674   echo "configure: warning: +----------------------------------------------------------" 1>&2
2675   tmp_mmx=no
2676 fi
2677
2678         ;;
2679     esac
2680
2681     # default for anything not otherwise mentioned
2682     path="x86"
2683
2684     case ${target} in
2685       i[34]86*-*-*)
2686         path="x86"
2687         ;;
2688       k5*-*-*)
2689         # don't know what best suits k5
2690         path="x86"
2691         ;;
2692       i586*-*-* | pentium-*-*)
2693         path="x86/pentium x86"
2694         ;;
2695       pentiummmx-*-*)
2696         path="x86/pentium x86"
2697         if test "$tmp_mmx" = yes; then
2698           path="x86/pentium/mmx $path"
2699         fi
2700         ;;
2701       i686*-*-* | pentiumpro-*-*)
2702         path="x86/p6 x86"
2703         ;;
2704       pentium2-*-*)
2705         path="x86/p6 x86"
2706         # The pentium/mmx lshift and rshift are good on p6 and can be used
2707         # until there's something specific for p6.
2708         if test "$tmp_mmx" = yes; then
2709           path="x86/p6/mmx x86/pentium/mmx $path"
2710         fi
2711         ;;
2712       pentium3-*-*)
2713         path="x86/p6 x86"
2714         # The pentium/mmx lshift and rshift are good on p6 and can be used
2715         # until there's something specific for p6.
2716         if test "$tmp_mmx" = yes; then
2717           path="x86/p6/p3mmx x86/p6/mmx x86/pentium/mmx $path"
2718         fi
2719         ;;
2720       k6[23]*-*-*)
2721         path="x86/k6 x86"
2722         if test "$tmp_mmx" = yes; then
2723           path="x86/k6/k62mmx x86/k6/mmx $path"
2724         fi
2725         ;;
2726       k6*-*-*)
2727         path="x86/k6 x86"
2728         if test "$tmp_mmx" = yes; then
2729           path="x86/k6/mmx $path"
2730         fi
2731         ;;
2732       athlon-*-*)
2733         path="x86/k7 x86"
2734         if test "$tmp_mmx" = yes; then
2735           path="x86/k7/mmx $path"
2736         fi
2737         ;;
2738     esac
2739     ;;
2740
2741   i960*-*-*) path="i960";;
2742
2743   ia64*-*-*) path="ia64";;
2744
2745 # Motorola 68k configurations.  Let m68k mean 68020-68040.
2746   m680[234]0*-*-* | m68k*-*-* | \
2747   m68*-next-nextstep*)          # Nexts are at least '020
2748     path="m68k/mc68020 m68k"
2749     family=m68k
2750     ;;
2751   m68000*-*-*)
2752     path="m68k"
2753     family=m68k
2754     ;;
2755
2756   m88k*-*-* | m88k*-*-*) path="m88k";;
2757   m88110*-*-*) path="m88k/mc88110 m88k";;
2758   ns32k*-*-*) path="ns32k";;
2759
2760   pyramid-*-*) path="pyr";;
2761
2762   ppc601-*-*) path="power powerpc32";;
2763   powerpc64*-*-*) path="powerpc64";;
2764   powerpc*-*-*) path="powerpc32";;
2765   rs6000-*-* | power-*-* | power2-*-*)
2766     path="power"
2767     extra_functions="udiv_w_sdiv"
2768     ;;
2769
2770   sh-*-*) path="sh";;
2771   sh2-*-*) path="sh/sh2 sh";;
2772
2773   mips[34]*-*-*) path="mips3";;
2774   mips*-*-irix6*) path="mips3";;
2775   mips*-*-*) path="mips2";;
2776
2777   vax*-*-*) path="vax"; extra_functions="udiv_w_sdiv";;
2778
2779   z8000x*-*-*) path="z8000x"; extra_functions="udiv_w_sdiv";;
2780   z8000*-*-*) path="z8000"; extra_functions="udiv_w_sdiv";;
2781
2782   clipper*-*-*) path="clipper";;
2783 esac
2784
2785 if test -n "$CALLING_CONVENTIONS_OBJS"; then
2786   cat >>confdefs.h <<\EOF
2787 #define HAVE_CALLING_CONVENTIONS 1
2788 EOF
2789
2790 fi
2791
2792 case ${target} in
2793   i[5-8]86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-*)
2794     # rdtsc is in pentium and up, not in i386 and i486
2795     SPEED_CYCLECOUNTER_OBJS=pentium.lo
2796     ;;
2797   alpha*-*-*)
2798     SPEED_CYCLECOUNTER_OBJS=alpha.lo
2799     ;;
2800   sparcv9*-*-* | ultrasparc*-*-* | sparc64*-*-*)
2801     SPEED_CYCLECOUNTER_OBJS=sparcv9.lo
2802     ;;
2803   hppa2*-*-*)
2804     SPEED_CYCLECOUNTER_OBJS=hppa2.lo
2805     ;;
2806   hppa*-*-*)
2807     SPEED_CYCLECOUNTER_OBJS=hppa.lo
2808     ;;
2809 esac
2810
2811 if test -n "$SPEED_CYCLECOUNTER_OBJS"
2812 then
2813   cat >>confdefs.h <<\EOF
2814 #define HAVE_SPEED_CYCLECOUNTER 1
2815 EOF
2816
2817 fi
2818
2819 echo $ECHO_N "checking for Cygwin environment... $ECHO_C" 1>&6
2820 echo "configure:2817: checking for Cygwin environment" 1>&5
2821 if test "${ac_cv_cygwin+set}" = set; then
2822   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2823 else
2824   cat >conftest.$ac_ext <<EOF
2825 #line 2822 "configure"
2826 #include "confdefs.h"
2827
2828 int
2829 main ()
2830 {
2831 #ifndef __CYGWIN__
2832 # define __CYGWIN__ __CYGWIN32__
2833 #endif
2834 return __CYGWIN__;
2835   ;
2836   return 0;
2837 }
2838 EOF
2839 if { (eval echo configure:2836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2840   rm -rf conftest*
2841   ac_cv_cygwin=yes
2842 else
2843   echo "configure: failed program was:" >&5
2844   cat conftest.$ac_ext >&5
2845   rm -rf conftest*
2846   ac_cv_cygwin=no
2847 fi
2848 rm -f conftest*
2849 fi
2850 echo "$ECHO_T""$ac_cv_cygwin" 1>&6
2851 CYGWIN=
2852 test "$ac_cv_cygwin" = yes && CYGWIN=yes
2853 echo $ECHO_N "checking for mingw32 environment... $ECHO_C" 1>&6
2854 echo "configure:2851: checking for mingw32 environment" 1>&5
2855 if test "${ac_cv_mingw32+set}" = set; then
2856   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2857 else
2858   cat >conftest.$ac_ext <<EOF
2859 #line 2856 "configure"
2860 #include "confdefs.h"
2861
2862 int
2863 main ()
2864 {
2865 return __MINGW32__;
2866   ;
2867   return 0;
2868 }
2869 EOF
2870 if { (eval echo configure:2867: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2871   rm -rf conftest*
2872   ac_cv_mingw32=yes
2873 else
2874   echo "configure: failed program was:" >&5
2875   cat conftest.$ac_ext >&5
2876   rm -rf conftest*
2877   ac_cv_mingw32=no
2878 fi
2879 rm -f conftest*
2880 fi
2881 echo "$ECHO_T""$ac_cv_mingw32" 1>&6
2882 MINGW32=
2883 test "$ac_cv_mingw32" = yes && MINGW32=yes
2884 echo $ECHO_N "checking for EMX OS/2 environment... $ECHO_C" 1>&6
2885 echo "configure:2882: checking for EMX OS/2 environment" 1>&5
2886 if test "${ac_cv_emxos2+set}" = set; then
2887   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2888 else
2889   cat >conftest.$ac_ext <<EOF
2890 #line 2887 "configure"
2891 #include "confdefs.h"
2892
2893 int
2894 main ()
2895 {
2896 return __EMX__;
2897   ;
2898   return 0;
2899 }
2900 EOF
2901 if { (eval echo configure:2898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2902   rm -rf conftest*
2903   ac_cv_emxos2=yes
2904 else
2905   echo "configure: failed program was:" >&5
2906   cat conftest.$ac_ext >&5
2907   rm -rf conftest*
2908   ac_cv_emxos2=no
2909 fi
2910 rm -f conftest*
2911 fi
2912 echo "$ECHO_T""$ac_cv_emxos2" 1>&6
2913 EMXOS2=
2914 test "$ac_cv_emxos2" = yes && EMXOS2=yes
2915
2916 echo $ECHO_N "checking for executable suffix... $ECHO_C" 1>&6
2917 echo "configure:2914: checking for executable suffix" 1>&5
2918 if test "${ac_cv_exeext+set}" = set; then
2919   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2920 else
2921   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
2922   ac_cv_exeext=.exe
2923 else
2924   rm -f conftest*
2925   echo 'int main () { return 0; }' >conftest.$ac_ext
2926   ac_cv_exeext=
2927   if { (eval echo configure:2924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
2928     for ac_file in conftest.*; do
2929       case $ac_file in
2930       *.c | *.C | *.o | *.obj | *.xcoff) ;;
2931       *) ac_cv_exeext=`echo $ac_file | sed -e s/conftest//` ;;
2932       esac
2933     done
2934   else
2935     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
2936   fi
2937   rm -f conftest*
2938   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
2939 fi
2940 fi
2941
2942 EXEEXT=""
2943 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
2944 echo "$ECHO_T""${ac_cv_exeext}" 1>&6
2945 ac_exeext=$EXEEXT
2946
2947 echo $ECHO_N "checking for object suffix... $ECHO_C" 1>&6
2948 echo "configure:2945: checking for object suffix" 1>&5
2949 if test "${ac_cv_objext+set}" = set; then
2950   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2951 else
2952   rm -f conftest*
2953 echo 'int i = 1;' >conftest.$ac_ext
2954 if { (eval echo configure:2951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2955   for ac_file in conftest.*; do
2956     case $ac_file in
2957     *.c) ;;
2958     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
2959     esac
2960   done
2961 else
2962   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
2963 fi
2964 rm -f conftest*
2965 fi
2966
2967 echo "$ECHO_T""$ac_cv_objext" 1>&6
2968 OBJEXT=$ac_cv_objext
2969 ac_objext=$ac_cv_objext
2970
2971 case "$target" in
2972   *-*-aix4.[3-9]*) enable_shared=no ;;
2973 esac
2974 # Check whether --enable-shared or --disable-shared was given.
2975 if test "${enable_shared+set}" = set; then
2976   enableval="$enable_shared"
2977   p=${PACKAGE-default}
2978 case "$enableval" in
2979 yes) enable_shared=yes ;;
2980 no) enable_shared=no ;;
2981 *)
2982   enable_shared=no
2983   # Look at the argument we got.  We use all the common list separators.
2984   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2985   for pkg in $enableval; do
2986     if test "X$pkg" = "X$p"; then
2987       enable_shared=yes
2988     fi
2989   done
2990   IFS="$ac_save_ifs"
2991   ;;
2992 esac
2993 else
2994   enable_shared=yes
2995 fi
2996 # Check whether --enable-static or --disable-static was given.
2997 if test "${enable_static+set}" = set; then
2998   enableval="$enable_static"
2999   p=${PACKAGE-default}
3000 case "$enableval" in
3001 yes) enable_static=yes ;;
3002 no) enable_static=no ;;
3003 *)
3004   enable_static=no
3005   # Look at the argument we got.  We use all the common list separators.
3006   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3007   for pkg in $enableval; do
3008     if test "X$pkg" = "X$p"; then
3009       enable_static=yes
3010     fi
3011   done
3012   IFS="$ac_save_ifs"
3013   ;;
3014 esac
3015 else
3016   enable_static=yes
3017 fi
3018 # Check whether --enable-fast-install or --disable-fast-install was given.
3019 if test "${enable_fast_install+set}" = set; then
3020   enableval="$enable_fast_install"
3021   p=${PACKAGE-default}
3022 case "$enableval" in
3023 yes) enable_fast_install=yes ;;
3024 no) enable_fast_install=no ;;
3025 *)
3026   enable_fast_install=no
3027   # Look at the argument we got.  We use all the common list separators.
3028   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3029   for pkg in $enableval; do
3030     if test "X$pkg" = "X$p"; then
3031       enable_fast_install=yes
3032     fi
3033   done
3034   IFS="$ac_save_ifs"
3035   ;;
3036 esac
3037 else
3038   enable_fast_install=yes
3039 fi
3040
3041 echo $ECHO_N "checking build system type... $ECHO_C" 1>&6
3042 echo "configure:3039: checking build system type" 1>&5
3043 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
3044
3045   # Make sure we can run config.sub.
3046   if $ac_config_sub sun4 >/dev/null 2>&1; then :; else
3047     { echo "configure: error: cannot run $ac_config_sub" 1>&2; exit 1; }
3048   fi
3049
3050   ac_cv_build_alias=$build
3051   case "$ac_cv_build_alias" in
3052   NONE)
3053     case $nonopt in
3054     NONE)
3055       ac_cv_build_alias=$host_alias ;;
3056     *) ac_cv_build_alias=$nonopt ;;
3057     esac ;;
3058   esac
3059
3060   ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || exit 1
3061   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
3062   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
3063   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
3064 else
3065   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3066 fi
3067
3068 echo "$ECHO_T""$ac_cv_build" 1>&6
3069
3070 build=$ac_cv_build
3071 build_alias=$ac_cv_build_alias
3072 build_cpu=$ac_cv_build_cpu
3073 build_vendor=$ac_cv_build_vendor
3074 build_os=$ac_cv_build_os
3075
3076 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3077 if test "${with_gnu_ld+set}" = set; then
3078   withval="$with_gnu_ld"
3079   test "$withval" = no || with_gnu_ld=yes
3080 else
3081   with_gnu_ld=no
3082 fi
3083
3084 ac_prog=ld
3085 if test "$ac_cv_prog_gcc" = yes; then
3086   # Check if gcc -print-prog-name=ld gives a path.
3087   echo $ECHO_N "checking for ld used by GCC... $ECHO_C" 1>&6
3088 echo "configure:3085: checking for ld used by GCC" 1>&5
3089   case $lt_target in
3090   *-*-mingw*)
3091     # gcc leaves a trailing carriage return which upsets mingw
3092     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3093   *)
3094     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3095   esac
3096   case "$ac_prog" in
3097     # Accept absolute paths.
3098     [\\/]* | [A-Za-z]:[\\/]*)
3099       re_direlt='/[^/][^/]*/\.\./'
3100       # Canonicalize the path of ld
3101       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3102       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3103         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3104       done
3105       test -z "$LD" && LD="$ac_prog"
3106       ;;
3107   "")
3108     # If it fails, then pretend we aren't using GCC.
3109     ac_prog=ld
3110     ;;
3111   *)
3112     # If it is relative, then search for the first ld in PATH.
3113     with_gnu_ld=unknown
3114     ;;
3115   esac
3116 elif test "$with_gnu_ld" = yes; then
3117   echo $ECHO_N "checking for GNU ld... $ECHO_C" 1>&6
3118 echo "configure:3115: checking for GNU ld" 1>&5
3119 else
3120   echo $ECHO_N "checking for non-GNU ld... $ECHO_C" 1>&6
3121 echo "configure:3118: checking for non-GNU ld" 1>&5
3122 fi
3123 if test "${ac_cv_path_LD+set}" = set; then
3124   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3125 else
3126   if test -z "$LD"; then
3127   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3128   for ac_dir in $PATH; do
3129     test -z "$ac_dir" && ac_dir=.
3130     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3131       ac_cv_path_LD="$ac_dir/$ac_prog"
3132       # Check to see if the program is GNU ld.  I'd rather use --version,
3133       # but apparently some GNU ld's only accept -v.
3134       # Break only if it was the GNU/non-GNU ld that we prefer.
3135       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3136         test "$with_gnu_ld" != no && break
3137       else
3138         test "$with_gnu_ld" != yes && break
3139       fi
3140     fi
3141   done
3142   IFS="$ac_save_ifs"
3143 else
3144   ac_cv_path_LD="$LD" # Let the user override the test with a path.
3145 fi
3146 fi
3147
3148 LD="$ac_cv_path_LD"
3149 if test -n "$LD"; then
3150   echo "$ECHO_T""$LD" 1>&6
3151 else
3152   echo "$ECHO_T""no" 1>&6
3153 fi
3154 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3155 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" 1>&6
3156 echo "configure:3153: checking if the linker ($LD) is GNU ld" 1>&5
3157 if test "${ac_cv_prog_gnu_ld+set}" = set; then
3158   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3159 else
3160   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3161 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3162   ac_cv_prog_gnu_ld=yes
3163 else
3164   ac_cv_prog_gnu_ld=no
3165 fi
3166 fi
3167 echo "$ECHO_T""$ac_cv_prog_gnu_ld" 1>&6
3168 with_gnu_ld=$ac_cv_prog_gnu_ld
3169
3170 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" 1>&6
3171 echo "configure:3168: checking for $LD option to reload object files" 1>&5
3172 if test "${lt_cv_ld_reload_flag+set}" = set; then
3173   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3174 else
3175   lt_cv_ld_reload_flag='-r'
3176 fi
3177 echo "$ECHO_T""$lt_cv_ld_reload_flag" 1>&6
3178 reload_flag=$lt_cv_ld_reload_flag
3179 test -n "$reload_flag" && reload_flag=" $reload_flag"
3180
3181 echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" 1>&6
3182 echo "configure:3179: checking how to recognise dependant libraries" 1>&5
3183 if test "${lt_cv_deplibs_check_method+set}" = set; then
3184   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3185 else
3186   lt_cv_file_magic_cmd='${MAGIC}'
3187 lt_cv_file_magic_test_file=
3188 lt_cv_deplibs_check_method='unknown'
3189 # Need to set the preceding variable on all platforms that support
3190 # interlibrary dependencies.
3191 # 'none' -- dependencies not supported.
3192 # `unknown' -- same as none, but documents that we really don't know.
3193 # 'pass_all' -- all dependencies passed with no checks.
3194 # 'test_compile' -- check by making test program.
3195 # 'file_magic [regex]' -- check by looking for files in library path
3196 # which responds to the $file_magic_cmd with a given egrep regex.
3197 # If you have `file' or equivalent on your system and you're not sure
3198 # whether `pass_all' will *always* work, you probably want this one.
3199
3200 case "$host_os" in
3201 aix4* | beos*)
3202   lt_cv_deplibs_check_method=pass_all
3203   ;;
3204
3205 bsdi4*)
3206     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
3207     lt_cv_file_magic_test_file=/shlib/libc.so
3208   ;;
3209
3210 cygwin* | mingw*)
3211   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3212   lt_cv_file_magic_cmd='${OBJDUMP} -f'
3213   ;;
3214
3215 freebsd*)
3216   case "$version_type" in
3217   freebsd-elf*)
3218     lt_cv_deplibs_check_method=pass_all
3219     ;;
3220   esac
3221   ;;
3222
3223 gnu*)
3224   lt_cv_deplibs_check_method=pass_all
3225   ;;
3226
3227 irix5* | irix6*)
3228   case "$host_os" in
3229   irix5*)
3230     # this will be overridden with pass_all, but let us keep it just in case
3231     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3232     ;;
3233   *)
3234     case "$LD" in
3235     *-32|*"-32 ") libmagic=32-bit;;
3236     *-n32|*"-n32 ") libmagic=N32;;
3237     *-64|*"-64 ") libmagic=64-bit;;
3238     *) libmagic=never-match;;
3239     esac
3240     # this will be overridden with pass_all, but let us keep it just in case
3241         lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
3242         ;;
3243   esac
3244   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3245   lt_cv_deplibs_check_method=pass_all
3246   ;;
3247
3248 # This must be Linux ELF.
3249 linux-gnu*)
3250   case "$host_cpu" in
3251   alpha* | i*86 | powerpc* | sparc* )
3252     lt_cv_deplibs_check_method=pass_all ;;
3253   *)
3254     # glibc up to 2.1.1 does not perform some relocations on ARM
3255         lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
3256       esac
3257   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3258   ;;
3259
3260 osf3* | osf4* | osf5*)
3261   # this will be overridden with pass_all, but let us keep it just in case
3262   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
3263   lt_cv_file_magic_test_file=/shlib/libc.so
3264   lt_cv_deplibs_check_method=pass_all
3265   ;;
3266
3267 sco3.2v5*)
3268   lt_cv_deplibs_check_method=pass_all
3269   ;;
3270
3271 solaris*)
3272   lt_cv_deplibs_check_method=pass_all
3273   lt_cv_file_magic_test_file=/lib/libc.so
3274   ;;
3275
3276 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3277   case "$host_vendor" in
3278   ncr)
3279     lt_cv_deplibs_check_method=pass_all
3280     ;;
3281   motorola)
3282         lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
3283         lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3284     ;;
3285   esac
3286   ;;
3287 esac
3288
3289 fi
3290 echo "$ECHO_T""$lt_cv_deplibs_check_method" 1>&6
3291 file_magic_cmd=$lt_cv_file_magic_cmd
3292 deplibs_check_method=$lt_cv_deplibs_check_method
3293
3294 if test $host != $build; then
3295   ac_tool_prefix=${host_alias}-
3296 else
3297   ac_tool_prefix=
3298 fi
3299
3300 # Only perform the check for file, if the check method requires it
3301 case "$deplibs_check_method" in
3302 file_magic*)
3303   if test "$file_magic_cmd" = '${MAGIC}'; then
3304
3305 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" 1>&6
3306 echo "configure:3303: checking for ${ac_tool_prefix}file" 1>&5
3307 if test "${lt_cv_path_MAGIC+set}" = set; then
3308   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3309 else
3310   case "$MAGIC" in
3311   /*)
3312   lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
3313   ;;
3314   ?:/*)
3315   ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
3316   ;;
3317   *)
3318   ac_save_MAGIC="$MAGIC"
3319   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3320   ac_dummy="/usr/bin:$PATH"
3321   for ac_dir in $ac_dummy; do
3322     test -z "$ac_dir" && ac_dir=.
3323     if test -f $ac_dir/${ac_tool_prefix}file; then
3324       lt_cv_path_MAGIC="$ac_dir/${ac_tool_prefix}file"
3325       if test -n "$file_magic_test_file"; then
3326         case "$deplibs_check_method" in
3327         "file_magic "*)
3328           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
3329           MAGIC="$lt_cv_path_MAGIC"
3330           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3331             egrep "$file_magic_regex" > /dev/null; then
3332             :
3333           else
3334             cat <<EOF 1>&2
3335
3336 *** Warning: the command libtool uses to detect shared libraries,
3337 *** $file_magic_cmd, produces output that libtool cannot recognize.
3338 *** The result is that libtool may fail to recognize shared libraries
3339 *** as such.  This will affect the creation of libtool libraries that
3340 *** depend on shared libraries, but programs linked with such libtool
3341 *** libraries will work regardless of this problem.  Nevertheless, you
3342 *** may want to report the problem to your system manager and/or to
3343 *** bug-libtool@gnu.org
3344
3345 EOF
3346           fi ;;
3347         esac
3348       fi
3349       break
3350     fi
3351   done
3352   IFS="$ac_save_ifs"
3353   MAGIC="$ac_save_MAGIC"
3354   ;;
3355 esac
3356 fi
3357
3358 MAGIC="$lt_cv_path_MAGIC"
3359 if test -n "$MAGIC"; then
3360   echo "$ECHO_T""$MAGIC" 1>&6
3361 else
3362   echo "$ECHO_T""no" 1>&6
3363 fi
3364
3365 if test -z "$lt_cv_path_MAGIC"; then
3366   if test -n "$ac_tool_prefix"; then
3367     echo $ECHO_N "checking for file... $ECHO_C" 1>&6
3368 echo "configure:3365: checking for file" 1>&5
3369 if test "${lt_cv_path_MAGIC+set}" = set; then
3370   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3371 else
3372   case "$MAGIC" in
3373   /*)
3374   lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
3375   ;;
3376   ?:/*)
3377   ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
3378   ;;
3379   *)
3380   ac_save_MAGIC="$MAGIC"
3381   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3382   ac_dummy="/usr/bin:$PATH"
3383   for ac_dir in $ac_dummy; do
3384     test -z "$ac_dir" && ac_dir=.
3385     if test -f $ac_dir/file; then
3386       lt_cv_path_MAGIC="$ac_dir/file"
3387       if test -n "$file_magic_test_file"; then
3388         case "$deplibs_check_method" in
3389         "file_magic "*)
3390           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
3391           MAGIC="$lt_cv_path_MAGIC"
3392           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3393             egrep "$file_magic_regex" > /dev/null; then
3394             :
3395           else
3396             cat <<EOF 1>&2
3397
3398 *** Warning: the command libtool uses to detect shared libraries,
3399 *** $file_magic_cmd, produces output that libtool cannot recognize.
3400 *** The result is that libtool may fail to recognize shared libraries
3401 *** as such.  This will affect the creation of libtool libraries that
3402 *** depend on shared libraries, but programs linked with such libtool
3403 *** libraries will work regardless of this problem.  Nevertheless, you
3404 *** may want to report the problem to your system manager and/or to
3405 *** bug-libtool@gnu.org
3406
3407 EOF
3408           fi ;;
3409         esac
3410       fi
3411       break
3412     fi
3413   done
3414   IFS="$ac_save_ifs"
3415   MAGIC="$ac_save_MAGIC"
3416   ;;
3417 esac
3418 fi
3419
3420 MAGIC="$lt_cv_path_MAGIC"
3421 if test -n "$MAGIC"; then
3422   echo "$ECHO_T""$MAGIC" 1>&6
3423 else
3424   echo "$ECHO_T""no" 1>&6
3425 fi
3426
3427   else
3428     MAGIC=:
3429   fi
3430 fi
3431
3432   fi
3433   ;;
3434 esac
3435
3436 case "$target" in
3437 NONE) lt_target="$host" ;;
3438 *) lt_target="$target" ;;
3439 esac
3440
3441 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3442 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3443 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
3444 echo "configure:3441: checking for $ac_word" 1>&5
3445 if test "${ac_cv_prog_RANLIB+set}" = set; then
3446   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3447 else
3448   if test -n "$RANLIB"; then
3449   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3450 else
3451   for ac_path in `IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3452 ac_dummy="$PATH"
3453 for ac_dir in $ac_dummy; do
3454   test -z "$ac_dir" && ac_dir=.
3455   if test -f $ac_dir/$ac_word; then
3456     echo "$ac_dir/$ac_word"
3457   fi
3458 done
3459 IFS="$ac_save_ifs"
3460 `; do
3461     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3462     break
3463   done
3464 fi
3465 fi
3466 RANLIB="$ac_cv_prog_RANLIB"
3467 if test -n "$RANLIB"; then
3468   echo "$ECHO_T""$RANLIB" 1>&6
3469 else
3470   echo "$ECHO_T""no" 1>&6
3471 fi
3472
3473 if test -z "$ac_cv_prog_RANLIB"; then
3474   if test -n "$ac_tool_prefix"; then
3475     # Extract the first word of "ranlib", so it can be a program name with args.
3476 set dummy ranlib; ac_word=$2
3477 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
3478 echo "configure:3475: checking for $ac_word" 1>&5
3479 if test "${ac_cv_prog_RANLIB+set}" = set; then
3480   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3481 else
3482   if test -n "$RANLIB"; then
3483   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3484 else
3485   for ac_path in `IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3486 ac_dummy="$PATH"
3487 for ac_dir in $ac_dummy; do
3488   test -z "$ac_dir" && ac_dir=.
3489   if test -f $ac_dir/$ac_word; then
3490     echo "$ac_dir/$ac_word"
3491   fi
3492 done
3493 IFS="$ac_save_ifs"
3494 `; do
3495     ac_cv_prog_RANLIB="ranlib"
3496     break
3497   done
3498   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
3499 fi
3500 fi
3501 RANLIB="$ac_cv_prog_RANLIB"
3502 if test -n "$RANLIB"; then
3503   echo "$ECHO_T""$RANLIB" 1>&6
3504 else
3505   echo "$ECHO_T""no" 1>&6
3506 fi
3507
3508   else
3509     RANLIB=":"
3510   fi
3511 fi
3512
3513 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
3514 set dummy ${ac_tool_prefix}strip; ac_word=$2
3515 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
3516 echo "configure:3513: checking for $ac_word" 1>&5
3517 if test "${ac_cv_prog_STRIP+set}" = set; then
3518   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3519 else
3520   if test -n "$STRIP"; then
3521   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
3522 else
3523   for ac_path in `IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3524 ac_dummy="$PATH"
3525 for ac_dir in $ac_dummy; do
3526   test -z "$ac_dir" && ac_dir=.
3527   if test -f $ac_dir/$ac_word; then
3528     echo "$ac_dir/$ac_word"
3529   fi
3530 done
3531 IFS="$ac_save_ifs"
3532 `; do
3533     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
3534     break
3535   done
3536 fi
3537 fi
3538 STRIP="$ac_cv_prog_STRIP"
3539 if test -n "$STRIP"; then
3540   echo "$ECHO_T""$STRIP" 1>&6
3541 else
3542   echo "$ECHO_T""no" 1>&6
3543 fi
3544
3545 if test -z "$ac_cv_prog_STRIP"; then
3546   if test -n "$ac_tool_prefix"; then
3547     # Extract the first word of "strip", so it can be a program name with args.
3548 set dummy strip; ac_word=$2
3549 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
3550 echo "configure:3547: checking for $ac_word" 1>&5
3551 if test "${ac_cv_prog_STRIP+set}" = set; then
3552   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3553 else
3554   if test -n "$STRIP"; then
3555   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
3556 else
3557   for ac_path in `IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3558 ac_dummy="$PATH"
3559 for ac_dir in $ac_dummy; do
3560   test -z "$ac_dir" && ac_dir=.
3561   if test -f $ac_dir/$ac_word; then
3562     echo "$ac_dir/$ac_word"
3563   fi
3564 done
3565 IFS="$ac_save_ifs"
3566 `; do
3567     ac_cv_prog_STRIP="strip"
3568     break
3569   done
3570   test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
3571 fi
3572 fi
3573 STRIP="$ac_cv_prog_STRIP"
3574 if test -n "$STRIP"; then
3575   echo "$ECHO_T""$STRIP" 1>&6
3576 else
3577   echo "$ECHO_T""no" 1>&6
3578 fi
3579
3580   else
3581     STRIP=":"
3582   fi
3583 fi
3584
3585 # Check for any special flags to pass to ltconfig.
3586 libtool_flags="--cache-file=$cache_file"
3587 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
3588 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
3589 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
3590 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
3591 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
3592
3593 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
3594 if test "${enable_libtool_lock+set}" = set; then
3595   enableval="$enable_libtool_lock"
3596
3597 fi
3598 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
3599 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
3600
3601 # Check whether --with-pic or --without-pic was given.
3602 if test "${with_pic+set}" = set; then
3603   withval="$with_pic"
3604   pic_mode="$withval"
3605 else
3606   pic_mode=default
3607 fi
3608 test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
3609 test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
3610
3611 # Some flags need to be propagated to the compiler or linker for good
3612 # libtool support.
3613 case "$lt_target" in
3614 *-*-irix6*)
3615   # Find out which ABI we are using.
3616   echo '#line 3613 "configure"' > conftest.$ac_ext
3617   if { (eval echo configure:3614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3618     case "`/usr/bin/file conftest.o`" in
3619     *32-bit*)
3620       LD="${LD-ld} -32"
3621       ;;
3622     *N32*)
3623       LD="${LD-ld} -n32"
3624       ;;
3625     *64-bit*)
3626       LD="${LD-ld} -64"
3627       ;;
3628     esac
3629   fi
3630   rm -rf conftest*
3631   ;;
3632
3633 *-*-sco3.2v5*)
3634   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3635   SAVE_CFLAGS="$CFLAGS"
3636   CFLAGS="$CFLAGS -belf"
3637   echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" 1>&6
3638 echo "configure:3635: checking whether the C compiler needs -belf" 1>&5
3639 if test "${lt_cv_cc_needs_belf+set}" = set; then
3640   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3641 else
3642
3643      ac_ext=c
3644 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3645 ac_cpp='$CPP $CPPFLAGS'
3646 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3647 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3648 cross_compiling=$ac_cv_prog_cc_cross
3649
3650      cat >conftest.$ac_ext <<EOF
3651 #line 3648 "configure"
3652 #include "confdefs.h"
3653
3654 int
3655 main()
3656 {
3657
3658   ;
3659   return 0;
3660 }
3661 EOF
3662 if { (eval echo configure:3659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3663   rm -rf conftest*
3664   lt_cv_cc_needs_belf=yes
3665 else
3666   echo "configure: failed program was:" >&5
3667   cat conftest.$ac_ext >&5
3668   rm -rf conftest*
3669   lt_cv_cc_needs_belf=no
3670 fi
3671 rm -f conftest*
3672
3673      ac_ext=c
3674 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3675 ac_cpp='$CPP $CPPFLAGS'
3676 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3677 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3678 cross_compiling=$ac_cv_prog_cc_cross
3679
3680 fi
3681 echo "$ECHO_T""$lt_cv_cc_needs_belf" 1>&6
3682   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3683     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3684     CFLAGS="$SAVE_CFLAGS"
3685   fi
3686   ;;
3687
3688 esac
3689
3690 # Save cache, so that ltconfig can load it
3691 cat >confcache <<\EOF
3692 # This file is a shell script that caches the results of configure
3693 # tests run on this system so they can be shared between configure
3694 # scripts and configure runs.  It is not useful on other systems.
3695 # If it contains results you don't want to keep, you may remove or edit it.
3696 #
3697 # By default, configure uses ./config.cache as the cache file,
3698 # creating it if it does not exist already.  You can give configure
3699 # the --cache-file=FILE option to use a different cache file; that is
3700 # what configure does when it calls configure scripts in
3701 # subdirectories, so they share the cache.
3702 # Giving --cache-file=/dev/null disables caching, for debugging configure.
3703 # config.status only pays attention to the cache file if you give it the
3704 # --recheck option to rerun configure.
3705 #
3706 EOF
3707 # The following way of writing the cache mishandles newlines in values,
3708 # but we know of no workaround that is simple, portable, and efficient.
3709 # So, don't put newlines in cache variables' values.
3710 # Ultrix sh set writes to stderr and can't be redirected directly,
3711 # and sets the high bit in the cache file unless we assign to the vars.
3712 (set) 2>&1 |
3713   case `(ac_space=' '; set | grep ac_space) 2>&1` in
3714   *ac_space=\ *)
3715     # `set' does not quote correctly, so add quotes (double-quote substitution
3716     # turns \\\\ into \\, and sed turns \\ into \).
3717     sed -n \
3718       -e "s/'/'\\\\''/g" \
3719       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
3720     ;;
3721   *)
3722     # `set' quotes correctly as required by POSIX, so do not add quotes.
3723     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
3724     ;;
3725   esac >>confcache
3726 if cmp -s $cache_file confcache; then :; else
3727   if test -w $cache_file; then
3728     echo "updating cache $cache_file"
3729     cat confcache >$cache_file
3730   else
3731     echo "not updating unwritable cache $cache_file"
3732   fi
3733 fi
3734 rm -f confcache
3735
3736 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3737 AR="$AR" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3738 MAGIC="$MAGIC" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3739 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
3740 AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
3741 objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
3742 deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
3743 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3744 $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $lt_target \
3745 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3746
3747 # Reload cache, that may have been modified by ltconfig
3748 if test -r "$cache_file"; then
3749   echo "loading cache $cache_file"
3750       test -f "$cache_file" && . $cache_file
3751 else
3752   echo "creating cache $cache_file"
3753   >$cache_file
3754 fi
3755
3756 # This can be used to rebuild libtool when needed
3757 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3758
3759 # Always use our own libtool.
3760 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3761
3762 # Redirect the config.log output again, so that the ltconfig log is not
3763 # clobbered by the next message.
3764 exec 5>>./config.log
3765
3766 echo $ECHO_N "checking whether optarg is declared... $ECHO_C" 1>&6
3767 echo "configure:3764: checking whether optarg is declared" 1>&5
3768 if test "${ac_cv_have_decl_optarg+set}" = set; then
3769   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3770 else
3771   cat >conftest.$ac_ext <<EOF
3772 #line 3769 "configure"
3773 #include "confdefs.h"
3774 $ac_includes_default
3775 int
3776 main ()
3777 {
3778 #ifndef optarg
3779   char *p = (char *) optarg;
3780 #endif
3781
3782   ;
3783   return 0;
3784 }
3785 EOF
3786 if { (eval echo configure:3783: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3787   rm -rf conftest*
3788   ac_cv_have_decl_optarg=yes
3789 else
3790   echo "configure: failed program was:" >&5
3791   cat conftest.$ac_ext >&5
3792   rm -rf conftest*
3793   ac_cv_have_decl_optarg=no
3794 fi
3795 rm -f conftest*
3796 fi
3797 echo "$ECHO_T""$ac_cv_have_decl_optarg" 1>&6
3798 if test $ac_cv_have_decl_optarg = yes; then
3799   cat >>confdefs.h <<EOF
3800 #define HAVE_DECL_OPTARG 1
3801 EOF
3802
3803 else
3804   cat >>confdefs.h <<EOF
3805 #define HAVE_DECL_OPTARG 0
3806 EOF
3807
3808 fi
3809
3810 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" 1>&6
3811 echo "configure:3808: checking for ANSI C header files" 1>&5
3812 if test "${ac_cv_header_stdc+set}" = set; then
3813   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3814 else
3815
3816 cat >conftest.$ac_ext <<EOF
3817 #line 3814 "configure"
3818 #include "confdefs.h"
3819 #include <stdlib.h>
3820 #include <stdarg.h>
3821 #include <string.h>
3822 #include <float.h>
3823
3824 EOF
3825 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3826 { (eval echo configure:3823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3827 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3828 if test -z "$ac_err"; then
3829   rm -rf conftest*
3830   ac_cv_header_stdc=yes
3831 else
3832   echo "$ac_err" >&5
3833   echo "configure: failed program was:" >&5
3834   cat conftest.$ac_ext >&5
3835   rm -rf conftest*
3836   ac_cv_header_stdc=no
3837 fi
3838 rm -f conftest*
3839
3840 if test $ac_cv_header_stdc = yes; then
3841   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3842
3843 cat >conftest.$ac_ext <<EOF
3844 #line 3841 "configure"
3845 #include "confdefs.h"
3846 #include <string.h>
3847
3848 EOF
3849 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3850   egrep "memchr" >/dev/null 2>&1; then
3851   :
3852 else
3853   rm -rf conftest*
3854   ac_cv_header_stdc=no
3855 fi
3856 rm -f conftest*
3857
3858 fi
3859
3860 if test $ac_cv_header_stdc = yes; then
3861   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3862
3863 cat >conftest.$ac_ext <<EOF
3864 #line 3861 "configure"
3865 #include "confdefs.h"
3866 #include <stdlib.h>
3867
3868 EOF
3869 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3870   egrep "free" >/dev/null 2>&1; then
3871   :
3872 else
3873   rm -rf conftest*
3874   ac_cv_header_stdc=no
3875 fi
3876 rm -f conftest*
3877
3878 fi
3879
3880 if test $ac_cv_header_stdc = yes; then
3881   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3882 if test "$cross_compiling" = yes; then
3883   :
3884 else
3885   cat >conftest.$ac_ext <<EOF
3886 #line 3883 "configure"
3887 #include "confdefs.h"
3888 #include <ctype.h>
3889 #if ((' ' & 0x0FF) == 0x020)
3890 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3891 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3892 #else
3893 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
3894                      || ('j' <= (c) && (c) <= 'r') \
3895                      || ('s' <= (c) && (c) <= 'z'))
3896 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
3897 #endif
3898
3899 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3900 int
3901 main ()
3902 {
3903   int i;
3904   for (i = 0; i < 256; i++)
3905     if (XOR (islower (i), ISLOWER (i))
3906         || toupper (i) != TOUPPER (i))
3907       exit(2);
3908   exit (0);
3909 }
3910 EOF
3911 if { (eval echo configure:3908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3912 then
3913   :
3914 else
3915   echo "configure: failed program was:" >&5
3916   cat conftest.$ac_ext >&5
3917   rm -fr conftest*
3918   ac_cv_header_stdc=no
3919 fi
3920 rm -fr conftest*
3921
3922 fi
3923
3924 fi
3925 fi
3926 echo "$ECHO_T""$ac_cv_header_stdc" 1>&6
3927 if test $ac_cv_header_stdc = yes; then
3928   cat >>confdefs.h <<\EOF
3929 #define STDC_HEADERS 1
3930 EOF
3931
3932 fi
3933
3934 for ac_header in getopt.h unistd.h sys/sysctl.h sys/time.h
3935 do
3936 ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
3937 echo $ECHO_N "checking for $ac_header... $ECHO_C" 1>&6
3938 echo "configure:3935: checking for $ac_header" 1>&5
3939 if eval "test \"\${$ac_ac_Header+set}\" = set"; then
3940   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3941 else
3942
3943 cat >conftest.$ac_ext <<EOF
3944 #line 3941 "configure"
3945 #include "confdefs.h"
3946 #include <$ac_header>
3947
3948 EOF
3949 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3950 { (eval echo configure:3947: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3951 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3952 if test -z "$ac_err"; then
3953   rm -rf conftest*
3954   eval "$ac_ac_Header=yes"
3955 else
3956   echo "$ac_err" >&5
3957   echo "configure: failed program was:" >&5
3958   cat conftest.$ac_ext >&5
3959   rm -rf conftest*
3960   eval "$ac_ac_Header=no"
3961 fi
3962 rm -f conftest*
3963 fi
3964 echo "$ECHO_T""`eval echo '${'$ac_ac_Header'}'`" 1>&6
3965 if test `eval echo '${'$ac_ac_Header'}'` = yes; then
3966   cat >>confdefs.h <<EOF
3967 #define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
3968 EOF
3969
3970 fi
3971 done
3972
3973 echo $ECHO_N "checking for void... $ECHO_C" 1>&6
3974 echo "configure:3971: checking for void" 1>&5
3975 if test "${ac_cv_type_void+set}" = set; then
3976   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3977 else
3978   cat >conftest.$ac_ext <<EOF
3979 #line 3976 "configure"
3980 #include "confdefs.h"
3981 $ac_includes_default
3982 int
3983 main ()
3984 {
3985 if ((void *) 0)
3986   return 0;
3987 if (sizeof (void))
3988   return 0;
3989   ;
3990   return 0;
3991 }
3992 EOF
3993 if { (eval echo configure:3990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3994   rm -rf conftest*
3995   ac_cv_type_void=yes
3996 else
3997   echo "configure: failed program was:" >&5
3998   cat conftest.$ac_ext >&5
3999   rm -rf conftest*
4000   ac_cv_type_void=no
4001 fi
4002 rm -f conftest*
4003 fi
4004 echo "$ECHO_T""$ac_cv_type_void" 1>&6
4005 if test $ac_cv_type_void = yes; then
4006   cat >>confdefs.h <<EOF
4007 #define HAVE_VOID 1
4008 EOF
4009
4010 fi
4011
4012 echo $ECHO_N "checking for preprocessor stringizing operator... $ECHO_C" 1>&6
4013 echo "configure:4010: checking for preprocessor stringizing operator" 1>&5
4014 if test "${ac_cv_c_stringize+set}" = set; then
4015   echo $ECHO_N "(cached) $ECHO_C" 1>&6
4016 else
4017
4018 cat >conftest.$ac_ext <<EOF
4019 #line 4016 "configure"
4020 #include "confdefs.h"
4021
4022 #define x(y) #y
4023
4024 char *s = x(teststring);
4025
4026 EOF
4027 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4028   egrep "#teststring" >/dev/null 2>&1; then
4029   rm -rf conftest*
4030   ac_cv_c_stringize=no
4031 else
4032   rm -rf conftest*
4033   ac_cv_c_stringize=yes
4034 fi
4035 rm -f conftest*
4036
4037 fi
4038
4039 if test "${ac_cv_c_stringize}" = yes; then
4040   cat >>confdefs.h <<\EOF
4041 #define HAVE_STRINGIZE 1
4042 EOF
4043
4044 fi
4045 echo "$ECHO_T""${ac_cv_c_stringize}" 1>&6
4046
4047 for ac_func in getopt_long getpagesize popen processor_info strtoul sysconf sysctlbyname
4048 do
4049 ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
4050 echo $ECHO_N "checking for $ac_func... $ECHO_C" 1>&6
4051 echo "configure:4048: checking for $ac_func" 1>&5
4052 if eval "test \"\${$ac_ac_var+set}\" = set"; then
4053   echo $ECHO_N "(cached) $ECHO_C" 1>&6
4054 else
4055   cat >conftest.$ac_ext <<EOF
4056 #line 4053 "configure"
4057 #include "confdefs.h"
4058 /* System header to define __stub macros and hopefully few prototypes,
4059     which can conflict with char $ac_func(); below.  */
4060 #include <assert.h>
4061 /* Override any gcc2 internal prototype to avoid an error.  */
4062 /* We use char because int might match the return type of a gcc2
4063     builtin and then its argument prototype would still apply.  */
4064 char $ac_func();
4065 char (*f)();
4066
4067 int
4068 main()
4069 {
4070
4071 /* The GNU C library defines this for functions which it implements
4072     to always fail with ENOSYS.  Some functions are actually named
4073     something starting with __ and the normal name is an alias.  */
4074 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4075 choke me
4076 #else
4077 f = $ac_func;
4078 #endif
4079
4080   ;
4081   return 0;
4082 }
4083 EOF
4084 if { (eval echo configure:4081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4085   rm -rf conftest*
4086   eval "$ac_ac_var=yes"
4087 else
4088   echo "configure: failed program was:" >&5
4089   cat conftest.$ac_ext >&5
4090   rm -rf conftest*
4091   eval "$ac_ac_var=no"
4092 fi
4093 rm -f conftest*
4094
4095 fi
4096 echo "$ECHO_T""`eval echo '${'$ac_ac_var'}'`" 1>&6
4097 if test `eval echo '${'$ac_ac_var'}'` = yes; then
4098   cat >>confdefs.h <<EOF
4099 #define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
4100 EOF
4101
4102 fi
4103 done
4104
4105 echo $ECHO_N "checking if ansi2knr should be used... $ECHO_C" 1>&6
4106 echo "configure:4103: checking if ansi2knr should be used" 1>&5
4107 if test "${gmp_cv_c_ansi2knr+set}" = set; then
4108   echo $ECHO_N "(cached) $ECHO_C" 1>&6
4109 else
4110   cat >conftest.c <<EOF
4111 int main (int argc, char *argv) { return 0; }
4112 EOF
4113 if { (eval echo configure:4110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4114   gmp_cv_c_ansi2knr=no
4115 else
4116   gmp_cv_c_ansi2knr=yes
4117 fi
4118 rm -f conftest.*
4119
4120 fi
4121 echo "$ECHO_T""$gmp_cv_c_ansi2knr" 1>&6
4122 if test $gmp_cv_c_ansi2knr = no; then
4123   U= ANSI2KNR=
4124 else
4125   U=_ ANSI2KNR=./ansi2knr
4126   # Ensure some checks needed by ansi2knr itself.
4127
4128 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" 1>&6
4129 echo "configure:4126: checking for ANSI C header files" 1>&5
4130 if test "${ac_cv_header_stdc+set}" = set; then
4131   echo $ECHO_N "(cached) $ECHO_C" 1>&6
4132 else
4133
4134 cat >conftest.$ac_ext <<EOF
4135 #line 4132 "configure"
4136 #include "confdefs.h"
4137 #include <stdlib.h>
4138 #include <stdarg.h>
4139 #include <string.h>
4140 #include <float.h>
4141
4142 EOF
4143 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4144 { (eval echo configure:4141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4145 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4146 if test -z "$ac_err"; then
4147   rm -rf conftest*
4148   ac_cv_header_stdc=yes
4149 else
4150   echo "$ac_err" >&5
4151   echo "configure: failed program was:" >&5
4152   cat conftest.$ac_ext >&5
4153   rm -rf conftest*
4154   ac_cv_header_stdc=no
4155 fi
4156 rm -f conftest*
4157
4158 if test $ac_cv_header_stdc = yes; then
4159   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4160
4161 cat >conftest.$ac_ext <<EOF
4162 #line 4159 "configure"
4163 #include "confdefs.h"
4164 #include <string.h>
4165
4166 EOF
4167 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4168   egrep "memchr" >/dev/null 2>&1; then
4169   :
4170 else
4171   rm -rf conftest*
4172   ac_cv_header_stdc=no
4173 fi
4174 rm -f conftest*
4175
4176 fi
4177
4178 if test $ac_cv_header_stdc = yes; then
4179   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4180
4181 cat >conftest.$ac_ext <<EOF
4182 #line 4179 "configure"
4183 #include "confdefs.h"
4184 #include <stdlib.h>
4185
4186 EOF
4187 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4188   egrep "free" >/dev/null 2>&1; then
4189   :
4190 else
4191   rm -rf conftest*
4192   ac_cv_header_stdc=no
4193 fi
4194 rm -f conftest*
4195
4196 fi
4197
4198 if test $ac_cv_header_stdc = yes; then
4199   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4200 if test "$cross_compiling" = yes; then
4201   :
4202 else
4203   cat >conftest.$ac_ext <<EOF
4204 #line 4201 "configure"
4205 #include "confdefs.h"
4206 #include <ctype.h>
4207 #if ((' ' & 0x0FF) == 0x020)
4208 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4209 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4210 #else
4211 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4212                      || ('j' <= (c) && (c) <= 'r') \
4213                      || ('s' <= (c) && (c) <= 'z'))
4214 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
4215 #endif
4216
4217 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4218 int
4219 main ()
4220 {
4221   int i;
4222   for (i = 0; i < 256; i++)
4223     if (XOR (islower (i), ISLOWER (i))
4224         || toupper (i) != TOUPPER (i))
4225       exit(2);
4226   exit (0);
4227 }
4228 EOF
4229 if { (eval echo configure:4226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4230 then
4231   :
4232 else
4233   echo "configure: failed program was:" >&5
4234   cat conftest.$ac_ext >&5
4235   rm -fr conftest*
4236   ac_cv_header_stdc=no
4237 fi
4238 rm -fr conftest*
4239
4240 fi
4241
4242 fi
4243 fi
4244 echo "$ECHO_T""$ac_cv_header_stdc" 1>&6
4245 if test $ac_cv_header_stdc = yes; then
4246   cat >>confdefs.h <<\EOF
4247 #define STDC_HEADERS 1
4248 EOF
4249
4250 fi
4251
4252   for ac_header in string.h
4253 do
4254 ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
4255 echo $ECHO_N "checking for $ac_header... $ECHO_C" 1>&6
4256 echo "configure:4253: checking for $ac_header" 1>&5
4257 if eval "test \"\${$ac_ac_Header+set}\" = set"; then
4258   echo $ECHO_N "(cached) $ECHO_C" 1>&6
4259 else
4260
4261 cat >conftest.$ac_ext <<EOF
4262 #line 4259 "configure"
4263 #include "confdefs.h"
4264 #include <$ac_header>
4265
4266 EOF
4267 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4268 { (eval echo configure:4265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4269 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4270 if test -z "$ac_err"; then
4271   rm -rf conftest*
4272   eval "$ac_ac_Header=yes"
4273 else
4274   echo "$ac_err" >&5
4275   echo "configure: failed program was:" >&5
4276   cat conftest.$ac_ext >&5
4277   rm -rf conftest*
4278   eval "$ac_ac_Header=no"
4279 fi
4280 rm -f conftest*
4281 fi
4282 echo "$ECHO_T""`eval echo '${'$ac_ac_Header'}'`" 1>&6
4283 if test `eval echo '${'$ac_ac_Header'}'` = yes; then
4284   cat >>confdefs.h <<EOF
4285 #define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
4286 EOF
4287
4288 fi
4289 done
4290
4291 fi
4292
4293 syntax=
4294 # For now, we use the old switch for setting syntax.
4295 # FIXME: Remove when conversion to .asm is completed.
4296 case "${target}" in
4297   m680[234]0*-*-linuxaout* | m68k*-*-linuxaout* | \
4298   m68k-next-nextstep* | \
4299   m68000*-*-*)
4300     syntax=mit
4301     ;;
4302   m680[234]0*-*-linux* | m68k*-*-linux*)
4303     syntax=elf
4304     ;;
4305   m680[234]0*-*-* | m68k*-*-*)
4306     syntax=mit
4307     ;;
4308 esac
4309
4310 # Now build an asm-syntax.h file for targets that include that from the
4311 # assembly files.
4312 # FIXME: Remove when conversion to .asm is completed.
4313 case "${family}-${underscore}-${asm_align}-${syntax}" in
4314   m68k-yes-log-mit)
4315     echo '#define MIT_SYNTAX' >asm-syntax.h
4316     cat $srcdir/mpn/underscore.h >>asm-syntax.h
4317     echo '#include "'$srcdir'/mpn/m68k/syntax.h"' >>asm-syntax.h;;
4318   m68k-no-nolog-elf)
4319     echo '#define ELF_SYNTAX' >asm-syntax.h
4320     echo '#define C_SYMBOL_NAME(name) name' >>asm-syntax.h
4321     echo '#include "'$srcdir'/mpn/m68k/syntax.h"' >>asm-syntax.h;;
4322 esac
4323
4324 # The pattern here tests for an absolute path the same way as
4325 # _AC_OUTPUT_FILES in autoconf acgeneral.m4.
4326
4327 echo "dnl  CONFIG_TOP_SRCDIR is a path from the mpn builddir to the top srcdir" >> $gmp_tmpconfigm4
4328
4329 case "$srcdir" in
4330 [\\/]* | ?:[\\/]* )
4331
4332 echo "define(<CONFIG_TOP_SRCDIR>,<\`$srcdir'>)" >> $gmp_tmpconfigm4
4333     ;;
4334 *)
4335
4336 echo "define(<CONFIG_TOP_SRCDIR>,<\`../$srcdir'>)" >> $gmp_tmpconfigm4
4337  ;;
4338 esac
4339
4340 echo "include(CONFIG_TOP_SRCDIR\`/mpn/asm-defs.m4')" >> $gmp_tmpconfigm4p
4341
4342 # Must be after asm-defs.m4
4343
4344 echo "define_not_for_expansion(\`HAVE_TARGET_CPU_$target_cpu')" >> $gmp_tmpconfigm4p
4345
4346 case "$target" in
4347   alpha*-cray-unicos*)
4348     gmp_m4postinc="alpha/unicos.m4"
4349     ;;
4350   alpha*-*-*)
4351     gmp_m4postinc="alpha/default.m4"
4352     ;;
4353   power*-*-*)
4354     case "$target" in
4355       *-*-mach* | *-*-rhapsody* | *-*-nextstep*)
4356         ;;      # these use non-conventional assembly syntax.
4357       powerpc64-*-aix*)
4358         gmp_m4postinc="powerpc32/regmap.m4 powerpc64/aix.m4"
4359         ;;
4360       *-*-aix*)
4361         gmp_m4postinc="powerpc32/regmap.m4 powerpc32/aix.m4"
4362         ;;
4363       *)
4364         gmp_m4postinc="powerpc32/regmap.m4"
4365         ;;
4366     esac
4367     ;;
4368 esac
4369
4370 for tmp_f in $gmp_m4postinc; do
4371
4372 echo "include_mpn(\`$tmp_f')" >> $gmp_tmpconfigm4p
4373
4374 done
4375
4376 # Set up `gmp_links'.  It's a list of link:file pairs that configure will
4377 # process to create link -> file.
4378 gmp_links=
4379
4380 # If the user specified `MPN_PATH', use that instead of the path we've
4381 # come up with.
4382 if test -z "$MPN_PATH"; then
4383   path="$path generic"
4384 else
4385   path="$MPN_PATH"
4386 fi
4387
4388 # Pick the correct source files in $path and link them to mpn/.
4389 # $gmp_mpn_functions lists all functions we need.
4390 #
4391 # The rule is to find a file with the function name and a .asm, .S,
4392 # .s, or .c extension.  Certain multi-function files with special names
4393 # can provide some functions too.  (mpn/Makefile.am passes
4394 # -DOPERATION_<func> to get them to generate the right code.)
4395
4396 # FIXME: udiv and umul aren't in $gmp_mpn_functions_optional yet since
4397 # there's some versions of those files which should be checked for bit
4398 # rot first.  Put them in $extra_functions for each target for now,
4399 # change to standard optionals when all are ready.
4400
4401 # Note: The following lines defining $gmp_mpn_functions_optional
4402 #       and $gmp_mpn_functions are parsed by the "macos/configure"
4403 #       Perl script. So if you change the lines in a major way
4404 #       make sure to run and examine the output from
4405 #
4406 #           % (cd macos; perl configure)
4407
4408 gmp_mpn_functions_optional="copyi copyd com_n           \
4409   and_n andn_n nand_n ior_n iorn_n nior_n xor_n xnor_n"
4410
4411 gmp_mpn_functions="${extra_functions} inlines add_n sub_n mul_1 addmul_1   \
4412   submul_1 lshift rshift diveby3 divrem divrem_1 divrem_2                  \
4413   mod_1 mod_1_rs pre_mod_1 dump                                            \
4414   mul mul_fft mul_n mul_basecase sqr_basecase random                       \
4415   random2 sqrtrem get_str set_str scan0 scan1 popcount hamdist cmp perfsqr \
4416   bdivmod gcd_1 gcd gcdext tdiv_qr bz_divrem_n sb_divrem_mn jacbase        \
4417   $gmp_mpn_functions_optional"
4418
4419 # the list of all object files used by mpn/Makefile.in and the
4420 # top-level Makefile.in, respectively
4421 mpn_objects=
4422 mpn_objs_in_libgmp="mpn/mp_bases.lo"
4423
4424 for tmp_fn in ${gmp_mpn_functions} ; do
4425   rm -f mpn/${tmp_fn}.[Ssc] mpn/${tmp_fn}.asm
4426
4427   # functions that can be provided by multi-function files
4428   tmp_mulfunc=
4429   case $tmp_fn in
4430   add_n|sub_n)       tmp_mulfunc="aors_n"    ;;
4431   addmul_1|submul_1) tmp_mulfunc="aorsmul_1" ;;
4432   popcount|hamdist)  tmp_mulfunc="popham"    ;;
4433   and_n|andn_n|nand_n | ior_n|iorn_n|nior_n | xor_n|xnor_n)
4434                      tmp_mulfunc="logops_n"  ;;
4435   esac
4436
4437   found=no
4438   for tmp_dir in $path; do
4439     for tmp_base in $tmp_fn $tmp_mulfunc; do
4440       for tmp_ext in asm S s c; do
4441         tmp_file=$srcdir/mpn/$tmp_dir/$tmp_base.$tmp_ext
4442         if test -f $tmp_file; then
4443           found=yes
4444
4445           mpn_objects="$mpn_objects ${tmp_fn}.lo"
4446           mpn_objs_in_libgmp="$mpn_objs_in_libgmp mpn/${tmp_fn}.lo"
4447           gmp_links="$gmp_links mpn/$tmp_fn.$tmp_ext:mpn/$tmp_dir/$tmp_base.$tmp_ext"
4448
4449           # duplicate AC_DEFINEs are harmless, so it doesn't matter
4450           # that multi-function files get grepped here repeatedly
4451           gmp_ep="`
4452             sed -n 's/^[        ]*MULFUNC_PROLOGUE(\(.*\))/\1/p' $tmp_file ;
4453             sed -n 's/^[        ]*PROLOGUE(\(.*\))/\1/p' $tmp_file
4454           `"
4455           for gmp_tmp in $gmp_ep; do
4456             cat >>confdefs.h <<EOF
4457 #define HAVE_NATIVE_${gmp_tmp} 1
4458 EOF
4459
4460           done
4461
4462           break
4463         fi
4464       done
4465       if test $found = yes; then break ; fi
4466     done
4467     if test $found = yes; then break ; fi
4468   done
4469
4470   if test $found = no; then
4471     for tmp_optional in $gmp_mpn_functions_optional; do
4472       if test $tmp_optional = $tmp_fn; then
4473         found=yes
4474       fi
4475     done
4476     if test $found = no; then
4477       { echo "configure: error: no version of $tmp_fn found in path: $path" 1>&2; exit 1; }
4478     fi
4479   fi
4480 done
4481
4482 # Create link for gmp-mparam.h.
4483 for tmp_dir in $path ; do
4484   rm -f gmp-mparam.h
4485   if test -f $srcdir/mpn/${tmp_dir}/gmp-mparam.h ; then
4486     gmp_links="$gmp_links gmp-mparam.h:mpn/${tmp_dir}/gmp-mparam.h"
4487
4488     # Copy any KARATSUBA_SQR_THRESHOLD in gmp-mparam.h to config.m4.
4489     # Some versions of sqr_basecase.asm use this.
4490     tmp_gmp_karatsuba_sqr_threshold="`sed -n 's/^#define KARATSUBA_SQR_THRESHOLD[       ]*\([0-9][0-9]*\).*$/\1/p' $srcdir/mpn/${tmp_dir}/gmp-mparam.h`"
4491     if test -n "$tmp_gmp_karatsuba_sqr_threshold"; then
4492
4493 echo "define(<KARATSUBA_SQR_THRESHOLD>,<$tmp_gmp_karatsuba_sqr_threshold>)" >> $gmp_tmpconfigm4
4494
4495     fi
4496
4497     break
4498   fi
4499 done
4500
4501 # Dig out the links from `gmp_links' for inclusion in DISTCLEANFILES.
4502 gmp_srclinks=
4503 for f in $gmp_links; do
4504   gmp_srclinks="$gmp_srclinks `echo $f | sed 's/\(.*\):.*/\1/'`"
4505 done
4506
4507 echo "creating $gmp_configm4"
4508 echo "dnl $gmp_configm4.  Generated automatically by configure." > $gmp_configm4
4509 if test -f $gmp_tmpconfigm4; then
4510   echo "changequote(<,>)dnl" >> $gmp_configm4
4511   echo "ifdef(<__CONFIG_M4_INCLUDED__>,,<" >> $gmp_configm4
4512   cat $gmp_tmpconfigm4 >> $gmp_configm4
4513   echo ">)" >> $gmp_configm4
4514   echo "changequote(\`,')dnl" >> $gmp_configm4
4515   rm $gmp_tmpconfigm4
4516 fi
4517 echo "ifdef(\`__CONFIG_M4_INCLUDED__',,\`" >> $gmp_configm4
4518 if test -f $gmp_tmpconfigm4i; then
4519   cat $gmp_tmpconfigm4i >> $gmp_configm4
4520   rm $gmp_tmpconfigm4i
4521 fi
4522 if test -f $gmp_tmpconfigm4p; then
4523   cat $gmp_tmpconfigm4p >> $gmp_configm4
4524   rm $gmp_tmpconfigm4p
4525 fi
4526 echo "')" >> $gmp_configm4
4527 echo "define(\`__CONFIG_M4_INCLUDED__')" >> $gmp_configm4
4528
4529 trap '' 1 2 15
4530 cat >confcache <<\EOF
4531 # This file is a shell script that caches the results of configure
4532 # tests run on this system so they can be shared between configure
4533 # scripts and configure runs.  It is not useful on other systems.
4534 # If it contains results you don't want to keep, you may remove or edit it.
4535 #
4536 # By default, configure uses ./config.cache as the cache file,
4537 # creating it if it does not exist already.  You can give configure
4538 # the --cache-file=FILE option to use a different cache file; that is
4539 # what configure does when it calls configure scripts in
4540 # subdirectories, so they share the cache.
4541 # Giving --cache-file=/dev/null disables caching, for debugging configure.
4542 # config.status only pays attention to the cache file if you give it the
4543 # --recheck option to rerun configure.
4544 #
4545 EOF
4546 # The following way of writing the cache mishandles newlines in values,
4547 # but we know of no workaround that is simple, portable, and efficient.
4548 # So, don't put newlines in cache variables' values.
4549 # Ultrix sh set writes to stderr and can't be redirected directly,
4550 # and sets the high bit in the cache file unless we assign to the vars.
4551 (set) 2>&1 |
4552   case `(ac_space=' '; set | grep ac_space) 2>&1` in
4553   *ac_space=\ *)
4554     # `set' does not quote correctly, so add quotes (double-quote substitution
4555     # turns \\\\ into \\, and sed turns \\ into \).
4556     sed -n \
4557       -e "s/'/'\\\\''/g" \
4558       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
4559     ;;
4560   *)
4561     # `set' quotes correctly as required by POSIX, so do not add quotes.
4562     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
4563     ;;
4564   esac >>confcache
4565 if cmp -s $cache_file confcache; then :; else
4566   if test -w $cache_file; then
4567     echo "updating cache $cache_file"
4568     cat confcache >$cache_file
4569   else
4570     echo "not updating unwritable cache $cache_file"
4571   fi
4572 fi
4573 rm -f confcache
4574
4575 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
4576
4577 test "x$prefix" = xNONE && prefix=$ac_default_prefix
4578 # Let make expand exec_prefix.
4579 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
4580
4581 # Any assignment to VPATH causes Sun make to only execute
4582 # the first set of double-colon rules, so remove it if not needed.
4583 # If there is a colon in the path, we need to keep it.
4584 if test "x$srcdir" = x.; then
4585   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
4586 fi
4587
4588 DEFS=-DHAVE_CONFIG_H
4589
4590 : ${CONFIG_STATUS=./config.status}
4591 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
4592 echo creating $CONFIG_STATUS
4593 cat >$CONFIG_STATUS <<EOF
4594 #! /bin/sh
4595 # Generated automatically by configure.
4596 # Run this file to recreate the current configuration.
4597 # This directory was configured as follows,
4598 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4599 #
4600 # $0 $ac_configure_args
4601 #
4602 # Compiler output produced by configure, useful for debugging
4603 # configure, is in ./config.log if it exists.
4604
4605 # Files that config.status was made for.
4606 config_files="\\
4607   Makefile mpn/Makefile mpz/Makefile"
4608 config_headers="\\
4609   config.h:config.in"
4610 config_links="\\
4611   $gmp_links"
4612 config_commands="\\
4613   default-1"
4614
4615 ac_cs_usage="\\
4616 \\\`$CONFIG_STATUS' instantiates files from templates according to the
4617 current configuration.
4618
4619 Usage: $CONFIG_STATUS [OPTIONS] FILE...
4620
4621   --recheck    Update $CONFIG_STATUS by reconfiguring in the same conditions
4622   --version    Print the version of Autoconf and exit
4623   --help       Display this help and exit
4624   --file=FILE[:TEMPLATE]
4625                Instantiate the configuration file FILE
4626   --header=FILE[:TEMPLATE]
4627                Instantiate the configuration header FILE
4628
4629 Configuration files:
4630 \$config_files
4631
4632 Configuration headers:
4633 \$config_headers
4634
4635 Configuration links:
4636 \$config_links
4637
4638 Configuration commands:
4639 \$config_commands
4640
4641 Report bugs to <bug-autoconf@gnu.org>."
4642
4643 ac_cs_version="\\
4644 $CONFIG_STATUS generated by autoconf version 2.14a.
4645 Configured on host `(hostname || uname -n) 2>/dev/null | sed 1q` by
4646   `echo "$0 $ac_configure_args" | sed 's/[\\"\`\$]/\\\\&/g'`"
4647
4648 # Root of the tmp file names.  Use pid to allow concurrent executions.
4649 ac_cs_root=cs\$\$
4650 ac_given_srcdir=$srcdir
4651 ac_given_INSTALL="$INSTALL"
4652
4653 # If no file are specified by the user, then we need to provide default
4654 # value.  By we need to know if files were specified by the user.
4655 ac_need_defaults=:
4656 while test \$# != 0
4657 do
4658   case "\$1" in
4659   --*=*)
4660     ac_option=\`echo "\$1" | sed -e 's/=.*//'\`
4661     ac_optarg=\`echo "\$1" | sed -e 's/[^=]*=//'\`
4662     shift
4663     set dummy "\$ac_option" "\$ac_optarg" \${1+"\$@"}
4664     shift
4665     ;;
4666   -*);;
4667   *) # This is not an option, so the user has probably given explicit
4668      # arguments.
4669      ac_need_defaults=false;;
4670   esac
4671
4672   case "\$1" in
4673
4674   # Handling of the options.
4675   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
4676     echo "running \${CONFIG_SHELL-/bin/sh} $0 `echo "$ac_configure_args" | sed 's/[\\"\`\$]/\\\\&/g'` --no-create --no-recursion"
4677     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
4678   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
4679     echo "\$ac_cs_version"; exit 0 ;;
4680   --he | --h)
4681     # Conflict between --help and --header
4682     echo "$CONFIG_STATUS: ambiguous option: \$ac_option
4683 Try \\\`$CONFIG_STATUS --help' for more information."; exit 1 ;;
4684   -help | --help | --hel )
4685     echo "\$ac_cs_usage"; exit 0 ;;
4686   --file | --fil | --fi | --f )
4687     shift
4688     CONFIG_FILES="\$CONFIG_FILES \$1"
4689     ac_need_defaults=false;;
4690   --header | --heade | --head | --hea )
4691     shift
4692     CONFIG_HEADERS="\$CONFIG_FILES \$1"
4693     ac_need_defaults=false;;
4694
4695   # Handling of arguments.
4696   'Makefile' ) CONFIG_FILES="\$CONFIG_FILES Makefile" ;;
4697   'mpz/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpz/Makefile" ;;
4698   'mpn/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpn/Makefile" ;;
4699   '$gmp_links' ) CONFIG_LINKS="\$CONFIG_LINKS $gmp_links" ;;
4700   'default-1' ) CONFIG_COMMANDS="\$CONFIG_COMMANDS default-1" ;;
4701   'config.h' ) CONFIG_HEADERS="\$CONFIG_HEADERS config.h:config.in" ;;
4702
4703   # This is an error.
4704   -*) echo "$CONFIG_STATUS: unrecognized option: \$1
4705 Try \\\`$CONFIG_STATUS --help' for more information."; exit 1 ;;
4706   *) echo "$CONFIG_STATUS: invalid argument: \$1"; exit 1 ;;
4707   esac
4708   shift
4709 done
4710
4711 EOF
4712
4713 cat >>$CONFIG_STATUS <<\EOF
4714 # If the user did not use the arguments to specify the items to instantiate,
4715 # then the envvar interface is used.  Set only those that are not.
4716 if $ac_need_defaults; then
4717   : ${CONFIG_FILES=$config_files}
4718   : ${CONFIG_HEADERS=$config_headers}
4719   : ${CONFIG_LINKS=$config_links}
4720   : ${CONFIG_COMMANDS=$config_commands}
4721 fi
4722
4723 # Trap to remove the temp files.
4724 trap 'rm -fr $ac_cs_root*; exit 1' 1 2 15
4725
4726 EOF
4727
4728 cat >>$CONFIG_STATUS <<EOF
4729 #
4730 # INIT-COMMANDS section.
4731 #
4732
4733 EOF
4734
4735 cat >>$CONFIG_STATUS <<EOF
4736
4737 #
4738 # CONFIG_FILES section.
4739 #
4740
4741 # No need to generate the scripts if there are no CONFIG_FILES.
4742 # This happens for instance when ./config.status config.h
4743 if test -n "\$CONFIG_FILES"; then
4744   # Protect against being on the right side of a sed subst in config.status.
4745   sed 's/%@/@@/; s/@%/@@/; s/%;t t\$/@;t t/; /@;t t\$/s/[\\\\&%]/\\\\&/g;
4746    s/@@/%@/; s/@@/@%/; s/@;t t\$/%;t t/' >\$ac_cs_root.subs <<\\CEOF
4747 s%@exec_prefix@%$exec_prefix%;t t
4748 s%@prefix@%$prefix%;t t
4749 s%@program_transform_name@%$program_transform_name%;t t
4750 s%@bindir@%$bindir%;t t
4751 s%@sbindir@%$sbindir%;t t
4752 s%@libexecdir@%$libexecdir%;t t
4753 s%@datadir@%$datadir%;t t
4754 s%@sysconfdir@%$sysconfdir%;t t
4755 s%@sharedstatedir@%$sharedstatedir%;t t
4756 s%@localstatedir@%$localstatedir%;t t
4757 s%@libdir@%$libdir%;t t
4758 s%@includedir@%$includedir%;t t
4759 s%@oldincludedir@%$oldincludedir%;t t
4760 s%@infodir@%$infodir%;t t
4761 s%@mandir@%$mandir%;t t
4762 s%@SHELL@%$SHELL%;t t
4763 s%@ECHO_C@%$ECHO_C%;t t
4764 s%@ECHO_N@%$ECHO_N%;t t
4765 s%@ECHO_T@%$ECHO_T%;t t
4766 s%@CFLAGS@%$CFLAGS%;t t
4767 s%@CPPFLAGS@%$CPPFLAGS%;t t
4768 s%@CXXFLAGS@%$CXXFLAGS%;t t
4769 s%@FFLAGS@%$FFLAGS%;t t
4770 s%@DEFS@%$DEFS%;t t
4771 s%@LDFLAGS@%$LDFLAGS%;t t
4772 s%@LIBS@%$LIBS%;t t
4773 s%@host@%$host%;t t
4774 s%@host_alias@%$host_alias%;t t
4775 s%@host_cpu@%$host_cpu%;t t
4776 s%@host_vendor@%$host_vendor%;t t
4777 s%@host_os@%$host_os%;t t
4778 s%@target@%$target%;t t
4779 s%@target_alias@%$target_alias%;t t
4780 s%@target_cpu@%$target_cpu%;t t
4781 s%@target_vendor@%$target_vendor%;t t
4782 s%@target_os@%$target_os%;t t
4783 s%@build@%$build%;t t
4784 s%@build_alias@%$build_alias%;t t
4785 s%@build_cpu@%$build_cpu%;t t
4786 s%@build_vendor@%$build_vendor%;t t
4787 s%@build_os@%$build_os%;t t
4788 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%;t t
4789 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%;t t
4790 s%@INSTALL_DATA@%$INSTALL_DATA%;t t
4791 s%@PACKAGE@%$PACKAGE%;t t
4792 s%@VERSION@%$VERSION%;t t
4793 s%@ACLOCAL@%$ACLOCAL%;t t
4794 s%@AUTOCONF@%$AUTOCONF%;t t
4795 s%@AUTOMAKE@%$AUTOMAKE%;t t
4796 s%@AUTOHEADER@%$AUTOHEADER%;t t
4797 s%@MAKEINFO@%$MAKEINFO%;t t
4798 s%@AMTAR@%$AMTAR%;t t
4799 s%@install_sh@%$install_sh%;t t
4800 s%@AWK@%$AWK%;t t
4801 s%@SET_MAKE@%$SET_MAKE%;t t
4802 s%@AMDEP@%$AMDEP%;t t
4803 s%@AMDEPBACKSLASH@%$AMDEPBACKSLASH%;t t
4804 s%@DEPDIR@%$DEPDIR%;t t
4805 s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%;t t
4806 s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%;t t
4807 s%@MAINT@%$MAINT%;t t
4808 s%@WANT_MPBSD_TRUE@%$WANT_MPBSD_TRUE%;t t
4809 s%@WANT_MPBSD_FALSE@%$WANT_MPBSD_FALSE%;t t
4810 s%@WANT_MPFR_TRUE@%$WANT_MPFR_TRUE%;t t
4811 s%@WANT_MPFR_FALSE@%$WANT_MPFR_FALSE%;t t
4812 s%@CC@%$CC%;t t
4813 s%@CCAS@%$CCAS%;t t
4814 s%@CPP@%$CPP%;t t
4815 s%@LN_S@%$LN_S%;t t
4816 s%@M4@%$M4%;t t
4817 s%@AR@%$AR%;t t
4818 s%@CALLING_CONVENTIONS_OBJS@%$CALLING_CONVENTIONS_OBJS%;t t
4819 s%@SPEED_CYCLECOUNTER_OBJS@%$SPEED_CYCLECOUNTER_OBJS%;t t
4820 s%@EXEEXT@%$EXEEXT%;t t
4821 s%@OBJEXT@%$OBJEXT%;t t
4822 s%@RANLIB@%$RANLIB%;t t
4823 s%@STRIP@%$STRIP%;t t
4824 s%@LIBTOOL@%$LIBTOOL%;t t
4825 s%@U@%$U%;t t
4826 s%@ANSI2KNR@%$ANSI2KNR%;t t
4827 s%@mpn_objects@%$mpn_objects%;t t
4828 s%@mpn_objs_in_libgmp@%$mpn_objs_in_libgmp%;t t
4829 s%@gmp_srclinks@%$gmp_srclinks%;t t
4830 CEOF
4831
4832 EOF
4833
4834   cat >>$CONFIG_STATUS <<\EOF
4835   # Split the substitutions into bite-sized pieces for seds with
4836   # small command number limits, like on Digital OSF/1 and HP-UX.
4837   ac_max_sed_lines=48
4838   ac_sed_frag=1 # Number of current file.
4839   ac_beg=1 # First line for current file.
4840   ac_end=$ac_max_sed_lines # Line after last line for current file.
4841   ac_more_lines=:
4842   ac_sed_cmds=""
4843   while $ac_more_lines; do
4844     if test $ac_beg -gt 1; then
4845       sed "1,${ac_beg}d; ${ac_end}q" $ac_cs_root.subs >$ac_cs_root.sfrag
4846     else
4847       sed "${ac_end}q" $ac_cs_root.subs >$ac_cs_root.sfrag
4848     fi
4849     if test ! -s $ac_cs_root.sfrag; then
4850       ac_more_lines=false
4851       rm -f $ac_cs_root.sfrag
4852     else
4853       # The purpose of the label and of the branching condition is to
4854       # speed up the sed processing (if there are no `@' at all, there
4855       # is no need to browse any of the substitutions).
4856       # These are the two extra sed commands mentioned above.
4857       (echo ':t
4858   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $ac_cs_root.sfrag) >$ac_cs_root.s$ac_sed_frag
4859       if test -z "$ac_sed_cmds"; then
4860         ac_sed_cmds="sed -f $ac_cs_root.s$ac_sed_frag"
4861       else
4862         ac_sed_cmds="$ac_sed_cmds | sed -f $ac_cs_root.s$ac_sed_frag"
4863       fi
4864       ac_sed_frag=`expr $ac_sed_frag + 1`
4865       ac_beg=$ac_end
4866       ac_end=`expr $ac_end + $ac_max_sed_lines`
4867     fi
4868   done
4869   if test -z "$ac_sed_cmds"; then
4870     ac_sed_cmds=cat
4871   fi
4872 fi # test -n "$CONFIG_FILES"
4873
4874 EOF
4875 cat >>$CONFIG_STATUS <<\EOF
4876 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
4877   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
4878   case "$ac_file" in
4879   *:*) ac_file_in=`echo "$ac_file" | sed 's%[^:]*:%%'`
4880        ac_file=`echo "$ac_file" | sed 's%:.*%%'` ;;
4881   *) ac_file_in="${ac_file}.in" ;;
4882   esac
4883
4884   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
4885
4886   # Remove last slash and all that follows it.  Not all systems have dirname.
4887   ac_dir=`echo "$ac_file" | sed 's%/[^/][^/]*$%%'`
4888   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
4889     # The file is in a subdirectory.
4890     test ! -d "$ac_dir" && mkdir "$ac_dir"
4891     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
4892     # A "../" for each directory in $ac_dir_suffix.
4893     ac_dots=`echo "$ac_dir_suffix" | sed 's%/[^/]*%../%g'`
4894   else
4895     ac_dir_suffix= ac_dots=
4896   fi
4897
4898   case "$ac_given_srcdir" in
4899   .)  srcdir=.
4900       if test -z "$ac_dots"; then top_srcdir=.
4901       else top_srcdir=`echo $ac_dots | sed 's%/$%%'`; fi ;;
4902   [\\/]* | ?:[\\/]* )
4903       srcdir="$ac_given_srcdir$ac_dir_suffix";
4904       top_srcdir=$ac_given_srcdir ;;
4905   *) # Relative path.
4906     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
4907     top_srcdir="$ac_dots$ac_given_srcdir" ;;
4908   esac
4909
4910   case "$ac_given_INSTALL" in
4911   [\\/$]* | ?:[\\/]* ) INSTALL="$ac_given_INSTALL" ;;
4912   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
4913   esac
4914
4915   echo creating "$ac_file"
4916   rm -f "$ac_file"
4917   configure_input="Generated automatically from `echo $ac_file_in |
4918                                                  sed 's%.*/%%'` by configure."
4919   case "$ac_file" in
4920   *[Mm]akefile*) ac_comsub="1i\\
4921 # $configure_input" ;;
4922   *) ac_comsub= ;;
4923   esac
4924
4925   # Don't redirect the output to AC_FILE directly: use `mv' so that updating
4926   # is atomic, and doesn't need trapping.
4927   ac_file_inputs=`echo "$ac_file_in" |
4928                   sed -e "s%:% $ac_given_srcdir/%g;s%^%$ac_given_srcdir/%"`
4929   for ac_file_input in $ac_file_inputs;
4930   do
4931     test -f "$ac_file_input" ||
4932         { echo "configure: error: cannot find input file \`$ac_file_input'" 1>&2; exit 1; }
4933   done
4934 EOF
4935 cat >>$CONFIG_STATUS <<EOF
4936   sed -e "$ac_comsub
4937 $ac_vpsub
4938 $extrasub
4939 EOF
4940 cat >>$CONFIG_STATUS <<\EOF
4941 :t
4942 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
4943 s%@configure_input@%$configure_input%;t t
4944 s%@srcdir@%$srcdir%;t t
4945 s%@top_srcdir@%$top_srcdir%;t t
4946 s%@INSTALL@%$INSTALL%;t t
4947 " $ac_file_inputs | (eval "$ac_sed_cmds") >$ac_cs_root.out
4948   mv $ac_cs_root.out $ac_file
4949
4950 fi; done
4951 rm -f $ac_cs_root.s*
4952 EOF
4953 cat >>$CONFIG_STATUS <<\EOF
4954
4955 #
4956 # CONFIG_HEADER section.
4957 #
4958
4959 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
4960 # NAME is the cpp macro being defined and VALUE is the value it is being given.
4961 #
4962 # ac_d sets the value in "#define NAME VALUE" lines.
4963 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
4964 ac_dB='[        ].*$%\1#\2'
4965 ac_dC=' '
4966 ac_dD='%;t'
4967 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
4968 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
4969 ac_uB='$%\1#\2define\3'
4970 ac_uC=' '
4971 ac_uD='%;t'
4972
4973 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
4974   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
4975   case "$ac_file" in
4976   *:*) ac_file_in=`echo "$ac_file" | sed 's%[^:]*:%%'`
4977        ac_file=`echo "$ac_file" | sed 's%:.*%%'` ;;
4978   *) ac_file_in="${ac_file}.in" ;;
4979   esac
4980
4981   echo creating $ac_file
4982
4983   rm -f $ac_cs_root.frag $ac_cs_root.in $ac_cs_root.out
4984   ac_file_inputs=`echo "$ac_file_in" |
4985                   sed -e "s%:% $ac_given_srcdir/%g;s%^%$ac_given_srcdir/%"`
4986     for ac_file_input in $ac_file_inputs;
4987   do
4988     test -f "$ac_file_input" ||
4989         { echo "configure: error: cannot find input file \`$ac_file_input'" 1>&2; exit 1; }
4990   done
4991   # Remove the trailing spaces.
4992   sed -e 's/[   ]*$//' $ac_file_inputs >$ac_cs_root.in
4993
4994 EOF
4995
4996 # Transform confdefs.h into two sed scripts, `conftest.defines' and
4997 # `conftest.undefs', that substitutes the proper values into
4998 # config.h.in to produce config.h.  The first handles `#define'
4999 # templates, and the second `#undef' templates.
5000 # And first: Protect against being on the right side of a sed subst in
5001 # config.status.  Protect against being in an unquoted here document
5002 # in config.status.
5003 rm -f conftest.defines conftest.undefs
5004 ac_cs_root=conftest
5005 cat >$ac_cs_root.hdr <<\EOF
5006 s/[\\&%]/\\&/g
5007 s%[\\$`]%\\&%g
5008 t clear
5009 : clear
5010 s%^[    ]*#[    ]*define[       ][      ]*\(\([^        (][^    (]*\)([^)]*)\)[         ]*\(.*\)$%${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD}%gp
5011 t cleanup
5012 s%^[    ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)$%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
5013 : cleanup
5014 EOF
5015 # If some macros were called several times there might be several times
5016 # the same #defines, which is useless.  Nevertheless, we may not want to
5017 # sort them, since we want the *last* AC_DEFINE to be honored.
5018 uniq confdefs.h | sed -n -f $ac_cs_root.hdr >conftest.defines
5019 sed -e 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
5020 rm -f $ac_cs_root.hdr
5021
5022 # This sed command replaces #undef with comments.  This is necessary, for
5023 # example, in the case of _POSIX_SOURCE, which is predefined and required
5024 # on some systems where configure will not decide to define it.
5025 cat >>conftest.undefs <<\EOF
5026 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
5027 EOF
5028
5029 # Break up conftest.defines because some shells have a limit on the size
5030 # of here documents, and old seds have small limits too (100 cmds).
5031 echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
5032 echo '  if egrep "^[    ]*#[    ]*define" $ac_cs_root.in >/dev/null; then' >>$CONFIG_STATUS
5033 echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
5034 echo '  :' >>$CONFIG_STATUS
5035 rm -f conftest.tail
5036 while grep . conftest.defines >/dev/null
5037 do
5038   # Write a limited-size here document to $ac_cs_root.frag.
5039   echo '  cat >$ac_cs_root.frag <<CEOF' >>$CONFIG_STATUS
5040   echo '/^[     ]*#[    ]*define/!b' >>$CONFIG_STATUS
5041   sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
5042   echo 'CEOF
5043   sed -f $ac_cs_root.frag $ac_cs_root.in >$ac_cs_root.out
5044   rm -f $ac_cs_root.in
5045   mv $ac_cs_root.out $ac_cs_root.in
5046 ' >>$CONFIG_STATUS
5047   sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
5048   rm -f conftest.defines
5049   mv conftest.tail conftest.defines
5050 done
5051 rm -f conftest.defines
5052 echo '  fi # egrep' >>$CONFIG_STATUS
5053 echo >>$CONFIG_STATUS
5054
5055 # Break up conftest.undefs because some shells have a limit on the size
5056 # of here documents, and old seds have small limits too (100 cmds).
5057 echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
5058 rm -f conftest.tail
5059 while grep . conftest.undefs >/dev/null
5060 do
5061   # Write a limited-size here document to $ac_cs_root.frag.
5062   echo '  cat >$ac_cs_root.frag <<CEOF' >>$CONFIG_STATUS
5063   echo '/^[     ]*#[    ]*undef/!b' >>$CONFIG_STATUS
5064   sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
5065   echo 'CEOF
5066   sed -f $ac_cs_root.frag $ac_cs_root.in >$ac_cs_root.out
5067   rm -f $ac_cs_root.in
5068   mv $ac_cs_root.out $ac_cs_root.in
5069 ' >>$CONFIG_STATUS
5070   sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
5071   rm -f conftest.undefs
5072   mv conftest.tail conftest.undefs
5073 done
5074 rm -f conftest.undefs
5075
5076 cat >>$CONFIG_STATUS <<\EOF
5077   rm -f $ac_cs_root.frag $ac_cs_root.h
5078   echo "/* $ac_file.  Generated automatically by configure.  */" >$ac_cs_root.h
5079   cat $ac_cs_root.in >>$ac_cs_root.h
5080   rm -f $ac_cs_root.in
5081   if cmp -s $ac_file $ac_cs_root.h 2>/dev/null; then
5082     echo "$ac_file is unchanged"
5083     rm -f $ac_cs_root.h
5084   else
5085     # Remove last slash and all that follows it.  Not all systems have dirname.
5086     ac_dir=`echo "$ac_file" | sed 's%/[^/][^/]*$%%'`
5087     if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5088       # The file is in a subdirectory.
5089       test ! -d "$ac_dir" && mkdir "$ac_dir"
5090     fi
5091     rm -f $ac_file
5092     mv $ac_cs_root.h $ac_file
5093   fi
5094 fi; done
5095 EOF
5096 cat >>$CONFIG_STATUS <<\EOF
5097
5098 #
5099 # CONFIG_LINKS section.
5100 #
5101 srcdir=$ac_given_srcdir
5102
5103 for ac_file in : $CONFIG_LINKS; do if test "x$ac_file" != x:; then
5104   ac_dest=`echo "$ac_file" | sed 's%:.*%%'`
5105   ac_source=`echo "$ac_file" | sed 's%[^:]*:%%'`
5106
5107   echo "linking $srcdir/$ac_source to $ac_dest"
5108
5109   if test ! -r $srcdir/$ac_source; then
5110     { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
5111   fi
5112   rm -f $ac_dest
5113
5114   # Make relative symlinks.
5115   # Remove last slash and all that follows it.  Not all systems have dirname.
5116   ac_dest_dir=`echo $ac_dest | sed 's%/[^/][^/]*$%%'`
5117   if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
5118     # The dest file is in a subdirectory.
5119     test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
5120     ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
5121     # A "../" for each directory in $ac_dest_dir_suffix.
5122     ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
5123   else
5124     ac_dest_dir_suffix= ac_dots=
5125   fi
5126
5127   case "$srcdir" in
5128   [\\/$]* | ?:[\\/]* ) ac_rel_source="$srcdir/$ac_source" ;;
5129       *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
5130   esac
5131
5132   # Make a symlink if possible; otherwise try a hard link.
5133   if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
5134      ln $srcdir/$ac_source $ac_dest; then :
5135   else
5136     { echo "configure: error: cannot link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
5137   fi
5138 fi; done
5139 EOF
5140 cat >>$CONFIG_STATUS <<\EOF
5141
5142 #
5143 # CONFIG_COMMANDS section.
5144 #
5145 for ac_file in .. $CONFIG_COMMANDS; do if test "x$ac_file" != x..; then
5146   ac_dest=`echo "$ac_file" | sed 's%:.*%%'`
5147   ac_source=`echo "$ac_file" | sed 's%[^:]*:%%'`
5148
5149   case "$ac_dest" in
5150     default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ;;
5151   esac
5152 fi;done
5153 EOF
5154
5155 cat >>$CONFIG_STATUS <<\EOF
5156
5157 exit 0
5158 EOF
5159 chmod +x $CONFIG_STATUS
5160 rm -fr confdefs* $ac_clean_files
5161 trap 'exit 1' 1 2 15
5162
5163 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1