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