* configure.in: Set HDLFLAGS for *-*-hpux with --enable-shared.
[binutils-gdb.git] / gprof / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.7
5 # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_help="$ac_help
15 --enable-shared build shared BFD library"
16
17 # Initialize some variables set by options.
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
55 ac_prev=
56 for ac_option
57 do
58
59 # If the previous option needs an argument, assign it.
60 if test -n "$ac_prev"; then
61 eval "$ac_prev=\$ac_option"
62 ac_prev=
63 continue
64 fi
65
66 case "$ac_option" in
67 -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
68 *) ac_optarg= ;;
69 esac
70
71 # Accept the important Cygnus configure options, so we can diagnose typos.
72
73 case "$ac_option" in
74
75 -bindir | --bindir | --bindi | --bind | --bin | --bi)
76 ac_prev=bindir ;;
77 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
78 bindir="$ac_optarg" ;;
79
80 -build | --build | --buil | --bui | --bu)
81 ac_prev=build ;;
82 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
83 build="$ac_optarg" ;;
84
85 -cache-file | --cache-file | --cache-fil | --cache-fi \
86 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
87 ac_prev=cache_file ;;
88 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
89 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
90 cache_file="$ac_optarg" ;;
91
92 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
93 ac_prev=datadir ;;
94 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
95 | --da=*)
96 datadir="$ac_optarg" ;;
97
98 -disable-* | --disable-*)
99 ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
100 # Reject names that are not valid shell variable names.
101 if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
102 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
103 fi
104 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
105 eval "enable_${ac_feature}=no" ;;
106
107 -enable-* | --enable-*)
108 ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
109 # Reject names that are not valid shell variable names.
110 if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
111 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
112 fi
113 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
114 case "$ac_option" in
115 *=*) ;;
116 *) ac_optarg=yes ;;
117 esac
118 eval "enable_${ac_feature}='$ac_optarg'" ;;
119
120 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
121 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
122 | --exec | --exe | --ex)
123 ac_prev=exec_prefix ;;
124 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
125 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
126 | --exec=* | --exe=* | --ex=*)
127 exec_prefix="$ac_optarg" ;;
128
129 -gas | --gas | --ga | --g)
130 # Obsolete; use --with-gas.
131 with_gas=yes ;;
132
133 -help | --help | --hel | --he)
134 # Omit some internal or obsolete options to make the list less imposing.
135 # This message is too long to be a string in the A/UX 3.1 sh.
136 cat << EOF
137 Usage: configure [options] [host]
138 Options: [defaults in brackets after descriptions]
139 Configuration:
140 --cache-file=FILE cache test results in FILE
141 --help print this message
142 --no-create do not create output files
143 --quiet, --silent do not print \`checking...' messages
144 --version print the version of autoconf that created configure
145 Directory and file names:
146 --prefix=PREFIX install architecture-independent files in PREFIX
147 [$ac_default_prefix]
148 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
149 [same as prefix]
150 --bindir=DIR user executables in DIR [EPREFIX/bin]
151 --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
152 --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
153 --datadir=DIR read-only architecture-independent data in DIR
154 [PREFIX/share]
155 --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
156 --sharedstatedir=DIR modifiable architecture-independent data in DIR
157 [PREFIX/com]
158 --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
159 --libdir=DIR object code libraries in DIR [EPREFIX/lib]
160 --includedir=DIR C header files in DIR [PREFIX/include]
161 --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
162 --infodir=DIR info documentation in DIR [PREFIX/info]
163 --mandir=DIR man documentation in DIR [PREFIX/man]
164 --srcdir=DIR find the sources in DIR [configure dir or ..]
165 --program-prefix=PREFIX prepend PREFIX to installed program names
166 --program-suffix=SUFFIX append SUFFIX to installed program names
167 --program-transform-name=PROGRAM
168 run sed PROGRAM on installed program names
169 EOF
170 cat << EOF
171 Host type:
172 --build=BUILD configure for building on BUILD [BUILD=HOST]
173 --host=HOST configure for HOST [guessed]
174 --target=TARGET configure for TARGET [TARGET=HOST]
175 Features and packages:
176 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
177 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
178 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
179 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
180 --x-includes=DIR X include files are in DIR
181 --x-libraries=DIR X library files are in DIR
182 EOF
183 if test -n "$ac_help"; then
184 echo "--enable and --with options recognized:$ac_help"
185 fi
186 exit 0 ;;
187
188 -host | --host | --hos | --ho)
189 ac_prev=host ;;
190 -host=* | --host=* | --hos=* | --ho=*)
191 host="$ac_optarg" ;;
192
193 -includedir | --includedir | --includedi | --included | --include \
194 | --includ | --inclu | --incl | --inc)
195 ac_prev=includedir ;;
196 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
197 | --includ=* | --inclu=* | --incl=* | --inc=*)
198 includedir="$ac_optarg" ;;
199
200 -infodir | --infodir | --infodi | --infod | --info | --inf)
201 ac_prev=infodir ;;
202 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
203 infodir="$ac_optarg" ;;
204
205 -libdir | --libdir | --libdi | --libd)
206 ac_prev=libdir ;;
207 -libdir=* | --libdir=* | --libdi=* | --libd=*)
208 libdir="$ac_optarg" ;;
209
210 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
211 | --libexe | --libex | --libe)
212 ac_prev=libexecdir ;;
213 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
214 | --libexe=* | --libex=* | --libe=*)
215 libexecdir="$ac_optarg" ;;
216
217 -localstatedir | --localstatedir | --localstatedi | --localstated \
218 | --localstate | --localstat | --localsta | --localst \
219 | --locals | --local | --loca | --loc | --lo)
220 ac_prev=localstatedir ;;
221 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
222 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
223 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
224 localstatedir="$ac_optarg" ;;
225
226 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
227 ac_prev=mandir ;;
228 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
229 mandir="$ac_optarg" ;;
230
231 -nfp | --nfp | --nf)
232 # Obsolete; use --without-fp.
233 with_fp=no ;;
234
235 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
236 | --no-cr | --no-c)
237 no_create=yes ;;
238
239 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
240 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
241 no_recursion=yes ;;
242
243 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
244 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
245 | --oldin | --oldi | --old | --ol | --o)
246 ac_prev=oldincludedir ;;
247 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
248 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
249 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
250 oldincludedir="$ac_optarg" ;;
251
252 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
253 ac_prev=prefix ;;
254 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
255 prefix="$ac_optarg" ;;
256
257 -program-prefix | --program-prefix | --program-prefi | --program-pref \
258 | --program-pre | --program-pr | --program-p)
259 ac_prev=program_prefix ;;
260 -program-prefix=* | --program-prefix=* | --program-prefi=* \
261 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
262 program_prefix="$ac_optarg" ;;
263
264 -program-suffix | --program-suffix | --program-suffi | --program-suff \
265 | --program-suf | --program-su | --program-s)
266 ac_prev=program_suffix ;;
267 -program-suffix=* | --program-suffix=* | --program-suffi=* \
268 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
269 program_suffix="$ac_optarg" ;;
270
271 -program-transform-name | --program-transform-name \
272 | --program-transform-nam | --program-transform-na \
273 | --program-transform-n | --program-transform- \
274 | --program-transform | --program-transfor \
275 | --program-transfo | --program-transf \
276 | --program-trans | --program-tran \
277 | --progr-tra | --program-tr | --program-t)
278 ac_prev=program_transform_name ;;
279 -program-transform-name=* | --program-transform-name=* \
280 | --program-transform-nam=* | --program-transform-na=* \
281 | --program-transform-n=* | --program-transform-=* \
282 | --program-transform=* | --program-transfor=* \
283 | --program-transfo=* | --program-transf=* \
284 | --program-trans=* | --program-tran=* \
285 | --progr-tra=* | --program-tr=* | --program-t=*)
286 program_transform_name="$ac_optarg" ;;
287
288 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
289 | -silent | --silent | --silen | --sile | --sil)
290 silent=yes ;;
291
292 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
293 ac_prev=sbindir ;;
294 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
295 | --sbi=* | --sb=*)
296 sbindir="$ac_optarg" ;;
297
298 -sharedstatedir | --sharedstatedir | --sharedstatedi \
299 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
300 | --sharedst | --shareds | --shared | --share | --shar \
301 | --sha | --sh)
302 ac_prev=sharedstatedir ;;
303 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
304 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
305 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
306 | --sha=* | --sh=*)
307 sharedstatedir="$ac_optarg" ;;
308
309 -site | --site | --sit)
310 ac_prev=site ;;
311 -site=* | --site=* | --sit=*)
312 site="$ac_optarg" ;;
313
314 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
315 ac_prev=srcdir ;;
316 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
317 srcdir="$ac_optarg" ;;
318
319 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
320 | --syscon | --sysco | --sysc | --sys | --sy)
321 ac_prev=sysconfdir ;;
322 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
323 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
324 sysconfdir="$ac_optarg" ;;
325
326 -target | --target | --targe | --targ | --tar | --ta | --t)
327 ac_prev=target ;;
328 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
329 target="$ac_optarg" ;;
330
331 -v | -verbose | --verbose | --verbos | --verbo | --verb)
332 verbose=yes ;;
333
334 -version | --version | --versio | --versi | --vers)
335 echo "configure generated by autoconf version 2.7"
336 exit 0 ;;
337
338 -with-* | --with-*)
339 ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
340 # Reject names that are not valid shell variable names.
341 if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
342 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
343 fi
344 ac_package=`echo $ac_package| sed 's/-/_/g'`
345 case "$ac_option" in
346 *=*) ;;
347 *) ac_optarg=yes ;;
348 esac
349 eval "with_${ac_package}='$ac_optarg'" ;;
350
351 -without-* | --without-*)
352 ac_package=`echo $ac_option|sed -e 's/-*without-//'`
353 # Reject names that are not valid shell variable names.
354 if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
355 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
356 fi
357 ac_package=`echo $ac_package| sed 's/-/_/g'`
358 eval "with_${ac_package}=no" ;;
359
360 --x)
361 # Obsolete; use --with-x.
362 with_x=yes ;;
363
364 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
365 | --x-incl | --x-inc | --x-in | --x-i)
366 ac_prev=x_includes ;;
367 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
368 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
369 x_includes="$ac_optarg" ;;
370
371 -x-libraries | --x-libraries | --x-librarie | --x-librari \
372 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
373 ac_prev=x_libraries ;;
374 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
375 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
376 x_libraries="$ac_optarg" ;;
377
378 -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
379 ;;
380
381 *)
382 if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
383 echo "configure: warning: $ac_option: invalid host type" 1>&2
384 fi
385 if test "x$nonopt" != xNONE; then
386 { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
387 fi
388 nonopt="$ac_option"
389 ;;
390
391 esac
392 done
393
394 if test -n "$ac_prev"; then
395 { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
396 fi
397
398 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
399
400 # File descriptor usage:
401 # 0 standard input
402 # 1 file creation
403 # 2 errors and warnings
404 # 3 some systems may open it to /dev/tty
405 # 4 used on the Kubota Titan
406 # 6 checking for... messages and results
407 # 5 compiler messages saved in config.log
408 if test "$silent" = yes; then
409 exec 6>/dev/null
410 else
411 exec 6>&1
412 fi
413 exec 5>./config.log
414
415 echo "\
416 This file contains any messages produced by compilers while
417 running configure, to aid debugging if configure makes a mistake.
418 " 1>&5
419
420 # Strip out --no-create and --no-recursion so they do not pile up.
421 # Also quote any args containing shell metacharacters.
422 ac_configure_args=
423 for ac_arg
424 do
425 case "$ac_arg" in
426 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
427 | --no-cr | --no-c) ;;
428 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
429 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
430 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
431 ac_configure_args="$ac_configure_args '$ac_arg'" ;;
432 *) ac_configure_args="$ac_configure_args $ac_arg" ;;
433 esac
434 done
435
436 # NLS nuisances.
437 # Only set LANG and LC_ALL to C if already set.
438 # These must not be set unconditionally because not all systems understand
439 # e.g. LANG=C (notably SCO).
440 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
441 if test "${LANG+set}" = set; then LANG=C; export LANG; fi
442
443 # confdefs.h avoids OS command line length limits that DEFS can exceed.
444 rm -rf conftest* confdefs.h
445 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
446 echo > confdefs.h
447
448 # A filename unique to this package, relative to the directory that
449 # configure is in, which we can look for to find out if srcdir is correct.
450 ac_unique_file=gprof.c
451
452 # Find the source files, if location was not specified.
453 if test -z "$srcdir"; then
454 ac_srcdir_defaulted=yes
455 # Try the directory containing this script, then its parent.
456 ac_prog=$0
457 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
458 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
459 srcdir=$ac_confdir
460 if test ! -r $srcdir/$ac_unique_file; then
461 srcdir=..
462 fi
463 else
464 ac_srcdir_defaulted=no
465 fi
466 if test ! -r $srcdir/$ac_unique_file; then
467 if test "$ac_srcdir_defaulted" = yes; then
468 { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
469 else
470 { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
471 fi
472 fi
473 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
474
475 # Prefer explicitly selected file to automatically selected ones.
476 if test -z "$CONFIG_SITE"; then
477 if test "x$prefix" != xNONE; then
478 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
479 else
480 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
481 fi
482 fi
483 for ac_site_file in $CONFIG_SITE; do
484 if test -r "$ac_site_file"; then
485 echo "loading site script $ac_site_file"
486 . "$ac_site_file"
487 fi
488 done
489
490 if test -r "$cache_file"; then
491 echo "loading cache $cache_file"
492 . $cache_file
493 else
494 echo "creating cache $cache_file"
495 > $cache_file
496 fi
497
498 ac_ext=c
499 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
500 ac_cpp='echo $CPP $CPPFLAGS 1>&5;
501 $CPP $CPPFLAGS'
502 ac_compile='echo ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5;
503 ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5'
504 ac_link='echo ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5;
505 ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5'
506
507 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
508 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
509 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
510 ac_n= ac_c='
511 ' ac_t=' '
512 else
513 ac_n=-n ac_c= ac_t=
514 fi
515 else
516 ac_n= ac_c='\c' ac_t=
517 fi
518
519
520
521 # Check whether --enable-shared or --disable-shared was given.
522 if test "${enable_shared+set}" = set; then
523 enableval="$enable_shared"
524 case "${enableval}" in
525 yes) shared=true ;;
526 no) shared=false ;;
527 *) { echo "configure: error: bad value ${enableval} for BFD shared option" 1>&2; exit 1; } ;;
528 esac
529 fi
530
531 # Extract the first word of "gcc", so it can be a program name with args.
532 set dummy gcc; ac_word=$2
533 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
534 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
535 echo $ac_n "(cached) $ac_c" 1>&6
536 else
537 if test -n "$CC"; then
538 ac_cv_prog_CC="$CC" # Let the user override the test.
539 else
540 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
541 for ac_dir in $PATH; do
542 test -z "$ac_dir" && ac_dir=.
543 if test -f $ac_dir/$ac_word; then
544 ac_cv_prog_CC="gcc"
545 break
546 fi
547 done
548 IFS="$ac_save_ifs"
549 test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc"
550 fi
551 fi
552 CC="$ac_cv_prog_CC"
553 if test -n "$CC"; then
554 echo "$ac_t""$CC" 1>&6
555 else
556 echo "$ac_t""no" 1>&6
557 fi
558
559
560 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
561 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
562 echo $ac_n "(cached) $ac_c" 1>&6
563 else
564 cat > conftest.c <<EOF
565 #ifdef __GNUC__
566 yes;
567 #endif
568 EOF
569 if ${CC-cc} -E conftest.c 2>&5 | egrep yes >/dev/null 2>&1; then
570 ac_cv_prog_gcc=yes
571 else
572 ac_cv_prog_gcc=no
573 fi
574 fi
575
576 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
577 if test $ac_cv_prog_gcc = yes; then
578 GCC=yes
579 if test "${CFLAGS+set}" != set; then
580 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
581 if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then
582 echo $ac_n "(cached) $ac_c" 1>&6
583 else
584 echo 'void f(){}' > conftest.c
585 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
586 ac_cv_prog_gcc_g=yes
587 else
588 ac_cv_prog_gcc_g=no
589 fi
590 rm -f conftest*
591
592 fi
593
594 echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
595 if test $ac_cv_prog_gcc_g = yes; then
596 CFLAGS="-g -O"
597 else
598 CFLAGS="-O"
599 fi
600 fi
601 else
602 GCC=
603 test "${CFLAGS+set}" = set || CFLAGS="-g"
604 fi
605
606
607 ac_aux_dir=
608 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
609 if test -f $ac_dir/install-sh; then
610 ac_aux_dir=$ac_dir
611 ac_install_sh="$ac_aux_dir/install-sh -c"
612 break
613 elif 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 fi
618 done
619 if test -z "$ac_aux_dir"; then
620 { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
621 fi
622 ac_config_guess=$ac_aux_dir/config.guess
623 ac_config_sub=$ac_aux_dir/config.sub
624 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
625
626
627 # Do some error checking and defaulting for the host and target type.
628 # The inputs are:
629 # configure --host=HOST --target=TARGET --build=BUILD NONOPT
630 #
631 # The rules are:
632 # 1. You are not allowed to specify --host, --target, and nonopt at the
633 # same time.
634 # 2. Host defaults to nonopt.
635 # 3. If nonopt is not specified, then host defaults to the current host,
636 # as determined by config.guess.
637 # 4. Target and build default to nonopt.
638 # 5. If nonopt is not specified, then target and build default to host.
639
640 # The aliases save the names the user supplied, while $host etc.
641 # will get canonicalized.
642 case $host---$target---$nonopt in
643 NONE---*---* | *---NONE---* | *---*---NONE) ;;
644 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
645 esac
646
647
648 # Make sure we can run config.sub.
649 if $ac_config_sub sun4 >/dev/null 2>&1; then :
650 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
651 fi
652
653 echo $ac_n "checking host system type""... $ac_c" 1>&6
654
655 host_alias=$host
656 case "$host_alias" in
657 NONE)
658 case $nonopt in
659 NONE)
660 if host_alias=`$ac_config_guess`; then :
661 else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
662 fi ;;
663 *) host_alias=$nonopt ;;
664 esac ;;
665 esac
666
667 host=`$ac_config_sub $host_alias`
668 host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
669 host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
670 host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
671 echo "$ac_t""$host" 1>&6
672
673 echo $ac_n "checking target system type""... $ac_c" 1>&6
674
675 target_alias=$target
676 case "$target_alias" in
677 NONE)
678 case $nonopt in
679 NONE) target_alias=$host_alias ;;
680 *) target_alias=$nonopt ;;
681 esac ;;
682 esac
683
684 target=`$ac_config_sub $target_alias`
685 target_cpu=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
686 target_vendor=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
687 target_os=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
688 echo "$ac_t""$target" 1>&6
689
690 echo $ac_n "checking build system type""... $ac_c" 1>&6
691
692 build_alias=$build
693 case "$build_alias" in
694 NONE)
695 case $nonopt in
696 NONE) build_alias=$host_alias ;;
697 *) build_alias=$nonopt ;;
698 esac ;;
699 esac
700
701 build=`$ac_config_sub $build_alias`
702 build_cpu=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
703 build_vendor=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
704 build_os=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
705 echo "$ac_t""$build" 1>&6
706
707 test "$host_alias" != "$target_alias" &&
708 test "$program_prefix$program_suffix$program_transform_name" = \
709 NONENONEs,x,x, &&
710 program_prefix=${target_alias}-
711
712 if test "$program_transform_name" = s,x,x,; then
713 program_transform_name=
714 else
715 # Double any \ or $. echo might interpret backslashes.
716 cat <<\EOF_SED > conftestsed
717 s,\\,\\\\,g; s,\$,$$,g
718 EOF_SED
719 program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
720 rm -f conftestsed
721 fi
722 test "$program_prefix" != NONE &&
723 program_transform_name="s,^,${program_prefix},; $program_transform_name"
724 # Use a double $ so make ignores it.
725 test "$program_suffix" != NONE &&
726 program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
727
728 # sed with no file args requires a program.
729 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
730
731
732 case "${target}" in
733 alpha-*-*) MY_TARGET=alpha ;;
734 i[345]86-*-*) MY_TARGET=i386 ;;
735 sparc-*-*) MY_TARGET=sparc ;;
736 tahoe-*-*) MY_TARGET=tahoe ;;
737 vax-*-*) MY_TARGET=vax ;;
738 ns32k-*-*) MY_TARGET=ns532;;
739 *-*-*) MY_TARGET=dummy ;;
740 esac
741
742
743
744 BFDLIB='-L../bfd -lbfd'
745
746 # We need to handle some special cases if BFD was built shared.
747 if test "${shared}" = "true"; then
748 case "${host}" in
749 *-*-sunos*)
750 # On SunOS, we must link against the name we are going to install,
751 # not -lbfd, since SunOS does not support SONAME.
752 BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
753 ;;
754 esac
755 fi
756
757
758 HLDFLAGS=
759 # If we have shared libraries, try to set rpath reasonably.
760 if test "${shared}" = "true"; then
761 case "${host}" in
762 *-*-hpux*)
763 HLDFLAGS='-Wl,+s,+b,$(libdir)'
764 ;;
765 *-*-irix5*)
766 HLDFLAGS='-Wl,-rpath,$(libdir)'
767 ;;
768 *-*-linux*aout*)
769 ;;
770 *-*-linux*)
771 HLDFLAGS='-Wl,-rpath,$(libdir)'
772 ;;
773 *-*-sysv4* | *-*-solaris*)
774 HLDFLAGS='-R $(libdir)'
775 ;;
776 esac
777 fi
778
779 # On SunOS, if the linker supports the -rpath option, use it to
780 # prevent ../bfd and ../opcodes from being included in the run time
781 # search path.
782 case "${host}" in
783 *-*-sunos*)
784 echo 'main () { }' > conftest.c
785 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
786 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
787 :
788 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
789 :
790 elif test "${shared}" = "true"; then
791 HLDFLAGS='-Wl,-rpath=$(libdir)'
792 else
793 HLDFLAGS='-Wl,-rpath='
794 fi
795 rm -f conftest.t conftest.c conftest
796 ;;
797 esac
798
799
800 trap '' 1 2 15
801 cat > confcache <<\EOF
802 # This file is a shell script that caches the results of configure
803 # tests run on this system so they can be shared between configure
804 # scripts and configure runs. It is not useful on other systems.
805 # If it contains results you don't want to keep, you may remove or edit it.
806 #
807 # By default, configure uses ./config.cache as the cache file,
808 # creating it if it does not exist already. You can give configure
809 # the --cache-file=FILE option to use a different cache file; that is
810 # what configure does when it calls configure scripts in
811 # subdirectories, so they share the cache.
812 # Giving --cache-file=/dev/null disables caching, for debugging configure.
813 # config.status only pays attention to the cache file if you give it the
814 # --recheck option to rerun configure.
815 #
816 EOF
817 # Ultrix sh set writes to stderr and can't be redirected directly,
818 # and sets the high bit in the cache file unless we assign to the vars.
819 (set) 2>&1 |
820 sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
821 >> confcache
822 if cmp -s $cache_file confcache; then
823 :
824 else
825 if test -w $cache_file; then
826 echo "updating cache $cache_file"
827 cat confcache > $cache_file
828 else
829 echo "not updating unwritable cache $cache_file"
830 fi
831 fi
832 rm -f confcache
833
834 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
835
836 test "x$prefix" = xNONE && prefix=$ac_default_prefix
837 # Let make expand exec_prefix.
838 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
839
840 # Any assignment to VPATH causes Sun make to only execute
841 # the first set of double-colon rules, so remove it if not needed.
842 # If there is a colon in the path, we need to keep it.
843 if test "x$srcdir" = x.; then
844 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
845 fi
846
847 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
848
849 # Transform confdefs.h into DEFS.
850 # Protect against shell expansion while executing Makefile rules.
851 # Protect against Makefile macro expansion.
852 cat > conftest.defs <<\EOF
853 s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g
854 s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
855 s%\[%\\&%g
856 s%\]%\\&%g
857 s%\$%$$%g
858 EOF
859 DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
860 rm -f conftest.defs
861
862
863 # Without the "./", some shells look in PATH for config.status.
864 : ${CONFIG_STATUS=./config.status}
865
866 echo creating $CONFIG_STATUS
867 rm -f $CONFIG_STATUS
868 cat > $CONFIG_STATUS <<EOF
869 #! /bin/sh
870 # Generated automatically by configure.
871 # Run this file to recreate the current configuration.
872 # This directory was configured as follows,
873 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
874 #
875 # $0 $ac_configure_args
876 #
877 # Compiler output produced by configure, useful for debugging
878 # configure, is in ./config.log if it exists.
879
880 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
881 for ac_option
882 do
883 case "\$ac_option" in
884 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
885 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
886 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
887 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
888 echo "$CONFIG_STATUS generated by autoconf version 2.7"
889 exit 0 ;;
890 -help | --help | --hel | --he | --h)
891 echo "\$ac_cs_usage"; exit 0 ;;
892 *) echo "\$ac_cs_usage"; exit 1 ;;
893 esac
894 done
895
896 ac_given_srcdir=$srcdir
897
898 trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
899 EOF
900 cat >> $CONFIG_STATUS <<EOF
901
902 # Protect against being on the right side of a sed subst in config.status.
903 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
904 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
905 $ac_vpsub
906 $extrasub
907 s%@CFLAGS@%$CFLAGS%g
908 s%@CPPFLAGS@%$CPPFLAGS%g
909 s%@CXXFLAGS@%$CXXFLAGS%g
910 s%@DEFS@%$DEFS%g
911 s%@LDFLAGS@%$LDFLAGS%g
912 s%@LIBS@%$LIBS%g
913 s%@exec_prefix@%$exec_prefix%g
914 s%@prefix@%$prefix%g
915 s%@program_transform_name@%$program_transform_name%g
916 s%@bindir@%$bindir%g
917 s%@sbindir@%$sbindir%g
918 s%@libexecdir@%$libexecdir%g
919 s%@datadir@%$datadir%g
920 s%@sysconfdir@%$sysconfdir%g
921 s%@sharedstatedir@%$sharedstatedir%g
922 s%@localstatedir@%$localstatedir%g
923 s%@libdir@%$libdir%g
924 s%@includedir@%$includedir%g
925 s%@oldincludedir@%$oldincludedir%g
926 s%@infodir@%$infodir%g
927 s%@mandir@%$mandir%g
928 s%@CC@%$CC%g
929 s%@host@%$host%g
930 s%@host_alias@%$host_alias%g
931 s%@host_cpu@%$host_cpu%g
932 s%@host_vendor@%$host_vendor%g
933 s%@host_os@%$host_os%g
934 s%@target@%$target%g
935 s%@target_alias@%$target_alias%g
936 s%@target_cpu@%$target_cpu%g
937 s%@target_vendor@%$target_vendor%g
938 s%@target_os@%$target_os%g
939 s%@build@%$build%g
940 s%@build_alias@%$build_alias%g
941 s%@build_cpu@%$build_cpu%g
942 s%@build_vendor@%$build_vendor%g
943 s%@build_os@%$build_os%g
944 s%@MY_TARGET@%$MY_TARGET%g
945 s%@BFDLIB@%$BFDLIB%g
946 s%@HLDFLAGS@%$HLDFLAGS%g
947
948 CEOF
949 EOF
950 cat >> $CONFIG_STATUS <<EOF
951
952 CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
953 EOF
954 cat >> $CONFIG_STATUS <<\EOF
955 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
956 # Support "outfile[:infile]", defaulting infile="outfile.in".
957 case "$ac_file" in
958 *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
959 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
960 *) ac_file_in="${ac_file}.in" ;;
961 esac
962
963 # Adjust relative srcdir, etc. for subdirectories.
964
965 # Remove last slash and all that follows it. Not all systems have dirname.
966 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
967 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
968 # The file is in a subdirectory.
969 test ! -d "$ac_dir" && mkdir "$ac_dir"
970 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
971 # A "../" for each directory in $ac_dir_suffix.
972 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
973 else
974 ac_dir_suffix= ac_dots=
975 fi
976
977 case "$ac_given_srcdir" in
978 .) srcdir=.
979 if test -z "$ac_dots"; then top_srcdir=.
980 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
981 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
982 *) # Relative path.
983 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
984 top_srcdir="$ac_dots$ac_given_srcdir" ;;
985 esac
986
987 echo creating "$ac_file"
988 rm -f "$ac_file"
989 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
990 case "$ac_file" in
991 *Makefile*) ac_comsub="1i\\
992 # $configure_input" ;;
993 *) ac_comsub= ;;
994 esac
995 sed -e "$ac_comsub
996 s%@configure_input@%$configure_input%g
997 s%@srcdir@%$srcdir%g
998 s%@top_srcdir@%$top_srcdir%g
999 " -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
1000 fi; done
1001 rm -f conftest.subs
1002
1003
1004
1005 exit 0
1006 EOF
1007 chmod +x $CONFIG_STATUS
1008 rm -fr confdefs* $ac_clean_files
1009 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
1010