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