aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-09-22 20:11:12 +0000
committerIan Lance Taylor <iant@google.com>2007-09-22 20:11:12 +0000
commit537b5f51e5904d474bd91b0e633a4d93e3f6fa10 (patch)
treeb22dab2a52f1a45d1b945458595c91b71973823e /gold
parentd4f5281bde13826402380afa522a4da25bb089e5 (diff)
downloadgdb-537b5f51e5904d474bd91b0e633a4d93e3f6fa10.zip
gdb-537b5f51e5904d474bd91b0e633a4d93e3f6fa10.tar.gz
gdb-537b5f51e5904d474bd91b0e633a4d93e3f6fa10.tar.bz2
Add bootstrap test.
Diffstat (limited to 'gold')
-rw-r--r--gold/Makefile.am50
-rw-r--r--gold/Makefile.in179
-rwxr-xr-xgold/configure53
-rw-r--r--gold/configure.ac5
-rw-r--r--gold/testsuite/Makefile.am4
-rw-r--r--gold/testsuite/Makefile.in9
6 files changed, 273 insertions, 27 deletions
diff --git a/gold/Makefile.am b/gold/Makefile.am
index 6975be4..b8a3be8 100644
--- a/gold/Makefile.am
+++ b/gold/Makefile.am
@@ -81,9 +81,13 @@ EXTRA_DIST = yyscript.c yyscript.h
libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES)
-ld_new_SOURCES = main.cc $(TARGETFILES)
-ld_new_DEPENDENCIES = libgold.a $(LIBINTL_DEP)
-ld_new_LDADD = libgold.a $(LIBINTL)
+sources_var = main.cc $(TARGETFILES)
+deps_var = libgold.a $(LIBINTL_DEP)
+ldadd_var = libgold.a $(LIBINTL)
+
+ld_new_SOURCES = $(sources_var)
+ld_new_DEPENDENCIES = $(deps_var)
+ld_new_LDADD = $(ldadd_var)
# Use an explicit dependency for the bison generated header file.
script.$(OBJEXT): yyscript.h
@@ -112,3 +116,43 @@ POTFILES= $(CCFILES) $(HFILES) $(TARGETFILES)
po/POTFILES.in: @MAINT@ Makefile
for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \
&& mv tmp $(srcdir)/po/POTFILES.in
+
+# Bootstrap test support. We use ld-new to build ld1, then use ld1 to
+# build ld2. ld1 and ld2 should be identical. ld-new need not be
+# identical to ld1, since it was linked with the host linker.
+
+if GCC
+if NATIVE_LINKER
+
+gcctestdir1/ld: ld-new
+ test -d gcctestdir1 || mkdir -p gcctestdir1
+ rm -f gcctestdir1/ld
+ (cd gcctestdir1 && $(LN_S) ../ld-new ld)
+
+ld1_SOURCES = $(sources_var)
+ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld
+ld1_LDADD = $(ldadd_var)
+ld1_LDFLAGS = -Bgcctestdir1/
+
+gcctestdir2/ld: ld1
+ test -d gcctestdir2 || mkdir -p gcctestdir2
+ rm -f gcctestdir2/ld
+ (cd gcctestdir2 && $(LN_S) ../ld1 ld)
+
+ld2_SOURCES = $(sources_var)
+ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld
+ld2_LDADD = $(ldadd_var)
+ld2_LDFLAGS = -Bgcctestdir2/
+
+check_PROGRAMS = ld1 ld2
+
+bootstrap-test: ld2
+ rm -f $@
+ echo "#!/bin/sh" > $@
+ echo "cmp ld1 ld2" > $@
+ chmod +x $@
+
+TESTS = bootstrap-test
+
+endif
+endif
diff --git a/gold/Makefile.in b/gold/Makefile.in
index a07680e..1a0f62c 100644
--- a/gold/Makefile.in
+++ b/gold/Makefile.in
@@ -41,6 +41,8 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
noinst_PROGRAMS = ld-new$(EXEEXT)
+@GCC_TRUE@@NATIVE_LINKER_TRUE@check_PROGRAMS = ld1$(EXEEXT) \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ ld2$(EXEEXT)
DIST_COMMON = README $(am__configure_deps) $(srcdir)/../config.guess \
$(srcdir)/../config.sub $(srcdir)/../depcomp \
$(srcdir)/../install-sh $(srcdir)/../missing \
@@ -83,9 +85,17 @@ am_libgold_a_OBJECTS = $(am__objects_1) $(am__objects_2) \
libgold_a_OBJECTS = $(am_libgold_a_OBJECTS)
PROGRAMS = $(noinst_PROGRAMS)
am__objects_4 = i386.$(OBJEXT)
-am_ld_new_OBJECTS = main.$(OBJEXT) $(am__objects_4)
+am__objects_5 = main.$(OBJEXT) $(am__objects_4)
+am_ld_new_OBJECTS = $(am__objects_5)
ld_new_OBJECTS = $(am_ld_new_OBJECTS)
am__DEPENDENCIES_1 =
+am__DEPENDENCIES_2 = libgold.a $(am__DEPENDENCIES_1)
+am__ld1_SOURCES_DIST = main.cc i386.cc
+@GCC_TRUE@@NATIVE_LINKER_TRUE@am_ld1_OBJECTS = $(am__objects_5)
+ld1_OBJECTS = $(am_ld1_OBJECTS)
+am__ld2_SOURCES_DIST = main.cc i386.cc
+@GCC_TRUE@@NATIVE_LINKER_TRUE@am_ld2_OBJECTS = $(am__objects_5)
+ld2_OBJECTS = $(am_ld2_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/../depcomp
am__depfiles_maybe = depfiles
@@ -99,8 +109,10 @@ CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
-SOURCES = $(libgold_a_SOURCES) $(ld_new_SOURCES)
-DIST_SOURCES = $(libgold_a_SOURCES) $(ld_new_SOURCES)
+SOURCES = $(libgold_a_SOURCES) $(ld_new_SOURCES) $(ld1_SOURCES) \
+ $(ld2_SOURCES)
+DIST_SOURCES = $(libgold_a_SOURCES) $(ld_new_SOURCES) \
+ $(am__ld1_SOURCES_DIST) $(am__ld2_SOURCES_DIST)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
@@ -148,6 +160,8 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+GCC_FALSE = @GCC_FALSE@
+GCC_TRUE = @GCC_TRUE@
GENCAT = @GENCAT@
GMSGFMT = @GMSGFMT@
INCINTL = @INCINTL@
@@ -162,6 +176,7 @@ LIBINTL = @LIBINTL@
LIBINTL_DEP = @LIBINTL_DEP@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
@@ -170,6 +185,8 @@ MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
+NATIVE_LINKER_FALSE = @NATIVE_LINKER_FALSE@
+NATIVE_LINKER_TRUE = @NATIVE_LINKER_TRUE@
NO_WERROR = @NO_WERROR@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
@@ -306,10 +323,22 @@ YFILES = \
EXTRA_DIST = yyscript.c yyscript.h
libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES)
-ld_new_SOURCES = main.cc $(TARGETFILES)
-ld_new_DEPENDENCIES = libgold.a $(LIBINTL_DEP)
-ld_new_LDADD = libgold.a $(LIBINTL)
+sources_var = main.cc $(TARGETFILES)
+deps_var = libgold.a $(LIBINTL_DEP)
+ldadd_var = libgold.a $(LIBINTL)
+ld_new_SOURCES = $(sources_var)
+ld_new_DEPENDENCIES = $(deps_var)
+ld_new_LDADD = $(ldadd_var)
POTFILES = $(CCFILES) $(HFILES) $(TARGETFILES)
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_SOURCES = $(sources_var)
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_LDADD = $(ldadd_var)
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ld1_LDFLAGS = -Bgcctestdir1/
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_SOURCES = $(sources_var)
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_LDADD = $(ldadd_var)
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ld2_LDFLAGS = -Bgcctestdir2/
+@GCC_TRUE@@NATIVE_LINKER_TRUE@TESTS = bootstrap-test
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -380,11 +409,20 @@ libgold.a: $(libgold_a_OBJECTS) $(libgold_a_DEPENDENCIES)
$(libgold_a_AR) libgold.a $(libgold_a_OBJECTS) $(libgold_a_LIBADD)
$(RANLIB) libgold.a
+clean-checkPROGRAMS:
+ -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
+
clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
ld-new$(EXEEXT): $(ld_new_OBJECTS) $(ld_new_DEPENDENCIES)
@rm -f ld-new$(EXEEXT)
$(CXXLINK) $(ld_new_LDFLAGS) $(ld_new_OBJECTS) $(ld_new_LDADD) $(LIBS)
+ld1$(EXEEXT): $(ld1_OBJECTS) $(ld1_DEPENDENCIES)
+ @rm -f ld1$(EXEEXT)
+ $(CXXLINK) $(ld1_LDFLAGS) $(ld1_OBJECTS) $(ld1_LDADD) $(LIBS)
+ld2$(EXEEXT): $(ld2_OBJECTS) $(ld2_DEPENDENCIES)
+ @rm -f ld2$(EXEEXT)
+ $(CXXLINK) $(ld2_LDFLAGS) $(ld2_OBJECTS) $(ld2_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -600,6 +638,79 @@ GTAGS:
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list='$(TESTS)'; \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *" $$tst "*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ echo "XPASS: $$tst"; \
+ ;; \
+ *) \
+ echo "PASS: $$tst"; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *" $$tst "*) \
+ xfail=`expr $$xfail + 1`; \
+ echo "XFAIL: $$tst"; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ echo "FAIL: $$tst"; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ echo "SKIP: $$tst"; \
+ fi; \
+ done; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="All $$all tests passed"; \
+ else \
+ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all tests failed"; \
+ else \
+ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ skipped="($$skip tests were not run)"; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
@@ -743,6 +854,8 @@ distcleancheck: distclean
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-recursive
all-am: Makefile $(LIBRARIES) $(PROGRAMS) config.h
installdirs: installdirs-recursive
@@ -775,8 +888,8 @@ maintainer-clean-generic:
-rm -f yyscript.h
clean: clean-recursive
-clean-am: clean-generic clean-noinstLIBRARIES clean-noinstPROGRAMS \
- mostlyclean-am
+clean-am: clean-checkPROGRAMS clean-generic clean-noinstLIBRARIES \
+ clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
@@ -829,21 +942,21 @@ uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
- check-am clean clean-generic clean-noinstLIBRARIES \
- clean-noinstPROGRAMS clean-recursive ctags ctags-recursive \
- dist dist-all dist-bzip2 dist-gzip dist-shar dist-tarZ \
- dist-zip distcheck distclean distclean-compile \
- distclean-generic distclean-hdr distclean-recursive \
- distclean-tags distcleancheck distdir distuninstallcheck dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-data-local install-exec \
- install-exec-am install-exec-local install-info \
- install-info-am install-man install-strip installcheck \
- installcheck-am installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic maintainer-clean-recursive \
- mostlyclean mostlyclean-compile mostlyclean-generic \
- mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
- uninstall uninstall-am uninstall-info-am
+ check-TESTS check-am clean clean-checkPROGRAMS clean-generic \
+ clean-noinstLIBRARIES clean-noinstPROGRAMS clean-recursive \
+ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+ dist-shar dist-tarZ dist-zip distcheck distclean \
+ distclean-compile distclean-generic distclean-hdr \
+ distclean-recursive distclean-tags distcleancheck distdir \
+ distuninstallcheck dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am \
+ install-data-local install-exec install-exec-am \
+ install-exec-local install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ maintainer-clean-recursive mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am uninstall-info-am
# Use an explicit dependency for the bison generated header file.
@@ -871,6 +984,26 @@ install-data-local: install-info
po/POTFILES.in: @MAINT@ Makefile
for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \
&& mv tmp $(srcdir)/po/POTFILES.in
+
+# Bootstrap test support. We use ld-new to build ld1, then use ld1 to
+# build ld2. ld1 and ld2 should be identical. ld-new need not be
+# identical to ld1, since it was linked with the host linker.
+
+@GCC_TRUE@@NATIVE_LINKER_TRUE@gcctestdir1/ld: ld-new
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ test -d gcctestdir1 || mkdir -p gcctestdir1
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f gcctestdir1/ld
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ (cd gcctestdir1 && $(LN_S) ../ld-new ld)
+
+@GCC_TRUE@@NATIVE_LINKER_TRUE@gcctestdir2/ld: ld1
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ test -d gcctestdir2 || mkdir -p gcctestdir2
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f gcctestdir2/ld
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ (cd gcctestdir2 && $(LN_S) ../ld1 ld)
+
+@GCC_TRUE@@NATIVE_LINKER_TRUE@bootstrap-test: ld2
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ rm -f $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo "#!/bin/sh" > $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ echo "cmp ld1 ld2" > $@
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ chmod +x $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/gold/configure b/gold/configure
index de4de03..98c06bc 100755
--- a/gold/configure
+++ b/gold/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE YACC RANLIB ac_ct_RANLIB USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE WARN_CFLAGS NO_WERROR WARN_CXXFLAGS LFS_CXXFLAGS CXXCPP EGREP MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE YACC RANLIB ac_ct_RANLIB LN_S USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE NATIVE_LINKER_TRUE NATIVE_LINKER_FALSE GCC_TRUE GCC_FALSE WARN_CFLAGS NO_WERROR WARN_CXXFLAGS LFS_CXXFLAGS CXXCPP EGREP MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -3698,6 +3698,17 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
# If we haven't got the data from the intl directory,
# assume NLS is disabled.
USE_NLS=no
@@ -4313,6 +4324,27 @@ esac
+
+if test "x$target_alias" = "x" -o "x$host_alias" = "x$target_alias"; then
+ NATIVE_LINKER_TRUE=
+ NATIVE_LINKER_FALSE='#'
+else
+ NATIVE_LINKER_TRUE='#'
+ NATIVE_LINKER_FALSE=
+fi
+
+
+
+if test "$GCC" = yes; then
+ GCC_TRUE=
+ GCC_FALSE='#'
+else
+ GCC_TRUE='#'
+ GCC_FALSE=
+fi
+
+
+
GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
# Check whether --enable-werror or --disable-werror was given.
@@ -5352,6 +5384,20 @@ echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
+if test -z "${NATIVE_LINKER_TRUE}" && test -z "${NATIVE_LINKER_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"NATIVE_LINKER\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"NATIVE_LINKER\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${GCC_TRUE}" && test -z "${GCC_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"GCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"GCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
@@ -5960,6 +6006,7 @@ s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
s,@YACC@,$YACC,;t t
s,@RANLIB@,$RANLIB,;t t
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@LN_S@,$LN_S,;t t
s,@USE_NLS@,$USE_NLS,;t t
s,@LIBINTL@,$LIBINTL,;t t
s,@LIBINTL_DEP@,$LIBINTL_DEP,;t t
@@ -5975,6 +6022,10 @@ s,@CATOBJEXT@,$CATOBJEXT,;t t
s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t
s,@MSGFMT@,$MSGFMT,;t t
s,@MSGMERGE@,$MSGMERGE,;t t
+s,@NATIVE_LINKER_TRUE@,$NATIVE_LINKER_TRUE,;t t
+s,@NATIVE_LINKER_FALSE@,$NATIVE_LINKER_FALSE,;t t
+s,@GCC_TRUE@,$GCC_TRUE,;t t
+s,@GCC_FALSE@,$GCC_FALSE,;t t
s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t
s,@NO_WERROR@,$NO_WERROR,;t t
s,@WARN_CXXFLAGS@,$WARN_CXXFLAGS,;t t
diff --git a/gold/configure.ac b/gold/configure.ac
index 402933d..1294fa6 100644
--- a/gold/configure.ac
+++ b/gold/configure.ac
@@ -84,6 +84,7 @@ AC_PROG_CXX
AC_PROG_YACC
AC_PROG_RANLIB
AC_PROG_INSTALL
+AC_PROG_LN_S
ZW_GNU_GETTEXT_SISTER_DIR
AM_PO_SUBDIRS
@@ -91,6 +92,10 @@ AC_C_BIGENDIAN
AC_EXEEXT
+AM_CONDITIONAL(NATIVE_LINKER,
+ test "x$target_alias" = "x" -o "x$host_alias" = "x$target_alias")
+AM_CONDITIONAL(GCC, test "$GCC" = yes)
+
AM_BINUTILS_WARNINGS
WARN_CXXFLAGS=`echo ${WARN_CFLAGS} | sed -e 's/-Wstrict-prototypes//' -e 's/-Wmissing-prototypes//'`
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
index 122be70..12268c6 100644
--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -1,5 +1,9 @@
# Process this file with automake to generate Makefile.in
+# As far as I can tell automake testing support assumes that the build
+# system and the host system are the same. So these tests will not
+# work when building with a cross-compiler.
+
AUTOMAKE_OPTIONS =
AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CXXFLAGS)
diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in
index 4967af6..0990cc6 100644
--- a/gold/testsuite/Makefile.in
+++ b/gold/testsuite/Makefile.in
@@ -15,6 +15,10 @@
@SET_MAKE@
# Process this file with automake to generate Makefile.in
+
+# As far as I can tell automake testing support assumes that the build
+# system and the host system are the same. So these tests will not
+# work when building with a cross-compiler.
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
@@ -104,6 +108,8 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
+GCC_FALSE = @GCC_FALSE@
+GCC_TRUE = @GCC_TRUE@
GENCAT = @GENCAT@
GMSGFMT = @GMSGFMT@
INCINTL = @INCINTL@
@@ -118,6 +124,7 @@ LIBINTL = @LIBINTL@
LIBINTL_DEP = @LIBINTL_DEP@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
@@ -126,6 +133,8 @@ MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGMERGE = @MSGMERGE@
+NATIVE_LINKER_FALSE = @NATIVE_LINKER_FALSE@
+NATIVE_LINKER_TRUE = @NATIVE_LINKER_TRUE@
NO_WERROR = @NO_WERROR@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@