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