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
73 -destdir=* |
+destdir
=* |
+destdi
=* |
+destd
=* |
+dest
=* |
+des
=* |
+de
=* |
+d
=*)
74 destdir
=`echo ${arg} | sed 's/[+-]d[a-z]*=//'`
76 -languages=* |
+languages
=* |
+language
=* |
+languag
=* \
77 |
+langua
=* |
+langu
=* |
+lang
=* |
+lan
=* |
+la
=* \
79 languages
="${languages} `echo ${arg} | sed 's/[+-]l[a-z]*=//'`"
96 # -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*)
97 # srcdir=`echo ${arg} | sed 's/[+-]s[a-z]*=//'`
99 -subdirs |
+f
* |
+su
*)
102 -target=* |
+target
=* |
+targe
=* |
+targ
=* |
+tar=* |
+ta
=*)
103 if [ -n "${targets}" ] ; then
107 newtargets
="${targets} `echo ${arg} | sed 's/[+-]t[a-z]*=//'`"
108 targets
="${newtargets}"
110 -template=* |
+template
=* |
+templat
=* |
+templa
=* |
+templ
=* |
+temp
=* |
+tem
=* |
+te
=*)
111 template
=`echo ${arg} | sed 's/[+-]template=//'`
118 echo "Unrecognized option: \"${arg}\"".
;
123 if [ -n "${hosts}" ] ; then
127 newhosts
="${hosts} ${arg}"
133 if [ -n "${verbose}" ] ; then
134 echo `pwd`/configure $
*
135 echo targets
=\"${targets}\"
138 # process host and target only if not rebuilding configure itself or removing.
139 if [ -z "${template}" -a -z "${removing}" -a -z "${fatal}" ] ; then
140 # Complain if an arg is missing
141 if [ -z "${hosts}" ] ; then
143 echo "configure: No HOST specified." ;
149 if [ -n "${fatal}" -o "${hosts}" = "help" ] ; then
150 (echo "Usage: configure HOST" ;
152 echo "Options: [defaults in brackets]" ;
153 echo " +ansi configure w/ANSI library. [no ansi lib]" ;
154 echo " +destdir=MYDIR configure for installation into MYDIR. [/usr/local]" ;
155 echo " +subdirs configure in subdirectories. [in source directories]" ;
156 echo " +lang=LANG configure to build LANG. [gcc]" ;
157 echo " +help print this message. [normal config]" ;
158 echo " +gas configure the compilers for use with gas. [native as]" ;
159 echo " +nfp configure the compilers default to soft floating point. [hard float]" ;
160 echo " +norecurse configure this directory only. [recurse]" ;
161 echo " +rm remove this configuration. [build a configuration]" ;
162 echo " +target=TARGET configure for TARGET. [TARGET = HOST]" ;
163 echo " +template=TEM rebuild configure using TEM. [normal config]" ;
165 echo "Where HOST and TARGET are something like \"vax\", \"sun3\", \"encore\", etc." ;
166 echo "Asking for more than one \"+target\" implies \"+subdirs\". Any other" ;
167 echo "options given will apply to all targets.") 1>&2
169 if [ -r config.status
] ; then
176 #### configure.in common parts come in here.
177 # This file is a shell script that supplies the information necessary
178 # to tailor a template configure script into the configure script
179 # appropriate for this directory. For more information, check any
180 # existing configure script.
186 ## end of common part.
188 # are we rebuilding config itself?
189 if [ -n "${template}" ] ; then
190 if [ ! -r ${template} ] ; then
191 echo "Can't find template ${template}."
196 sed -e '/^#### configure.in common parts come in here.$/,/^## end of common part.$/c\
197 #### configure.in common parts come in here.\
198 ## end of common part.' \
199 -e '/^#### configure.in per-host parts come in here.$/,/^## end of per-host part.$/c\
200 #### configure.in per-host parts come in here.\
201 ## end of per-host part.' \
202 -e '/^#### configure.in per-target parts come in here.$/,/^## end of per-target part.$/c\
203 #### configure.in per-target parts come in here.\
204 ## end of per-target part.' \
205 -e '/^#### configure.in post-target parts come in here.$/,/^## end of post-target part.$/c\
206 #### configure.in post-target parts come in here.\
207 ## end of post-target part.' \
208 < ${template} > template.new
210 if [ -r configure.
in ] ; then
211 if [ -z "`grep '^# per\-host:' configure.in`" ] ; then
212 echo `pwd`/configure.
in has no
"per-host:" line.
216 if [ -z "`grep '^# per\-target:' configure.in`" ] ; then
217 echo `pwd`/configure.
in has no
"per-target:" line.
221 # split configure.in into common, per-host, per-target,
222 # and post-target parts. Post-target is optional.
223 sed -e '/^# per\-host:/,$d' configure.
in > configure.com
224 sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' configure.
in > configure.hst
225 if grep -s '^# post-target:' configure.
in ; then
226 sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' configure.
in > configure.tgt
227 sed -e '1,/^# post\-target:/d' configure.
in > configure.pos
229 sed -e '1,/^# per\-target:/d' configure.
in > configure.tgt
234 sed -e '/^#### configure.in common parts come in here.$/ r configure.com' \
235 -e '/^#### configure.in per\-host parts come in here.$/ r configure.hst' \
236 -e '/^#### configure.in per\-target parts come in here.$/ r configure.tgt' \
237 -e '/^#### configure.in post\-target parts come in here.$/ r configure.pos' \
238 template.new
> configure.new
240 rm -f configure.com configure.tgt configure.hst configure.pos
242 echo Warning
: no configure.
in in `pwd`
243 cat ${template} >> configure
246 chmod a
+x configure.new
248 # mv configure configure.old
249 mv configure.new configure
250 echo Rebuilt configure
in `pwd`
252 if [ -z "${norecurse}" ] ; then
253 # If template is relative path, make it absolute for recursing.
254 if echo "${template}" |
grep -s '^/' ; then
257 template
=`pwd`/${template}
260 while [ -n "${configdirs}" ] ; do
261 # set configdir to car of configdirs, configdirs to cdr of configdirs
262 set ${configdirs}; configdir
=$1; shift; configdirs
=$
*
264 if [ "`echo ${configdir}.*`" != "${configdir}.*" ] ; then
265 targetspecificdirs
=${configdir}.
*
270 for i
in ${configdir} ${targetspecificdirs} ; do
272 if [ -r $i/configure
] ; then
274 .
/configure
+template
=${template} ${verbose})
276 echo No configure
script in `pwd`/$i
279 echo Warning
: directory
$i is missing.
288 # some sanity checks on configure.in
289 if [ -z "${srctrigger}" ] ; then
290 echo srctrigger not
set in configure.
in.
`pwd` not configured.
294 for host in ${hosts} ; do
296 if [ -z "${targets}" -o -n "${defaulttargets}" ] ; then
301 host_makefile_frag
=config
/hmake-
${host}
303 #### configure.in per-host parts come in here.
305 ## end of per-host part.
308 for target
in ${targets} ; do
310 if [ -n "${verbose}" ] ; then
311 echo " target=\"${target}\""
314 target_makefile_frag
=config
/tmake-
${target}
316 #### configure.in per-target parts come in here.
346 # assign object format
362 # assign floating point type
372 files
="config/ho-${host}.h config/tc-${cpu_type}.c \
373 config/tc-${cpu_type}.h config/te-${emulation}.h \
374 config/obj-${obj_format}.h config/obj-${obj_format}.c \
375 config/atof-${atof}.c"
377 links
="host.h targ-cpu.c targ-cpu.h targ-env.h obj-format.h obj-format.c atof-targ.c"
378 ## end of per-target part.
380 # Temporarily, we support only direct subdir builds.
381 hostsubdir
=Host-
${host}
382 targetsubdir
=Target-
${target}
384 if [ -n "${removing}" ] ; then
385 if [ -n "${subdirs}" ] ; then
386 if [ -d "${hostsubdir}" ] ; then
387 rm -rf ${hostsubdir}/${targetsubdir}
389 if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ] ; then
393 echo Warning
: no
`pwd`/${hostsubdir} to remove.
396 rm -f ${Makefile} config.status
${links}
399 if [ -n "${subdirs}" ] ; then
400 # check for existing status before allowing forced subdirs.
401 if [ -f ${Makefile} ] ; then
402 echo "${Makefile} already exists in source directory. `pwd` not configured."
406 if [ ! -d ${hostsubdir} ] ; then mkdir
${hostsubdir} ; fi
409 if [ ! -d ${targetsubdir} ] ; then mkdir
${targetsubdir} ; fi
414 # if not subdir builds, then make sure none exist.
415 if [ -n "`(ls .) 2>&1 | grep Host-`" ] ; then
416 echo "Configured subdirs exist. `pwd` not configured."
421 # Find the source files, if location was not specified.
422 if [ -z "${srcdir}" ] ; then
425 if [ -n "${srctrigger}" -a ! -r ${srctrigger} ] ; then
430 if [ -n "${srctrigger}" -a ! -r ${srcdir}/${srctrigger} ] ; then
431 if [ -z "${srcdirdefaulted}" ] ; then
432 echo "${progname}: Can't find ${srcname} sources in `pwd`/${srcdir}" 1>&2
434 echo "${progname}: Can
't find ${srcname} sources in `pwd`/. or `pwd`/.." 1>&2
437 echo \(At least ${srctrigger} is missing.\) 1>&2
441 # Set up the list of links to be made.
442 # ${links} is the list of link names, and ${files} is the list of names to link to.
445 while [ -n "${files}" ] ; do
446 # set file to car of files, files to cdr of files
447 set ${files}; file=$1; shift; files=$*
448 set ${links}; link=$1; shift; links=$*
450 if [ ! -r ${srcdir}/${file} ] ; then
451 echo "${progname}: cannot create a link \"${link}\"," 1>&2
452 echo "since the file \"${file}\" does not exist." 1>&2
458 # Make a symlink if possible, otherwise try a hard link
459 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
461 if [ ! -r ${link} ] ; then
462 echo "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
465 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
468 # Create a .gdbinit file which runs the one in srcdir
469 # and tells GDB to look there for source files.
475 echo "dir ." > .gdbinit
476 echo "dir ${srcdir}" >> .gdbinit
477 echo "source ${srcdir}/.gdbinit" >> .gdbinit
481 # Install a makefile, and make it set VPATH
482 # if necessary so that the sources are found.
483 # Also change its value of srcdir.
485 # FIXME-someday: This business of always writing to .tem and mv back
486 # is so that I don't screw things up
while developing. Once this
487 # template is stable, these should be optimized. xoxorich.
489 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
490 if [ "${host}" != "${target}" ] ; then
491 echo "CROSS=-DCROSS_COMPILE" > ${Makefile}
492 echo "ALL=start.encap" >> ${Makefile}
494 echo "ALL=all.internal" > ${Makefile}
497 # set target, host, VPATH
498 echo "host = ${host}" >> ${Makefile}
499 echo "target = ${target}" >> ${Makefile}
501 if [ -n "${subdirs}" ] ; then
502 echo "subdir = /${hostsubdir}/${targetsubdir}" >> ${Makefile}
504 echo "subdir
=" >> ${Makefile}
507 # echo "workdir
= `pwd`" >> ${Makefile}
508 echo "VPATH
= ${srcdir}" >> ${Makefile}
510 # add "Makefile.
in" (or whatever it's called)
511 cat ${srcdir}/${Makefile_in} >> ${Makefile}
513 # Conditionalize the makefile for this host.
514 if [ -f ${srcdir}/${host_makefile_frag} ] ; then
515 sed -e "/^
####/ r ${srcdir}/${host_makefile_frag}" ${Makefile} > Makefile.tem
516 mv Makefile.tem
${Makefile}
519 # Conditionalize the makefile for this target.
520 if [ -f ${srcdir}/${target_makefile_frag} ] ; then
521 sed -e "/^####/ r ${srcdir}/${target_makefile_frag}" ${Makefile} > Makefile.tem
522 mv Makefile.tem ${Makefile}
526 sed "s@^srcdir
= \.@srcdir
= ${srcdir}@
" ${Makefile} > Makefile.tem
527 mv Makefile.tem ${Makefile}
530 if [ -n "${destdir}" ] ; then
531 sed "s
:^destdir
=.
*$
:destdir
= ${destdir}:" ${Makefile} > Makefile.tem
532 mv Makefile.tem ${Makefile}
536 sed "s
:^SUBDIRS
=.
*$
:SUBDIRS
= ${configdirs}:" ${Makefile} > Makefile.tem
537 mv Makefile.tem ${Makefile}
540 sed "s
:^NONSUBDIRS
=.
*$
:NONSUBDIRS
= ${noconfigdirs}:" ${Makefile} > Makefile.tem
541 mv Makefile.tem ${Makefile}
544 if [ -f ${srcdir}/${host_makefile_frag} ] ; then
545 using=" using
\"${host_makefile_frag}\""
548 if [ -f ${srcdir}/${target_makefile_frag} ] ; then
549 if [ -z "${using}" ] ; then
550 andusing=" using
\"${target_makefile_frag}\""
552 andusing="${using} and
\"${target_makefile_frag}\""
558 echo "Created
\"${Makefile}\"" in `pwd`${andusing}.
560 #### configure.in post-target parts come in here.
562 ## end of post-target part.
564 if [ "${host}" = "${target}" ] ; then
565 echo "Links are now
set up
for use with a
${target}.
" \
567 # | tee ${srcdir}/config.status
569 echo "Links are now
set up
for host ${host} and target
${target}.
" \
571 # | tee ${srcdir}/config.status
577 done # for each target
579 # Now build a Makefile for this host.
580 if [ -n "${subdirs}" -a ! -n "${removing}" ] ; then
582 cat > GNUmakefile << E!O!F
583 # Makefile generated by configure for host ${host}.
585 ALL := $(shell ls -d Target-*)
588 $(foreach subdir,$(ALL),$(MAKE) -C $(subdir) \$@ &&) true
596 # If there are subdirectories, then recurse.
598 if [ -n "${norecurse}" -o -z "${configdirs}" ] ; then exit 0 ; fi
600 # configdirs is not null
601 for configdir in ${configdirs} ; do
602 echo Configuring ${configdir}...
606 if [ -n "${defaulttargets}" ] ; then
607 for host in ${hosts} ; do
608 if [ -d ${configdir}.${host} ] ; then
609 newspecifics="${specifics} ${host}"
610 specifics=${newspecifics}
612 newcommons="${commons} ${host}"
613 commons=${newcommons}
614 fi # if target specific
617 if [ -n "${commons}" ] ; then
618 if [ -d ${configdir} ] ; then
620 ./configure ${commons} ${verbose} ${subdirs} ${removing} +destdir=${destdir}) \
623 echo Warning: directory \"${configdir}\" is missing.
625 fi # if any common hosts
627 if [ -n "${specifics}" ] ; then
628 for host in ${specifics} ; do
629 echo Configuring target specific directory ${configdir}.${host}...
630 (cd ${configdir}.${host} ;
631 ./configure ${host} ${verbose} ${subdirs} ${removing} +destdir=${destdir}) \
633 done # for host in specifics
634 fi # if there are any specifics
637 for target in ${targets} ; do
638 if [ -d ${configdir}.${target} ] ; then
639 newspecifics="${specifics} ${target}"
640 specifics=${newspecifics}
642 newcommons="${commons} +target
=${target}"
643 commons=${newcommons}
646 done # check for target specific dir override
648 if [ -n "${verbose}" ] ; then
649 echo " "commons=\"${commons}\"
650 echo " "specifics=\"${specifics}\"
653 if [ -n "${commons}" ] ; then
654 if [ -d ${configdir} ] ; then
656 ./configure ${hosts} ${verbose} ${subdirs} ${removing} \
657 ${commons} +destdir=${destdir}) \
660 echo Warning: directory \"${configdir}\" is missing.
664 if [ -n "${specifics}" ] ; then
665 for target in ${specifics} ; do
666 echo Configuring target specific directory ${configdir}.${target}...
667 (cd ${configdir}.${target} ;
668 ./configure ${hosts} ${verbose} ${subdirs} ${removing} \
669 "+target
=${target}" +destdir=${destdir}) \
672 fi # if any specifics
673 fi # not default targets
680 # Revision 1.20 1991/08/14 00:29:31 rich
681 # Deal with emulations more gracefully.
683 # Revision 1.19 1991/08/08 01:12:07 rich
684 # allow +f to stand in for +subdirs
686 # Revision 1.26 1991/08/07 19:21:32 rich
687 # +forcesubdirs -> +subdirs
689 # Revision 1.25 1991/08/07 07:05:30 rich
692 # Revision 1.24 1991/08/06 19:26:01 rich
693 # revised option parsing.
695 # Revision 1.23 1991/08/06 19:12:32 rich
696 # Host-level GNUmakefiles.
698 # Revision 1.22 1991/07/20 01:22:30 rich
699 # propogate gdb changes and destdir fix
701 # Revision 1.21 1991/07/20 00:55:20 gnu
702 # Roll in new configure that handles GDB. Make sure that the "configure
"
703 # that is checked-in reflects the latest "configure.
in", which includes gdb.
705 # Revision 1.9 1991/07/06 04:35:51 gnu
706 # Fix bug in configure when iterating targets.
707 # Depend on alldeps.mak, not ${srcdir}/alldeps.mak, so it can be found
710 # Revision 1.8 1991/07/05 00:04:58 gnu
711 # Thu Jul 4 14:47:06 1991 John Gilmore (gnu at cygint.cygnus.com)
713 # * configure.in, Makefile.in: Avoid rebuilding "depend
" as much.
714 # Avoid declaring Makefile dependencies, because GNU Make stupidly
715 # tries to update it if we do.
717 # * coffread.c: Revise for minor changes to bfd internal coff
720 # * configure: If -template= is given a relative path, make it
721 # absolute before recurring in subdirectories.
723 # Revision 1.7 1991/07/04 15:59:46 gnu
724 # Make gdb work with configure. Only thing that doesn't work is the -list
725 # option (as far as I know).
727 # Revision 1.6 1991/06/04 07:28:16 gnu
728 # Change GDB over to GNU General Public License version 2.
730 # Revision 1.5 1991/05/19 07:26:54 rich
731 # configure changes and -opcode.h movement.
733 # Revision 1.4 1991/05/19 00:16:45 rich
736 # Revision 1.10 1991/05/04 00:58:38 rich
737 # Fix program name bug.
739 # Revision 1.9 1991/05/03 19:14:18 rich
740 # Changed getopt to libiberty, commented out an aborted attempt at host
741 # level Makefiles because it caused errors on +rm, add a warning for
742 # directories expected to be removed on +rm but that don't exist.
744 # Revision 1.8 1991/04/24 16:50:59 rich
745 # Three staging checkpoint.
747 # Revision 1.7 1991/04/17 01:34:47 rich
748 # Added getopt for binutils, fixed problem with host dependancies in
749 # configure.template.
751 # Revision 1.6 1991/04/16 00:18:44 rich
752 # Now handles multiple hosts and targets.
754 # Revision 1.5 1991/04/15 23:43:44 rich
755 # Now handles multiple hosts and targets.
757 # Revision 1.4 1991/04/13 02:11:03 rich
758 # Config cut 3. We now almost install a29k.
760 # Revision 1.3 1991/04/11 02:41:54 rich
761 # Cut 2 config. Subdirs.
772 # end of configure.template