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 fragment that supplies the information
134 # necessary to tailor a template configure script into the configure
135 # script appropriate for this directory. For more information, check
136 # any existing configure script.
138 configdirs
="bfd binutils ld gas gcc clib"
139 srctrigger
=README.configure
140 srcname
="gnu development package"
141 ### end of configure.in
143 # are we rebuilding config itself?
144 if [ -n "${template}" ]
146 if [ ! -r ${template} ]
148 echo "Can't find template ${template}."
152 mv configure configure.old
153 echo "#!/bin/sh" > configure
154 echo "# Please do not edit this file. It is generated automatically from" >> configure
155 echo "# configure.in and a configure template." >> configure
156 echo "configdirs=" >> configure
159 if [ -r configure.
in ]
161 sed -e "/^####/ r configure.in" ${template} >> configure
163 echo Warning
: no configure.
in in `pwd`
164 cat ${template} >> configure
169 echo Rebuilt configure
in `pwd`
171 if [ -z "${norecurse}" ]
173 while [ -n "${configdirs}" ]
175 # set configdir to car of configdirs, configdirs to cdr of configdirs
176 set ${configdirs}; configdir
=$1; shift; configdirs
=$
*
178 if [ "`echo ${configdir}.*`" != "${configdir}.*" ]
180 targetspecificdirs
=${configdir}.
*
185 for i
in ${configdir} ${targetspecificdirs}
187 if [ -r $i/configure
]
190 configure
+template
=${template})
192 echo No configure
script in `pwd`/$i
201 # some sanity checks on configure.in
202 if [ -z "${srctrigger}" ]
204 echo srctrigger not
set in configure.
in.
`pwd` not configured.
208 # Temporarily, we support only direct subdir builds.
209 hostsubdir
=Host-
${host}
210 targetsubdir
=Target-
${target}
212 if [ -n "${removing}" ]
214 if [ -d "${hostsubdir}/${targetsubdir}" ]
216 rm -rf ${hostsubdir}/${targetsubdir}
218 if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ]
223 rm -f .gdbinit Makefile config.status
${links}
226 if [ -n "${forcesubdirs}" ]
228 # check for existing status before allowing forced subdirs.
231 echo "Makefile already exists in source directory. `pwd` not configured."
235 if [ ! -d ${hostsubdir} ] ; then mkdir
${hostsubdir} ; fi
238 if [ ! -d ${targetsubdir} ] ; then mkdir
${targetsubdir} ; fi
243 # if not subdir builds, then make sure none exist.
244 if [ -n "`(ls .) 2>&1 | grep Host-`" ]
246 echo "Configured subdirs exist. `pwd` not configured."
251 # Find the source files, if location was not specified.
252 if [ -z "${srcdir}" ]
256 if [ -n "${srctrigger}" -a ! -r ${srctrigger} ]
262 if [ -n "${srctrigger}" -a ! -r ${srcdir}/${srctrigger} ]
264 if [ -z "${srcdirdefaulted}" ]
266 echo "${progname}: Can't find ${srcname} sources in \`${srcdir}'." 1>&2
268 echo "${progname}: Can't
find ${srcname} sources
in \
`.' or \`..
'." 1>&2
273 # Set up the list of links to be made.
274 # ${links} is the list of link names, and ${files} is the list of names to link to.
277 while [ -n "${files}" ]
279 # set file to car of files, files to cdr of files
280 set ${files}; file=$1; shift; files=$*
281 set ${links}; link=$1; shift; links=$*
283 if [ ! -r ${srcdir}/${file} ]
285 echo "${progname}: cannot create a link \"${link}\"," 1>&2
286 echo "since the file \"${file}\" does not exist." 1>&2
292 # Make a symlink if possible, otherwise try a hard link
293 ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link}
297 echo "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2
300 echo "Linked \"${link}\" to \"${srcdir}/${file}\"."
303 # Create a .gdbinit file which runs the one in srcdir
304 # and tells GDB to look there for source files.
310 echo "dir ." > .gdbinit
311 echo "dir ${srcdir}" >> .gdbinit
312 echo "source ${srcdir}/.gdbinit" >> .gdbinit
316 # Install a makefile, and make it set VPATH
317 # if necessary so that the sources are found.
318 # Also change its value of srcdir.
320 # FIXME-someday: This business of always writing to .tem and mv back
321 # is so that I don't screw things up
while developing. Once this
322 # template is stable, these should be optimized. xoxorich.
324 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
325 if [ "${host}" != "${target}" ]
327 echo "CROSS=-DCROSS_COMPILE" > Makefile
328 echo "ALL=start.encap" >> Makefile
330 echo "ALL=all.internal" > Makefile
333 # set target, host, VPATH
334 echo "host = ${host}" >> Makefile
335 echo "target = ${target}" >> Makefile
337 if [ -n "${forcesubdirs}" ]
339 echo "subdir = /${hostsubdir}/${targetsubdir}" >> Makefile
341 echo "subdir =" >> Makefile
344 # echo "workdir = `pwd`" >> Makefile
345 echo "VPATH = ${srcdir}" >> Makefile
348 cat ${srcdir}/Makefile.
in >> Makefile
350 # and shake thoroughly.
351 host_var_file
=hmake-
${host}
352 target_var_file
=tmake-
${target}
354 # Conditionalize the makefile for this host.
355 if [ -f ${srcdir}/config
/${host_var_file} ]
357 sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile
> Makefile.tem
358 mv Makefile.tem Makefile
361 # Conditionalize the makefile for this target.
362 if [ -f ${srcdir}/config
/${target_var_file} ]
364 sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile
> Makefile.tem
365 mv Makefile.tem Makefile
369 sed "s@^srcdir = \.@srcdir = ${srcdir}@" Makefile
> Makefile.tem
370 mv Makefile.tem Makefile
373 if [ -n "${destdir}" ]
375 sed "s:^destdir =.*$:destdir = ${destdir}:" Makefile
> Makefile.tem
376 mv Makefile.tem Makefile
379 # Remove all formfeeds, since some Makes get confused by them.
380 sed "s/\f//" Makefile
>> Makefile.tem
381 mv Makefile.tem Makefile
384 sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile
> Makefile.tem
385 mv Makefile.tem Makefile
388 sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile
> Makefile.tem
389 mv Makefile.tem Makefile
392 if [ -f ${srcdir}/config
/${host_var_file} ]
394 using
=" using \"${host_var_file}\""
397 if [ -f ${srcdir}/config
/${target_var_file} ]
401 andusing
=" using \"${target_var_file}\""
403 andusing
="${using} and \"${target_var_file}\""
409 echo "Created \"Makefile\""${andusing}.
411 if [ "${host}" = "${target}" ]
413 echo "Links are now set up for use with a ${target}." \
415 # | tee ${srcdir}/config.status
417 echo "Links are now set up for host ${host} and target ${target}." \
419 # | tee ${srcdir}/config.status
426 # If there are subdirectories, then recurse.
428 if [ -n "${norecurse}" ] ; then exit 0 ; fi
430 while [ -n "${configdirs}" ]
432 # set configdir to car of configdirs, configdirs to cdr of configdirs
433 set ${configdirs}; configdir
=$1; shift; configdirs
=$
*
435 # check for target override
436 targetspecificdir
=${configdir}.
${target}
437 if [ -d ${targetspecificdir} ]
439 configdir
=${targetspecificdir}
442 echo Configuring
${configdir}...
444 .
/configure
${forcesubdirs} ${removing} +host=${host} ${target}) \
452 # Revision 1.4 1991/04/13 02:11:07 rich
453 # Config cut 3. We now almost install a29k.
455 # Revision 1.3 1991/04/11 02:41:54 rich
456 # Cut 2 config. Subdirs.
462 # end of configure.template