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