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