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