aboutsummaryrefslogtreecommitdiff
path: root/bfd/configure
diff options
context:
space:
mode:
authorK. Richard Pixley <rich@cygnus>1991-05-14 14:14:40 +0000
committerK. Richard Pixley <rich@cygnus>1991-05-14 14:14:40 +0000
commitc4220303188899ce5d0088cf9cedf162e22d4d1d (patch)
tree6e0fb53e083ebefc73fd754af4d172a3413b1629 /bfd/configure
parent7df723106b620970603c2d6a52f31103055ff150 (diff)
downloadgdb-c4220303188899ce5d0088cf9cedf162e22d4d1d.zip
gdb-c4220303188899ce5d0088cf9cedf162e22d4d1d.tar.gz
gdb-c4220303188899ce5d0088cf9cedf162e22d4d1d.tar.bz2
see devo/configure 1.11
Diffstat (limited to 'bfd/configure')
-rwxr-xr-xbfd/configure96
1 files changed, 70 insertions, 26 deletions
diff --git a/bfd/configure b/bfd/configure
index fc07559..da3adaf 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -44,6 +44,8 @@ symbolic_link='ln -s'
#hard_link="echo ln"
#symbolic_link="echo ln -s"
+progname=$0
+
# clear some things potentially inherited from environment.
ansi=
defaulttargets=
@@ -69,7 +71,8 @@ do
-destdir=* | +destdir=* | +destdi=* | +destd=* | +dest=* | +des=* | +de=* | +d=*)
destdir=`echo ${arg} | sed 's/[+-]d[a-z]*=//'`
;;
- -forcesubdirs | +forcesubdirs | +f)
+ -forcesubdirs | +forcesubdirs | +forcesubdir | +forcesubdi | +forcesubd \
+ | +forcesub | +forcesu | +forces | +force | +forc | +for | +fo | +f)
forcesubdirs=${arg}
;;
-languages=* | +languages=* | +language=* | +languag=* \
@@ -178,7 +181,7 @@ fi
srctrigger=libbfd.c
srcname="bfd"
-## end of common part
+## end of common part.
# are we rebuilding config itself?
if [ -n "${template}" ] ; then
@@ -187,12 +190,17 @@ if [ -n "${template}" ] ; then
exit 1
fi
- mv configure configure.old
- echo "#!/bin/sh" > configure
- echo "# Please do not edit this file. It is generated automatically from" >> configure
- echo "# configure.in and a configure template." >> configure
- echo "configdirs=" >> configure
- echo >> configure
+# prep the template
+ sed -e '/^#### configure.in common parts come in here.$/,/^## end of common part.$/c\
+#### configure.in common parts come in here.\
+## end of common part.' \
+ -e '/^#### configure.in per-host parts come in here.$/,/^## end of per-host part.$/c\
+#### configure.in per-host parts come in here.\
+## end of per-host part.' \
+ -e '/^#### configure.in per-target parts come in here.$/,/^## end of per-target part.$/c\
+#### configure.in per-target parts come in here.\
+## end of per-target part.' \
+ < ${template} > template.new
if [ -r configure.in ] ; then
if [ -z "`grep '^# per\-host:' configure.in`" ] ; then
@@ -211,10 +219,10 @@ if [ -n "${template}" ] ; then
sed -e '1,/^# per\-target:/d' configure.in > configure.tgt
# and insert them
- sed -e '/^#### configure.in common part/ r configure.com' \
- -e '/^#### configure.in per\-host part/ r configure.hst' \
- -e '/^#### configure.in per\-target part/ r configure.tgt' \
- ${template} >> configure
+ sed -e '/^#### configure.in common parts come in here.$/ r configure.com' \
+ -e '/^#### configure.in per\-host parts come in here.$/ r configure.hst' \
+ -e '/^#### configure.in per\-target parts come in here.$/ r configure.tgt' \
+ template.new > configure.new
rm -f configure.com configure.tgt configure.hst
else
@@ -222,8 +230,10 @@ if [ -n "${template}" ] ; then
cat ${template} >> configure
fi
- chmod a+x configure
- rm configure.old
+ chmod a+x configure.new
+ rm template.new
+# mv configure configure.old
+ mv configure.new configure
echo Rebuilt configure in `pwd`
if [ -z "${norecurse}" ] ; then
@@ -266,7 +276,7 @@ for host in ${hosts} ; do
#### configure.in per-host parts come in here.
-## end of per-target part
+## end of per-host part.
for target in ${targets} ; do
@@ -279,18 +289,22 @@ for host in ${hosts} ; do
files=
links=
-## end of per-target part
+## end of per-target part.
# Temporarily, we support only direct subdir builds.
hostsubdir=Host-${host}
targetsubdir=Target-${target}
if [ -n "${removing}" ] ; then
- if [ -d "${hostsubdir}/${targetsubdir}" ] ; then
- rm -rf ${hostsubdir}/${targetsubdir}
+ if [ -n "${forcesubdirs}" ] ; then
+ if [ -d "${hostsubdir}" ] ; then
+ rm -rf ${hostsubdir}/${targetsubdir}
- if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ] ; then
- rm -rf ${hostsubdir}
+ if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ] ; then
+ rm -rf ${hostsubdir}
+ fi
+ else
+ echo Warning: no `pwd`/${hostsubdir} to remove.
fi
else
rm -f Makefile config.status ${links}
@@ -329,11 +343,12 @@ links=
if [ -n "${srctrigger}" -a ! -r ${srcdir}/${srctrigger} ] ; then
if [ -z "${srcdirdefaulted}" ] ; then
- echo "${progname}: Can't find ${srcname} sources in \`${srcdir}'." 1>&2
+ echo "${progname}: Can't find ${srcname} sources in `pwd`/${srcdir}" 1>&2
else
- echo "${progname}: Can't find ${srcname} sources in \`.' or \`..'." 1>&2
+ echo "${progname}: Can't find ${srcname} sources in `pwd`/. or `pwd`/.." 1>&2
fi
+ echo \(At least ${srctrigger} is missing.\) 1>&2
exit 1
fi
@@ -477,8 +492,22 @@ links=
originaldir=`pwd`
cd ${srcdir}
fi
- done
-done
+ done # for each target
+
+# # Now build a Makefile for this host.
+# if [ -n "${forcesubdirs}" ] ; then
+# cd ${hostsubdir}
+# cat > GNUmakefile << E!O!F
+## Makefile generated by configure for host ${host}.
+#
+#%:
+# for i in ${targets} ; do \
+# $(MAKE) -C Target-\$i \$@
+#
+#all clean stage1 stage2 stage3 stage4etags tags TAGS
+#E!O!F
+# fi
+done # for each host
# If there are subdirectories, then recurse.
@@ -554,8 +583,23 @@ exit 0
#
# $Log$
-# Revision 1.7 1991/04/17 01:41:18 rich
-# Fixed a problem with host dependent parts.
+# Revision 1.8 1991/05/14 14:14:25 rich
+# see devo/configure 1.11
+#
+# Revision 1.10 1991/05/04 00:58:38 rich
+# Fix program name bug.
+#
+# Revision 1.9 1991/05/03 19:14:18 rich
+# Changed getopt to libiberty, commented out an aborted attempt at host
+# level Makefiles because it caused errors on +rm, add a warning for
+# directories expected to be removed on +rm but that don't exist.
+#
+# Revision 1.8 1991/04/24 16:50:59 rich
+# Three staging checkpoint.
+#
+# Revision 1.7 1991/04/17 01:34:47 rich
+# Added getopt for binutils, fixed problem with host dependancies in
+# configure.template.
#
# Revision 1.6 1991/04/16 00:18:44 rich
# Now handles multiple hosts and targets.