Commit | Line | Data |
---|---|---|
0df06ca0 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 | ||
bdf3621b 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. */ | |
0df06ca0 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 | ||
c4220303 RP |
47 | progname=$0 |
48 | ||
0df06ca0 RP |
49 | # clear some things potentially inherited from environment. |
50 | ansi= | |
c4220303 | 51 | defaulttargets= |
0df06ca0 RP |
52 | destdir= |
53 | fatal= | |
54 | hostsubdir= | |
bdf3621b JG |
55 | Makefile=Makefile |
56 | Makefile_in=Makefile.in | |
0df06ca0 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 | ;; | |
c4220303 RP |
76 | -forcesubdirs | +forcesubdirs | +forcesubdir | +forcesubdi | +forcesubd \ |
77 | | +forcesub | +forcesu | +forces | +force | +forc | +for | +fo | +f) | |
0df06ca0 RP |
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. | |
912e0732 RP |
178 | srcname="GDB" |
179 | srctrigger=main.c | |
bdf3621b | 180 | Makefile=Makefile.conf |
0df06ca0 | 181 | |
c4220303 | 182 | ## end of common part. |
0df06ca0 RP |
183 | |
184 | # are we rebuilding config itself? | |
185 | if [ -n "${template}" ] ; then | |
186 | if [ ! -r ${template} ] ; then | |
187 | echo "Can't find template ${template}." | |
188 | exit 1 | |
189 | fi | |
190 | ||
c4220303 RP |
191 | # prep the template |
192 | sed -e '/^#### configure.in common parts come in here.$/,/^## end of common part.$/c\ | |
193 | #### configure.in common parts come in here.\ | |
194 | ## end of common part.' \ | |
195 | -e '/^#### configure.in per-host parts come in here.$/,/^## end of per-host part.$/c\ | |
196 | #### configure.in per-host parts come in here.\ | |
197 | ## end of per-host part.' \ | |
198 | -e '/^#### configure.in per-target parts come in here.$/,/^## end of per-target part.$/c\ | |
199 | #### configure.in per-target parts come in here.\ | |
200 | ## end of per-target part.' \ | |
bdf3621b JG |
201 | -e '/^#### configure.in post-target parts come in here.$/,/^## end of post-target part.$/c\ |
202 | #### configure.in post-target parts come in here.\ | |
203 | ## end of post-target part.' \ | |
c4220303 | 204 | < ${template} > template.new |
0df06ca0 RP |
205 | |
206 | if [ -r configure.in ] ; then | |
207 | if [ -z "`grep '^# per\-host:' configure.in`" ] ; then | |
208 | echo `pwd`/configure.in has no "per-host:" line. | |
209 | exit 1 | |
210 | fi | |
211 | ||
212 | if [ -z "`grep '^# per\-target:' configure.in`" ] ; then | |
213 | echo `pwd`/configure.in has no "per-target:" line. | |
214 | exit 1 | |
215 | fi | |
216 | ||
bdf3621b JG |
217 | # split configure.in into common, per-host, per-target, |
218 | # and post-target parts. Post-target is optional. | |
c4220303 RP |
219 | sed -e '/^# per\-host:/,$d' configure.in > configure.com |
220 | sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' configure.in > configure.hst | |
bdf3621b JG |
221 | if grep -s '^# post-target:' configure.in ; then |
222 | sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' configure.in > configure.tgt | |
223 | sed -e '1,/^# post\-target:/d' configure.in > configure.pos | |
224 | else | |
225 | sed -e '1,/^# per\-target:/d' configure.in > configure.tgt | |
226 | echo >configure.pos | |
227 | fi | |
0df06ca0 | 228 | |
c4220303 RP |
229 | # and insert them |
230 | sed -e '/^#### configure.in common parts come in here.$/ r configure.com' \ | |
231 | -e '/^#### configure.in per\-host parts come in here.$/ r configure.hst' \ | |
232 | -e '/^#### configure.in per\-target parts come in here.$/ r configure.tgt' \ | |
bdf3621b | 233 | -e '/^#### configure.in post\-target parts come in here.$/ r configure.pos' \ |
c4220303 | 234 | template.new > configure.new |
0df06ca0 | 235 | |
bdf3621b | 236 | rm -f configure.com configure.tgt configure.hst configure.pos |
0df06ca0 RP |
237 | else |
238 | echo Warning: no configure.in in `pwd` | |
239 | cat ${template} >> configure | |
240 | fi | |
241 | ||
c4220303 RP |
242 | chmod a+x configure.new |
243 | rm template.new | |
244 | # mv configure configure.old | |
245 | mv configure.new configure | |
0df06ca0 RP |
246 | echo Rebuilt configure in `pwd` |
247 | ||
248 | if [ -z "${norecurse}" ] ; then | |
6988f5c0 JG |
249 | # If template is relative path, make it absolute for recursing. |
250 | if echo "${template}" | grep -s '^/' ; then | |
251 | true | |
252 | else | |
253 | template=`pwd`/${template} | |
254 | fi | |
255 | ||
0df06ca0 RP |
256 | while [ -n "${configdirs}" ] ; do |
257 | # set configdir to car of configdirs, configdirs to cdr of configdirs | |
258 | set ${configdirs}; configdir=$1; shift; configdirs=$* | |
259 | ||
260 | if [ "`echo ${configdir}.*`" != "${configdir}.*" ] ; then | |
261 | targetspecificdirs=${configdir}.* | |
262 | else | |
263 | targetspecificdirs= | |
264 | fi | |
265 | ||
266 | for i in ${configdir} ${targetspecificdirs} ; do | |
912e0732 RP |
267 | if [ -d $i ] ; then |
268 | if [ -r $i/configure ] ; then | |
269 | (cd $i ; | |
270 | ./configure +template=${template} ${verbose}) | |
271 | else | |
272 | echo No configure script in `pwd`/$i | |
273 | fi | |
0df06ca0 | 274 | else |
912e0732 | 275 | echo Warning: directory $i is missing. |
0df06ca0 RP |
276 | fi |
277 | done | |
278 | done | |
279 | fi | |
280 | ||
281 | exit 0 | |
282 | fi | |
283 | ||
284 | # some sanity checks on configure.in | |
285 | if [ -z "${srctrigger}" ] ; then | |
286 | echo srctrigger not set in configure.in. `pwd` not configured. | |
287 | exit 1 | |
288 | fi | |
289 | ||
290 | for host in ${hosts} ; do | |
291 | # Default other arg | |
c4220303 | 292 | if [ -z "${targets}" -o -n "${defaulttargets}" ] ; then |
0df06ca0 | 293 | targets=${host} |
c4220303 | 294 | defaulttargets=true |
0df06ca0 RP |
295 | fi |
296 | ||
391e5612 JG |
297 | host_makefile_frag=config/hmake-${host} |
298 | ||
0df06ca0 | 299 | #### configure.in per-host parts come in here. |
c4220303 | 300 | |
912e0732 RP |
301 | if [ ! -f xconfig/${host} ]; then |
302 | echo "No such host ${host}" | |
303 | exit 1 | |
304 | fi | |
305 | ||
bdf3621b JG |
306 | # We really shouldn't depend on there being a space after XM_FILE= ... |
307 | hostfile=`awk '$1 == "XM_FILE=" { print $2 }' <xconfig/$host` | |
912e0732 | 308 | |
c4220303 | 309 | ## end of per-host part. |
0df06ca0 RP |
310 | |
311 | ||
312 | for target in ${targets} ; do | |
313 | ||
314 | if [ -n "${verbose}" ] ; then | |
bdf3621b | 315 | echo " target=\"${target}\"" |
0df06ca0 RP |
316 | fi |
317 | ||
391e5612 JG |
318 | target_makefile_frag=config/tmake-${target} |
319 | ||
0df06ca0 | 320 | #### configure.in per-target parts come in here. |
c4220303 | 321 | |
912e0732 RP |
322 | if [ ! -f tconfig/${target} ]; then |
323 | echo "No such target ${target}" | |
324 | exit 1 | |
325 | fi | |
326 | ||
327 | if [ -z "${removing}" ] ; then | |
328 | cat xconfig/${host} tconfig/${target} | awk '$1 == "#msg" { | |
329 | print substr($0,6)}' | |
330 | fi | |
331 | ||
bdf3621b JG |
332 | # We really shouldn't depend on there being a space after TM_FILE= ... |
333 | targetfile=`awk '$1 == "TM_FILE=" { print $2 }' <tconfig/$target` | |
912e0732 RP |
334 | |
335 | host_makefile_frag=xconfig/${host} | |
336 | target_makefile_frag=tconfig/${target} | |
337 | ||
bdf3621b JG |
338 | # If hostfile (XM_FILE) and/or targetfile (TM_FILE) is not set in the |
339 | # ?config/* file, we don't make the corresponding links. | |
340 | files= | |
341 | links= | |
342 | if [ "${hostfile}" != "" ]; then | |
343 | files="${files} ${hostfile}" | |
344 | links="${links} xm.h" | |
345 | fi | |
346 | if [ "${targetfile}" != "" ]; then | |
347 | files="${files} ${targetfile}" | |
348 | links="${links} tm.h" | |
349 | fi | |
912e0732 | 350 | |
c4220303 | 351 | ## end of per-target part. |
0df06ca0 RP |
352 | |
353 | # Temporarily, we support only direct subdir builds. | |
354 | hostsubdir=Host-${host} | |
355 | targetsubdir=Target-${target} | |
356 | ||
357 | if [ -n "${removing}" ] ; then | |
c4220303 RP |
358 | if [ -n "${forcesubdirs}" ] ; then |
359 | if [ -d "${hostsubdir}" ] ; then | |
360 | rm -rf ${hostsubdir}/${targetsubdir} | |
0df06ca0 | 361 | |
c4220303 RP |
362 | if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ] ; then |
363 | rm -rf ${hostsubdir} | |
364 | fi | |
365 | else | |
366 | echo Warning: no `pwd`/${hostsubdir} to remove. | |
0df06ca0 RP |
367 | fi |
368 | else | |
bdf3621b | 369 | rm -f ${Makefile} config.status ${links} |
0df06ca0 RP |
370 | fi |
371 | else | |
372 | if [ -n "${forcesubdirs}" ] ; then | |
373 | # check for existing status before allowing forced subdirs. | |
bdf3621b JG |
374 | if [ -f ${Makefile} ] ; then |
375 | echo "${Makefile} already exists in source directory. `pwd` not configured." | |
0df06ca0 RP |
376 | exit 1 |
377 | fi | |
378 | ||
379 | if [ ! -d ${hostsubdir} ] ; then mkdir ${hostsubdir} ; fi | |
380 | cd ${hostsubdir} | |
381 | ||
382 | if [ ! -d ${targetsubdir} ] ; then mkdir ${targetsubdir} ; fi | |
383 | cd ${targetsubdir} | |
384 | ||
385 | srcdir=../.. | |
386 | else | |
387 | # if not subdir builds, then make sure none exist. | |
388 | if [ -n "`(ls .) 2>&1 | grep Host-`" ] ; then | |
389 | echo "Configured subdirs exist. `pwd` not configured." | |
390 | exit 1 | |
391 | fi | |
392 | fi | |
393 | ||
394 | # Find the source files, if location was not specified. | |
395 | if [ -z "${srcdir}" ] ; then | |
396 | srcdirdefaulted=1 | |
397 | srcdir=. | |
398 | if [ -n "${srctrigger}" -a ! -r ${srctrigger} ] ; then | |
399 | srcdir=.. | |
400 | fi | |
401 | fi | |
402 | ||
403 | if [ -n "${srctrigger}" -a ! -r ${srcdir}/${srctrigger} ] ; then | |
404 | if [ -z "${srcdirdefaulted}" ] ; then | |
c4220303 | 405 | echo "${progname}: Can't find ${srcname} sources in `pwd`/${srcdir}" 1>&2 |
0df06ca0 | 406 | else |
c4220303 | 407 | echo "${progname}: Can't find ${srcname} sources in `pwd`/. or `pwd`/.." 1>&2 |
0df06ca0 RP |
408 | fi |
409 | ||
c4220303 | 410 | echo \(At least ${srctrigger} is missing.\) 1>&2 |
0df06ca0 RP |
411 | exit 1 |
412 | fi | |
413 | ||
414 | # Set up the list of links to be made. | |
415 | # ${links} is the list of link names, and ${files} is the list of names to link to. | |
416 | ||
417 | # Make the links. | |
418 | while [ -n "${files}" ] ; do | |
419 | # set file to car of files, files to cdr of files | |
420 | set ${files}; file=$1; shift; files=$* | |
421 | set ${links}; link=$1; shift; links=$* | |
422 | ||
423 | if [ ! -r ${srcdir}/${file} ] ; then | |
424 | echo "${progname}: cannot create a link \"${link}\"," 1>&2 | |
425 | echo "since the file \"${file}\" does not exist." 1>&2 | |
426 | exit 1 | |
427 | fi | |
428 | ||
429 | ${remove} -f ${link} | |
430 | rm -f config.status | |
431 | # Make a symlink if possible, otherwise try a hard link | |
432 | ${symbolic_link} ${srcdir}/${file} ${link} 2>/dev/null || ${hard_link} ${srcdir}/${file} ${link} | |
433 | ||
434 | if [ ! -r ${link} ] ; then | |
435 | echo "${progname}: unable to link \"${link}\" to \"${srcdir}/${file}\"." 1>&2 | |
436 | exit 1 | |
437 | fi | |
438 | echo "Linked \"${link}\" to \"${srcdir}/${file}\"." | |
439 | done | |
440 | ||
441 | # Create a .gdbinit file which runs the one in srcdir | |
442 | # and tells GDB to look there for source files. | |
443 | ||
444 | case ${srcdir} in | |
445 | .) | |
446 | ;; | |
447 | *) | |
448 | echo "dir ." > .gdbinit | |
449 | echo "dir ${srcdir}" >> .gdbinit | |
450 | echo "source ${srcdir}/.gdbinit" >> .gdbinit | |
451 | ;; | |
452 | esac | |
453 | ||
454 | # Install a makefile, and make it set VPATH | |
455 | # if necessary so that the sources are found. | |
456 | # Also change its value of srcdir. | |
457 | ||
458 | # FIXME-someday: This business of always writing to .tem and mv back | |
459 | # is so that I don't screw things up while developing. Once this | |
460 | # template is stable, these should be optimized. xoxorich. | |
461 | ||
462 | # Define macro CROSS_COMPILE in compilation if this is a cross-compiler. | |
463 | if [ "${host}" != "${target}" ] ; then | |
bdf3621b JG |
464 | echo "CROSS=-DCROSS_COMPILE" > ${Makefile} |
465 | echo "ALL=start.encap" >> ${Makefile} | |
0df06ca0 | 466 | else |
bdf3621b | 467 | echo "ALL=all.internal" > ${Makefile} |
0df06ca0 RP |
468 | fi |
469 | ||
470 | # set target, host, VPATH | |
bdf3621b JG |
471 | echo "host = ${host}" >> ${Makefile} |
472 | echo "target = ${target}" >> ${Makefile} | |
0df06ca0 RP |
473 | |
474 | if [ -n "${forcesubdirs}" ] ; then | |
bdf3621b | 475 | echo "subdir = /${hostsubdir}/${targetsubdir}" >> ${Makefile} |
0df06ca0 | 476 | else |
bdf3621b | 477 | echo "subdir =" >> ${Makefile} |
0df06ca0 RP |
478 | fi |
479 | ||
bdf3621b JG |
480 | # echo "workdir = `pwd`" >> ${Makefile} |
481 | echo "VPATH = ${srcdir}" >> ${Makefile} | |
0df06ca0 | 482 | |
bdf3621b JG |
483 | # add "Makefile.in" (or whatever it's called) |
484 | cat ${srcdir}/${Makefile_in} >> ${Makefile} | |
0df06ca0 | 485 | |
0df06ca0 | 486 | # Conditionalize the makefile for this host. |
912e0732 | 487 | if [ -f ${srcdir}/${host_makefile_frag} ] ; then |
bdf3621b JG |
488 | sed -e "/^####/ r ${srcdir}/${host_makefile_frag}" ${Makefile} > Makefile.tem |
489 | mv Makefile.tem ${Makefile} | |
0df06ca0 RP |
490 | fi |
491 | ||
492 | # Conditionalize the makefile for this target. | |
912e0732 | 493 | if [ -f ${srcdir}/${target_makefile_frag} ] ; then |
bdf3621b JG |
494 | sed -e "/^####/ r ${srcdir}/${target_makefile_frag}" ${Makefile} > Makefile.tem |
495 | mv Makefile.tem ${Makefile} | |
0df06ca0 RP |
496 | fi |
497 | ||
498 | # set srcdir | |
bdf3621b JG |
499 | sed "s@^srcdir = \.@srcdir = ${srcdir}@" ${Makefile} > Makefile.tem |
500 | mv Makefile.tem ${Makefile} | |
0df06ca0 RP |
501 | |
502 | # set destdir | |
503 | if [ -n "${destdir}" ] ; then | |
bdf3621b JG |
504 | sed "s:^destdir =.*$:destdir = ${destdir}:" ${Makefile} > Makefile.tem |
505 | mv Makefile.tem ${Makefile} | |
0df06ca0 RP |
506 | fi |
507 | ||
0df06ca0 | 508 | # reset SUBDIRS |
bdf3621b JG |
509 | sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" ${Makefile} > Makefile.tem |
510 | mv Makefile.tem ${Makefile} | |
0df06ca0 RP |
511 | |
512 | # reset NONSUBDIRS | |
bdf3621b JG |
513 | sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" ${Makefile} > Makefile.tem |
514 | mv Makefile.tem ${Makefile} | |
0df06ca0 RP |
515 | |
516 | using= | |
912e0732 RP |
517 | if [ -f ${srcdir}/${host_makefile_frag} ] ; then |
518 | using=" using \"${host_makefile_frag}\"" | |
0df06ca0 RP |
519 | fi |
520 | ||
912e0732 | 521 | if [ -f ${srcdir}/${target_makefile_frag} ] ; then |
0df06ca0 | 522 | if [ -z "${using}" ] ; then |
912e0732 | 523 | andusing=" using \"${target_makefile_frag}\"" |
0df06ca0 | 524 | else |
912e0732 | 525 | andusing="${using} and \"${target_makefile_frag}\"" |
0df06ca0 RP |
526 | fi |
527 | else | |
528 | andusing=${using} | |
529 | fi | |
530 | ||
bdf3621b JG |
531 | echo "Created \"${Makefile}\"" in `pwd`${andusing}. |
532 | ||
533 | #### configure.in post-target parts come in here. | |
534 | ||
535 | case ${srcdir} in | |
536 | .) | |
537 | ;; | |
538 | *) | |
539 | grep -s "source ${srcdir}/.gdbinit" .gdbinit 2>/dev/null || \ | |
540 | echo "source ${srcdir}/.gdbinit" >> .gdbinit | |
541 | esac | |
542 | ||
543 | rm -f Makefile | |
6988f5c0 JG |
544 | if [ ! -f ${srcdir}/depend ]; then |
545 | make -f Makefile.conf make-depend | |
bdf3621b | 546 | fi |
6988f5c0 | 547 | make -f Makefile.conf make-Makefile |
bdf3621b | 548 | ## end of post-target part. |
0df06ca0 RP |
549 | |
550 | if [ "${host}" = "${target}" ] ; then | |
551 | echo "Links are now set up for use with a ${target}." \ | |
552 | > config.status | |
553 | # | tee ${srcdir}/config.status | |
554 | else | |
555 | echo "Links are now set up for host ${host} and target ${target}." \ | |
556 | > config.status | |
557 | # | tee ${srcdir}/config.status | |
558 | fi | |
559 | ||
560 | originaldir=`pwd` | |
561 | cd ${srcdir} | |
562 | fi | |
c4220303 RP |
563 | done # for each target |
564 | ||
565 | # # Now build a Makefile for this host. | |
566 | # if [ -n "${forcesubdirs}" ] ; then | |
567 | # cd ${hostsubdir} | |
568 | # cat > GNUmakefile << E!O!F | |
569 | ## Makefile generated by configure for host ${host}. | |
570 | # | |
571 | #%: | |
572 | # for i in ${targets} ; do \ | |
573 | # $(MAKE) -C Target-\$i \$@ | |
574 | # | |
575 | #all clean stage1 stage2 stage3 stage4etags tags TAGS | |
576 | #E!O!F | |
577 | # fi | |
578 | done # for each host | |
0df06ca0 RP |
579 | |
580 | # If there are subdirectories, then recurse. | |
581 | ||
582 | if [ -n "${norecurse}" -o -z "${configdirs}" ] ; then exit 0 ; fi | |
583 | ||
584 | # configdirs is not null | |
585 | for configdir in ${configdirs} ; do | |
586 | echo Configuring ${configdir}... | |
587 | specifics= | |
588 | commons= | |
589 | ||
c4220303 RP |
590 | if [ -n "${defaulttargets}" ] ; then |
591 | for host in ${hosts} ; do | |
592 | if [ -d ${configdir}.${host} ] ; then | |
593 | newspecifics="${specifics} ${host}" | |
594 | specifics=${newspecifics} | |
595 | else | |
596 | newcommons="${commons} ${host}" | |
597 | commons=${newcommons} | |
598 | fi # if target specific | |
599 | done # for each host | |
600 | ||
601 | if [ -n "${commons}" ] ; then | |
912e0732 RP |
602 | if [ -d ${configdir} ] ; then |
603 | (cd ${configdir} ; | |
604 | ./configure ${commons} ${verbose} ${forcesubdirs} ${removing}) \ | |
605 | | sed 's/^/ /' | |
606 | else | |
607 | echo Warning: directory \"${configdir}\" is missing. | |
608 | fi | |
c4220303 RP |
609 | fi # if any common hosts |
610 | ||
611 | if [ -n "${specifics}" ] ; then | |
612 | for host in ${specifics} ; do | |
613 | echo Configuring target specific directory ${configdir}.${host}... | |
614 | (cd ${configdir}.${host} ; | |
615 | ./configure ${host} ${verbose} ${forcesubdirs} ${removing}) \ | |
616 | | sed 's/^/ /' | |
617 | done # for host in specifics | |
618 | fi # if there are any specifics | |
619 | else | |
0df06ca0 | 620 | |
c4220303 RP |
621 | for target in ${targets} ; do |
622 | if [ -d ${configdir}.${target} ] ; then | |
623 | newspecifics="${specifics} ${target}" | |
624 | specifics=${newspecifics} | |
625 | else | |
626 | newcommons="${commons} +target=${target}" | |
627 | commons=${newcommons} | |
628 | fi | |
0df06ca0 | 629 | |
c4220303 | 630 | done # check for target specific dir override |
0df06ca0 | 631 | |
c4220303 RP |
632 | if [ -n "${verbose}" ] ; then |
633 | echo " "commons=\"${commons}\" | |
634 | echo " "specifics=\"${specifics}\" | |
635 | fi # if verbose | |
0df06ca0 | 636 | |
c4220303 | 637 | if [ -n "${commons}" ] ; then |
912e0732 RP |
638 | if [ -d ${configdir} ] ; then |
639 | (cd ${configdir} ; | |
640 | ./configure ${hosts} ${verbose} ${forcesubdirs} ${removing} ${commons}) \ | |
641 | | sed 's/^/ /' | |
642 | else | |
643 | echo Warning: directory \"${configdir}\" is missing. | |
644 | fi | |
c4220303 RP |
645 | fi # if any commons |
646 | ||
647 | if [ -n "${specifics}" ] ; then | |
648 | for target in ${specifics} ; do | |
649 | echo Configuring target specific directory ${configdir}.${target}... | |
650 | (cd ${configdir}.${target} ; | |
651 | ./configure ${hosts} ${verbose} ${forcesubdirs} ${removing} "+target=${target}") \ | |
652 | | sed 's/^/ /' | |
653 | done | |
654 | fi # if any specifics | |
655 | fi # not default targets | |
0df06ca0 RP |
656 | done |
657 | ||
658 | exit 0 | |
659 | ||
660 | # | |
661 | # $Log$ | |
391e5612 JG |
662 | # Revision 1.9 1991/07/06 04:35:51 gnu |
663 | # Fix bug in configure when iterating targets. | |
664 | # Depend on alldeps.mak, not ${srcdir}/alldeps.mak, so it can be found | |
665 | # in either spot. | |
666 | # | |
667 | # Revision 1.8 1991/07/05 00:04:58 gnu | |
6988f5c0 JG |
668 | # Thu Jul 4 14:47:06 1991 John Gilmore (gnu at cygint.cygnus.com) |
669 | # | |
670 | # * configure.in, Makefile.in: Avoid rebuilding "depend" as much. | |
671 | # Avoid declaring Makefile dependencies, because GNU Make stupidly | |
672 | # tries to update it if we do. | |
673 | # | |
674 | # * coffread.c: Revise for minor changes to bfd internal coff | |
675 | # indexes. | |
676 | # | |
677 | # * configure: If -template= is given a relative path, make it | |
678 | # absolute before recurring in subdirectories. | |
679 | # | |
680 | # Revision 1.7 1991/07/04 15:59:46 gnu | |
bdf3621b JG |
681 | # Make gdb work with configure. Only thing that doesn't work is the -list |
682 | # option (as far as I know). | |
683 | # | |
684 | # Revision 1.6 1991/06/04 07:28:16 gnu | |
685 | # Change GDB over to GNU General Public License version 2. | |
686 | # | |
687 | # Revision 1.5 1991/05/19 07:26:54 rich | |
688 | # configure changes and -opcode.h movement. | |
689 | # | |
690 | # Revision 1.4 1991/05/19 00:16:45 rich | |
912e0732 | 691 | # Configure for gdb. |
c4220303 RP |
692 | # |
693 | # Revision 1.10 1991/05/04 00:58:38 rich | |
694 | # Fix program name bug. | |
695 | # | |
696 | # Revision 1.9 1991/05/03 19:14:18 rich | |
697 | # Changed getopt to libiberty, commented out an aborted attempt at host | |
698 | # level Makefiles because it caused errors on +rm, add a warning for | |
699 | # directories expected to be removed on +rm but that don't exist. | |
700 | # | |
701 | # Revision 1.8 1991/04/24 16:50:59 rich | |
702 | # Three staging checkpoint. | |
703 | # | |
704 | # Revision 1.7 1991/04/17 01:34:47 rich | |
705 | # Added getopt for binutils, fixed problem with host dependancies in | |
706 | # configure.template. | |
707 | # | |
708 | # Revision 1.6 1991/04/16 00:18:44 rich | |
709 | # Now handles multiple hosts and targets. | |
710 | # | |
711 | # Revision 1.5 1991/04/15 23:43:44 rich | |
0df06ca0 RP |
712 | # Now handles multiple hosts and targets. |
713 | # | |
714 | # Revision 1.4 1991/04/13 02:11:03 rich | |
715 | # Config cut 3. We now almost install a29k. | |
716 | # | |
717 | # Revision 1.3 1991/04/11 02:41:54 rich | |
718 | # Cut 2 config. Subdirs. | |
719 | # | |
720 | # | |
721 | # | |
722 | ||
723 | # | |
724 | # Local Variables: | |
725 | # fill-column: 131 | |
726 | # End: | |
727 | # | |
728 | ||
729 | # end of configure.template |