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 -forcesubdirs |
+forcesubdirs |
+forcesubdir |
+forcesubdi |
+forcesubd \
77 |
+forcesub |
+forcesu |
+forces |
+force |
+forc |
+for |
+fo |
+f
)
80 -languages=* |
+languages
=* |
+language
=* |
+languag
=* \
81 |
+langua
=* |
+langu
=* |
+lang
=* |
+lan
=* |
+la
=* \
83 languages
="${languages} `echo ${arg} | sed 's/[+-]l[a-z]*=//'`"
85 -gas |
+gas |
+ga |
+g
)
91 -nfp |
+nfp |
+nf |
+n
)
94 -norecurse |
+norecurse
)
100 # -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*)
101 # srcdir=`echo ${arg} | sed 's/[+-]s[a-z]*=//'`
103 -target=* |
+target
=* |
+targe
=* |
+targ
=* |
+tar=* |
+ta
=* |
+t
=*)
104 if [ -n "${targets}" ] ; then
105 forcesubdirs
="+forcesubdirs"
108 newtargets
="${targets} `echo ${arg} | sed 's/[+-]t[a-z]*=//'`"
109 targets
="${newtargets}"
111 -template=* |
+template
=*)
112 template
=`echo ${arg} | sed 's/[+-]template=//'`
114 +verbose |
+verbos |
+verbo |
+verb |
+ver |
+ve |
+v
)
119 echo "Unrecognized option: \"${arg}\"".
;
124 if [ -n "${hosts}" ] ; then
125 forcesubdirs
="+forcesubdirs"
128 newhosts
="${hosts} ${arg}"
134 if [ -n "${verbose}" ] ; then
135 echo `pwd`/configure $
*
136 echo targets
=\"${targets}\"
139 # process host and target only if not rebuilding configure itself or removing.
140 if [ -z "${template}" -a -z "${removing}" -a -z "${fatal}" ] ; then
141 # Complain if an arg is missing
142 if [ -z "${hosts}" ] ; then
144 echo "configure: No HOST specified." ;
150 if [ -n "${fatal}" -o "${hosts}" = "help" ] ; then
151 (echo "Usage: configure HOST" ;
153 echo "Options: [defaults in brackets]" ;
154 echo " +ansi configure w/ANSI library. [no ansi lib]" ;
155 echo " +destdir=MYDIR configure for installation into MYDIR. [/usr/local]" ;
156 echo " +forcesubdirs configure in subdirectories. [in source directories]" ;
157 echo " +lang=LANG configure to build LANG. [gcc]" ;
158 echo " +help print this message. [normal config]" ;
159 echo " +gas configure the compilers for use with gas. [native as]" ;
160 echo " +nfp configure the compilers default to soft floating point. [hard float]" ;
161 echo " +norecurse configure this directory only. [recurse]" ;
162 echo " +rm remove this configuration. [build a configuration]" ;
163 echo " +target=TARGET configure for TARGET. [TARGET = HOST]" ;
164 echo " +template=TEM rebuild configure using TEM. [normal config]" ;
166 echo "Where HOST and TARGET are something like \"vax\", \"sun3\", \"encore\", etc." ;
167 echo "Asking for more than one \"+target\" implies \"+forcesubdirs\". Any other" ;
168 echo "options given will apply to all targets.") 1>&2
170 if [ -r config.status
] ; then
177 #### configure.in common parts come in here.
178 # This file is a shell script that supplies the information necessary
179 # to tailor a template configure script into the configure script
180 # appropriate for this directory. For more information, check any
181 # 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.
321 ## end of per-target part.
323 # Temporarily, we support only direct subdir builds.
324 hostsubdir
=Host-
${host}
325 targetsubdir
=Target-
${target}
327 if [ -n "${removing}" ] ; then
328 if [ -n "${forcesubdirs}" ] ; then
329 if [ -d "${hostsubdir}" ] ; then
330 rm -rf ${hostsubdir}/${targetsubdir}
332 if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ] ; then
336 echo Warning
: no
`pwd`/${hostsubdir} to remove.
339 rm -f ${Makefile} config.status
${links}
342 if [ -n "${forcesubdirs}" ] ; then
343 # check for existing status before allowing forced subdirs.
344 if [ -f ${Makefile} ] ; then
345 echo "${Makefile} already exists in source directory. `pwd` not configured."
349 if [ ! -d ${hostsubdir} ] ; then mkdir
${hostsubdir} ; fi
352 if [ ! -d ${targetsubdir} ] ; then mkdir
${targetsubdir} ; fi
357 # if not subdir builds, then make sure none exist.
358 if [ -n "`(ls .) 2>&1 | grep Host-`" ] ; then
359 echo "Configured subdirs exist. `pwd` not configured."
364 # Find the source files, if location was not specified.
365 if [ -z "${srcdir}" ] ; then
368 if [ -n "${srctrigger}" -a ! -r ${srctrigger} ] ; then
373 if [ -n "${srctrigger}" -a ! -r ${srcdir}/${srctrigger} ] ; then
374 if [ -z "${srcdirdefaulted}" ] ; then
375 echo "${progname}: Can't find ${srcname} sources in `pwd`/${srcdir}" 1>&2
377 echo "${progname}: Can
't find ${srcname} sources in `pwd`/. or `pwd`/.." 1>&2
380 echo \(At least ${srctrigger} is missing.\) 1>&2
384 # Set up the list of links to be made.
385 # ${links} is the list of link names, and ${files} is the list of names to link to.
388 while [ -n "${files}" ] ; do
389 # set file to car of files, files to cdr of files
390 set ${files}; file=$1; shift; files=$*
391 set ${links}; link=$1; shift; links=$*
393 if [ ! -r ${srcdir}/${file} ] ; then
394 echo "${progname}: cannot create a link \"${link}\"," 1>&2
395 echo "since the file \"${file}\" does not exist." 1>&2
401 # Make a symlink if possible, otherwise try a hard link
402 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
404 if [ ! -r ${link} ] ; then
405 echo "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
408 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
411 # Create a .gdbinit file which runs the one in srcdir
412 # and tells GDB to look there for source files.
418 echo "dir ." > .gdbinit
419 echo "dir ${srcdir}" >> .gdbinit
420 echo "source ${srcdir}/.gdbinit" >> .gdbinit
424 # Install a makefile, and make it set VPATH
425 # if necessary so that the sources are found.
426 # Also change its value of srcdir.
428 # FIXME-someday: This business of always writing to .tem and mv back
429 # is so that I don't screw things up
while developing. Once this
430 # template is stable, these should be optimized. xoxorich.
432 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
433 if [ "${host}" != "${target}" ] ; then
434 echo "CROSS=-DCROSS_COMPILE" > ${Makefile}
435 echo "ALL=start.encap" >> ${Makefile}
437 echo "ALL=all.internal" > ${Makefile}
440 # set target, host, VPATH
441 echo "host = ${host}" >> ${Makefile}
442 echo "target = ${target}" >> ${Makefile}
444 if [ -n "${forcesubdirs}" ] ; then
445 echo "subdir = /${hostsubdir}/${targetsubdir}" >> ${Makefile}
447 echo "subdir
=" >> ${Makefile}
450 # echo "workdir
= `pwd`" >> ${Makefile}
451 echo "VPATH
= ${srcdir}" >> ${Makefile}
453 # add "Makefile.
in" (or whatever it's called)
454 cat ${srcdir}/${Makefile_in} >> ${Makefile}
456 # Conditionalize the makefile for this host.
457 if [ -f ${srcdir}/${host_makefile_frag} ] ; then
458 sed -e "/^
####/ r ${srcdir}/${host_makefile_frag}" ${Makefile} > Makefile.tem
459 mv Makefile.tem
${Makefile}
462 # Conditionalize the makefile for this target.
463 if [ -f ${srcdir}/${target_makefile_frag} ] ; then
464 sed -e "/^####/ r ${srcdir}/${target_makefile_frag}" ${Makefile} > Makefile.tem
465 mv Makefile.tem ${Makefile}
469 sed "s@^srcdir
= \.@srcdir
= ${srcdir}@
" ${Makefile} > Makefile.tem
470 mv Makefile.tem ${Makefile}
473 if [ -n "${destdir}" ] ; then
474 sed "s
:^destdir
=.
*$
:destdir
= ${destdir}:" ${Makefile} > Makefile.tem
475 mv Makefile.tem ${Makefile}
479 sed "s
:^SUBDIRS
=.
*$
:SUBDIRS
= ${configdirs}:" ${Makefile} > Makefile.tem
480 mv Makefile.tem ${Makefile}
483 sed "s
:^NONSUBDIRS
=.
*$
:NONSUBDIRS
= ${noconfigdirs}:" ${Makefile} > Makefile.tem
484 mv Makefile.tem ${Makefile}
487 if [ -f ${srcdir}/${host_makefile_frag} ] ; then
488 using=" using
\"${host_makefile_frag}\""
491 if [ -f ${srcdir}/${target_makefile_frag} ] ; then
492 if [ -z "${using}" ] ; then
493 andusing=" using
\"${target_makefile_frag}\""
495 andusing="${using} and
\"${target_makefile_frag}\""
501 echo "Created
\"${Makefile}\"" in `pwd`${andusing}.
503 #### configure.in post-target parts come in here.
505 ## end of post-target part.
507 if [ "${host}" = "${target}" ] ; then
508 echo "Links are now
set up
for use with a
${target}.
" \
510 # | tee ${srcdir}/config.status
512 echo "Links are now
set up
for host ${host} and target
${target}.
" \
514 # | tee ${srcdir}/config.status
520 done # for each target
522 # Now build a Makefile for this host.
523 if [ -n "${forcesubdirs}" -a ! -n "${removing}" ] ; then
525 cat > GNUmakefile << E!O!F
526 # Makefile generated by configure for host ${host}.
528 ALL := $(shell ls -d Target-*)
531 $(foreach subdir,$(ALL),$(MAKE) -C $(subdir) \$@ &&) true
539 # If there are subdirectories, then recurse.
541 if [ -n "${norecurse}" -o -z "${configdirs}" ] ; then exit 0 ; fi
543 # configdirs is not null
544 for configdir in ${configdirs} ; do
545 echo Configuring ${configdir}...
549 if [ -n "${defaulttargets}" ] ; then
550 for host in ${hosts} ; do
551 if [ -d ${configdir}.${host} ] ; then
552 newspecifics="${specifics} ${host}"
553 specifics=${newspecifics}
555 newcommons="${commons} ${host}"
556 commons=${newcommons}
557 fi # if target specific
560 if [ -n "${commons}" ] ; then
561 if [ -d ${configdir} ] ; then
563 ./configure ${commons} ${verbose} ${forcesubdirs} ${removing} +destdir=${destdir}) \
566 echo Warning: directory \"${configdir}\" is missing.
568 fi # if any common hosts
570 if [ -n "${specifics}" ] ; then
571 for host in ${specifics} ; do
572 echo Configuring target specific directory ${configdir}.${host}...
573 (cd ${configdir}.${host} ;
574 ./configure ${host} ${verbose} ${forcesubdirs} ${removing} +destdir=${destdir}) \
576 done # for host in specifics
577 fi # if there are any specifics
580 for target in ${targets} ; do
581 if [ -d ${configdir}.${target} ] ; then
582 newspecifics="${specifics} ${target}"
583 specifics=${newspecifics}
585 newcommons="${commons} +target
=${target}"
586 commons=${newcommons}
589 done # check for target specific dir override
591 if [ -n "${verbose}" ] ; then
592 echo " "commons=\"${commons}\"
593 echo " "specifics=\"${specifics}\"
596 if [ -n "${commons}" ] ; then
597 if [ -d ${configdir} ] ; then
599 ./configure ${hosts} ${verbose} ${forcesubdirs} ${removing} \
600 ${commons} +destdir=${destdir}) \
603 echo Warning: directory \"${configdir}\" is missing.
607 if [ -n "${specifics}" ] ; then
608 for target in ${specifics} ; do
609 echo Configuring target specific directory ${configdir}.${target}...
610 (cd ${configdir}.${target} ;
611 ./configure ${hosts} ${verbose} ${forcesubdirs} ${removing} \
612 "+target
=${target}" +destdir=${destdir}) \
615 fi # if any specifics
616 fi # not default targets
623 # Revision 1.13 1991/08/06 19:12:16 rich
624 # Host-level GNUmakefiles.
626 # Revision 1.22 1991/07/20 01:22:30 rich
627 # propogate gdb changes and destdir fix
629 # Revision 1.21 1991/07/20 00:55:20 gnu
630 # Roll in new configure that handles GDB. Make sure that the "configure
"
631 # that is checked-in reflects the latest "configure.
in", which includes gdb.
633 # Revision 1.9 1991/07/06 04:35:51 gnu
634 # Fix bug in configure when iterating targets.
635 # Depend on alldeps.mak, not ${srcdir}/alldeps.mak, so it can be found
638 # Revision 1.8 1991/07/05 00:04:58 gnu
639 # Thu Jul 4 14:47:06 1991 John Gilmore (gnu at cygint.cygnus.com)
641 # * configure.in, Makefile.in: Avoid rebuilding "depend
" as much.
642 # Avoid declaring Makefile dependencies, because GNU Make stupidly
643 # tries to update it if we do.
645 # * coffread.c: Revise for minor changes to bfd internal coff
648 # * configure: If -template= is given a relative path, make it
649 # absolute before recurring in subdirectories.
651 # Revision 1.7 1991/07/04 15:59:46 gnu
652 # Make gdb work with configure. Only thing that doesn't work is the -list
653 # option (as far as I know).
655 # Revision 1.6 1991/06/04 07:28:16 gnu
656 # Change GDB over to GNU General Public License version 2.
658 # Revision 1.5 1991/05/19 07:26:54 rich
659 # configure changes and -opcode.h movement.
661 # Revision 1.4 1991/05/19 00:16:45 rich
664 # Revision 1.10 1991/05/04 00:58:38 rich
665 # Fix program name bug.
667 # Revision 1.9 1991/05/03 19:14:18 rich
668 # Changed getopt to libiberty, commented out an aborted attempt at host
669 # level Makefiles because it caused errors on +rm, add a warning for
670 # directories expected to be removed on +rm but that don't exist.
672 # Revision 1.8 1991/04/24 16:50:59 rich
673 # Three staging checkpoint.
675 # Revision 1.7 1991/04/17 01:34:47 rich
676 # Added getopt for binutils, fixed problem with host dependancies in
677 # configure.template.
679 # Revision 1.6 1991/04/16 00:18:44 rich
680 # Now handles multiple hosts and targets.
682 # Revision 1.5 1991/04/15 23:43:44 rich
683 # Now handles multiple hosts and targets.
685 # Revision 1.4 1991/04/13 02:11:03 rich
686 # Config cut 3. We now almost install a29k.
688 # Revision 1.3 1991/04/11 02:41:54 rich
689 # Cut 2 config. Subdirs.
700 # end of configure.template