diff options
author | K. Richard Pixley <rich@cygnus> | 1991-04-10 22:56:51 +0000 |
---|---|---|
committer | K. Richard Pixley <rich@cygnus> | 1991-04-10 22:56:51 +0000 |
commit | f2e91404e7f0f821448493cb48c0aa0499f81c42 (patch) | |
tree | 475f1cefe575998531859df1740916d2849d904f | |
parent | 74cc5508e7f605763b9f48bd6eff2530fcacd080 (diff) | |
download | gdb-f2e91404e7f0f821448493cb48c0aa0499f81c42.zip gdb-f2e91404e7f0f821448493cb48c0aa0499f81c42.tar.gz gdb-f2e91404e7f0f821448493cb48c0aa0499f81c42.tar.bz2 |
Cut 2. Subdirs.
-rw-r--r-- | bfd/Makefile.in | 4 | ||||
-rwxr-xr-x | bfd/configure | 203 | ||||
-rwxr-xr-x | binutils/configure | 203 | ||||
-rw-r--r-- | ld/Makefile.in | 7 | ||||
-rwxr-xr-x | ld/configure | 203 |
5 files changed, 358 insertions, 262 deletions
diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 861edd3..b483c0c 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -162,4 +162,6 @@ make: sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile Makefile: $(srcdir)/Makefile.in $(srcdir)/configure - (cd $(srcdir) ; ./configure -host=$(host) $(target)) + (cd $(srcdir) ; \ + ./configure `if [ "$(srcdir)" != "." ] ; then echo +f; fi` -host=$(host) $(target)) + diff --git a/bfd/configure b/bfd/configure index 8e53d4e..d0b1680 100755 --- a/bfd/configure +++ b/bfd/configure @@ -49,12 +49,14 @@ symbolic_link='ln -s' #symbolic_link="echo ln -s" # clear some things potentially inherited from environment. -target= -template= -removing= -norecurse= ansi= +hostsubdir= +norecurse= +removing= srcdir= +target= +targetsubdir= +template= for arg in $*; do @@ -62,17 +64,8 @@ do -ansi | +ansi) ansi=true ;; - -template=* | +template=*) - template=`echo $arg | sed 's/[+-]template=//'` - ;; - -norecurse | +norecurse) - norecurse=true - ;; - -rm | +rm) - removing=$arg - ;; - -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*) - srcdir=`echo $arg | sed 's/[+-]s[a-z]*=//'` + -forcesubdirs | +f*) + forcesubdirs=${arg} ;; -host=* | +host=* | +hos=* | +ho=* | +h=*) host=`echo $arg | sed 's/[+-]h[a-z]*=//'` @@ -88,6 +81,18 @@ do -nfp | +nfp | +nf | +n) nfp=yes ;; + -norecurse | +norecurse) + norecurse=true + ;; + -rm | +rm) + removing=$arg + ;; + -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*) + srcdir=`echo $arg | sed 's/[+-]s[a-z]*=//'` + ;; + -template=* | +template=*) + template=`echo $arg | sed 's/[+-]template=//'` + ;; *) # Allow configure HOST TARGET if [ x$host = x ] ; then host=$target ; fi @@ -96,7 +101,7 @@ do esac done -# process host and target only if not rebuilding configure itself. +# process host and target only if not rebuilding configure itself or removing. if [ -z "$template" -a -z "$removing" ] then # Complain if an arg is missing @@ -111,13 +116,12 @@ then fi exit 1 fi +fi - # Default other arg - if [ -z "$host" ] - then - host=$target - fi - +# Default other arg +if [ -z "$host" ] +then + host=$target fi #### configure.in files come in here. @@ -190,28 +194,47 @@ then fi # Temporarily, we support only direct subdir builds. -hostsubdir=Host-$host -targetsubdir=Target-$target +hostsubdir=Host-${host} +targetsubdir=Target-${target} -if [ -n "$removing" ] +if [ -n "${removing}" ] then -# rm -rf $hostsubdir/$targetsubdir -# -# if [ -z "`(ls $hostsubdir) 2>&1 | grep Target-`" ] -# then -# rm -rf $hostsubdir -# fi - - rm -f .gdbinit Makefile config.status $links + if [ -d "${hostsubdir}/${targetsubdir}" ] + then + rm -rf ${hostsubdir}/${targetsubdir} + if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ] + then + rm -rf ${hostsubdir} + fi + else + rm -f .gdbinit Makefile config.status $links + fi else -# if [ ! -d $hostsubdir ] ; then mkdir $hostsubdir ; fi -# cd $hostsubdir -# -# if [ ! -d $targetsubdir ] ; then mkdir $targetsubdir ; fi -# cd $targetsubdir -# -# srcdir=../.. + if [ -n "$forcesubdirs" ] + then + # check for existing status before allowing forced subdirs. + if [ -f Makefile ] + then + echo "Makefile already exists in source directory. `pwd` not configured." + exit 1 + fi + + if [ ! -d $hostsubdir ] ; then mkdir $hostsubdir ; fi + cd $hostsubdir + + if [ ! -d $targetsubdir ] ; then mkdir $targetsubdir ; fi + cd $targetsubdir + + srcdir=../.. + else + # if not subdir builds, then make sure none exist. + if [ -n "`(ls .) 2>&1 | grep Host-`" ] + then + echo "Configured subdirs exist. `pwd` not configured." + exit 1 + fi + fi # Find the source files, if location was not specified. if [ x$srcdir = x ] @@ -265,73 +288,84 @@ else echo "Linked \"$link\" to \"${srcdir}/${file}\"." done - # Install a makefile, and make it set VPATH - # if necessary so that the sources are found. - # Also change its value of srcdir. - # Also create a .gdbinit file which runs the one in srcdir + # Create a .gdbinit file which runs the one in srcdir # and tells GDB to look there for source files. + case $srcdir in .) ;; *) - echo "VPATH = ${srcdir}" > x - cat x ${srcdir}/Makefile.in | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.in - rm x echo "dir ." > .gdbinit echo "dir ${srcdir}" >> .gdbinit echo "source ${srcdir}/.gdbinit" >> .gdbinit ;; esac + # Install a makefile, and make it set VPATH + # if necessary so that the sources are found. + # Also change its value of srcdir. + +# FIXME-someday: This business of always writing to .tem and mv back +# is so that I don't screw things up while developing. Once this +# template is stable, these should be optimized. xoxorich. + + # Define macro CROSS_COMPILE in compilation if this is a cross-compiler. + if [ x$host != x$target ] + then + echo "CROSS=-DCROSS_COMPILE" > Makefile + echo "ALL=start.encap" >> Makefile + else + echo "ALL=all.internal" > Makefile + fi + + # set target, host, VPATH + echo "host = $host" >> Makefile + echo "target = $target" >> Makefile + + if [ -n "${forcesubdirs}" ] + then + echo "subdir = /${hostsubdir}/${targetsubdir}" >> Makefile + else + echo "subdir =" >> Makefile + fi + +# echo "workdir = `pwd`" >> Makefile + echo "VPATH = ${srcdir}" >> Makefile + + # add Makefile.in + cat ${srcdir}/Makefile.in >> Makefile + + # and shake thoroughly. host_var_file=hmake-${host} target_var_file=tmake-${target} # Conditionalize the makefile for this machine. if [ -f ${srcdir}/config/${host_var_file} ] then - sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile.in > Makefile.tem - else - cp Makefile.in Makefile.tem + sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile > Makefile.tem + mv Makefile.tem Makefile fi if [ -f ${srcdir}/config/${target_var_file} ] then - sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile.tem > Makefile.tem1 - mv Makefile.tem1 Makefile.tem + sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile > Makefile.tem + mv Makefile.tem Makefile fi + sed "s@^srcdir = \.@srcdir = ${srcdir}@" Makefile > Makefile.tem + mv Makefile.tem Makefile + # Remove all formfeeds, since some Makes get confused by them. - sed "s///" Makefile.tem >> Makefile.tem1 - mv Makefile.tem1 Makefile.tem + sed "s///" Makefile >> Makefile.tem + mv Makefile.tem Makefile # reset SUBDIRS - sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile.tem > Makefile.tem1 - mv Makefile.tem1 Makefile.tem + sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile > Makefile.tem + mv Makefile.tem Makefile # reset NONSUBDIRS - sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile.tem > Makefile.tem1 - mv Makefile.tem1 Makefile.tem - - # Delete the intermediate files - if [ x$srcdir != x. ] ; then rm Makefile.in ; fi - - rm -f Makefile - - # Define macro CROSS_COMPILE in compilation if this is a cross-compiler. - if [ x$host != x$target ] - then - echo "CROSS=-DCROSS_COMPILE" > Makefile - echo "ALL=start.encap" >> Makefile - else - echo "ALL=all.internal" > Makefile - fi - - # set target and host - echo "host = $host" >> Makefile - echo "target = $target" >> Makefile - - cat Makefile.tem >> Makefile - rm Makefile.tem + sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile > Makefile.tem + mv Makefile.tem Makefile using= if [ -f ${srcdir}/config/${host_var_file} ] @@ -364,6 +398,7 @@ else # | tee ${srcdir}/config.status fi + originaldir=`pwd` cd ${srcdir} fi @@ -384,12 +419,8 @@ do fi echo Configuring ${configdir}... -# (cd ${configdir} ; -# configure +host=${host} ${target} ${removing}) \ -# | sed 's/^/ /' - (cd ${configdir} ; - ./configure +host=${host} ${target} ${removing}) \ + ./configure ${forcesubdirs} ${removing} +host=${host} ${target}) \ | sed 's/^/ /' done @@ -397,8 +428,8 @@ exit 0 # # $Log$ -# Revision 1.2 1991/04/09 23:20:12 rich -# First minimally usable checkin. +# Revision 1.3 1991/04/10 22:56:14 rich +# Cut 2. Subdirs. # # # diff --git a/binutils/configure b/binutils/configure index 1c764aa..c0473fa 100755 --- a/binutils/configure +++ b/binutils/configure @@ -49,12 +49,14 @@ symbolic_link='ln -s' #symbolic_link="echo ln -s" # clear some things potentially inherited from environment. -target= -template= -removing= -norecurse= ansi= +hostsubdir= +norecurse= +removing= srcdir= +target= +targetsubdir= +template= for arg in $*; do @@ -62,17 +64,8 @@ do -ansi | +ansi) ansi=true ;; - -template=* | +template=*) - template=`echo $arg | sed 's/[+-]template=//'` - ;; - -norecurse | +norecurse) - norecurse=true - ;; - -rm | +rm) - removing=$arg - ;; - -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*) - srcdir=`echo $arg | sed 's/[+-]s[a-z]*=//'` + -forcesubdirs | +f*) + forcesubdirs=${arg} ;; -host=* | +host=* | +hos=* | +ho=* | +h=*) host=`echo $arg | sed 's/[+-]h[a-z]*=//'` @@ -88,6 +81,18 @@ do -nfp | +nfp | +nf | +n) nfp=yes ;; + -norecurse | +norecurse) + norecurse=true + ;; + -rm | +rm) + removing=$arg + ;; + -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*) + srcdir=`echo $arg | sed 's/[+-]s[a-z]*=//'` + ;; + -template=* | +template=*) + template=`echo $arg | sed 's/[+-]template=//'` + ;; *) # Allow configure HOST TARGET if [ x$host = x ] ; then host=$target ; fi @@ -96,7 +101,7 @@ do esac done -# process host and target only if not rebuilding configure itself. +# process host and target only if not rebuilding configure itself or removing. if [ -z "$template" -a -z "$removing" ] then # Complain if an arg is missing @@ -111,13 +116,12 @@ then fi exit 1 fi +fi - # Default other arg - if [ -z "$host" ] - then - host=$target - fi - +# Default other arg +if [ -z "$host" ] +then + host=$target fi #### configure.in files come in here. @@ -191,28 +195,47 @@ then fi # Temporarily, we support only direct subdir builds. -hostsubdir=Host-$host -targetsubdir=Target-$target +hostsubdir=Host-${host} +targetsubdir=Target-${target} -if [ -n "$removing" ] +if [ -n "${removing}" ] then -# rm -rf $hostsubdir/$targetsubdir -# -# if [ -z "`(ls $hostsubdir) 2>&1 | grep Target-`" ] -# then -# rm -rf $hostsubdir -# fi - - rm -f .gdbinit Makefile config.status $links + if [ -d "${hostsubdir}/${targetsubdir}" ] + then + rm -rf ${hostsubdir}/${targetsubdir} + if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ] + then + rm -rf ${hostsubdir} + fi + else + rm -f .gdbinit Makefile config.status $links + fi else -# if [ ! -d $hostsubdir ] ; then mkdir $hostsubdir ; fi -# cd $hostsubdir -# -# if [ ! -d $targetsubdir ] ; then mkdir $targetsubdir ; fi -# cd $targetsubdir -# -# srcdir=../.. + if [ -n "$forcesubdirs" ] + then + # check for existing status before allowing forced subdirs. + if [ -f Makefile ] + then + echo "Makefile already exists in source directory. `pwd` not configured." + exit 1 + fi + + if [ ! -d $hostsubdir ] ; then mkdir $hostsubdir ; fi + cd $hostsubdir + + if [ ! -d $targetsubdir ] ; then mkdir $targetsubdir ; fi + cd $targetsubdir + + srcdir=../.. + else + # if not subdir builds, then make sure none exist. + if [ -n "`(ls .) 2>&1 | grep Host-`" ] + then + echo "Configured subdirs exist. `pwd` not configured." + exit 1 + fi + fi # Find the source files, if location was not specified. if [ x$srcdir = x ] @@ -266,73 +289,84 @@ else echo "Linked \"$link\" to \"${srcdir}/${file}\"." done - # Install a makefile, and make it set VPATH - # if necessary so that the sources are found. - # Also change its value of srcdir. - # Also create a .gdbinit file which runs the one in srcdir + # Create a .gdbinit file which runs the one in srcdir # and tells GDB to look there for source files. + case $srcdir in .) ;; *) - echo "VPATH = ${srcdir}" > x - cat x ${srcdir}/Makefile.in | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.in - rm x echo "dir ." > .gdbinit echo "dir ${srcdir}" >> .gdbinit echo "source ${srcdir}/.gdbinit" >> .gdbinit ;; esac + # Install a makefile, and make it set VPATH + # if necessary so that the sources are found. + # Also change its value of srcdir. + +# FIXME-someday: This business of always writing to .tem and mv back +# is so that I don't screw things up while developing. Once this +# template is stable, these should be optimized. xoxorich. + + # Define macro CROSS_COMPILE in compilation if this is a cross-compiler. + if [ x$host != x$target ] + then + echo "CROSS=-DCROSS_COMPILE" > Makefile + echo "ALL=start.encap" >> Makefile + else + echo "ALL=all.internal" > Makefile + fi + + # set target, host, VPATH + echo "host = $host" >> Makefile + echo "target = $target" >> Makefile + + if [ -n "${forcesubdirs}" ] + then + echo "subdir = /${hostsubdir}/${targetsubdir}" >> Makefile + else + echo "subdir =" >> Makefile + fi + +# echo "workdir = `pwd`" >> Makefile + echo "VPATH = ${srcdir}" >> Makefile + + # add Makefile.in + cat ${srcdir}/Makefile.in >> Makefile + + # and shake thoroughly. host_var_file=hmake-${host} target_var_file=tmake-${target} # Conditionalize the makefile for this machine. if [ -f ${srcdir}/config/${host_var_file} ] then - sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile.in > Makefile.tem - else - cp Makefile.in Makefile.tem + sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile > Makefile.tem + mv Makefile.tem Makefile fi if [ -f ${srcdir}/config/${target_var_file} ] then - sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile.tem > Makefile.tem1 - mv Makefile.tem1 Makefile.tem + sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile > Makefile.tem + mv Makefile.tem Makefile fi + sed "s@^srcdir = \.@srcdir = ${srcdir}@" Makefile > Makefile.tem + mv Makefile.tem Makefile + # Remove all formfeeds, since some Makes get confused by them. - sed "s///" Makefile.tem >> Makefile.tem1 - mv Makefile.tem1 Makefile.tem + sed "s///" Makefile >> Makefile.tem + mv Makefile.tem Makefile # reset SUBDIRS - sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile.tem > Makefile.tem1 - mv Makefile.tem1 Makefile.tem + sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile > Makefile.tem + mv Makefile.tem Makefile # reset NONSUBDIRS - sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile.tem > Makefile.tem1 - mv Makefile.tem1 Makefile.tem - - # Delete the intermediate files - if [ x$srcdir != x. ] ; then rm Makefile.in ; fi - - rm -f Makefile - - # Define macro CROSS_COMPILE in compilation if this is a cross-compiler. - if [ x$host != x$target ] - then - echo "CROSS=-DCROSS_COMPILE" > Makefile - echo "ALL=start.encap" >> Makefile - else - echo "ALL=all.internal" > Makefile - fi - - # set target and host - echo "host = $host" >> Makefile - echo "target = $target" >> Makefile - - cat Makefile.tem >> Makefile - rm Makefile.tem + sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile > Makefile.tem + mv Makefile.tem Makefile using= if [ -f ${srcdir}/config/${host_var_file} ] @@ -365,6 +399,7 @@ else # | tee ${srcdir}/config.status fi + originaldir=`pwd` cd ${srcdir} fi @@ -385,12 +420,8 @@ do fi echo Configuring ${configdir}... -# (cd ${configdir} ; -# configure +host=${host} ${target} ${removing}) \ -# | sed 's/^/ /' - (cd ${configdir} ; - ./configure +host=${host} ${target} ${removing}) \ + ./configure ${forcesubdirs} ${removing} +host=${host} ${target}) \ | sed 's/^/ /' done @@ -398,8 +429,8 @@ exit 0 # # $Log$ -# Revision 1.2 1991/04/09 23:44:28 rich -# First cut config hits binutils. +# Revision 1.3 1991/04/10 22:56:51 rich +# Cut 2. Subdirs. # # # diff --git a/ld/Makefile.in b/ld/Makefile.in index 388b00a..a8f81c1 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -40,7 +40,7 @@ PROGS = $(HOSTDIR)/ld.new # for self hosting GNUTARGET=a.out-generic-big LDEMULATION=gld -BFDLIB=$(srcdir)/../bfd/libbfd.a +BFDLIB=$(srcdir)/../bfd$(subdir)/libbfd.a OBJS= ldgram.o ldlex.o ldlang.o ldmain.o ldwrite.o ldexp.o ld-lnk960.o ld-gld68k.o \ ld-gld.o ld-gld960.o ld-emul.o ldversion.o ldmisc.o ldsym.o ldfile.o @@ -113,7 +113,7 @@ ldmisc.o: ldmisc.c ldsym.o: ldsym.c clean: - - rm -f $(OBJS) $(GENERATED_SOURCES) $(GENERATED_HEADERS) + - rm -f TAGS $(OBJS) $(GENERATED_SOURCES) $(GENERATED_HEADERS) - rm -f ld ld1 ld2 ld3 ld.new @@ -194,7 +194,8 @@ make: # Makefile: $(srcdir)/Makefile.in $(srcdir)/configure - (cd $(srcdir) ; ./configure -host=$(host) $(target)) + (cd $(srcdir) ; \ + ./configure `if [ "$(srcdir)" != "." ] ; then echo +f; fi` -host=$(host) $(target)) ### Local Variables: *** ### mode:fundamental *** diff --git a/ld/configure b/ld/configure index 3dbbb47..103106c 100755 --- a/ld/configure +++ b/ld/configure @@ -49,12 +49,14 @@ symbolic_link='ln -s' #symbolic_link="echo ln -s" # clear some things potentially inherited from environment. -target= -template= -removing= -norecurse= ansi= +hostsubdir= +norecurse= +removing= srcdir= +target= +targetsubdir= +template= for arg in $*; do @@ -62,17 +64,8 @@ do -ansi | +ansi) ansi=true ;; - -template=* | +template=*) - template=`echo $arg | sed 's/[+-]template=//'` - ;; - -norecurse | +norecurse) - norecurse=true - ;; - -rm | +rm) - removing=$arg - ;; - -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*) - srcdir=`echo $arg | sed 's/[+-]s[a-z]*=//'` + -forcesubdirs | +f*) + forcesubdirs=${arg} ;; -host=* | +host=* | +hos=* | +ho=* | +h=*) host=`echo $arg | sed 's/[+-]h[a-z]*=//'` @@ -88,6 +81,18 @@ do -nfp | +nfp | +nf | +n) nfp=yes ;; + -norecurse | +norecurse) + norecurse=true + ;; + -rm | +rm) + removing=$arg + ;; + -srcdir=* | +srcdir=* | +srcdi=* | +srcd=* | +src=* | +sr=* | +s=*) + srcdir=`echo $arg | sed 's/[+-]s[a-z]*=//'` + ;; + -template=* | +template=*) + template=`echo $arg | sed 's/[+-]template=//'` + ;; *) # Allow configure HOST TARGET if [ x$host = x ] ; then host=$target ; fi @@ -96,7 +101,7 @@ do esac done -# process host and target only if not rebuilding configure itself. +# process host and target only if not rebuilding configure itself or removing. if [ -z "$template" -a -z "$removing" ] then # Complain if an arg is missing @@ -111,13 +116,12 @@ then fi exit 1 fi +fi - # Default other arg - if [ -z "$host" ] - then - host=$target - fi - +# Default other arg +if [ -z "$host" ] +then + host=$target fi #### configure.in files come in here. @@ -191,28 +195,47 @@ then fi # Temporarily, we support only direct subdir builds. -hostsubdir=Host-$host -targetsubdir=Target-$target +hostsubdir=Host-${host} +targetsubdir=Target-${target} -if [ -n "$removing" ] +if [ -n "${removing}" ] then -# rm -rf $hostsubdir/$targetsubdir -# -# if [ -z "`(ls $hostsubdir) 2>&1 | grep Target-`" ] -# then -# rm -rf $hostsubdir -# fi - - rm -f .gdbinit Makefile config.status $links + if [ -d "${hostsubdir}/${targetsubdir}" ] + then + rm -rf ${hostsubdir}/${targetsubdir} + if [ -z "`(ls ${hostsubdir}) 2>&1 | grep Target-`" ] + then + rm -rf ${hostsubdir} + fi + else + rm -f .gdbinit Makefile config.status $links + fi else -# if [ ! -d $hostsubdir ] ; then mkdir $hostsubdir ; fi -# cd $hostsubdir -# -# if [ ! -d $targetsubdir ] ; then mkdir $targetsubdir ; fi -# cd $targetsubdir -# -# srcdir=../.. + if [ -n "$forcesubdirs" ] + then + # check for existing status before allowing forced subdirs. + if [ -f Makefile ] + then + echo "Makefile already exists in source directory. `pwd` not configured." + exit 1 + fi + + if [ ! -d $hostsubdir ] ; then mkdir $hostsubdir ; fi + cd $hostsubdir + + if [ ! -d $targetsubdir ] ; then mkdir $targetsubdir ; fi + cd $targetsubdir + + srcdir=../.. + else + # if not subdir builds, then make sure none exist. + if [ -n "`(ls .) 2>&1 | grep Host-`" ] + then + echo "Configured subdirs exist. `pwd` not configured." + exit 1 + fi + fi # Find the source files, if location was not specified. if [ x$srcdir = x ] @@ -266,73 +289,84 @@ else echo "Linked \"$link\" to \"${srcdir}/${file}\"." done - # Install a makefile, and make it set VPATH - # if necessary so that the sources are found. - # Also change its value of srcdir. - # Also create a .gdbinit file which runs the one in srcdir + # Create a .gdbinit file which runs the one in srcdir # and tells GDB to look there for source files. + case $srcdir in .) ;; *) - echo "VPATH = ${srcdir}" > x - cat x ${srcdir}/Makefile.in | sed "s@^srcdir = \.@srcdir = ${srcdir}@" > Makefile.in - rm x echo "dir ." > .gdbinit echo "dir ${srcdir}" >> .gdbinit echo "source ${srcdir}/.gdbinit" >> .gdbinit ;; esac + # Install a makefile, and make it set VPATH + # if necessary so that the sources are found. + # Also change its value of srcdir. + +# FIXME-someday: This business of always writing to .tem and mv back +# is so that I don't screw things up while developing. Once this +# template is stable, these should be optimized. xoxorich. + + # Define macro CROSS_COMPILE in compilation if this is a cross-compiler. + if [ x$host != x$target ] + then + echo "CROSS=-DCROSS_COMPILE" > Makefile + echo "ALL=start.encap" >> Makefile + else + echo "ALL=all.internal" > Makefile + fi + + # set target, host, VPATH + echo "host = $host" >> Makefile + echo "target = $target" >> Makefile + + if [ -n "${forcesubdirs}" ] + then + echo "subdir = /${hostsubdir}/${targetsubdir}" >> Makefile + else + echo "subdir =" >> Makefile + fi + +# echo "workdir = `pwd`" >> Makefile + echo "VPATH = ${srcdir}" >> Makefile + + # add Makefile.in + cat ${srcdir}/Makefile.in >> Makefile + + # and shake thoroughly. host_var_file=hmake-${host} target_var_file=tmake-${target} # Conditionalize the makefile for this machine. if [ -f ${srcdir}/config/${host_var_file} ] then - sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile.in > Makefile.tem - else - cp Makefile.in Makefile.tem + sed -e "/^####/ r ${srcdir}/config/${host_var_file}" Makefile > Makefile.tem + mv Makefile.tem Makefile fi if [ -f ${srcdir}/config/${target_var_file} ] then - sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile.tem > Makefile.tem1 - mv Makefile.tem1 Makefile.tem + sed -e "/^####/ r ${srcdir}/config/${target_var_file}" Makefile > Makefile.tem + mv Makefile.tem Makefile fi + sed "s@^srcdir = \.@srcdir = ${srcdir}@" Makefile > Makefile.tem + mv Makefile.tem Makefile + # Remove all formfeeds, since some Makes get confused by them. - sed "s///" Makefile.tem >> Makefile.tem1 - mv Makefile.tem1 Makefile.tem + sed "s///" Makefile >> Makefile.tem + mv Makefile.tem Makefile # reset SUBDIRS - sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile.tem > Makefile.tem1 - mv Makefile.tem1 Makefile.tem + sed "s:^SUBDIRS =.*$:SUBDIRS = ${configdirs}:" Makefile > Makefile.tem + mv Makefile.tem Makefile # reset NONSUBDIRS - sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile.tem > Makefile.tem1 - mv Makefile.tem1 Makefile.tem - - # Delete the intermediate files - if [ x$srcdir != x. ] ; then rm Makefile.in ; fi - - rm -f Makefile - - # Define macro CROSS_COMPILE in compilation if this is a cross-compiler. - if [ x$host != x$target ] - then - echo "CROSS=-DCROSS_COMPILE" > Makefile - echo "ALL=start.encap" >> Makefile - else - echo "ALL=all.internal" > Makefile - fi - - # set target and host - echo "host = $host" >> Makefile - echo "target = $target" >> Makefile - - cat Makefile.tem >> Makefile - rm Makefile.tem + sed "s:^NONSUBDIRS =.*$:NONSUBDIRS = ${noconfigdirs}:" Makefile > Makefile.tem + mv Makefile.tem Makefile using= if [ -f ${srcdir}/config/${host_var_file} ] @@ -365,6 +399,7 @@ else # | tee ${srcdir}/config.status fi + originaldir=`pwd` cd ${srcdir} fi @@ -385,12 +420,8 @@ do fi echo Configuring ${configdir}... -# (cd ${configdir} ; -# configure +host=${host} ${target} ${removing}) \ -# | sed 's/^/ /' - (cd ${configdir} ; - ./configure +host=${host} ${target} ${removing}) \ + ./configure ${forcesubdirs} ${removing} +host=${host} ${target}) \ | sed 's/^/ /' done @@ -398,8 +429,8 @@ exit 0 # # $Log$ -# Revision 1.2 1991/04/09 23:21:17 rich -# First minimally usable config checkin. +# Revision 1.3 1991/04/10 22:55:43 rich +# Cut 2. Subdirs. # # # |