Makefiles should include the makefile frag names even if the makefile

frag doesn't exist in *this* directory.  Otherwise we inherit the
variable setting from our parent Makefile.
This commit is contained in:
K. Richard Pixley 1991-10-23 21:48:28 +00:00
parent e89b8910fc
commit c5ae567837

130
configure vendored
View File

@ -33,7 +33,9 @@
# config.status is removed. # config.status is removed.
# #
set -e export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0 $argv; kill $$)
#set -e
remove=rm remove=rm
hard_link=ln hard_link=ln
@ -174,9 +176,11 @@ else
fi fi
fi fi
configsub=`echo ${progname} | sed 's/configure\$/config.sub/'` configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
if [ ! -f ${configsub} ] ; then if ${configsub} none >/dev/null 2>&1 ; then
true
else
echo '***' cannot find config.sub. echo '***' cannot find config.sub.
echo 1 echo 1
fi fi
@ -238,16 +242,19 @@ if [ -r configure.in ] ; then
TMPDIR=/tmp ; export TMPDIR TMPDIR=/tmp ; export TMPDIR
fi fi
# keep this filename short for &%*%$*# 14 char file names
tmpfile=${TMPDIR}/cONf$$
# split configure.in into common, per-host, per-target, # split configure.in into common, per-host, per-target,
# and post-target parts. Post-target is optional. # and post-target parts. Post-target is optional.
sed -e '/^# per\-host:/,$d' configure.in > ${TMPDIR}/configure.$$.com sed -e '/^# per\-host:/,$d' configure.in > ${tmpfile}.com
sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' configure.in > ${TMPDIR}/configure.$$.hst sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' configure.in > ${tmpfile}.hst
if grep -s '^# post-target:' configure.in ; then if grep '^# post-target:' configure.in >/dev/null ; then
sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' configure.in > ${TMPDIR}/configure.$$.tgt sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' configure.in > ${tmpfile}.tgt
sed -e '1,/^# post\-target:/d' configure.in > ${TMPDIR}/configure.$$.pos sed -e '1,/^# post\-target:/d' configure.in > ${tmpfile}.pos
else else
sed -e '1,/^# per\-target:/d' configure.in > ${TMPDIR}/configure.$$.tgt sed -e '1,/^# per\-target:/d' configure.in > ${tmpfile}.tgt
echo >${TMPDIR}/configure.$$.pos echo >${tmpfile}.pos
fi fi
else else
@ -257,7 +264,7 @@ fi
### do common part of configure.in ### do common part of configure.in
. ${TMPDIR}/configure.$$.com . ${tmpfile}.com
# some sanity checks on configure.in # some sanity checks on configure.in
if [ -z "${srctrigger}" ] ; then if [ -z "${srctrigger}" ] ; then
@ -281,7 +288,7 @@ for host in ${hosts} ; do
host=${host_cpu}-${host_vendor}-${host_os} host=${host_cpu}-${host_vendor}-${host_os}
host_makefile_frag=config/hmake-${host} host_makefile_frag=config/hmake-${host}
. ${TMPDIR}/configure.$$.hst . ${tmpfile}.hst
for target in ${targets} ; do for target in ${targets} ; do
@ -293,7 +300,7 @@ for host in ${hosts} ; do
target=${target_cpu}-${target_vendor}-${target_os} target=${target_cpu}-${target_vendor}-${target_os}
target_makefile_frag=config/tmake-${target} target_makefile_frag=config/tmake-${target}
. ${TMPDIR}/configure.$$.tgt . ${tmpfile}.tgt
# Temporarily, we support only direct subdir builds. # Temporarily, we support only direct subdir builds.
hostsubdir=H-${host_alias} hostsubdir=H-${host_alias}
@ -466,28 +473,22 @@ for host in ${hosts} ; do
cat ${srcdir}/${Makefile_in} >> ${Makefile} cat ${srcdir}/${Makefile_in} >> ${Makefile}
# Conditionalize the makefile for this host. # Conditionalize the makefile for this host.
if [ -f ${srcdir}/${host_makefile_frag} ] ; then (echo "host_makefile_frag = ${srcdir}/${host_makefile_frag}" ;
(echo "host_makefile_frag = ${srcdir}/${host_makefile_frag}" ; sed -e "/^####/ r ${srcdir}/${host_makefile_frag}" ${Makefile}) > Makefile.tem
sed -e "/^####/ r ${srcdir}/${host_makefile_frag}" ${Makefile}) > Makefile.tem mv Makefile.tem ${Makefile}
mv Makefile.tem ${Makefile}
fi
# Conditionalize the makefile for this target. # Conditionalize the makefile for this target.
if [ -f ${srcdir}/${target_makefile_frag} ] ; then (echo "target_makefile_frag = ${srcdir}/${target_makefile_frag}" ;
(echo "target_makefile_frag = ${srcdir}/${target_makefile_frag}" ; sed -e "/^####/ r ${srcdir}/${target_makefile_frag}" ${Makefile}) > Makefile.tem
sed -e "/^####/ r ${srcdir}/${target_makefile_frag}" ${Makefile}) > Makefile.tem mv Makefile.tem ${Makefile}
mv Makefile.tem ${Makefile}
fi
# Conditionalize the makefile for this site. # Conditionalize the makefile for this site.
if [ -n "${site}" ] ; then if [ -n "${site}" ] ; then
site_makefile_frag=smake-${site} site_makefile_frag=smake-${site}
if [ -f ${srcdir}/${site_makefile_frag} ] ; then (echo "site_makefile_frag = ${srcdir}/${site_makefile_frag}" ;
(echo "site_makefile_frag = ${srcdir}/${site_makefile_frag}" ; sed -e "/^####/ r ${srcdir}/${site_makefile_frag}" ${Makefile}) > Makefile.tem
sed -e "/^####/ r ${srcdir}/${site_makefile_frag}" ${Makefile}) > Makefile.tem mv Makefile.tem ${Makefile}
mv Makefile.tem ${Makefile}
fi
fi fi
# set srcdir # set srcdir
@ -514,36 +515,23 @@ for host in ${hosts} ; do
using= using=
if [ -f ${srcdir}/${host_makefile_frag} ] ; then if [ -f ${srcdir}/${host_makefile_frag} ] ; then
using=" using \"${host_makefile_frag}\"" using="${using} and \"${host_makefile_frag}\""
fi fi
if [ -f ${srcdir}/${target_makefile_frag} ] ; then if [ -f ${srcdir}/${target_makefile_frag} ] ; then
if [ -z "${using}" ] ; then using="${using} and \"${target_makefile_frag}\""
andusing=" using \"${target_makefile_frag}\""
else
andusing="${using} and \"${target_makefile_frag}\""
fi
else
andusing=${using}
fi fi
if [ -n "${site}" -a \
if [ -f ${srcdir}/${site_makefile_frag} ] ; then -f ${srcdir}/${site_makefile_frag} ] ; then
if [ -z "${andusing}" ] ; then using="${using} and \"${site_makefile_frag}\""
andandusing=" using \"${site_makefile_frag}\""
else
andandusing="${andusing} and \"${site_makefile_frag}\""
fi
else
andandusing=${andusing}
fi fi
using=`echo "${using}" | sed 's/and/using/'`
using="Created \"${Makefile}\" in `pwd`${using}."
if [ -n "${verbose}" -o -z "${recurring}" ] ; then if [ -n "${verbose}" -o -z "${recurring}" ] ; then
echo "Created \"${Makefile}\"" in `pwd`${andandusing}. echo ${using}
fi fi
if [ -f ${TMPDIR}/configure.$$.pos ] ; then . ${tmpfile}.pos
. ${TMPDIR}/configure.$$.pos
fi
# describe the chosen configuration in config.status. # describe the chosen configuration in config.status.
# Make that file a shellscript which will reestablish # Make that file a shellscript which will reestablish
@ -552,7 +540,8 @@ for host in ${hosts} ; do
echo "#!/bin/sh echo "#!/bin/sh
# `pwd` was configured as follows: # `pwd` was configured as follows:
(cd ${srcdir} ; ${progname}" ${arguments} `if [ -z "${norecursion}" ] ; then echo +norecursion ; else true ; fi` ")" > config.status (cd ${srcdir} ; ${progname}" ${arguments} `if [ -z "${norecursion}" ] ; then echo +norecursion ; else true ; fi` ")
# ${using}" > config.status
chmod a+x config.status chmod a+x config.status
originaldir=`pwd` originaldir=`pwd`
@ -576,10 +565,14 @@ for host in ${hosts} ; do
POPDIR=`pwd` POPDIR=`pwd`
cd ${configdir} cd ${configdir}
${progname} +recurring ${host_alias} +target=${target_alias} \ if (${progname} +recurring ${host_alias} +target=${target_alias} \
${verbose} ${subdirs} ${removing} +destdir=${destdir} \ ${verbose} ${subdirs} ${removing} +destdir=${destdir} \
`if [ -n "${objdir}" ] ; then echo +objdir=${objdir}/${configdir} ; fi` \ `if [ -n "${objdir}" ] ; then echo +objdir=${objdir}/${configdir} ; fi` \
${tmpdiroption} ${tmpdiroption}) ; then
true
else
exit 1
fi
cd ${POPDIR} cd ${POPDIR}
@ -607,7 +600,7 @@ for host in ${hosts} ; do
fi fi
cd ${hostsubdir} cd ${hostsubdir}
cat > GNUmakefile << E!O!F cat > GNUmakefile << 'E!O!F'
# Makefile generated by configure for host ${host_alias}. # Makefile generated by configure for host ${host_alias}.
ALL := $(shell ls -d T-*) ALL := $(shell ls -d T-*)
@ -623,14 +616,39 @@ done # for each host
### clean up. ### clean up.
rm -f ${TMPDIR}/configure.$$.com ${TMPDIR}/configure.$$.tgt ${TMPDIR}/configure.$$.hst ${TMPDIR}/configure.$$.pos rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos
exit 0 exit 0
# #
# #
# $Log$ # $Log$
# Revision 1.55 1991/10/10 04:57:23 rich # Revision 1.60 1991/10/23 21:48:28 rich
# Makefiles should include the makefile frag names even if the makefile
# frag doesn't exist in *this* directory. Otherwise we inherit the
# variable setting from our parent Makefile.
#
# Revision 1.59 1991/10/16 19:53:31 gnu
# Update for SCO problems.
#
# * Fix "Larry Wall kludge" line so it works. If this script is run by csh,
# it will complain, feed itself to sh, and complain some more. But will work.
#
# * Use <14 char file names in /tmp.
#
# Revision 1.58 1991/10/16 06:12:52 rich
# Two small bugs. First, single quoted sed line doesn't need to quote
# '$'. Second, use quotes around the hereis document trigger in order
# to quote the entire contents of the hereis document.
#
# Revision 1.57 1991/10/11 05:31:05 gnu
# Simplify "Using" message code. Put the message that configure prints
# (or suppresses) into the config.status file as a comment.
#
# Revision 1.56 1991/10/10 05:01:47 rich
# Remove the set -e but protect the recusion call.
#
# Revision 1.55 1991/10/10 04:57:23 rich
# * Die when sub-configure's do. # * Die when sub-configure's do.
# * get the makefile building message line correct. # * get the makefile building message line correct.
# * set -e # * set -e