Ticket #3743: cross-build-tools-yasm.diff

File cross-build-tools-yasm.diff, 4.7 KB (added by umccullough, 12 years ago)

patch to add yasm to cross-tools creation

  • build/jam/OptionalPackageDependencies

     
    22
    33OptionalPackageDependencies APR-util : APR ;
    44OptionalPackageDependencies BeHappy : BeBook NetSurf ;
    5 OptionalPackageDependencies Development : Perl ;
     5OptionalPackageDependencies Development : Perl Yasm ;
    66OptionalPackageDependencies LibLayout : Development ;
    77OptionalPackageDependencies NetSurf : OpenSSL ;
    88OptionalPackageDependencies OpenSSH : OpenSSL ;
  • build/jam/MainBuildRules

     
    175175actions AssembleNasm
    176176{
    177177    if test $(ASFLAGS) ; then
    178         yasm -d $(ASFLAGS) -f elf32 -o $(1) $(2);
     178        $(HAIKU_YASM) -d $(ASFLAGS) -f elf32 -o $(1) $(2);
    179179    else
    180         yasm -f elf32 -o $(1) $(2);
     180        $(HAIKU_YASM) -f elf32 -o $(1) $(2);
    181181    fi
    182182}
    183183
  • build/scripts/build_cross_tools

     
    5050# create the object and installation directories for the cross compilation tools
    5151installDir=$haikuOutputDir/cross-tools
    5252objDir=$haikuOutputDir/cross-tools-build
     53yasmObjDir=$objDir/yasm
    5354binutilsObjDir=$objDir/binutils
    5455gccObjDir=$objDir/gcc
    5556tmpIncludeDir=$objDir/sysincludes
     
    5758
    5859rm -rf $installDir $objDir
    5960
    60 mkdir -p $installDir $objDir $binutilsObjDir $gccObjDir $tmpIncludeDir \
    61     $tmpLibDir || exit 1
     61mkdir -p $installDir $objDir $yasmObjDir $binutilsObjDir $gccObjDir \
     62    $tmpIncludeDir $tmpLibDir || exit 1
    6263mkdir -p $installDir/lib/gcc-lib/i586-pc-haiku/$haikuRequiredLegacyGCCVersion
    6364
     65# build yasm
     66cd $yasmObjDir
     67$buildToolsDir/../yasm/configure --prefix=$installDir \
     68    --program-prefix=i586-pc-haiku- || exit 1
     69make || exit 1
     70make install || exit 1
     71
    6472# build binutils
    6573cd $binutilsObjDir
    6674CFLAGS="-O2" CXXFLAGS="-O2" $buildToolsDir/binutils/configure \
  • build/scripts/build_cross_tools_gcc4

     
    5757cd $haikuOutputDir
    5858haikuOutputDir=$(pwd)
    5959
     60yasmSourceDir=$buildToolsDir/yasm
     61
    6062binutilsSourceDir=$buildToolsDir/binutils
    6163gccSourceDir=$buildToolsDir/gcc
    6264
     
    7375# create the object and installation directories for the cross compilation tools
    7476installDir=$haikuOutputDir/cross-tools
    7577objDir=$haikuOutputDir/cross-tools-build
     78yasmObjDir=$objDir/yasm
    7679binutilsObjDir=$objDir/binutils
    7780gccObjDir=$objDir/gcc
    7881tmpIncludeDir=$objDir/sysincludes
     
    8083
    8184rm -rf $installDir $objDir
    8285
    83 mkdir -p $installDir $objDir $binutilsObjDir $gccObjDir $tmpIncludeDir \
    84     $tmpLibDir || exit 1
     86mkdir -p $installDir $objDir $yasmObjDir $binutilsObjDir $gccObjDir \
     87    $tmpIncludeDir $tmpLibDir || exit 1
    8588mkdir -p $installDir/lib/gcc/$haikuMachine/$gccVersion
    8689
     90# build yasm
     91cd $yasmObjDir
     92$yasmSourceDir/configure --prefix=$installDir \
     93    --program-prefix=$haikuMachine-
     94$MAKE || exit 1
     95$MAKE install || exit 1
    8796
    8897# build binutils
    8998cd $binutilsObjDir
  • configure

     
    7575  HAIKU_LD                    The linker. Defaults to "ld".
    7676  HAIKU_OBJCOPY               The objcopy to be used. Defaults to "objcopy".
    7777  HAIKU_RANLIB                The static library indexer. Defaults to "ranlib".
     78  HAIKU_YASM                  The yasm assembler. Defaults to "yasm".
    7879  HAIKU_CPPFLAGS              The preprocessor flags. Defaults to "".
    7980  HAIKU_CCFLAGS               The C flags. Defaults to "".
    8081  HAIKU_CXXFLAGS              The C++ flags. Defaults to "".
     
    279280set_default_value HAIKU_LD          ld
    280281set_default_value HAIKU_OBJCOPY     objcopy
    281282set_default_value HAIKU_RANLIB      ranlib
     283set_default_value HAIKU_YASM        yasm
    282284set_default_value HAIKU_CPPFLAGS    ""
    283285set_default_value HAIKU_CCFLAGS     ""
    284286set_default_value HAIKU_CXXFLAGS    ""
     
    403405    get_build_tool_path LD ld
    404406    get_build_tool_path OBJCOPY objcopy
    405407    get_build_tool_path RANLIB ranlib
     408    get_build_tool_path YASM yasm
    406409fi
    407410
    408411# prepare gcc settings
     
    457460HAIKU_LD                    ?= ${HAIKU_LD} ;
    458461HAIKU_OBJCOPY               ?= ${HAIKU_OBJCOPY} ;
    459462HAIKU_RANLIB                ?= ${HAIKU_RANLIB} ;
     463HAIKU_YASM              ?= ${HAIKU_YASM} ;
    460464HAIKU_CPPFLAGS              ?= ${HAIKU_CPPFLAGS} ;
    461465HAIKU_CCFLAGS               ?= ${HAIKU_CCFLAGS} ;
    462466HAIKU_CXXFLAGS              ?= ${HAIKU_CXXFLAGS} ;