SHELL = /bin/sh
-INSTALL = $${srcroot}/install.sh -c
+INSTALL = $$s/install.sh -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
then echo $$r/expect/expect ; \
else echo expect ; fi`
-RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
- then echo $${srcroot}/dejagnu/runtest ; \
+RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
+ then echo $$s/dejagnu/runtest ; \
else echo runtest ; fi`
CC_FOR_TARGET = ` \
- if [ -f $$r/gcc/Makefile ] ; then \
+ if [ -f $$r/gcc/xgcc ] ; then \
if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
- echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/newlib/ -L$$r/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
+ echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/newlib/ -L$$r/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
else \
- echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
+ echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
fi; \
else \
echo $$r/gcc/xgcc -B$$r/gcc/; \
fi; \
fi`
+# If CC_FOR_TARGET is not overriden on the command line, then this
+# variable is passed down to the gcc Makefile, where it is used to
+# build libgcc2.a. We define it here so that it can itself be
+# overridden on the command line.
+GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/
+
# start-sanitize-chill
CHILL_FOR_TARGET = ` \
- if [ -f $$r/gcc/Makefile ] ; then \
+ if [ -f $$r/gcc/xgcc ] ; then \
echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/; \
else \
if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
# end-sanitize-chill
CXX_FOR_TARGET = ` \
- if [ -f $$r/gcc/Makefile ] ; then \
+ if [ -f $$r/gcc/xgcc ] ; then \
if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
- echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/newlib/ -L$$r/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
+ echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/newlib/ -L$$r/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
else \
- echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
+ echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
fi; \
else \
echo $$r/gcc/xgcc -B$$r/gcc/; \
"CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
"CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
"DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
- "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
'RANLIB=$(RANLIB)'
-FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
+FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(HOST_FLAGS)
# Flags that are concerned with the location of the X11 include files
# and library files
# If any variables are added here, they must be added to do-*, below.
# The HOST_* variables are a special case, which are used for the gcc
# cross-building scheme.
+# The condition for setting GCC_FOR_TARGET is so that if CC_FOR_TARGET
+# is overridden on the command line we use that value for
+# GCC_FOR_TARGET, and, if it is not, we use the value of
+# GCC_FOR_TARGET. We do this because the default value of
+# CC_FOR_TARGET depends on gcc/xgcc, which won't exist when we first
+# go into the gcc directory. FIXME: The test won't work correctly for
+# older non-Posix make programs that do not set MAKEFLAGS; in that
+# case, overriding CC_FOR_TARGET on the command line will not affect
+# GCC_FOR_TARGET.
EXTRA_GCC_FLAGS = \
'AR=$$(AR_FOR_TARGET)' \
'AS=$(AS)' \
'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
'NM=$(NM)' \
'RANLIB=$$(RANLIB_FOR_TARGET)' \
+ 'GCC_FOR_TARGET=$(GCC_FOR_TARGET)' \
`if test x"$(LANGUAGES)" != x; then echo "LANGUAGES=$(LANGUAGES)"; fi` \
`if test x"$(STMP_FIXPROTO)" != x; then echo "STMP_FIXPROTO=$(STMP_FIXPROTO)"; fi` \
`if test x"$(LIMITS_H_TEST)" != x; then echo "LIMITS_H_TEST=$(LIMITS_H_TEST)"; fi` \
$(DO_X):
@target=`echo $@ | sed -e 's/^do-//'`; \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
for i in $(SUBDIRS) -dummy-; do \
if [ -f ./$$i/Makefile ]; then \
done
@target=`echo $@ | sed -e 's/^do-//'`; \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
for i in $(TARGET_CONFIGDIRS) -dummy-; do \
if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
dvi: do-dvi
install-info: do-install-info dir.info
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
if [ -f dir.info ] ; then \
$(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
else true ; fi
@dir=`echo $@ | sed -e 's/clean-//'`; \
if [ -f ./$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
else \
rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
else \
touch gcc/stmp-fixinc gcc/include/fixed; \
rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd` ; export srcroot; \
+ s=`cd $(srcdir); pwd` ; export s; \
$(SET_LIB_PATH) \
(cd ./gcc; \
$(MAKE) $(GCC_FLAGS_TO_PASS) install); \
@dir=`echo $@ | sed -e 's/all-//'`; \
if [ -f ./$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
else \
dir=`echo $@ | sed -e 's/check-//'`; \
if [ -f ./$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
else \
@dir=`echo $@ | sed -e 's/check-//'`; \
if [ -f ./$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
else \
@dir=`echo $@ | sed -e 's/install-//'`; \
if [ -f ./$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
else \
fi; \
fi; exit 0 # break command into two pieces
@dir=`echo $@ | sed -e 's/configure-target-//'`; \
- if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
+ if [ ! -d $(TARGET_SUBDIR) ]; then \
+ true; \
+ elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
true; \
elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
if [ -d $(srcdir)/$${dir} ]; then \
[ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
AR="$(AR_FOR_TARGET)"; export AR; \
AS="$(AS_FOR_TARGET)"; export AS; \
esac; \
if [ "$(srcdir)" = "." ] ; then \
if [ "$(TARGET_SUBDIR)" != "." ] ; then \
- if $(SHELL) $${srcroot}/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
if [ -f Makefile ]; then \
if $(MAKE) distclean; then \
true; \
libsrcdir="."; \
else \
srcdiroption="--srcdir=$${topdir}/$${dir}"; \
- libsrcdir="$${srcroot}/$${dir}"; \
+ libsrcdir="$$s/$${dir}"; \
fi; \
if [ -f $${libsrcdir}/configure ] ; then \
$(SHELL) $${libsrcdir}/configure \
$(CONFIG_ARGUMENTS) $${srcdiroption} \
--with-target-subdir="$(TARGET_SUBDIR)"; \
else \
- $(SHELL) $${srcroot}/configure \
+ $(SHELL) $$s/configure \
$(CONFIG_ARGUMENTS) $${srcdiroption} \
--with-target-subdir="$(TARGET_SUBDIR)"; \
fi; \
@dir=`echo $@ | sed -e 's/all-target-//'`; \
if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
else \
@dir=`echo $@ | sed -e 's/check-target-//'`; \
if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
else \
@dir=`echo $@ | sed -e 's/install-target-//'`; \
if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd $(TARGET_SUBDIR)/$${dir}; \
$(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
@dir=`echo $@ | sed -e 's/all-//'`; \
if [ -f ./$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd $${dir}; \
$(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
@dir=`echo $@ | sed -e 's/check-//'`; \
if [ -f ./$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd $${dir}; \
$(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
@dir=`echo $@ | sed -e 's/install-//'`; \
if [ -f ./$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd $${dir}; \
$(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
all-gcc:
@if [ -f ./gcc/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
else \
all-bootstrap:
@if [ -f ./gcc/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) bootstrap); \
else \
check-gcc:
@if [ -f ./gcc/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
else \
install-gcc:
@if [ -f ./gcc/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
else \
@dir=`echo $@ | sed -e 's/install-//'`; \
if [ -f ./$${dir}/Makefile ] ; then \
r=`pwd`; export r; \
- srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ s=`cd $(srcdir); pwd`; export s; \
$(SET_LIB_PATH) \
(cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
else \