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.
70 -host=* |
+host=* |
+hos
=* |
+ho
=* |
+h
=*)
71 host=`echo $arg | sed 's/[+-]h[a-z]*=//'`
73 -languages=* |
+languages
=* |
+language
=* |
+languag
=* \
74 |
+langua
=* |
+langu
=* |
+lang
=* |
+lan
=* |
+la
=* \
76 languages
="$languages `echo $arg | sed 's/[+-]l[a-z]*=//'`"
78 -gas |
+gas |
+ga |
+g
)
81 -nfp |
+nfp |
+nf |
+n
)
84 -norecurse |
+norecurse
)
90 -srcdir=* |
+srcdir
=* |
+srcdi
=* |
+srcd
=* |
+src
=* |
+sr
=* |
+s
=*)
91 srcdir
=`echo $arg | sed 's/[+-]s[a-z]*=//'`
93 -template=* |
+template
=*)
94 template
=`echo $arg | sed 's/[+-]template=//'`
97 # Allow configure HOST TARGET
98 if [ x
$host = x
] ; then host=$target ; fi
104 # process host and target only if not rebuilding configure itself or removing.
105 if [ -z "$template" -a -z "$removing" ]
107 # Complain if an arg is missing
110 echo "Usage: $progname [+srcdir=DIR] [+host=HOST] [+gas] [+nfp] TARGET"
111 echo -n "Where HOST and TARGET are something like "
112 echo "\`vax', \`sun3', \`encore', etc."
113 if [ -r config.status
]
127 #### configure.in files come in here.
128 # This file is a shell script that supplies the information necessary
129 # to tailor a template configure script into the configure script
130 # appropriate for this directory. For more information, check any
131 # existing configure script.
138 ### end of configure.in
140 # are we rebuilding config itself?
141 if [ -n "$template" ]
143 if [ ! -r $template ]
145 echo "Can't find template ${template}."
149 mv configure configure.old
150 echo "#!/bin/sh" > configure
151 echo "# Please do not edit this file. It is generated automatically from" >> configure
152 echo "# configure.in and a configure template." >> configure
153 echo "configdirs=" >> configure
156 if [ -r configure.
in ]
158 sed -e "/^####/ r configure.in" $template >> configure
160 cat $template >> configure
165 echo Rebuilt configure
in `pwd`
167 if [ x
$norecurse = x
]
169 while [ -n "$configdirs" ]
171 # set configdir to car of configdirs, configdirs to cdr of configdirs
172 set $configdirs; configdir
=$1; shift; configdirs
=$
*
174 if [ "`echo ${configdir}.*`" != "${configdir}.*" ]
176 targetspecificdirs
=${configdir}.
*
181 for i
in ${configdir} ${targetspecificdirs}
183 if [ -r $i/configure
]
186 configure
+template
=${template})
188 echo No configure
script in `pwd`/$i
197 # Temporarily, we support only direct subdir builds.
198 hostsubdir
=Host-
${host}
199 targetsubdir
=Target-
${target}
201 if [ -n "${removing}" ]
203 if [ -d "${hostsubdir}/${targetsubdir}" ]
205 rm -rf ${hostsubdir}/${targetsubdir}
207 if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ]
212 rm -f .gdbinit Makefile config.status
$links
215 if [ -n "$forcesubdirs" ]
217 # check for existing status before allowing forced subdirs.
220 echo "Makefile already exists in source directory. `pwd` not configured."
224 if [ ! -d $hostsubdir ] ; then mkdir
$hostsubdir ; fi
227 if [ ! -d $targetsubdir ] ; then mkdir
$targetsubdir ; fi
232 # if not subdir builds, then make sure none exist.
233 if [ -n "`(ls .) 2>&1 | grep Host-`" ]
235 echo "Configured subdirs exist. `pwd` not configured."
240 # Find the source files, if location was not specified.
245 if [ ! -r ${srctrigger} ]
251 if [ ! -r ${srcdir}/${srctrigger} ]
253 if [ -z "$srcdirdefaulted" ]
255 echo "$progname: Can't find ${srcname} sources in \`${srcdir}'." 1>&2
257 echo "$progname: Can't find ${srcname} sources in \`.' or \`..'." 1>&2
262 # Set up the list of links to be made.
263 # $links is the list of link names, and $files is the list of names to link to.
266 while [ -n "$files" ]
268 # set file to car of files, files to cdr of files
269 set $files; file=$1; shift; files
=$
*
270 set $links; link
=$1; shift; links
=$
*
272 if [ ! -r ${srcdir}/${file} ]
274 echo "$progname: cannot create a link \"${link}\"," 1>&2
275 echo "since the file \"$file\" does not exist." 1>&2
281 # Make a symlink if possible, otherwise try a hard link
282 $symbolic_link ${srcdir}/$file $link 2>/dev
/null ||
$hard_link ${srcdir}/$file $link
286 echo "$progname: unable to link \"$link\" to \"${srcdir}/$file\"." 1>&2
289 echo "Linked \"$link\" to \"${srcdir}/${file}\"."
292 # Create a .gdbinit file which runs the one in srcdir
293 # and tells GDB to look there for source files.
299 echo "dir ." > .gdbinit
300 echo "dir ${srcdir}" >> .gdbinit
301 echo "source ${srcdir}/.gdbinit" >> .gdbinit
305 # Install a makefile, and make it set VPATH
306 # if necessary so that the sources are found.
307 # Also change its value of srcdir.
309 # FIXME-someday: This business of always writing to .tem and mv back
310 # is so that I don't screw things up while developing. Once this
311 # template is stable, these should be optimized. xoxorich.
313 # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
314 if [ x
$host != x
$target ]
316 echo "CROSS=-DCROSS_COMPILE" > Makefile
317 echo "ALL=start.encap" >> Makefile
319 echo "ALL=all.internal" > Makefile
322 # set target, host, VPATH
323 echo "host = $host" >> Makefile
324 echo "target = $target" >> Makefile
326 if [ -n "${forcesubdirs}" ]
328 echo "subdir = /${hostsubdir}/${targetsubdir}" >> Makefile
330 echo "subdir =" >> Makefile
333 # echo "workdir = `pwd`" >> Makefile
334 echo "VPATH = ${srcdir}" >> Makefile
337 cat ${srcdir}/Makefile.
in >> Makefile
339 # and shake thoroughly.
340 host_var_file
=hmake-
${host}
341 target_var_file
=tmake-
${target}
343 # Conditionalize the makefile for this machine.
344 if [ -f ${srcdir}/config
/${host_var_file} ]
346 sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile
> Makefile.tem
347 mv Makefile.tem Makefile
350 if [ -f ${srcdir}/config
/${target_var_file} ]
352 sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile
> Makefile.tem
353 mv Makefile.tem Makefile
356 sed "s@^srcdir = \.@srcdir = ${srcdir}@" Makefile
> Makefile.tem
357 mv Makefile.tem Makefile
359 # Remove all formfeeds, since some Makes get confused by them.
360 sed "s/\f//" Makefile
>> Makefile.tem
361 mv Makefile.tem Makefile
364 sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile
> Makefile.tem
365 mv Makefile.tem Makefile
368 sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile
> Makefile.tem
369 mv Makefile.tem Makefile
372 if [ -f ${srcdir}/config
/${host_var_file} ]
374 using
=" using \"${host_var_file}\""
377 if [ -f ${srcdir}/config
/${target_var_file} ]
381 andusing
=" using \"${target_var_file}\""
383 andusing
="${using} and \"${target_var_file}\""
389 echo "Created \"Makefile\""${andusing}.
391 if [ x
$host = x
$target ]
393 echo "Links are now set up for use with a $target." \
395 # | tee ${srcdir}/config.status
397 echo "Links are now set up for host $host and target $target." \
399 # | tee ${srcdir}/config.status
406 # If there are subdirectories, then recurse.
408 if [ -n "$norecurse" ] ; then exit 0 ; fi
410 while [ -n "$configdirs" ]
412 # set configdir to car of configdirs, configdirs to cdr of configdirs
413 set $configdirs; configdir
=$1; shift; configdirs
=$
*
415 # check for target override
416 targetspecificdir
=${configdir}.
${target}
417 if [ -d ${targetspecificdir} ]
419 configdir
=${targetspecificdir}
422 echo Configuring
${configdir}...
424 .
/configure
${forcesubdirs} ${removing} +host=${host} ${target}) \
432 # Revision 1.3 1991/04/10 22:56:51 rich
439 # end of configure.template