From 912e0732bef948b2be1e8b57a9ebda9ada7b70c9 Mon Sep 17 00:00:00 2001 From: "K. Richard Pixley" Date: Sun, 19 May 1991 00:16:46 +0000 Subject: [PATCH] Configure for gdb. --- gdb/Makefile.dist | 33 +++++++++---- gdb/Makefile.in | 33 +++++++++---- gdb/configure | 115 ++++++++++++++++++++++++++++++++++------------ gdb/configure.in | 48 +++++++++++++++++++ 4 files changed, 179 insertions(+), 50 deletions(-) diff --git a/gdb/Makefile.dist b/gdb/Makefile.dist index 4985c43b30a..fffccd24e9a 100755 --- a/gdb/Makefile.dist +++ b/gdb/Makefile.dist @@ -16,8 +16,14 @@ # along with GDB; see the file COPYING. If not, write to # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +#### host and target dependent Makefile fragments come in here. +## + +srcdir = . +destdir = /usr/local + # Place to install binaries. -bindir=/usr/local/bin +bindir=$(destdir)/bin # System V: If you compile gdb with a compiler which uses the coff # encapsulation feature (this is a function of the compiler used, NOT @@ -278,16 +284,22 @@ rapp: $(RAPP_OBS) ${srcdir}/munch ${RAPP_OBS} > rapp_init.c ${CC-LD} $(LDFLAGS) -o $@ rapp_init.c $(RAPP_OBS) -Makefiles= Makefile.sdir $(M_MAKEFILE) \ - ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist +Makefiles= ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist + +MAKE_MAKEFILE_IN= cat ${Makefiles} ${srcdir}/depend > $(srcdir)/Makefile.in + +$(srcdir)/Makefile.in: $(Makefiles) + $(MAKE_MAKEFILE_IN) -MAKE_MAKEFILE= echo "M_MAKEFILE=$(M_MAKEFILE)" | \ - cat - ${Makefiles} ${srcdir}/depend >Makefile +# with the gnu make, this is done automatically. -Makefile: $(Makefiles) - $(MAKE_MAKEFILE) +Makefile: $(srcdir)/Makefile.in $(srcdir)/configure + (cd $(srcdir) ; \ + ./configure +destdir=$(destdir) +norecurse \ + `if [ "$(srcdir)" != "." ] ; then echo +f; fi` \ + $(host) +target=$(target)) -alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig +$(srcdir)/alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig rm -f alldeps.mak alldeps.tmp allparam.tmp allconfig.tmp for i in `ls -d ${srcdir}/tconfig/*[0-9A-Za-z] \ ${srcdir}/xconfig/*[0-9A-Za-z] | grep -v RCS` ; do \ @@ -332,6 +344,7 @@ alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig NR == 0 {printf $$0;} \ NR != 0 {printf "\\\n" $$0} \ END {printf "\n\n"}' >>alldeps.mak; + if [ "$(srcdir)" != "." ] ; then mv alldeps.mak $(srcdir) ; fi rm -f alldeps.tmp alldeps2.tmp allparam.tmp allconfig.tmp # The sed script makes everything which depends on {x,t}m.h depend on @@ -352,8 +365,8 @@ depend: $(SOURCES) Makefile.dist -e 's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \ -e 's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \ -e 's; \./; $${srcdir}/;g' \ - >depend - $(MAKE_MAKEFILE) + >$(srcdir)/depend + $(MAKE_MAKEFILE_IN) rm depend.tmp config.status: diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 4985c43b30a..fffccd24e9a 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -16,8 +16,14 @@ # along with GDB; see the file COPYING. If not, write to # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +#### host and target dependent Makefile fragments come in here. +## + +srcdir = . +destdir = /usr/local + # Place to install binaries. -bindir=/usr/local/bin +bindir=$(destdir)/bin # System V: If you compile gdb with a compiler which uses the coff # encapsulation feature (this is a function of the compiler used, NOT @@ -278,16 +284,22 @@ rapp: $(RAPP_OBS) ${srcdir}/munch ${RAPP_OBS} > rapp_init.c ${CC-LD} $(LDFLAGS) -o $@ rapp_init.c $(RAPP_OBS) -Makefiles= Makefile.sdir $(M_MAKEFILE) \ - ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist +Makefiles= ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist + +MAKE_MAKEFILE_IN= cat ${Makefiles} ${srcdir}/depend > $(srcdir)/Makefile.in + +$(srcdir)/Makefile.in: $(Makefiles) + $(MAKE_MAKEFILE_IN) -MAKE_MAKEFILE= echo "M_MAKEFILE=$(M_MAKEFILE)" | \ - cat - ${Makefiles} ${srcdir}/depend >Makefile +# with the gnu make, this is done automatically. -Makefile: $(Makefiles) - $(MAKE_MAKEFILE) +Makefile: $(srcdir)/Makefile.in $(srcdir)/configure + (cd $(srcdir) ; \ + ./configure +destdir=$(destdir) +norecurse \ + `if [ "$(srcdir)" != "." ] ; then echo +f; fi` \ + $(host) +target=$(target)) -alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig +$(srcdir)/alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig rm -f alldeps.mak alldeps.tmp allparam.tmp allconfig.tmp for i in `ls -d ${srcdir}/tconfig/*[0-9A-Za-z] \ ${srcdir}/xconfig/*[0-9A-Za-z] | grep -v RCS` ; do \ @@ -332,6 +344,7 @@ alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig NR == 0 {printf $$0;} \ NR != 0 {printf "\\\n" $$0} \ END {printf "\n\n"}' >>alldeps.mak; + if [ "$(srcdir)" != "." ] ; then mv alldeps.mak $(srcdir) ; fi rm -f alldeps.tmp alldeps2.tmp allparam.tmp allconfig.tmp # The sed script makes everything which depends on {x,t}m.h depend on @@ -352,8 +365,8 @@ depend: $(SOURCES) Makefile.dist -e 's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \ -e 's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \ -e 's; \./; $${srcdir}/;g' \ - >depend - $(MAKE_MAKEFILE) + >$(srcdir)/depend + $(MAKE_MAKEFILE_IN) rm depend.tmp config.status: diff --git a/gdb/configure b/gdb/configure index 49fc13f1010..44ab9dc268b 100755 --- a/gdb/configure +++ b/gdb/configure @@ -173,14 +173,12 @@ if [ -n "${fatal}" -o "${hosts}" = "help" ] ; then fi #### configure.in common parts come in here. -# This file is a shell script fragment that supplies the information -# necessary to tailor a template configure script into the configure -# script appropriate for this directory. For more information, check -# any existing configure script. +srcname="GDB" +srctrigger=main.c -configdirs="libiberty bfd binutils ld gas gcc gnulib clib" -srctrigger=README.configure -srcname="gnu development package" +if [ -z "${template}" ] ; then + make -f Makefile.dist Makefile.in +fi ## end of common part. @@ -249,11 +247,15 @@ if [ -n "${template}" ] ; then fi for i in ${configdir} ${targetspecificdirs} ; do - if [ -r $i/configure ] ; then - (cd $i ; - ./configure +template=${template} ${verbose}) + if [ -d $i ] ; then + if [ -r $i/configure ] ; then + (cd $i ; + ./configure +template=${template} ${verbose}) + else + echo No configure script in `pwd`/$i + fi else - echo No configure script in `pwd`/$i + echo Warning: directory $i is missing. fi done done @@ -277,6 +279,17 @@ for host in ${hosts} ; do #### configure.in per-host parts come in here. +if [ ! -f xconfig/${host} ]; then + echo "No such host ${host}" + exit 1 +fi + +targetfile=`awk ' + $1 == "XM_FILE=" { print $2 }' > Makefile # and shake thoroughly. - host_var_file=hmake-${host} - target_var_file=tmake-${target} + if [ -z "${host_makefile_frag}" ] ; then + host_makefile_frag=config/hmake-${host} + fi + + if [ -z "${target_makefile_frag}" ] ; then + target_makefile_frag=config/tmake-${target} + fi # Conditionalize the makefile for this host. - if [ -f ${srcdir}/config/${host_var_file} ] ; then - sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile > Makefile.tem + if [ -f ${srcdir}/${host_makefile_frag} ] ; then + sed -e "/^####/ r ${srcdir}/${host_makefile_frag}" Makefile > Makefile.tem mv Makefile.tem Makefile fi # Conditionalize the makefile for this target. - if [ -f ${srcdir}/config/${target_var_file} ] ; then - sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile > Makefile.tem + if [ -f ${srcdir}/${target_makefile_frag} ] ; then + sed -e "/^####/ r ${srcdir}/${target_makefile_frag}" Makefile > Makefile.tem mv Makefile.tem Makefile fi @@ -462,15 +509,15 @@ for host in ${hosts} ; do mv Makefile.tem Makefile using= - if [ -f ${srcdir}/config/${host_var_file} ] ; then - using=" using \"${host_var_file}\"" + if [ -f ${srcdir}/${host_makefile_frag} ] ; then + using=" using \"${host_makefile_frag}\"" fi - if [ -f ${srcdir}/config/${target_var_file} ] ; then + if [ -f ${srcdir}/${target_makefile_frag} ] ; then if [ -z "${using}" ] ; then - andusing=" using \"${target_var_file}\"" + andusing=" using \"${target_makefile_frag}\"" else - andusing="${using} and \"${target_var_file}\"" + andusing="${using} and \"${target_makefile_frag}\"" fi else andusing=${using} @@ -530,9 +577,13 @@ for configdir in ${configdirs} ; do done # for each host if [ -n "${commons}" ] ; then - (cd ${configdir} ; - ./configure ${commons} ${verbose} ${forcesubdirs} ${removing}) \ - | sed 's/^/ /' + if [ -d ${configdir} ] ; then + (cd ${configdir} ; + ./configure ${commons} ${verbose} ${forcesubdirs} ${removing}) \ + | sed 's/^/ /' + else + echo Warning: directory \"${configdir}\" is missing. + fi fi # if any common hosts if [ -n "${specifics}" ] ; then @@ -562,9 +613,13 @@ for configdir in ${configdirs} ; do fi # if verbose if [ -n "${commons}" ] ; then - (cd ${configdir} ; - ./configure ${hosts} ${verbose} ${forcesubdirs} ${removing} ${commons}) \ - | sed 's/^/ /' + if [ -d ${configdir} ] ; then + (cd ${configdir} ; + ./configure ${hosts} ${verbose} ${forcesubdirs} ${removing} ${commons}) \ + | sed 's/^/ /' + else + echo Warning: directory \"${configdir}\" is missing. + fi fi # if any commons if [ -n "${specifics}" ] ; then @@ -582,8 +637,8 @@ exit 0 # # $Log$ -# Revision 1.3 1991/05/14 14:14:40 rich -# see devo/configure 1.11 +# Revision 1.4 1991/05/19 00:16:45 rich +# Configure for gdb. # # Revision 1.10 1991/05/04 00:58:38 rich # Fix program name bug. diff --git a/gdb/configure.in b/gdb/configure.in index 277eb3c0efa..6cc5fba34b3 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -1,3 +1,51 @@ +srcname="GDB" +srctrigger=main.c + +if [ -z "${template}" ] ; then + make -f Makefile.dist Makefile.in +fi + # per-host: +if [ ! -f xconfig/${host} ]; then + echo "No such host ${host}" + exit 1 +fi + +targetfile=`awk ' + $1 == "XM_FILE=" { print $2 }'