Changeset 72eb02e in rtems for contrib/mingw/build-rpms.sh


Ignore:
Timestamp:
08/07/06 07:02:41 (16 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
b7c9b29
Parents:
61e5a32
Message:

Updated to handle a different build processor to a i686.

File:
1 edited

Legend:

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

    r61e5a32 r72eb02e  
    3737
    3838rtems_tool_list="$base_tool_list"
     39linux_tool_list="$base_tool_list"
    3940cygwin_tool_list="w32api libs $base_tool_list"
    4041freebsd_tool_list="libs $base_tool_list"
     
    4546mingw32_cc_name="pc"
    4647
     48linux_cpu_list="$processor"
    4749cygwin_cpu_list="i686"
    4850freebsd_cpu_list="i586"
     
    156158 else
    157159  echo "Creating $(pwd)"
    158   $mkdir $prefix
     160  $mkdir -p $prefix
    159161  check "making the prefix directory: $prefix"
    160162 fi
     
    265267hosts="linux $hosts"
    266268
    267 echo "Configuring host:$h($th) target:$t-rtems$version"
     269echo "Configuring target: all"
    268270echo "configure --prefix=$prefix $rpm_prefix_arg " \
    269271     " --target=all $infos"
     
    288290   th="linux-gnu"
    289291   sd=rtems$version
     292   canadian_cross=no
    290293  else
    291294   th=$h
    292295   sd=$h
    293   fi
    294 
    295   th="$processor-pc-$th"
    296 
    297   if [ $(echo $th | sed -e "s/.*linux.*/yes/") = yes ]; then
    298    canadian_cross=no
    299   else
    300296   canadian_cross=yes
    301297  fi
    302298
    303   echo "Canadian Cross: $canadian_cross"
    304 
    305   if [ $canadian_cross = yes ]; then
    306    #
    307    # Associate the host to its tool list to get the packages to build.
    308    #
    309    tl=${h}_tool_list
    310    pl=${h}_cpu_list
    311 
    312    echo "Native Host Tools: ${!tl} for ${!pl}"
    313 
    314    echo "make -C $sd/$p"
    315    $make -C $sd/$p
    316    check "building the rpm spec files failed: $sd/$p"
    317 
    318    for p in ${!pl}
    319    do
     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}
     309  do
     310   pth="$p-pc-$th"
     311
     312   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
    320317    for s in ${!tl}
    321318    do
    322      rpmbuild_cmd="-ba $prefix/$sd/$p/$rpm_prefix$th-$s.spec --target=$build"
     319     rpmbuild_cmd="-ba $prefix/$sd/$p/$rpm_prefix$pth-$s.spec --target=$build"
    323320
    324321     echo "rpmbuild $rpm_database $rpmbuild_cmd"
    325322     $rpmbuild $rpm_database $rpmbuild_cmd
    326      check "building the $sd/$p/$rpm_prefix$th-$s rpm failed"
     323     check "building the $sd/$p/$rpm_prefix$pth-$s rpm failed"
    327324
    328325     rpm_installer "$rpm_database" \
    329                    $(rpm_arch $rpm_prefix$th-$s $processor) \
     326                   $(rpm_arch $rpm_prefix$pth-$s $processor) \
    330327                   $rpm_topdir/linux/RPMS \
    331328                   $rpmbuild_cmd
    332329    done
     330   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
    333356   done
    334   fi
    335 
    336   for s in ${rtems_tool_list}
    337   do
    338    rpmbuild_cmd="-ba $prefix/rtems$version/$t/$rpm_prefix$t-rtems$version-$s.spec --target=$th"
    339 
    340    if [ $canadian_cross = yes ]; then
    341     ccl=${h}_cc_name
    342     echo "rpmbuild --define '_build i686-redhat-linux' --define '_host $th' $rpm_database $rpmbuild_cmd"
    343     $rpmbuild --define "_build i686-redhat-linux" \
    344               --define "_host $th" \
    345               --define "__cc $processor-${!ccl}-$h-gcc" \
    346               $rpm_database $rpmbuild_cmd
    347     check "building host cross target: $rpm_prefix$t-rtems$version-$s"
    348    else
    349     echo "rpmbuild $rpm_database $rpmbuild_cmd"
    350     $rpmbuild $rpm_database $rpmbuild_cmd
    351     check "building host cross target: $rpm_prefix$t-rtems$version-$s"
    352    fi
    353 
    354    if [ $canadian_cross != yes ]; then
    355     rpm_installer "$rpm_database" \
    356                   $(rpm_arch $rpm_prefix$t-rtems$version-$s $processor) \
    357                   $rpm_topdir/$h/RPMS \
    358                   $rpmbuild_cmd
    359    fi
    360357  done
    361358 done
Note: See TracChangeset for help on using the changeset viewer.