Be more careful with CFG_{SRC,BUILD}_DIR ending in slash.

This commit is contained in:
Graydon Hoare 2012-03-26 16:05:33 -07:00
parent 071dbfc478
commit 89dec28a5c
2 changed files with 25 additions and 25 deletions

View File

@ -89,7 +89,7 @@ ifdef DEBUG
endif
# platform-specific auto-configuration
include $(CFG_SRC_DIR)/mk/platform.mk
include $(CFG_SRC_DIR)mk/platform.mk
# Run the stage1/2 compilers under valgrind
ifdef VALGRIND_COMPILE
@ -443,15 +443,15 @@ config.stamp: $(S)configure $(S)Makefile.in $(S)src/snapshots.txt
# Primary-target makefiles
######################################################################
include $(CFG_SRC_DIR)/mk/target.mk
include $(CFG_SRC_DIR)/mk/host.mk
include $(CFG_SRC_DIR)/mk/stage0.mk
include $(CFG_SRC_DIR)/mk/rt.mk
include $(CFG_SRC_DIR)/mk/rustllvm.mk
include $(CFG_SRC_DIR)/mk/autodep.mk
include $(CFG_SRC_DIR)/mk/tools.mk
include $(CFG_SRC_DIR)/mk/docs.mk
include $(CFG_SRC_DIR)/mk/llvm.mk
include $(CFG_SRC_DIR)mk/target.mk
include $(CFG_SRC_DIR)mk/host.mk
include $(CFG_SRC_DIR)mk/stage0.mk
include $(CFG_SRC_DIR)mk/rt.mk
include $(CFG_SRC_DIR)mk/rustllvm.mk
include $(CFG_SRC_DIR)mk/autodep.mk
include $(CFG_SRC_DIR)mk/tools.mk
include $(CFG_SRC_DIR)mk/docs.mk
include $(CFG_SRC_DIR)mk/llvm.mk
######################################################################
# Secondary makefiles, conditionalized for speed
@ -463,18 +463,18 @@ ifneq ($(strip $(findstring dist,$(MAKECMDGOALS)) \
$(findstring tidy,$(MAKECMDGOALS)) \
$(findstring clean,$(MAKECMDGOALS))),)
CFG_INFO := $(info cfg: including dist rules)
include $(CFG_SRC_DIR)/mk/dist.mk
include $(CFG_SRC_DIR)mk/dist.mk
endif
ifneq ($(strip $(findstring snap,$(MAKECMDGOALS)) \
$(findstring clean,$(MAKECMDGOALS))),)
CFG_INFO := $(info cfg: including snap rules)
include $(CFG_SRC_DIR)/mk/snap.mk
include $(CFG_SRC_DIR)mk/snap.mk
endif
ifneq ($(findstring reformat,$(MAKECMDGOALS)),)
CFG_INFO := $(info cfg: including reformat rules)
include $(CFG_SRC_DIR)/mk/pp.mk
include $(CFG_SRC_DIR)mk/pp.mk
endif
ifneq ($(strip $(findstring check,$(MAKECMDGOALS)) \
@ -482,17 +482,17 @@ ifneq ($(strip $(findstring check,$(MAKECMDGOALS)) \
$(findstring perf,$(MAKECMDGOALS)) \
$(findstring tidy,$(MAKECMDGOALS))),)
CFG_INFO := $(info cfg: including test rules)
include $(CFG_SRC_DIR)/mk/tests.mk
include $(CFG_SRC_DIR)mk/tests.mk
endif
ifneq ($(findstring perf,$(MAKECMDGOALS)),)
CFG_INFO := $(info cfg: including perf rules)
include $(CFG_SRC_DIR)/mk/perf.mk
include $(CFG_SRC_DIR)mk/perf.mk
endif
ifneq ($(findstring clean,$(MAKECMDGOALS)),)
CFG_INFO := $(info cfg: including clean rules)
include $(CFG_SRC_DIR)/mk/clean.mk
include $(CFG_SRC_DIR)mk/clean.mk
endif
ifneq ($(findstring install,$(MAKECMDGOALS)),)
@ -503,11 +503,11 @@ ifneq ($(findstring install,$(MAKECMDGOALS)),)
endif
CFG_INFO := $(info cfg: including install rules)
include $(CFG_SRC_DIR)/mk/install.mk
include $(CFG_SRC_DIR)mk/install.mk
endif
ifneq ($(strip $(findstring TAGS.emacs,$(MAKECMDGOALS)) \
$(findstring TAGS.vi,$(MAKECMDGOALS))),)
CFG_INFO := $(info cfg: including ctags rules)
include $(CFG_SRC_DIR)/mk/ctags.mk
include $(CFG_SRC_DIR)mk/ctags.mk
endif

14
configure vendored
View File

@ -251,8 +251,8 @@ esac
DEFAULT_HOST_TRIPLE="${CFG_CPUTYPE}-${CFG_OSTYPE}"
CFG_SELF=$(echo $0 | tr '\\' '/')
CFG_SRC_DIR=${CFG_SELF%${CFG_SELF##*/}}
CFG_BUILD_DIR=$(echo $PWD | tr '\\' '/')
CFG_SRC_DIR="$(dirname $CFG_SELF)/"
CFG_BUILD_DIR="$(echo $PWD | tr '\\' '/')/"
CFG_CONFIGURE_ARGS="$@"
OPTIONS=""
@ -517,14 +517,14 @@ fi
# Configure llvm, only if necessary
step_msg "looking at LLVM"
CFG_LLVM_SRC_DIR=${CFG_SRC_DIR}src/llvm
CFG_LLVM_SRC_DIR=${CFG_SRC_DIR}src/llvm/
for t in $CFG_TARGET_TRIPLES
do
do_reconfigure=1
if [ -z $CFG_LLVM_ROOT ]
then
LLVM_BUILD_DIR=$CFG_BUILD_DIR/llvm/$t
LLVM_BUILD_DIR=${CFG_BUILD_DIR}llvm/$t
if [ ! -z "$CFG_DISABLE_OPTIMIZE_LLVM" ]
then
LLVM_DBG_OPTS=""
@ -552,7 +552,7 @@ do
index2="${CFG_SRC_DIR}src/llvm/.git/index"
for index in ${index1} ${index2}
do
config_status="${CFG_BUILD_DIR}/llvm/$t/config.status"
config_status="${CFG_BUILD_DIR}llvm/$t/config.status"
if test -e ${index} -a \
-e ${config_status} -a \
${config_status} -nt ${index}
@ -636,10 +636,10 @@ do
cd $LLVM_BUILD_DIR
case $CFG_SRC_DIR in
/* | [a-z]:* | [A-Z]:*)
${CFG_LLVM_SRC_DIR}/configure $LLVM_FLAGS
${CFG_LLVM_SRC_DIR}configure $LLVM_FLAGS
;;
*)
${CFG_BUILD_DIR}/${CFG_LLVM_SRC_DIR}/configure \
${CFG_BUILD_DIR}${CFG_LLVM_SRC_DIR}configure \
$LLVM_FLAGS
;;
esac