contrib/gcc-test-suite/Makefile
author Martin Guy <martinwguy@gmail.com>
Sun Mar 31 04:07:38 2013 +0000 (2013-03-31)
changeset 3203 74fd467be5aa
parent 2170 4f8aa694f9c0
permissions -rw-r--r--
arch/avr32: Fix download of header files

This patch fixes the download of the avr32 headers in crosstool-ng by
fetching them directly from Atmel's web site instead of the now-broken URL
given by the original author of the avr32-header-fetching modification,
who fetched them from a copy on his own, now-defunct server.

It also adds the necessary logic to extract from a zip file, as that is
how the headers are packaged.

To configure it for avr32 after launching ct-ng menuconfig in an empty
directory:

Paths and misc options ->
Shell to use as CONFIG_SHELL = sh
Target options ->
Target Architecture = avr32
Toolchain options ->
Tuple's alias = avr32
Binary utilities ->
binutils version = 2.18a
C compiler
gcc version = 4.2.2
C-library
newlib version = 1.17.0
Enable IOs on long long = yes
Enable IOs on floats and doubles = yes
Disable the syscalls supplied with newlib = yes

CONFIG_SHELL is necessary to get round the "fragment: command not
found" bug when binutils-2.18 is configured using bash.

Prepared against crosstool-ng mercurial trunk on 31 March 2012.

Signed-off-by: Martin Guy <martinwguy@gmail.com>
[yann.morin.1998@free.fr: update bundles sample accordingly]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <CAL4-wQrg_NQ7jm-NCADqeyQr9twyhtx42OUGNThP6gWeqZc=kw@mail.gmail.com>
Patchwork-Id: 232612
     1 # Helper makefile which downloads (if required) and runs the GCC test suite (DejaGnu)
     2 #
     3 # Note: Before run please make sure to have your toolchain available in your path.
     4 #
     5 # Copyright 2010 DoréDevelopment
     6 # 
     7 # Author: Martin Lund <mgl@doredevelopment.dk>
     8 #
     9 # This program is free software; you can redistribute  it and/or modify it
    10 # under  the terms of  the GNU General  Public License as published by the
    11 # Free Software Foundation;  either version 2 of the  License, or (at your
    12 # option) any later version.
    13 #
    14 
    15 # Internal configuration
    16 TARGET:=@@DG_TARGET@@
    17 TOPDIR:=$(shell pwd)
    18 LOGDIR:=$(TOPDIR)/tmp
    19 
    20 # Include default configuration
    21 include default.cfg
    22 
    23 # Add toolchain to path
    24 PATH:=$(shell cd ../../bin && pwd):$(PATH)
    25 
    26 # Select test set
    27 ifeq ($(DG_TOOLNAME),gcc)
    28 	DG_TESTS:=$(DG_C_TESTS)
    29 endif
    30 ifeq ($(DG_TOOLNAME),g++)
    31 	DG_TESTS:=$(DG_CPP_TESTS)
    32 endif
    33 
    34 # Check that we have 'runtest' installed
    35 RUNTEST=$(shell which runtest)
    36 ifeq ($(RUNTEST),)
    37         $(error "DejaGnu 'runtest' not found - please install (eg. apt-get install dejagnu)")
    38 endif
    39 
    40 # Targets 
    41 all: test
    42 
    43 $(LOGDIR):
    44 	@mkdir -p $@
    45 
    46 $(LOGDIR)/site.exp: $(TOPDIR)/default.cfg $(LOGDIR)
    47 	@{ echo 'lappend boards_dir "$(LOGDIR)"'; \
    48 	   echo 'set target_alias $(TARGET)';     } > $@
    49 
    50 $(LOGDIR)/board.exp: $(TOPDIR)/default.cfg $(LOGDIR)
    51 	@{ echo 'load_generic_config "unix"';                    \
    52 	   echo 'process_multilib_options ""';                   \
    53 	   echo 'set_board_info bmk,use_alarm 1';                \
    54 	   echo 'set_board_info rsh_prog ssh';                   \
    55 	   echo 'set_board_info rcp_prog scp';                   \
    56 	   echo 'set_board_info hostname $(DG_TARGET_HOSTNAME)'; \
    57 	   echo 'set_board_info username $(DG_TARGET_USERNAME)'; } > $@
    58 
    59 # As Martin puts it:
    60 #  > The thing is that when you run 50k+ test cases the odds are that at
    61 #  > least one will fail and thus runtest basically always return an error
    62 #  > despite the fact that the test session has executed successfully.
    63 # So just ignore any error reported by runtest
    64 test: $(LOGDIR)/board.exp $(LOGDIR)/site.exp $(LOGDIR)
    65 	@runtest --tool $(DG_TOOLNAME)          \
    66 	         --srcdir $(TOPDIR)/testsuite   \
    67 	         --objdir $(LOGDIR)             \
    68 	         --outdir $(LOGDIR)             \
    69 	         --all                          \
    70 	         --target $(TARGET)             \
    71 	         --target_board board           \
    72 	         $(DG_TESTS)                    \
    73 	         GXX_UNDER_TEST=$(TARGET)-g++   || true
    74 	@printf "Result files available in '%s'\n" "$(LOGDIR)"
    75 
    76 clean:
    77 	rm -rf $(LOGDIR)
    78 
    79 .PHONY: config test clean