Changeset a2d7c41 in rtems


Ignore:
Timestamp:
08/21/06 22:29:53 (17 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
d5423d83
Parents:
a94075b
Message:

Move the build to host tools out of the target root,

File:
1 edited

Legend:

Unmodified
Added
Removed
  • contrib/mingw/build-rpms.sh

    ra94075b ra2d7c41  
    3333base_tool_list="binutils gcc"
    3434
    35 target_list="i386 m68k powerpc sparc arm mips"
     35target_list="arm avr h8300 i386 m68k mips powerpc sh sparc tic4x"
    3636host_list="cygwin freebsd5.2 freebsd6.0 freebsd6.1 mingw32"
    3737
    3838rtems_tool_list="$base_tool_list"
    39 linux_tool_list="$base_tool_list"
    40 cygwin_tool_list="w32api libs $base_tool_list"
    41 freebsd_tool_list="libs $base_tool_list"
    42 mingw32_tool_list="w32api libs $base_tool_list"
     39linux_tool_list="autoconf automake $base_tool_list"
     40cygwin_tool_list="w32api libs autoconf automake $base_tool_list"
     41freebsd_tool_list="libs autoconf automake $base_tool_list"
     42mingw32_tool_list="w32api libs autoconf automake $base_tool_list"
    4343
    4444cygwin_cc_name="pc"
     
    5353rpm_topdir=$(rpm --eval "%{_topdir}")
    5454
    55 prefix=/opt/rtems
     55prefix=/opt/rtems-$version
    5656hosts=$host_list
    5757build=$processor-linux-gnu
     
    252252rpm_arch()
    253253{
    254   if [ $(echo $1 | sed 's/.*api.*/yes/') = yes ]; then
    255    echo "noarch"
    256   elif [ $(echo $1 | sed 's/.*lib.*/yes/') = yes ]; then
    257    echo "noarch"
    258   else
    259    echo $2
    260   fi
     254 if [ $(echo $1 | sed 's/.*api.*/yes/') = yes ]; then
     255  echo "noarch"
     256 elif [ $(echo $1 | sed 's/.*lib.*/yes/') = yes ]; then
     257  echo "noarch"
     258 elif [ $(echo $1 | sed 's/.*auto.*/yes/') = yes ]; then
     259  echo "noarch"
     260 else
     261  echo $2
     262 fi
    261263}
    262264
     
    277279$make
    278280check "building the rpm spec files failed"
    279 
    280 for t in $targets;
     281echo "make -C autotools"
     282$make -C autotools
     283check "building the rpm spec files failed"
     284
     285for h in $hosts;
    281286do
    282  for h in $hosts;
     287 #
     288 # Need to translate the build host to an RTEMS host. Create a
     289 # target host (th) and specs directory (sd) variable to handle
     290 # the use of RTEMS.
     291 #
     292 if [ $h = "linux" ]; then
     293  th="linux-gnu"
     294  sd=rtems$version
     295  canadian_cross=no
     296 else
     297  th=$h
     298  sd=$h
     299  canadian_cross=yes
     300 fi
     301
     302 #
     303 # Associate the host to its tool list to get the packages to build.
     304 #
     305 tl=${h}_tool_list
     306 pl=${h}_cpu_list
     307
     308 echo "Native Host Tools: ${!tl} for ${!pl}"
     309 echo "Canadian Cross: $canadian_cross ($t $h)"
     310
     311 for p in ${!pl}
    283312 do
    284   #
    285   # Need to translate the build host to an RTEMS host. Create a
    286   # target host (th) and specs directory (sd) variable to handle
    287   # the use of RTEMS.
    288   #
    289   if [ $h = "linux" ]; then
    290    th="linux-gnu"
    291    sd=rtems$version
    292    canadian_cross=no
    293   else
    294    th=$h
    295    sd=$h
    296    canadian_cross=yes
     313  pth="$p-pc-$th"
     314
     315  if [ $canadian_cross = yes ]; then
     316   echo "make -C $sd/$p"
     317   $make -C $sd/$p
     318   check "building the rpm spec files failed: $sd/$p"
     319
     320   for s in ${!tl}
     321   do
     322    case $s in
     323     autoconf|automake)
     324      # Hack around the prefix in the spec files for autotools.
     325      ba="-ba $prefix/autotools/$rpm_prefix$s-rtems.spec"
     326      ;;
     327     *)
     328      ba="-ba $prefix/$sd/$p/$rpm_prefix$pth-$s.spec"
     329    esac
     330
     331    rpmbuild_cmd="$ba --target=$build"
     332
     333    echo "rpmbuild --define '_defaultdocdir $prefix/share/doc' $rpm_database $rpmbuild_cmd"
     334    $rpmbuild --define "_defaultdocdir $prefix/share/doc" $rpm_database $rpmbuild_cmd
     335    check "building the $sd/$p/$rpm_prefix$pth-$s rpm failed"
     336
     337    rpm_installer "$rpm_database" \
     338                  $(rpm_arch $rpm_prefix$pth-$s $processor) \
     339                  $rpm_topdir/linux/RPMS \
     340                  $rpmbuild_cmd
     341   done
    297342  fi
    298 
    299   #
    300   # Associate the host to its tool list to get the packages to build.
    301   #
    302   tl=${h}_tool_list
    303   pl=${h}_cpu_list
    304 
    305   echo "Native Host Tools: ${!tl} for ${!pl}"
    306   echo "Canadian Cross: $canadian_cross ($t $h)"
    307 
    308   for p in ${!pl}
     343 done
     344
     345 for t in $targets;
     346 do
     347  for s in ${rtems_tool_list}
    309348  do
    310    pth="$p-pc-$th"
     349   rpmbuild_cmd="-ba $prefix/rtems$version/$t/$rpm_prefix$t-rtems$version-$s.spec --target=$pth"
    311350
    312351   if [ $canadian_cross = yes ]; then
    313     echo "make -C $sd/$p"
    314     $make -C $sd/$p
    315     check "building the rpm spec files failed: $sd/$p"
    316 
    317     for s in ${!tl}
    318     do
    319      rpmbuild_cmd="-ba $prefix/$sd/$p/$rpm_prefix$pth-$s.spec --target=$build"
    320 
    321      echo "rpmbuild $rpm_database $rpmbuild_cmd"
    322      $rpmbuild $rpm_database $rpmbuild_cmd
    323      check "building the $sd/$p/$rpm_prefix$pth-$s rpm failed"
    324 
    325      rpm_installer "$rpm_database" \
    326                    $(rpm_arch $rpm_prefix$pth-$s $processor) \
    327                    $rpm_topdir/linux/RPMS \
    328                    $rpmbuild_cmd
    329     done
     352    ccl=${h}_cc_name
     353    echo "rpmbuild --define '_build $processor-redhat-linux' " \
     354         "--define '_host $pth' $rpm_database $rpmbuild_cmd "
     355    $rpmbuild --define "_build $processor-redhat-linux" \
     356              --define "_host $pth" \
     357              --define "__cc $p-${!ccl}-$h-gcc" \
     358              $rpm_database $rpmbuild_cmd
     359    check "building host cross target: $rpm_prefix$t-rtems$version-$s"
     360   else
     361    echo "rpmbuild $rpm_database $rpmbuild_cmd"
     362    $rpmbuild $rpm_database $rpmbuild_cmd
     363    check "building host cross target: $rpm_prefix$t-rtems$version-$s"
     364   fi
     365
     366   if [ $canadian_cross != yes ]; then
     367    rpm_installer "$rpm_database" \
     368                  $(rpm_arch $rpm_prefix$t-rtems$version-$s $p) \
     369                  $rpm_topdir/$h/RPMS \
     370                  $rpmbuild_cmd
    330371   fi
    331 
    332    for s in ${rtems_tool_list}
    333    do
    334     rpmbuild_cmd="-ba $prefix/rtems$version/$t/$rpm_prefix$t-rtems$version-$s.spec --target=$pth"
    335 
    336     if [ $canadian_cross = yes ]; then
    337      ccl=${h}_cc_name
    338      echo "rpmbuild --define '_build $processor-redhat-linux' --define '_host $pth' $rpm_database $rpmbuild_cmd"
    339      $rpmbuild --define "_build $processor-redhat-linux" \
    340                --define "_host $pth" \
    341                --define "__cc $p-${!ccl}-$h-gcc" \
    342                $rpm_database $rpmbuild_cmd
    343      check "building host cross target: $rpm_prefix$t-rtems$version-$s"
    344     else
    345      echo "rpmbuild $rpm_database $rpmbuild_cmd"
    346      $rpmbuild $rpm_database $rpmbuild_cmd
    347      check "building host cross target: $rpm_prefix$t-rtems$version-$s"
    348     fi
    349 
    350     if [ $canadian_cross != yes ]; then
    351      rpm_installer "$rpm_database" \
    352                    $(rpm_arch $rpm_prefix$t-rtems$version-$s $p) \
    353                    $rpm_topdir/$h/RPMS \
    354                    $rpmbuild_cmd
    355     fi
    356    done
    357372  done
    358373 done
Note: See TracChangeset for help on using the changeset viewer.