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.
65 -template=* | +template=*)
66 template=`echo $arg | sed 's/[+-]template=//'`
68 -norecurse | +norecurse)
74 -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*)
75 srcdir=`echo $arg | sed 's/[+-]s[a-z]*=//'`
77 -host=* | +host=* | +hos=* | +ho=* | +h=*)
78 host=`echo $arg | sed 's/[+-]h[a-z]*=//'`
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)
88 -nfp | +nfp | +nf | +n)
92 # Allow configure HOST TARGET
93 if [ x$host = x ] ; then host=$target ; fi
99 # process host and target only if not rebuilding configure itself.
100 if [ -z "$template" -a -z "$removing" ]
102 # Complain if an arg is missing
105 echo "Usage: $progname [+srcdir=DIR] [+host=HOST] [+gas] [+nfp] TARGET"
106 echo -n "Where HOST and TARGET are something like "
107 echo "\`vax', \`sun3', \`encore', etc."
108 if [ -r config.status ]
123 #### configure.in files come in here.
124 # This file is a shell script that supplies the information necessary
125 # to tailor a template configure script into the configure script
126 # appropriate for this directory. For more information, check any
127 # existing configure script.
133 ### end of configure.in
135 # are we rebuilding config itself?
136 if [ -n "$template" ]
138 if [ ! -r $template ]
140 echo "Can't find template ${template}."
144 mv configure configure.old
145 echo "#!/bin/sh" > configure
146 echo "# Please do not edit this file. It is generated automatically from" >> configure
147 echo "# configure.in and a configure template." >> configure
148 echo "configdirs=" >> configure
151 if [ -r configure.in ]
153 sed -e "/^####/ r configure.in" $template >> configure
155 cat $template >> configure
160 echo Rebuilt configure in `pwd`
162 if [ x$norecurse = x ]
164 while [ -n "$configdirs" ]
166 # set configdir to car of configdirs, configdirs to cdr of configdirs
167 set $configdirs; configdir=$1; shift; configdirs=$*
169 if [ "`echo ${configdir}.*`" != "${configdir}.*" ]
171 targetspecificdirs=${configdir}.*
176 for i in ${configdir} ${targetspecificdirs}
178 if [ -r $i/configure ]
181 configure +template=${template})
183 echo No configure script in `pwd`/$i
192 # Temporarily, we support only direct subdir builds.
193 hostsubdir=Host-$host
194 targetsubdir=Target-$target
196 if [ -n "$removing" ]
198 # rm -rf $hostsubdir/$targetsubdir
200 # if [ -z "`(ls $hostsubdir) 2>&1 | grep Target-`" ]
205 rm -f .gdbinit Makefile config.status $links
208 # if [ ! -d $hostsubdir ] ; then mkdir $hostsubdir ; fi
211 # if [ ! -d $targetsubdir ] ; then mkdir $targetsubdir ; fi
216 # Find the source files, if location was not specified.
221 if [ ! -r ${srctrigger} ]
227 if [ ! -r ${srcdir}/${srctrigger} ]
229 if [ -z "$srcdirdefaulted" ]
231 echo "$progname: Can't find ${srcname} sources in \`${srcdir}'." 1>&2
233 echo "$progname: Can't find ${srcname} sources in \`.' or \`..'." 1>&2
238 # Set up the list of links to be made.
239 # $links is the list of link names, and $files is the list of names to link to.
242 while [ -n "$files" ]
244 # set file to car of files, files to cdr of files
245 set $files; file=$1; shift; files=$*
246 set $links; link=$1; shift; links=$*
248 if [ ! -r ${srcdir}/${file} ]
250 echo "$progname: cannot create a link \"${link}\"," 1>&2
251 echo "since the file \"$file\" does not exist." 1>&2
257 # Make a symlink if possible, otherwise try a hard link
258 $symbolic_link ${srcdir}/$file $link 2>/dev/null || $hard_link ${srcdir}/$file $link
262 echo "$progname: unable to link \"$link\" to \"${srcdir}/$file\"." 1>&2
265 echo "Linked \"$link\" to \"${srcdir}/${file}\"."
268 # Install a makefile, and make it set VPATH
269 # if necessary so that the sources are found.
270 # Also change its value of srcdir.
271 # Also create a .gdbinit file which runs the one in srcdir
272 # and tells GDB to look there for source files.
277 echo "VPATH = ${srcdir}" > x
278 cat x ${srcdir}/Makefile.in | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.in
280 echo "dir ." > .gdbinit
281 echo "dir ${srcdir}" >> .gdbinit
282 echo "source ${srcdir}/.gdbinit" >> .gdbinit
286 host_var_file=hmake-${host}
287 target_var_file=tmake-${target}
289 # Conditionalize the makefile for this machine.
290 if [ -f ${srcdir}/config/${host_var_file} ]
292 sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile.in > Makefile.tem
294 cp Makefile.in Makefile.tem
297 if [ -f ${srcdir}/config/${target_var_file} ]
299 sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile.tem > Makefile.tem1
300 mv Makefile.tem1 Makefile.tem
303 # Remove all formfeeds, since some Makes get confused by them.
304 sed "s/
\f//" Makefile.tem >> Makefile.tem1
305 mv Makefile.tem1 Makefile.tem
308 sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile.tem > Makefile.tem1
309 mv Makefile.tem1 Makefile.tem
312 sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile.tem > Makefile.tem1
313 mv Makefile.tem1 Makefile.tem
315 # Delete the intermediate files
316 if [ x$srcdir != x. ] ; then rm Makefile.in ; fi
320 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
321 if [ x$host != x$target ]
323 echo "CROSS=-DCROSS_COMPILE" > Makefile
324 echo "ALL=start.encap" >> Makefile
326 echo "ALL=all.internal" > Makefile
329 # set target and host
330 echo "host = $host" >> Makefile
331 echo "target = $target" >> Makefile
333 cat Makefile.tem >> Makefile
337 if [ -f ${srcdir}/config/${host_var_file} ]
339 using=" using \"${host_var_file}\""
342 if [ -f ${srcdir}/config/${target_var_file} ]
346 andusing=" using \"${target_var_file}\""
348 andusing="${using} and \"${target_var_file}\""
354 echo "Created \"Makefile\""${andusing}.
356 if [ x$host = x$target ]
358 echo "Links are now set up for use with a $target." \
360 # | tee ${srcdir}/config.status
362 echo "Links are now set up for host $host and target $target." \
364 # | tee ${srcdir}/config.status
370 # If there are subdirectories, then recurse.
372 if [ -n "$norecurse" ] ; then exit 0 ; fi
374 while [ -n "$configdirs" ]
376 # set configdir to car of configdirs, configdirs to cdr of configdirs
377 set $configdirs; configdir=$1; shift; configdirs=$*
379 # check for target override
380 targetspecificdir=${configdir}.${target}
381 if [ -d ${targetspecificdir} ]
383 configdir=${targetspecificdir}
386 echo Configuring ${configdir}...
388 # configure +host=${host} ${target} ${removing}) \
392 ./configure +host=${host} ${target} ${removing}) \
400 # Revision 1.2 1991/04/09 23:20:12 rich
401 # First minimally usable checkin.
407 # end of configure.template