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.
68 -destdir=* |
+destdir
=* |
+destdi
=* |
+destd
=* |
+dest
=* |
+des
=* |
+de
=* |
+d
=*)
69 destdir
=`echo ${arg} | sed 's/[+-]d[a-z]*=//'`
71 -forcesubdirs |
+forcesubdirs |
+f
)
74 -languages=* |
+languages
=* |
+language
=* |
+languag
=* \
75 |
+langua
=* |
+langu
=* |
+lang
=* |
+lan
=* |
+la
=* \
77 languages
="${languages} `echo ${arg} | sed 's/[+-]l[a-z]*=//'`"
79 -gas |
+gas |
+ga |
+g
)
85 -nfp |
+nfp |
+nf |
+n
)
88 -norecurse |
+norecurse
)
94 # -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*)
95 # srcdir=`echo ${arg} | sed 's/[+-]s[a-z]*=//'`
97 -target=* |
+target
=* |
+targe
=* |
+targ
=* |
+tar=* |
+ta
=* |
+t
=*)
98 if [ -n "${targets}" ] ; then
99 forcesubdirs
="+forcesubdirs"
102 newtargets
="${targets} `echo ${arg} | sed 's/[+-]t[a-z]*=//'`"
103 targets
="${newtargets}"
105 -template=* |
+template
=*)
106 template
=`echo ${arg} | sed 's/[+-]template=//'`
108 +verbose |
+verbos |
+verbo |
+verb |
+ver |
+ve |
+v
)
113 echo "Unrecognized option: \"${arg}\"".
;
118 if [ -n "${hosts}" ] ; then
119 forcesubdirs
="+forcesubdirs"
122 newhosts
="${hosts} ${arg}"
128 if [ -n "${verbose}" ] ; then
129 echo `pwd`/configure $
*
130 echo targets
=\"${targets}\"
133 # process host and target only if not rebuilding configure itself or removing.
134 if [ -z "${template}" -a -z "${removing}" -a -z "${fatal}" ] ; then
135 # Complain if an arg is missing
136 if [ -z "${hosts}" ] ; then
138 echo "configure: No HOST specified." ;
144 if [ -n "${fatal}" -o "${hosts}" = "help" ] ; then
145 (echo "Usage: configure HOST" ;
147 echo "Options: [defaults in brackets]" ;
148 echo " +ansi configure w/ANSI library. [no ansi lib]" ;
149 echo " +destdir=MYDIR configure for installation into MYDIR. [/usr/local]" ;
150 echo " +forcesubdirs configure in subdirectories. [in source directories]" ;
151 echo " +lang=LANG configure to build LANG. [gcc]" ;
152 echo " +help print this message. [normal config]" ;
153 echo " +gas configure the compilers for use with gas. [native as]" ;
154 echo " +nfp configure the compilers default to soft floating point. [hard float]" ;
155 echo " +norecurse configure this directory only. [recurse]" ;
156 echo " +rm remove this configuration. [build a configuration]" ;
157 echo " +target=TARGET configure for TARGET. [TARGET = HOST]" ;
158 echo " +template=TEM rebuild configure using TEM. [normal config]" ;
160 echo "Where HOST and TARGET are something like \"vax\", \"sun3\", \"encore\", etc." ;
161 echo "Asking for more than one \"+target\" implies \"+forcesubdirs\". Any other" ;
162 echo "options given will apply to all targets.") 1>&2
164 if [ -r config.status
] ; then
171 #### configure.in common parts come in here.
172 # This file is a shell script fragment that supplies the information
173 # necessary to tailor a template configure script into the configure
174 # script appropriate for this directory. For more information, check
175 # any existing configure script.
177 configdirs
="bfd binutils ld gas gnulib gcc clib"
178 srctrigger
=README.configure
179 srcname
="gnu development package"
183 ## end of common part
185 # are we rebuilding config itself?
186 if [ -n "${template}" ] ; then
187 if [ ! -r ${template} ] ; then
188 echo "Can't find template ${template}."
192 mv configure configure.old
193 echo "#!/bin/sh" > configure
194 echo "# Please do not edit this file. It is generated automatically from" >> configure
195 echo "# configure.in and a configure template." >> configure
196 echo "configdirs=" >> configure
199 if [ -r configure.
in ] ; then
200 if [ -z "`grep '^# per\-host:' configure.in`" ] ; then
201 echo `pwd`/configure.
in has no
"per-host:" line.
205 if [ -z "`grep '^# per\-target:' configure.in`" ] ; then
206 echo `pwd`/configure.
in has no
"per-target:" line.
210 sed -e '/^# per\-target:/,$d' configure.
in > configure.com
211 sed -e '1,/^# per\-target:/d' configure.
in > configure.tgt
213 sed -e '/^#### configure.in common parts/ r configure.com' \
214 -e '/^##### / r configure.tgt' \
215 ${template} >> configure
217 rm -f configure.top configure.bot
219 echo Warning
: no configure.
in in `pwd`
220 cat ${template} >> configure
225 echo Rebuilt configure
in `pwd`
227 if [ -z "${norecurse}" ] ; then
228 while [ -n "${configdirs}" ] ; do
229 # set configdir to car of configdirs, configdirs to cdr of configdirs
230 set ${configdirs}; configdir
=$1; shift; configdirs
=$
*
232 if [ "`echo ${configdir}.*`" != "${configdir}.*" ] ; then
233 targetspecificdirs
=${configdir}.
*
238 for i
in ${configdir} ${targetspecificdirs} ; do
239 if [ -r $i/configure
] ; then
241 .
/configure
+template
=${template} ${verbose})
243 echo No configure
script in `pwd`/$i
252 # some sanity checks on configure.in
253 if [ -z "${srctrigger}" ] ; then
254 echo srctrigger not
set in configure.
in.
`pwd` not configured.
258 for host in ${hosts} ; do
260 if [ -z "${targets}" ] ; then
264 #### configure.in per-host parts come in here.
265 ## end of per-target part
268 for target
in ${targets} ; do
270 if [ -n "${verbose}" ] ; then
271 echo " "target
=\"${target}\"
274 #### configure.in per-target parts come in here.
275 ## end of per-target part
277 # Temporarily, we support only direct subdir builds.
278 hostsubdir
=Host-
${host}
279 targetsubdir
=Target-
${target}
281 if [ -n "${removing}" ] ; then
282 if [ -d "${hostsubdir}/${targetsubdir}" ] ; then
283 rm -rf ${hostsubdir}/${targetsubdir}
285 if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ] ; then
289 rm -f Makefile config.status
${links}
292 if [ -n "${forcesubdirs}" ] ; then
293 # check for existing status before allowing forced subdirs.
294 if [ -f Makefile
] ; then
295 echo "Makefile already exists in source directory. `pwd` not configured."
299 if [ ! -d ${hostsubdir} ] ; then mkdir
${hostsubdir} ; fi
302 if [ ! -d ${targetsubdir} ] ; then mkdir
${targetsubdir} ; fi
307 # if not subdir builds, then make sure none exist.
308 if [ -n "`(ls .) 2>&1 | grep Host-`" ] ; then
309 echo "Configured subdirs exist. `pwd` not configured."
314 # Find the source files, if location was not specified.
315 if [ -z "${srcdir}" ] ; then
318 if [ -n "${srctrigger}" -a ! -r ${srctrigger} ] ; then
323 if [ -n "${srctrigger}" -a ! -r ${srcdir}/${srctrigger} ] ; then
324 if [ -z "${srcdirdefaulted}" ] ; then
325 echo "${progname}: Can't find ${srcname} sources in \`${srcdir}'." 1>&2
327 echo "${progname}: Can't
find ${srcname} sources
in \
`.' or \`..
'." 1>&2
333 # Set up the list of links to be made.
334 # ${links} is the list of link names, and ${files} is the list of names to link to.
337 while [ -n "${files}" ] ; do
338 # set file to car of files, files to cdr of files
339 set ${files}; file=$1; shift; files=$*
340 set ${links}; link=$1; shift; links=$*
342 if [ ! -r ${srcdir}/${file} ] ; then
343 echo "${progname}: cannot create a link \"${link}\"," 1>&2
344 echo "since the file \"${file}\" does not exist." 1>&2
350 # Make a symlink if possible, otherwise try a hard link
351 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
353 if [ ! -r ${link} ] ; then
354 echo "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
357 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
360 # Create a .gdbinit file which runs the one in srcdir
361 # and tells GDB to look there for source files.
367 echo "dir ." > .gdbinit
368 echo "dir ${srcdir}" >> .gdbinit
369 echo "source ${srcdir}/.gdbinit" >> .gdbinit
373 # Install a makefile, and make it set VPATH
374 # if necessary so that the sources are found.
375 # Also change its value of srcdir.
377 # FIXME-someday: This business of always writing to .tem and mv back
378 # is so that I don't screw things up
while developing. Once this
379 # template is stable, these should be optimized. xoxorich.
381 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
382 if [ "${host}" != "${target}" ] ; then
383 echo "CROSS=-DCROSS_COMPILE" > Makefile
384 echo "ALL=start.encap" >> Makefile
386 echo "ALL=all.internal" > Makefile
389 # set target, host, VPATH
390 echo "host = ${host}" >> Makefile
391 echo "target = ${target}" >> Makefile
393 if [ -n "${forcesubdirs}" ] ; then
394 echo "subdir = /${hostsubdir}/${targetsubdir}" >> Makefile
396 echo "subdir =" >> Makefile
399 # echo "workdir = `pwd`" >> Makefile
400 echo "VPATH = ${srcdir}" >> Makefile
403 cat ${srcdir}/Makefile.
in >> Makefile
405 # and shake thoroughly.
406 host_var_file
=hmake-
${host}
407 target_var_file
=tmake-
${target}
409 # Conditionalize the makefile for this host.
410 if [ -f ${srcdir}/config
/${host_var_file} ] ; then
411 sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile
> Makefile.tem
412 mv Makefile.tem Makefile
415 # Conditionalize the makefile for this target.
416 if [ -f ${srcdir}/config
/${target_var_file} ] ; then
417 sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile
> Makefile.tem
418 mv Makefile.tem Makefile
422 sed "s@^srcdir = \.@srcdir = ${srcdir}@" Makefile
> Makefile.tem
423 mv Makefile.tem Makefile
426 if [ -n "${destdir}" ] ; then
427 sed "s:^destdir =.*$:destdir = ${destdir}:" Makefile
> Makefile.tem
428 mv Makefile.tem Makefile
431 # Remove all formfeeds, since some Makes get confused by them.
432 sed "s/\f//" Makefile
>> Makefile.tem
433 mv Makefile.tem Makefile
436 sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile
> Makefile.tem
437 mv Makefile.tem Makefile
440 sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile
> Makefile.tem
441 mv Makefile.tem Makefile
444 if [ -f ${srcdir}/config
/${host_var_file} ] ; then
445 using
=" using \"${host_var_file}\""
448 if [ -f ${srcdir}/config
/${target_var_file} ] ; then
449 if [ -z "${using}" ] ; then
450 andusing
=" using \"${target_var_file}\""
452 andusing
="${using} and \"${target_var_file}\""
458 echo "Created \"Makefile\"" in `pwd`${andusing}.
460 if [ "${host}" = "${target}" ] ; then
461 echo "Links are now set up for use with a ${target}." \
463 # | tee ${srcdir}/config.status
465 echo "Links are now set up for host ${host} and target ${target}." \
467 # | tee ${srcdir}/config.status
476 # If there are subdirectories, then recurse.
478 if [ -n "${norecurse}" -o -z "${configdirs}" ] ; then exit 0 ; fi
480 # configdirs is not null
481 for configdir
in ${configdirs} ; do
482 echo Configuring
${configdir}...
486 for target
in ${targets} ; do
487 # check for target specific dir override
488 if [ -d ${configdir}.
${target} ] ; then
489 newspecifics
="${specifics} ${target}"
490 specifics
=${newspecifics}
492 newcommons
="${commons} +target=${target}"
493 commons
=${newcommons}
498 if [ -n "${verbose}" ] ; then
499 echo " "commons
=\"${commons}\"
500 echo " "specifics
=\"${specifics}\"
503 if [ -n "${commons}" ] ; then
505 .
/configure
${host} ${verbose} ${forcesubdirs} ${removing} ${commons}) \
509 if [ -n "${specifics}" ] ; then
510 for target
in ${specifics} ; do
511 echo Configuring target specific directory
${configdir}.
${target}...
512 (cd ${configdir}.
${target} ;
513 .
/configure
${host} ${verbose} ${forcesubdirs} ${removing} "+target=${target}") \
523 # Revision 1.2 1991/04/15 23:46:48 rich
524 # Now handles multiple hosts and targets.
526 # Revision 1.4 1991/04/13 02:11:03 rich
527 # Config cut 3. We now almost install a29k.
529 # Revision 1.3 1991/04/11 02:41:54 rich
530 # Cut 2 config. Subdirs.
541 # end of configure.template