[project @ 2001-01-17 12:14:30 by simonmar]
[ghc-hetmet.git] / ghc / rts / gmp / configure
1 #! /bin/sh
2 # From configure.in Revision: 1.129.2.2
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.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     # Need to think more about the options passed here.  This isn't good for
1234     # some sparc64 linux distros, since we end up not optimizing when all the
1235     # options below fail.
1236     os_64bit=yes
1237     gmp_cflags64_gcc="$gmp_cflags64_gcc -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9"
1238     gmp_cflags_gcc="$gmp_cflags_gcc -m32"
1239     gmp_xoptflags_gcc="-mcpu=ultrasparc -mvis"
1240     ;;
1241   ultrasparc*-*-* | sparcv9-*-*)
1242     gmp_cflags_gcc="$gmp_cflags_gcc -Wa,-xarch=v8plus"
1243     gmp_xoptcflags_gcc="-mcpu=v9 -mcpu=v8 -mv8"
1244     gmp_cflags_cc="-xtarget=native -xarch=v8 -xO4"
1245     ;;
1246   sparcv8*-*-solaris2.* | microsparc*-*-solaris2.*)
1247     gmp_cflags_gcc="$gmp_cflags_gcc"
1248     gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
1249     gmp_cflags_cc="-xtarget=native -xarch=v8 -xO4"
1250     ;;
1251   sparcv8*-*-* | microsparc*-*-*)               # SunOS, Linux, *BSD
1252     cclist="gcc acc cc"
1253     gmp_cflags_gcc="$gmp_cflags_gcc"
1254     gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
1255     gmp_cflags_acc="-g -O2 -cg92"
1256     gmp_cflags_cc="-O2"         # FIXME: Flag for v8?
1257     ;;
1258   supersparc*-*-solaris2.*)
1259     gmp_cflags_gcc="$gmp_cflags_gcc -DSUPERSPARC"
1260     gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
1261     gmp_cflags_cc="-xtarget=native -xarch=v8 -xO4 -DSUPERSPARC"
1262     ;;
1263   supersparc*-*-*)              # SunOS, Linux, *BSD
1264     cclist="gcc acc cc"
1265     gmp_cflags_gcc="$gmp_cflags_gcc -DSUPERSPARC"
1266     gmp_xoptcflags_gcc="-mcpu=v8 -mv8"
1267     gmp_cflags_acc="-g -O2 -cg92 -DSUPERSPARC"
1268     gmp_cflags_cc="-O2 -DSUPERSPARC"    # FIXME: Flag for v8?
1269     ;;
1270   *sparc*-*-*)
1271     cclist="gcc acc cc"
1272     gmp_cflags_acc="-g -O2"
1273     gmp_cflags_cc="-g -O2"
1274     ;;
1275
1276   # POWER/PowerPC
1277   powerpc64-*-aix*)
1278     cclist="gcc xlc"
1279     gmp_cflags_gcc="$gmp_cflags_gcc -maix64 -mpowerpc64"
1280     gmp_cflags_xlc="-g -O2 -q64 -qtune=pwr3"
1281     ;;
1282   powerpc*-*-aix*)
1283     cclist="gcc xlc"
1284     gmp_cflags_gcc="$gmp_cflags_gcc -mpowerpc"
1285     gmp_cflags_xlc="$gmp_cflags_cc -qarch=ppc -O2"
1286     ;;
1287   power-*-aix*)
1288     cclist="gcc xlc"
1289     gmp_cflags_gcc="$gmp_cflags_gcc -mpower"
1290     gmp_cflags_xlc="$gmp_cflags_cc -qarch=pwr -O2"
1291     ;;
1292   powerpc64*-*-*)
1293     gmp_cflags_gcc="$gmp_cflags_gcc -mpowerpc64"
1294     cat >>confdefs.h <<\EOF
1295 #define _LONG_LONG_LIMB 1
1296 EOF
1297             ;;
1298   powerpc*-*-*)
1299     gmp_cflags_gcc="$gmp_cflags_gcc -mpowerpc"
1300     ;;
1301
1302   # MIPS
1303   mips-sgi-irix6.*)
1304     os_64bit=yes
1305     gmp_cflags64_gcc="-g -O2 -mabi=n32"
1306     gmp_cflags64_cc="$gmp_cflags64_cc -O2 -n32"
1307     ;;
1308
1309   # Motorola 68k family
1310   m88110*-*-*)
1311     gmp_cflags_gcc="-g -O -m88110"          ;;
1312   m68*-*-*)
1313     gmp_cflags_gcc="$gmp_cflags_gcc -fomit-frame-pointer"
1314     ;;
1315
1316   # HP
1317   hppa1.0*-*-*)
1318     cclist="gcc c89 cc"
1319     gmp_cflags_c89="$gmp_cflags_cc +O2"
1320     gmp_cflags_cc="$gmp_cflags_cc +O2"
1321     ;;
1322   hppa2.0w*-*-*)
1323     cclist="c89 cc"
1324     gmp_cflags_c89="+DD64 +O3"
1325     gmp_cflags_cc="+DD64 +O3"
1326     ;;
1327   hppa2.0*-*-*)
1328     os_64bit=yes
1329     cclist="gcc c89 cc"
1330     gmp_cflags64_gcc="$gmp_cflags64_gcc -mWHAT -D_LONG_LONG_LIMB"
1331     # +O2 to cc triggers bug in mpz/powm.c (1.4)
1332     gmp_cflags64_c89="+DA2.0 +e +O3 -D_LONG_LONG_LIMB"
1333     gmp_cflags64_cc="+DA2.0 +e +O3 -D_LONG_LONG_LIMB"
1334     gmp_cflags_c89="$gmp_cflags_cc +O2"
1335     gmp_cflags_cc="$gmp_cflags_cc +O2"
1336     ;;
1337
1338   # VAX
1339   vax*-*-*)
1340     gmp_cflags_gcc="$gmp_cflags_gcc -fomit-frame-pointer"
1341     ;;
1342
1343   # Fujitsu
1344   f30[01]-fujitsu-sysv*)
1345     cclist="gcc vcc"
1346     gmp_cflags_vcc="-g"         # FIXME: flags for vcc?
1347     ;;
1348 esac
1349
1350 case "${target}" in
1351   *-*-mingw32) gmp_cflags_gcc="$gmp_cflags_gcc -mno-cygwin";;
1352 esac
1353
1354 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" 1>&6
1355 echo "configure:1352: checking for BSD-compatible nm" 1>&5
1356 if test "${ac_cv_path_NM+set}" = set; then
1357   echo $ECHO_N "(cached) $ECHO_C" 1>&6
1358 else
1359   if test -n "$NM"; then
1360   # Let the user override the test.
1361   ac_cv_path_NM="$NM"
1362 else
1363   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1364   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1365     test -z "$ac_dir" && ac_dir=.
1366     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
1367       # Check to see if the nm accepts a BSD-compat flag.
1368       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1369       #   nm: unknown option "B" ignored
1370       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1371         ac_cv_path_NM="$ac_dir/nm -B"
1372         break
1373       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1374         ac_cv_path_NM="$ac_dir/nm -p"
1375         break
1376       else
1377         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
1378         continue # so that we can try to find one that supports BSD flags
1379       fi
1380     fi
1381   done
1382   IFS="$ac_save_ifs"
1383   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1384 fi
1385 fi
1386
1387 NM="$ac_cv_path_NM"
1388 echo "$ECHO_T""$NM" 1>&6
1389         # nm on 64-bit AIX needs to know the object file format
1390 case "$target" in
1391   powerpc64*-*-aix*)
1392     NM="$NM -X 64"
1393     ;;
1394 esac
1395
1396 # Save CFLAGS given on command line.
1397 gmp_user_CFLAGS="$CFLAGS"
1398
1399 if test -z "$CC"; then
1400   # Find compiler.
1401
1402 if test $host != $build; then
1403   ac_tool_prefix=${host_alias}-
1404 else
1405   ac_tool_prefix=
1406 fi
1407
1408 gmp_cc_list="$cclist"
1409 gmp_req_64bit_cc="$os_64bit"
1410
1411 CC32=
1412 CC64=
1413 for c in $gmp_cc_list; do
1414   # Avoid cache hits.
1415   unset CC
1416   unset ac_cv_prog_CC
1417
1418 # Extract the first word of "${ac_tool_prefix}$c", so it can be a program name with args.
1419 set dummy ${ac_tool_prefix}$c; ac_word=$2
1420 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
1421 echo "configure:1418: checking for $ac_word" 1>&5
1422 if test "${ac_cv_prog_CC+set}" = set; then
1423   echo $ECHO_N "(cached) $ECHO_C" 1>&6
1424 else
1425   if test -n "$CC"; then
1426   ac_cv_prog_CC="$CC" # Let the user override the test.
1427 else
1428   for ac_path in `IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1429 ac_dummy="$PATH"
1430 for ac_dir in $ac_dummy; do
1431   test -z "$ac_dir" && ac_dir=.
1432   if test -f $ac_dir/$ac_word; then
1433     echo "$ac_dir/$ac_word"
1434   fi
1435 done
1436 IFS="$ac_save_ifs"
1437 `; do
1438     ac_cv_prog_CC="${ac_tool_prefix}$c"
1439     break
1440   done
1441 fi
1442 fi
1443 CC="$ac_cv_prog_CC"
1444 if test -n "$CC"; then
1445   echo "$ECHO_T""$CC" 1>&6
1446 else
1447   echo "$ECHO_T""no" 1>&6
1448 fi
1449
1450 if test -z "$ac_cv_prog_CC"; then
1451   if test -n "$ac_tool_prefix"; then
1452     # Extract the first word of "$c", so it can be a program name with args.
1453 set dummy $c; ac_word=$2
1454 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
1455 echo "configure:1452: checking for $ac_word" 1>&5
1456 if test "${ac_cv_prog_CC+set}" = set; then
1457   echo $ECHO_N "(cached) $ECHO_C" 1>&6
1458 else
1459   if test -n "$CC"; then
1460   ac_cv_prog_CC="$CC" # Let the user override the test.
1461 else
1462   for ac_path in `IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1463 ac_dummy="$PATH"
1464 for ac_dir in $ac_dummy; do
1465   test -z "$ac_dir" && ac_dir=.
1466   if test -f $ac_dir/$ac_word; then
1467     echo "$ac_dir/$ac_word"
1468   fi
1469 done
1470 IFS="$ac_save_ifs"
1471 `; do
1472     ac_cv_prog_CC="$c"
1473     break
1474   done
1475   test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="$c"
1476 fi
1477 fi
1478 CC="$ac_cv_prog_CC"
1479 if test -n "$CC"; then
1480   echo "$ECHO_T""$CC" 1>&6
1481 else
1482   echo "$ECHO_T""no" 1>&6
1483 fi
1484
1485   else
1486     CC="$c"
1487   fi
1488 fi
1489
1490   if test -n "$CC"; then
1491     eval c_flags=\$gmp_cflags_$c
1492     ac_ext=c
1493 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1494 ac_cpp='$CPP $CPPFLAGS'
1495 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1496 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1497 cross_compiling=$ac_cv_prog_cc_cross
1498         CC="$CC"
1499 CFLAGS="$c_flags"
1500 echo $ECHO_N "checking if the C compiler ($CC) works with flags $CFLAGS... $ECHO_C" 1>&6
1501 echo "configure:1498: checking if the C compiler ($CC) works with flags $CFLAGS" 1>&5
1502
1503 # Simple test for all targets.
1504 cat >conftest.$ac_ext <<EOF
1505
1506 #line 1503 "configure"
1507 #include "confdefs.h"
1508
1509 int main(){return(0);}
1510 EOF
1511 if { (eval echo configure:1508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1512   tmp_works=yes
1513   # If we can't run a trivial program, we are probably using a cross compiler.
1514   if (./conftest; exit) 2>/dev/null; then
1515     tmp_cross=no
1516   else
1517     tmp_cross=yes
1518   fi
1519 else
1520   echo "configure: failed program was:" >&5
1521   cat conftest.$ac_ext >&5
1522   tmp_works=no
1523 fi
1524 rm -fr conftest*
1525
1526 # Target specific tests.
1527 if test "$tmp_works" = "yes"; then
1528   case "$target" in
1529     *-*-aix*)   # Returning a funcptr.
1530       cat >conftest.$ac_ext <<EOF
1531 #line 1528 "configure"
1532 #include "confdefs.h"
1533
1534 int
1535 main ()
1536 {
1537 } void *g(); void *f() { return g(); } int bar(){
1538   ;
1539   return 0;
1540 }
1541 EOF
1542 if { (eval echo configure:1539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1543   rm -rf conftest*
1544   tmp_works=yes
1545 else
1546   echo "configure: failed program was:" >&5
1547   cat conftest.$ac_ext >&5
1548   rm -rf conftest*
1549   tmp_works=no
1550 fi
1551 rm -f conftest*
1552       ;;
1553   esac
1554 fi
1555
1556 if test "$tmp_works" = "yes"; then
1557   gmp_prog_cc_works=yes
1558 else
1559   gmp_prog_cc_works=no
1560 fi
1561
1562 echo "$ECHO_T""$tmp_works" 1>&6
1563
1564     if test "$gmp_prog_cc_works" != "yes"; then
1565       continue
1566     fi
1567
1568     # Save first working compiler, whether 32- or 64-bit capable.
1569     if test -z "$CC32"; then
1570       CC32="$CC"
1571     fi
1572     if test "$gmp_req_64bit_cc" = "yes"; then
1573       eval c_flags=\$gmp_cflags64_$c
1574
1575       # Verify that the compiler works in 64-bit mode as well.
1576       # /usr/ucb/cc on Solaris 7 can *compile* in 64-bit mode, but not link.
1577       ac_ext=c
1578 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1579 ac_cpp='$CPP $CPPFLAGS'
1580 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1581 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1582 cross_compiling=$ac_cv_prog_cc_cross
1583         CC="$c"
1584 CFLAGS="$c_flags"
1585 echo $ECHO_N "checking if the C compiler ($CC) works with flags $CFLAGS... $ECHO_C" 1>&6
1586 echo "configure:1583: checking if the C compiler ($CC) works with flags $CFLAGS" 1>&5
1587
1588 # Simple test for all targets.
1589 cat >conftest.$ac_ext <<EOF
1590
1591 #line 1588 "configure"
1592 #include "confdefs.h"
1593
1594 int main(){return(0);}
1595 EOF
1596 if { (eval echo configure:1593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1597   tmp_works=yes
1598   # If we can't run a trivial program, we are probably using a cross compiler.
1599   if (./conftest; exit) 2>/dev/null; then
1600     tmp_cross=no
1601   else
1602     tmp_cross=yes
1603   fi
1604 else
1605   echo "configure: failed program was:" >&5
1606   cat conftest.$ac_ext >&5
1607   tmp_works=no
1608 fi
1609 rm -fr conftest*
1610
1611 # Target specific tests.
1612 if test "$tmp_works" = "yes"; then
1613   case "$target" in
1614     *-*-aix*)   # Returning a funcptr.
1615       cat >conftest.$ac_ext <<EOF
1616 #line 1613 "configure"
1617 #include "confdefs.h"
1618
1619 int
1620 main ()
1621 {
1622 } void *g(); void *f() { return g(); } int bar(){
1623   ;
1624   return 0;
1625 }
1626 EOF
1627 if { (eval echo configure:1624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1628   rm -rf conftest*
1629   tmp_works=yes
1630 else
1631   echo "configure: failed program was:" >&5
1632   cat conftest.$ac_ext >&5
1633   rm -rf conftest*
1634   tmp_works=no
1635 fi
1636 rm -f conftest*
1637       ;;
1638   esac
1639 fi
1640
1641 if test "$tmp_works" = "yes"; then
1642   gmp_prog_cc_works=yes
1643 else
1644   gmp_prog_cc_works=no
1645 fi
1646
1647 echo "$ECHO_T""$tmp_works" 1>&6
1648
1649       if test "$gmp_prog_cc_works" = "yes"; then
1650
1651   gmp_tmp_CC_save="$CC"
1652   CC="$c"
1653   echo $ECHO_N "checking whether the C compiler ($CC) is 64-bit capable... $ECHO_C" 1>&6
1654 echo "configure:1651: checking whether the C compiler ($CC) is 64-bit capable" 1>&5
1655   if test -z "$NM"; then
1656     echo; echo "configure: GMP_CHECK_CC_64BIT: fatal: need nm"
1657     exit 1
1658   fi
1659   gmp_tmp_CFLAGS_save="$CFLAGS"
1660   CFLAGS="$c_flags"
1661
1662   case "$target" in
1663     hppa2.0*-*-*)
1664       # FIXME: If gcc is installed under another name than "gcc", we will
1665       # test the wrong thing.
1666       if test "$CC" != "gcc"; then
1667                                                 echo >conftest.c
1668         gmp_tmp_vs=`$CC $CFLAGS -V -c -o conftest.o conftest.c 2>&1 | grep "^ccom:"`
1669         rm conftest*
1670         gmp_tmp_v1=`echo $gmp_tmp_vs | sed 's/.* .\.\(.*\)\..*\..* HP C.*/\1/'`
1671         gmp_tmp_v2=`echo $gmp_tmp_vs | sed 's/.* .\..*\.\(.*\)\..* HP C.*/\1/'`
1672         gmp_tmp_v3=`echo $gmp_tmp_vs | sed 's/.* .\..*\..*\.\(.*\) HP C.*/\1/'`
1673         gmp_cv_cc_64bit=no
1674         test -n "$gmp_tmp_v1" && test "$gmp_tmp_v1" -ge "10" \
1675           && test -n "$gmp_tmp_v2" && test "$gmp_tmp_v2" -ge "32" \
1676           && test -n "$gmp_tmp_v3" && test "$gmp_tmp_v3" -ge "30" \
1677           && gmp_cv_cc_64bit=yes
1678       else      # gcc
1679         # FIXME: Compile a minimal file and determine if the resulting object
1680         # file is an ELF file.  If so, gcc can produce 64-bit code.
1681         # Do we have file(1) for target?
1682         gmp_cv_cc_64bit=no
1683       fi
1684       ;;
1685     mips-sgi-irix6.*)
1686       # We use `-n32' to cc and `-mabi=n32' to gcc, resulting in 64-bit
1687       # arithmetic but not 64-bit pointers, so the general test for sizeof
1688       # (void *) is not valid.
1689       # Simply try to compile an empty main.  If that succeeds return
1690       # true.
1691       cat >conftest.$ac_ext <<EOF
1692 #line 1689 "configure"
1693 #include "confdefs.h"
1694
1695 int
1696 main ()
1697 {
1698
1699   ;
1700   return 0;
1701 }
1702 EOF
1703 if { (eval echo configure:1700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1704   rm -rf conftest*
1705   gmp_cv_cc_64bit=yes
1706 else
1707   echo "configure: failed program was:" >&5
1708   cat conftest.$ac_ext >&5
1709   rm -rf conftest*
1710   gmp_cv_cc_64bit=no
1711 fi
1712 rm -f conftest*
1713       ;;
1714     *-*-*)
1715       # Allocate an array of size sizeof (void *) and use nm to determine its
1716       # size.  We depend on the first declared variable being put at address 0.
1717       cat >conftest.c <<EOF
1718 char arr[sizeof (void *)]={0};
1719 char post=0;
1720 EOF
1721       gmp_compile="$CC $CFLAGS -c conftest.c 1>&5"
1722       if { (eval echo configure:1719: \"$gmp_compile\") 1>&5; (eval $gmp_compile) 2>&5; }; then
1723                 gmp_tmp_val=`$NM conftest.o | grep post | sed -e 's;[[][0-9][]]\(.*\);\1;' \
1724           -e 's;[^1-9]*\([0-9]*\).*;\1;'`
1725                 if test "$gmp_tmp_val" = "8"; then
1726           gmp_cv_cc_64bit=yes
1727         else
1728           gmp_cv_cc_64bit=no
1729         fi
1730       else
1731         echo "configure: failed program was:" >&5
1732         cat conftest.$ac_ext >&5
1733         gmp_cv_cc_64bit=no
1734       fi
1735       rm -f conftest*
1736       ;;
1737   esac
1738
1739   CC="$gmp_tmp_CC_save"
1740   CFLAGS="$gmp_tmp_CFLAGS_save"
1741   echo "$ECHO_T""$gmp_cv_cc_64bit" 1>&6
1742
1743         if test "$gmp_cv_cc_64bit" = "yes"; then
1744           test -z "$CC64" && CC64="$c"
1745           test -z "$CFLAGS64" && CFLAGS64="$c_flags"
1746           # We have CC64 so we're done.
1747           break
1748         fi
1749       fi
1750     else
1751       # We have CC32, and we don't need a 64-bit compiler so we're done.
1752       break
1753     fi
1754   fi
1755 done
1756 CC="$CC32"
1757
1758   # If 64-bit OS and we have a 64-bit compiler, use it.
1759   if test -n "$os_64bit" && test -n "$CC64"; then
1760     CC=$CC64
1761     CFLAGS=$CFLAGS64
1762   else
1763     eval CFLAGS=\$gmp_cflags_$CC
1764   fi
1765
1766   # Try compiler flags that may work with only some compiler versions.
1767   # gmp_optcflags: All or nothing.
1768   eval optcflags=\$gmp_optcflags_$CC
1769   if test -n "$optcflags"; then
1770     CFLAGS_save="$CFLAGS"
1771     CFLAGS="$CFLAGS $optcflags"
1772     echo $ECHO_N "checking whether $CC accepts $optcflags... $ECHO_C" 1>&6
1773 echo "configure:1770: checking whether $CC accepts $optcflags" 1>&5
1774     ac_ext=c
1775 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1776 ac_cpp='$CPP $CPPFLAGS'
1777 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1778 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1779 cross_compiling=$ac_cv_prog_cc_cross
1780
1781     cat >conftest.$ac_ext <<EOF
1782
1783 #line 1780 "configure"
1784 #include "confdefs.h"
1785
1786 int main(){return(0);}
1787 EOF
1788 if { (eval echo configure:1785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1789   optok=yes
1790   # If we can't run a trivial program, we are probably using a cross compiler.
1791   if (./conftest; exit) 2>/dev/null; then
1792     cross=no
1793   else
1794     cross=yes
1795   fi
1796 else
1797   echo "configure: failed program was:" >&5
1798   cat conftest.$ac_ext >&5
1799   optok=no
1800 fi
1801 rm -fr conftest*
1802     if test "$optok" = "yes"; then
1803       echo "$ECHO_T""yes" 1>&6
1804     else
1805       echo "$ECHO_T""no" 1>&6
1806       CFLAGS="$CFLAGS_save"
1807     fi
1808   fi
1809   # gmp_xoptcflags: First is best, one has to work.
1810   eval xoptcflags=\$gmp_xoptcflags_$CC
1811   if test -n "$xoptcflags"; then
1812     gmp_found="no"
1813     for xopt in $xoptcflags; do
1814       CFLAGS_save="$CFLAGS"
1815       CFLAGS="$CFLAGS $xopt"
1816       echo $ECHO_N "checking whether $CC accepts $xopt... $ECHO_C" 1>&6
1817 echo "configure:1814: checking whether $CC accepts $xopt" 1>&5
1818       ac_ext=c
1819 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1820 ac_cpp='$CPP $CPPFLAGS'
1821 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1822 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1823 cross_compiling=$ac_cv_prog_cc_cross
1824
1825       cat >conftest.$ac_ext <<EOF
1826
1827 #line 1824 "configure"
1828 #include "confdefs.h"
1829
1830 int main(){return(0);}
1831 EOF
1832 if { (eval echo configure:1829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1833   optok=yes
1834   # If we can't run a trivial program, we are probably using a cross compiler.
1835   if (./conftest; exit) 2>/dev/null; then
1836     cross=no
1837   else
1838     cross=yes
1839   fi
1840 else
1841   echo "configure: failed program was:" >&5
1842   cat conftest.$ac_ext >&5
1843   optok=no
1844 fi
1845 rm -fr conftest*
1846       if test "$optok" = "yes"; then
1847         echo "$ECHO_T""yes" 1>&6
1848         gmp_found="yes"
1849         break
1850       else
1851         echo "$ECHO_T""no" 1>&6
1852         CFLAGS="$CFLAGS_save"
1853       fi
1854     done
1855     if test "$gmp_found" = "no"; then
1856       echo "$0: fatal: need a compiler that understands one of $xoptcflags"
1857       exit 1
1858     fi
1859   fi
1860 fi
1861
1862 # Restore CFLAGS given on command line.
1863 # FIXME: We've run through quite some unnecessary code looking for a
1864 # nice compiler and working flags for it, just to spoil that with user
1865 # supplied flags.
1866 test -n "$gmp_user_CFLAGS" && CFLAGS="$gmp_user_CFLAGS"
1867
1868 # Select chosen compiler.
1869
1870 echo $ECHO_N "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works... $ECHO_C" 1>&6
1871 echo "configure:1868: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" 1>&5
1872
1873 ac_ext=c
1874 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1875 ac_cpp='$CPP $CPPFLAGS'
1876 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1877 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1878 cross_compiling=$ac_cv_prog_cc_cross
1879
1880 cat >conftest.$ac_ext <<EOF
1881
1882 #line 1879 "configure"
1883 #include "confdefs.h"
1884
1885 int main(){return(0);}
1886 EOF
1887 if { (eval echo configure:1884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1888   ac_cv_prog_cc_works=yes
1889   # If we can't run a trivial program, we are probably using a cross compiler.
1890   if (./conftest; exit) 2>/dev/null; then
1891     ac_cv_prog_cc_cross=no
1892   else
1893     ac_cv_prog_cc_cross=yes
1894   fi
1895 else
1896   echo "configure: failed program was:" >&5
1897   cat conftest.$ac_ext >&5
1898   ac_cv_prog_cc_works=no
1899 fi
1900 rm -fr conftest*
1901 ac_ext=c
1902 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1903 ac_cpp='$CPP $CPPFLAGS'
1904 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1905 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1906 cross_compiling=$ac_cv_prog_cc_cross
1907
1908 echo "$ECHO_T""$ac_cv_prog_cc_works" 1>&6
1909 if test $ac_cv_prog_cc_works = no; then
1910   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 77; }
1911 fi
1912 echo $ECHO_N "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler... $ECHO_C" 1>&6
1913 echo "configure:1910: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" 1>&5
1914 echo "$ECHO_T""$ac_cv_prog_cc_cross" 1>&6
1915 cross_compiling=$ac_cv_prog_cc_cross
1916
1917 echo $ECHO_N "checking whether we are using GNU C... $ECHO_C" 1>&6
1918 echo "configure:1915: checking whether we are using GNU C" 1>&5
1919 if test "${ac_cv_prog_gcc+set}" = set; then
1920   echo $ECHO_N "(cached) $ECHO_C" 1>&6
1921 else
1922   cat >conftest.c <<EOF
1923 #ifdef __GNUC__
1924   yes;
1925 #endif
1926 EOF
1927 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1928   ac_cv_prog_gcc=yes
1929 else
1930   ac_cv_prog_gcc=no
1931 fi
1932 fi
1933 echo "$ECHO_T""$ac_cv_prog_gcc" 1>&6
1934
1935 if test "$ac_cv_prog_gcc" = "yes"; then
1936   GCC=yes
1937 else
1938   GCC=
1939 fi
1940
1941 # Set CFLAGS if not already set.
1942 if test -z "$CFLAGS"; then
1943   CFLAGS="-g"
1944   if test "$GCC" = "yes"; then
1945     CFLAGS="$CFLAGS -O2"
1946   fi
1947 fi
1948
1949 if test "${ac_cv_prog_CC+set}" = set; then
1950   echo $ECHO_N "(cached) $ECHO_C" 1>&6
1951 else
1952   ac_cv_prog_CC="$CC"
1953 fi
1954
1955 # How to assemble.
1956 CCAS="$CC -c"
1957
1958 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" 1>&6
1959 echo "configure:1956: checking how to run the C preprocessor" 1>&5
1960 # On Suns, sometimes $CPP names a directory.
1961 if test -n "$CPP" && test -d "$CPP"; then
1962   CPP=
1963 fi
1964 if test -z "$CPP"; then
1965 if test "${ac_cv_prog_CPP+set}" = set; then
1966   echo $ECHO_N "(cached) $ECHO_C" 1>&6
1967 else
1968     # This must be in double quotes, not single quotes, because CPP may get
1969   # substituted into the Makefile and "${CC-cc}" will confuse make.
1970   CPP="${CC-cc} -E"
1971   # On the NeXT, cc -E runs the code through the compiler's parser,
1972   # not just through cpp.
1973
1974 cat >conftest.$ac_ext <<EOF
1975 #line 1972 "configure"
1976 #include "confdefs.h"
1977 #include <assert.h>
1978 Syntax Error
1979 EOF
1980 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1981 { (eval echo configure:1978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1982 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1983 if test -z "$ac_err"; then
1984   :
1985 else
1986   echo "$ac_err" >&5
1987   echo "configure: failed program was:" >&5
1988   cat conftest.$ac_ext >&5
1989   rm -rf conftest*
1990   CPP="${CC-cc} -E -traditional-cpp"
1991
1992 cat >conftest.$ac_ext <<EOF
1993 #line 1990 "configure"
1994 #include "confdefs.h"
1995 #include <assert.h>
1996 Syntax Error
1997 EOF
1998 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1999 { (eval echo configure:1996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2000 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2001 if test -z "$ac_err"; then
2002   :
2003 else
2004   echo "$ac_err" >&5
2005   echo "configure: failed program was:" >&5
2006   cat conftest.$ac_ext >&5
2007   rm -rf conftest*
2008   CPP="${CC-cc} -nologo -E"
2009
2010 cat >conftest.$ac_ext <<EOF
2011 #line 2008 "configure"
2012 #include "confdefs.h"
2013 #include <assert.h>
2014 Syntax Error
2015 EOF
2016 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2017 { (eval echo configure:2014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2018 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2019 if test -z "$ac_err"; then
2020   :
2021 else
2022   echo "$ac_err" >&5
2023   echo "configure: failed program was:" >&5
2024   cat conftest.$ac_ext >&5
2025   rm -rf conftest*
2026   CPP=/lib/cpp
2027 fi
2028 rm -f conftest*
2029 fi
2030 rm -f conftest*
2031 fi
2032 rm -f conftest*
2033   ac_cv_prog_CPP="$CPP"
2034 fi
2035   CPP="$ac_cv_prog_CPP"
2036 else
2037   ac_cv_prog_CPP="$CPP"
2038 fi
2039 echo "$ECHO_T""$CPP" 1>&6
2040
2041 # Find a good install program.  We prefer a C program (faster),
2042 # so one script is as good as another.  But avoid the broken or
2043 # incompatible versions:
2044 # SysV /etc/install, /usr/sbin/install
2045 # SunOS /usr/etc/install
2046 # IRIX /sbin/install
2047 # AIX /bin/install
2048 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2049 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2050 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2051 # ./install, which can be erroneously created by make from ./install.sh.
2052 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" 1>&6
2053 echo "configure:2050: checking for a BSD compatible install" 1>&5
2054 if test -z "$INSTALL"; then
2055 if test "${ac_cv_path_install+set}" = set; then
2056   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2057 else
2058     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
2059   for ac_dir in $PATH; do
2060     # Account for people who put trailing slashes in PATH elements.
2061     case "$ac_dir/" in
2062     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2063     *)
2064       # OSF1 and SCO ODT 3.0 have their own names for install.
2065       # Don't use installbsd from OSF since it installs stuff as root
2066       # by default.
2067       for ac_prog in ginstall scoinst install; do
2068         if test -f $ac_dir/$ac_prog; then
2069           if test $ac_prog = install &&
2070             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2071             # AIX install.  It has an incompatible calling convention.
2072             :
2073           elif test $ac_prog = install &&
2074             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
2075             # program-specific install script used by HP pwplus--don't use.
2076             :
2077           else
2078             ac_cv_path_install="$ac_dir/$ac_prog -c"
2079             break 2
2080           fi
2081         fi
2082       done
2083       ;;
2084     esac
2085   done
2086   IFS="$ac_save_IFS"
2087
2088 fi
2089   if test "${ac_cv_path_install+set}" = set; then
2090     INSTALL="$ac_cv_path_install"
2091   else
2092     # As a last resort, use the slow shell script.  We don't cache a
2093     # path for INSTALL within a source directory, because that will
2094     # break other packages using the cache if that directory is
2095     # removed, or if the path is relative.
2096     INSTALL="$ac_install_sh"
2097   fi
2098 fi
2099 echo "$ECHO_T""$INSTALL" 1>&6
2100
2101 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2102 # It thinks the first close brace ends the variable substitution.
2103 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2104
2105 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2106
2107 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2108
2109 echo $ECHO_N "checking whether ln -s works... $ECHO_C" 1>&6
2110 echo "configure:2107: checking whether ln -s works" 1>&5
2111 if test "${ac_cv_prog_LN_S+set}" = set; then
2112   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2113 else
2114   rm -f conftestdata
2115 if ln -s X conftestdata 2>/dev/null
2116 then
2117   rm -f conftestdata
2118   ac_cv_prog_LN_S="ln -s"
2119 else
2120   ac_cv_prog_LN_S=ln
2121 fi
2122 fi
2123 LN_S="$ac_cv_prog_LN_S"
2124 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2125   echo "$ECHO_T""yes" 1>&6
2126 else
2127   echo "$ECHO_T""no" 1>&6
2128 fi
2129
2130 echo $ECHO_N "checking for suitable m4... $ECHO_C" 1>&6
2131 echo "configure:2128: checking for suitable m4" 1>&5
2132 if test "${gmp_cv_prog_m4+set}" = set; then
2133   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2134 else
2135   if test -n "$M4"; then
2136   gmp_cv_prog_m4="$M4"
2137 else
2138   cat >conftest.m4 <<\EOF
2139 define(dollarhash,``$#'')dnl
2140 ifelse(dollarhash(x),1,`define(t1,Y)',
2141 ``bad: $# not supported (SunOS /usr/bin/m4)
2142 '')dnl
2143 ifelse(eval(89),89,`define(t2,Y)',
2144 `bad: eval() doesnt support 8 or 9 in a constant (OpenBSD 2.6 m4)
2145 ')dnl
2146 ifelse(t1`'t2,YY,`good
2147 ')dnl
2148 EOF
2149   echo "trying m4" 1>&5
2150   gmp_tmp_val="`(m4 conftest.m4) 2>&5`"
2151   echo "$gmp_tmp_val" 1>&5
2152   if test "$gmp_tmp_val" = good; then
2153     gmp_cv_prog_m4="m4"
2154   else
2155     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS=":"
2156     ac_dummy="$PATH:/usr/5bin"
2157     for ac_dir in $ac_dummy; do
2158       test -z "$ac_dir" && ac_dir=.
2159       echo "trying $ac_dir/m4" 1>&5
2160       gmp_tmp_val="`($ac_dir/m4 conftest.m4) 2>&5`"
2161       echo "$gmp_tmp_val" 1>&5
2162       if test "$gmp_tmp_val" = good; then
2163         gmp_cv_prog_m4="$ac_dir/m4"
2164         break
2165       fi
2166     done
2167     IFS="$ac_save_ifs"
2168     if test -z "$gmp_cv_prog_m4"; then
2169       { echo "configure: error: No usable m4 in \$PATH or /usr/5bin (see config.log for reasons)." 1>&2; exit 1; }
2170     fi
2171   fi
2172   rm -f conftest.m4
2173 fi
2174 fi
2175 echo "$ECHO_T""$gmp_cv_prog_m4" 1>&6
2176 M4="$gmp_cv_prog_m4"
2177
2178 # Extract the first word of "ar", so it can be a program name with args.
2179 set dummy ar; ac_word=$2
2180 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
2181 echo "configure:2178: checking for $ac_word" 1>&5
2182 if test "${ac_cv_prog_AR+set}" = set; then
2183   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2184 else
2185   if test -n "$AR"; then
2186   ac_cv_prog_AR="$AR" # Let the user override the test.
2187 else
2188   for ac_path in `IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2189 ac_dummy="$PATH"
2190 for ac_dir in $ac_dummy; do
2191   test -z "$ac_dir" && ac_dir=.
2192   if test -f $ac_dir/$ac_word; then
2193     echo "$ac_dir/$ac_word"
2194   fi
2195 done
2196 IFS="$ac_save_ifs"
2197 `; do
2198     ac_cv_prog_AR="ar"
2199     break
2200   done
2201 fi
2202 fi
2203 AR="$ac_cv_prog_AR"
2204 if test -n "$AR"; then
2205   echo "$ECHO_T""$AR" 1>&6
2206 else
2207   echo "$ECHO_T""no" 1>&6
2208 fi
2209
2210 # ar on AIX needs to know the object file format
2211 case "$target" in
2212   powerpc64*-*-aix*)
2213     AR="$AR -X 64"
2214     ;;
2215 esac
2216
2217 if test "$gmp_no_asm_syntax_testing" != "yes"; then
2218   echo $ECHO_N "checking how to switch to text section... $ECHO_C" 1>&6
2219 echo "configure:2216: checking how to switch to text section" 1>&5
2220 if test "${gmp_cv_check_asm_text+set}" = set; then
2221   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2222 else
2223   case "$target" in
2224   *-*-aix*)
2225
2226     gmp_cv_check_asm_text=".csect .text[PR]"
2227
2228     ;;
2229   *-*-hpux*) gmp_cv_check_asm_text=".code" ;;
2230   *) gmp_cv_check_asm_text=".text" ;;
2231 esac
2232
2233 fi
2234 echo "$ECHO_T""$gmp_cv_check_asm_text" 1>&6
2235 echo "define(<TEXT>, <$gmp_cv_check_asm_text>)" >> $gmp_tmpconfigm4
2236
2237   echo $ECHO_N "checking how to switch to data section... $ECHO_C" 1>&6
2238 echo "configure:2235: checking how to switch to data section" 1>&5
2239 if test "${gmp_cv_check_asm_data+set}" = set; then
2240   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2241 else
2242   case "$target" in
2243   *-*-aix*)
2244
2245     gmp_cv_check_asm_data=".csect .data[RW]"
2246
2247     ;;
2248   *) gmp_cv_check_asm_data=".data" ;;
2249 esac
2250
2251 fi
2252 echo "$ECHO_T""$gmp_cv_check_asm_data" 1>&6
2253 echo "define(<DATA>, <$gmp_cv_check_asm_data>)" >> $gmp_tmpconfigm4
2254
2255   echo $ECHO_N "checking how to export a symbol... $ECHO_C" 1>&6
2256 echo "configure:2253: checking how to export a symbol" 1>&5
2257 if test "${gmp_cv_check_asm_globl+set}" = set; then
2258   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2259 else
2260   case "$target" in
2261   *-*-hpux*) gmp_cv_check_asm_globl=".export" ;;
2262   *) gmp_cv_check_asm_globl=".globl" ;;
2263 esac
2264
2265 fi
2266 echo "$ECHO_T""$gmp_cv_check_asm_globl" 1>&6
2267 echo "define(<GLOBL>, <$gmp_cv_check_asm_globl>)" >> $gmp_tmpconfigm4
2268
2269   echo $ECHO_N "checking what assembly label suffix to use... $ECHO_C" 1>&6
2270 echo "configure:2267: checking what assembly label suffix to use" 1>&5
2271 if test "${gmp_cv_check_asm_label_suffix+set}" = set; then
2272   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2273 else
2274   case "$target" in
2275   *-*-hpux*) gmp_cv_check_asm_label_suffix="" ;;
2276   *) gmp_cv_check_asm_label_suffix=":" ;;
2277 esac
2278
2279 fi
2280 echo "$ECHO_T""$gmp_cv_check_asm_label_suffix" 1>&6
2281 echo "define(<LABEL_SUFFIX>, <\$1$gmp_cv_check_asm_label_suffix>)" >> $gmp_tmpconfigm4
2282
2283   echo $ECHO_N "checking how the .type assembly directive should be used... $ECHO_C" 1>&6
2284 echo "configure:2281: checking how the .type assembly directive should be used" 1>&5
2285 if test "${gmp_cv_check_asm_type+set}" = set; then
2286   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2287 else
2288   ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
2289 for gmp_tmp_prefix in @ \# %; do
2290   echo "        .type   sym,${gmp_tmp_prefix}function" > conftest.s
2291   if { (eval echo configure:2288: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
2292     gmp_cv_check_asm_type=".type        \$1,${gmp_tmp_prefix}\$2"
2293     break
2294   fi
2295 done
2296 if test -z "$gmp_cv_check_asm_type"; then
2297   gmp_cv_check_asm_type="dnl"
2298 fi
2299
2300 fi
2301 echo "$ECHO_T""$gmp_cv_check_asm_type" 1>&6
2302 echo "define(<TYPE>, <$gmp_cv_check_asm_type>)" >> $gmp_tmpconfigm4
2303
2304   echo $ECHO_N "checking if the .size assembly directive works... $ECHO_C" 1>&6
2305 echo "configure:2302: checking if the .size assembly directive works" 1>&5
2306 if test "${gmp_cv_check_asm_size+set}" = set; then
2307   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2308 else
2309   ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
2310 echo '  .size   sym,1' > conftest.s
2311 if { (eval echo configure:2308: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
2312   gmp_cv_check_asm_size=".size  \$1,\$2"
2313 else
2314   gmp_cv_check_asm_size="dnl"
2315 fi
2316
2317 fi
2318 echo "$ECHO_T""$gmp_cv_check_asm_size" 1>&6
2319 echo "define(<SIZE>, <$gmp_cv_check_asm_size>)" >> $gmp_tmpconfigm4
2320
2321 echo $ECHO_N "checking what prefix to use for a local label... $ECHO_C" 1>&6
2322 echo "configure:2319: checking what prefix to use for a local label" 1>&5
2323 if test "${gmp_cv_check_asm_lsym_prefix+set}" = set; then
2324   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2325 else
2326   if test -z "$NM"; then
2327   echo; echo "GMP_CHECK_ASM_LSYM_PREFIX: fatal: need nm"
2328   exit 1
2329 fi
2330 ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
2331 gmp_cv_check_asm_lsym_prefix="L"
2332 for gmp_tmp_pre in L .L $ L$; do
2333   cat > conftest.s <<EOF
2334 dummy${gmp_cv_check_asm_label_suffix}
2335 ${gmp_tmp_pre}gurkmacka${gmp_cv_check_asm_label_suffix}
2336         .byte 0
2337 EOF
2338   if { (eval echo configure:2335: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
2339     $NM conftest.o >/dev/null 2>&1
2340     gmp_rc=$?
2341     if test "$gmp_rc" != "0"; then
2342       echo "configure: $NM failure, using default"
2343       break
2344     fi
2345     if $NM conftest.o | grep gurkmacka >/dev/null; then true; else
2346       gmp_cv_check_asm_lsym_prefix="$gmp_tmp_pre"
2347       break
2348     fi
2349   else
2350     echo "configure: failed program was:" >&5
2351     cat conftest.s >&5
2352     # Use default.
2353   fi
2354 done
2355 rm -f conftest*
2356
2357 fi
2358 echo "$ECHO_T""$gmp_cv_check_asm_lsym_prefix" 1>&6
2359 echo "define(<LSYM_PREFIX>, <${gmp_cv_check_asm_lsym_prefix}>)" >> $gmp_tmpconfigm4
2360
2361 echo $ECHO_N "checking how to define a 32-bit word... $ECHO_C" 1>&6
2362 echo "configure:2359: checking how to [define] a 32-bit word" 1>&5
2363 if test "${gmp_cv_check_asm_w32+set}" = set; then
2364   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2365 else
2366   if test -z "$NM"; then
2367   echo; echo "configure: GMP_CHECK_ASM_W32: fatal: need nm"
2368   exit 1
2369 fi
2370
2371 # FIXME: HPUX puts first symbol at 0x40000000, breaking our assumption
2372 # that it's at 0x0.  We'll have to declare another symbol before the
2373 # .long/.word and look at the distance between the two symbols.  The
2374 # only problem is that the sed expression(s) barfs (on Solaris, for
2375 # example) for the symbol with value 0.  For now, HPUX uses .word.
2376
2377 case "$target" in
2378   *-*-hpux*)
2379     gmp_cv_check_asm_w32=".word"
2380     ;;
2381   *-*-*)
2382     ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
2383     for gmp_tmp_op in .long .word; do
2384       cat > conftest.s <<EOF
2385         $gmp_cv_check_asm_data
2386         $gmp_cv_check_asm_globl foo
2387         $gmp_tmp_op     0
2388 foo${gmp_cv_check_asm_label_suffix}
2389         .byte   0
2390 EOF
2391       if { (eval echo configure:2388: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
2392
2393         gmp_tmp_val=`$NM conftest.o | grep foo | sed -e 's;[[][0-9][]]\(.*\);\1;' \
2394              -e 's;[^1-9]*\([0-9]*\).*;\1;'`
2395                 if test "$gmp_tmp_val" = "4"; then
2396           gmp_cv_check_asm_w32="$gmp_tmp_op"
2397           break
2398         fi
2399       fi
2400     done
2401     ;;
2402 esac
2403
2404 if test -z "$gmp_cv_check_asm_w32"; then
2405   echo; echo "configure: GMP_CHECK_ASM_W32: fatal: do not know how to define a 32-bit word"
2406   exit 1
2407 fi
2408 rm -f conftest*
2409
2410 fi
2411 echo "$ECHO_T""$gmp_cv_check_asm_w32" 1>&6
2412 echo "define(<W32>, <$gmp_cv_check_asm_w32>)" >> $gmp_tmpconfigm4
2413
2414   echo $ECHO_N "checking if symbols are prefixed by underscore... $ECHO_C" 1>&6
2415 echo "configure:2412: checking if symbols are prefixed by underscore" 1>&5
2416 if test "${gmp_cv_check_asm_underscore+set}" = set; then
2417   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2418 else
2419   cat > conftest.$ac_ext <<EOF
2420 #line 2417 "configure"
2421 #include "confdefs.h"
2422 int underscore_test() {
2423 return; }
2424 EOF
2425 if { (eval echo configure:2422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2426   if grep _underscore_test conftest* >/dev/null; then
2427     gmp_cv_check_asm_underscore=yes
2428   else
2429     gmp_cv_check_asm_underscore=no
2430   fi
2431 else
2432   echo "configure: failed program was:" >&5
2433   cat conftest.$ac_ext >&5
2434 fi
2435 rm -f conftest*
2436
2437 fi
2438 echo "$ECHO_T""$gmp_cv_check_asm_underscore" 1>&6
2439 if test "$gmp_cv_check_asm_underscore" = "yes"; then
2440
2441 echo 'define(<GSYM_PREFIX>, <_>)' >> $gmp_tmpconfigm4
2442
2443   underscore=yes
2444 else
2445
2446 echo 'define(<GSYM_PREFIX>, <>)' >> $gmp_tmpconfigm4
2447
2448   underscore=no
2449 fi
2450
2451 echo $ECHO_N "checking if .align assembly directive is logarithmic... $ECHO_C" 1>&6
2452 echo "configure:2449: checking if .align assembly directive is logarithmic" 1>&5
2453 if test "${gmp_cv_check_asm_align_log+set}" = set; then
2454   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2455 else
2456   if test -z "$NM"; then
2457   echo; echo "configure: GMP_CHECK_ASM_ALIGN_LOG: fatal: need nm"
2458   exit 1
2459 fi
2460 cat > conftest.s <<EOF
2461         $gmp_cv_check_asm_data
2462         .align  4
2463         $gmp_cv_check_asm_globl foo
2464         .byte   1
2465         .align  4
2466 foo$gmp_cv_check_asm_label_suffix
2467         .byte   2
2468 EOF
2469 ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
2470 if { (eval echo configure:2467: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
2471
2472   gmp_tmp_val=`$NM conftest.o | grep foo | sed -e 's;[[][0-9][]]\(.*\);\1;' \
2473        -e 's;[^1-9]*\([0-9]*\).*;\1;'`
2474     if test "$gmp_tmp_val" = "10" || test "$gmp_tmp_val" = "16"; then
2475     gmp_cv_check_asm_align_log=yes
2476   else
2477     gmp_cv_check_asm_align_log=no
2478   fi
2479 else
2480   echo "configure: failed program was:" >&5
2481   cat conftest.s >&5
2482 fi
2483 rm -f conftest*
2484
2485 fi
2486 echo "$ECHO_T""$gmp_cv_check_asm_align_log" 1>&6
2487
2488 echo "define(<ALIGN_LOGARITHMIC>,<$gmp_cv_check_asm_align_log>)" >> $gmp_tmpconfigm4
2489
2490 if test "$gmp_cv_check_asm_align_log" = "yes"; then
2491   asm_align=log
2492 else
2493   asm_align=nolog
2494 fi
2495
2496 fi
2497
2498 family=generic
2499
2500 case ${target} in
2501   arm*-*-*)
2502     path="arm"
2503     ;;
2504   sparcv9*-*-solaris2.[789]* | sparc64*-*-solaris2.[789]* | ultrasparc*-*-solaris2.[789]*)
2505     if test -n "$CC64"
2506       then path="sparc64"
2507       else path="sparc32/v9 sparc32/v8 sparc32"
2508     fi
2509     ;;
2510   sparc64-*-linux*)
2511     if test -n "$CC64"
2512       then path="sparc64"
2513       else path="sparc32/v9 sparc32/v8 sparc32"
2514     fi
2515     ;;
2516   sparcv8*-*-* | microsparc*-*-*)
2517         path="sparc32/v8 sparc32"
2518         if test x${floating_point} = xno
2519           then extra_functions="udiv_nfp"
2520           else extra_functions="udiv_fp"
2521         fi
2522         ;;
2523   sparcv9*-*-* | ultrasparc*-*-*)
2524         path="sparc32/v9 sparc32/v8 sparc32"
2525         extra_functions="udiv_fp"
2526         ;;
2527   supersparc*-*-*)
2528         path="sparc32/v8/supersparc sparc32/v8 sparc32"
2529         extra_functions="udiv"
2530         ;;
2531   sparc*-*-*) path="sparc32"
2532         if test x${floating_point} = xno
2533           then extra_functions="udiv_nfp"
2534           else extra_functions="udiv_fp"
2535         fi
2536         ;;
2537   hppa7000*-*-*)
2538     path="hppa/hppa1_1 hppa"
2539     extra_functions="udiv_qrnnd"
2540     ;;
2541   hppa1.0*-*-*)
2542     path="hppa"
2543     extra_functions="udiv_qrnnd"
2544     ;;
2545   hppa2.0w-*-*)
2546     path="pa64w"
2547     extra_functions="umul_ppmm udiv_qrnnd"
2548     ;;
2549   hppa2.0*-*-*)
2550     if test -n "$CC64"; then
2551       path="pa64"
2552       extra_functions="umul_ppmm udiv_qrnnd"
2553       # We need to use the system compiler, or actually the system assembler,
2554       # since GAS has not been ported to understand the 2.0 instructions.
2555       CCAS="$CC64 -c"
2556     else
2557       # FIXME: path should be "hppa/hppa2_0 hppa/hppa1_1 hppa"
2558       path="hppa/hppa1_1 hppa"
2559       extra_functions="udiv_qrnnd"
2560     fi
2561     ;;
2562   hppa*-*-*)                                    #assume pa7100
2563     path="hppa/hppa1_1/pa7100 hppa/hppa1_1 hppa"
2564     extra_functions="udiv_qrnnd";;
2565   f30[01]-fujitsu-sysv*)
2566     path=fujitsu;;
2567   alphaev6*-*-*) path="alpha/ev6 alpha"; extra_functions="invert_limb cntlz";;
2568   alphaev5*-*-*) path="alpha/ev5 alpha"; extra_functions="invert_limb cntlz";;
2569   alpha*-*-*) path="alpha"; extra_functions="invert_limb cntlz";;
2570   # Cray vector machines.  This must come after alpha* so that we can
2571   # recognize present and future vector processors with a wildcard.
2572   *-cray-unicos*)
2573     path="cray"
2574     extra_functions="mulww";;
2575   am29000*-*-*) path="a29k";;
2576   a29k*-*-*) path="a29k";;
2577
2578   # AMD and Intel x86 configurations
2579
2580   i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-*)
2581     gmp_m4postinc="x86/x86-defs.m4"
2582     extra_functions="udiv umul"
2583     CALLING_CONVENTIONS_OBJS="x86call.o x86check.o"
2584
2585 echo $ECHO_N "checking if the assembler takes cl with shldl... $ECHO_C" 1>&6
2586 echo "configure:2583: checking if the assembler takes cl with shldl" 1>&5
2587 if test "${gmp_cv_check_asm_shldl_cl+set}" = set; then
2588   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2589 else
2590   cat > conftest.s <<EOF
2591         $gmp_cv_check_asm_text
2592         shldl   %cl, %eax, %ebx
2593 EOF
2594 ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
2595 if { (eval echo configure:2592: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
2596   gmp_cv_check_asm_shldl_cl=yes
2597 else
2598   gmp_cv_check_asm_shldl_cl=no
2599 fi
2600 rm -f conftest*
2601
2602 fi
2603 echo "$ECHO_T""$gmp_cv_check_asm_shldl_cl" 1>&6
2604 if test "$gmp_cv_check_asm_shldl_cl" = "yes"; then
2605
2606 echo 'define(<WANT_SHLDL_CL>, <1>)' >> $gmp_tmpconfigm4
2607
2608 else
2609
2610 echo 'define(<WANT_SHLDL_CL>, <0>)' >> $gmp_tmpconfigm4
2611
2612 fi
2613
2614     echo $ECHO_N "checking if the .align directive accepts an 0x90 fill in .text... $ECHO_C" 1>&6
2615 echo "configure:2612: checking if the .align directive accepts an 0x90 fill in .text" 1>&5
2616 if test "${gmp_cv_check_asm_align_fill_0x90+set}" = set; then
2617   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2618 else
2619
2620 cat > conftest.s <<EOF
2621         $gmp_cv_check_asm_text
2622         .align  4, 0x90
2623         .byte   0
2624         .align  4, 0x90
2625 EOF
2626 gmp_tmp_val="`$CCAS $CFLAGS conftest.s 2>&1`"
2627 if test $? = 0; then
2628   echo "$gmp_tmp_val" 1>&5
2629   if echo "$gmp_tmp_val" | grep "Warning: Fill parameter ignored for executable section"; then
2630     echo "Supressing this warning by omitting 0x90" 1>&5
2631     gmp_cv_check_asm_align_fill_0x90=no
2632   else
2633     gmp_cv_check_asm_align_fill_0x90=yes
2634   fi
2635 else
2636   echo "Non-zero exit code" 1>&5
2637   echo "$gmp_tmp_val" 1>&5
2638   gmp_cv_check_asm_align_fill_0x90=no
2639 fi
2640 rm -f conftest*
2641
2642 fi
2643 echo "$ECHO_T""$gmp_cv_check_asm_align_fill_0x90" 1>&6
2644
2645 echo "define(<ALIGN_FILL_0x90>,<$gmp_cv_check_asm_align_fill_0x90>)" >> $gmp_tmpconfigm4
2646
2647     # the CPUs below wanting to know about mmx
2648     case ${target} in
2649       pentiummmx-*-* | pentium[23]-*-* | k6*-*-* | athlon-*-*)
2650
2651 echo $ECHO_N "checking if the assembler knows about MMX instructions... $ECHO_C" 1>&6
2652 echo "configure:2649: checking if the assembler knows about MMX instructions" 1>&5
2653 if test "${gmp_cv_check_asm_mmx+set}" = set; then
2654   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2655 else
2656   cat > conftest.s <<EOF
2657         $gmp_cv_check_asm_text
2658         por     %mm0, %mm0
2659 EOF
2660 ac_assemble="$CCAS $CFLAGS conftest.s 1>&5"
2661 if { (eval echo configure:2658: \"$ac_assemble\") 1>&5; (eval $ac_assemble) 2>&5; }; then
2662   gmp_cv_check_asm_mmx=yes
2663 else
2664   gmp_cv_check_asm_mmx=no
2665 fi
2666 rm -f conftest*
2667
2668 fi
2669 echo "$ECHO_T""$gmp_cv_check_asm_mmx" 1>&6
2670 if test "$gmp_cv_check_asm_mmx" = "yes"; then
2671   tmp_mmx=yes
2672 else
2673   echo "configure: warning: +----------------------------------------------------------" 1>&2
2674   echo "configure: warning: | WARNING WARNING WARNING" 1>&2
2675   echo "configure: warning: | Target CPU has MMX code, but it can't be assembled by" 1>&2
2676   echo "configure: warning: |     $CCAS $CFLAGS" 1>&2
2677   echo "configure: warning: | Non-MMX replacements will be used." 1>&2
2678   echo "configure: warning: | This will be an inferior build." 1>&2
2679   echo "configure: warning: +----------------------------------------------------------" 1>&2
2680   tmp_mmx=no
2681 fi
2682
2683         ;;
2684     esac
2685
2686     # default for anything not otherwise mentioned
2687     path="x86"
2688
2689     case ${target} in
2690       i[34]86*-*-*)
2691         path="x86"
2692         ;;
2693       k5*-*-*)
2694         # don't know what best suits k5
2695         path="x86"
2696         ;;
2697       i586*-*-* | pentium-*-*)
2698         path="x86/pentium x86"
2699         ;;
2700       pentiummmx-*-*)
2701         path="x86/pentium x86"
2702         if test "$tmp_mmx" = yes; then
2703           path="x86/pentium/mmx $path"
2704         fi
2705         ;;
2706       i686*-*-* | pentiumpro-*-*)
2707         path="x86/p6 x86"
2708         ;;
2709       pentium2-*-*)
2710         path="x86/p6 x86"
2711         # The pentium/mmx lshift and rshift are good on p6 and can be used
2712         # until there's something specific for p6.
2713         if test "$tmp_mmx" = yes; then
2714           path="x86/p6/mmx x86/pentium/mmx $path"
2715         fi
2716         ;;
2717       pentium3-*-*)
2718         path="x86/p6 x86"
2719         # The pentium/mmx lshift and rshift are good on p6 and can be used
2720         # until there's something specific for p6.
2721         if test "$tmp_mmx" = yes; then
2722           path="x86/p6/p3mmx x86/p6/mmx x86/pentium/mmx $path"
2723         fi
2724         ;;
2725       k6[23]*-*-*)
2726         path="x86/k6 x86"
2727         if test "$tmp_mmx" = yes; then
2728           path="x86/k6/k62mmx x86/k6/mmx $path"
2729         fi
2730         ;;
2731       k6*-*-*)
2732         path="x86/k6 x86"
2733         if test "$tmp_mmx" = yes; then
2734           path="x86/k6/mmx $path"
2735         fi
2736         ;;
2737       athlon-*-*)
2738         path="x86/k7 x86"
2739         if test "$tmp_mmx" = yes; then
2740           path="x86/k7/mmx $path"
2741         fi
2742         ;;
2743     esac
2744     ;;
2745
2746   i960*-*-*) path="i960";;
2747
2748   ia64*-*-*) path="ia64";;
2749
2750 # Motorola 68k configurations.  Let m68k mean 68020-68040.
2751   m680[234]0*-*-* | m68k*-*-* | \
2752   m68*-next-nextstep*)          # Nexts are at least '020
2753     path="m68k/mc68020 m68k"
2754     family=m68k
2755     ;;
2756   m68000*-*-*)
2757     path="m68k"
2758     family=m68k
2759     ;;
2760
2761   m88k*-*-* | m88k*-*-*) path="m88k";;
2762   m88110*-*-*) path="m88k/mc88110 m88k";;
2763   ns32k*-*-*) path="ns32k";;
2764
2765   pyramid-*-*) path="pyr";;
2766
2767   ppc601-*-*) path="power powerpc32";;
2768   powerpc64*-*-*) path="powerpc64";;
2769   powerpc*-*-*) path="powerpc32";;
2770   rs6000-*-* | power-*-* | power2-*-*)
2771     path="power"
2772     extra_functions="udiv_w_sdiv"
2773     ;;
2774
2775   sh-*-*) path="sh";;
2776   sh2-*-*) path="sh/sh2 sh";;
2777
2778   mips[34]*-*-*) path="mips3";;
2779   mips*-*-irix6*) path="mips3";;
2780   mips*-*-*) path="mips2";;
2781
2782   vax*-*-*) path="vax"; extra_functions="udiv_w_sdiv";;
2783
2784   z8000x*-*-*) path="z8000x"; extra_functions="udiv_w_sdiv";;
2785   z8000*-*-*) path="z8000"; extra_functions="udiv_w_sdiv";;
2786
2787   clipper*-*-*) path="clipper";;
2788 esac
2789
2790 if test -n "$CALLING_CONVENTIONS_OBJS"; then
2791   cat >>confdefs.h <<\EOF
2792 #define HAVE_CALLING_CONVENTIONS 1
2793 EOF
2794
2795 fi
2796
2797 case ${target} in
2798   i[5-8]86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-*)
2799     # rdtsc is in pentium and up, not in i386 and i486
2800     SPEED_CYCLECOUNTER_OBJS=pentium.lo
2801     ;;
2802   alpha*-*-*)
2803     SPEED_CYCLECOUNTER_OBJS=alpha.lo
2804     ;;
2805   sparcv9*-*-* | ultrasparc*-*-* | sparc64*-*-*)
2806     SPEED_CYCLECOUNTER_OBJS=sparcv9.lo
2807     ;;
2808   hppa2*-*-*)
2809     SPEED_CYCLECOUNTER_OBJS=hppa2.lo
2810     ;;
2811   hppa*-*-*)
2812     SPEED_CYCLECOUNTER_OBJS=hppa.lo
2813     ;;
2814 esac
2815
2816 if test -n "$SPEED_CYCLECOUNTER_OBJS"
2817 then
2818   cat >>confdefs.h <<\EOF
2819 #define HAVE_SPEED_CYCLECOUNTER 1
2820 EOF
2821
2822 fi
2823
2824 echo $ECHO_N "checking for Cygwin environment... $ECHO_C" 1>&6
2825 echo "configure:2822: checking for Cygwin environment" 1>&5
2826 if test "${ac_cv_cygwin+set}" = set; then
2827   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2828 else
2829   cat >conftest.$ac_ext <<EOF
2830 #line 2827 "configure"
2831 #include "confdefs.h"
2832
2833 int
2834 main ()
2835 {
2836 #ifndef __CYGWIN__
2837 # define __CYGWIN__ __CYGWIN32__
2838 #endif
2839 return __CYGWIN__;
2840   ;
2841   return 0;
2842 }
2843 EOF
2844 if { (eval echo configure:2841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2845   rm -rf conftest*
2846   ac_cv_cygwin=yes
2847 else
2848   echo "configure: failed program was:" >&5
2849   cat conftest.$ac_ext >&5
2850   rm -rf conftest*
2851   ac_cv_cygwin=no
2852 fi
2853 rm -f conftest*
2854 fi
2855 echo "$ECHO_T""$ac_cv_cygwin" 1>&6
2856 CYGWIN=
2857 test "$ac_cv_cygwin" = yes && CYGWIN=yes
2858 echo $ECHO_N "checking for mingw32 environment... $ECHO_C" 1>&6
2859 echo "configure:2856: checking for mingw32 environment" 1>&5
2860 if test "${ac_cv_mingw32+set}" = set; then
2861   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2862 else
2863   cat >conftest.$ac_ext <<EOF
2864 #line 2861 "configure"
2865 #include "confdefs.h"
2866
2867 int
2868 main ()
2869 {
2870 return __MINGW32__;
2871   ;
2872   return 0;
2873 }
2874 EOF
2875 if { (eval echo configure:2872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2876   rm -rf conftest*
2877   ac_cv_mingw32=yes
2878 else
2879   echo "configure: failed program was:" >&5
2880   cat conftest.$ac_ext >&5
2881   rm -rf conftest*
2882   ac_cv_mingw32=no
2883 fi
2884 rm -f conftest*
2885 fi
2886 echo "$ECHO_T""$ac_cv_mingw32" 1>&6
2887 MINGW32=
2888 test "$ac_cv_mingw32" = yes && MINGW32=yes
2889 echo $ECHO_N "checking for EMX OS/2 environment... $ECHO_C" 1>&6
2890 echo "configure:2887: checking for EMX OS/2 environment" 1>&5
2891 if test "${ac_cv_emxos2+set}" = set; then
2892   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2893 else
2894   cat >conftest.$ac_ext <<EOF
2895 #line 2892 "configure"
2896 #include "confdefs.h"
2897
2898 int
2899 main ()
2900 {
2901 return __EMX__;
2902   ;
2903   return 0;
2904 }
2905 EOF
2906 if { (eval echo configure:2903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2907   rm -rf conftest*
2908   ac_cv_emxos2=yes
2909 else
2910   echo "configure: failed program was:" >&5
2911   cat conftest.$ac_ext >&5
2912   rm -rf conftest*
2913   ac_cv_emxos2=no
2914 fi
2915 rm -f conftest*
2916 fi
2917 echo "$ECHO_T""$ac_cv_emxos2" 1>&6
2918 EMXOS2=
2919 test "$ac_cv_emxos2" = yes && EMXOS2=yes
2920
2921 echo $ECHO_N "checking for executable suffix... $ECHO_C" 1>&6
2922 echo "configure:2919: checking for executable suffix" 1>&5
2923 if test "${ac_cv_exeext+set}" = set; then
2924   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2925 else
2926   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
2927   ac_cv_exeext=.exe
2928 else
2929   rm -f conftest*
2930   echo 'int main () { return 0; }' >conftest.$ac_ext
2931   ac_cv_exeext=
2932   if { (eval echo configure:2929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
2933     for ac_file in conftest.*; do
2934       case $ac_file in
2935       *.c | *.C | *.o | *.obj | *.xcoff) ;;
2936       *) ac_cv_exeext=`echo $ac_file | sed -e s/conftest//` ;;
2937       esac
2938     done
2939   else
2940     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
2941   fi
2942   rm -f conftest*
2943   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
2944 fi
2945 fi
2946
2947 EXEEXT=""
2948 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
2949 echo "$ECHO_T""${ac_cv_exeext}" 1>&6
2950 ac_exeext=$EXEEXT
2951
2952 echo $ECHO_N "checking for object suffix... $ECHO_C" 1>&6
2953 echo "configure:2950: checking for object suffix" 1>&5
2954 if test "${ac_cv_objext+set}" = set; then
2955   echo $ECHO_N "(cached) $ECHO_C" 1>&6
2956 else
2957   rm -f conftest*
2958 echo 'int i = 1;' >conftest.$ac_ext
2959 if { (eval echo configure:2956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2960   for ac_file in conftest.*; do
2961     case $ac_file in
2962     *.c) ;;
2963     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
2964     esac
2965   done
2966 else
2967   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
2968 fi
2969 rm -f conftest*
2970 fi
2971
2972 echo "$ECHO_T""$ac_cv_objext" 1>&6
2973 OBJEXT=$ac_cv_objext
2974 ac_objext=$ac_cv_objext
2975
2976 case "$target" in
2977   *-*-aix4.[3-9]*) enable_shared=no ;;
2978 esac
2979 # Check whether --enable-shared or --disable-shared was given.
2980 if test "${enable_shared+set}" = set; then
2981   enableval="$enable_shared"
2982   p=${PACKAGE-default}
2983 case "$enableval" in
2984 yes) enable_shared=yes ;;
2985 no) enable_shared=no ;;
2986 *)
2987   enable_shared=no
2988   # Look at the argument we got.  We use all the common list separators.
2989   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2990   for pkg in $enableval; do
2991     if test "X$pkg" = "X$p"; then
2992       enable_shared=yes
2993     fi
2994   done
2995   IFS="$ac_save_ifs"
2996   ;;
2997 esac
2998 else
2999   enable_shared=yes
3000 fi
3001 # Check whether --enable-static or --disable-static was given.
3002 if test "${enable_static+set}" = set; then
3003   enableval="$enable_static"
3004   p=${PACKAGE-default}
3005 case "$enableval" in
3006 yes) enable_static=yes ;;
3007 no) enable_static=no ;;
3008 *)
3009   enable_static=no
3010   # Look at the argument we got.  We use all the common list separators.
3011   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3012   for pkg in $enableval; do
3013     if test "X$pkg" = "X$p"; then
3014       enable_static=yes
3015     fi
3016   done
3017   IFS="$ac_save_ifs"
3018   ;;
3019 esac
3020 else
3021   enable_static=yes
3022 fi
3023 # Check whether --enable-fast-install or --disable-fast-install was given.
3024 if test "${enable_fast_install+set}" = set; then
3025   enableval="$enable_fast_install"
3026   p=${PACKAGE-default}
3027 case "$enableval" in
3028 yes) enable_fast_install=yes ;;
3029 no) enable_fast_install=no ;;
3030 *)
3031   enable_fast_install=no
3032   # Look at the argument we got.  We use all the common list separators.
3033   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
3034   for pkg in $enableval; do
3035     if test "X$pkg" = "X$p"; then
3036       enable_fast_install=yes
3037     fi
3038   done
3039   IFS="$ac_save_ifs"
3040   ;;
3041 esac
3042 else
3043   enable_fast_install=yes
3044 fi
3045
3046 echo $ECHO_N "checking build system type... $ECHO_C" 1>&6
3047 echo "configure:3044: checking build system type" 1>&5
3048 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
3049
3050   # Make sure we can run config.sub.
3051   if $ac_config_sub sun4 >/dev/null 2>&1; then :; else
3052     { echo "configure: error: cannot run $ac_config_sub" 1>&2; exit 1; }
3053   fi
3054
3055   ac_cv_build_alias=$build
3056   case "$ac_cv_build_alias" in
3057   NONE)
3058     case $nonopt in
3059     NONE)
3060       ac_cv_build_alias=$host_alias ;;
3061     *) ac_cv_build_alias=$nonopt ;;
3062     esac ;;
3063   esac
3064
3065   ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || exit 1
3066   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
3067   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
3068   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
3069 else
3070   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3071 fi
3072
3073 echo "$ECHO_T""$ac_cv_build" 1>&6
3074
3075 build=$ac_cv_build
3076 build_alias=$ac_cv_build_alias
3077 build_cpu=$ac_cv_build_cpu
3078 build_vendor=$ac_cv_build_vendor
3079 build_os=$ac_cv_build_os
3080
3081 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3082 if test "${with_gnu_ld+set}" = set; then
3083   withval="$with_gnu_ld"
3084   test "$withval" = no || with_gnu_ld=yes
3085 else
3086   with_gnu_ld=no
3087 fi
3088
3089 ac_prog=ld
3090 if test "$ac_cv_prog_gcc" = yes; then
3091   # Check if gcc -print-prog-name=ld gives a path.
3092   echo $ECHO_N "checking for ld used by GCC... $ECHO_C" 1>&6
3093 echo "configure:3090: checking for ld used by GCC" 1>&5
3094   case $lt_target in
3095   *-*-mingw*)
3096     # gcc leaves a trailing carriage return which upsets mingw
3097     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3098   *)
3099     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3100   esac
3101   case "$ac_prog" in
3102     # Accept absolute paths.
3103     [\\/]* | [A-Za-z]:[\\/]*)
3104       re_direlt='/[^/][^/]*/\.\./'
3105       # Canonicalize the path of ld
3106       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3107       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3108         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3109       done
3110       test -z "$LD" && LD="$ac_prog"
3111       ;;
3112   "")
3113     # If it fails, then pretend we aren't using GCC.
3114     ac_prog=ld
3115     ;;
3116   *)
3117     # If it is relative, then search for the first ld in PATH.
3118     with_gnu_ld=unknown
3119     ;;
3120   esac
3121 elif test "$with_gnu_ld" = yes; then
3122   echo $ECHO_N "checking for GNU ld... $ECHO_C" 1>&6
3123 echo "configure:3120: checking for GNU ld" 1>&5
3124 else
3125   echo $ECHO_N "checking for non-GNU ld... $ECHO_C" 1>&6
3126 echo "configure:3123: checking for non-GNU ld" 1>&5
3127 fi
3128 if test "${ac_cv_path_LD+set}" = set; then
3129   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3130 else
3131   if test -z "$LD"; then
3132   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3133   for ac_dir in $PATH; do
3134     test -z "$ac_dir" && ac_dir=.
3135     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3136       ac_cv_path_LD="$ac_dir/$ac_prog"
3137       # Check to see if the program is GNU ld.  I'd rather use --version,
3138       # but apparently some GNU ld's only accept -v.
3139       # Break only if it was the GNU/non-GNU ld that we prefer.
3140       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3141         test "$with_gnu_ld" != no && break
3142       else
3143         test "$with_gnu_ld" != yes && break
3144       fi
3145     fi
3146   done
3147   IFS="$ac_save_ifs"
3148 else
3149   ac_cv_path_LD="$LD" # Let the user override the test with a path.
3150 fi
3151 fi
3152
3153 LD="$ac_cv_path_LD"
3154 if test -n "$LD"; then
3155   echo "$ECHO_T""$LD" 1>&6
3156 else
3157   echo "$ECHO_T""no" 1>&6
3158 fi
3159 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3160 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" 1>&6
3161 echo "configure:3158: checking if the linker ($LD) is GNU ld" 1>&5
3162 if test "${ac_cv_prog_gnu_ld+set}" = set; then
3163   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3164 else
3165   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3166 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3167   ac_cv_prog_gnu_ld=yes
3168 else
3169   ac_cv_prog_gnu_ld=no
3170 fi
3171 fi
3172 echo "$ECHO_T""$ac_cv_prog_gnu_ld" 1>&6
3173 with_gnu_ld=$ac_cv_prog_gnu_ld
3174
3175 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" 1>&6
3176 echo "configure:3173: checking for $LD option to reload object files" 1>&5
3177 if test "${lt_cv_ld_reload_flag+set}" = set; then
3178   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3179 else
3180   lt_cv_ld_reload_flag='-r'
3181 fi
3182 echo "$ECHO_T""$lt_cv_ld_reload_flag" 1>&6
3183 reload_flag=$lt_cv_ld_reload_flag
3184 test -n "$reload_flag" && reload_flag=" $reload_flag"
3185
3186 echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" 1>&6
3187 echo "configure:3184: checking how to recognise dependant libraries" 1>&5
3188 if test "${lt_cv_deplibs_check_method+set}" = set; then
3189   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3190 else
3191   lt_cv_file_magic_cmd='${MAGIC}'
3192 lt_cv_file_magic_test_file=
3193 lt_cv_deplibs_check_method='unknown'
3194 # Need to set the preceding variable on all platforms that support
3195 # interlibrary dependencies.
3196 # 'none' -- dependencies not supported.
3197 # `unknown' -- same as none, but documents that we really don't know.
3198 # 'pass_all' -- all dependencies passed with no checks.
3199 # 'test_compile' -- check by making test program.
3200 # 'file_magic [regex]' -- check by looking for files in library path
3201 # which responds to the $file_magic_cmd with a given egrep regex.
3202 # If you have `file' or equivalent on your system and you're not sure
3203 # whether `pass_all' will *always* work, you probably want this one.
3204
3205 case "$host_os" in
3206 aix4* | beos*)
3207   lt_cv_deplibs_check_method=pass_all
3208   ;;
3209
3210 bsdi4*)
3211     lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
3212     lt_cv_file_magic_test_file=/shlib/libc.so
3213   ;;
3214
3215 cygwin* | mingw*)
3216   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3217   lt_cv_file_magic_cmd='${OBJDUMP} -f'
3218   ;;
3219
3220 freebsd*)
3221   case "$version_type" in
3222   freebsd-elf*)
3223     lt_cv_deplibs_check_method=pass_all
3224     ;;
3225   esac
3226   ;;
3227
3228 gnu*)
3229   lt_cv_deplibs_check_method=pass_all
3230   ;;
3231
3232 irix5* | irix6*)
3233   case "$host_os" in
3234   irix5*)
3235     # this will be overridden with pass_all, but let us keep it just in case
3236     lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
3237     ;;
3238   *)
3239     case "$LD" in
3240     *-32|*"-32 ") libmagic=32-bit;;
3241     *-n32|*"-n32 ") libmagic=N32;;
3242     *-64|*"-64 ") libmagic=64-bit;;
3243     *) libmagic=never-match;;
3244     esac
3245     # this will be overridden with pass_all, but let us keep it just in case
3246         lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
3247         ;;
3248   esac
3249   lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
3250   lt_cv_deplibs_check_method=pass_all
3251   ;;
3252
3253 # This must be Linux ELF.
3254 linux-gnu*)
3255   case "$host_cpu" in
3256   alpha* | i*86 | powerpc* | sparc* )
3257     lt_cv_deplibs_check_method=pass_all ;;
3258   *)
3259     # glibc up to 2.1.1 does not perform some relocations on ARM
3260         lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
3261       esac
3262   lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3263   ;;
3264
3265 osf3* | osf4* | osf5*)
3266   # this will be overridden with pass_all, but let us keep it just in case
3267   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
3268   lt_cv_file_magic_test_file=/shlib/libc.so
3269   lt_cv_deplibs_check_method=pass_all
3270   ;;
3271
3272 sco3.2v5*)
3273   lt_cv_deplibs_check_method=pass_all
3274   ;;
3275
3276 solaris*)
3277   lt_cv_deplibs_check_method=pass_all
3278   lt_cv_file_magic_test_file=/lib/libc.so
3279   ;;
3280
3281 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
3282   case "$host_vendor" in
3283   ncr)
3284     lt_cv_deplibs_check_method=pass_all
3285     ;;
3286   motorola)
3287         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]'
3288         lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3289     ;;
3290   esac
3291   ;;
3292 esac
3293
3294 fi
3295 echo "$ECHO_T""$lt_cv_deplibs_check_method" 1>&6
3296 file_magic_cmd=$lt_cv_file_magic_cmd
3297 deplibs_check_method=$lt_cv_deplibs_check_method
3298
3299 if test $host != $build; then
3300   ac_tool_prefix=${host_alias}-
3301 else
3302   ac_tool_prefix=
3303 fi
3304
3305 # Only perform the check for file, if the check method requires it
3306 case "$deplibs_check_method" in
3307 file_magic*)
3308   if test "$file_magic_cmd" = '${MAGIC}'; then
3309
3310 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" 1>&6
3311 echo "configure:3308: checking for ${ac_tool_prefix}file" 1>&5
3312 if test "${lt_cv_path_MAGIC+set}" = set; then
3313   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3314 else
3315   case "$MAGIC" in
3316   /*)
3317   lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
3318   ;;
3319   ?:/*)
3320   ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
3321   ;;
3322   *)
3323   ac_save_MAGIC="$MAGIC"
3324   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3325   ac_dummy="/usr/bin:$PATH"
3326   for ac_dir in $ac_dummy; do
3327     test -z "$ac_dir" && ac_dir=.
3328     if test -f $ac_dir/${ac_tool_prefix}file; then
3329       lt_cv_path_MAGIC="$ac_dir/${ac_tool_prefix}file"
3330       if test -n "$file_magic_test_file"; then
3331         case "$deplibs_check_method" in
3332         "file_magic "*)
3333           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
3334           MAGIC="$lt_cv_path_MAGIC"
3335           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3336             egrep "$file_magic_regex" > /dev/null; then
3337             :
3338           else
3339             cat <<EOF 1>&2
3340
3341 *** Warning: the command libtool uses to detect shared libraries,
3342 *** $file_magic_cmd, produces output that libtool cannot recognize.
3343 *** The result is that libtool may fail to recognize shared libraries
3344 *** as such.  This will affect the creation of libtool libraries that
3345 *** depend on shared libraries, but programs linked with such libtool
3346 *** libraries will work regardless of this problem.  Nevertheless, you
3347 *** may want to report the problem to your system manager and/or to
3348 *** bug-libtool@gnu.org
3349
3350 EOF
3351           fi ;;
3352         esac
3353       fi
3354       break
3355     fi
3356   done
3357   IFS="$ac_save_ifs"
3358   MAGIC="$ac_save_MAGIC"
3359   ;;
3360 esac
3361 fi
3362
3363 MAGIC="$lt_cv_path_MAGIC"
3364 if test -n "$MAGIC"; then
3365   echo "$ECHO_T""$MAGIC" 1>&6
3366 else
3367   echo "$ECHO_T""no" 1>&6
3368 fi
3369
3370 if test -z "$lt_cv_path_MAGIC"; then
3371   if test -n "$ac_tool_prefix"; then
3372     echo $ECHO_N "checking for file... $ECHO_C" 1>&6
3373 echo "configure:3370: checking for file" 1>&5
3374 if test "${lt_cv_path_MAGIC+set}" = set; then
3375   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3376 else
3377   case "$MAGIC" in
3378   /*)
3379   lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
3380   ;;
3381   ?:/*)
3382   ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
3383   ;;
3384   *)
3385   ac_save_MAGIC="$MAGIC"
3386   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3387   ac_dummy="/usr/bin:$PATH"
3388   for ac_dir in $ac_dummy; do
3389     test -z "$ac_dir" && ac_dir=.
3390     if test -f $ac_dir/file; then
3391       lt_cv_path_MAGIC="$ac_dir/file"
3392       if test -n "$file_magic_test_file"; then
3393         case "$deplibs_check_method" in
3394         "file_magic "*)
3395           file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
3396           MAGIC="$lt_cv_path_MAGIC"
3397           if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3398             egrep "$file_magic_regex" > /dev/null; then
3399             :
3400           else
3401             cat <<EOF 1>&2
3402
3403 *** Warning: the command libtool uses to detect shared libraries,
3404 *** $file_magic_cmd, produces output that libtool cannot recognize.
3405 *** The result is that libtool may fail to recognize shared libraries
3406 *** as such.  This will affect the creation of libtool libraries that
3407 *** depend on shared libraries, but programs linked with such libtool
3408 *** libraries will work regardless of this problem.  Nevertheless, you
3409 *** may want to report the problem to your system manager and/or to
3410 *** bug-libtool@gnu.org
3411
3412 EOF
3413           fi ;;
3414         esac
3415       fi
3416       break
3417     fi
3418   done
3419   IFS="$ac_save_ifs"
3420   MAGIC="$ac_save_MAGIC"
3421   ;;
3422 esac
3423 fi
3424
3425 MAGIC="$lt_cv_path_MAGIC"
3426 if test -n "$MAGIC"; then
3427   echo "$ECHO_T""$MAGIC" 1>&6
3428 else
3429   echo "$ECHO_T""no" 1>&6
3430 fi
3431
3432   else
3433     MAGIC=:
3434   fi
3435 fi
3436
3437   fi
3438   ;;
3439 esac
3440
3441 case "$target" in
3442 NONE) lt_target="$host" ;;
3443 *) lt_target="$target" ;;
3444 esac
3445
3446 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3447 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3448 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
3449 echo "configure:3446: checking for $ac_word" 1>&5
3450 if test "${ac_cv_prog_RANLIB+set}" = set; then
3451   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3452 else
3453   if test -n "$RANLIB"; then
3454   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3455 else
3456   for ac_path in `IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3457 ac_dummy="$PATH"
3458 for ac_dir in $ac_dummy; do
3459   test -z "$ac_dir" && ac_dir=.
3460   if test -f $ac_dir/$ac_word; then
3461     echo "$ac_dir/$ac_word"
3462   fi
3463 done
3464 IFS="$ac_save_ifs"
3465 `; do
3466     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3467     break
3468   done
3469 fi
3470 fi
3471 RANLIB="$ac_cv_prog_RANLIB"
3472 if test -n "$RANLIB"; then
3473   echo "$ECHO_T""$RANLIB" 1>&6
3474 else
3475   echo "$ECHO_T""no" 1>&6
3476 fi
3477
3478 if test -z "$ac_cv_prog_RANLIB"; then
3479   if test -n "$ac_tool_prefix"; then
3480     # Extract the first word of "ranlib", so it can be a program name with args.
3481 set dummy ranlib; ac_word=$2
3482 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
3483 echo "configure:3480: checking for $ac_word" 1>&5
3484 if test "${ac_cv_prog_RANLIB+set}" = set; then
3485   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3486 else
3487   if test -n "$RANLIB"; then
3488   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3489 else
3490   for ac_path in `IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3491 ac_dummy="$PATH"
3492 for ac_dir in $ac_dummy; do
3493   test -z "$ac_dir" && ac_dir=.
3494   if test -f $ac_dir/$ac_word; then
3495     echo "$ac_dir/$ac_word"
3496   fi
3497 done
3498 IFS="$ac_save_ifs"
3499 `; do
3500     ac_cv_prog_RANLIB="ranlib"
3501     break
3502   done
3503   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
3504 fi
3505 fi
3506 RANLIB="$ac_cv_prog_RANLIB"
3507 if test -n "$RANLIB"; then
3508   echo "$ECHO_T""$RANLIB" 1>&6
3509 else
3510   echo "$ECHO_T""no" 1>&6
3511 fi
3512
3513   else
3514     RANLIB=":"
3515   fi
3516 fi
3517
3518 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
3519 set dummy ${ac_tool_prefix}strip; ac_word=$2
3520 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
3521 echo "configure:3518: checking for $ac_word" 1>&5
3522 if test "${ac_cv_prog_STRIP+set}" = set; then
3523   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3524 else
3525   if test -n "$STRIP"; then
3526   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
3527 else
3528   for ac_path in `IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3529 ac_dummy="$PATH"
3530 for ac_dir in $ac_dummy; do
3531   test -z "$ac_dir" && ac_dir=.
3532   if test -f $ac_dir/$ac_word; then
3533     echo "$ac_dir/$ac_word"
3534   fi
3535 done
3536 IFS="$ac_save_ifs"
3537 `; do
3538     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
3539     break
3540   done
3541 fi
3542 fi
3543 STRIP="$ac_cv_prog_STRIP"
3544 if test -n "$STRIP"; then
3545   echo "$ECHO_T""$STRIP" 1>&6
3546 else
3547   echo "$ECHO_T""no" 1>&6
3548 fi
3549
3550 if test -z "$ac_cv_prog_STRIP"; then
3551   if test -n "$ac_tool_prefix"; then
3552     # Extract the first word of "strip", so it can be a program name with args.
3553 set dummy strip; ac_word=$2
3554 echo $ECHO_N "checking for $ac_word... $ECHO_C" 1>&6
3555 echo "configure:3552: checking for $ac_word" 1>&5
3556 if test "${ac_cv_prog_STRIP+set}" = set; then
3557   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3558 else
3559   if test -n "$STRIP"; then
3560   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
3561 else
3562   for ac_path in `IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3563 ac_dummy="$PATH"
3564 for ac_dir in $ac_dummy; do
3565   test -z "$ac_dir" && ac_dir=.
3566   if test -f $ac_dir/$ac_word; then
3567     echo "$ac_dir/$ac_word"
3568   fi
3569 done
3570 IFS="$ac_save_ifs"
3571 `; do
3572     ac_cv_prog_STRIP="strip"
3573     break
3574   done
3575   test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
3576 fi
3577 fi
3578 STRIP="$ac_cv_prog_STRIP"
3579 if test -n "$STRIP"; then
3580   echo "$ECHO_T""$STRIP" 1>&6
3581 else
3582   echo "$ECHO_T""no" 1>&6
3583 fi
3584
3585   else
3586     STRIP=":"
3587   fi
3588 fi
3589
3590 # Check for any special flags to pass to ltconfig.
3591 libtool_flags="--cache-file=$cache_file"
3592 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
3593 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
3594 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
3595 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
3596 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
3597
3598 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
3599 if test "${enable_libtool_lock+set}" = set; then
3600   enableval="$enable_libtool_lock"
3601
3602 fi
3603 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
3604 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
3605
3606 # Check whether --with-pic or --without-pic was given.
3607 if test "${with_pic+set}" = set; then
3608   withval="$with_pic"
3609   pic_mode="$withval"
3610 else
3611   pic_mode=default
3612 fi
3613 test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
3614 test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
3615
3616 # Some flags need to be propagated to the compiler or linker for good
3617 # libtool support.
3618 case "$lt_target" in
3619 *-*-irix6*)
3620   # Find out which ABI we are using.
3621   echo '#line 3618 "configure"' > conftest.$ac_ext
3622   if { (eval echo configure:3619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3623     case "`/usr/bin/file conftest.o`" in
3624     *32-bit*)
3625       LD="${LD-ld} -32"
3626       ;;
3627     *N32*)
3628       LD="${LD-ld} -n32"
3629       ;;
3630     *64-bit*)
3631       LD="${LD-ld} -64"
3632       ;;
3633     esac
3634   fi
3635   rm -rf conftest*
3636   ;;
3637
3638 *-*-sco3.2v5*)
3639   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3640   SAVE_CFLAGS="$CFLAGS"
3641   CFLAGS="$CFLAGS -belf"
3642   echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" 1>&6
3643 echo "configure:3640: checking whether the C compiler needs -belf" 1>&5
3644 if test "${lt_cv_cc_needs_belf+set}" = set; then
3645   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3646 else
3647
3648      ac_ext=c
3649 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3650 ac_cpp='$CPP $CPPFLAGS'
3651 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3652 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3653 cross_compiling=$ac_cv_prog_cc_cross
3654
3655      cat >conftest.$ac_ext <<EOF
3656 #line 3653 "configure"
3657 #include "confdefs.h"
3658
3659 int
3660 main()
3661 {
3662
3663   ;
3664   return 0;
3665 }
3666 EOF
3667 if { (eval echo configure:3664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3668   rm -rf conftest*
3669   lt_cv_cc_needs_belf=yes
3670 else
3671   echo "configure: failed program was:" >&5
3672   cat conftest.$ac_ext >&5
3673   rm -rf conftest*
3674   lt_cv_cc_needs_belf=no
3675 fi
3676 rm -f conftest*
3677
3678      ac_ext=c
3679 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3680 ac_cpp='$CPP $CPPFLAGS'
3681 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3682 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3683 cross_compiling=$ac_cv_prog_cc_cross
3684
3685 fi
3686 echo "$ECHO_T""$lt_cv_cc_needs_belf" 1>&6
3687   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3688     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3689     CFLAGS="$SAVE_CFLAGS"
3690   fi
3691   ;;
3692
3693 esac
3694
3695 # Save cache, so that ltconfig can load it
3696 cat >confcache <<\EOF
3697 # This file is a shell script that caches the results of configure
3698 # tests run on this system so they can be shared between configure
3699 # scripts and configure runs.  It is not useful on other systems.
3700 # If it contains results you don't want to keep, you may remove or edit it.
3701 #
3702 # By default, configure uses ./config.cache as the cache file,
3703 # creating it if it does not exist already.  You can give configure
3704 # the --cache-file=FILE option to use a different cache file; that is
3705 # what configure does when it calls configure scripts in
3706 # subdirectories, so they share the cache.
3707 # Giving --cache-file=/dev/null disables caching, for debugging configure.
3708 # config.status only pays attention to the cache file if you give it the
3709 # --recheck option to rerun configure.
3710 #
3711 EOF
3712 # The following way of writing the cache mishandles newlines in values,
3713 # but we know of no workaround that is simple, portable, and efficient.
3714 # So, don't put newlines in cache variables' values.
3715 # Ultrix sh set writes to stderr and can't be redirected directly,
3716 # and sets the high bit in the cache file unless we assign to the vars.
3717 (set) 2>&1 |
3718   case `(ac_space=' '; set | grep ac_space) 2>&1` in
3719   *ac_space=\ *)
3720     # `set' does not quote correctly, so add quotes (double-quote substitution
3721     # turns \\\\ into \\, and sed turns \\ into \).
3722     sed -n \
3723       -e "s/'/'\\\\''/g" \
3724       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
3725     ;;
3726   *)
3727     # `set' quotes correctly as required by POSIX, so do not add quotes.
3728     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
3729     ;;
3730   esac >>confcache
3731 if cmp -s $cache_file confcache; then :; else
3732   if test -w $cache_file; then
3733     echo "updating cache $cache_file"
3734     cat confcache >$cache_file
3735   else
3736     echo "not updating unwritable cache $cache_file"
3737   fi
3738 fi
3739 rm -f confcache
3740
3741 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3742 AR="$AR" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3743 MAGIC="$MAGIC" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3744 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
3745 AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
3746 objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
3747 deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
3748 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3749 $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $lt_target \
3750 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3751
3752 # Reload cache, that may have been modified by ltconfig
3753 if test -r "$cache_file"; then
3754   echo "loading cache $cache_file"
3755       test -f "$cache_file" && . $cache_file
3756 else
3757   echo "creating cache $cache_file"
3758   >$cache_file
3759 fi
3760
3761 # This can be used to rebuild libtool when needed
3762 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3763
3764 # Always use our own libtool.
3765 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3766
3767 # Redirect the config.log output again, so that the ltconfig log is not
3768 # clobbered by the next message.
3769 exec 5>>./config.log
3770
3771 echo $ECHO_N "checking whether optarg is declared... $ECHO_C" 1>&6
3772 echo "configure:3769: checking whether optarg is declared" 1>&5
3773 if test "${ac_cv_have_decl_optarg+set}" = set; then
3774   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3775 else
3776   cat >conftest.$ac_ext <<EOF
3777 #line 3774 "configure"
3778 #include "confdefs.h"
3779 $ac_includes_default
3780 int
3781 main ()
3782 {
3783 #ifndef optarg
3784   char *p = (char *) optarg;
3785 #endif
3786
3787   ;
3788   return 0;
3789 }
3790 EOF
3791 if { (eval echo configure:3788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3792   rm -rf conftest*
3793   ac_cv_have_decl_optarg=yes
3794 else
3795   echo "configure: failed program was:" >&5
3796   cat conftest.$ac_ext >&5
3797   rm -rf conftest*
3798   ac_cv_have_decl_optarg=no
3799 fi
3800 rm -f conftest*
3801 fi
3802 echo "$ECHO_T""$ac_cv_have_decl_optarg" 1>&6
3803 if test $ac_cv_have_decl_optarg = yes; then
3804   cat >>confdefs.h <<EOF
3805 #define HAVE_DECL_OPTARG 1
3806 EOF
3807
3808 else
3809   cat >>confdefs.h <<EOF
3810 #define HAVE_DECL_OPTARG 0
3811 EOF
3812
3813 fi
3814
3815 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" 1>&6
3816 echo "configure:3813: checking for ANSI C header files" 1>&5
3817 if test "${ac_cv_header_stdc+set}" = set; then
3818   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3819 else
3820
3821 cat >conftest.$ac_ext <<EOF
3822 #line 3819 "configure"
3823 #include "confdefs.h"
3824 #include <stdlib.h>
3825 #include <stdarg.h>
3826 #include <string.h>
3827 #include <float.h>
3828
3829 EOF
3830 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3831 { (eval echo configure:3828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3832 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3833 if test -z "$ac_err"; then
3834   rm -rf conftest*
3835   ac_cv_header_stdc=yes
3836 else
3837   echo "$ac_err" >&5
3838   echo "configure: failed program was:" >&5
3839   cat conftest.$ac_ext >&5
3840   rm -rf conftest*
3841   ac_cv_header_stdc=no
3842 fi
3843 rm -f conftest*
3844
3845 if test $ac_cv_header_stdc = yes; then
3846   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3847
3848 cat >conftest.$ac_ext <<EOF
3849 #line 3846 "configure"
3850 #include "confdefs.h"
3851 #include <string.h>
3852
3853 EOF
3854 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3855   egrep "memchr" >/dev/null 2>&1; then
3856   :
3857 else
3858   rm -rf conftest*
3859   ac_cv_header_stdc=no
3860 fi
3861 rm -f conftest*
3862
3863 fi
3864
3865 if test $ac_cv_header_stdc = yes; then
3866   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3867
3868 cat >conftest.$ac_ext <<EOF
3869 #line 3866 "configure"
3870 #include "confdefs.h"
3871 #include <stdlib.h>
3872
3873 EOF
3874 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3875   egrep "free" >/dev/null 2>&1; then
3876   :
3877 else
3878   rm -rf conftest*
3879   ac_cv_header_stdc=no
3880 fi
3881 rm -f conftest*
3882
3883 fi
3884
3885 if test $ac_cv_header_stdc = yes; then
3886   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3887 if test "$cross_compiling" = yes; then
3888   :
3889 else
3890   cat >conftest.$ac_ext <<EOF
3891 #line 3888 "configure"
3892 #include "confdefs.h"
3893 #include <ctype.h>
3894 #if ((' ' & 0x0FF) == 0x020)
3895 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3896 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3897 #else
3898 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
3899                      || ('j' <= (c) && (c) <= 'r') \
3900                      || ('s' <= (c) && (c) <= 'z'))
3901 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
3902 #endif
3903
3904 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3905 int
3906 main ()
3907 {
3908   int i;
3909   for (i = 0; i < 256; i++)
3910     if (XOR (islower (i), ISLOWER (i))
3911         || toupper (i) != TOUPPER (i))
3912       exit(2);
3913   exit (0);
3914 }
3915 EOF
3916 if { (eval echo configure:3913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3917 then
3918   :
3919 else
3920   echo "configure: failed program was:" >&5
3921   cat conftest.$ac_ext >&5
3922   rm -fr conftest*
3923   ac_cv_header_stdc=no
3924 fi
3925 rm -fr conftest*
3926
3927 fi
3928
3929 fi
3930 fi
3931 echo "$ECHO_T""$ac_cv_header_stdc" 1>&6
3932 if test $ac_cv_header_stdc = yes; then
3933   cat >>confdefs.h <<\EOF
3934 #define STDC_HEADERS 1
3935 EOF
3936
3937 fi
3938
3939 for ac_header in getopt.h unistd.h sys/sysctl.h sys/time.h
3940 do
3941 ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
3942 echo $ECHO_N "checking for $ac_header... $ECHO_C" 1>&6
3943 echo "configure:3940: checking for $ac_header" 1>&5
3944 if eval "test \"\${$ac_ac_Header+set}\" = set"; then
3945   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3946 else
3947
3948 cat >conftest.$ac_ext <<EOF
3949 #line 3946 "configure"
3950 #include "confdefs.h"
3951 #include <$ac_header>
3952
3953 EOF
3954 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3955 { (eval echo configure:3952: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3956 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3957 if test -z "$ac_err"; then
3958   rm -rf conftest*
3959   eval "$ac_ac_Header=yes"
3960 else
3961   echo "$ac_err" >&5
3962   echo "configure: failed program was:" >&5
3963   cat conftest.$ac_ext >&5
3964   rm -rf conftest*
3965   eval "$ac_ac_Header=no"
3966 fi
3967 rm -f conftest*
3968 fi
3969 echo "$ECHO_T""`eval echo '${'$ac_ac_Header'}'`" 1>&6
3970 if test `eval echo '${'$ac_ac_Header'}'` = yes; then
3971   cat >>confdefs.h <<EOF
3972 #define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
3973 EOF
3974
3975 fi
3976 done
3977
3978 echo $ECHO_N "checking for void... $ECHO_C" 1>&6
3979 echo "configure:3976: checking for void" 1>&5
3980 if test "${ac_cv_type_void+set}" = set; then
3981   echo $ECHO_N "(cached) $ECHO_C" 1>&6
3982 else
3983   cat >conftest.$ac_ext <<EOF
3984 #line 3981 "configure"
3985 #include "confdefs.h"
3986 $ac_includes_default
3987 int
3988 main ()
3989 {
3990 if ((void *) 0)
3991   return 0;
3992 if (sizeof (void))
3993   return 0;
3994   ;
3995   return 0;
3996 }
3997 EOF
3998 if { (eval echo configure:3995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3999   rm -rf conftest*
4000   ac_cv_type_void=yes
4001 else
4002   echo "configure: failed program was:" >&5
4003   cat conftest.$ac_ext >&5
4004   rm -rf conftest*
4005   ac_cv_type_void=no
4006 fi
4007 rm -f conftest*
4008 fi
4009 echo "$ECHO_T""$ac_cv_type_void" 1>&6
4010 if test $ac_cv_type_void = yes; then
4011   cat >>confdefs.h <<EOF
4012 #define HAVE_VOID 1
4013 EOF
4014
4015 fi
4016
4017 echo $ECHO_N "checking for preprocessor stringizing operator... $ECHO_C" 1>&6
4018 echo "configure:4015: checking for preprocessor stringizing operator" 1>&5
4019 if test "${ac_cv_c_stringize+set}" = set; then
4020   echo $ECHO_N "(cached) $ECHO_C" 1>&6
4021 else
4022
4023 cat >conftest.$ac_ext <<EOF
4024 #line 4021 "configure"
4025 #include "confdefs.h"
4026
4027 #define x(y) #y
4028
4029 char *s = x(teststring);
4030
4031 EOF
4032 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4033   egrep "#teststring" >/dev/null 2>&1; then
4034   rm -rf conftest*
4035   ac_cv_c_stringize=no
4036 else
4037   rm -rf conftest*
4038   ac_cv_c_stringize=yes
4039 fi
4040 rm -f conftest*
4041
4042 fi
4043
4044 if test "${ac_cv_c_stringize}" = yes; then
4045   cat >>confdefs.h <<\EOF
4046 #define HAVE_STRINGIZE 1
4047 EOF
4048
4049 fi
4050 echo "$ECHO_T""${ac_cv_c_stringize}" 1>&6
4051
4052 for ac_func in getopt_long getpagesize popen processor_info strtoul sysconf sysctlbyname
4053 do
4054 ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh`
4055 echo $ECHO_N "checking for $ac_func... $ECHO_C" 1>&6
4056 echo "configure:4053: checking for $ac_func" 1>&5
4057 if eval "test \"\${$ac_ac_var+set}\" = set"; then
4058   echo $ECHO_N "(cached) $ECHO_C" 1>&6
4059 else
4060   cat >conftest.$ac_ext <<EOF
4061 #line 4058 "configure"
4062 #include "confdefs.h"
4063 /* System header to define __stub macros and hopefully few prototypes,
4064     which can conflict with char $ac_func(); below.  */
4065 #include <assert.h>
4066 /* Override any gcc2 internal prototype to avoid an error.  */
4067 /* We use char because int might match the return type of a gcc2
4068     builtin and then its argument prototype would still apply.  */
4069 char $ac_func();
4070 char (*f)();
4071
4072 int
4073 main()
4074 {
4075
4076 /* The GNU C library defines this for functions which it implements
4077     to always fail with ENOSYS.  Some functions are actually named
4078     something starting with __ and the normal name is an alias.  */
4079 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4080 choke me
4081 #else
4082 f = $ac_func;
4083 #endif
4084
4085   ;
4086   return 0;
4087 }
4088 EOF
4089 if { (eval echo configure:4086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4090   rm -rf conftest*
4091   eval "$ac_ac_var=yes"
4092 else
4093   echo "configure: failed program was:" >&5
4094   cat conftest.$ac_ext >&5
4095   rm -rf conftest*
4096   eval "$ac_ac_var=no"
4097 fi
4098 rm -f conftest*
4099
4100 fi
4101 echo "$ECHO_T""`eval echo '${'$ac_ac_var'}'`" 1>&6
4102 if test `eval echo '${'$ac_ac_var'}'` = yes; then
4103   cat >>confdefs.h <<EOF
4104 #define `echo "HAVE_$ac_func" | $ac_tr_cpp` 1
4105 EOF
4106
4107 fi
4108 done
4109
4110 echo $ECHO_N "checking if ansi2knr should be used... $ECHO_C" 1>&6
4111 echo "configure:4108: checking if ansi2knr should be used" 1>&5
4112 if test "${gmp_cv_c_ansi2knr+set}" = set; then
4113   echo $ECHO_N "(cached) $ECHO_C" 1>&6
4114 else
4115   cat >conftest.c <<EOF
4116 int main (int argc, char *argv) { return 0; }
4117 EOF
4118 if { (eval echo configure:4115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4119   gmp_cv_c_ansi2knr=no
4120 else
4121   gmp_cv_c_ansi2knr=yes
4122 fi
4123 rm -f conftest.*
4124
4125 fi
4126 echo "$ECHO_T""$gmp_cv_c_ansi2knr" 1>&6
4127 if test $gmp_cv_c_ansi2knr = no; then
4128   U= ANSI2KNR=
4129 else
4130   U=_ ANSI2KNR=./ansi2knr
4131   # Ensure some checks needed by ansi2knr itself.
4132
4133 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" 1>&6
4134 echo "configure:4131: checking for ANSI C header files" 1>&5
4135 if test "${ac_cv_header_stdc+set}" = set; then
4136   echo $ECHO_N "(cached) $ECHO_C" 1>&6
4137 else
4138
4139 cat >conftest.$ac_ext <<EOF
4140 #line 4137 "configure"
4141 #include "confdefs.h"
4142 #include <stdlib.h>
4143 #include <stdarg.h>
4144 #include <string.h>
4145 #include <float.h>
4146
4147 EOF
4148 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4149 { (eval echo configure:4146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4150 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4151 if test -z "$ac_err"; then
4152   rm -rf conftest*
4153   ac_cv_header_stdc=yes
4154 else
4155   echo "$ac_err" >&5
4156   echo "configure: failed program was:" >&5
4157   cat conftest.$ac_ext >&5
4158   rm -rf conftest*
4159   ac_cv_header_stdc=no
4160 fi
4161 rm -f conftest*
4162
4163 if test $ac_cv_header_stdc = yes; then
4164   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4165
4166 cat >conftest.$ac_ext <<EOF
4167 #line 4164 "configure"
4168 #include "confdefs.h"
4169 #include <string.h>
4170
4171 EOF
4172 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4173   egrep "memchr" >/dev/null 2>&1; then
4174   :
4175 else
4176   rm -rf conftest*
4177   ac_cv_header_stdc=no
4178 fi
4179 rm -f conftest*
4180
4181 fi
4182
4183 if test $ac_cv_header_stdc = yes; then
4184   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4185
4186 cat >conftest.$ac_ext <<EOF
4187 #line 4184 "configure"
4188 #include "confdefs.h"
4189 #include <stdlib.h>
4190
4191 EOF
4192 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4193   egrep "free" >/dev/null 2>&1; then
4194   :
4195 else
4196   rm -rf conftest*
4197   ac_cv_header_stdc=no
4198 fi
4199 rm -f conftest*
4200
4201 fi
4202
4203 if test $ac_cv_header_stdc = yes; then
4204   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4205 if test "$cross_compiling" = yes; then
4206   :
4207 else
4208   cat >conftest.$ac_ext <<EOF
4209 #line 4206 "configure"
4210 #include "confdefs.h"
4211 #include <ctype.h>
4212 #if ((' ' & 0x0FF) == 0x020)
4213 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4214 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4215 #else
4216 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4217                      || ('j' <= (c) && (c) <= 'r') \
4218                      || ('s' <= (c) && (c) <= 'z'))
4219 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
4220 #endif
4221
4222 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4223 int
4224 main ()
4225 {
4226   int i;
4227   for (i = 0; i < 256; i++)
4228     if (XOR (islower (i), ISLOWER (i))
4229         || toupper (i) != TOUPPER (i))
4230       exit(2);
4231   exit (0);
4232 }
4233 EOF
4234 if { (eval echo configure:4231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4235 then
4236   :
4237 else
4238   echo "configure: failed program was:" >&5
4239   cat conftest.$ac_ext >&5
4240   rm -fr conftest*
4241   ac_cv_header_stdc=no
4242 fi
4243 rm -fr conftest*
4244
4245 fi
4246
4247 fi
4248 fi
4249 echo "$ECHO_T""$ac_cv_header_stdc" 1>&6
4250 if test $ac_cv_header_stdc = yes; then
4251   cat >>confdefs.h <<\EOF
4252 #define STDC_HEADERS 1
4253 EOF
4254
4255 fi
4256
4257   for ac_header in string.h
4258 do
4259 ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh`
4260 echo $ECHO_N "checking for $ac_header... $ECHO_C" 1>&6
4261 echo "configure:4258: checking for $ac_header" 1>&5
4262 if eval "test \"\${$ac_ac_Header+set}\" = set"; then
4263   echo $ECHO_N "(cached) $ECHO_C" 1>&6
4264 else
4265
4266 cat >conftest.$ac_ext <<EOF
4267 #line 4264 "configure"
4268 #include "confdefs.h"
4269 #include <$ac_header>
4270
4271 EOF
4272 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4273 { (eval echo configure:4270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4274 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4275 if test -z "$ac_err"; then
4276   rm -rf conftest*
4277   eval "$ac_ac_Header=yes"
4278 else
4279   echo "$ac_err" >&5
4280   echo "configure: failed program was:" >&5
4281   cat conftest.$ac_ext >&5
4282   rm -rf conftest*
4283   eval "$ac_ac_Header=no"
4284 fi
4285 rm -f conftest*
4286 fi
4287 echo "$ECHO_T""`eval echo '${'$ac_ac_Header'}'`" 1>&6
4288 if test `eval echo '${'$ac_ac_Header'}'` = yes; then
4289   cat >>confdefs.h <<EOF
4290 #define `echo "HAVE_$ac_header" | $ac_tr_cpp` 1
4291 EOF
4292
4293 fi
4294 done
4295
4296 fi
4297
4298 syntax=
4299 # For now, we use the old switch for setting syntax.
4300 # FIXME: Remove when conversion to .asm is completed.
4301 case "${target}" in
4302   m680[234]0*-*-linuxaout* | m68k*-*-linuxaout* | \
4303   m68k-next-nextstep* | \
4304   m68000*-*-*)
4305     syntax=mit
4306     ;;
4307   m680[234]0*-*-linux* | m68k*-*-linux*)
4308     syntax=elf
4309     ;;
4310   m680[234]0*-*-* | m68k*-*-*)
4311     syntax=mit
4312     ;;
4313 esac
4314
4315 # Now build an asm-syntax.h file for targets that include that from the
4316 # assembly files.
4317 # FIXME: Remove when conversion to .asm is completed.
4318 case "${family}-${underscore}-${asm_align}-${syntax}" in
4319   m68k-yes-log-mit)
4320     echo '#define MIT_SYNTAX' >asm-syntax.h
4321     cat $srcdir/mpn/underscore.h >>asm-syntax.h
4322     echo '#include "'$srcdir'/mpn/m68k/syntax.h"' >>asm-syntax.h;;
4323   m68k-no-nolog-elf)
4324     echo '#define ELF_SYNTAX' >asm-syntax.h
4325     echo '#define C_SYMBOL_NAME(name) name' >>asm-syntax.h
4326     echo '#include "'$srcdir'/mpn/m68k/syntax.h"' >>asm-syntax.h;;
4327 esac
4328
4329 # The pattern here tests for an absolute path the same way as
4330 # _AC_OUTPUT_FILES in autoconf acgeneral.m4.
4331
4332 echo "dnl  CONFIG_TOP_SRCDIR is a path from the mpn builddir to the top srcdir" >> $gmp_tmpconfigm4
4333
4334 case "$srcdir" in
4335 [\\/]* | ?:[\\/]* )
4336
4337 echo "define(<CONFIG_TOP_SRCDIR>,<\`$srcdir'>)" >> $gmp_tmpconfigm4
4338     ;;
4339 *)
4340
4341 echo "define(<CONFIG_TOP_SRCDIR>,<\`../$srcdir'>)" >> $gmp_tmpconfigm4
4342  ;;
4343 esac
4344
4345 echo "include(CONFIG_TOP_SRCDIR\`/mpn/asm-defs.m4')" >> $gmp_tmpconfigm4p
4346
4347 # Must be after asm-defs.m4
4348
4349 echo "define_not_for_expansion(\`HAVE_TARGET_CPU_$target_cpu')" >> $gmp_tmpconfigm4p
4350
4351 case "$target" in
4352   alpha*-cray-unicos*)
4353     gmp_m4postinc="alpha/unicos.m4"
4354     ;;
4355   alpha*-*-*)
4356     gmp_m4postinc="alpha/default.m4"
4357     ;;
4358   power*-*-*)
4359     case "$target" in
4360       *-*-mach* | *-*-rhapsody* | *-*-nextstep*)
4361         ;;      # these use non-conventional assembly syntax.
4362       powerpc64-*-aix*)
4363         gmp_m4postinc="powerpc32/regmap.m4 powerpc64/aix.m4"
4364         ;;
4365       *-*-aix*)
4366         gmp_m4postinc="powerpc32/regmap.m4 powerpc32/aix.m4"
4367         ;;
4368       *)
4369         gmp_m4postinc="powerpc32/regmap.m4"
4370         ;;
4371     esac
4372     ;;
4373 esac
4374
4375 for tmp_f in $gmp_m4postinc; do
4376
4377 echo "include_mpn(\`$tmp_f')" >> $gmp_tmpconfigm4p
4378
4379 done
4380
4381 # Set up `gmp_links'.  It's a list of link:file pairs that configure will
4382 # process to create link -> file.
4383 gmp_links=
4384
4385 # If the user specified `MPN_PATH', use that instead of the path we've
4386 # come up with.
4387 if test -z "$MPN_PATH"; then
4388   path="$path generic"
4389 else
4390   path="$MPN_PATH"
4391 fi
4392
4393 # Pick the correct source files in $path and link them to mpn/.
4394 # $gmp_mpn_functions lists all functions we need.
4395 #
4396 # The rule is to find a file with the function name and a .asm, .S,
4397 # .s, or .c extension.  Certain multi-function files with special names
4398 # can provide some functions too.  (mpn/Makefile.am passes
4399 # -DOPERATION_<func> to get them to generate the right code.)
4400
4401 # FIXME: udiv and umul aren't in $gmp_mpn_functions_optional yet since
4402 # there's some versions of those files which should be checked for bit
4403 # rot first.  Put them in $extra_functions for each target for now,
4404 # change to standard optionals when all are ready.
4405
4406 # Note: The following lines defining $gmp_mpn_functions_optional
4407 #       and $gmp_mpn_functions are parsed by the "macos/configure"
4408 #       Perl script. So if you change the lines in a major way
4409 #       make sure to run and examine the output from
4410 #
4411 #           % (cd macos; perl configure)
4412
4413 gmp_mpn_functions_optional="copyi copyd com_n           \
4414   and_n andn_n nand_n ior_n iorn_n nior_n xor_n xnor_n"
4415
4416 gmp_mpn_functions="${extra_functions} inlines add_n sub_n mul_1 addmul_1   \
4417   submul_1 lshift rshift diveby3 divrem divrem_1 divrem_2                  \
4418   mod_1 mod_1_rs pre_mod_1 dump                                            \
4419   mul mul_fft mul_n mul_basecase sqr_basecase random                       \
4420   random2 sqrtrem get_str set_str scan0 scan1 popcount hamdist cmp perfsqr \
4421   bdivmod gcd_1 gcd gcdext tdiv_qr bz_divrem_n sb_divrem_mn jacbase        \
4422   $gmp_mpn_functions_optional"
4423
4424 # the list of all object files used by mpn/Makefile.in and the
4425 # top-level Makefile.in, respectively
4426 mpn_objects=
4427 mpn_objs_in_libgmp="mpn/mp_bases.lo"
4428
4429 for tmp_fn in ${gmp_mpn_functions} ; do
4430   rm -f mpn/${tmp_fn}.[Ssc] mpn/${tmp_fn}.asm
4431
4432   # functions that can be provided by multi-function files
4433   tmp_mulfunc=
4434   case $tmp_fn in
4435   add_n|sub_n)       tmp_mulfunc="aors_n"    ;;
4436   addmul_1|submul_1) tmp_mulfunc="aorsmul_1" ;;
4437   popcount|hamdist)  tmp_mulfunc="popham"    ;;
4438   and_n|andn_n|nand_n | ior_n|iorn_n|nior_n | xor_n|xnor_n)
4439                      tmp_mulfunc="logops_n"  ;;
4440   esac
4441
4442   found=no
4443   for tmp_dir in $path; do
4444     for tmp_base in $tmp_fn $tmp_mulfunc; do
4445       for tmp_ext in asm S s c; do
4446         tmp_file=$srcdir/mpn/$tmp_dir/$tmp_base.$tmp_ext
4447         if test -f $tmp_file; then
4448           found=yes
4449
4450           mpn_objects="$mpn_objects ${tmp_fn}.lo"
4451           mpn_objs_in_libgmp="$mpn_objs_in_libgmp mpn/${tmp_fn}.lo"
4452           gmp_links="$gmp_links mpn/$tmp_fn.$tmp_ext:mpn/$tmp_dir/$tmp_base.$tmp_ext"
4453
4454           # duplicate AC_DEFINEs are harmless, so it doesn't matter
4455           # that multi-function files get grepped here repeatedly
4456           gmp_ep="`
4457             sed -n 's/^[        ]*MULFUNC_PROLOGUE(\(.*\))/\1/p' $tmp_file ;
4458             sed -n 's/^[        ]*PROLOGUE.*(\(.*\))/\1/p' $tmp_file
4459           `"
4460           for gmp_tmp in $gmp_ep; do
4461             cat >>confdefs.h <<EOF
4462 #define HAVE_NATIVE_${gmp_tmp} 1
4463 EOF
4464
4465           done
4466
4467           break
4468         fi
4469       done
4470       if test $found = yes; then break ; fi
4471     done
4472     if test $found = yes; then break ; fi
4473   done
4474
4475   if test $found = no; then
4476     for tmp_optional in $gmp_mpn_functions_optional; do
4477       if test $tmp_optional = $tmp_fn; then
4478         found=yes
4479       fi
4480     done
4481     if test $found = no; then
4482       { echo "configure: error: no version of $tmp_fn found in path: $path" 1>&2; exit 1; }
4483     fi
4484   fi
4485 done
4486
4487 # Create link for gmp-mparam.h.
4488 for tmp_dir in $path ; do
4489   rm -f gmp-mparam.h
4490   if test -f $srcdir/mpn/${tmp_dir}/gmp-mparam.h ; then
4491     gmp_links="$gmp_links gmp-mparam.h:mpn/${tmp_dir}/gmp-mparam.h"
4492
4493     # Copy any KARATSUBA_SQR_THRESHOLD in gmp-mparam.h to config.m4.
4494     # Some versions of sqr_basecase.asm use this.
4495     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`"
4496     if test -n "$tmp_gmp_karatsuba_sqr_threshold"; then
4497
4498 echo "define(<KARATSUBA_SQR_THRESHOLD>,<$tmp_gmp_karatsuba_sqr_threshold>)" >> $gmp_tmpconfigm4
4499
4500     fi
4501
4502     break
4503   fi
4504 done
4505
4506 # Dig out the links from `gmp_links' for inclusion in DISTCLEANFILES.
4507 gmp_srclinks=
4508 for f in $gmp_links; do
4509   gmp_srclinks="$gmp_srclinks `echo $f | sed 's/\(.*\):.*/\1/'`"
4510 done
4511
4512 echo "creating $gmp_configm4"
4513 echo "dnl $gmp_configm4.  Generated automatically by configure." > $gmp_configm4
4514 if test -f $gmp_tmpconfigm4; then
4515   echo "changequote(<,>)dnl" >> $gmp_configm4
4516   echo "ifdef(<__CONFIG_M4_INCLUDED__>,,<" >> $gmp_configm4
4517   cat $gmp_tmpconfigm4 >> $gmp_configm4
4518   echo ">)" >> $gmp_configm4
4519   echo "changequote(\`,')dnl" >> $gmp_configm4
4520   rm $gmp_tmpconfigm4
4521 fi
4522 echo "ifdef(\`__CONFIG_M4_INCLUDED__',,\`" >> $gmp_configm4
4523 if test -f $gmp_tmpconfigm4i; then
4524   cat $gmp_tmpconfigm4i >> $gmp_configm4
4525   rm $gmp_tmpconfigm4i
4526 fi
4527 if test -f $gmp_tmpconfigm4p; then
4528   cat $gmp_tmpconfigm4p >> $gmp_configm4
4529   rm $gmp_tmpconfigm4p
4530 fi
4531 echo "')" >> $gmp_configm4
4532 echo "define(\`__CONFIG_M4_INCLUDED__')" >> $gmp_configm4
4533
4534 trap '' 1 2 15
4535 cat >confcache <<\EOF
4536 # This file is a shell script that caches the results of configure
4537 # tests run on this system so they can be shared between configure
4538 # scripts and configure runs.  It is not useful on other systems.
4539 # If it contains results you don't want to keep, you may remove or edit it.
4540 #
4541 # By default, configure uses ./config.cache as the cache file,
4542 # creating it if it does not exist already.  You can give configure
4543 # the --cache-file=FILE option to use a different cache file; that is
4544 # what configure does when it calls configure scripts in
4545 # subdirectories, so they share the cache.
4546 # Giving --cache-file=/dev/null disables caching, for debugging configure.
4547 # config.status only pays attention to the cache file if you give it the
4548 # --recheck option to rerun configure.
4549 #
4550 EOF
4551 # The following way of writing the cache mishandles newlines in values,
4552 # but we know of no workaround that is simple, portable, and efficient.
4553 # So, don't put newlines in cache variables' values.
4554 # Ultrix sh set writes to stderr and can't be redirected directly,
4555 # and sets the high bit in the cache file unless we assign to the vars.
4556 (set) 2>&1 |
4557   case `(ac_space=' '; set | grep ac_space) 2>&1` in
4558   *ac_space=\ *)
4559     # `set' does not quote correctly, so add quotes (double-quote substitution
4560     # turns \\\\ into \\, and sed turns \\ into \).
4561     sed -n \
4562       -e "s/'/'\\\\''/g" \
4563       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
4564     ;;
4565   *)
4566     # `set' quotes correctly as required by POSIX, so do not add quotes.
4567     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
4568     ;;
4569   esac >>confcache
4570 if cmp -s $cache_file confcache; then :; else
4571   if test -w $cache_file; then
4572     echo "updating cache $cache_file"
4573     cat confcache >$cache_file
4574   else
4575     echo "not updating unwritable cache $cache_file"
4576   fi
4577 fi
4578 rm -f confcache
4579
4580 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
4581
4582 test "x$prefix" = xNONE && prefix=$ac_default_prefix
4583 # Let make expand exec_prefix.
4584 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
4585
4586 # Any assignment to VPATH causes Sun make to only execute
4587 # the first set of double-colon rules, so remove it if not needed.
4588 # If there is a colon in the path, we need to keep it.
4589 if test "x$srcdir" = x.; then
4590   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
4591 fi
4592
4593 DEFS=-DHAVE_CONFIG_H
4594
4595 : ${CONFIG_STATUS=./config.status}
4596 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
4597 echo creating $CONFIG_STATUS
4598 cat >$CONFIG_STATUS <<EOF
4599 #! /bin/sh
4600 # Generated automatically by configure.
4601 # Run this file to recreate the current configuration.
4602 # This directory was configured as follows,
4603 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4604 #
4605 # $0 $ac_configure_args
4606 #
4607 # Compiler output produced by configure, useful for debugging
4608 # configure, is in ./config.log if it exists.
4609
4610 # Files that config.status was made for.
4611 config_files="\\
4612   Makefile mpn/Makefile mpz/Makefile"
4613 config_headers="\\
4614   config.h:config.in"
4615 config_links="\\
4616   $gmp_links"
4617 config_commands="\\
4618   default-1"
4619
4620 ac_cs_usage="\\
4621 \\\`$CONFIG_STATUS' instantiates files from templates according to the
4622 current configuration.
4623
4624 Usage: $CONFIG_STATUS [OPTIONS] FILE...
4625
4626   --recheck    Update $CONFIG_STATUS by reconfiguring in the same conditions
4627   --version    Print the version of Autoconf and exit
4628   --help       Display this help and exit
4629   --file=FILE[:TEMPLATE]
4630                Instantiate the configuration file FILE
4631   --header=FILE[:TEMPLATE]
4632                Instantiate the configuration header FILE
4633
4634 Configuration files:
4635 \$config_files
4636
4637 Configuration headers:
4638 \$config_headers
4639
4640 Configuration links:
4641 \$config_links
4642
4643 Configuration commands:
4644 \$config_commands
4645
4646 Report bugs to <bug-autoconf@gnu.org>."
4647
4648 ac_cs_version="\\
4649 $CONFIG_STATUS generated by autoconf version 2.14a.
4650 Configured on host `(hostname || uname -n) 2>/dev/null | sed 1q` by
4651   `echo "$0 $ac_configure_args" | sed 's/[\\"\`\$]/\\\\&/g'`"
4652
4653 # Root of the tmp file names.  Use pid to allow concurrent executions.
4654 ac_cs_root=cs\$\$
4655 ac_given_srcdir=$srcdir
4656 ac_given_INSTALL="$INSTALL"
4657
4658 # If no file are specified by the user, then we need to provide default
4659 # value.  By we need to know if files were specified by the user.
4660 ac_need_defaults=:
4661 while test \$# != 0
4662 do
4663   case "\$1" in
4664   --*=*)
4665     ac_option=\`echo "\$1" | sed -e 's/=.*//'\`
4666     ac_optarg=\`echo "\$1" | sed -e 's/[^=]*=//'\`
4667     shift
4668     set dummy "\$ac_option" "\$ac_optarg" \${1+"\$@"}
4669     shift
4670     ;;
4671   -*);;
4672   *) # This is not an option, so the user has probably given explicit
4673      # arguments.
4674      ac_need_defaults=false;;
4675   esac
4676
4677   case "\$1" in
4678
4679   # Handling of the options.
4680   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
4681     echo "running \${CONFIG_SHELL-/bin/sh} $0 `echo "$ac_configure_args" | sed 's/[\\"\`\$]/\\\\&/g'` --no-create --no-recursion"
4682     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
4683   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
4684     echo "\$ac_cs_version"; exit 0 ;;
4685   --he | --h)
4686     # Conflict between --help and --header
4687     echo "$CONFIG_STATUS: ambiguous option: \$ac_option
4688 Try \\\`$CONFIG_STATUS --help' for more information."; exit 1 ;;
4689   -help | --help | --hel )
4690     echo "\$ac_cs_usage"; exit 0 ;;
4691   --file | --fil | --fi | --f )
4692     shift
4693     CONFIG_FILES="\$CONFIG_FILES \$1"
4694     ac_need_defaults=false;;
4695   --header | --heade | --head | --hea )
4696     shift
4697     CONFIG_HEADERS="\$CONFIG_FILES \$1"
4698     ac_need_defaults=false;;
4699
4700   # Handling of arguments.
4701   'Makefile' ) CONFIG_FILES="\$CONFIG_FILES Makefile" ;;
4702   'mpz/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpz/Makefile" ;;
4703   'mpn/Makefile' ) CONFIG_FILES="\$CONFIG_FILES mpn/Makefile" ;;
4704   '$gmp_links' ) CONFIG_LINKS="\$CONFIG_LINKS $gmp_links" ;;
4705   'default-1' ) CONFIG_COMMANDS="\$CONFIG_COMMANDS default-1" ;;
4706   'config.h' ) CONFIG_HEADERS="\$CONFIG_HEADERS config.h:config.in" ;;
4707
4708   # This is an error.
4709   -*) echo "$CONFIG_STATUS: unrecognized option: \$1
4710 Try \\\`$CONFIG_STATUS --help' for more information."; exit 1 ;;
4711   *) echo "$CONFIG_STATUS: invalid argument: \$1"; exit 1 ;;
4712   esac
4713   shift
4714 done
4715
4716 EOF
4717
4718 cat >>$CONFIG_STATUS <<\EOF
4719 # If the user did not use the arguments to specify the items to instantiate,
4720 # then the envvar interface is used.  Set only those that are not.
4721 if $ac_need_defaults; then
4722   : ${CONFIG_FILES=$config_files}
4723   : ${CONFIG_HEADERS=$config_headers}
4724   : ${CONFIG_LINKS=$config_links}
4725   : ${CONFIG_COMMANDS=$config_commands}
4726 fi
4727
4728 # Trap to remove the temp files.
4729 trap 'rm -fr $ac_cs_root*; exit 1' 1 2 15
4730
4731 EOF
4732
4733 cat >>$CONFIG_STATUS <<EOF
4734 #
4735 # INIT-COMMANDS section.
4736 #
4737
4738 EOF
4739
4740 cat >>$CONFIG_STATUS <<EOF
4741
4742 #
4743 # CONFIG_FILES section.
4744 #
4745
4746 # No need to generate the scripts if there are no CONFIG_FILES.
4747 # This happens for instance when ./config.status config.h
4748 if test -n "\$CONFIG_FILES"; then
4749   # Protect against being on the right side of a sed subst in config.status.
4750   sed 's/%@/@@/; s/@%/@@/; s/%;t t\$/@;t t/; /@;t t\$/s/[\\\\&%]/\\\\&/g;
4751    s/@@/%@/; s/@@/@%/; s/@;t t\$/%;t t/' >\$ac_cs_root.subs <<\\CEOF
4752 s%@exec_prefix@%$exec_prefix%;t t
4753 s%@prefix@%$prefix%;t t
4754 s%@program_transform_name@%$program_transform_name%;t t
4755 s%@bindir@%$bindir%;t t
4756 s%@sbindir@%$sbindir%;t t
4757 s%@libexecdir@%$libexecdir%;t t
4758 s%@datadir@%$datadir%;t t
4759 s%@sysconfdir@%$sysconfdir%;t t
4760 s%@sharedstatedir@%$sharedstatedir%;t t
4761 s%@localstatedir@%$localstatedir%;t t
4762 s%@libdir@%$libdir%;t t
4763 s%@includedir@%$includedir%;t t
4764 s%@oldincludedir@%$oldincludedir%;t t
4765 s%@infodir@%$infodir%;t t
4766 s%@mandir@%$mandir%;t t
4767 s%@SHELL@%$SHELL%;t t
4768 s%@ECHO_C@%$ECHO_C%;t t
4769 s%@ECHO_N@%$ECHO_N%;t t
4770 s%@ECHO_T@%$ECHO_T%;t t
4771 s%@CFLAGS@%$CFLAGS%;t t
4772 s%@CPPFLAGS@%$CPPFLAGS%;t t
4773 s%@CXXFLAGS@%$CXXFLAGS%;t t
4774 s%@FFLAGS@%$FFLAGS%;t t
4775 s%@DEFS@%$DEFS%;t t
4776 s%@LDFLAGS@%$LDFLAGS%;t t
4777 s%@LIBS@%$LIBS%;t t
4778 s%@host@%$host%;t t
4779 s%@host_alias@%$host_alias%;t t
4780 s%@host_cpu@%$host_cpu%;t t
4781 s%@host_vendor@%$host_vendor%;t t
4782 s%@host_os@%$host_os%;t t
4783 s%@target@%$target%;t t
4784 s%@target_alias@%$target_alias%;t t
4785 s%@target_cpu@%$target_cpu%;t t
4786 s%@target_vendor@%$target_vendor%;t t
4787 s%@target_os@%$target_os%;t t
4788 s%@build@%$build%;t t
4789 s%@build_alias@%$build_alias%;t t
4790 s%@build_cpu@%$build_cpu%;t t
4791 s%@build_vendor@%$build_vendor%;t t
4792 s%@build_os@%$build_os%;t t
4793 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%;t t
4794 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%;t t
4795 s%@INSTALL_DATA@%$INSTALL_DATA%;t t
4796 s%@PACKAGE@%$PACKAGE%;t t
4797 s%@VERSION@%$VERSION%;t t
4798 s%@ACLOCAL@%$ACLOCAL%;t t
4799 s%@AUTOCONF@%$AUTOCONF%;t t
4800 s%@AUTOMAKE@%$AUTOMAKE%;t t
4801 s%@AUTOHEADER@%$AUTOHEADER%;t t
4802 s%@MAKEINFO@%$MAKEINFO%;t t
4803 s%@AMTAR@%$AMTAR%;t t
4804 s%@install_sh@%$install_sh%;t t
4805 s%@AWK@%$AWK%;t t
4806 s%@SET_MAKE@%$SET_MAKE%;t t
4807 s%@AMDEP@%$AMDEP%;t t
4808 s%@AMDEPBACKSLASH@%$AMDEPBACKSLASH%;t t
4809 s%@DEPDIR@%$DEPDIR%;t t
4810 s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%;t t
4811 s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%;t t
4812 s%@MAINT@%$MAINT%;t t
4813 s%@WANT_MPBSD_TRUE@%$WANT_MPBSD_TRUE%;t t
4814 s%@WANT_MPBSD_FALSE@%$WANT_MPBSD_FALSE%;t t
4815 s%@WANT_MPFR_TRUE@%$WANT_MPFR_TRUE%;t t
4816 s%@WANT_MPFR_FALSE@%$WANT_MPFR_FALSE%;t t
4817 s%@CC@%$CC%;t t
4818 s%@CCAS@%$CCAS%;t t
4819 s%@CPP@%$CPP%;t t
4820 s%@LN_S@%$LN_S%;t t
4821 s%@M4@%$M4%;t t
4822 s%@AR@%$AR%;t t
4823 s%@CALLING_CONVENTIONS_OBJS@%$CALLING_CONVENTIONS_OBJS%;t t
4824 s%@SPEED_CYCLECOUNTER_OBJS@%$SPEED_CYCLECOUNTER_OBJS%;t t
4825 s%@EXEEXT@%$EXEEXT%;t t
4826 s%@OBJEXT@%$OBJEXT%;t t
4827 s%@RANLIB@%$RANLIB%;t t
4828 s%@STRIP@%$STRIP%;t t
4829 s%@LIBTOOL@%$LIBTOOL%;t t
4830 s%@U@%$U%;t t
4831 s%@ANSI2KNR@%$ANSI2KNR%;t t
4832 s%@mpn_objects@%$mpn_objects%;t t
4833 s%@mpn_objs_in_libgmp@%$mpn_objs_in_libgmp%;t t
4834 s%@gmp_srclinks@%$gmp_srclinks%;t t
4835 CEOF
4836
4837 EOF
4838
4839   cat >>$CONFIG_STATUS <<\EOF
4840   # Split the substitutions into bite-sized pieces for seds with
4841   # small command number limits, like on Digital OSF/1 and HP-UX.
4842   ac_max_sed_lines=48
4843   ac_sed_frag=1 # Number of current file.
4844   ac_beg=1 # First line for current file.
4845   ac_end=$ac_max_sed_lines # Line after last line for current file.
4846   ac_more_lines=:
4847   ac_sed_cmds=""
4848   while $ac_more_lines; do
4849     if test $ac_beg -gt 1; then
4850       sed "1,${ac_beg}d; ${ac_end}q" $ac_cs_root.subs >$ac_cs_root.sfrag
4851     else
4852       sed "${ac_end}q" $ac_cs_root.subs >$ac_cs_root.sfrag
4853     fi
4854     if test ! -s $ac_cs_root.sfrag; then
4855       ac_more_lines=false
4856       rm -f $ac_cs_root.sfrag
4857     else
4858       # The purpose of the label and of the branching condition is to
4859       # speed up the sed processing (if there are no `@' at all, there
4860       # is no need to browse any of the substitutions).
4861       # These are the two extra sed commands mentioned above.
4862       (echo ':t
4863   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $ac_cs_root.sfrag) >$ac_cs_root.s$ac_sed_frag
4864       if test -z "$ac_sed_cmds"; then
4865         ac_sed_cmds="sed -f $ac_cs_root.s$ac_sed_frag"
4866       else
4867         ac_sed_cmds="$ac_sed_cmds | sed -f $ac_cs_root.s$ac_sed_frag"
4868       fi
4869       ac_sed_frag=`expr $ac_sed_frag + 1`
4870       ac_beg=$ac_end
4871       ac_end=`expr $ac_end + $ac_max_sed_lines`
4872     fi
4873   done
4874   if test -z "$ac_sed_cmds"; then
4875     ac_sed_cmds=cat
4876   fi
4877 fi # test -n "$CONFIG_FILES"
4878
4879 EOF
4880 cat >>$CONFIG_STATUS <<\EOF
4881 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
4882   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
4883   case "$ac_file" in
4884   *:*) ac_file_in=`echo "$ac_file" | sed 's%[^:]*:%%'`
4885        ac_file=`echo "$ac_file" | sed 's%:.*%%'` ;;
4886   *) ac_file_in="${ac_file}.in" ;;
4887   esac
4888
4889   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
4890
4891   # Remove last slash and all that follows it.  Not all systems have dirname.
4892   ac_dir=`echo "$ac_file" | sed 's%/[^/][^/]*$%%'`
4893   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
4894     # The file is in a subdirectory.
4895     test ! -d "$ac_dir" && mkdir "$ac_dir"
4896     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
4897     # A "../" for each directory in $ac_dir_suffix.
4898     ac_dots=`echo "$ac_dir_suffix" | sed 's%/[^/]*%../%g'`
4899   else
4900     ac_dir_suffix= ac_dots=
4901   fi
4902
4903   case "$ac_given_srcdir" in
4904   .)  srcdir=.
4905       if test -z "$ac_dots"; then top_srcdir=.
4906       else top_srcdir=`echo $ac_dots | sed 's%/$%%'`; fi ;;
4907   [\\/]* | ?:[\\/]* )
4908       srcdir="$ac_given_srcdir$ac_dir_suffix";
4909       top_srcdir=$ac_given_srcdir ;;
4910   *) # Relative path.
4911     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
4912     top_srcdir="$ac_dots$ac_given_srcdir" ;;
4913   esac
4914
4915   case "$ac_given_INSTALL" in
4916   [\\/$]* | ?:[\\/]* ) INSTALL="$ac_given_INSTALL" ;;
4917   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
4918   esac
4919
4920   echo creating "$ac_file"
4921   rm -f "$ac_file"
4922   configure_input="Generated automatically from `echo $ac_file_in |
4923                                                  sed 's%.*/%%'` by configure."
4924   case "$ac_file" in
4925   *[Mm]akefile*) ac_comsub="1i\\
4926 # $configure_input" ;;
4927   *) ac_comsub= ;;
4928   esac
4929
4930   # Don't redirect the output to AC_FILE directly: use `mv' so that updating
4931   # is atomic, and doesn't need trapping.
4932   ac_file_inputs=`echo "$ac_file_in" |
4933                   sed -e "s%:% $ac_given_srcdir/%g;s%^%$ac_given_srcdir/%"`
4934   for ac_file_input in $ac_file_inputs;
4935   do
4936     test -f "$ac_file_input" ||
4937         { echo "configure: error: cannot find input file \`$ac_file_input'" 1>&2; exit 1; }
4938   done
4939 EOF
4940 cat >>$CONFIG_STATUS <<EOF
4941   sed -e "$ac_comsub
4942 $ac_vpsub
4943 $extrasub
4944 EOF
4945 cat >>$CONFIG_STATUS <<\EOF
4946 :t
4947 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
4948 s%@configure_input@%$configure_input%;t t
4949 s%@srcdir@%$srcdir%;t t
4950 s%@top_srcdir@%$top_srcdir%;t t
4951 s%@INSTALL@%$INSTALL%;t t
4952 " $ac_file_inputs | (eval "$ac_sed_cmds") >$ac_cs_root.out
4953   mv $ac_cs_root.out $ac_file
4954
4955 fi; done
4956 rm -f $ac_cs_root.s*
4957 EOF
4958 cat >>$CONFIG_STATUS <<\EOF
4959
4960 #
4961 # CONFIG_HEADER section.
4962 #
4963
4964 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
4965 # NAME is the cpp macro being defined and VALUE is the value it is being given.
4966 #
4967 # ac_d sets the value in "#define NAME VALUE" lines.
4968 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
4969 ac_dB='[        ].*$%\1#\2'
4970 ac_dC=' '
4971 ac_dD='%;t'
4972 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
4973 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
4974 ac_uB='$%\1#\2define\3'
4975 ac_uC=' '
4976 ac_uD='%;t'
4977
4978 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
4979   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
4980   case "$ac_file" in
4981   *:*) ac_file_in=`echo "$ac_file" | sed 's%[^:]*:%%'`
4982        ac_file=`echo "$ac_file" | sed 's%:.*%%'` ;;
4983   *) ac_file_in="${ac_file}.in" ;;
4984   esac
4985
4986   echo creating $ac_file
4987
4988   rm -f $ac_cs_root.frag $ac_cs_root.in $ac_cs_root.out
4989   ac_file_inputs=`echo "$ac_file_in" |
4990                   sed -e "s%:% $ac_given_srcdir/%g;s%^%$ac_given_srcdir/%"`
4991     for ac_file_input in $ac_file_inputs;
4992   do
4993     test -f "$ac_file_input" ||
4994         { echo "configure: error: cannot find input file \`$ac_file_input'" 1>&2; exit 1; }
4995   done
4996   # Remove the trailing spaces.
4997   sed -e 's/[   ]*$//' $ac_file_inputs >$ac_cs_root.in
4998
4999 EOF
5000
5001 # Transform confdefs.h into two sed scripts, `conftest.defines' and
5002 # `conftest.undefs', that substitutes the proper values into
5003 # config.h.in to produce config.h.  The first handles `#define'
5004 # templates, and the second `#undef' templates.
5005 # And first: Protect against being on the right side of a sed subst in
5006 # config.status.  Protect against being in an unquoted here document
5007 # in config.status.
5008 rm -f conftest.defines conftest.undefs
5009 ac_cs_root=conftest
5010 cat >$ac_cs_root.hdr <<\EOF
5011 s/[\\&%]/\\&/g
5012 s%[\\$`]%\\&%g
5013 t clear
5014 : clear
5015 s%^[    ]*#[    ]*define[       ][      ]*\(\([^        (][^    (]*\)([^)]*)\)[         ]*\(.*\)$%${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD}%gp
5016 t cleanup
5017 s%^[    ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)$%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
5018 : cleanup
5019 EOF
5020 # If some macros were called several times there might be several times
5021 # the same #defines, which is useless.  Nevertheless, we may not want to
5022 # sort them, since we want the *last* AC_DEFINE to be honored.
5023 uniq confdefs.h | sed -n -f $ac_cs_root.hdr >conftest.defines
5024 sed -e 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
5025 rm -f $ac_cs_root.hdr
5026
5027 # This sed command replaces #undef with comments.  This is necessary, for
5028 # example, in the case of _POSIX_SOURCE, which is predefined and required
5029 # on some systems where configure will not decide to define it.
5030 cat >>conftest.undefs <<\EOF
5031 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
5032 EOF
5033
5034 # Break up conftest.defines because some shells have a limit on the size
5035 # of here documents, and old seds have small limits too (100 cmds).
5036 echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
5037 echo '  if egrep "^[    ]*#[    ]*define" $ac_cs_root.in >/dev/null; then' >>$CONFIG_STATUS
5038 echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
5039 echo '  :' >>$CONFIG_STATUS
5040 rm -f conftest.tail
5041 while grep . conftest.defines >/dev/null
5042 do
5043   # Write a limited-size here document to $ac_cs_root.frag.
5044   echo '  cat >$ac_cs_root.frag <<CEOF' >>$CONFIG_STATUS
5045   echo '/^[     ]*#[    ]*define/!b' >>$CONFIG_STATUS
5046   sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
5047   echo 'CEOF
5048   sed -f $ac_cs_root.frag $ac_cs_root.in >$ac_cs_root.out
5049   rm -f $ac_cs_root.in
5050   mv $ac_cs_root.out $ac_cs_root.in
5051 ' >>$CONFIG_STATUS
5052   sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
5053   rm -f conftest.defines
5054   mv conftest.tail conftest.defines
5055 done
5056 rm -f conftest.defines
5057 echo '  fi # egrep' >>$CONFIG_STATUS
5058 echo >>$CONFIG_STATUS
5059
5060 # Break up conftest.undefs because some shells have a limit on the size
5061 # of here documents, and old seds have small limits too (100 cmds).
5062 echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
5063 rm -f conftest.tail
5064 while grep . conftest.undefs >/dev/null
5065 do
5066   # Write a limited-size here document to $ac_cs_root.frag.
5067   echo '  cat >$ac_cs_root.frag <<CEOF' >>$CONFIG_STATUS
5068   echo '/^[     ]*#[    ]*undef/!b' >>$CONFIG_STATUS
5069   sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
5070   echo 'CEOF
5071   sed -f $ac_cs_root.frag $ac_cs_root.in >$ac_cs_root.out
5072   rm -f $ac_cs_root.in
5073   mv $ac_cs_root.out $ac_cs_root.in
5074 ' >>$CONFIG_STATUS
5075   sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
5076   rm -f conftest.undefs
5077   mv conftest.tail conftest.undefs
5078 done
5079 rm -f conftest.undefs
5080
5081 cat >>$CONFIG_STATUS <<\EOF
5082   rm -f $ac_cs_root.frag $ac_cs_root.h
5083   echo "/* $ac_file.  Generated automatically by configure.  */" >$ac_cs_root.h
5084   cat $ac_cs_root.in >>$ac_cs_root.h
5085   rm -f $ac_cs_root.in
5086   if cmp -s $ac_file $ac_cs_root.h 2>/dev/null; then
5087     echo "$ac_file is unchanged"
5088     rm -f $ac_cs_root.h
5089   else
5090     # Remove last slash and all that follows it.  Not all systems have dirname.
5091     ac_dir=`echo "$ac_file" | sed 's%/[^/][^/]*$%%'`
5092     if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5093       # The file is in a subdirectory.
5094       test ! -d "$ac_dir" && mkdir "$ac_dir"
5095     fi
5096     rm -f $ac_file
5097     mv $ac_cs_root.h $ac_file
5098   fi
5099 fi; done
5100 EOF
5101 cat >>$CONFIG_STATUS <<\EOF
5102
5103 #
5104 # CONFIG_LINKS section.
5105 #
5106 srcdir=$ac_given_srcdir
5107
5108 for ac_file in : $CONFIG_LINKS; do if test "x$ac_file" != x:; then
5109   ac_dest=`echo "$ac_file" | sed 's%:.*%%'`
5110   ac_source=`echo "$ac_file" | sed 's%[^:]*:%%'`
5111
5112   echo "linking $srcdir/$ac_source to $ac_dest"
5113
5114   if test ! -r $srcdir/$ac_source; then
5115     { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
5116   fi
5117   rm -f $ac_dest
5118
5119   # Make relative symlinks.
5120   # Remove last slash and all that follows it.  Not all systems have dirname.
5121   ac_dest_dir=`echo $ac_dest | sed 's%/[^/][^/]*$%%'`
5122   if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
5123     # The dest file is in a subdirectory.
5124     test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
5125     ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
5126     # A "../" for each directory in $ac_dest_dir_suffix.
5127     ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
5128   else
5129     ac_dest_dir_suffix= ac_dots=
5130   fi
5131
5132   case "$srcdir" in
5133   [\\/$]* | ?:[\\/]* ) ac_rel_source="$srcdir/$ac_source" ;;
5134       *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
5135   esac
5136
5137   # Make a symlink if possible; otherwise try a hard link.
5138   if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
5139      ln $srcdir/$ac_source $ac_dest; then :
5140   else
5141     { echo "configure: error: cannot link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
5142   fi
5143 fi; done
5144 EOF
5145 cat >>$CONFIG_STATUS <<\EOF
5146
5147 #
5148 # CONFIG_COMMANDS section.
5149 #
5150 for ac_file in .. $CONFIG_COMMANDS; do if test "x$ac_file" != x..; then
5151   ac_dest=`echo "$ac_file" | sed 's%:.*%%'`
5152   ac_source=`echo "$ac_file" | sed 's%[^:]*:%%'`
5153
5154   case "$ac_dest" in
5155     default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ;;
5156   esac
5157 fi;done
5158 EOF
5159
5160 cat >>$CONFIG_STATUS <<\EOF
5161
5162 exit 0
5163 EOF
5164 chmod +x $CONFIG_STATUS
5165 rm -fr confdefs* $ac_clean_files
5166 trap 'exit 1' 1 2 15
5167
5168 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1