2 # Please do not edit this file. It is generated automatically from
3 # configure.in and a configure template.
8 # Configuration script template
9 # Copyright (C) 1988, 1990, 1991 Free Software Foundation, Inc.
11 #This file is part of GNU.
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
30 # Shell script to create proper links to machine-dependent files in
31 # preparation for compilation.
33 # If configure succeeds, it leaves its status in config.status.
34 # If configure fails after disturbing the status quo,
35 # config.status is removed.
45 #symbolic_link="echo ln -s"
49 # clear some things potentially inherited from environment.
56 Makefile_in
=Makefile.
in
76 -destdir=* |
+destdir
=* |
+destdi
=* |
+destd
=* |
+dest
=* |
+des
=* |
+de
=* |
+d
=*)
77 destdir
=`echo ${arg} | sed 's/[+-]d[a-z]*=//'`
79 -languages=* |
+languages
=* |
+language
=* |
+languag
=* \
80 |
+langua
=* |
+langu
=* |
+lang
=* |
+lan
=* |
+la
=* \
82 languages
="${languages} `echo ${arg} | sed 's/[+-]l[a-z]*=//'`"
102 # -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*)
103 # srcdir=`echo ${arg} | sed 's/[+-]s[a-z]*=//'`
105 -subdirs |
+f
* |
+su
*)
108 -target=* |
+target
=* |
+targe
=* |
+targ
=* |
+tar=* |
+ta
=*)
109 if [ -n "${targets}" ] ; then
113 newtargets
="${targets} `echo ${arg} | sed 's/[+-]t[a-z]*=//'`"
114 targets
="${newtargets}"
116 -template=* |
+template
=* |
+templat
=* |
+templa
=* |
+templ
=* |
+temp
=* |
+tem
=* |
+te
=*)
117 template
=`echo ${arg} | sed 's/[+-]template=//'`
124 echo "Unrecognized option: \"${arg}\"".
;
129 if [ -n "${hosts}" ] ; then
133 newhosts
="${hosts} ${arg}"
139 if [ -n "${verbose}" ] ; then
140 echo `pwd`/configure $
*
143 # process host and target only if not rebuilding configure itself or removing.
144 if [ -z "${template}" -a -z "${removing}" -a -z "${fatal}" ] ; then
145 # Complain if an arg is missing
146 if [ -z "${hosts}" ] ; then
148 echo "configure: No HOST specified." ;
154 if [ -n "${fatal}" -o "${hosts}" = "help" ] ; then
155 (echo "Usage: configure HOST" ;
157 echo "Options: [defaults in brackets]" ;
158 echo " +ansi configure w/ANSI library. [no ansi lib]" ;
159 echo " +destdir=MYDIR configure for installation into MYDIR. [/usr/local]" ;
160 echo " +subdirs configure in subdirectories. [in source directories]" ;
161 echo " +lang=LANG configure to build LANG. [gcc]" ;
162 echo " +help print this message. [normal config]" ;
163 echo " +gas configure the compilers for use with gas. [native as]" ;
164 echo " +nfp configure the compilers default to soft floating point. [hard float]" ;
165 echo " +norecurse configure this directory only. [recurse]" ;
166 echo " +rm remove this configuration. [build a configuration]" ;
167 echo " +target=TARGET configure for TARGET. [TARGET = HOST]" ;
168 echo " +template=TEM rebuild configure using TEM. [normal config]" ;
170 echo "Where HOST and TARGET are something like \"vax\", \"sun3\", \"encore\", etc." ;
171 echo "Asking for more than one \"+target\" implies \"+subdirs\". Any other" ;
172 echo "options given will apply to all targets.") 1>&2
174 if [ -r config.status
] ; then
181 #### configure.in common parts come in here.
182 # This file is a shell script that supplies the information necessary
183 # to tailor a template configure script into the configure script
184 # appropriate for this directory. For more information, check any
185 # existing configure script.
191 ## end of common part.
193 # are we rebuilding config itself?
194 if [ -n "${template}" ] ; then
195 if [ ! -r ${template} ] ; then
196 echo '***' "Can't find template ${template}." 1>&2
201 sed -e '/^#### configure.in common parts come in here.$/,/^## end of common part.$/c\
202 #### configure.in common parts come in here.\
203 ## end of common part.' \
204 -e '/^#### configure.in per-host parts come in here.$/,/^## end of per-host part.$/c\
205 #### configure.in per-host parts come in here.\
206 ## end of per-host part.' \
207 -e '/^#### configure.in per-target parts come in here.$/,/^## end of per-target part.$/c\
208 #### configure.in per-target parts come in here.\
209 ## end of per-target part.' \
210 -e '/^#### configure.in post-target parts come in here.$/,/^## end of post-target part.$/c\
211 #### configure.in post-target parts come in here.\
212 ## end of post-target part.' \
213 < ${template} > template.new
215 if [ -r configure.
in ] ; then
216 if [ -z "`grep '^# per\-host:' configure.in`" ] ; then
217 echo '***' `pwd`/configure.
in has no
"per-host:" line.
1>&2
221 if [ -z "`grep '^# per\-target:' configure.in`" ] ; then
222 echo '***' `pwd`/configure.
in has no
"per-target:" line.
1>&2
226 # split configure.in into common, per-host, per-target,
227 # and post-target parts. Post-target is optional.
228 sed -e '/^# per\-host:/,$d' configure.
in > configure.com
229 sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' configure.
in > configure.hst
230 if grep -s '^# post-target:' configure.
in ; then
231 sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' configure.
in > configure.tgt
232 sed -e '1,/^# post\-target:/d' configure.
in > configure.pos
234 sed -e '1,/^# per\-target:/d' configure.
in > configure.tgt
239 sed -e '/^#### configure.in common parts come in here.$/ r configure.com' \
240 -e '/^#### configure.in per\-host parts come in here.$/ r configure.hst' \
241 -e '/^#### configure.in per\-target parts come in here.$/ r configure.tgt' \
242 -e '/^#### configure.in post\-target parts come in here.$/ r configure.pos' \
243 template.new
> configure.new
245 rm -f configure.com configure.tgt configure.hst configure.pos
247 echo Warning
: no configure.
in in `pwd`
248 cat ${template} >> configure
251 chmod a
+x configure.new
253 # mv configure configure.old
254 mv configure.new configure
256 if [ -n "${verbose}" ] ; then
257 echo Rebuilt configure
in `pwd`
260 # Now update config.sub from the template directory.
261 if echo "$template" |
grep -s 'configure$' ; then
262 cp `echo "$template" | sed s/configure$/config.sub/` .
/config.sub.new
263 # mv config.sub config.sub.old
264 mv config.sub.new config.sub
266 if [ -n "${verbose}" ] ; then
267 echo Rebuilt config.sub
in `pwd`
271 if [ -z "${norecurse}" ] ; then
272 # If template is relative path, make it absolute for recursing.
273 if echo "${template}" |
grep -s '^/' ; then
276 template
=`pwd`/${template}
279 while [ -n "${configdirs}" ] ; do
280 # set configdir to car of configdirs, configdirs to cdr of configdirs
281 set ${configdirs}; configdir
=$1; shift; configdirs
=$
*
283 if [ "`echo ${configdir}.*`" != "${configdir}.*" ] ; then
284 targetspecificdirs
=${configdir}.
*
289 for i
in ${configdir} ${targetspecificdirs} ; do
291 if [ -r $i/configure
] ; then
293 .
/configure
+template
=${template} ${verbose})
295 echo Warning
: No configure
script in `pwd`/$i
298 if [ -n "${verbose}" ] ; then
299 echo Warning
: directory
$i is missing.
309 # some sanity checks on configure.in
310 if [ -z "${srctrigger}" ] ; then
311 echo Warning
: srctrigger not
set in configure.
in.
`pwd` not configured.
315 for host in ${hosts} ; do
317 if [ -z "${targets}" -o -n "${defaulttargets}" ] ; then
322 result
=`/bin/sh ./config.sub ${host}`
323 host_cpu
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
324 host_vendor
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
325 host_os
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
326 host=${host_cpu}-${host_vendor}-${host_os}
327 host_makefile_frag
=config
/hmake-
${host}
329 #### configure.in per-host parts come in here.
333 case "${host_cpu}" in
334 a29k | rs6000 | vax
) gas_host
=${host_cpu} ;;
337 ultrix
) gas_host
=decstation
;;
342 ansi | ultrix | hpux | sysv
*) gas_host
=${host_os} ;;
344 case "${host_vendor}" in
346 case "${host_cpu}" in
347 m68k
) gas_host
=sun3
;;
348 i386
) gas_host
=sun386
;;
349 sparc
) gas_host
=sun4
;;
358 ## end of per-host part.
360 for target
in ${targets} ; do
362 result
=`/bin/sh ./config.sub ${target}`
363 target_cpu
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
364 target_vendor
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
365 target_os
=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
366 target
=${target_cpu}-${target_vendor}-${target_os}
367 target_makefile_frag
=config
/tmake-
${target}
369 #### configure.in per-target parts come in here.
374 cpu_type
=${target_cpu}
376 # assign object format
392 # assign floating point type
393 case ${target_cpu} in
402 files
="config/ho-${gas_host}.h config/tc-${cpu_type}.c \
403 config/tc-${cpu_type}.h config/te-${emulation}.h \
404 config/obj-${obj_format}.h config/obj-${obj_format}.c \
405 config/atof-${atof}.c"
407 links
="host.h targ-cpu.c targ-cpu.h targ-env.h obj-format.h obj-format.c atof-targ.c"
408 ## end of per-target part.
410 # Temporarily, we support only direct subdir builds.
411 hostsubdir
=Host-
${host}
412 targetsubdir
=Target-
${target}
414 if [ -n "${removing}" ] ; then
415 if [ -n "${subdirs}" ] ; then
416 if [ -d "${hostsubdir}" ] ; then
417 rm -rf ${hostsubdir}/${targetsubdir}
419 if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target- | grep -v Target-independent`" ] ; then
423 echo Warning
: no
`pwd`/${hostsubdir} to remove.
426 rm -f ${Makefile} config.status
${links}
429 if [ -n "${subdirs}" ] ; then
430 # check for existing status before allowing forced subdirs.
431 if [ -f ${Makefile} ] ; then
432 echo '***' "${Makefile} already exists in source directory. `pwd` not configured." 1>&2
436 if [ ! -d ${hostsubdir} ] ; then mkdir
${hostsubdir} ; fi
439 if [ ! -d ${targetsubdir} ] ; then
440 if [ -z "${commontargets}" ] ; then
441 mkdir
${targetsubdir}
443 if [ ! -d Target-independent
] ; then
444 mkdir Target-independent
447 ${symbolic_link} Target-independent
${targetsubdir}
448 fi # if target independent
449 fi # if no target dir yet
455 # if not subdir builds, then make sure none exist.
456 if [ -n "`(ls .) 2>&1 | grep Host-`" ] ; then
457 echo '***' "Configured subdirs exist. `pwd` not configured." 1>&2
462 # Find the source files, if location was not specified.
463 if [ -z "${srcdir}" ] ; then
466 if [ -n "${srctrigger}" -a ! -r ${srctrigger} ] ; then
471 if [ -n "${srctrigger}" -a ! -r ${srcdir}/${srctrigger} ] ; then
472 if [ -z "${srcdirdefaulted}" ] ; then
473 echo '***' "${progname}: Can't find ${srcname} sources in `pwd`/${srcdir}" 1>&2
475 echo '***' "${progname}: Can
't find ${srcname} sources in `pwd`/. or `pwd`/.." 1>&2
478 echo '***' \(At least ${srctrigger} is missing.\) 1>&2
482 # Set up the list of links to be made.
483 # ${links} is the list of link names, and ${files} is the list of names to link to.
486 while [ -n "${files}" ] ; do
487 # set file to car of files, files to cdr of files
488 set ${files}; file=$1; shift; files=$*
489 set ${links}; link=$1; shift; links=$*
491 if [ ! -r ${srcdir}/${file} ] ; then
492 echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2
493 echo '***' "since the file \"${file}\" does not exist." 1>&2
499 # Make a symlink if possible, otherwise try a hard link
500 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
502 if [ ! -r ${link} ] ; then
503 echo '***' "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
507 if [ -n "${verbose}" ] ; then
508 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
512 # Create a .gdbinit file which runs the one in srcdir
513 # and tells GDB to look there for source files.
519 echo "dir ." > .gdbinit
520 echo "dir ${srcdir}" >> .gdbinit
521 echo "source ${srcdir}/.gdbinit" >> .gdbinit
525 # Install a makefile, and make it set VPATH
526 # if necessary so that the sources are found.
527 # Also change its value of srcdir.
529 # FIXME-someday: This business of always writing to .tem and mv back
530 # is so that I don't screw things up
while developing. Once this
531 # template is stable, these should be optimized. xoxorich.
533 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
534 if [ "${host}" != "${target}" ] ; then
535 echo "CROSS=-DCROSS_COMPILE" > ${Makefile}
536 echo "ALL=start.encap" >> ${Makefile}
538 echo "ALL=all.internal" > ${Makefile}
541 # set target, host, VPATH
542 echo "host = ${host}" >> ${Makefile}
543 echo "target = ${target}" >> ${Makefile}
545 if [ -n "${subdirs}" ] ; then
546 echo "subdir = /${hostsubdir}/${targetsubdir}" >> ${Makefile}
548 echo "subdir
=" >> ${Makefile}
551 # echo "workdir
= `pwd`" >> ${Makefile}
552 echo "VPATH
= ${srcdir}" >> ${Makefile}
554 # add "Makefile.
in" (or whatever it's called)
555 cat ${srcdir}/${Makefile_in} >> ${Makefile}
557 # Conditionalize the makefile for this host.
558 if [ -f ${srcdir}/${host_makefile_frag} ] ; then
559 sed -e "/^
####/ r ${srcdir}/${host_makefile_frag}" ${Makefile} > Makefile.tem
560 mv Makefile.tem
${Makefile}
563 # Conditionalize the makefile for this target.
564 if [ -f ${srcdir}/${target_makefile_frag} ] ; then
565 sed -e "/^####/ r ${srcdir}/${target_makefile_frag}" ${Makefile} > Makefile.tem
566 mv Makefile.tem ${Makefile}
570 sed "s@^srcdir
= \.@srcdir
= ${srcdir}@
" ${Makefile} > Makefile.tem
571 mv Makefile.tem ${Makefile}
574 if [ -n "${destdir}" ] ; then
575 sed "s
:^destdir
=.
*$
:destdir
= ${destdir}:" ${Makefile} > Makefile.tem
576 mv Makefile.tem ${Makefile}
580 sed "s
:^SUBDIRS
=.
*$
:SUBDIRS
= ${configdirs}:" ${Makefile} > Makefile.tem
581 mv Makefile.tem ${Makefile}
584 sed "s
:^NONSUBDIRS
=.
*$
:NONSUBDIRS
= ${noconfigdirs}:" ${Makefile} > Makefile.tem
585 mv Makefile.tem ${Makefile}
588 if [ -f ${srcdir}/${host_makefile_frag} ] ; then
589 using=" using
\"${host_makefile_frag}\""
592 if [ -f ${srcdir}/${target_makefile_frag} ] ; then
593 if [ -z "${using}" ] ; then
594 andusing=" using
\"${target_makefile_frag}\""
596 andusing="${using} and
\"${target_makefile_frag}\""
602 if [ -n "${verbose}" -o -z "${recursing}" ] ; then
603 echo "Created
\"${Makefile}\"" in `pwd`${andusing}.
606 #### configure.in post-target parts come in here.
608 ## end of post-target part.
610 if [ "${host}" = "${target}" ] ; then
611 echo "Links are now
set up
for use with a
${target}.
" \
613 # | tee ${srcdir}/config.status
615 echo "Links are now
set up
for host ${host} and target
${target}.
" \
617 # | tee ${srcdir}/config.status
624 # If there are subdirectories, then recurse.
625 if [ -z "${norecurse}" -a -n "${configdirs}" ] ; then
626 for configdir in ${configdirs} ; do
627 if [ -n "${verbose}" ] ; then
628 echo Configuring ${configdir}...
631 if [ -d ${configdir} ] ; then
633 ./configure -recursing ${host} +target=${target} \
634 ${verbose} ${subdirs} ${removing} +destdir=${destdir}) \
637 if [ -n "${verbose}" ] ; then
638 echo Warning: directory \"${configdir}\" is missing.
643 done # for each target
645 # Now build a Makefile for this host.
646 if [ -n "${subdirs}" -a ! -n "${removing}" ] ; then
648 cat > GNUmakefile << E!O!F
649 # Makefile generated by configure for host ${host}.
651 ALL := $(shell ls -d Target-*)
654 $(foreach subdir,$(ALL),$(MAKE) -C $(subdir) \$@ &&) true
666 # Revision 1.23 1991/08/28 21:49:10 rich
667 # Update to current standards.
669 # Revision 1.35 1991/08/26 04:29:31 rich
670 # Welcome cvs to the big time.
672 # Revision 1.34 1991/08/25 23:40:23 rich
673 # rcs enters the soup.
675 # Revision 1.33 1991/08/25 21:48:38 rich
676 # Adding diff to the fray.
678 # Revision 1.32 1991/08/25 20:18:20 rich
679 # Adding grep to the fray.
681 # Revision 1.31 1991/08/23 04:50:57 rich
682 # Minor config polish.
684 # Revision 1.22 1991/08/23 03:31:43 rich
685 # Minor polish & config mapping.
687 # Revision 1.30 1991/08/22 07:15:51 rich
688 # Three part names, etc.
690 # Revision 1.29 1991/08/20 04:56:51 rich
691 # revisiting error messages
693 # Revision 1.28 1991/08/16 19:22:17 rich
694 # This is the commontargets change and should be considered
697 # Revision 1.27 1991/08/08 01:14:13 rich
698 # allow +f to stand in for +subdirs
700 # Revision 1.26 1991/08/07 19:21:32 rich
701 # +forcesubdirs -> +subdirs
703 # Revision 1.25 1991/08/07 07:05:30 rich
706 # Revision 1.24 1991/08/06 19:26:01 rich
707 # revised option parsing.
709 # Revision 1.23 1991/08/06 19:12:32 rich
710 # Host-level GNUmakefiles.
712 # Revision 1.22 1991/07/20 01:22:30 rich
713 # propogate gdb changes and destdir fix
715 # Revision 1.21 1991/07/20 00:55:20 gnu
716 # Roll in new configure that handles GDB. Make sure that the "configure
"
717 # that is checked-in reflects the latest "configure.
in", which includes gdb.
719 # Revision 1.9 1991/07/06 04:35:51 gnu
720 # Fix bug in configure when iterating targets.
721 # Depend on alldeps.mak, not ${srcdir}/alldeps.mak, so it can be found
724 # Revision 1.8 1991/07/05 00:04:58 gnu
725 # Thu Jul 4 14:47:06 1991 John Gilmore (gnu at cygint.cygnus.com)
727 # * configure.in, Makefile.in: Avoid rebuilding "depend
" as much.
728 # Avoid declaring Makefile dependencies, because GNU Make stupidly
729 # tries to update it if we do.
731 # * coffread.c: Revise for minor changes to bfd internal coff
734 # * configure: If -template= is given a relative path, make it
735 # absolute before recurring in subdirectories.
737 # Revision 1.7 1991/07/04 15:59:46 gnu
738 # Make gdb work with configure. Only thing that doesn't work is the -list
739 # option (as far as I know).
741 # Revision 1.6 1991/06/04 07:28:16 gnu
742 # Change GDB over to GNU General Public License version 2.
744 # Revision 1.5 1991/05/19 07:26:54 rich
745 # configure changes and -opcode.h movement.
747 # Revision 1.4 1991/05/19 00:16:45 rich
750 # Revision 1.10 1991/05/04 00:58:38 rich
751 # Fix program name bug.
753 # Revision 1.9 1991/05/03 19:14:18 rich
754 # Changed getopt to libiberty, commented out an aborted attempt at host
755 # level Makefiles because it caused errors on +rm, add a warning for
756 # directories expected to be removed on +rm but that don't exist.
758 # Revision 1.8 1991/04/24 16:50:59 rich
759 # Three staging checkpoint.
761 # Revision 1.7 1991/04/17 01:34:47 rich
762 # Added getopt for binutils, fixed problem with host dependancies in
763 # configure.template.
765 # Revision 1.6 1991/04/16 00:18:44 rich
766 # Now handles multiple hosts and targets.
768 # Revision 1.5 1991/04/15 23:43:44 rich
769 # Now handles multiple hosts and targets.
771 # Revision 1.4 1991/04/13 02:11:03 rich
772 # Config cut 3. We now almost install a29k.
774 # Revision 1.3 1991/04/11 02:41:54 rich
775 # Cut 2 config. Subdirs.
786 # end of configure.template