*** empty log message ***
[deliverable/binutils-gdb.git] / configure
CommitLineData
252b5132
RH
1#!/bin/sh
2
3### WARNING: this file contains embedded tabs. Do not run untabify on this file.
4
5# Configuration script
d5de0a84
NC
6# Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999, 2000, 2001,
7# 2002 Free Software Foundation, Inc.
252b5132
RH
8
9# This program is free software; you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, write to the Free Software
21# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23# This file was originally written by K. Richard Pixley.
24
25#
26# Shell script to create proper links to machine-dependent files in
27# preparation for compilation.
28#
29# If configure succeeds, it leaves its status in config.status.
30# If configure fails after disturbing the status quo,
31# config.status is removed.
32#
33
34export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0 $argv; kill $$)
35
36remove=rm
37hard_link=ln
38symbolic_link='ln -s'
39
40#for Test
41#remove="echo rm"
42#hard_link="echo ln"
43#symbolic_link="echo ln -s"
44
45# clear some things potentially inherited from environment.
46
47Makefile=Makefile
48Makefile_in=Makefile.in
49arguments=
50build_alias=
51cache_file=config.cache
52cache_file_option=
53configdirs=
54extraconfigdirs=
55diroptions=
75205f78
DD
56enable_threads=no
57enable_shared=no
58enable_libstdcxx_v3=yes
252b5132
RH
59exec_prefix=
60exec_prefixoption=
61fatal=
62floating_point=default
63gas=default
64gcc_version=
65gcc_version_trigger=
66host_alias=NOHOST
67host_makefile_frag=
68moveifchange=
69norecursion=
70other_options=
71package_makefile_frag=
72package_makefile_rules_frag=
73prefix=/usr/local
74progname=
75program_prefix=
76program_prefixoption=
77program_suffix=
78program_suffixoption=
79program_transform_name=
80program_transform_nameoption=
81redirect=
252b5132
RH
82site=
83site_makefile_frag=
84site_option=
85srcdir=
86srctrigger=
252b5132
RH
87target_alias=NOTARGET
88target_makefile_frag=
89undefs=NOUNDEFS
90version="$Revision$"
91x11=default
92bindir='${exec_prefix}/bin'
93sbindir='${exec_prefix}/sbin'
94libexecdir='${exec_prefix}/libexec'
95datadir='${prefix}/share'
96sysconfdir='${prefix}/etc'
97sharedstatedir='${prefix}/com'
98localstatedir='${prefix}/var'
99libdir='${exec_prefix}/lib'
100includedir='${prefix}/include'
101oldincludedir='/usr/include'
102infodir='${prefix}/info'
103mandir='${prefix}/man'
104
105### we might need to use some other shell than /bin/sh for running subshells
106
107### If we are on Windows, search for the shell. This will permit people
108### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure
109### without also having to set CONFIG_SHELL. This code will work when
110### using bash, which sets OSTYPE.
111case "${OSTYPE}" in
112*win32*)
113 if [ x${CONFIG_SHELL} = x ]; then
114 if [ ! -f /bin/sh ]; then
115 if [ x${SHELL} != x ] && [ -f ${SHELL} ]; then
116 CONFIG_SHELL=${SHELL}
117 export CONFIG_SHELL
118 else
119 for prog in sh sh.exe bash bash.exe; do
120 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
121 for dir in $PATH; do
122 test -z "$dir" && dir=.
123 if test -f $dir/$prog; then
124 CONFIG_SHELL=$dir/$prog
125 export CONFIG_SHELL
126 break
127 fi
128 done
129 IFS="$save_ifs"
130 test -n "${CONFIG_SHELL}" && break
131 done
132 fi
133 fi
134 fi
135 ;;
136esac
137
138config_shell=${CONFIG_SHELL-/bin/sh}
139
140NO_EDIT="This file was generated automatically by configure. Do not edit."
141
142## this is a little touchy and won't always work, but...
143##
144## if the argv[0] starts with a slash then it is an absolute name that can (and
145## must) be used as is.
146##
147## otherwise, if argv[0] has no slash in it, we can assume that it is on the
148## path. Since PATH might include "." we also add `pwd` to the end of PATH.
149##
150
151progname=$0
152# if PWD already has a value, it is probably wrong.
d5de0a84 153if [ -n "$PWD" ]; then PWD=`${PWDCMD-pwd}`; fi
252b5132
RH
154
155case "${progname}" in
75205f78 156/* | [A-Za-z]:[\\/]* ) ;;
252b5132
RH
157*/*) ;;
158*)
d5de0a84 159 PATH=$PATH:${PWD=`${PWDCMD-pwd}`} ; export PATH
252b5132
RH
160 ;;
161esac
162
75205f78
DD
163# Export original configure arguments for use by sub-configures.
164TOPLEVEL_CONFIGURE_ARGUMENTS="$progname $@"
165export TOPLEVEL_CONFIGURE_ARGUMENTS
166
252b5132
RH
167# Loop over all args
168
169while :
170do
171
172# Break out if there are no more args
173 case $# in
174 0)
175 break
176 ;;
177 esac
178
179# Get the first arg, and shuffle
180 option=$1
181 shift
182
183# Make all options have two hyphens
184 orig_option=$option # Save original for error messages
185 case $option in
186 --*) ;;
187 -*) option=-$option ;;
188 esac
189
190# Split out the argument for options that take them
191 case $option in
192 --*=*)
193 optarg=`echo $option | sed -e 's/^[^=]*=//'`
194 arguments="$arguments $option"
195 ;;
196# These options have mandatory values. Since we didn't find an = sign,
197# the value must be in the next argument
198 --bu* | --cache* | --ex* | --ho* | --pre* | --program-p* | --program-s* | --program-t* | --si* | --sr* | --ta* | --tm* | --x-* | --bi* | --sb* | --li* | --da* | --sy* | --sh* | --lo* | --in* | --ol* | --ma*)
199 optarg=$1
200 shift
201 arguments="$arguments $option=$optarg"
202 ;;
203 --v)
204 arguments="$arguments -v"
205 ;;
206 --*)
207 arguments="$arguments $option"
208 ;;
209 esac
210
211# Now, process the options
212 case $option in
213
214 --bi*)
215 bindir=$optarg
216 diroptions="$diroptions --bindir=$optarg"
217 ;;
218 --build* | --bu*)
219 case "$build_alias" in
220 "") build_alias=$optarg ;;
221 *) echo '***' Can only configure for one build machine at a time. 1>&2
222 fatal=yes
223 ;;
224 esac
225 ;;
226 --cache*)
227 cache_file=$optarg
228 ;;
229 --da*)
230 datadir=$optarg
231 diroptions="$diroptions --datadir=$optarg"
232 ;;
233 --disable-*)
234 enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'`
235 eval $enableopt=no
236 disableoptions="$disableoptions $option"
237 ;;
238 --enable-*)
239 case "$option" in
240 *=*) ;;
241 *) optarg=yes ;;
242 esac
243
244 enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
ba73c63f 245 eval "$enableopt=\$optarg"
252b5132
RH
246 enableoptions="$enableoptions '$option'"
247 ;;
248 --exec-prefix* | --ex*)
249 exec_prefix=$optarg
250 exec_prefixoption="--exec-prefix=$optarg"
251 ;;
252 --gas | --g*)
253 gas=yes
254 ;;
255 --help | --he*)
256 fatal=yes
257 ;;
258 --host* | --ho*)
259 case $host_alias in
260 NOHOST) host_alias=$optarg ;;
261 *) echo '***' Can only configure for one host at a time. 1>&2
262 fatal=yes
263 ;;
264 esac
265 ;;
266 --inc*)
267 includedir=$optarg
268 diroptions="$diroptions --includedir=$optarg"
269 ;;
270 --inf*)
271 infodir=$optarg
272 diroptions="$diroptions --infodir=$optarg"
273 ;;
274 --libd*)
275 libdir=$optarg
276 diroptions="$diroptions --libdir=$optarg"
277 ;;
278 --libe*)
279 libexecdir=$optarg
280 diroptions="$diroptions --libexecdir=$optarg"
281 ;;
282 --lo*)
283 localstatedir=$optarg
284 diroptions="$diroptions --localstatedir=$optarg"
285 ;;
286 --ma*)
287 mandir=$optarg
288 diroptions="$diroptions --mandir=$optarg"
289 ;;
290 --nfp | --nf*)
291 floating_point=no
292 floating_pointoption="--nfp"
293 ;;
294 --norecursion | --no*)
295 norecursion=yes
296 ;;
297 --ol*)
298 oldincludedir=$optarg
299 diroptions="$diroptions --oldincludedir=$optarg"
300 ;;
301 --prefix* | --pre*)
302 prefix=$optarg
303 prefixoption="--prefix=$optarg"
304 ;;
305 --program-prefix* | --program-p*)
306 program_prefix=$optarg
307 program_prefixoption="--program-prefix=$optarg"
308 ;;
309 --program-suffix* | --program-s*)
310 program_suffix=$optarg
311 program_suffixoption="--program-suffix=$optarg"
312 ;;
313 --program-transform-name* | --program-t*)
314 # Double any backslashes or dollar signs in the argument
315 program_transform_name="${program_transform_name} -e `echo ${optarg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
316 program_transform_nameoption="${program_transform_nameoption} --program-transform-name='$optarg'"
317 ;;
252b5132
RH
318 --sb*)
319 sbindir=$optarg
320 diroptions="$diroptions --sbindir=$optarg"
321 ;;
322 --sh*)
323 sharedstatedir=$optarg
324 diroptions="$diroptions --sharedstatedir=$optarg"
325 ;;
326 --silent | --sil* | --quiet | --q*)
327 redirect=">/dev/null"
328 verbose=--silent
329 ;;
330 --site* | --sit*)
331 site=$optarg
332 site_option="--site=$optarg"
333 ;;
334 --srcdir*/ | --sr*/)
335 # Remove trailing slashes. Otherwise, when the file name gets
336 # bolted into an object file as debug info, it has two slashes
337 # in it. Ordinarily this is ok, but emacs takes double slash
338 # to mean "forget the first part".
339 srcdir=`echo $optarg | sed -e 's:/$::'`
340 ;;
341 --srcdir* | --sr*)
342 srcdir=$optarg
343 ;;
344 --sy*)
345 sysconfdir=$optarg
346 diroptions="$diroptions --sysconfdir=$optarg"
347 ;;
348 --target* | --ta*)
349 case $target_alias in
350 NOTARGET) target_alias=$optarg ;;
351 *) echo '***' Can only configure for one target at a time. 1>&2
352 fatal=yes
353 ;;
354 esac
355 ;;
356 --tmpdir* | --tm*)
357 TMPDIR=$optarg
358 tmpdiroption="--tmpdir=$optarg"
359 ;;
360 --verbose | --v | --verb*)
361 redirect=
362 verbose=--verbose
363 ;;
364 --version | --V | --vers*)
365 echo "This is Cygnus Configure version" `echo ${version} | sed 's/[ $:]//g'`
366 exit 0
367 ;;
368 --with-*)
369 case "$option" in
370 *=*) ;;
371 *) optarg=yes ;;
372 esac
373
374 withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
ba73c63f 375 eval $withopt="\$optarg"
252b5132
RH
376 withoptions="$withoptions $option"
377 ;;
378 --without-*)
379 withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'`
380 eval $withopt=no
381 withoutoptions="$withoutoptions $option"
382 ;;
383 --x) with_x=yes
384 withoptions="$withoptions --with-x"
385 ;;
386 --x-i* | --x-l*) other_options="$other_options $orig_option"
387 ;;
388 --*)
389 echo "configure: Unrecognized option: \"$orig_option\"; use --help for usage." >&2
390 exit 1
391 ;;
392 *)
393 case $undefs in
394 NOUNDEFS) undefs=$option ;;
395 *) echo '***' Can only configure for one host and one target at a time. 1>&2
396 fatal=yes
397 ;;
398 esac
399 ;;
400 esac
401done
402
403# process host and target
404
405# Do some error checking and defaulting for the host and target type.
406# The inputs are:
407# configure --host=HOST --target=TARGET UNDEFS
408#
409# The rules are:
410# 1. You aren't allowed to specify --host, --target, and undefs at the
411# same time.
412# 2. Host defaults to undefs.
413# 3. If undefs is not specified, then host defaults to the current host,
414# as determined by config.guess.
415# 4. Target defaults to undefs.
416# 5. If undefs is not specified, then target defaults to host.
417
418case "${fatal}" in
419"")
420 # Make sure that host, target & undefs aren't all specified at the
421 # same time.
422 case $host_alias---$target_alias---$undefs in
423 NOHOST---*---* | *---NOTARGET---* | *---*---NOUNDEFS)
424 ;;
425 *) echo '***' Can only configure for one host and one target at a time. 1>&2
426 fatal=yes
427 break 2
428 ;;
429 esac
430
431 # Now, do defaulting for host.
432 case $host_alias in
433 NOHOST)
434 case $undefs in
435 NOUNDEFS)
436 # Neither --host option nor undefs were present.
437 # Call config.guess.
438 guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
439 if host_alias=`${config_shell} ${guesssys}`
440 then
441 # If the string we are going to use for
442 # the target is a prefix of the string
443 # we just guessed for the host, then
444 # assume we are running native, and force
445 # the same string for both target and host.
446 case $target_alias in
447 NOTARGET) ;;
448 *)
449 if expr $host_alias : $target_alias >/dev/null
450 then
451 host_alias=$target_alias
452 fi
453 ;;
454 esac
51221c5e 455 echo "Configuring for a ${host_alias} host."
252b5132
RH
456 arguments="--host=$host_alias $arguments"
457 else
458 echo 'Config.guess failed to determine the host type. You need to specify one.' 1>&2
459 fatal=yes
460 fi
461 ;;
462 *)
463 host_alias=$undefs
464 arguments="--host=$host_alias $arguments"
465 undefs=NOUNDEFS
466 ;;
467 esac
468 esac
469
470 # Do defaulting for target. If --target option isn't present, default
471 # to undefs. If undefs isn't present, default to host.
472 case $target_alias in
473 NOTARGET)
474 case $undefs in
475 NOUNDEFS)
476 target_alias=$host_alias
477 ;;
478 *)
479 target_alias=$undefs
480 arguments="--target=$target_alias $arguments"
481 ;;
482 esac
483 esac
484 ;;
485*) ;;
486esac
487
488if [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then
489 exec 1>&2
490 echo Usage: configure [OPTIONS] [HOST]
491 echo
492 echo Options: [defaults in brackets]
493 echo ' --prefix=MYDIR install into MYDIR [/usr/local]'
494 echo ' --exec-prefix=MYDIR install host-dependent files into MYDIR [/usr/local]'
495 echo ' --help print this message [normal config]'
496 echo ' --build=BUILD configure for building on BUILD [BUILD=HOST]'
497 echo ' --host=HOST configure for HOST [determined via config.guess]'
498 echo ' --norecursion configure this directory only [recurse]'
499 echo ' --program-prefix=FOO prepend FOO to installed program names [""]'
500 echo ' --program-suffix=FOO append FOO to installed program names [""]'
501 echo ' --program-transform-name=P transform installed names by sed pattern P [""]'
502 echo ' --site=SITE configure with site-specific makefile for SITE'
503 echo ' --srcdir=DIR find the sources in DIR [. or ..]'
504 echo ' --target=TARGET configure for TARGET [TARGET=HOST]'
505 echo ' --tmpdir=TMPDIR create temporary files in TMPDIR [/tmp]'
506 echo ' --nfp configure for software floating point [hard float]'
507 echo ' --with-FOO, --with-FOO=BAR package FOO is available (parameter BAR)'
508 echo ' --without-FOO package FOO is NOT available'
509 echo ' --enable-FOO, --enable-FOO=BAR include feature FOO (parameter BAR)'
510 echo ' --disable-FOO do not include feature FOO'
511 echo
512 echo 'Where HOST and TARGET are something like "sparc-sunos", "mips-sgi-irix5", etc.'
513 echo
514 if [ -r config.status ] ; then
515 cat config.status
516 fi
517
518 exit 1
519fi
520
521configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
522moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
25c6c112 523## the sed command below emulates the dirname command
d5de0a84 524topsrcdir=`cd \`echo ${progname} | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'\`; ${PWDCMD-pwd}`
252b5132
RH
525
526
527# this is a hack. sun4 must always be a valid host alias or this will fail.
528if ${config_shell} ${configsub} sun4 >/dev/null 2>&1 ; then
529 true
530else
531 echo '***' cannot find config.sub. 1>&2
532 exit 1
533fi
534
535touch config.junk
536if ${config_shell} ${moveifchange} config.junk config.trash ; then
537 true
538else
539 echo '***' cannot find move-if-change. 1>&2
540 exit 1
541fi
542rm -f config.junk config.trash
543
544case "${srcdir}" in
545"")
546 if [ -r configure.in ] ; then
547 srcdir=.
548 else
549 if [ -r ${progname}.in ] ; then
550 srcdir=`echo ${progname} | sed 's:/configure$::'`
551 else
552 echo '***' "Can't find configure.in. Try using --srcdir=some_dir" 1>&2
553 exit 1
554 fi
555 fi
556 ;;
557*)
558 # Set srcdir to "." if that's what it is.
559 # This is important for multilib support.
560 if [ ! -d ${srcdir} ] ; then
561 echo "Invalid source directory ${srcdir}" >&2
562 exit 1
563 fi
d5de0a84
NC
564 pwd=`${PWDCMD-pwd}`
565 srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}`
252b5132
RH
566 if [ "${pwd}" = "${srcpwd}" ] ; then
567 srcdir=.
568 fi
569esac
570
571### warn about some conflicting configurations.
572
573case "${srcdir}" in
574".") ;;
575*)
576 if [ -f ${srcdir}/config.status ] ; then
d5de0a84 577 echo '***' Cannot configure here in \"${PWD=`${PWDCMD-pwd}`}\" when \"${srcdir}\" is currently configured. 1>&2
252b5132
RH
578 exit 1
579 fi
580esac
581
252b5132
RH
582# default exec_prefix
583case "${exec_prefixoption}" in
584"") exec_prefix="\$(prefix)" ;;
585*) ;;
586esac
587
252b5132
RH
588### break up ${srcdir}/configure.in.
589case "`grep '^# per\-host:' ${srcdir}/configure.in`" in
590"")
591 echo '***' ${srcdir}/configure.in has no \"per-host:\" line. 1>&2
592 # Check for a directory that's been converted to use autoconf since
593 # it was last configured.
594 if grep AC_OUTPUT ${srcdir}/configure.in >/dev/null ; then
595 echo '***' Hmm, looks like this directory has been autoconfiscated. 1>&2
596 if [ -r ${srcdir}/configure ] ; then
597 echo '***' Running the local configure script. 1>&2
598 case "${cache_file}" in
599 "") cache_file_option= ;;
600 *) cache_file_option="--cache-file=${cache_file}" ;;
601 esac
602 srcdiroption="--srcdir=${srcdir}"
603 case "${build_alias}" in
604 "") buildopt= ;;
605 *) buildopt="--build=${build_alias}" ;;
606 esac
607 eval exec ${config_shell} ${srcdir}/configure ${verbose} \
608 ${buildopt} --host=${host_alias} --target=${target_alias} \
609 ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
610 ${srcdiroption} ${diroptions} \
611 ${program_prefixoption} ${program_suffixoption} \
612 ${program_transform_nameoption} ${site_option} \
613 ${withoptions} ${withoutoptions} \
614 ${enableoptions} ${disableoptions} ${floating_pointoption} \
852e5f18 615 ${cache_file_option} ${other_options} ${redirect}
252b5132
RH
616 else
617 echo '***' There is no configure script present though. 1>&2
618 fi
619 fi
620 exit 1
621 ;;
622*) ;;
623esac
624
625case "`grep '^# per\-target:' ${srcdir}/configure.in`" in
626"")
627 echo '***' ${srcdir}/configure.in has no \"per-target:\" line. 1>&2
628 exit 1
629 ;;
630*) ;;
631esac
632
633case "${TMPDIR}" in
634"") TMPDIR=/tmp ; export TMPDIR ;;
635*) ;;
636esac
637
6ca3858e 638# keep this filename short for &%*%$*# 14 char file names and 8+3 file names
75205f78
DD
639tmpdir=${TMPDIR}/cNf$$
640mkdir ${tmpdir} || exit 1
641tmpfile=${tmpdir}/cNf$$
252b5132
RH
642# Note that under many versions of sh a trap handler for 0 will *override* any
643# exit status you explicitly specify! At this point, the only non-error exit
644# is at the end of the script; these actions are duplicated there, minus
645# the "exit 1". Don't use "exit 0" anywhere after this without resetting the
646# trap handler, or you'll lose.
75205f78 647trap "rm -rf Makefile.tem ${tmpdir}; exit 1" 0 1 2 15
252b5132
RH
648
649# split ${srcdir}/configure.in into common, per-host, per-target,
650# and post-target parts. Post-target is optional.
651sed -e '/^# per\-host:/,$d' ${srcdir}/configure.in > ${tmpfile}.com
652sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.hst
653if grep '^# post-target:' ${srcdir}/configure.in >/dev/null ; then
654 sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.tgt
655 sed -e '1,/^# post\-target:/d' ${srcdir}/configure.in > ${tmpfile}.pos
656else
657 sed -e '1,/^# per\-target:/d' ${srcdir}/configure.in > ${tmpfile}.tgt
658 echo >${tmpfile}.pos
659fi
660
661### do common part of configure.in
662
252b5132
RH
663. ${tmpfile}.com
664
252b5132
RH
665# some sanity checks on configure.in
666case "${srctrigger}" in
667"")
d5de0a84 668 echo '***' srctrigger not set in ${PWD=`${PWDCMD-pwd}`}/configure.in. 1>&2
252b5132
RH
669 exit 1
670 ;;
671*) ;;
672esac
673
674case "${build_alias}" in
675"")
676 if result=`${config_shell} ${configsub} ${host_alias}` ; then
677 build_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
678 build_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
679 build_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
680 build=${build_cpu}-${build_vendor}-${build_os}
681 build_alias=${host_alias}
682 fi
683 ;;
684*)
685 if result=`${config_shell} ${configsub} ${build_alias}` ; then
686 buildopt="--build=${build_alias}"
687 build_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
688 build_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
689 build_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
690 build=${build_cpu}-${build_vendor}-${build_os}
691 else
692 echo "Unrecognized build system name ${build_alias}." 1>&2
693 exit 1
694 fi
695 ;;
696esac
697
698if result=`${config_shell} ${configsub} ${host_alias}` ; then
699 true
700else
701 echo "Unrecognized host system name ${host_alias}." 1>&2
702 exit 1
703fi
704host_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
705host_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
706host_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
707host=${host_cpu}-${host_vendor}-${host_os}
708
709. ${tmpfile}.hst
710
711if result=`${config_shell} ${configsub} ${target_alias}` ; then
712 true
713else
714 echo "Unrecognized target system name ${target_alias}." 1>&2
715 exit 1
716fi
717target_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
718target_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
719target_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
720target=${target_cpu}-${target_vendor}-${target_os}
721
722. ${tmpfile}.tgt
723
724# Find the source files, if location was not specified.
725case "${srcdir}" in
726"")
727 srcdirdefaulted=1
728 srcdir=.
729 if [ ! -r ${srctrigger} ] ; then
730 srcdir=..
731 fi
732 ;;
733*) ;;
734esac
735
736if [ ! -r ${srcdir}/${srctrigger} ] ; then
737 case "${srcdirdefaulted}" in
d5de0a84
NC
738 "") echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`${PWDCMD-pwd}`}/${srcdir}" 1>&2 ;;
739 *) echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`${PWDCMD-pwd}`}/. or ${PWD=`${PWDCMD-pwd}`}/.." 1>&2 ;;
252b5132
RH
740 esac
741
742 echo '***' \(At least ${srctrigger} is missing.\) 1>&2
743 exit 1
744fi
745
746# Some systems (e.g., one of the i386-aix systems the gas testers are
747# using) don't handle "\$" correctly, so don't use it here.
748tooldir='$(exec_prefix)'/${target_alias}
749
750if [ "${host_alias}" != "${target_alias}" ] ; then
751 if [ "${program_prefixoption}" = "" ] ; then
752 if [ "${program_suffixoption}" = "" ] ; then
753 if [ "${program_transform_nameoption}" = "" ] ; then
754 program_prefix=${target_alias}- ;
755 fi
756 fi
757 fi
758fi
759
760# Merge program_prefix and program_suffix onto program_transform_name.
761# (program_suffix used to use $, but it's hard to preserve $ through both
762# make and sh.)
763if [ "${program_suffix}" != "" ] ; then
764 program_transform_name="-e s,\\\\(.*\\\\),\\\\1${program_suffix}, ${program_transform_name}"
765fi
766
767if [ "${program_prefix}" != "" ] ; then
768 program_transform_name="-e s,^,${program_prefix}, ${program_transform_name}"
769fi
770
771# If CC and CXX are not set in the environment, and the Makefile
772# exists, try to extract them from it. This is to handle running
773# ./config.status by hand.
774if [ -z "${CC}" ] && [ -r Makefile ]; then
775 sed -n -e ':loop
776/\\$/ N
777s/\\\n//g
778t loop
779/^CC[ ]*=/ s/CC[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc
780 CC=`tail -1 Makefile.cc`
781 rm -f Makefile.cc
782fi
783
784if [ -z "${CFLAGS}" ] && [ -r Makefile ]; then
785 sed -n -e ':loop
786/\\$/ N
787s/\\\n//g
788t loop
789/^CFLAGS[ ]*=/ s/CFLAGS[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc
790 CFLAGS=`tail -1 Makefile.cc`
791 rm -f Makefile.cc
792fi
793
794if [ -z "${CXX}" ] && [ -r Makefile ]; then
795 sed -n -e ':loop
796/\\$/ N
797s/\\\n//g
798t loop
799/^CXX[ ]*=/ s/CXX[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc
800 CXX=`tail -1 Makefile.cc`
801 rm -f Makefile.cc
802fi
803
804if [ -z "${CXXFLAGS}" ] && [ -r Makefile ]; then
805 sed -n -e ':loop
806/\\$/ N
807s/\\\n//g
808t loop
809/^CXXFLAGS[ ]*=/ s/CXXFLAGS[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc
810 CXXFLAGS=`tail -1 Makefile.cc`
811 rm -f Makefile.cc
812fi
813
814# Generate a default definition for YACC. This is used if the makefile can't
815# locate bison or byacc in objdir.
816
817for prog in 'bison -y' byacc yacc
818do
819 set dummy $prog; tmp=$2
820 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
821 for dir in $PATH; do
822 test -z "$dir" && dir=.
823 if test -f $dir/$tmp; then
824 DEFAULT_YACC="$prog"
825 break
826 fi
827 done
828 IFS="$save_ifs"
829
830 test -n "$DEFAULT_YACC" && break
831done
832
833# Generate a default definition for M4. This is used if the makefile can't
834# locate m4 in objdir.
835
836for prog in gm4 gnum4 m4
837do
838 set dummy $prog; tmp=$2
839 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
840 for dir in $PATH; do
841 test -z "$dir" && dir=.
842 if test -f $dir/$tmp; then
843 DEFAULT_M4="$prog"
844 break
845 fi
846 done
847 IFS="$save_ifs"
848
849 test -n "$DEFAULT_M4" && break
850done
851
852# Generate a default definition for LEX. This is used if the makefile can't
853# locate flex in objdir.
854
855for prog in flex lex
856do
857 set dummy $prog; tmp=$2
858 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
859 for dir in $PATH; do
860 test -z "$dir" && dir=.
861 if test -f $dir/$tmp; then
862 DEFAULT_LEX="$prog"
863 break
864 fi
865 done
866 IFS="$save_ifs"
867
868 test -n "$DEFAULT_LEX" && break
869done
870
852e5f18 871
c567df0a
NN
872tools="AR AR_FOR_TARGET AS AS_FOR_TARGET BISON CC_FOR_BUILD"
873tools="${tools} DLLTOOL DLLTOOL_FOR_TARGET GCC_FOR_TARGET BUILD_PREFIX"
874tools="${tools} BUILD_PREFIX_1 LD LD_FOR_TARGET LEX MAKEINFO NM"
875tools="${tools} NM_FOR_TARGET RANLIB RANLIB_FOR_TARGET"
876tools="${tools} WINDRES WINDRES_FOR_TARGET YACC"
877tools="${tools} OBJCOPY OBJDUMP"
252b5132
RH
878if [ "${build}" != "${host}" ]; then
879 # If we are doing a Canadian Cross, in which the host and build systems
880 # are not the same, we set reasonable default values for the tools.
c567df0a 881 tools="${tools} RANLIB"
252b5132
RH
882
883 for var in ${tools}; do
ba73c63f 884 if eval [ -z \"\$${var}\" ] && [ -r Makefile ]; then
252b5132
RH
885 sed -n -e ':loop
886/\\$/ N
887s/\\\n//g
888t loop
889/^'"${var}"'[ ]*=/ s/'"${var}"'[ ]*=[ ]*\(.*\)/\1/p' \
890 < Makefile > Makefile.v
891 t=`tail -1 Makefile.v`
892 if [ -n "${t}" ]; then
ba73c63f 893 eval "${var}=\${t}"
252b5132
RH
894 fi
895 rm -f Makefile.v
896 fi
897 done
898
899 AR=${AR-${host_alias}-ar}
900 AR_FOR_TARGET=${AR_FOR_TARGET-${target_alias}-ar}
874e38b4 901 AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
252b5132
RH
902 AS=${AS-${host_alias}-as}
903 AS_FOR_TARGET=${AS_FOR_TARGET-${target_alias}-as}
904 BISON=${BISON-bison}
905 CC=${CC-${host_alias}-gcc}
a2d91340 906 CFLAGS=${CFLAGS-"-g -O2"}
252b5132
RH
907 CXX=${CXX-${host_alias}-c++}
908 CXXFLAGS=${CXXFLAGS-"-g -O2"}
909 CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
910 CC_FOR_TARGET=${CC_FOR_TARGET-${target_alias}-gcc}
911 CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++}
75205f78 912 GCJ_FOR_TARGET=${GCJ_FOR_TARGET-${target_alias}-gcj}
252b5132
RH
913 DLLTOOL=${DLLTOOL-${host_alias}-dlltool}
914 DLLTOOL_FOR_TARGET=${DLLTOOL_FOR_TARGET-${target_alias}-dlltool}
915 GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}}
27f15fdd
DD
916 BUILD_PREFIX=${build_alias}-
917 BUILD_PREFIX_1=${build_alias}-
252b5132
RH
918 LD=${LD-${host_alias}-ld}
919 LD_FOR_TARGET=${LD_FOR_TARGET-${target_alias}-ld}
920 MAKEINFO=${MAKEINFO-makeinfo}
921 NM=${NM-${host_alias}-nm}
922 NM_FOR_TARGET=${NM_FOR_TARGET-${target_alias}-nm}
874e38b4 923 NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
252b5132
RH
924 RANLIB=${RANLIB-${host_alias}-ranlib}
925 RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET-${target_alias}-ranlib}
926 WINDRES=${WINDRES-${host_alias}-windres}
927 WINDRES_FOR_TARGET=${WINDRES_FOR_TARGET-${target_alias}-windres}
ba73c63f
JM
928 OBJCOPY=${OBJCOPY-${host_alias}-objcopy}
929 OBJDUMP=${OBJDUMP-${host_alias}-objdump}
252b5132
RH
930
931 if [ -z "${YACC}" ]; then
932 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
933 for dir in $PATH; do
934 test -z "$dir" && dir=.
935 if test -f $dir/bison; then
936 YACC="bison -y"
937 break
938 fi
939 if test -f $dir/byacc; then
940 YACC=byacc
941 break
942 fi
943 if test -f $dir/yacc; then
944 YACC=yacc
945 break
946 fi
947 done
948 IFS="$save_ifs"
949 if [ -z "${YACC}" ]; then
950 YACC="bison -y"
951 fi
952 fi
953
954 if [ -z "${LEX}" ]; then
955 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
956 for dir in $PATH; do
957 test -z "$dir" && dir=.
958 if test -f $dir/flex; then
959 LEX=flex
960 break
961 fi
962 if test -f $dir/lex; then
963 LEX=lex
964 break
965 fi
966 done
967 IFS="$save_ifs"
968 LEX=${LEX-flex}
969 fi
970
252b5132 971else
852e5f18
NN
972 # Set reasonable default values for some tools even if not Canadian.
973 # Of course, these are different reasonable default values, originally
974 # specified directly in the Makefile.
975 # We don't export, so that autoconf can do its job.
976 # Note that all these settings are above the fragment inclusion point
977 # in Makefile.in, so can still be overridden by fragments.
978 # This is all going to change when we autoconfiscate...
979
852e5f18
NN
980 AR=ar
981 AR_FOR_TARGET='\$(USUAL_AR_FOR_TARGET)'
874e38b4 982 AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
852e5f18
NN
983 AS=as
984 AS_FOR_TARGET='\$(USUAL_AS_FOR_TARGET)'
985 BISON='$(USUAL_BISON)'
986 CC_FOR_BUILD='\$(CC)'
987 DLLTOOL=dlltool
988 DLLTOOL_FOR_TARGET='\$(USUAL_DLLTOOL_FOR_TARGET)'
989 GCC_FOR_TARGET='\$(USUAL_GCC_FOR_TARGET)'
990 BUILD_PREFIX=
991 BUILD_PREFIX_1=loser-
992 LD=ld
993 LD_FOR_TARGET='\$(USUAL_LD_FOR_TARGET)'
994 MAKEINFO='\$(USUAL_MAKEINFO)'
995 NM=nm
996 NM_FOR_TARGET='\$(USUAL_NM_FOR_TARGET)'
874e38b4 997 NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
852e5f18 998 RANLIB_FOR_TARGET='\$(USUAL_RANLIB_FOR_TARGET)'
1086bc09 999 RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
852e5f18
NN
1000 WINDRES=windres
1001 WINDRES_FOR_TARGET='\$(USUAL_WINDRES_FOR_TARGET)'
1002 LEX='\$(USUAL_LEX)'
1003 YACC='\$(USUAL_YACC)'
1004
252b5132
RH
1005 # If CC is still not set, try to get gcc.
1006 if [ -z "${CC}" ]; then
1007 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
1008 for dir in $PATH; do
1009 test -z "$dir" && dir=.
1010 if test -f $dir/gcc; then
1011 CC="gcc"
1012 echo 'void f(){}' > conftest.c
1013 if test -z "`${CC} -g -c conftest.c 2>&1`"; then
a2d91340 1014 CFLAGS=${CFLAGS-"-g -O2"}
252b5132
RH
1015 CXXFLAGS=${CXXFLAGS-"-g -O2"}
1016 else
a2d91340 1017 CFLAGS=${CFLAGS-"-O2"}
252b5132
RH
1018 CXXFLAGS=${CXXFLAGS-"-O2"}
1019 fi
1020 rm -f conftest*
1021 break
1022 fi
1023 done
1024 IFS="$save_ifs"
1025 CC=${CC-cc}
1026 else
1027 if test -z "${CFLAGS}"; then
1028 # Here CC is set but CFLAGS is not. Use a quick hack to use -O2 if CC
1029 # is set to a version of gcc.
1030 case "${CC}" in
1031 *gcc)
1032 echo 'void f(){}' > conftest.c
1033 if test -z "`${CC} -g -c conftest.c 2>&1`"; then
a2d91340 1034 CFLAGS=${CFLAGS-"-g -O2"}
252b5132
RH
1035 CXXFLAGS=${CXXFLAGS-"-g -O2"}
1036 else
a2d91340 1037 CFLAGS=${CFLAGS-"-O2"}
252b5132
RH
1038 CXXFLAGS=${CXXFLAGS-"-O2"}
1039 fi
1040 rm -f conftest*
1041 ;;
1042 esac
1043 fi
1044 fi
1045
1046 CXX=${CXX-"c++"}
1047 CFLAGS=${CFLAGS-"-g"}
1048 CXXFLAGS=${CXXFLAGS-"-g -O2"}
1049fi
1050
852e5f18
NN
1051# FIXME Should this be done recursively ??? (Useful for e.g. gdbtest)
1052# Set up the list of links to be made.
1053# ${links} is the list of link names, and ${files} is the list of names to link to.
c11e16a9 1054
852e5f18
NN
1055# Make the links.
1056configlinks="${links}"
1057if [ -r ./config.status ] ; then
1058 mv -f ./config.status ./config.back
1059fi
1060while [ -n "${files}" ] ; do
1061 # set file to car of files, files to cdr of files
1062 set ${files}; file=$1; shift; files=$*
1063 set ${links}; link=$1; shift; links=$*
1064
1065 if [ ! -r ${srcdir}/${file} ] ; then
1066 if [ ! -r ${file} ] ; then
1067 echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
1068 echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2
1069 exit 1
1070 else
1071 srcfile=${file}
c11e16a9 1072 fi
852e5f18
NN
1073 else
1074 srcfile=${srcdir}/${file}
1075 fi
c11e16a9 1076
852e5f18
NN
1077 ${remove} -f ${link}
1078 # Make a symlink if possible, otherwise try a hard link
1079 if ${symbolic_link} ${srcfile} ${link} >/dev/null 2>&1 ; then
1080 true
1081 else
1082 # We need to re-remove the file because Lynx leaves a
1083 # very strange directory there when it fails an NFS symlink.
1084 ${remove} -r -f ${link}
1085 ${hard_link} ${srcfile} ${link}
1086 fi
1087 if [ ! -r ${link} ] ; then
1088 echo '***' "${progname}: unable to link \"${link}\" to \"${srcfile}\"." 1>&2
1089 exit 1
1090 fi
252b5132 1091
852e5f18
NN
1092 echo "Linked \"${link}\" to \"${srcfile}\"."
1093done
252b5132 1094
852e5f18
NN
1095# Create a .gdbinit file which runs the one in srcdir
1096# and tells GDB to look there for source files.
252b5132 1097
852e5f18
NN
1098if [ -r ${srcdir}/.gdbinit ] ; then
1099 case ${srcdir} in
1100 .) ;;
1101 *) cat > ./.gdbinit <<EOF
252b5132 1102# ${NO_EDIT}
852e5f18 1103dir ${srcdir}
252b5132 1104dir .
852e5f18 1105source ${srcdir}/.gdbinit
252b5132 1106EOF
852e5f18
NN
1107 ;;
1108 esac
1109fi
1110
1111# Install a makefile, and make it set VPATH
1112# if necessary so that the sources are found.
1113# Also change its value of srcdir.
1114# NOTE: Makefile generation constitutes the majority of the time in configure. Hence, this section has
1115# been somewhat optimized and is perhaps a bit twisty.
1116
1117# code is order so as to try to sed the smallest input files we know.
1118# so do these separately because I don't trust the order of sed -e expressions.
1119
1120# the five makefile fragments MUST end up in the resulting Makefile in this order:
1121# package macros, target, host, site, and package rules.
1122
1123if [ -f ${srcdir}/${Makefile_in} ] ; then
252b5132 1124
852e5f18
NN
1125 # Conditionalize the makefile for this package from "Makefile.in" (or whatever it's called) into Makefile.tem.
1126 rm -f ./${Makefile}.tem
1127 case "${package_makefile_rules_frag}" in
1128 "") cp ${srcdir}/${Makefile_in} ./Makefile.tem ;;
1129 *)
1130 if [ ! -f ${package_makefile_rules_frag} ] ; then
1131 package_makefile_rules_frag=${srcdir}/${package_makefile_rules_frag}
1132 fi
1133 if [ -f ${package_makefile_rules_frag} ] ; then
1134 sed -e "/^####/ r ${package_makefile_rules_frag}" ${srcdir}/${Makefile_in} > ${Makefile}.tem
1135 else
1136 echo '***' Expected package makefile rules fragment \"${package_makefile_rules_frag}\" 1>&2
1137 echo '***' is missing in ${PWD=`${PWDCMD-pwd}`}. 1>&2
1138 cp ${srcdir}/${Makefile_in} ./Makefile.tem
1139 fi
1140 esac
1141 # working copy now in ${Makefile}.tem
1142
1143 # Conditionalize for this site.
1144 rm -f ${Makefile}
1145 case "${site}" in
1146 "") mv ./Makefile.tem ${Makefile} ;;
1147 *)
1148 site_makefile_frag=${srcdir}/config/ms-${site}
1149
1150 if [ -f ${site_makefile_frag} ] ; then
1151 sed -e "/^####/ r ${site_makefile_frag}" ./Makefile.tem > ${Makefile}
1152 else
1153 mv ./Makefile.tem ${Makefile}
1154 site_makefile_frag=
1155 fi
1156 ;;
1157 esac
1158 # working copy now in ${Makefile}
1159
1160 # Conditionalize the makefile for this host.
1161 rm -f ./Makefile.tem
1162 case "${host_makefile_frag}" in
1163 "") mv ${Makefile} ./Makefile.tem ;;
1164 *)
1165 if [ ! -f ${host_makefile_frag} ] ; then
1166 host_makefile_frag=${srcdir}/${host_makefile_frag}
1167 fi
1168 if [ -f ${host_makefile_frag} ] ; then
1169 sed -e "/^####/ r ${host_makefile_frag}" ${Makefile} > ./Makefile.tem
1170 else
1171 echo '***' Expected host makefile fragment \"${host_makefile_frag}\" 1>&2
1172 echo '***' is missing in ${PWD=`${PWDCMD-pwd}`}. 1>&2
1173 mv ${Makefile} ./Makefile.tem
1174 fi
1175 esac
1176 # working copy now in ./Makefile.tem
1177
1178 # Conditionalize the makefile for this target.
1179 rm -f ${Makefile}
1180 case "${target_makefile_frag}" in
1181 "") mv ./Makefile.tem ${Makefile} ;;
1182 *)
1183 if [ ! -f ${target_makefile_frag} ] ; then
1184 target_makefile_frag=${srcdir}/${target_makefile_frag}
1185 fi
1186 if [ -f ${target_makefile_frag} ] ; then
1187 sed -e "/^####/ r ${target_makefile_frag}" ./Makefile.tem > ${Makefile}
1188 else
1189 mv ./Makefile.tem ${Makefile}
1190 target_makefile_frag=
1191 fi
1192 ;;
1193 esac
1194 # working copy now in ${Makefile}
1195
1196 # Emit the default values of this package's macros.
1197 rm -f ./Makefile.tem
1198 case "${package_makefile_frag}" in
1199 "") mv ${Makefile} ./Makefile.tem ;;
1200 *)
1201 if [ ! -f ${package_makefile_frag} ] ; then
1202 package_makefile_frag=${srcdir}/${package_makefile_frag}
1203 fi
1204 if [ -f ${package_makefile_frag} ] ; then
1205 sed -e "/^####/ r ${package_makefile_frag}" ${Makefile} > ./Makefile.tem
1206 else
1207 echo '***' Expected package makefile fragment \"${package_makefile_rules_frag}\" 1>&2
1208 echo '***' is missing in ${PWD=`${PWDCMD-pwd}`}. 1>&2
1209 mv ${Makefile} ./Makefile.tem
1210 fi
1211 esac
1212 # real copy now in ./Makefile.tem
1213
583d52d7
NN
1214 # record if we want runtime library stuff installed in libsubdir.
1215 # Blank means no.
852e5f18 1216 if test -z "${enable_version_specific_runtime_libs}"; then
583d52d7 1217 enable_version_specific_runtime_libs=no
852e5f18 1218 fi
252b5132 1219
583d52d7
NN
1220 sed -e "s|@configlinks@|${configlinks}|" \
1221 -e "s|@build_alias@|${build_alias}|" \
1222 -e "s|@build_cpu@|${build_cpu}|" \
1223 -e "s|@build_vendor@|${build_vendor}|" \
1224 -e "s|@build_os@|${build_os}|" \
1225 -e "s|@host_alias@|${host_alias}|" \
1226 -e "s|@host_cpu@|${host_cpu}|" \
1227 -e "s|@host_vendor@|${host_vendor}|" \
1228 -e "s|@host_os@|${host_os}|" \
1229 -e "s|@target_alias@|${target_alias}|" \
1230 -e "s|@target_cpu@|${target_cpu}|" \
1231 -e "s|@target_vendor@|${target_vendor}|" \
1232 -e "s|@target_os@|${target_os}|" \
1233 -e "s|@target_makefile_frag@|${target_makefile_frag}|" \
1234 -e "s|@host_makefile_frag@|${host_makefile_frag}|" \
1235 -e "s|@enable_shared@|${enable_shared}|" \
1236 -e "s|@enable_threads@|${enable_threads}|" \
1237 -e "s|@enable_version_specific_runtime_libs@|${enable_version_specific_runtime_libs}|" \
1238 -e "s|@gcc_version_trigger@|${gcc_version_trigger}|" \
1239 -e "s|@gcc_version@|${gcc_version}|" \
1240 ./Makefile.tem > ${Makefile}
1241 mv -f ${Makefile} ./Makefile.tem
1242 # Real copy now in Makefile.tem; no prologue.
852e5f18
NN
1243
1244 # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
1245 # remove any form feeds.
583d52d7
NN
1246 sed -e "s|@configdirs@|${configdirs}|" \
1247 -e "s|@prefix@|${prefix}|" \
852e5f18
NN
1248 -e "s|@exec_prefix@|${exec_prefix}|" \
1249 -e "s|@bindir@|${bindir}|" \
1250 -e "s|@sbindir@|${sbindir}|" \
1251 -e "s|@libexecdir@|${libexecdir}|" \
1252 -e "s|@datadir@|${datadir}|" \
1253 -e "s|@sysconfdir@|${sysconfdir}|" \
1254 -e "s|@sharedstatedir@|${sharedstatedir}|" \
1255 -e "s|@localstatedir@|${localstatedir}|" \
1256 -e "s|@libdir@|${libdir}|" \
1257 -e "s|@includedir@|${includedir}|" \
1258 -e "s|@oldincludedir@|${oldincludedir}|" \
1259 -e "s|@infodir@|${infodir}|" \
1260 -e "s|@mandir@|${mandir}|" \
d03be79e
NN
1261 -e "s|@CC@|${CC}|" \
1262 -e "s|@CXX@|${CXX}|" \
929293f4 1263 -e "s|@CFLAGS@|${CFLAGS}|" \
d03be79e 1264 -e "s|@CXXFLAGS@|${CXXFLAGS}|" \
852e5f18
NN
1265 -e "s|@config_shell@|${config_shell}|" \
1266 -e "s|@srcdir@|${srcdir}|" \
1267 -e "s/\f//" \
1268 -e "s:@program_transform_name@:${program_transform_name}:" \
1269 -e "s|@tooldir@|${tooldir}|" \
1270 -e "s|@build_tooldir@|${tooldir}|" \
1271 -e "s:@DEFAULT_YACC@:${DEFAULT_YACC}:" \
1272 -e "s:@DEFAULT_LEX@:${DEFAULT_LEX}:" \
1273 -e "s:@DEFAULT_M4@:${DEFAULT_M4}:" \
583d52d7 1274 ./Makefile.tem > ${Makefile}
852e5f18
NN
1275
1276 # If this is a Canadian Cross, preset the values of many more
1277 # tools.
1278 if [ "${build}" != "${host}" ]; then
1279 for var in ${tools}; do
1280 eval val=\$${var}
1281 sed -e "/^${var}[ ]*=/{
1282 :loop1
1283 /\\\\$/ N
1284 /\\\\$/ b loop1
1285 s/\\\\\\n//g
1286 s%^${var}[ ]*=.*$%${var} = ${val}%
1287 }" ${Makefile} > ${Makefile}.tem
1288 mv -f ${Makefile}.tem ${Makefile}
1289 done
1290 fi
1291 # If this is NOT a Canadian Cross, preset the values of some more
1292 # tools. The above line should get merged into this, but this
1293 # substitutes *once* where the above substitutes *globally*; that
1294 # needs to be worked out before the merger. The issue is in Makefile
1295 # fragment elements (ick, yuck, ugh).
1296 if [ "${build}" = "${host}" ]; then
1297 for var in ${tools}; do
1298 eval val=\$${var}
1299 sed -e "s%@${var}@%${val}%" ${Makefile} > ${Makefile}.tem
1300 mv -f ${Makefile}.tem ${Makefile}
1301 done
1302 fi
252b5132 1303
852e5f18 1304 # final copy now in ${Makefile}
252b5132 1305
852e5f18
NN
1306else
1307 echo "No Makefile.in found in ${srcdir}/., unable to configure" 1>&2
1308fi
252b5132 1309
852e5f18 1310rm -f ./Makefile.tem
252b5132 1311
852e5f18
NN
1312case "${host_makefile_frag}" in
1313 "") using= ;;
1314 *) using="and \"${host_makefile_frag}\"" ;;
1315esac
252b5132 1316
852e5f18
NN
1317case "${target_makefile_frag}" in
1318 "") ;;
1319 *) using="${using} and \"${target_makefile_frag}\"" ;;
1320esac
252b5132 1321
852e5f18
NN
1322case "${site_makefile_frag}" in
1323 "") ;;
1324 *) using="${using} and \"${site_makefile_frag}\"" ;;
1325esac
252b5132 1326
852e5f18
NN
1327newusing=`echo "${using}" | sed 's/and/using/'`
1328using=${newusing}
1329echo "Created \"${Makefile}\" in" ${PWD=`${PWDCMD-pwd}`} ${using}
252b5132 1330
852e5f18 1331. ${tmpfile}.pos
252b5132 1332
852e5f18
NN
1333# describe the chosen configuration in config.status.
1334# Make that file a shellscript which will reestablish
1335# the same configuration. Used in Makefiles to rebuild
1336# Makefiles.
252b5132 1337
852e5f18
NN
1338case "${norecursion}" in
1339 "") arguments="${arguments} --norecursion" ;;
1340 *) ;;
1341esac
252b5132 1342
852e5f18 1343echo "#!/bin/sh
c11e16a9
NN
1344# ${NO_EDIT}
1345# This directory was configured as follows:
1346${progname}" ${arguments} "
852e5f18
NN
1347# ${using}" > ./config.new
1348chmod a+x ./config.new
1349if [ -r ./config.back ] ; then
1350 mv -f ./config.back ./config.status
1351fi
1352${config_shell} ${moveifchange} ./config.new ./config.status
252b5132 1353
252b5132
RH
1354# Perform the same cleanup as the trap handler, minus the "exit 1" of course,
1355# and reset the trap handler.
75205f78 1356rm -rf ${tmpdir}
252b5132
RH
1357trap 0
1358
1359exit 0
1360
1361#
1362# Local Variables:
1363# fill-column: 131
1364# End:
1365#
1366
1367# end of configure
This page took 0.194316 seconds and 4 git commands to generate.