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