source: rtems-testing/gcc/do_one @ 85c521d

4.11
Last change on this file since 85c521d was 85c521d, checked in by Joel Sherrill <joel.sherrill@…>, on May 2, 2014 at 2:14:18 PM

rtems-testing: Use eval bash instead of full path

  • Property mode set to 100755
File size: 28.5 KB
Line 
1#! /usr/bin/eval bash
2#
3# Execution Times (for sparc-rtems${RTEMS_VERSION})
4#
5#   - building native                      - ?
6#   - building binutils                    - 1m31.310s
7#   - building GDB                         - 1m39.318s
8#   - building stage1 (multilib)           - 10m22.371s
9#   - building RTEMS (multilib + BSP)      - 22m47.048s
10#   - building Objective-C (multilib)      - 6m45.532s
11#   - building Ada (multilib)              - ?
12#   - building Go (multilib)               - ?
13#   - building GCJ (multilib)              - ?
14#   - Running GCC Test Suite (sis)         - 122m47.289s
15#   - Running Objective-C Test Suite (sis) - ?
16#   - Running ACAT           (sis)         - ?
17#   - Running Go Test Suite  (sis)         - ?
18#   - Running GCJ Test Suite  (sis)        - ?
19#
20# Computer Info
21#   Fedora 14 on Intel Core2 Duo Q6600 (4 core) @ 2.40GHz w/ 4GB RAM
22
23vfile=`dirname $0`/../VERSIONS
24if [ ! -r ${vfile} ] ; then
25  echo VERSIONS file not found
26  exit 1
27fi
28
29source ${vfile}
30
31
32######################## Set defaults #############################
33# Remove Build Directories
34do_cleanup=no
35# Install Binutils
36do_binutils=no
37# Install GDB
38do_gdb=no
39# Build the native compiler?
40do_native=no
41  do_native_ada=yes
42# Build the base level cross compiler. C++ and multilib are optional.
43do_stage1=no
44  do_cxx=yes
45  do_multilib=yes
46# Build the Objective-C language cross compiler.
47do_objc=no
48  do_native_objc=yes
49# Build the Ada language cross compiler.
50do_ada=no
51  do_ada_multilib=yes
52# Build the GCC Go language cross compiler.
53do_gccgo=no
54        do_gccgo_multilib=yes
55# Build the GCC Java language cross compiler.
56do_gcj=no
57        do_gcj_multilib=yes
58# Build the GCC FORTRAN language cross compiler.
59do_fortran=no
60        do_fortran_multilib=yes
61# Build RTEMS for a particular CPU/BSP combination
62do_rtems=no
63# Which test suites do we attempt
64run_gcctests=no
65run_objctests=no
66run_acats=no
67run_gccgotests=no
68run_libgotests=no
69run_libjavatests=no
70run_fortrantests=no
71# Do we send email to gcc-testresults with the test results?
72do_mail=yes
73# Are we noisy when running?
74verbose=no
75######################## Parse arguments ###########################
76
77usage()
78{
79cat <<EOF
80do_one [options] CPU BSP
81  -A   - binutils, stage 1, C++, C/C++ multilib, RTEMS
82  -S   - enable secondary languages of Ada, GCC Go, ObjC, FORTRAN
83  -T   - run GCC tests for languages enabled
84  -B n - build jobs in parallel (e.g. make -j N)
85  -n   - native compiler
86  -d   - do not clean up (delete build directories) (default=no)
87  -M   - do NOT email test results to gcc-testresults
88  -v   - verbose (default=no)
89
90  Cross Compilation Options (Base and Primary Languages)
91  ======================================================
92    -b   - install binutils
93    -D   - install gdb
94    -1   - stage 1 C/C++ compiler
95    -c   -   do not include C++
96    -m   -   do not build multilib
97    -r   - build RTEMS
98    -g   - run GCC C/C++ tests
99
100
101  Cross Compilation Options (Secondary Languages)
102  ===============================================
103    -a   - enable stage 2 Ada compiler
104    -G   - enable stage 2 GCC Go compiler
105    -J   - enable stage 2 GCC Java compiler
106    -f   - enable stage 2 GCC FORTRAN compiler
107    -F   - run FORTRAN tests
108    -C   - run ACATS
109    -O   - Build Objective-C
110    -P   - Run Objective-C Tests
111    -o   - run GCC Go tests
112    -t   - run libgo tests
113    -j   - run libjava tests
114EOF
115}
116
117fatal()
118{
119  usage
120  exit 1
121}
122
123toggle()
124{
125  case $1 in
126    no)  echo "yes" ;;
127    yes) echo "no" ;;
128    *)   fatal "Unknown value to toggle ($1)" ;;
129  esac
130}
131
132while getopts bdDnv1cmargiotB:CfFAJTMGOPS OPT
133do
134    case "$OPT" in
135        A) do_binutils="yes"
136           do_gdb="yes"
137           do_stage1="yes"
138           do_cxx="yes"
139           do_multilib="yes"
140           do_rtems="yes"
141           ;;
142        S) # Secondary languages need to be explicitly turned on
143           do_ada="yes"
144           do_gccgo="yes"
145           do_gcj="yes"
146           do_objc="yes"
147           do_fortran="yes"
148           ;;
149        B) MAKEJOBS="-j$OPTARG" ;;
150        d) do_cleanup=`toggle ${do_cleanup}` ;;
151        D) do_gdb=`toggle ${do_gdb}` ;;
152        T) run_gcctests="yes"
153           run_objctests="yes"
154           run_acats="yes"
155           run_gccgotests="yes"
156           run_fortrantests="yes"
157           ;;
158        b) do_binutils=`toggle ${do_binutils}` ;;
159        # Build the native
160        n) do_native=`toggle ${do_native}` ;;
161        # Stage 1 arguments
162        1) do_stage1=`toggle ${do_stage1}` ;;
163        c) do_cxx=`toggle ${do_cxx}` ;;
164        m) do_multilib=`toggle ${do_multilib}` ;;
165        # Stage 2 arguments
166        a) do_ada=`toggle ${do_ada}` ;;
167        G) do_gccgo=`toggle ${do_gccgo}` ;;
168        J) do_gcj=`toggle ${do_gcj}` ;;
169        f) do_fortran=`toggle ${do_fortran}` ;;
170        # Build RTEMS
171        r) do_rtems=`toggle ${do_rtems}` ;;
172        # Testsuites to run
173        g) run_gcctests=`toggle ${run_gcctests}` ;;
174        C) run_acats=`toggle ${run_acats}` ;;
175        v) verbose=`toggle ${verbose}` ;;
176        M) do_mail=`toggle ${do_mail}` ;;
177        O) do_objc=`toggle ${do_objc}` ;;
178        P) run_objctests=`toggle ${run_objctests}` ;;
179        o) run_gccgotests=`toggle ${run_gccgotests}` ;;
180        t) run_libgotests=`toggle ${run_libgotests}` ;;
181        j) run_libjavatests=`toggle ${run_libjavatests}` ;;
182        F) run_fortrantests=`toggle ${run_fortrantests}` ;;
183        *) fatal ;;
184    esac
185done
186
187run_libgotests=$run_gccgotests
188
189########################### Grab CPU/BSP ###########################
190shiftcount=`expr $OPTIND - 1`
191shift $shiftcount
192cpu=${1}
193bsp=${2}
194
195needBSP=no
196needCPU=no
197
198# If native or cross, check things differently
199if [ ${do_native} = yes ] ; then
200  if [ ${do_gccgo} = yes ] ; then
201    echo "Warning! Go requires native C++ to build."
202    do_cxx=yes
203  fi
204
205  if [ ${do_gcj} = yes ] ; then
206    echo "Warning! GCJ requires native C++ to build."
207    do_cxx=yes
208  fi
209else # NOT NATIVE - build for RTEMS
210  # Should the user have specified a CPU and/or BSP?
211  if [ ${do_binutils} = yes -o ${do_gdb} = yes -o \
212       ${do_stage1} = yes -o ${do_ada} = yes -o \
213       ${do_gccgo} = yes -o ${do_gcj} = yes -o \
214       ${do_fortran} = yes ] ; then
215    needCPU=yes
216  fi
217
218  if [ ${do_rtems} = yes -o ${run_gcctests} = yes -o \
219       ${run_acats} = yes -o ${run_gccgotests} = yes -o \
220       ${run_libjavatests} = yes ] ; then
221    needBSP=yes
222    needCPU=yes
223    if [ x${bsp} = x ] ; then
224      echo "BSP NOT SET"
225      fatal
226    fi
227  fi
228
229  if [ ${needCPU} = yes -a x${cpu} = x ] ; then
230    echo "CPU NOT SET"
231    fatal
232  fi
233
234  if [ ${needBSP} = yes -a x${bsp} = x ] ; then
235    echo "BSP NOT SET"
236    fatal
237  fi
238
239  TARGET=${cpu}-rtems${RTEMS_VERSION}
240
241  # Which CPUs do not support C++
242  if [ ${do_cxx} = "yes" ] ; then
243    case ${cpu} in
244      avr|h8300|m32c)
245        do_cxx=no
246        echo ${cpu} does not support C++
247        ;;
248      *);;
249    esac
250  fi
251
252  # Which CPUs do not support Ada
253  if [ ${do_ada} = "yes" ] ; then
254    case ${cpu} in
255      avr|h8300|m32c|sh)
256        do_ada=no
257        run_acats=no
258        echo ${cpu} does not support Ada
259        ;;
260      *);;
261    esac
262  fi
263
264  # Which CPUs do not support Go
265  if [ ${do_gccgo} = "yes" ] ; then
266    case ${cpu} in
267      avr|h8300|m32c)
268        do_gccgo=no
269        echo ${cpu} does not support Go
270        ;;
271      *);;
272    esac
273  fi
274
275  # Which CPUs do not support GCJ
276  if [ ${do_gcj} = "yes" ] ; then
277    case ${cpu} in
278      avr|h8300|m32c)
279        do_gcj=no
280        echo ${cpu} does not support GCJ
281        ;;
282      *);;
283    esac
284  fi
285
286  # Which CPUs do not support FORTRAN
287  if [ ${do_fortran} = "yes" ] ; then
288    case ${cpu} in
289      arm|i386|m68k|mips|powerpc|sparc) ;;
290      *)
291        do_fortran=no
292        echo ${cpu} does not support Ada
293        ;;
294    esac
295  fi
296fi
297
298# When verbose, print settings
299if [ ${verbose} = yes ] ; then
300  echo "Target          : " ${cpu}
301  echo "BSP             : " ${bsp}
302  echo "Binutils        : " ${do_binutils}
303  echo "GDB             : " ${do_gdb}
304  echo "Make Jobs       : " ${MAKEJOBS}
305  echo "Build Native    : " ${do_native}
306  echo "Build C Stage 1 : " ${do_stage1} "(multilib=${do_multilib} test=${run_gcctests})"
307  echo "  C++           : " ${do_cxx}
308  echo "Build RTEMS     : " ${do_rtems}
309  echo "Email Tests     : " ${do_mail}
310  echo "Native GCC      : " `type gcc`
311  echo "PATH            : " ${PATH}
312  echo "Clean up        : " ${do_cleanup}
313  echo
314  echo "==================== Secondary Languages ======================"
315  echo "  Ada         : " ${do_ada}     "(multilib=${do_ada_multilib} test=${run_acats})"
316  echo "  FORTRAN     : " ${do_fortran} "(multilib=${do_gccgo_multilib} test=${run_fortrantests})"
317  echo "  GCC Go      : " ${do_gccgo} \
318       "(multilib=${do_gccgo_multilib} test=${run_gccgotests} libgotests=${run_libgotests})"
319  echo "  GCJ         : " ${do_gcj} \
320       "(multilib=${do_gcj_multilib} test=${run_gcjtests} libtests=${run_libjavatests})"
321  echo "  Objective-C : " ${do_objc}   "(multilib=${do_ada_multilib} test=${run_objctests})"
322fi
323
324# Do we accept an alternate name for the BSP?
325if [ x${bsp} = xqemu ] ; then
326  BSP_BUILT=pc386
327else
328  BSP_BUILT=${bsp}
329fi
330 
331######### Consistency check installation of source
332if [ ! -d ${GCCDIR}/newlib ] ; then
333  echo "${GCCDIR}/newlib not present"
334  exit 1
335fi
336
337ADASCRIPTDIR=${SCRIPTDIR}/gcc/testsuite/ada/acats
338for i in Makefile.rtems rtems_acats_reasons rtems_acats_status \
339    rtems_generate_acats_email rtems_init.c run_all_rtems.sh
340do
341  if [ ! -r ${ADASCRIPTDIR}/${i} ] ; then
342    echo "${ADASCRIPTDIR}/gcc/testsuite/ada/acats/${i} not present"
343    echo "RTEMS ACATS support files not present"
344    exit 1
345  fi
346done
347
348if [ ${needCPU} = yes -a ${needBSP} = yes -a \
349     ${run_gcctests} = yes -a ${run_acats} = yes ] ; then
350  DEJADIR=${SCRIPTDIR}/dejagnu/boards
351  if [ ! -d ${DEJADIR} ] ; then
352    echo "Missing DejaGNU configuration directory (${DEJADIR})"
353    exit 1
354  fi
355
356  case ${cpu}-${bsp} in
357    arm-edb7312)          dejacfg=rtems-arm-edb7312 ;;
358    avr-avrtest)          dejacfg=rtems-avr-avrtest ;;
359    bfin-eZKit533)        dejacfg=rtems-bfin-nosim ;;
360    h8300-h8sim)          dejacfg=rtems-h8300-h8sim ;;
361    i386-pc386|i386-qemu) dejacfg=rtems-i386-qemu ;;
362    lm32-lm32_evr)        dejacfg=rtems-lm32-lm32_evr ;;
363    m32c-m32csim)         dejacfg=rtems-m32c-m32csim ;;
364    m32r-m32rsim)         dejacfg=rtems-m32r-m32rsim ;;
365    m68k-uC5282)          dejacfg=rtems-m68k-uC5282 ;;
366    microblaze-nosim)     dejacfg=rtems-microblaze-nosim ;;
367    mips-jmr3904)         dejacfg=rtems-mips-jmr3904 ;;
368    powerpc-psim)         dejacfg=rtems-powerpc-psim ;;
369    sh-simsh1)            dejacfg=rtems-sh-simsh1 ;;
370    sparc-sis)            dejacfg=rtems-sparc-sis ;;
371    sparc64-niagara)      dejacfg=rtems-sparc64-nosim ;;
372    v850-*v850*sim*)      dejacfg=rtems-v850-v850sim ;;
373    *)
374      echo "ERROR ${bsp} is not known to DegaGNU"
375      exit 1
376      ;;
377  esac
378
379  if [ ! -r ${DEJADIR}/${dejacfg}.exp ] ; then
380    echo "Missing DejaGNU file for ${cpu}/${bsp}"
381    exit 1
382  fi
383fi
384######### END OF Consistency check installation of source
385
386######### Log Directory
387if [ ! -d ${LOGDIR} ] ; then
388  mkdir ${LOGDIR}
389fi
390#########
391
392######### Install binutils
393j_binutils()
394{
395  test -d ${INSTALL} || mkdir -p ${INSTALL}
396
397  cd ${INSTALL}/..
398 
399  echo "Building Binutils from source"
400  rm -rf ${BUILDDIR}/b-${cpu}-binutils
401  mkdir ${BUILDDIR}/b-${cpu}-binutils
402  cd ${BUILDDIR}/b-${cpu}-binutils
403  (${BINUTILSDIR}/configure --target=${TARGET} --prefix=$INSTALL \
404    --disable-werror && \
405    make ${MAKEJOBS} && make install) >${LOGDIR}/${cpu}-binutils.log 2>&1
406  if [ $? -ne 0 ] ; then
407    echo "Failed to build Binutils from source"
408    exit 1
409  fi
410  echo "Checking Binutils "
411  make check >${LOGDIR}/${cpu}-binutils-check.log 2>&1
412  grep ^FAIL ${LOGDIR}/${cpu}-binutils-check.log
413  cd ..
414  test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-binutils
415}
416
417if [ ${do_binutils} = yes ] ; then
418  echo "Building binutils..."
419  time j_binutils ${cpu}
420fi
421
422######### Install gdb
423j_gdb()
424{
425  test -d ${INSTALL} || mkdir -p ${INSTALL}
426
427  cd ${INSTALL}/..
428
429  case ${cpu} in
430    mips) GDBTARGET=${cpu}tx39-rtems${RTEMS_VERSION} ;;
431    *)    GDBTARGET=${TARGET} ;;
432  esac
433
434  echo "Building GDB from source"
435  cd ${BASEDIR}
436  rm -rf ${BUILDDIR}/b-${cpu}-gdb
437  mkdir ${BUILDDIR}/b-${cpu}-gdb
438  cd ${BUILDDIR}/b-${cpu}-gdb
439  (${GDBDIR}/configure --target=${GDBTARGET} \
440    --enable-sim --enable-sim-hardware \
441    --disable-werror \
442    --enable-timebase --enable-sim-trace  --prefix=$INSTALL && \
443    make ${MAKEJOBS} && make install) >${LOGDIR}/${cpu}-gdb.log 2>&1
444  if [ $? -ne 0 ] ; then
445    echo "Failed to build gdb from source"
446    exit 1
447  fi
448  cd ..
449  test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-gdb
450}
451
452if [ ${do_gdb} = yes ] ; then
453  echo "Building gdb..."
454  time j_gdb ${cpu}
455fi
456
457######### Build a native compiler
458j_native()
459{
460  test ${do_native_ada} = "yes" && AdaArg=",ada"
461  test ${do_native_objc} = "yes" && ObjCArg=",objc"
462  ${GCCDIR}/configure \
463    ${NATIVE_GCC_EXTRA_ARGS} \
464    --disable-werror \
465    --enable-languages=c,c++${AdaArg}${ObjCArg} --prefix=$INSTALL &&
466  make ${MAKEJOBS} && make install
467}
468
469if [ ${do_native} = "yes" ] ; then
470  echo "Building native compiler..."
471  cd ${BASEDIR} && \
472  rm -rf ${BUILDDIR}/b-native && \
473  mkdir  ${BUILDDIR}/b-native && \
474  cd ${BUILDDIR}/b-native
475  time j_native >${LOGDIR}/native.log 2>&1
476  if [ $? -ne 0 ] ; then
477    echo "Failed to build native gcc"
478    exit 1
479  fi
480  cd ..
481  test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-native
482else
483  echo Skipping native
484fi
485# END of build native compiler
486
487######### Build Cross C/C++ baseline compiler
488j_gcc()
489{
490
491  if [ X${1} = X ] ; then
492    echo Usage: $0 TARGET_CPU
493    exit 1
494  fi
495
496  if [ ! -d ${INSTALL} ] ; then
497    echo ${INSTALL} does not exist
498    exit 1
499  fi
500
501  if [ ${verbose} = yes ] ; then
502    echo "Cross Assembler ==>" `type ${TARGET}-as`
503  fi
504
505  if [ ${do_cxx} = yes ] ; then
506     cxx=",c++"
507  fi
508  if [ ${cpu} = avr ] ; then
509    cxx=""
510  fi
511
512  if [ ${do_multilib} = yes ] ; then
513     multilib="--enable-multilib"
514  else
515     multilib="--disable-multilib"
516  fi
517
518  ${GCCDIR}/configure \
519    ${GCC_EXTRA_ARGS} \
520    --disable-werror \
521    --enable-threads=rtems  --with-gnu-as ${multilib} \
522    --enable-newlib-mb --enable-newlib-iconv \
523    --with-gnu-ld --with-newlib  --verbose --with-system-zlib --disable-nls \
524    --enable-version-specific-runtime-libs \
525    --enable-languages=c${cxx} --target=$TARGET --prefix=$INSTALL
526  if [ $? -ne 0 ] ; then
527    echo "Failed to configure GCC C/C++ .. bailing"
528    exit 1
529  fi
530
531  make ${MAKEJOBS}
532  if [ $? -ne 0 ] ; then
533    echo "Failed to build GCC C/C++ .. bailing"
534    exit 1
535  fi
536
537  make install
538  if [ $? -ne 0 ] ; then
539    echo "Failed to install GCC C/C++ .. bailing"
540    exit 1
541  fi
542}
543
544if [ ${do_stage1} = "yes" ] ; then
545  echo "Building Stage 1 compiler (C/C++)..."
546  (cd ${BASEDIR} && \
547   rm -rf ${BUILDDIR}/b-${cpu}-gcc && \
548   mkdir  ${BUILDDIR}/b-${cpu}-gcc && \
549   cd ${BUILDDIR}/b-${cpu}-gcc && \
550     time j_gcc ${cpu} >${LOGDIR}/${cpu}-gcc.log 2>&1 && cd ..) || exit 1
551else
552  echo Skipping Stage 1 for ${cpu}
553fi
554
555#################### RTEMS
556
557j_rtems()
558{
559  cpuArg=$1
560  bspArg=$2
561  bspdir=${BUILDDIR}/b-${cpuArg}-${bspArg}
562
563  cd ${BASEDIR}
564  rm -rf ${bspdir}
565  mkdir  ${bspdir} || exit 1
566  cd ${bspdir}     || exit 1
567
568  ENABLE_BSP="--enable-rtemsbsp=${bspArg}"
569  case $bspArg in
570    multilib)
571      ENABLE_BSP="--enable-multilib"
572      MAKE_ARG="-k"
573      ;;
574      edb7312)    ENABLE_BSP="${ENABLE_BSP} ON_SKYEYE=1" ;;
575      gumstix)    ENABLE_BSP="${ENABLE_BSP} ON_SKYEYE=1" ;;
576    qemu|pc386)
577      ENABLE_BSP="${ENABLE_BSP} USE_COM1_AS_CONSOLE=1"
578      ENABLE_BSP="${ENABLE_BSP} BSP_PRESS_KEY_FOR_RESET=0"
579      ENABLE_BSP="${ENABLE_BSP} BSP_RESET_BOARD_AT_EXIT=1"
580      ;;
581    *) ;;
582  esac
583  case ${cpu} in
584    m32c|h8300)
585      RTEMS_ARGS="--disable-ada --disable-posix --disable-networking" ;;
586    *)
587      RTEMS_ARGS="--enable-ada --enable-posix --enable-networking" ;;
588  esac
589  ${RTEMSDIR}/configure --target=${TARGET} ${ENABLE_BSP} \
590  ${RTEMS_ARGS} --enable-maintainer-mode --disable-tests \
591  --prefix=${BSP_INSTALL} && make ${MAKEJOBS} ${MAKE_ARG} && make install
592  status=$?
593  cd ..
594  if [ $status -ne 0 ] ; then
595    echo "Failed building RTEMS for ${cpuArg}/${bspArg}"
596    if [ ${bspArg} != "multilib" ] ; then
597      exit $status
598    fi
599  fi
600}
601
602if [ ${do_rtems} = "yes" ] ; then
603  echo "Building RTEMS for ${cpu} ${bsp} ..."
604  time j_rtems ${cpu} multilib ${bsp} >${LOGDIR}/${cpu}-rtems-multilib.log 2>&1
605  if [ $? -ne 0 ] ; then
606    echo "Failed to build RTEMS multilib for ${cpu}"
607    exit 1
608  fi
609  time j_rtems ${cpu} ${bsp} >${LOGDIR}/${cpu}-rtems-${bsp}.log 2>&1
610  if [ $? -ne 0 ] ; then
611    echo "Failed to build RTEMS for ${cpu}/${bsp}"
612    exit 1
613  fi
614  test ${do_cleanup} = "yes" && \
615      rm -rf ${BUILDDIR}/b-${cpu}-${bsp} ${BUILDDIR}/b-${cpu}-multilib
616else
617  echo Skipping RTEMS for ${cpu}/${bsp}
618fi
619pwd
620
621j_process_results()
622{
623  language=$1
624
625  shift
626
627  RDIR=${RESULTSDIR}/${TARGET}-${bsp}/`date +%Y-%m-%d-%H-%M-%S`
628  for results in `ls -1 gcc/testsuite/*/${*}.log gcc/testsuite/*/${*}.sum 2>/dev/null`
629  do
630    test -d ${RDIR} || mkdir -p ${RDIR}
631    cp ${results} ${RDIR}
632  done
633
634  if [ ${do_mail} = "yes" ] ; then
635    echo "Sending ${language} test results to GCC community.."
636    ${GCCDIR}/contrib/test_summary -m gcc-testresults@gcc.gnu.org | sh
637    if [ $? -ne 0 ] ; then
638      echo "Failed to email ${language} Test Results to GCC Community .. bailing"
639      exit 1
640    fi
641
642    echo "Sending ${language} test results to RTEMS community.."
643    ${GCCDIR}/contrib/test_summary -o -m rtems-tooltestresults@rtems.org | sh
644    if [ $? -ne 0 ] ; then
645      echo "Failed to email ${language} Test Results to RTEMS Community .. bailing"
646      exit 1
647    fi
648  fi
649}
650
651##### Do the gcc tests
652if [ ${run_gcctests} = "yes" ] ; then
653  echo "Running GCC Tests..."
654  cd ${BUILDDIR}/b-${cpu}-gcc || exit 1
655  time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} gcc \
656    >${LOGDIR}/${cpu}-gcctests-${bsp}.log 2>&1
657 
658  if [ $? -eq 0 ] ; then
659    j_process_results "C/C++" gcc/testsuite/gcc/gcc gcc/testsuite/g++/g++
660  fi
661
662  cd .. || exit 1
663else
664  echo Skipping GCC DejaGNU tests for ${cpu}/${bsp}
665fi
666test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-gcc
667
668##### Build an Objective-C compiler now that we have a cross installed
669j_gccobjc()
670{
671  if [ X${1} = X ] ; then
672    echo Usage: $0 TARGET_CPU
673    exit 1
674  fi
675  TARGET=${1}-rtems${RTEMS_VERSION}
676
677  if [ ! -d ${INSTALL} ] ; then
678    echo ${INSTALL} does not exist
679    exit 1
680  fi
681
682  if [ ${verbose} = yes ] ; then
683    echo "Cross GCC for Objective-C ==>" `type ${TARGET}-gcc`
684  fi
685
686  ${GCCDIR}/configure \
687   ${GCC_EXTRA_ARGS} \
688   --enable-threads=rtems  --with-gnu-as  --enable-multilib \
689   --with-gnu-ld --disable-newlib  --verbose --with-system-zlib --disable-nls \
690    CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/ \
691    --enable-version-specific-runtime-libs \
692    --enable-languages=c,objc --target=$TARGET --prefix=$INSTALL &&
693  make ${MAKEJOBS} &&
694  make install
695  status=$?
696  if [ $status -ne 0 ] ; then
697    echo "Failed building Objective-C"
698  fi
699}
700
701objc_fail="no"
702if [ ${do_objc} = "yes" ] ; then
703  echo "Building Stage 2 cross Objective-C compiler for ${1} ..."
704  (cd ${BASEDIR} && \
705   rm -rf ${BUILDDIR}/b-${cpu}-objc && \
706   mkdir  ${BUILDDIR}/b-${cpu}-objc && \
707   cd ${BUILDDIR}/b-${cpu}-objc && \
708   time j_gccobjc ${cpu} >${LOGDIR}/${cpu}-objc.log 2>&1 && cd ..) || \
709    objc_fail="yes"
710else
711  echo Skipping Stage 2 Objective-C for ${cpu}
712fi
713
714#### Run the Objective-C tests
715if [ ${run_objctests} = "yes" -a \
716     -d ${BUILDDIR}/b-${cpu}-objc -a ${objc_fail} = "no" ] ; then
717  echo "Running Objective-C Tests..."
718
719  cd ${BUILDDIR}/b-${cpu}-objc || exit 1
720  time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} objc \
721    >${LOGDIR}/${cpu}-gcctests-${bsp}.log 2>&1
722
723  if [ $? -eq 0 ] ; then
724    j_process_results "Objective-C" gcc/testsuite/objc/objc
725  fi
726
727  cd .. || exit 1
728else
729  echo Skipping Objective-C Tests for ${cpu}
730fi
731
732if [ ${do_ada} = "yes" ] ; then
733  test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-ada
734fi
735
736##### Build an Ada compiler now that we have a cross installed
737j_gccada()
738{
739  if [ X${1} = X ] ; then
740    echo Usage: $0 TARGET_CPU
741    exit 1
742  fi
743  TARGET=${1}-rtems${RTEMS_VERSION}
744
745  if [ ! -d ${INSTALL} ] ; then
746    echo ${INSTALL} does not exist
747    exit 1
748  fi
749
750  if [ ${verbose} = yes ] ; then
751    echo "Cross GCC for Ada ==>" `type ${TARGET}-gcc`
752  fi
753
754  if [ ${do_ada_multilib} = yes ] ; then
755     ada_multilib="--enable-multilib"
756  else
757     ada_multilib="--disable-multilib"
758  fi
759
760#    CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/
761
762  ${GCCDIR}/configure \
763   ${GCC_EXTRA_ARGS} \
764   --enable-threads=rtems  --with-gnu-as ${ada_multilib} \
765   --with-gnu-ld --disable-newlib  --verbose --with-system-zlib --disable-nls \
766    CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/ \
767    --enable-version-specific-runtime-libs \
768    --enable-languages=c,ada --target=$TARGET --prefix=$INSTALL &&
769  make ${MAKEJOBS} &&
770  make install
771  status=$?
772  if [ $status -ne 0 ] ; then
773    echo "Failed building Ada - continuing to next secondary language"
774  fi
775  return $status
776}
777
778ada_fail="no"
779if [ ${do_ada} = "yes" ] ; then
780  echo "Building Stage 2 cross Ada compiler for ${1} ..."
781  (cd ${BASEDIR} && \
782   rm -rf ${BUILDDIR}/b-${cpu}-ada && \
783   mkdir  ${BUILDDIR}/b-${cpu}-ada && \
784   cd ${BUILDDIR}/b-${cpu}-ada && \
785   time j_gccada ${cpu} >${LOGDIR}/${cpu}-ada.log 2>&1 && cd ..) || \
786    ada_fail="yes"
787else
788  echo Skipping Stage 2 Ada for ${cpu}
789fi
790
791#### Run the Ada ACATS tests
792if [ ${run_acats} = "yes" -a \
793     -d ${BUILDDIR}/b-${cpu}-ada -a ${ada_fail} = "no" ] ; then
794  echo "Running ACATS..."
795  cd ${GCCDIR}/gcc/testsuite/ada/acats/ || exit 1
796
797  time ${ADASCRIPTDIR}/run_all_rtems.sh ${INSTALL} ${BSP_INSTALL} \
798    ${TARGET} ${bsp} >${LOGDIR}/${cpu}-acats-${bsp}-build.log 2>&1
799  if [ $? -eq 0 ] ; then
800    if [ -r work-${bsp}/acats.log ] ; then
801      cp work-${bsp}/acats.log ${LOGDIR}/${cpu}-acats-${bsp}.log
802    fi
803
804    if [ ${do_mail} = "yes" ] ; then
805      echo Sending ACATS test results to GCC community..
806      ${ADASCRIPTDIR}/rtems_generate_acats_email ${cpu} ${bsp} yes
807    fi
808  fi
809
810  cd ../../../../.. || exit 1
811else
812  echo Skipping ACATS for ${cpu}
813fi
814
815if [ ${do_ada} = "yes" ] ; then
816  test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-ada
817fi
818
819##### Build a GCC Go compiler now that we have a cross installed
820j_gccgo()
821{
822  if [ X${1} = X ] ; then
823    echo Usage: $0 TARGET_CPU
824    exit 1
825  fi
826  TARGET=${1}-rtems${RTEMS_VERSION}
827
828  if [ ! -d ${INSTALL} ] ; then
829    echo ${INSTALL} does not exist
830    exit 1
831  fi
832
833  if [ ${verbose} = yes ] ; then
834    echo "Cross GCC ==>" `type ${TARGET}-gcc`
835  fi
836
837  if [ ${do_gccgo_multilib} = yes ] ; then
838     gccgo_multilib="--enable-multilib"
839  else
840     gccgo_multilib="--disable-multilib"
841  fi
842
843  case ${TARGET} in
844    i386*) GOFLAGS="-march=i486" ;;
845    *)     GOFLAGS="" ;;
846  esac
847#    CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/
848
849  ${GCCDIR}/configure \
850   ${GCC_EXTRA_ARGS} \
851   CFLAGS_FOR_TARGET="-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/ ${GOFLAGS}" \
852     --enable-threads=rtems --with-gnu-as ${gccgo_multilib} \
853     --with-gnu-ld --disable-newlib  --verbose \
854     --with-system-zlib --disable-nls \
855     --enable-version-specific-runtime-libs \
856     --with-host-libstdcxx=-static-libstdc++ \
857     --enable-languages=c,go --target=$TARGET --prefix=$INSTALL &&
858  make ${MAKEJOBS} &&
859  make install
860  status=$?
861  if [ $status -ne 0 ] ; then
862    echo "Failed building Go - continuing to next secondary language"
863  fi
864  return $status
865}
866
867go_fail="no"
868if [ ${do_gccgo} = "yes" ] ; then
869  echo "Building Stage 2 cross GCC Go compiler for ${1} ..."
870  (cd ${BASEDIR} && \
871   rm -rf ${BUILDDIR}/b-${cpu}-go && \
872   mkdir  ${BUILDDIR}/b-${cpu}-go && \
873   cd ${BUILDDIR}/b-${cpu}-go && \
874   time j_gccgo ${cpu} >${LOGDIR}/${cpu}-go.log 2>&1 && cd ..) || \
875     go_fail="yes"
876else
877  echo Skipping GCC Go for ${cpu}
878fi
879
880##### Do the gccgo tests
881if [ $a ${run_gccgotests} = "yes" -a \
882     -d ${BUILDDIR}/b-${cpu}-go -a ${go_fail} = "no" ] ; then
883  echo "Running GCC Go Tests..."
884  cd ${BUILDDIR}/b-${cpu}-go/gcc || exit 1
885  time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} gccgo \
886    >${LOGDIR}/${cpu}-gccgotests-${bsp}.log 2>&1
887
888  if [ $? -eq 0 ] ; then
889    j_process_results "Go" testsuite/go/go
890  fi
891  cd .. || exit 1
892else
893  echo Skipping GCC Go DejaGNU tests for ${cpu}/${bsp}
894fi
895
896##### Do the libgo tests
897if [ $a ${run_libgotests} = "yes" -a \
898     -d ${BUILDDIR}/b-${cpu}-go -a ${go_fail} = "no" ] ; then
899  echo "Running libgo DejaGNU tests..."
900  cd ${BUILDDIR}/b-${cpu}-go || exit 1
901  time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} libgo \
902    >${LOGDIR}/${cpu}-libgotests-${bsp}.log 2>&1
903
904  if [ $? -eq 0 ] ; then
905    j_process_results "Go Library" ${TARGET}/libgo/testsuite/libgo-all
906  fi
907else
908  echo Skipping libgo DejaGNU tests for ${cpu}/${bsp}
909fi
910
911if [ ${do_gccgo} = "yes" ] ; then
912  test ${do_cleanup} = "yes" && rm -rf ${BUILDDIR}/b-${cpu}-go
913fi
914
915##### Build a GCJ compiler now that we have a cross installed
916j_gcj()
917{
918  if [ X${1} = X ] ; then
919    echo Usage: $0 TARGET_CPU
920    exit 1
921  fi
922  TARGET=${1}-rtems${RTEMS_VERSION}
923
924  if [ ! -d ${INSTALL} ] ; then
925    echo ${INSTALL} does not exist
926    exit 1
927  fi
928
929  if [ ${verbose} = yes ] ; then
930    echo "Cross GCC ==>" `type ${TARGET}-gcc`
931  fi
932
933  if [ ${do_gcj_multilib} = yes ] ; then
934     gcj_multilib="--enable-multilib"
935  else
936     gcj_multilib="--disable-multilib"
937  fi
938
939  case ${TARGET} in
940    i386*) GOFLAGS="-march=i486" ;;
941    *)     GOFLAGS="" ;;
942  esac
943#    CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/
944
945  ${GCCDIR}/configure \
946   ${GCC_EXTRA_ARGS} \
947   CFLAGS_FOR_TARGET="-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/ ${GOFLAGS}" \
948     --enable-threads=rtems --with-gnu-as ${gcj_multilib} \
949     --with-gnu-ld --disable-newlib  --verbose \
950     --with-system-zlib --disable-nls \
951     --enable-version-specific-runtime-libs \
952     --with-host-libstdcxx=-static-libstdc++ \
953     --enable-languages=c,c++,java --target=$TARGET --prefix=$INSTALL &&
954  make ${MAKEJOBS} &&
955  make install
956  status=$?
957  if [ $status -ne 0 ] ; then
958    echo "Failed building GCJ - continuing to next secondary language"
959  fi
960  return $status
961}
962
963gcj_fail="no"
964if [ ${do_gcj} = "yes" ] ; then
965  echo "Building Stage 2 cross GCC Java compiler for ${1} ..."
966  (cd ${BASEDIR} && \
967   rm -rf b-${cpu}-gcj && \
968   mkdir  b-${cpu}-gcj && \
969   cd b-${cpu}-gcj && \
970   time j_gcj ${cpu} >${LOGDIR}/${cpu}-gcj.log 2>&1 && cd ..) || \
971     gcj_fail="yes"
972else
973  echo Skipping GCC Java compiler for ${cpu}
974fi
975
976##### Do the libjava tests
977if [ $a ${run_libjavatests} = "yes" -a \
978     -d ${BASEDIR}/b-${cpu}-gcj -a ${gcj_fail} = "no" ] ; then
979  echo "Running libjava DejaGNU tests..."
980  cd ${BASEDIR}/b-${cpu}-gcj || exit 1
981  time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} java \
982    >${LOGDIR}/${cpu}-libjavatests-${bsp}.log 2>&1
983
984  if [ $? -eq 0 ] ; then
985    j_process_results "GCJ" ${TARGET}-${bsp}/libjava/testsuite/libjava-all
986  fi
987else
988  echo Skipping libjava DejaGNU tests for ${cpu}/${bsp}
989fi
990
991if [ ${do_gcj} = "yes" ] ; then
992  test ${do_cleanup} = "yes" && rm -rf b-${cpu}-gcj
993fi
994
995##### Build a FORTRAN compiler now that we have a cross installed
996j_fortran()
997{
998  if [ X${1} = X ] ; then
999    echo Usage: $0 TARGET_CPU
1000    exit 1
1001  fi
1002  TARGET=${1}-rtems${RTEMS_VERSION}
1003
1004  if [ ! -d ${INSTALL} ] ; then
1005    echo ${INSTALL} does not exist
1006    exit 1
1007  fi
1008
1009  ${GCCDIR}/configure \
1010   ${GCC_EXTRA_ARGS} \
1011   CFLAGS_FOR_TARGET="-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/ ${F_FLAGS}" \
1012     --with-ppl=/users/joel/test-gcc/install-svn/ \
1013     --enable-threads=rtems --with-gnu-as \
1014     --with-gnu-ld --disable-newlib  --verbose \
1015     --with-system-zlib --disable-nls \
1016     --enable-version-specific-runtime-libs \
1017     --enable-languages=c,fortran --target=$TARGET --prefix=$INSTALL && \
1018  make ${MAKEJOBS} &&
1019  make install
1020  status=$?
1021  if [ $status -ne 0 ] ; then
1022    echo "Failed building FORTRAN - continuing to next secondary language"
1023  fi
1024  return $status
1025}
1026
1027fortran_fail="no"
1028if [ ${do_fortran} = "yes" ] ; then
1029  echo "Building Stage 2 cross GCC FORTRAN compiler for ${1} ..."
1030  (cd ${BASEDIR} && \
1031   rm -rf b-${cpu}-fortran && \
1032   mkdir  b-${cpu}-fortran && \
1033   cd b-${cpu}-fortran && \
1034   time j_fortran ${cpu} >${LOGDIR}/${cpu}-fortran.log 2>&1 && cd ..) || \
1035     fortran_fail="yes"
1036else
1037  echo Skipping GCC FORTRAN compiler for ${cpu}
1038fi
1039
1040##### Do the FORTRAN tests
1041if [ $a ${run_fortrantests} = "yes" -a \
1042     -d ${BASEDIR}/b-${cpu}-fortran -a ${fortran_fail} = "no" ] ; then
1043  echo "Running FORTRAN DejaGNU tests..."
1044  cd ${BASEDIR}/b-${cpu}-fortran || exit 1
1045  time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} fortran \
1046    >${LOGDIR}/${cpu}-fortrantests-${bsp}.log 2>&1
1047
1048  if [ $? -eq 0 ] ; then
1049    j_process_results "FORTRAN" gcc/testsuite/gfortran/gfortran
1050  fi
1051else
1052  echo Skipping FORTRAN DejaGNU tests for ${cpu}/${bsp}
1053fi
1054
1055if [ ${do_fortran} = "yes" ] ; then
1056  test ${do_cleanup} = "yes" && rm -rf b-${cpu}-fortran
1057fi
1058
1059
1060
1061exit 0
Note: See TracBrowser for help on using the repository browser.