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