+ifndef build
+build := $(host)
+endif
+
+ifndef target
+target := $(host)
+endif
+
+ifeq ($(patsubst %-lynx,lynx,$(host)),lynx)
+SHELL := /bin/bash
+GNU_MAKE := $(MAKE)
+CONFIG_SHELL := /bin/bash
+endif
+
+ifeq ($(patsubst %-m68k-hp-hpux,m68k-hp-hpux,$(host)),m68k-hp-hpux)
+SHELL := /usr/unsupported/bin/bash
+GNU_MAKE := $(MAKE)
+CONFIG_SHELL := /usr/unsupported/bin/bash
+endif
+
+ifneq ($(build),$(host))
+
+# We are building on a machine other than the host. We rely upon
+# previously built cross-compilers from the build machine to the host
+# (used to build the executables) and from the build machine to the
+# target (used to build the libraries).
+
+AR := $(host)-ar
+AR_FOR_TARGET := $(target)-ar
+AS := $(host)-as
+AS_FOR_TARGET := $(target)-as
+BISON := byacc
+CC := $(host)-gcc
+CC_FOR_BUILD := gcc
+CC_FOR_TARGET := $(target)-gcc
+CFLAGS := $(GNUCFLAGS)
+CXX := $(host)-gcc
+CXX_FOR_TARGET := $(target)-gcc
+GCC := $(host)-gcc
+GXX := $(host)-g++
+GXX_FOR_TARGET := $(target)-g++
+HOST_PREFIX := $(build)-
+HOST_PREFIX_1 := $(build)-
+LEX := flex
+MAKEINFO := makeinfo
+MUNCH_NM := $(host)-nm
+NM := $(host)-nm
+NM_FOR_TARGET := $(target)-nm
+RANLIB := $(host)-ranlib
+RANLIB_FOR_TARGET := $(target)-ranlib
+YACC := $(BISON)
+
+ifeq ($(host),i386-go32)
+MAKEINFOFLAGS = --no-split
+endif
+
+FLAGS_TO_PASS := \
+ "AR=$(AR)" \
+ "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
+ "AS=$(AS)" \
+ "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
+ "BISON=$(BISON)" \
+ "CC=$(CC)" \
+ "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+ "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
+ "CXX=$(CXX)" \
+ "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
+ "CFLAGS=$(CFLAGS)" \
+ "CXXFLAGS=$(CXXFLAGS)" \
+ "GCC=$(GCC)" \
+ "HOST_PREFIX=$(HOST_PREFIX)" \
+ "HOST_PREFIX_1=$(HOST_PREFIX_1)" \
+ "LEX=$(LEX)" \
+ "MAKEINFO=$(MAKEINFO)" \
+ "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
+ "MF=$(MF)" \
+ "MUNCH_NM=$(MUNCH_NM)" \
+ "NM=$(NM)" \
+ "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
+ "RANLIB=$(RANLIB)" \
+ "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
+ "RELEASE_TAG=$(RELEASE_TAG)" \
+ "RUNTEST=$(relbindir)/runtest" \
+ "SHELL=$(SHELL)" \
+ "TIME=$(TIME)" \
+ "YACC=$(YACC)" \
+ "build=$(build)" \
+ "host=$(host)"
+
+# We must pass the build cross host tools in the environment of
+# configure, so that autoconf scripts will run the right programs.
+configenv := AR="$(AR)" CC="$(CC)" RANLIB="$(RANLIB)"
+
+else
+
+# This is a normal build on the host machine.
+