source: rtems-testing/gcc/do_one @ 288a6fb

4.11
Last change on this file since 288a6fb was 288a6fb, checked in by Joel Sherrill <joel.sherrill@…>, on Jul 21, 2010 at 12:41:37 PM

2010-07-21 Vinu Rajashekhar <vinutheraj@…>

  • do_one, rundeja, test_driver: Add Go support. Plus some cleanup from Joel.
  • Property mode set to 100755
File size: 19.3 KB
Line 
1#! /bin/sh
2#
3# Execution Times (for sparc-rtems${RTEMS_VERSION})
4#
5#   - building native                   - 45m43.697s
6#   - building stage1 (non-multilib)    - 7m26.749s
7#   - building stage1 (multilib)        -
8#   - building Ada stack (non-multilib) - 13m25.945s
9#   - building RTEMS                    - 12m27.799s
10#   - Running ACAT           (sis)      -
11#   - Running GCC Test Suite (sis)      - 60m26.523s
12#
13# Computer Info
14#   Fedora 8 on Intel Core2 Duo T7500  @ 2.20GHz w/ 2GB RAM
15
16vfile=`dirname $0`/../VERSIONS
17if [ ! -r ${vfile} ] ; then
18  echo VERSIONS file not found
19  exit 1
20fi
21
22source ${vfile}
23
24
25######################## Set defaults #############################
26# Remove Build Directories
27do_cleanup=yes
28# Install Binutils (from rpm or source)
29do_binutils=no
30  do_binutils_method=source
31# Install GDB (from rpm or source)
32do_gdb=no
33  do_gdb_method=source
34# Build the native compiler?
35do_native=no
36  do_native_ada=yes
37# Build the base level cross compiler. C++ and multilib are optional.
38do_stage1=no
39  do_cxx=yes
40  do_multilib=yes
41# Build the Ada language cross compiler. Multilib is NOT supported
42do_ada=no
43  do_ada_multilib=yes
44# Build the GCC Go language cross compiler.
45do_gccgo=no
46        do_gccgo_multilib=yes
47# Build RTEMS for a particular CPU/BSP combination
48do_rtems=no
49# Which test suites do we attempt
50run_gcctests=no
51run_acats=no
52run_gccgotests=no
53# Do we send email to gcc-testresults with the test results?
54do_mail=yes
55# Are we noisy when running?
56verbose=no
57######################## Parse arguments ###########################
58
59usage()
60{
61cat <<EOF
62do_one [options] CPU BSP
63  -A - binutils, stage 1, C++, C/C++ multilib, Ada, GCC Go, RTEMS
64  -T - run GCC, Ada and GCC Go tests
65  -b - install binutils (from source or copy installed RPM contents)
66  -D - install gdb (from source or copy installed RPM contents)
67  -n - native compiler
68  -1 - stage 1 C/C++ compiler
69  -c -   do not include C++
70  -m -   do not build multilib
71  -a - stage 2 Ada compiler
72  -G - stage 2 GCC Go compiler
73  -r - build RTEMS
74  -g - run GCC C/C++ tests
75  -C - run ACATS
76  -d - do not clean up (delete build directories)
77  -v - verbose
78  -M - do NOT email test results to gcc-testresults
79  -o - run GCC Go tests
80EOF
81}
82
83fatal()
84{
85  usage
86  exit 1
87}
88
89toggle()
90{
91  case $1 in
92    no)  echo "yes" ;;
93    yes) echo "no" ;;
94    *)   fatal "Unknown value to toggle ($1)" ;;
95  esac
96}
97
98while getopts bdDnv1cmargioCATMG OPT
99do
100    case "$OPT" in
101        A) do_binutils="yes"
102           do_gdb="yes"
103           do_stage1="yes"
104           do_cxx="yes"
105           do_multilib="yes"
106           do_ada="yes"
107           do_gccgo="yes"
108           do_rtems="yes"
109           ;;
110        d) do_cleanup=`toggle ${do_cleanup}` ;;
111        D) do_gdb=`toggle ${do_gdb}` ;;
112        T) run_gcctests="yes"
113           run_acats="yes"
114           run_gccgotests="yes"
115           ;;
116        # unrpm binutils
117        b) do_binutils=`toggle ${do_binutils}` ;;
118        # Build the native
119        n) do_native=`toggle ${do_native}` ;;
120        # Stage 1 arguments
121        1) do_stage1=`toggle ${do_stage1}` ;;
122        c) do_cxx=`toggle ${do_cxx}` ;;
123        m) do_multilib=`toggle ${do_multilib}` ;;
124        # Stage 2 arguments
125        a) do_ada=`toggle ${do_ada}` ;;
126        G) do_gccgo=`toggle ${do_gccgo}` ;;
127        # Build RTEMS
128        r) do_rtems=`toggle ${do_rtems}` ;;
129        # Testsuites to run
130        g) run_gcctests=`toggle ${run_gcctests}` ;;
131        C) run_acats=`toggle ${run_acats}` ;;
132        v) verbose=`toggle ${verbose}` ;;
133        M) do_mail=`toggle ${do_mail}` ;;
134        o) run_gccgotests=`toggle ${run_gccgotests}` ;;
135        *) fatal ;;
136    esac
137done
138
139########################### Grab CPU/BSP ###########################
140
141shiftcount=`expr $OPTIND - 1`
142shift $shiftcount
143
144cpu=${1}
145bsp=${2}
146
147case ${cpu} in
148  m32c)
149    do_ada=no
150    do_cxx=no
151    run_acats=no
152    echo M32C does not support C++ or Ada
153    ;;
154  *);;
155esac
156
157if [ ${verbose} = yes ] ; then
158  echo "Target        : " ${cpu}
159  echo "BSP           : " ${bsp}
160  echo "Binutils      : " ${do_binutils}
161  echo "GDB           : " ${do_gdb}
162  echo "Build Native  : " ${do_native}
163  echo "Build Stage 1 : " ${do_stage1}
164  echo "  C++         : " ${do_cxx}
165  echo "  Multilib    : " ${do_multilib}
166  echo "Stage 2       : " ${do_ada}
167  echo "  Ada         : " ${do_ada}
168  echo "  Multilib    : " ${do_ada_multilib}
169  echo "  GCC Go      : " ${do_gccgo}
170  echo "  Multilib    : " ${do_gccgo_multilib}
171  echo "Build RTEMS   : " ${do_rtems}
172  echo "Run GCC Tests : " ${run_gcctests}
173  echo "Run ACATS     : " ${run_acats}
174  echo "Run Go Tests  : " ${run_gccgotests}
175  echo "Email Tests   : " ${do_mail}
176  echo "Native GCC    : " `type gcc`
177  echo "PATH          : " ${PATH}
178  echo "Clean up      : " ${do_cleanup}
179fi
180
181# Should the user have specified a CPU and/or BSP?
182needBSP=no
183needCPU=no
184
185if [ ${do_binutils} = yes -o ${do_gdb} = yes -o \
186     ${do_stage1} = yes -o ${do_ada} = yes -o ${do_gccgo} = yes ] ; then
187  needCPU=yes
188fi
189
190if [ ${do_native} = yes -a ${do_gccgo} = yes ] ; then
191  echo "Warning! Go requires native C++ to build."
192  do_cxx=yes
193fi
194
195if [ ${do_rtems} = yes -o ${run_gcctests} = yes -o \
196     ${run_acats} = yes -o ${run_gccgotests} = yes ] ; then
197  needBSP=yes
198  needCPU=yes
199  if [ x${bsp} = x ] ; then
200    echo "BSP NOT SET"
201    fatal
202  fi
203fi
204
205if [ ${needCPU} = yes -a x${cpu} = x ] ; then
206  echo "CPU NOT SET"
207  fatal
208fi
209
210if [ ${needBSP} = yes -a x${bsp} = x ] ; then
211  echo "BSP NOT SET"
212  fatal
213fi
214
215TARGET=${cpu}-rtems${RTEMS_VERSION}
216
217if [ x${bsp} = xqemu ] ; then
218  BSP_BUILT=pc386
219else
220  BSP_BUILT=${bsp}
221fi
222 
223######### Consistency check installation of source
224
225if [ ! -d ${GCCDIR}/newlib ] ; then
226  echo "${GCCDIR}/newlib not present"
227  exit 1
228fi
229
230ADASCRIPTDIR=${SCRIPTDIR}/gcc/testsuite/ada/acats
231for i in Makefile.rtems rtems_acats_reasons rtems_acats_status \
232    rtems_generate_acats_email rtems_init.c run_all_rtems.sh
233do
234  if [ ! -r ${ADASCRIPTDIR}/${i} ] ; then
235    echo "${ADASCRIPTDIR}/gcc/testsuite/ada/acats/${i} not present"
236    echo "RTEMS ACATS support files not present"
237    exit 1
238  fi
239done
240
241if [ ${needCPU} = yes -a ${needBSP} = yes -a \
242     ${run_gcctests} = yes -a ${run_acats} = yes ] ; then
243  DEJADIR=${SCRIPTDIR}/dejagnu/boards
244  if [ ! -d ${DEJADIR} ] ; then
245    echo "Missing DejaGNU configuration directory (${DEJADIR})"
246    exit 1
247  fi
248
249  case ${cpu}-${bsp} in
250    arm-edb7312)          dejacfg=rtems-arm-edb7312 ;;
251    avr-avrtest)          dejacfg=rtems-avr-avrtest ;;
252    bfin-eZKit533)        dejacfg=rtems-bfin-nosim ;;
253    h8300-h8sim)          dejacfg=rtems-h8300-h8sim ;;
254    i386-pc386|i386-qemu) dejacfg=rtems-i386-qemu ;;
255    lm32-lm32_evr)        dejacfg=rtems-lm32-lm32_evr ;;
256    m32c-m32csim)         dejacfg=rtems-m32c-m32csim ;;
257    m32r-m32rsim)         dejacfg=rtems-m32r-m32rsim ;;
258    m68k-uC5282)          dejacfg=rtems-m68k-uC5282 ;;
259    mips-jmr3904)         dejacfg=rtems-mips-jmr3904 ;;
260    powerpc-psim)         dejacfg=rtems-powerpc-psim ;;
261    sh-simsh1)            dejacfg=rtems-sh-simsh1 ;;
262    sparc-sis)            dejacfg=rtems-sparc-sis ;;
263    *)
264      echo "ERROR ${bsp} is not known to DegaGNU"
265      exit 1
266      ;;
267  esac
268
269  if [ ! -r ${DEJADIR}/${dejacfg}.exp ] ; then
270    echo "Missing DejaGNU file for ${cpu}/${bsp}"
271    exit 1
272  fi
273fi
274######### END OF Consistency check installation of source
275
276######### Log Directory
277if [ ! -d ${LOGDIR} ] ; then
278  mkdir ${LOGDIR}
279fi
280#########
281
282######### Install binutils
283j_binutils()
284{
285  test -d ${INSTALL} || mkdir -p ${INSTALL}
286
287  cd ${INSTALL}/..
288 
289  case ${do_binutils_method} in
290    rpm)
291      if [ ! -r /opt/rtems-${RTEMS_VERSION}/bin/${TARGET}-as ] ; then
292         echo "Binutils RPMs not installed"
293         exit 0
294      fi
295
296      echo "Extracting binutils from installed RPMs"
297      DIR=`pwd`
298      mkdir tmp-unrpm
299      cd tmp-unrpm
300      cd /
301      for cpu in $*
302      do
303        pkg=`rpm -qf /opt/rtems-${RTEMS_VERSION}/bin/${TARGET}-as`
304        rpm -ql $pkg | cpio -pvdum ${DIR}/tmp-unrpm
305      done
306      cd ${DIR}/tmp-unrpm/opt/rtems-${RTEMS_VERSION}
307      find . | cpio -pdum ${INSTALL}
308      cd ${DIR}
309      rm -rf tmp-unrpm
310      ;;
311    source)
312      echo "Building Binutils from source"
313      rm -rf b-binutils-${cpu}
314      mkdir b-binutils-${cpu}
315      cd b-binutils-${cpu}
316      (${BINUTILSDIR}/configure --target=${TARGET} --prefix=$INSTALL \
317        --disable-werror && \
318        make ${MAKEJOBS} && make install) >${LOGDIR}/${cpu}-binutils.log 2>&1
319      if [ $? -ne 0 ] ; then
320        echo "Failed to build Binutils from source"
321        exit 1
322      fi
323      echo "Checking Binutils "
324      make check >${LOGDIR}/${cpu}-binutils-check.log 2>&1
325      grep ^FAIL ${LOGDIR}/${cpu}-binutils-check.log
326      cd ..
327      test ${do_cleanup} = "yes" && rm -rf b-binutils-${cpu}
328      ;;
329    *)
330      echo "Where do I get the binutils from?"
331      exit 1
332      ;;
333  esac
334}
335
336if [ ${do_binutils} = yes ] ; then
337  echo "Building binutils..."
338  j_binutils ${cpu}
339fi
340
341######### Install gdb
342j_gdb()
343{
344  test -d ${INSTALL} || mkdir -p ${INSTALL}
345
346  cd ${INSTALL}/..
347
348  case ${cpu} in
349    mips) GDBTARGET=${cpu}tx39-rtems${RTEMS_VERSION} ;;
350    *)    GDBTARGET=${TARGET} ;;
351  esac
352
353  case ${do_gdb_method} in
354    rpm)
355      if [ ! -r /opt/rtems-${RTEMS_VERSION}/bin/${GDBTARGET}-gdb ] ; then
356         echo "Binutils RPMs not installed"
357         exit 0
358      fi
359
360      echo "Extracting gdb from installed RPMs"
361      DIR=`pwd`
362      mkdir tmp-unrpm
363      cd tmp-unrpm
364      cd /
365      for cpu in $*
366      do
367        pkg=`rpm -qf /opt/rtems-${RTEMS_VERSION}/bin/${GDBTARGET}-gdb`
368        rpm -ql $pkg | cpio -pvdum ${DIR}/tmp-unrpm
369      done
370      cd ${DIR}/tmp-unrpm/opt/rtems-${RTEMS_VERSION}
371      find . | cpio -pdum ${INSTALL}
372      cd ${DIR}
373      rm -rf tmp-unrpm
374      ;;
375    source)
376      echo "Building GDB from source"
377      cd ${BASEDIR}
378      rm -rf b-gdb-${cpu}
379      mkdir b-gdb-${cpu}
380      cd b-gdb-${cpu}
381      (${GDBDIR}/configure --target=${GDBTARGET} \
382        --enable-sim --enable-sim-hardware \
383        --disable-werror \
384        --enable-timebase --enable-sim-trace  --prefix=$INSTALL && \
385        make ${MAKEJOBS} && make install) >${LOGDIR}/${cpu}-gdb.log 2>&1
386      if [ $? -ne 0 ] ; then
387        echo "Failed to build gdb from source"
388        exit 1
389      fi
390      cd ..
391      test ${do_cleanup} = "yes" && rm -rf b-gdb-${cpu}
392      ;;
393    *)
394      echo "Where do I get the gdb from?"
395      exit 1
396      ;;
397  esac
398}
399
400if [ ${do_gdb} = yes ] ; then
401  echo "Building gdb..."
402  j_gdb ${cpu}
403fi
404
405######### Build a native compiler
406j_native()
407{
408  test ${do_native_ada} = "yes" && AdaArg=",ada"
409  ${GCCDIR}/configure \
410    ${NATIVE_GCC_EXTRA_ARGS} \
411    --enable-languages=c${AdaArg} --prefix=$INSTALL &&
412  make ${MAKEJOBS} && make install
413}
414
415if [ ${do_native} = "yes" ] ; then
416  echo "Building native compiler..."
417  (cd ${BASEDIR} && \
418   rm -rf b-native && \
419   mkdir  b-native && \
420   cd b-native && \
421   time j_native >${LOGDIR}/native.log 2>&1 && cd .. ) || exit 1
422   test ${do_cleanup} = "yes" && rm -rf b-native
423else
424  echo Skipping native
425fi
426# END of build native compiler
427
428######### Build Cross C/C++ baseline compiler
429j_gcc1()
430{
431
432  if [ X${1} = X ] ; then
433    echo Usage: $0 TARGET_CPU
434    exit 1
435  fi
436
437  if [ ! -d ${INSTALL} ]; then
438    echo ${INSTALL} does not exist
439    exit 1
440  fi
441
442  if [ ${verbose} = yes ] ; then
443    echo "Cross Assembler ==>" `type ${TARGET}-as`
444  fi
445
446  if [ ${do_cxx} = yes ] ; then
447     cxx=",c++"
448  fi
449  if [ ${cpu} = avr ] ; then
450    cxx=""
451  fi
452
453  if [ ${do_multilib} = yes ] ; then
454     multilib="--enable-multilib"
455  else
456     multilib="--disable-multilib"
457  fi
458
459  ${GCCDIR}/configure \
460    ${GCC_EXTRA_ARGS} \
461   --enable-threads=rtems  --with-gnu-as ${multilib} \
462   --enable-newlib-mb --enable-newlib-iconv \
463   --with-gnu-ld --with-newlib  --verbose --with-system-zlib --disable-nls \
464    --enable-version-specific-runtime-libs \
465    --enable-languages=c${cxx} --target=$TARGET --prefix=$INSTALL
466  if [ $? -ne 0 ] ; then
467    echo "Failed to configure GCC C/C++ .. bailing"
468    exit 1
469  fi
470
471  make ${MAKEJOBS}
472  if [ $? -ne 0 ] ; then
473    echo "Failed to build GCC C/C++ .. bailing"
474    exit 1
475  fi
476
477  make install
478  if [ $? -ne 0 ] ; then
479    echo "Failed to install GCC C/C++ .. bailing"
480    exit 1
481  fi
482
483}
484
485if [ ${do_stage1} = "yes" ] ; then
486  echo "Building Stage 1 compiler (C/C++)..."
487  (cd ${BASEDIR} && \
488   rm -rf b-gcc1-${cpu} && \
489   mkdir  b-gcc1-${cpu} && \
490   cd b-gcc1-${cpu} && \
491     time j_gcc1 ${cpu} >${LOGDIR}/${cpu}-stage1.log 2>&1 && cd ..) || exit 1
492else
493  echo Skipping Stage 1 for ${cpu}
494fi
495
496#################### RTEMS
497
498j_rtems()
499{
500  cpuArg=$1
501  bspArg=$2
502  bspdir=b-${cpuArg}-${bspArg}
503
504  cd ${BASEDIR}
505  rm -rf ${bspdir}
506  mkdir  ${bspdir} || exit 1
507  cd ${bspdir}     || exit 1
508
509  ENABLE_BSP="--enable-rtemsbsp=${bspArg}"
510  case $bspArg in
511    multilib)
512      ENABLE_BSP="--enable-multilib"
513      MAKE_ARG="-k"
514      ;;
515      edb7312)    ENABLE_BSP="${ENABLE_BSP} ON_SKYEYE=1" ;;
516      gumstix)    ENABLE_BSP="${ENABLE_BSP} ON_SKYEYE=1" ;;
517    qemu|pc386)
518      ENABLE_BSP="${ENABLE_BSP} USE_COM1_AS_CONSOLE=1"
519      ENABLE_BSP="${ENABLE_BSP} BSP_PRESS_KEY_FOR_RESET=0"
520      ENABLE_BSP="${ENABLE_BSP} BSP_RESET_BOARD_AT_EXIT=0"
521      ;;
522    *) ;;
523  esac
524  case ${cpu} in
525    m32c) RTEMS_ARGS="--disable-ada --disable-posix --disable-networking" ;;
526    *)    RTEMS_ARGS="--enable-ada --enable-posix --enable-networking" ;;
527  esac
528  ${RTEMSDIR}/configure --target=${TARGET} ${ENABLE_BSP} \
529  ${RTEMS_ARGS} --enable-maintainer-mode --disable-tests \
530  --prefix=${BSP_INSTALL} && make ${MAKEJOBS} ${MAKE_ARG} && make install
531  cd ..
532}
533
534if [ ${do_rtems} = "yes" ] ; then
535  echo "Building RTEMS for ${cpu} ${bsp} ..."
536  time j_rtems ${cpu} multilib >${LOGDIR}/${cpu}-rtems-multilib.log 2>&1 || \
537    exit 1
538  time j_rtems ${cpu} ${bsp} >${LOGDIR}/${cpu}-rtems-${bsp}.log 2>&1 || \
539    exit 1
540  test ${do_cleanup} = "yes" && rm -rf b-${cpu}-${bsp} b-${cpu}-multilib
541else
542  echo Skipping RTEMS for ${cpu}/${bsp}
543fi
544pwd
545
546##### Do the gcc tests
547if [ ${run_gcctests} = "yes" ] ; then
548  echo "Running GCC Tests..."
549  cd ${BASEDIR}/b-gcc1-${cpu} || exit 1
550  time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} gcc\
551    >${LOGDIR}/${cpu}-gcctests-${bsp}.log 2>&1
552
553  RDIR=${RESULTSDIR}/${TARGET}-${bsp}/`date +%Y-%m-%d-%H-%M-%S`
554  mkdir -p ${RDIR}
555  cp gcc/testsuite/gcc/gcc.log gcc/testsuite/gcc/gcc.sum ${RDIR}
556  if [ -r gcc/testsuite/g++/g++.log ] ; then
557    cp gcc/testsuite/g++/g++.log gcc/testsuite/g++/g++.sum ${RDIR}
558  fi
559
560  if [ ${do_mail} = "yes" ] ; then
561    echo Sending test results to GCC community..
562    ${GCCDIR}/contrib/test_summary -m gcc-testresults@gcc.gnu.org | sh
563    if [ $? -ne 0 ] ; then
564      echo "Failed to email GCC Test Results to GCC Community .. bailing"
565      exit 1
566    fi
567
568    echo Sending test results to RTEMS community..
569    ${GCCDIR}/contrib/test_summary -o -m rtems-tooltestresults@rtems.org | sh
570    if [ $? -ne 0 ] ; then
571      echo "Failed to email GCC Test Results to RTEMS Community .. bailing"
572      exit 1
573    fi
574  fi
575  cd .. || exit 1
576else
577  echo Skipping GCC DejaGNU tests for ${cpu}/${bsp}
578fi
579test ${do_cleanup} = "yes" && rm -rf b-gcc1-${cpu}
580
581##### Build an Ada compiler now that we have a cross installed
582j_gccada()
583{
584  if [ X${1} = X ] ; then
585    echo Usage: $0 TARGET_CPU
586    exit 1
587  fi
588  TARGET=${1}-rtems${RTEMS_VERSION}
589
590  if [ ! -d ${INSTALL} ]; then
591    echo ${INSTALL} does not exist
592    exit 1
593  fi
594
595  if [ ${verbose} = yes ] ; then
596    echo "Cross GCC ==>" `type ${TARGET}-gcc`
597  fi
598
599  if [ ${do_ada_multilib} = yes ] ; then
600     ada_multilib="--enable-multilib"
601  else
602     ada_multilib="--disable-multilib"
603  fi
604
605#    CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/
606
607  ${GCCDIR}/configure \
608   ${GCC_EXTRA_ARGS} \
609   --enable-threads=rtems  --with-gnu-as ${ada_multilib} \
610   --enable-newlib-mb --enable-newlib-iconv \
611   --with-gnu-ld --with-newlib  --verbose --with-system-zlib --disable-nls \
612    CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/ \
613    --enable-version-specific-runtime-libs \
614    --enable-languages=c,ada --target=$TARGET --prefix=$INSTALL &&
615  make ${MAKEJOBS} &&
616  make install
617}
618
619if [ ${do_ada} = "yes" ] ; then
620  echo "Building Stage 2 cross Ada compiler for ${1} ..."
621  (cd ${BASEDIR} && \
622   rm -rf b-gccada-${cpu} && \
623   mkdir  b-gccada-${cpu} && \
624   cd b-gccada-${cpu} && \
625   time j_gccada ${cpu} >${LOGDIR}/${cpu}-ada.log 2>&1 && cd ..) || exit 1
626else
627  echo Skipping Stage 2 Ada for ${cpu}
628fi
629
630#### Run the Ada ACATS tests
631if [ ${run_acats} = "yes" -a -d b-gccada-${cpu} ] ; then
632  echo "Running ACATS..."
633  cd ${GCCDIR}/gcc/testsuite/ada/acats/ || exit 1
634
635  time ${ADASCRIPTDIR}/run_all_rtems.sh ${INSTALL} ${BSP_INSTALL} \
636    ${TARGET} ${bsp} >${LOGDIR}/${cpu}-acats-${bsp}-build.log 2>&1
637  if [ $? -eq 0 ] ; then
638    if [ -r work-${bsp}/acats.log ] ; then
639      cp work-${bsp}/acats.log ${LOGDIR}/${cpu}-acats-${bsp}.log
640    fi
641
642    if [ ${do_mail} = "yes" ] ; then
643      echo Sending ACATS test results to GCC community..
644      ${ADASCRIPTDIR}/rtems_generate_acats_email ${cpu} ${bsp} yes
645    fi
646  fi
647
648  cd ../../../../.. || exit 1
649else
650  echo Skipping ACATS for ${cpu}
651fi
652
653if [ ${do_ada} = "yes" ] ; then
654  test ${do_cleanup} = "yes" && rm -rf b-gccada-${cpu}
655fi
656
657##### Build a GCC Go compiler now that we have a cross installed
658j_gccgo()
659{
660  if [ X${1} = X ] ; then
661    echo Usage: $0 TARGET_CPU
662    exit 1
663  fi
664  TARGET=${1}-rtems${RTEMS_VERSION}
665
666  if [ ! -d ${INSTALL} ]; then
667    echo ${INSTALL} does not exist
668    exit 1
669  fi
670
671  if [ ${verbose} = yes ] ; then
672    echo "Cross GCC ==>" `type ${TARGET}-gcc`
673  fi
674
675  if [ ${do_gccgo_multilib} = yes ] ; then
676     gccgo_multilib="--enable-multilib"
677  else
678     gccgo_multilib="--disable-multilib"
679  fi
680
681  case ${TARGET} in
682    i386*) GOFLAGS="-march=i486" ;;
683    *)     GOFLAGS="" ;;
684  esac
685#    CFLAGS_FOR_TARGET=-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/
686
687  ${GCCDIR}/configure \
688   ${GCC_EXTRA_ARGS} \
689   CFLAGS_FOR_TARGET="-B${BSP_INSTALL}/${TARGET}/${BSP_BUILT}/lib/ ${GOFLAGS}" \
690     --enable-threads=rtems --with-gnu-as ${gccgo_multilib} \
691     --enable-newlib-mb --enable-newlib-iconv \
692     --with-gnu-ld --with-newlib  --verbose --with-system-zlib --disable-nls \
693     --enable-version-specific-runtime-libs \
694    --enable-languages=c,go --target=$TARGET --prefix=$INSTALL &&
695  make ${MAKEJOBS} &&
696  make install
697}
698
699if [ ${do_gccgo} = "yes" ] ; then
700  echo "Building Stage 2 cross GCC Go compiler for ${1} ..."
701  (cd ${BASEDIR} && \
702   rm -rf b-gccgo1-${cpu} && \
703   mkdir  b-gccgo1-${cpu} && \
704   cd b-gccgo1-${cpu} && \
705   time j_gccgo ${cpu} >${LOGDIR}/${cpu}-go.log 2>&1 && cd ..) || exit 1
706else
707  echo Skipping GCC Go for ${cpu}
708fi
709
710##### Do the gccgo tests
711if [ ${run_gccgotests} = "yes" ] ; then
712  echo "Running GCC Go Tests..."
713  cd ${BASEDIR}/b-gccgo1-${cpu}/gcc || exit 1
714  time sh -x ${SCRIPTDIR}/gcc/rundeja ${bsp} gccgo \
715    >${LOGDIR}/${cpu}-gccgotests-${bsp}.log 2>&1
716
717  RDIR=${RESULTSDIR}/${TARGET}-${bsp}/`date +%Y-%m-%d-%H-%M-%S`
718  mkdir -p ${RDIR}
719  cp testsuite/go/go.log testsuite/go/go.sum ${RDIR}
720
721  if [ ${do_mail} = "yes" ] ; then
722    echo Sending test results to GCC community..
723    ${DIR}/contrib/test_summary -m gcc-testresults@gcc.gnu.org | sh
724    if [ $? -ne 0 ] ; then
725      echo "Failed to email GCC Test Results to GCC Community .. bailing"
726      exit 1
727    fi
728
729    echo Sending test results to RTEMS community..
730    ${GCCDIR}/contrib/test_summary -o -m rtems-tooltestresults@rtems.org | sh
731    if [ $? -ne 0 ] ; then
732      echo "Failed to email GCC Test Results to RTEMS Community .. bailing"
733      exit 1
734    fi
735  fi
736  cd .. || exit 1
737else
738  echo Skipping GCC Go DejaGNU tests for ${cpu}/${bsp}
739fi
740
741if [ ${do_gccgo} = "yes" ] ; then
742  test ${do_cleanup} = "yes" && rm -rf b-gccgo1-${cpu}
743fi
744exit 0
Note: See TracBrowser for help on using the repository browser.