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"
49 # clear some things potentially inherited from environment.
71 -destdir=* |
+destdir
=* |
+destdi
=* |
+destd
=* |
+dest
=* |
+des
=* |
+de
=* |
+d
=*)
72 destdir
=`echo ${arg} | sed 's/[+-]d[a-z]*=//'`
74 -forcesubdirs |
+forcesubdirs |
+forcesubdir |
+forcesubdi |
+forcesubd \
75 |
+forcesub |
+forcesu |
+forces |
+force |
+forc |
+for |
+fo |
+f
)
78 -languages=* |
+languages
=* |
+language
=* |
+languag
=* \
79 |
+langua
=* |
+langu
=* |
+lang
=* |
+lan
=* |
+la
=* \
81 languages
="${languages} `echo ${arg} | sed 's/[+-]l[a-z]*=//'`"
83 -gas |
+gas |
+ga |
+g
)
89 -nfp |
+nfp |
+nf |
+n
)
92 -norecurse |
+norecurse
)
98 # -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*)
99 # srcdir=`echo ${arg} | sed 's/[+-]s[a-z]*=//'`
101 -target=* |
+target
=* |
+targe
=* |
+targ
=* |
+tar=* |
+ta
=* |
+t
=*)
102 if [ -n "${targets}" ] ; then
103 forcesubdirs
="+forcesubdirs"
106 newtargets
="${targets} `echo ${arg} | sed 's/[+-]t[a-z]*=//'`"
107 targets
="${newtargets}"
109 -template=* |
+template
=*)
110 template
=`echo ${arg} | sed 's/[+-]template=//'`
112 +verbose |
+verbos |
+verbo |
+verb |
+ver |
+ve |
+v
)
117 echo "Unrecognized option: \"${arg}\"".
;
122 if [ -n "${hosts}" ] ; then
123 forcesubdirs
="+forcesubdirs"
126 newhosts
="${hosts} ${arg}"
132 if [ -n "${verbose}" ] ; then
133 echo `pwd`/configure $
*
134 echo targets
=\"${targets}\"
137 # process host and target only if not rebuilding configure itself or removing.
138 if [ -z "${template}" -a -z "${removing}" -a -z "${fatal}" ] ; then
139 # Complain if an arg is missing
140 if [ -z "${hosts}" ] ; then
142 echo "configure: No HOST specified." ;
148 if [ -n "${fatal}" -o "${hosts}" = "help" ] ; then
149 (echo "Usage: configure HOST" ;
151 echo "Options: [defaults in brackets]" ;
152 echo " +ansi configure w/ANSI library. [no ansi lib]" ;
153 echo " +destdir=MYDIR configure for installation into MYDIR. [/usr/local]" ;
154 echo " +forcesubdirs configure in subdirectories. [in source directories]" ;
155 echo " +lang=LANG configure to build LANG. [gcc]" ;
156 echo " +help print this message. [normal config]" ;
157 echo " +gas configure the compilers for use with gas. [native as]" ;
158 echo " +nfp configure the compilers default to soft floating point. [hard float]" ;
159 echo " +norecurse configure this directory only. [recurse]" ;
160 echo " +rm remove this configuration. [build a configuration]" ;
161 echo " +target=TARGET configure for TARGET. [TARGET = HOST]" ;
162 echo " +template=TEM rebuild configure using TEM. [normal config]" ;
164 echo "Where HOST and TARGET are something like \"vax\", \"sun3\", \"encore\", etc." ;
165 echo "Asking for more than one \"+target\" implies \"+forcesubdirs\". Any other" ;
166 echo "options given will apply to all targets.") 1>&2
168 if [ -r config.status
] ; then
175 #### configure.in common parts come in here.
176 # This file is a shell script that supplies the information necessary
177 # to tailor a template configure script into the configure script
178 # appropriate for this directory. For more information, check any
179 # existing configure script.
184 ## end of common part.
186 # are we rebuilding config itself?
187 if [ -n "${template}" ] ; then
188 if [ ! -r ${template} ] ; then
189 echo "Can't find template ${template}."
194 sed -e '/^#### configure.in common parts come in here.$/,/^## end of common part.$/c\
195 #### configure.in common parts come in here.\
196 ## end of common part.' \
197 -e '/^#### configure.in per-host parts come in here.$/,/^## end of per-host part.$/c\
198 #### configure.in per-host parts come in here.\
199 ## end of per-host part.' \
200 -e '/^#### configure.in per-target parts come in here.$/,/^## end of per-target part.$/c\
201 #### configure.in per-target parts come in here.\
202 ## end of per-target part.' \
203 < ${template} > template.new
205 if [ -r configure.
in ] ; then
206 if [ -z "`grep '^# per\-host:' configure.in`" ] ; then
207 echo `pwd`/configure.
in has no
"per-host:" line.
211 if [ -z "`grep '^# per\-target:' configure.in`" ] ; then
212 echo `pwd`/configure.
in has no
"per-target:" line.
216 # split configure.in into common, per-host, and per-target parts
217 sed -e '/^# per\-host:/,$d' configure.
in > configure.com
218 sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' configure.
in > configure.hst
219 sed -e '1,/^# per\-target:/d' configure.
in > configure.tgt
222 sed -e '/^#### configure.in common parts come in here.$/ r configure.com' \
223 -e '/^#### configure.in per\-host parts come in here.$/ r configure.hst' \
224 -e '/^#### configure.in per\-target parts come in here.$/ r configure.tgt' \
225 template.new
> configure.new
227 rm -f configure.com configure.tgt configure.hst
229 echo Warning
: no configure.
in in `pwd`
230 cat ${template} >> configure
233 chmod a
+x configure.new
235 # mv configure configure.old
236 mv configure.new configure
237 echo Rebuilt configure
in `pwd`
239 if [ -z "${norecurse}" ] ; then
240 while [ -n "${configdirs}" ] ; do
241 # set configdir to car of configdirs, configdirs to cdr of configdirs
242 set ${configdirs}; configdir
=$1; shift; configdirs
=$
*
244 if [ "`echo ${configdir}.*`" != "${configdir}.*" ] ; then
245 targetspecificdirs
=${configdir}.
*
250 for i
in ${configdir} ${targetspecificdirs} ; do
251 if [ -r $i/configure
] ; then
253 .
/configure
+template
=${template} ${verbose})
255 echo No configure
script in `pwd`/$i
264 # some sanity checks on configure.in
265 if [ -z "${srctrigger}" ] ; then
266 echo srctrigger not
set in configure.
in.
`pwd` not configured.
270 for host in ${hosts} ; do
272 if [ -z "${targets}" -o -n "${defaulttargets}" ] ; then
277 #### configure.in per-host parts come in here.
279 ## end of per-host part.
282 for target
in ${targets} ; do
284 if [ -n "${verbose}" ] ; then
285 echo " "target
=\"${target}\"
288 #### configure.in per-target parts come in here.
312 # assign object format
328 # assign floating point type
338 files
="config/ho-${host}.h config/tc-${cpu_type}.c \
339 config/tc-${cpu_type}.h config/te-generic.h \
340 config/obj-${obj_format}.h config/obj-${obj_format}.c \
341 config/atof-${atof}.c"
343 links
="host.h targ-cpu.c targ-cpu.h targ-env.h obj-format.h obj-format.c atof-targ.c"
344 ## end of per-target part.
346 # Temporarily, we support only direct subdir builds.
347 hostsubdir
=Host-
${host}
348 targetsubdir
=Target-
${target}
350 if [ -n "${removing}" ] ; then
351 if [ -n "${forcesubdirs}" ] ; then
352 if [ -d "${hostsubdir}" ] ; then
353 rm -rf ${hostsubdir}/${targetsubdir}
355 if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ] ; then
359 echo Warning
: no
`pwd`/${hostsubdir} to remove.
362 rm -f Makefile config.status
${links}
365 if [ -n "${forcesubdirs}" ] ; then
366 # check for existing status before allowing forced subdirs.
367 if [ -f Makefile
] ; then
368 echo "Makefile already exists in source directory. `pwd` not configured."
372 if [ ! -d ${hostsubdir} ] ; then mkdir
${hostsubdir} ; fi
375 if [ ! -d ${targetsubdir} ] ; then mkdir
${targetsubdir} ; fi
380 # if not subdir builds, then make sure none exist.
381 if [ -n "`(ls .) 2>&1 | grep Host-`" ] ; then
382 echo "Configured subdirs exist. `pwd` not configured."
387 # Find the source files, if location was not specified.
388 if [ -z "${srcdir}" ] ; then
391 if [ -n "${srctrigger}" -a ! -r ${srctrigger} ] ; then
396 if [ -n "${srctrigger}" -a ! -r ${srcdir}/${srctrigger} ] ; then
397 if [ -z "${srcdirdefaulted}" ] ; then
398 echo "${progname}: Can't find ${srcname} sources in `pwd`/${srcdir}" 1>&2
400 echo "${progname}: Can
't find ${srcname} sources in `pwd`/. or `pwd`/.." 1>&2
403 echo \(At least ${srctrigger} is missing.\) 1>&2
407 # Set up the list of links to be made.
408 # ${links} is the list of link names, and ${files} is the list of names to link to.
411 while [ -n "${files}" ] ; do
412 # set file to car of files, files to cdr of files
413 set ${files}; file=$1; shift; files=$*
414 set ${links}; link=$1; shift; links=$*
416 if [ ! -r ${srcdir}/${file} ] ; then
417 echo "${progname}: cannot create a link \"${link}\"," 1>&2
418 echo "since the file \"${file}\" does not exist." 1>&2
424 # Make a symlink if possible, otherwise try a hard link
425 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
427 if [ ! -r ${link} ] ; then
428 echo "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
431 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
434 # Create a .gdbinit file which runs the one in srcdir
435 # and tells GDB to look there for source files.
441 echo "dir ." > .gdbinit
442 echo "dir ${srcdir}" >> .gdbinit
443 echo "source ${srcdir}/.gdbinit" >> .gdbinit
447 # Install a makefile, and make it set VPATH
448 # if necessary so that the sources are found.
449 # Also change its value of srcdir.
451 # FIXME-someday: This business of always writing to .tem and mv back
452 # is so that I don't screw things up
while developing. Once this
453 # template is stable, these should be optimized. xoxorich.
455 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
456 if [ "${host}" != "${target}" ] ; then
457 echo "CROSS=-DCROSS_COMPILE" > Makefile
458 echo "ALL=start.encap" >> Makefile
460 echo "ALL=all.internal" > Makefile
463 # set target, host, VPATH
464 echo "host = ${host}" >> Makefile
465 echo "target = ${target}" >> Makefile
467 if [ -n "${forcesubdirs}" ] ; then
468 echo "subdir = /${hostsubdir}/${targetsubdir}" >> Makefile
470 echo "subdir =" >> Makefile
473 # echo "workdir = `pwd`" >> Makefile
474 echo "VPATH = ${srcdir}" >> Makefile
477 cat ${srcdir}/Makefile.
in >> Makefile
479 # and shake thoroughly.
480 host_var_file
=hmake-
${host}
481 target_var_file
=tmake-
${target}
483 # Conditionalize the makefile for this host.
484 if [ -f ${srcdir}/config
/${host_var_file} ] ; then
485 sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile
> Makefile.tem
486 mv Makefile.tem Makefile
489 # Conditionalize the makefile for this target.
490 if [ -f ${srcdir}/config
/${target_var_file} ] ; then
491 sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile
> Makefile.tem
492 mv Makefile.tem Makefile
496 sed "s@^srcdir = \.@srcdir = ${srcdir}@" Makefile
> Makefile.tem
497 mv Makefile.tem Makefile
500 if [ -n "${destdir}" ] ; then
501 sed "s:^destdir =.*$:destdir = ${destdir}:" Makefile
> Makefile.tem
502 mv Makefile.tem Makefile
505 # Remove all formfeeds, since some Makes get confused by them.
506 sed "s/\f//" Makefile
>> Makefile.tem
507 mv Makefile.tem Makefile
510 sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile
> Makefile.tem
511 mv Makefile.tem Makefile
514 sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile
> Makefile.tem
515 mv Makefile.tem Makefile
518 if [ -f ${srcdir}/config
/${host_var_file} ] ; then
519 using
=" using \"${host_var_file}\""
522 if [ -f ${srcdir}/config
/${target_var_file} ] ; then
523 if [ -z "${using}" ] ; then
524 andusing
=" using \"${target_var_file}\""
526 andusing
="${using} and \"${target_var_file}\""
532 echo "Created \"Makefile\"" in `pwd`${andusing}.
534 if [ "${host}" = "${target}" ] ; then
535 echo "Links are now set up for use with a ${target}." \
537 # | tee ${srcdir}/config.status
539 echo "Links are now set up for host ${host} and target ${target}." \
541 # | tee ${srcdir}/config.status
547 done # for each target
549 # # Now build a Makefile for this host.
550 # if [ -n "${forcesubdirs}" ] ; then
552 # cat > GNUmakefile << E!O!F
553 ## Makefile generated by configure for host ${host}.
556 # for i in ${targets} ; do \
557 # $(MAKE) -C Target-\$i \$@
559 #all clean stage1 stage2 stage3 stage4etags tags TAGS
564 # If there are subdirectories, then recurse.
566 if [ -n "${norecurse}" -o -z "${configdirs}" ] ; then exit 0 ; fi
568 # configdirs is not null
569 for configdir
in ${configdirs} ; do
570 echo Configuring
${configdir}...
574 if [ -n "${defaulttargets}" ] ; then
575 for host in ${hosts} ; do
576 if [ -d ${configdir}.
${host} ] ; then
577 newspecifics
="${specifics} ${host}"
578 specifics
=${newspecifics}
580 newcommons
="${commons} ${host}"
581 commons
=${newcommons}
582 fi # if target specific
585 if [ -n "${commons}" ] ; then
587 .
/configure
${commons} ${verbose} ${forcesubdirs} ${removing}) \
589 fi # if any common hosts
591 if [ -n "${specifics}" ] ; then
592 for host in ${specifics} ; do
593 echo Configuring target specific directory
${configdir}.
${host}...
594 (cd ${configdir}.
${host} ;
595 .
/configure
${host} ${verbose} ${forcesubdirs} ${removing}) \
597 done # for host in specifics
598 fi # if there are any specifics
601 for target
in ${targets} ; do
602 if [ -d ${configdir}.
${target} ] ; then
603 newspecifics
="${specifics} ${target}"
604 specifics
=${newspecifics}
606 newcommons
="${commons} +target=${target}"
607 commons
=${newcommons}
610 done # check for target specific dir override
612 if [ -n "${verbose}" ] ; then
613 echo " "commons
=\"${commons}\"
614 echo " "specifics
=\"${specifics}\"
617 if [ -n "${commons}" ] ; then
619 .
/configure
${hosts} ${verbose} ${forcesubdirs} ${removing} ${commons}) \
623 if [ -n "${specifics}" ] ; then
624 for target
in ${specifics} ; do
625 echo Configuring target specific directory
${configdir}.
${target}...
626 (cd ${configdir}.
${target} ;
627 .
/configure
${hosts} ${verbose} ${forcesubdirs} ${removing} "+target=${target}") \
630 fi # if any specifics
631 fi # not default targets
638 # Revision 1.9 1991/05/14 14:14:08 rich
639 # see devo/configure 1.11
641 # Revision 1.10 1991/05/04 00:58:38 rich
642 # Fix program name bug.
644 # Revision 1.9 1991/05/03 19:14:18 rich
645 # Changed getopt to libiberty, commented out an aborted attempt at host
646 # level Makefiles because it caused errors on +rm, add a warning for
647 # directories expected to be removed on +rm but that don't exist.
649 # Revision 1.8 1991/04/24 16:50:59 rich
650 # Three staging checkpoint.
652 # Revision 1.7 1991/04/17 01:34:47 rich
653 # Added getopt for binutils, fixed problem with host dependancies in
654 # configure.template.
656 # Revision 1.6 1991/04/16 00:18:44 rich
657 # Now handles multiple hosts and targets.
659 # Revision 1.5 1991/04/15 23:43:44 rich
660 # Now handles multiple hosts and targets.
662 # Revision 1.4 1991/04/13 02:11:03 rich
663 # Config cut 3. We now almost install a29k.
665 # Revision 1.3 1991/04/11 02:41:54 rich
666 # Cut 2 config. Subdirs.
677 # end of configure.template