]>
Commit | Line | Data |
---|---|---|
99a42820 | 1 | #!/bin/sh |
a10d26a1 RP |
2 | # Please do not edit this file. It is generated automatically from |
3 | # configure.in and a configure template. | |
99a42820 RP |
4 | configdirs= |
5 | ||
6c18e393 RP |
6 | # the debugger. |
7 | #set -x | |
8 | ||
99a42820 | 9 | #!/bin/sh |
99a42820 RP |
10 | |
11 | # Configuration script template | |
12 | # Copyright (C) 1988, 1990, 1991 Free Software Foundation, Inc. | |
13 | ||
14 | #This file is part of GNU. | |
15 | ||
16 | #GNU CC is free software; you can redistribute it and/or modify | |
17 | #it under the terms of the GNU General Public License as published by | |
18 | #the Free Software Foundation; either version 1, or (at your option) | |
19 | #any later version. | |
20 | ||
21 | #GNU CC is distributed in the hope that it will be useful, | |
22 | #but WITHOUT ANY WARRANTY; without even the implied warranty of | |
23 | #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
24 | #GNU General Public License for more details. | |
25 | ||
26 | #You should have received a copy of the GNU General Public License | |
27 | #along with GNU CC; see the file COPYING. If not, write to | |
28 | #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
29 | ||
a10d26a1 RP |
30 | # $Id$ |
31 | ||
99a42820 RP |
32 | # |
33 | # Shell script to create proper links to machine-dependent files in | |
b5132a6b | 34 | # preparation for compilation. |
99a42820 RP |
35 | # |
36 | # If configure succeeds, it leaves its status in config.status. | |
37 | # If configure fails after disturbing the status quo, | |
38 | # config.status is removed. | |
39 | # | |
40 | ||
99a42820 RP |
41 | remove=rm |
42 | hard_link=ln | |
43 | symbolic_link='ln -s' | |
44 | ||
45 | #for Test | |
46 | #remove="echo rm" | |
47 | #hard_link="echo ln" | |
48 | #symbolic_link="echo ln -s" | |
49 | ||
c4220303 RP |
50 | progname=$0 |
51 | ||
99a42820 | 52 | # clear some things potentially inherited from environment. |
99a42820 | 53 | ansi= |
b5132a6b | 54 | defaulttargets= |
ec342d7d | 55 | destdir= |
b5132a6b | 56 | fatal= |
f2e91404 RP |
57 | hostsubdir= |
58 | norecurse= | |
59 | removing= | |
a10d26a1 | 60 | srcdir= |
ec342d7d | 61 | srctrigger= |
f2e91404 | 62 | target= |
b5132a6b | 63 | targets= |
f2e91404 RP |
64 | targetsubdir= |
65 | template= | |
b5132a6b | 66 | verbose= |
99a42820 RP |
67 | |
68 | for arg in $*; | |
69 | do | |
ec342d7d | 70 | case ${arg} in |
99a42820 RP |
71 | -ansi | +ansi) |
72 | ansi=true | |
73 | ;; | |
ec342d7d RP |
74 | -destdir=* | +destdir=* | +destdi=* | +destd=* | +dest=* | +des=* | +de=* | +d=*) |
75 | destdir=`echo ${arg} | sed 's/[+-]d[a-z]*=//'` | |
76 | ;; | |
c4220303 RP |
77 | -forcesubdirs | +forcesubdirs | +forcesubdir | +forcesubdi | +forcesubd \ |
78 | | +forcesub | +forcesu | +forces | +force | +forc | +for | +fo | +f) | |
f2e91404 | 79 | forcesubdirs=${arg} |
99a42820 | 80 | ;; |
a10d26a1 RP |
81 | -languages=* | +languages=* | +language=* | +languag=* \ |
82 | | +langua=* | +langu=* | +lang=* | +lan=* | +la=* \ | |
83 | | +l=*) | |
ec342d7d | 84 | languages="${languages} `echo ${arg} | sed 's/[+-]l[a-z]*=//'`" |
99a42820 RP |
85 | ;; |
86 | -gas | +gas | +ga | +g) | |
87 | gas=yes | |
88 | ;; | |
b5132a6b RP |
89 | -help | +h | +help) |
90 | fatal=true | |
91 | ;; | |
99a42820 RP |
92 | -nfp | +nfp | +nf | +n) |
93 | nfp=yes | |
94 | ;; | |
f2e91404 RP |
95 | -norecurse | +norecurse) |
96 | norecurse=true | |
97 | ;; | |
98 | -rm | +rm) | |
ec342d7d | 99 | removing=${arg} |
f2e91404 | 100 | ;; |
b5132a6b RP |
101 | # -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*) |
102 | # srcdir=`echo ${arg} | sed 's/[+-]s[a-z]*=//'` | |
103 | # ;; | |
104 | -target=* | +target=* | +targe=* | +targ=* | +tar=* | +ta=* | +t=*) | |
105 | if [ -n "${targets}" ] ; then | |
106 | forcesubdirs="+forcesubdirs" | |
107 | fi | |
108 | ||
109 | newtargets="${targets} `echo ${arg} | sed 's/[+-]t[a-z]*=//'`" | |
110 | targets="${newtargets}" | |
f2e91404 RP |
111 | ;; |
112 | -template=* | +template=*) | |
ec342d7d | 113 | template=`echo ${arg} | sed 's/[+-]template=//'` |
f2e91404 | 114 | ;; |
b5132a6b RP |
115 | +verbose | +verbos | +verbo | +verb | +ver | +ve | +v) |
116 | verbose=${arg} | |
117 | ;; | |
118 | -* | +*) | |
119 | (echo ; | |
120 | echo "Unrecognized option: \"${arg}\"". ; | |
121 | echo) 1>&2 | |
122 | fatal=true | |
123 | ;; | |
99a42820 | 124 | *) |
b5132a6b RP |
125 | if [ -n "${hosts}" ] ; then |
126 | forcesubdirs="+forcesubdirs" | |
127 | fi | |
128 | ||
129 | newhosts="${hosts} ${arg}" | |
130 | hosts=${newhosts} | |
99a42820 RP |
131 | ;; |
132 | esac | |
133 | done | |
134 | ||
b5132a6b RP |
135 | if [ -n "${verbose}" ] ; then |
136 | echo `pwd`/configure $* | |
137 | echo targets=\"${targets}\" | |
138 | fi | |
139 | ||
f2e91404 | 140 | # process host and target only if not rebuilding configure itself or removing. |
b5132a6b | 141 | if [ -z "${template}" -a -z "${removing}" -a -z "${fatal}" ] ; then |
99a42820 | 142 | # Complain if an arg is missing |
b5132a6b RP |
143 | if [ -z "${hosts}" ] ; then |
144 | (echo ; | |
145 | echo "configure: No HOST specified." ; | |
146 | echo) 2>&1 | |
147 | fatal=true | |
99a42820 | 148 | fi |
f2e91404 | 149 | fi |
99a42820 | 150 | |
b5132a6b RP |
151 | if [ -n "${fatal}" -o "${hosts}" = "help" ] ; then |
152 | (echo "Usage: configure HOST" ; | |
153 | echo ; | |
154 | echo "Options: [defaults in brackets]" ; | |
155 | echo " +ansi configure w/ANSI library. [no ansi lib]" ; | |
156 | echo " +destdir=MYDIR configure for installation into MYDIR. [/usr/local]" ; | |
157 | echo " +forcesubdirs configure in subdirectories. [in source directories]" ; | |
158 | echo " +lang=LANG configure to build LANG. [gcc]" ; | |
159 | echo " +help print this message. [normal config]" ; | |
160 | echo " +gas configure the compilers for use with gas. [native as]" ; | |
161 | echo " +nfp configure the compilers default to soft floating point. [hard float]" ; | |
162 | echo " +norecurse configure this directory only. [recurse]" ; | |
163 | echo " +rm remove this configuration. [build a configuration]" ; | |
164 | echo " +target=TARGET configure for TARGET. [TARGET = HOST]" ; | |
165 | echo " +template=TEM rebuild configure using TEM. [normal config]" ; | |
166 | echo ; | |
167 | echo "Where HOST and TARGET are something like \"vax\", \"sun3\", \"encore\", etc." ; | |
168 | echo "Asking for more than one \"+target\" implies \"+forcesubdirs\". Any other" ; | |
169 | echo "options given will apply to all targets.") 1>&2 | |
170 | ||
171 | if [ -r config.status ] ; then | |
172 | cat config.status | |
173 | fi | |
174 | ||
175 | exit 1 | |
a10d26a1 | 176 | fi |
99a42820 | 177 | |
b5132a6b | 178 | #### configure.in common parts come in here. |
a10d26a1 RP |
179 | # This file is a shell script that supplies the information necessary |
180 | # to tailor a template configure script into the configure script | |
181 | # appropriate for this directory. For more information, check any | |
182 | # existing configure script. | |
99a42820 | 183 | |
a10d26a1 RP |
184 | srctrigger=ar.c |
185 | srcname="binutils" | |
b5132a6b | 186 | |
c4220303 | 187 | ## end of common part. |
99a42820 RP |
188 | |
189 | # are we rebuilding config itself? | |
b5132a6b RP |
190 | if [ -n "${template}" ] ; then |
191 | if [ ! -r ${template} ] ; then | |
99a42820 RP |
192 | echo "Can't find template ${template}." |
193 | exit 1 | |
194 | fi | |
195 | ||
c4220303 RP |
196 | # prep the template |
197 | sed -e '/^#### configure.in common parts come in here.$/,/^## end of common part.$/c\ | |
198 | #### configure.in common parts come in here.\ | |
199 | ## end of common part.' \ | |
200 | -e '/^#### configure.in per-host parts come in here.$/,/^## end of per-host part.$/c\ | |
201 | #### configure.in per-host parts come in here.\ | |
202 | ## end of per-host part.' \ | |
203 | -e '/^#### configure.in per-target parts come in here.$/,/^## end of per-target part.$/c\ | |
204 | #### configure.in per-target parts come in here.\ | |
205 | ## end of per-target part.' \ | |
206 | < ${template} > template.new | |
99a42820 | 207 | |
b5132a6b RP |
208 | if [ -r configure.in ] ; then |
209 | if [ -z "`grep '^# per\-host:' configure.in`" ] ; then | |
210 | echo `pwd`/configure.in has no "per-host:" line. | |
211 | exit 1 | |
212 | fi | |
213 | ||
214 | if [ -z "`grep '^# per\-target:' configure.in`" ] ; then | |
215 | echo `pwd`/configure.in has no "per-target:" line. | |
216 | exit 1 | |
217 | fi | |
218 | ||
04dc1a62 RP |
219 | # split configure.in into common, per-host, and per-target parts |
220 | sed -e '/^# per\-host:/,$d' configure.in > configure.com | |
221 | sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' configure.in > configure.hst | |
b5132a6b RP |
222 | sed -e '1,/^# per\-target:/d' configure.in > configure.tgt |
223 | ||
04dc1a62 | 224 | # and insert them |
c4220303 RP |
225 | sed -e '/^#### configure.in common parts come in here.$/ r configure.com' \ |
226 | -e '/^#### configure.in per\-host parts come in here.$/ r configure.hst' \ | |
227 | -e '/^#### configure.in per\-target parts come in here.$/ r configure.tgt' \ | |
228 | template.new > configure.new | |
b5132a6b RP |
229 | |
230 | rm -f configure.com configure.tgt configure.hst | |
99a42820 | 231 | else |
ec342d7d RP |
232 | echo Warning: no configure.in in `pwd` |
233 | cat ${template} >> configure | |
99a42820 RP |
234 | fi |
235 | ||
c4220303 RP |
236 | chmod a+x configure.new |
237 | rm template.new | |
238 | # mv configure configure.old | |
239 | mv configure.new configure | |
99a42820 RP |
240 | echo Rebuilt configure in `pwd` |
241 | ||
b5132a6b RP |
242 | if [ -z "${norecurse}" ] ; then |
243 | while [ -n "${configdirs}" ] ; do | |
99a42820 | 244 | # set configdir to car of configdirs, configdirs to cdr of configdirs |
ec342d7d | 245 | set ${configdirs}; configdir=$1; shift; configdirs=$* |
99a42820 | 246 | |
b5132a6b | 247 | if [ "`echo ${configdir}.*`" != "${configdir}.*" ] ; then |
99a42820 RP |
248 | targetspecificdirs=${configdir}.* |
249 | else | |
250 | targetspecificdirs= | |
251 | fi | |
252 | ||
b5132a6b | 253 | for i in ${configdir} ${targetspecificdirs} ; do |
6c18e393 RP |
254 | if [ -d $i ] ; then |
255 | if [ -r $i/configure ] ; then | |
256 | (cd $i ; | |
257 | ./configure +template=${template} ${verbose}) | |
258 | else | |
259 | echo No configure script in `pwd`/$i | |
260 | fi | |
99a42820 | 261 | else |
6c18e393 | 262 | echo Warning: directory $i is missing. |
99a42820 RP |
263 | fi |
264 | done | |
265 | done | |
266 | fi | |
267 | ||
268 | exit 0 | |
269 | fi | |
270 | ||
ec342d7d | 271 | # some sanity checks on configure.in |
b5132a6b | 272 | if [ -z "${srctrigger}" ] ; then |
ec342d7d RP |
273 | echo srctrigger not set in configure.in. `pwd` not configured. |
274 | exit 1 | |
275 | fi | |
276 | ||
b5132a6b RP |
277 | for host in ${hosts} ; do |
278 | # Default other arg | |
279 | if [ -z "${targets}" -o -n "${defaulttargets}" ] ; then | |
280 | targets=${host} | |
281 | defaulttargets=true | |
282 | fi | |
99a42820 | 283 | |
6c18e393 RP |
284 | host_makefile_frag=config/hmake-${host} |
285 | ||
b5132a6b | 286 | #### configure.in per-host parts come in here. |
99a42820 | 287 | |
c4220303 | 288 | ## end of per-host part. |
f2e91404 | 289 | |
99a42820 | 290 | |
b5132a6b RP |
291 | for target in ${targets} ; do |
292 | ||
293 | if [ -n "${verbose}" ] ; then | |
6c18e393 | 294 | echo host \= \"${host}\", target \= \"${target}\". |
a10d26a1 | 295 | fi |
b5132a6b | 296 | |
6c18e393 RP |
297 | target_makefile_frag=config/tmake-${target} |
298 | ||
b5132a6b RP |
299 | #### configure.in per-target parts come in here. |
300 | ||
301 | files= | |
302 | links= | |
303 | ||
c4220303 | 304 | ## end of per-target part. |
b5132a6b RP |
305 | |
306 | # Temporarily, we support only direct subdir builds. | |
307 | hostsubdir=Host-${host} | |
308 | targetsubdir=Target-${target} | |
309 | ||
310 | if [ -n "${removing}" ] ; then | |
c4220303 RP |
311 | if [ -n "${forcesubdirs}" ] ; then |
312 | if [ -d "${hostsubdir}" ] ; then | |
313 | rm -rf ${hostsubdir}/${targetsubdir} | |
b5132a6b | 314 | |
c4220303 RP |
315 | if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ] ; then |
316 | rm -rf ${hostsubdir} | |
317 | fi | |
318 | else | |
319 | echo Warning: no `pwd`/${hostsubdir} to remove. | |
b5132a6b RP |
320 | fi |
321 | else | |
322 | rm -f Makefile config.status ${links} | |
323 | fi | |
a10d26a1 | 324 | else |
b5132a6b RP |
325 | if [ -n "${forcesubdirs}" ] ; then |
326 | # check for existing status before allowing forced subdirs. | |
327 | if [ -f Makefile ] ; then | |
328 | echo "Makefile already exists in source directory. `pwd` not configured." | |
329 | exit 1 | |
330 | fi | |
99a42820 | 331 | |
b5132a6b RP |
332 | if [ ! -d ${hostsubdir} ] ; then mkdir ${hostsubdir} ; fi |
333 | cd ${hostsubdir} | |
99a42820 | 334 | |
b5132a6b RP |
335 | if [ ! -d ${targetsubdir} ] ; then mkdir ${targetsubdir} ; fi |
336 | cd ${targetsubdir} | |
99a42820 | 337 | |
b5132a6b RP |
338 | srcdir=../.. |
339 | else | |
340 | # if not subdir builds, then make sure none exist. | |
341 | if [ -n "`(ls .) 2>&1 | grep Host-`" ] ; then | |
342 | echo "Configured subdirs exist. `pwd` not configured." | |
343 | exit 1 | |
344 | fi | |
345 | fi | |
99a42820 | 346 | |
b5132a6b RP |
347 | # Find the source files, if location was not specified. |
348 | if [ -z "${srcdir}" ] ; then | |
349 | srcdirdefaulted=1 | |
350 | srcdir=. | |
351 | if [ -n "${srctrigger}" -a ! -r ${srctrigger} ] ; then | |
352 | srcdir=.. | |
353 | fi | |
354 | fi | |
99a42820 | 355 | |
b5132a6b RP |
356 | if [ -n "${srctrigger}" -a ! -r ${srcdir}/${srctrigger} ] ; then |
357 | if [ -z "${srcdirdefaulted}" ] ; then | |
c4220303 | 358 | echo "${progname}: Can't find ${srcname} sources in `pwd`/${srcdir}" 1>&2 |
b5132a6b | 359 | else |
c4220303 | 360 | echo "${progname}: Can't find ${srcname} sources in `pwd`/. or `pwd`/.." 1>&2 |
b5132a6b | 361 | fi |
99a42820 | 362 | |
c4220303 | 363 | echo \(At least ${srctrigger} is missing.\) 1>&2 |
b5132a6b RP |
364 | exit 1 |
365 | fi | |
f2e91404 | 366 | |
b5132a6b RP |
367 | # Set up the list of links to be made. |
368 | # ${links} is the list of link names, and ${files} is the list of names to link to. | |
99a42820 | 369 | |
b5132a6b RP |
370 | # Make the links. |
371 | while [ -n "${files}" ] ; do | |
372 | # set file to car of files, files to cdr of files | |
373 | set ${files}; file=$1; shift; files=$* | |
374 | set ${links}; link=$1; shift; links=$* | |
f2e91404 | 375 | |
b5132a6b RP |
376 | if [ ! -r ${srcdir}/${file} ] ; then |
377 | echo "${progname}: cannot create a link \"${link}\"," 1>&2 | |
378 | echo "since the file \"${file}\" does not exist." 1>&2 | |
379 | exit 1 | |
380 | fi | |
f2e91404 | 381 | |
b5132a6b RP |
382 | ${remove} -f ${link} |
383 | rm -f config.status | |
384 | # Make a symlink if possible, otherwise try a hard link | |
385 | ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link} | |
f2e91404 | 386 | |
b5132a6b RP |
387 | if [ ! -r ${link} ] ; then |
388 | echo "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2 | |
389 | exit 1 | |
390 | fi | |
391 | echo "Linked \"${link}\" to \"${srcdir}/${file}\"." | |
392 | done | |
f2e91404 | 393 | |
b5132a6b RP |
394 | # Create a .gdbinit file which runs the one in srcdir |
395 | # and tells GDB to look there for source files. | |
396 | ||
397 | case ${srcdir} in | |
398 | .) | |
399 | ;; | |
400 | *) | |
401 | echo "dir ." > .gdbinit | |
402 | echo "dir ${srcdir}" >> .gdbinit | |
403 | echo "source ${srcdir}/.gdbinit" >> .gdbinit | |
404 | ;; | |
405 | esac | |
406 | ||
407 | # Install a makefile, and make it set VPATH | |
408 | # if necessary so that the sources are found. | |
409 | # Also change its value of srcdir. | |
410 | ||
411 | # FIXME-someday: This business of always writing to .tem and mv back | |
412 | # is so that I don't screw things up while developing. Once this | |
413 | # template is stable, these should be optimized. xoxorich. | |
414 | ||
415 | # Define macro CROSS_COMPILE in compilation if this is a cross-compiler. | |
416 | if [ "${host}" != "${target}" ] ; then | |
417 | echo "CROSS=-DCROSS_COMPILE" > Makefile | |
418 | echo "ALL=start.encap" >> Makefile | |
419 | else | |
420 | echo "ALL=all.internal" > Makefile | |
421 | fi | |
f2e91404 | 422 | |
b5132a6b RP |
423 | # set target, host, VPATH |
424 | echo "host = ${host}" >> Makefile | |
425 | echo "target = ${target}" >> Makefile | |
f2e91404 | 426 | |
b5132a6b RP |
427 | if [ -n "${forcesubdirs}" ] ; then |
428 | echo "subdir = /${hostsubdir}/${targetsubdir}" >> Makefile | |
429 | else | |
430 | echo "subdir =" >> Makefile | |
431 | fi | |
f2e91404 | 432 | |
b5132a6b RP |
433 | # echo "workdir = `pwd`" >> Makefile |
434 | echo "VPATH = ${srcdir}" >> Makefile | |
99a42820 | 435 | |
b5132a6b RP |
436 | # add Makefile.in |
437 | cat ${srcdir}/Makefile.in >> Makefile | |
99a42820 | 438 | |
b5132a6b | 439 | # and shake thoroughly. |
b5132a6b | 440 | # Conditionalize the makefile for this host. |
6c18e393 RP |
441 | if [ -f ${srcdir}/${host_makefile_frag} ] ; then |
442 | sed -e "/^####/ r ${srcdir}/${host_makefile_frag}" Makefile > Makefile.tem | |
b5132a6b RP |
443 | mv Makefile.tem Makefile |
444 | fi | |
f2e91404 | 445 | |
b5132a6b | 446 | # Conditionalize the makefile for this target. |
6c18e393 RP |
447 | if [ -f ${srcdir}/${target_makefile_frag} ] ; then |
448 | sed -e "/^####/ r ${srcdir}/${target_makefile_frag}" Makefile > Makefile.tem | |
b5132a6b RP |
449 | mv Makefile.tem Makefile |
450 | fi | |
ec342d7d | 451 | |
b5132a6b RP |
452 | # set srcdir |
453 | sed "s@^srcdir = \.@srcdir = ${srcdir}@" Makefile > Makefile.tem | |
454 | mv Makefile.tem Makefile | |
99a42820 | 455 | |
b5132a6b RP |
456 | # set destdir |
457 | if [ -n "${destdir}" ] ; then | |
458 | sed "s:^destdir =.*$:destdir = ${destdir}:" Makefile > Makefile.tem | |
459 | mv Makefile.tem Makefile | |
460 | fi | |
99a42820 | 461 | |
b5132a6b RP |
462 | # Remove all formfeeds, since some Makes get confused by them. |
463 | sed "s/\f//" Makefile >> Makefile.tem | |
464 | mv Makefile.tem Makefile | |
99a42820 | 465 | |
b5132a6b RP |
466 | # reset SUBDIRS |
467 | sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile > Makefile.tem | |
468 | mv Makefile.tem Makefile | |
99a42820 | 469 | |
b5132a6b RP |
470 | # reset NONSUBDIRS |
471 | sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile > Makefile.tem | |
472 | mv Makefile.tem Makefile | |
99a42820 | 473 | |
b5132a6b | 474 | using= |
6c18e393 RP |
475 | if [ -f ${srcdir}/${host_makefile_frag} ] ; then |
476 | using=" using \"${host_makefile_frag}\"" | |
b5132a6b | 477 | fi |
99a42820 | 478 | |
6c18e393 | 479 | if [ -f ${srcdir}/${target_makefile_frag} ] ; then |
b5132a6b | 480 | if [ -z "${using}" ] ; then |
6c18e393 | 481 | andusing=" using \"${target_makefile_frag}\"" |
b5132a6b | 482 | else |
6c18e393 | 483 | andusing="${using} and \"${target_makefile_frag}\"" |
b5132a6b RP |
484 | fi |
485 | else | |
486 | andusing=${using} | |
487 | fi | |
99a42820 | 488 | |
b5132a6b | 489 | echo "Created \"Makefile\"" in `pwd`${andusing}. |
99a42820 | 490 | |
b5132a6b RP |
491 | if [ "${host}" = "${target}" ] ; then |
492 | echo "Links are now set up for use with a ${target}." \ | |
493 | > config.status | |
494 | # | tee ${srcdir}/config.status | |
495 | else | |
496 | echo "Links are now set up for host ${host} and target ${target}." \ | |
497 | > config.status | |
498 | # | tee ${srcdir}/config.status | |
499 | fi | |
99a42820 | 500 | |
b5132a6b RP |
501 | originaldir=`pwd` |
502 | cd ${srcdir} | |
503 | fi | |
c4220303 RP |
504 | done # for each target |
505 | ||
506 | # # Now build a Makefile for this host. | |
507 | # if [ -n "${forcesubdirs}" ] ; then | |
508 | # cd ${hostsubdir} | |
509 | # cat > GNUmakefile << E!O!F | |
510 | ## Makefile generated by configure for host ${host}. | |
511 | # | |
512 | #%: | |
513 | # for i in ${targets} ; do \ | |
514 | # $(MAKE) -C Target-\$i \$@ | |
515 | # | |
516 | #all clean stage1 stage2 stage3 stage4etags tags TAGS | |
517 | #E!O!F | |
518 | # fi | |
519 | done # for each host | |
99a42820 | 520 | |
b5132a6b RP |
521 | # If there are subdirectories, then recurse. |
522 | ||
523 | if [ -n "${norecurse}" -o -z "${configdirs}" ] ; then exit 0 ; fi | |
99a42820 | 524 | |
b5132a6b RP |
525 | # configdirs is not null |
526 | for configdir in ${configdirs} ; do | |
99a42820 | 527 | echo Configuring ${configdir}... |
b5132a6b RP |
528 | specifics= |
529 | commons= | |
530 | ||
531 | if [ -n "${defaulttargets}" ] ; then | |
532 | for host in ${hosts} ; do | |
533 | if [ -d ${configdir}.${host} ] ; then | |
534 | newspecifics="${specifics} ${host}" | |
535 | specifics=${newspecifics} | |
536 | else | |
537 | newcommons="${commons} ${host}" | |
538 | commons=${newcommons} | |
539 | fi # if target specific | |
540 | done # for each host | |
541 | ||
542 | if [ -n "${commons}" ] ; then | |
6c18e393 RP |
543 | if [ -d ${configdir} ] ; then |
544 | (cd ${configdir} ; | |
545 | ./configure ${commons} ${verbose} ${forcesubdirs} ${removing}) \ | |
546 | | sed 's/^/ /' | |
547 | else | |
548 | echo Warning: directory \"${configdir}\" is missing. | |
549 | fi | |
b5132a6b RP |
550 | fi # if any common hosts |
551 | ||
552 | if [ -n "${specifics}" ] ; then | |
553 | for host in ${specifics} ; do | |
554 | echo Configuring target specific directory ${configdir}.${host}... | |
555 | (cd ${configdir}.${host} ; | |
556 | ./configure ${host} ${verbose} ${forcesubdirs} ${removing}) \ | |
557 | | sed 's/^/ /' | |
558 | done # for host in specifics | |
559 | fi # if there are any specifics | |
560 | else | |
561 | ||
562 | for target in ${targets} ; do | |
563 | if [ -d ${configdir}.${target} ] ; then | |
564 | newspecifics="${specifics} ${target}" | |
565 | specifics=${newspecifics} | |
566 | else | |
567 | newcommons="${commons} +target=${target}" | |
568 | commons=${newcommons} | |
569 | fi | |
570 | ||
571 | done # check for target specific dir override | |
572 | ||
573 | if [ -n "${verbose}" ] ; then | |
574 | echo " "commons=\"${commons}\" | |
575 | echo " "specifics=\"${specifics}\" | |
576 | fi # if verbose | |
577 | ||
578 | if [ -n "${commons}" ] ; then | |
6c18e393 RP |
579 | if [ -d ${configdir} ] ; then |
580 | (cd ${configdir} ; | |
581 | ./configure ${hosts} ${verbose} ${forcesubdirs} ${removing} ${commons}) \ | |
582 | | sed 's/^/ /' | |
583 | else | |
584 | echo Warning: directory \"${configdir}\" is missing. | |
585 | fi | |
b5132a6b RP |
586 | fi # if any commons |
587 | ||
588 | if [ -n "${specifics}" ] ; then | |
589 | for target in ${specifics} ; do | |
590 | echo Configuring target specific directory ${configdir}.${target}... | |
591 | (cd ${configdir}.${target} ; | |
592 | ./configure ${hosts} ${verbose} ${forcesubdirs} ${removing} "+target=${target}") \ | |
593 | | sed 's/^/ /' | |
594 | done | |
595 | fi # if any specifics | |
596 | fi # not default targets | |
99a42820 RP |
597 | done |
598 | ||
599 | exit 0 | |
a10d26a1 RP |
600 | |
601 | # | |
602 | # $Log$ | |
6c18e393 RP |
603 | # Revision 1.10 1991/05/27 20:54:35 rich |
604 | # fixed a bug in multiple targets | |
605 | # | |
606 | # Revision 1.14 1991/05/22 01:44:04 rich | |
607 | # remove gdb until config issues resolve. | |
608 | # | |
609 | # Revision 1.13 1991/05/19 08:00:09 rich | |
610 | # Added gdb. | |
611 | # | |
612 | # Revision 1.12 1991/05/19 00:32:13 rich | |
613 | # Changes to deal with missing subdirs gracefully, and changes dictated | |
614 | # from dropping configure over gdb. | |
615 | # | |
616 | # Revision 1.4 1991/05/19 00:16:45 rich | |
617 | # Configure for gdb. | |
c4220303 RP |
618 | # |
619 | # Revision 1.10 1991/05/04 00:58:38 rich | |
620 | # Fix program name bug. | |
621 | # | |
622 | # Revision 1.9 1991/05/03 19:14:18 rich | |
623 | # Changed getopt to libiberty, commented out an aborted attempt at host | |
624 | # level Makefiles because it caused errors on +rm, add a warning for | |
625 | # directories expected to be removed on +rm but that don't exist. | |
626 | # | |
627 | # Revision 1.8 1991/04/24 16:50:59 rich | |
628 | # Three staging checkpoint. | |
629 | # | |
630 | # Revision 1.7 1991/04/17 01:34:47 rich | |
631 | # Added getopt for binutils, fixed problem with host dependancies in | |
632 | # configure.template. | |
04dc1a62 RP |
633 | # |
634 | # Revision 1.6 1991/04/16 00:18:44 rich | |
b5132a6b RP |
635 | # Now handles multiple hosts and targets. |
636 | # | |
637 | # Revision 1.5 1991/04/15 23:43:44 rich | |
638 | # Now handles multiple hosts and targets. | |
639 | # | |
640 | # Revision 1.4 1991/04/13 02:11:03 rich | |
ec342d7d RP |
641 | # Config cut 3. We now almost install a29k. |
642 | # | |
643 | # Revision 1.3 1991/04/11 02:41:54 rich | |
644 | # Cut 2 config. Subdirs. | |
a10d26a1 RP |
645 | # |
646 | # | |
647 | # | |
648 | ||
b5132a6b RP |
649 | # |
650 | # Local Variables: | |
651 | # fill-column: 131 | |
652 | # End: | |
653 | # | |
a10d26a1 RP |
654 | |
655 | # end of configure.template |