aboutsummaryrefslogtreecommitdiff
path: root/gdb/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 /gdb/configure
parent7df723106b620970603c2d6a52f31103055ff150 (diff)
downloadgdb-c4220303188899ce5d0088cf9cedf162e22d4d1d.zip
gdb-c4220303188899ce5d0088cf9cedf162e22d4d1d.tar.gz
gdb-c4220303188899ce5d0088cf9cedf162e22d4d1d.tar.bz2
see devo/configure 1.11
Diffstat (limited to 'gdb/configure')
-rwxr-xr-xgdb/configure195
1 files changed, 139 insertions, 56 deletions
diff --git a/gdb/configure b/gdb/configure
index 44a6967..49fc13f 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -44,8 +44,11 @@ symbolic_link='ln -s'
#hard_link="echo ln"
#symbolic_link="echo ln -s"
+progname=$0
+
# clear some things potentially inherited from environment.
ansi=
+defaulttargets=
destdir=
fatal=
hostsubdir=
@@ -68,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=* \
@@ -174,13 +178,11 @@ fi
# script appropriate for this directory. For more information, check
# any existing configure script.
-configdirs="bfd binutils ld gas gnulib gcc clib"
+configdirs="libiberty bfd binutils ld gas gcc gnulib clib"
srctrigger=README.configure
srcname="gnu development package"
-# per-host:
-
-## end of common part
+## end of common part.
# are we rebuilding config itself?
if [ -n "${template}" ] ; then
@@ -189,12 +191,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
@@ -207,21 +214,27 @@ if [ -n "${template}" ] ; then
exit 1
fi
- sed -e '/^# per\-target:/,$d' configure.in > configure.com
+ # split configure.in into common, per-host, and per-target parts
+ sed -e '/^# per\-host:/,$d' configure.in > configure.com
+ sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' configure.in > configure.hst
sed -e '1,/^# per\-target:/d' configure.in > configure.tgt
- sed -e '/^#### configure.in common parts/ r configure.com' \
- -e '/^##### / r configure.tgt' \
- ${template} >> configure
+ # and insert them
+ 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.top configure.bot
+ rm -f configure.com configure.tgt configure.hst
else
echo Warning: no configure.in in `pwd`
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
@@ -257,12 +270,14 @@ fi
for host in ${hosts} ; do
# Default other arg
- if [ -z "${targets}" ] ; then
+ if [ -z "${targets}" -o -n "${defaulttargets}" ] ; then
targets=${host}
+ defaulttargets=true
fi
#### configure.in per-host parts come in here.
-## end of per-target part
+
+## end of per-host part.
for target in ${targets} ; do
@@ -272,18 +287,23 @@ for host in ${hosts} ; do
fi
#### configure.in per-target parts come in here.
-## 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}
@@ -322,11 +342,12 @@ for host in ${hosts} ; do
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
@@ -470,8 +491,22 @@ for host in ${hosts} ; do
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.
@@ -483,44 +518,92 @@ for configdir in ${configdirs} ; do
specifics=
commons=
- for target in ${targets} ; do
- # check for target specific dir override
- if [ -d ${configdir}.${target} ] ; then
- newspecifics="${specifics} ${target}"
- specifics=${newspecifics}
- else
- newcommons="${commons} +target=${target}"
- commons=${newcommons}
- fi
+ if [ -n "${defaulttargets}" ] ; then
+ for host in ${hosts} ; do
+ if [ -d ${configdir}.${host} ] ; then
+ newspecifics="${specifics} ${host}"
+ specifics=${newspecifics}
+ else
+ newcommons="${commons} ${host}"
+ commons=${newcommons}
+ fi # if target specific
+ done # for each host
+
+ if [ -n "${commons}" ] ; then
+ (cd ${configdir} ;
+ ./configure ${commons} ${verbose} ${forcesubdirs} ${removing}) \
+ | sed 's/^/ /'
+ fi # if any common hosts
+
+ if [ -n "${specifics}" ] ; then
+ for host in ${specifics} ; do
+ echo Configuring target specific directory ${configdir}.${host}...
+ (cd ${configdir}.${host} ;
+ ./configure ${host} ${verbose} ${forcesubdirs} ${removing}) \
+ | sed 's/^/ /'
+ done # for host in specifics
+ fi # if there are any specifics
+ else
- done
+ for target in ${targets} ; do
+ if [ -d ${configdir}.${target} ] ; then
+ newspecifics="${specifics} ${target}"
+ specifics=${newspecifics}
+ else
+ newcommons="${commons} +target=${target}"
+ commons=${newcommons}
+ fi
- if [ -n "${verbose}" ] ; then
- echo " "commons=\"${commons}\"
- echo " "specifics=\"${specifics}\"
- fi
+ done # check for target specific dir override
- if [ -n "${commons}" ] ; then
- (cd ${configdir} ;
- ./configure ${host} ${verbose} ${forcesubdirs} ${removing} ${commons}) \
- | sed 's/^/ /'
- fi
+ if [ -n "${verbose}" ] ; then
+ echo " "commons=\"${commons}\"
+ echo " "specifics=\"${specifics}\"
+ fi # if verbose
- if [ -n "${specifics}" ] ; then
- for target in ${specifics} ; do
- echo Configuring target specific directory ${configdir}.${target}...
- (cd ${configdir}.${target} ;
- ./configure ${host} ${verbose} ${forcesubdirs} ${removing} "+target=${target}") \
+ if [ -n "${commons}" ] ; then
+ (cd ${configdir} ;
+ ./configure ${hosts} ${verbose} ${forcesubdirs} ${removing} ${commons}) \
| sed 's/^/ /'
- done
- fi
+ fi # if any commons
+
+ if [ -n "${specifics}" ] ; then
+ for target in ${specifics} ; do
+ echo Configuring target specific directory ${configdir}.${target}...
+ (cd ${configdir}.${target} ;
+ ./configure ${hosts} ${verbose} ${forcesubdirs} ${removing} "+target=${target}") \
+ | sed 's/^/ /'
+ done
+ fi # if any specifics
+ fi # not default targets
done
exit 0
#
# $Log$
-# Revision 1.2 1991/04/15 23:46:48 rich
+# Revision 1.3 1991/05/14 14:14:40 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.
+#
+# Revision 1.5 1991/04/15 23:43:44 rich
# Now handles multiple hosts and targets.
#
# Revision 1.4 1991/04/13 02:11:03 rich