diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index 21c0a2a075..5942fccc81 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -180,6 +180,11 @@ switch $(HAIKU_CPU) { HAIKU_BOOT_PLATFORM = bios_ia32 ; # offset in floppy image (>= sizeof(haiku_loader)) HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 300 ; # in kB + + # yasm is required for target arch x86 + if ! $(HAIKU_YASM) { + Exit "HAIKU_YASM not set. Please re-run configure." ; + } } case m68k : { diff --git a/build/jam/MainBuildRules b/build/jam/MainBuildRules index 0486010394..18ba52d2f8 100644 --- a/build/jam/MainBuildRules +++ b/build/jam/MainBuildRules @@ -175,9 +175,9 @@ rule AssembleNasm actions AssembleNasm { if test $(ASFLAGS) ; then - yasm -d $(ASFLAGS) -f elf32 -o $(1) $(2); + $(HAIKU_YASM) -d $(ASFLAGS) -f elf32 -o $(1) $(2); else - yasm -f elf32 -o $(1) $(2); + $(HAIKU_YASM) -f elf32 -o $(1) $(2); fi } diff --git a/configure b/configure index f1a6709c0a..ac761b2e09 100755 --- a/configure +++ b/configure @@ -75,6 +75,7 @@ environment variables: HAIKU_LD The linker. Defaults to "ld". HAIKU_OBJCOPY The objcopy to be used. Defaults to "objcopy". HAIKU_RANLIB The static library indexer. Defaults to "ranlib". + HAIKU_YASM The yasm assembler (x86 only). HAIKU_CPPFLAGS The preprocessor flags. Defaults to "". HAIKU_CCFLAGS The C flags. Defaults to "". HAIKU_CXXFLAGS The C++ flags. Defaults to "". @@ -260,6 +261,7 @@ include3rdParty=0 enableMultiuser=0 distroCompatibility=default target=haiku +targetArch=x86 useGCCPipe=0 use32bit=0 useXattr=0 @@ -279,6 +281,7 @@ set_default_value HAIKU_CC gcc set_default_value HAIKU_LD ld set_default_value HAIKU_OBJCOPY objcopy set_default_value HAIKU_RANLIB ranlib +set_default_value HAIKU_YASM yasm set_default_value HAIKU_CPPFLAGS "" set_default_value HAIKU_CCFLAGS "" set_default_value HAIKU_CXXFLAGS "" @@ -298,10 +301,10 @@ while [ $# -gt 0 ] ; do buildCrossToolsScript="${buildCrossToolsScript}_gcc4" case "$2" in x86) haikuGCCMachine=i586-pc-haiku;; - ppc) haikuGCCMachine=powerpc-apple-haiku;; - m68k) haikuGCCMachine=m68k-unknown-haiku;; - arm) haikuGCCMachine=arm-unknown-haiku;; - mipsel) haikuGCCMachine=mipsel-unknown-haiku;; + ppc) haikuGCCMachine=powerpc-apple-haiku; targetArch=ppc;; + m68k) haikuGCCMachine=m68k-unknown-haiku; targetArch=m86k;; + arm) haikuGCCMachine=arm-unknown-haiku; targetArch=arm;; + mipsel) haikuGCCMachine=mipsel-unknown-haiku; targetArch=mips;; *) echo "Unsupported target architecture: $2" exit 1;; esac @@ -380,6 +383,30 @@ case "${platform}" in exit 1 ;; esac +# check yasm version +if [ $targetArch = "x86" ]; then + $HAIKU_YASM --version > /dev/null || { + echo "The yasm assembler version 0.7.2 or later must be installed." + echo "Download from: http://www.tortall.net/projects/yasm/wiki/Download" + exit 1 + } + + set -- $($HAIKU_YASM --version | head -n 1) + versionOK=0 + case $2 in + 0.[0-6].*) echo match1;; + 0.7.[0-1].*) echo match2;; + *) versionOK=1 ;; + esac + + if [ $versionOK = 0 ]; then + echo "The yasm assembler version 0.7.2 or later must be installed." + echo "The installed version is $2." + echo "Download from: http://www.tortall.net/projects/yasm/wiki/Download" + exit 1 + fi +fi + # create output directory if [ "$currentDir" = "$sourceDir" ]; then outputDir=$currentDir/generated @@ -458,6 +485,7 @@ HAIKU_CC ?= ${HAIKU_CC} ; HAIKU_LD ?= ${HAIKU_LD} ; HAIKU_OBJCOPY ?= ${HAIKU_OBJCOPY} ; HAIKU_RANLIB ?= ${HAIKU_RANLIB} ; +HAIKU_YASM ?= ${HAIKU_YASM} ; HAIKU_CPPFLAGS ?= ${HAIKU_CPPFLAGS} ; HAIKU_CCFLAGS ?= ${HAIKU_CCFLAGS} ; HAIKU_CXXFLAGS ?= ${HAIKU_CXXFLAGS} ;