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 #GNU CC 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 1, or (at your option)
18 #GNU CC 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 GNU CC; see the file COPYING. If not, write to
25 #the Free Software Foundation, 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"
47 # clear some things potentially inherited from environment.
69 -destdir=* |
+destdir
=* |
+destdi
=* |
+destd
=* |
+dest
=* |
+des
=* |
+de
=* |
+d
=*)
70 destdir
=`echo ${arg} | sed 's/[+-]d[a-z]*=//'`
72 -forcesubdirs |
+forcesubdirs |
+f
)
75 -languages=* |
+languages
=* |
+language
=* |
+languag
=* \
76 |
+langua
=* |
+langu
=* |
+lang
=* |
+lan
=* |
+la
=* \
78 languages
="${languages} `echo ${arg} | sed 's/[+-]l[a-z]*=//'`"
80 -gas |
+gas |
+ga |
+g
)
86 -nfp |
+nfp |
+nf |
+n
)
89 -norecurse |
+norecurse
)
95 # -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*)
96 # srcdir=`echo ${arg} | sed 's/[+-]s[a-z]*=//'`
98 -target=* |
+target
=* |
+targe
=* |
+targ
=* |
+tar=* |
+ta
=* |
+t
=*)
99 if [ -n "${targets}" ] ; then
100 forcesubdirs
="+forcesubdirs"
103 newtargets
="${targets} `echo ${arg} | sed 's/[+-]t[a-z]*=//'`"
104 targets
="${newtargets}"
106 -template=* |
+template
=*)
107 template
=`echo ${arg} | sed 's/[+-]template=//'`
109 +verbose |
+verbos |
+verbo |
+verb |
+ver |
+ve |
+v
)
114 echo "Unrecognized option: \"${arg}\"".
;
119 if [ -n "${hosts}" ] ; then
120 forcesubdirs
="+forcesubdirs"
123 newhosts
="${hosts} ${arg}"
129 if [ -n "${verbose}" ] ; then
130 echo `pwd`/configure $
*
131 echo targets
=\"${targets}\"
134 # process host and target only if not rebuilding configure itself or removing.
135 if [ -z "${template}" -a -z "${removing}" -a -z "${fatal}" ] ; then
136 # Complain if an arg is missing
137 if [ -z "${hosts}" ] ; then
139 echo "configure: No HOST specified." ;
145 if [ -n "${fatal}" -o "${hosts}" = "help" ] ; then
146 (echo "Usage: configure HOST" ;
148 echo "Options: [defaults in brackets]" ;
149 echo " +ansi configure w/ANSI library. [no ansi lib]" ;
150 echo " +destdir=MYDIR configure for installation into MYDIR. [/usr/local]" ;
151 echo " +forcesubdirs configure in subdirectories. [in source directories]" ;
152 echo " +lang=LANG configure to build LANG. [gcc]" ;
153 echo " +help print this message. [normal config]" ;
154 echo " +gas configure the compilers for use with gas. [native as]" ;
155 echo " +nfp configure the compilers default to soft floating point. [hard float]" ;
156 echo " +norecurse configure this directory only. [recurse]" ;
157 echo " +rm remove this configuration. [build a configuration]" ;
158 echo " +target=TARGET configure for TARGET. [TARGET = HOST]" ;
159 echo " +template=TEM rebuild configure using TEM. [normal config]" ;
161 echo "Where HOST and TARGET are something like \"vax\", \"sun3\", \"encore\", etc." ;
162 echo "Asking for more than one \"+target\" implies \"+forcesubdirs\". Any other" ;
163 echo "options given will apply to all targets.") 1>&2
165 if [ -r config.status
] ; then
172 #### configure.in common parts come in here.
173 # This file is a shell script that supplies the information necessary
174 # to tailor a template configure script into the configure script
175 # appropriate for this directory. For more information, check any
176 # existing configure script.
206 # assign object format
222 # assign floating point type
232 files
="config/ho-${host}.h config/tc-${cpu_type}.c \
233 config/tc-${cpu_type}.h config/te-generic.h \
234 config/obj-${obj_format}.h config/obj-${obj_format}.c \
235 config/atof-${atof}.c"
237 links
="host.h targ-cpu.c targ-cpu.h targ-env.h obj-format.h obj-format.c atof-targ.c"
238 ## end of common part
240 # are we rebuilding config itself?
241 if [ -n "${template}" ] ; then
242 if [ ! -r ${template} ] ; then
243 echo "Can't find template ${template}."
247 mv configure configure.old
248 echo "#!/bin/sh" > configure
249 echo "# Please do not edit this file. It is generated automatically from" >> configure
250 echo "# configure.in and a configure template." >> configure
251 echo "configdirs=" >> configure
254 if [ -r configure.
in ] ; then
255 if [ -z "`grep '^# per\-host:' configure.in`" ] ; then
256 echo `pwd`/configure.
in has no
"per-host:" line.
260 if [ -z "`grep '^# per\-target:' configure.in`" ] ; then
261 echo `pwd`/configure.
in has no
"per-target:" line.
265 sed -e '/^# per\-target:/,$d' configure.
in > configure.com
266 sed -e '1,/^# per\-target:/d' configure.
in > configure.tgt
268 sed -e '/^#### configure.in common parts/ r configure.com' \
269 -e '/^#### / r configure.tgt' \
270 ${template} >> configure
272 rm -f configure.com configure.tgt configure.hst
274 echo Warning
: no configure.
in in `pwd`
275 cat ${template} >> configure
280 echo Rebuilt configure
in `pwd`
282 if [ -z "${norecurse}" ] ; then
283 while [ -n "${configdirs}" ] ; do
284 # set configdir to car of configdirs, configdirs to cdr of configdirs
285 set ${configdirs}; configdir
=$1; shift; configdirs
=$
*
287 if [ "`echo ${configdir}.*`" != "${configdir}.*" ] ; then
288 targetspecificdirs
=${configdir}.
*
293 for i
in ${configdir} ${targetspecificdirs} ; do
294 if [ -r $i/configure
] ; then
296 .
/configure
+template
=${template} ${verbose})
298 echo No configure
script in `pwd`/$i
307 # some sanity checks on configure.in
308 if [ -z "${srctrigger}" ] ; then
309 echo srctrigger not
set in configure.
in.
`pwd` not configured.
313 for host in ${hosts} ; do
315 if [ -z "${targets}" -o -n "${defaulttargets}" ] ; then
320 #### configure.in per-host parts come in here.
344 # assign object format
360 # assign floating point type
370 files
="config/ho-${host}.h config/tc-${cpu_type}.c \
371 config/tc-${cpu_type}.h config/te-generic.h \
372 config/obj-${obj_format}.h config/obj-${obj_format}.c \
373 config/atof-${atof}.c"
375 links
="host.h targ-cpu.c targ-cpu.h targ-env.h obj-format.h obj-format.c atof-targ.c"
376 ## end of per-target part
379 for target
in ${targets} ; do
381 if [ -n "${verbose}" ] ; then
382 echo " "target
=\"${target}\"
385 #### configure.in per-target parts come in here.
409 # assign object format
425 # assign floating point type
435 files
="config/ho-${host}.h config/tc-${cpu_type}.c \
436 config/tc-${cpu_type}.h config/te-generic.h \
437 config/obj-${obj_format}.h config/obj-${obj_format}.c \
438 config/atof-${atof}.c"
440 links
="host.h targ-cpu.c targ-cpu.h targ-env.h obj-format.h obj-format.c atof-targ.c"
441 ## end of per-target part
443 # Temporarily, we support only direct subdir builds.
444 hostsubdir
=Host-
${host}
445 targetsubdir
=Target-
${target}
447 if [ -n "${removing}" ] ; then
448 if [ -d "${hostsubdir}/${targetsubdir}" ] ; then
449 rm -rf ${hostsubdir}/${targetsubdir}
451 if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ] ; then
455 rm -f Makefile config.status
${links}
458 if [ -n "${forcesubdirs}" ] ; then
459 # check for existing status before allowing forced subdirs.
460 if [ -f Makefile
] ; then
461 echo "Makefile already exists in source directory. `pwd` not configured."
465 if [ ! -d ${hostsubdir} ] ; then mkdir
${hostsubdir} ; fi
468 if [ ! -d ${targetsubdir} ] ; then mkdir
${targetsubdir} ; fi
473 # if not subdir builds, then make sure none exist.
474 if [ -n "`(ls .) 2>&1 | grep Host-`" ] ; then
475 echo "Configured subdirs exist. `pwd` not configured."
480 # Find the source files, if location was not specified.
481 if [ -z "${srcdir}" ] ; then
484 if [ -n "${srctrigger}" -a ! -r ${srctrigger} ] ; then
489 if [ -n "${srctrigger}" -a ! -r ${srcdir}/${srctrigger} ] ; then
490 if [ -z "${srcdirdefaulted}" ] ; then
491 echo "${progname}: Can't find ${srcname} sources in \`${srcdir}'." 1>&2
493 echo "${progname}: Can't
find ${srcname} sources
in \
`.' or \`..
'." 1>&2
499 # Set up the list of links to be made.
500 # ${links} is the list of link names, and ${files} is the list of names to link to.
503 while [ -n "${files}" ] ; do
504 # set file to car of files, files to cdr of files
505 set ${files}; file=$1; shift; files=$*
506 set ${links}; link=$1; shift; links=$*
508 if [ ! -r ${srcdir}/${file} ] ; then
509 echo "${progname}: cannot create a link \"${link}\"," 1>&2
510 echo "since the file \"${file}\" does not exist." 1>&2
516 # Make a symlink if possible, otherwise try a hard link
517 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
519 if [ ! -r ${link} ] ; then
520 echo "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
523 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
526 # Create a .gdbinit file which runs the one in srcdir
527 # and tells GDB to look there for source files.
533 echo "dir ." > .gdbinit
534 echo "dir ${srcdir}" >> .gdbinit
535 echo "source ${srcdir}/.gdbinit" >> .gdbinit
539 # Install a makefile, and make it set VPATH
540 # if necessary so that the sources are found.
541 # Also change its value of srcdir.
543 # FIXME-someday: This business of always writing to .tem and mv back
544 # is so that I don't screw things up
while developing. Once this
545 # template is stable, these should be optimized. xoxorich.
547 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
548 if [ "${host}" != "${target}" ] ; then
549 echo "CROSS=-DCROSS_COMPILE" > Makefile
550 echo "ALL=start.encap" >> Makefile
552 echo "ALL=all.internal" > Makefile
555 # set target, host, VPATH
556 echo "host = ${host}" >> Makefile
557 echo "target = ${target}" >> Makefile
559 if [ -n "${forcesubdirs}" ] ; then
560 echo "subdir = /${hostsubdir}/${targetsubdir}" >> Makefile
562 echo "subdir =" >> Makefile
565 # echo "workdir = `pwd`" >> Makefile
566 echo "VPATH = ${srcdir}" >> Makefile
569 cat ${srcdir}/Makefile.
in >> Makefile
571 # and shake thoroughly.
572 host_var_file
=hmake-
${host}
573 target_var_file
=tmake-
${target}
575 # Conditionalize the makefile for this host.
576 if [ -f ${srcdir}/config
/${host_var_file} ] ; then
577 sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile
> Makefile.tem
578 mv Makefile.tem Makefile
581 # Conditionalize the makefile for this target.
582 if [ -f ${srcdir}/config
/${target_var_file} ] ; then
583 sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile
> Makefile.tem
584 mv Makefile.tem Makefile
588 sed "s@^srcdir = \.@srcdir = ${srcdir}@" Makefile
> Makefile.tem
589 mv Makefile.tem Makefile
592 if [ -n "${destdir}" ] ; then
593 sed "s:^destdir =.*$:destdir = ${destdir}:" Makefile
> Makefile.tem
594 mv Makefile.tem Makefile
597 # Remove all formfeeds, since some Makes get confused by them.
598 sed "s/\f//" Makefile
>> Makefile.tem
599 mv Makefile.tem Makefile
602 sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile
> Makefile.tem
603 mv Makefile.tem Makefile
606 sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile
> Makefile.tem
607 mv Makefile.tem Makefile
610 if [ -f ${srcdir}/config
/${host_var_file} ] ; then
611 using
=" using \"${host_var_file}\""
614 if [ -f ${srcdir}/config
/${target_var_file} ] ; then
615 if [ -z "${using}" ] ; then
616 andusing
=" using \"${target_var_file}\""
618 andusing
="${using} and \"${target_var_file}\""
624 echo "Created \"Makefile\"" in `pwd`${andusing}.
626 if [ "${host}" = "${target}" ] ; then
627 echo "Links are now set up for use with a ${target}." \
629 # | tee ${srcdir}/config.status
631 echo "Links are now set up for host ${host} and target ${target}." \
633 # | tee ${srcdir}/config.status
642 # If there are subdirectories, then recurse.
644 if [ -n "${norecurse}" -o -z "${configdirs}" ] ; then exit 0 ; fi
646 # configdirs is not null
647 for configdir
in ${configdirs} ; do
648 echo Configuring
${configdir}...
652 if [ -n "${defaulttargets}" ] ; then
653 for host in ${hosts} ; do
654 if [ -d ${configdir}.
${host} ] ; then
655 newspecifics
="${specifics} ${host}"
656 specifics
=${newspecifics}
658 newcommons
="${commons} ${host}"
659 commons
=${newcommons}
660 fi # if target specific
663 if [ -n "${commons}" ] ; then
665 .
/configure
${commons} ${verbose} ${forcesubdirs} ${removing}) \
667 fi # if any common hosts
669 if [ -n "${specifics}" ] ; then
670 for host in ${specifics} ; do
671 echo Configuring target specific directory
${configdir}.
${host}...
672 (cd ${configdir}.
${host} ;
673 .
/configure
${host} ${verbose} ${forcesubdirs} ${removing}) \
675 done # for host in specifics
676 fi # if there are any specifics
679 for target
in ${targets} ; do
680 if [ -d ${configdir}.
${target} ] ; then
681 newspecifics
="${specifics} ${target}"
682 specifics
=${newspecifics}
684 newcommons
="${commons} +target=${target}"
685 commons
=${newcommons}
688 done # check for target specific dir override
690 if [ -n "${verbose}" ] ; then
691 echo " "commons
=\"${commons}\"
692 echo " "specifics
=\"${specifics}\"
695 if [ -n "${commons}" ] ; then
697 .
/configure
${hosts} ${verbose} ${forcesubdirs} ${removing} ${commons}) \
701 if [ -n "${specifics}" ] ; then
702 for target
in ${specifics} ; do
703 echo Configuring target specific directory
${configdir}.
${target}...
704 (cd ${configdir}.
${target} ;
705 .
/configure
${hosts} ${verbose} ${forcesubdirs} ${removing} "+target=${target}") \
708 fi # if any specifics
709 fi # not default targets
716 # Revision 1.6 1991/04/15 23:55:43 rich
717 # Now handles multiple hosts and targets.
719 # Revision 1.5 1991/04/15 23:43:44 rich
720 # Now handles multiple hosts and targets.
722 # Revision 1.4 1991/04/13 02:11:03 rich
723 # Config cut 3. We now almost install a29k.
725 # Revision 1.3 1991/04/11 02:41:54 rich
726 # Cut 2 config. Subdirs.
737 # end of configure.template