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