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