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 compiling gcc.
33 # Usage: configure [+srcdir=DIR] [+host=HOST] [+gas] [+nfp] TARGET
35 # If configure succeeds, it leaves its status in config.status.
36 # If configure fails after disturbing the status quo,
37 # config.status is removed.
49 #symbolic_link="echo ln -s"
51 # 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]*=//'`
75 -host=* |
+host=* |
+hos
=* |
+ho
=* |
+h
=*)
76 host=`echo ${arg} | sed 's/[+-]h[a-z]*=//'`
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
)
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 -template=* |
+template
=*)
99 template
=`echo ${arg} | sed 's/[+-]template=//'`
102 # Allow configure HOST TARGET
103 if [ -z "${host}" ] ; then host=${target} ; fi
109 # process host and target only if not rebuilding configure itself or removing.
110 if [ -z "${template}" -a -z "${removing}" ]
112 # Complain if an arg is missing
113 if [ -z "${target}" ]
115 echo "Usage: ${progname} [+srcdir=DIR] [+host=HOST] [+gas] [+nfp] TARGET"
116 echo -n "Where HOST and TARGET are something like "
117 echo "\`vax', \`sun3', \`encore', etc."
118 if [ -r config.status
]
132 #### configure.in files come in here.
133 # This file is a shell script that supplies the information necessary
134 # to tailor a template configure script into the configure script
135 # appropriate for this directory. For more information, check any
136 # existing configure script.
163 # assign object format
179 # assign floating point type
189 files
="config/ho-${host}.h config/tc-${cpu_type}.c \
190 config/tc-${cpu_type}.h config/te-generic.h \
191 config/obj-${obj_format}.h config/obj-${obj_format}.c \
192 config/atof-${atof}.c"
194 links
="host.h targ-cpu.c targ-cpu.h targ-env.h obj-format.h obj-format.c atof-targ.c"
195 ### end of configure.in
197 # are we rebuilding config itself?
198 if [ -n "${template}" ]
200 if [ ! -r ${template} ]
202 echo "Can't find template ${template}."
206 mv configure configure.old
207 echo "#!/bin/sh" > configure
208 echo "# Please do not edit this file. It is generated automatically from" >> configure
209 echo "# configure.in and a configure template." >> configure
210 echo "configdirs=" >> configure
213 if [ -r configure.
in ]
215 sed -e "/^####/ r configure.in" ${template} >> configure
217 echo Warning
: no configure.
in in `pwd`
218 cat ${template} >> configure
223 echo Rebuilt configure
in `pwd`
225 if [ -z "${norecurse}" ]
227 while [ -n "${configdirs}" ]
229 # set configdir to car of configdirs, configdirs to cdr of configdirs
230 set ${configdirs}; configdir
=$1; shift; configdirs
=$
*
232 if [ "`echo ${configdir}.*`" != "${configdir}.*" ]
234 targetspecificdirs
=${configdir}.
*
239 for i
in ${configdir} ${targetspecificdirs}
241 if [ -r $i/configure
]
244 configure
+template
=${template})
246 echo No configure
script in `pwd`/$i
255 # some sanity checks on configure.in
256 if [ -z "${srctrigger}" ]
258 echo srctrigger not
set in configure.
in.
`pwd` not configured.
262 # Temporarily, we support only direct subdir builds.
263 hostsubdir
=Host-
${host}
264 targetsubdir
=Target-
${target}
266 if [ -n "${removing}" ]
268 if [ -d "${hostsubdir}/${targetsubdir}" ]
270 rm -rf ${hostsubdir}/${targetsubdir}
272 if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ]
277 rm -f .gdbinit Makefile config.status
${links}
280 if [ -n "${forcesubdirs}" ]
282 # check for existing status before allowing forced subdirs.
285 echo "Makefile already exists in source directory. `pwd` not configured."
289 if [ ! -d ${hostsubdir} ] ; then mkdir
${hostsubdir} ; fi
292 if [ ! -d ${targetsubdir} ] ; then mkdir
${targetsubdir} ; fi
297 # if not subdir builds, then make sure none exist.
298 if [ -n "`(ls .) 2>&1 | grep Host-`" ]
300 echo "Configured subdirs exist. `pwd` not configured."
305 # Find the source files, if location was not specified.
306 if [ -z "${srcdir}" ]
310 if [ -n "${srctrigger}" -a ! -r ${srctrigger} ]
316 if [ -n "${srctrigger}" -a ! -r ${srcdir}/${srctrigger} ]
318 if [ -z "${srcdirdefaulted}" ]
320 echo "${progname}: Can't find ${srcname} sources in \`${srcdir}'." 1>&2
322 echo "${progname}: Can't
find ${srcname} sources
in \
`.' or \`..
'." 1>&2
327 # Set up the list of links to be made.
328 # ${links} is the list of link names, and ${files} is the list of names to link to.
331 while [ -n "${files}" ]
333 # set file to car of files, files to cdr of files
334 set ${files}; file=$1; shift; files=$*
335 set ${links}; link=$1; shift; links=$*
337 if [ ! -r ${srcdir}/${file} ]
339 echo "${progname}: cannot create a link \"${link}\"," 1>&2
340 echo "since the file \"${file}\" does not exist." 1>&2
346 # Make a symlink if possible, otherwise try a hard link
347 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
351 echo "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
354 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
357 # Create a .gdbinit file which runs the one in srcdir
358 # and tells GDB to look there for source files.
364 echo "dir ." > .gdbinit
365 echo "dir ${srcdir}" >> .gdbinit
366 echo "source ${srcdir}/.gdbinit" >> .gdbinit
370 # Install a makefile, and make it set VPATH
371 # if necessary so that the sources are found.
372 # Also change its value of srcdir.
374 # FIXME-someday: This business of always writing to .tem and mv back
375 # is so that I don't screw things up
while developing. Once this
376 # template is stable, these should be optimized. xoxorich.
378 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
379 if [ "${host}" != "${target}" ]
381 echo "CROSS=-DCROSS_COMPILE" > Makefile
382 echo "ALL=start.encap" >> Makefile
384 echo "ALL=all.internal" > Makefile
387 # set target, host, VPATH
388 echo "host = ${host}" >> Makefile
389 echo "target = ${target}" >> Makefile
391 if [ -n "${forcesubdirs}" ]
393 echo "subdir = /${hostsubdir}/${targetsubdir}" >> Makefile
395 echo "subdir =" >> Makefile
398 # echo "workdir = `pwd`" >> Makefile
399 echo "VPATH = ${srcdir}" >> Makefile
402 cat ${srcdir}/Makefile.
in >> Makefile
404 # and shake thoroughly.
405 host_var_file
=hmake-
${host}
406 target_var_file
=tmake-
${target}
408 # Conditionalize the makefile for this host.
409 if [ -f ${srcdir}/config
/${host_var_file} ]
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} ]
418 sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile
> Makefile.tem
419 mv Makefile.tem Makefile
423 sed "s@^srcdir = \.@srcdir = ${srcdir}@" Makefile
> Makefile.tem
424 mv Makefile.tem Makefile
427 if [ -n "${destdir}" ]
429 sed "s:^destdir =.*$:destdir = ${destdir}:" Makefile
> Makefile.tem
430 mv Makefile.tem Makefile
433 # Remove all formfeeds, since some Makes get confused by them.
434 sed "s/\f//" Makefile
>> Makefile.tem
435 mv Makefile.tem Makefile
438 sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile
> Makefile.tem
439 mv Makefile.tem Makefile
442 sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile
> Makefile.tem
443 mv Makefile.tem Makefile
446 if [ -f ${srcdir}/config
/${host_var_file} ]
448 using
=" using \"${host_var_file}\""
451 if [ -f ${srcdir}/config
/${target_var_file} ]
455 andusing
=" using \"${target_var_file}\""
457 andusing
="${using} and \"${target_var_file}\""
463 echo "Created \"Makefile\""${andusing}.
465 if [ "${host}" = "${target}" ]
467 echo "Links are now set up for use with a ${target}." \
469 # | tee ${srcdir}/config.status
471 echo "Links are now set up for host ${host} and target ${target}." \
473 # | tee ${srcdir}/config.status
480 # If there are subdirectories, then recurse.
482 if [ -n "${norecurse}" ] ; then exit 0 ; fi
484 while [ -n "${configdirs}" ]
486 # set configdir to car of configdirs, configdirs to cdr of configdirs
487 set ${configdirs}; configdir
=$1; shift; configdirs
=$
*
489 # check for target override
490 targetspecificdir
=${configdir}.
${target}
491 if [ -d ${targetspecificdir} ]
493 configdir
=${targetspecificdir}
496 echo Configuring
${configdir}...
498 .
/configure
${forcesubdirs} ${removing} +host=${host} ${target}) \
506 # Revision 1.4 1991/04/13 02:10:29 rich
507 # Config cut 3. We now almost install a29k.
509 # Revision 1.3 1991/04/11 02:41:54 rich
510 # Cut 2 config. Subdirs.
516 # end of configure.template