From: qwert Date: Tue, 29 Jul 2008 13:07:19 +0000 (+0000) Subject: Add specific check routine for compiling under OS X X-Git-Tag: 2.0.0~406 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=a2fc2366ad564f11e705703ed1f42b7dc499a47c;p=bertos.git Add specific check routine for compiling under OS X git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1528 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/emul/switch_i386.S b/bertos/emul/switch_i386.S index 6931d45c..6570f8e8 100644 --- a/bertos/emul/switch_i386.S +++ b/bertos/emul/switch_i386.S @@ -13,9 +13,20 @@ * \author Bernardo Innocenti */ + + +#ifdef __APPLE__ + //This workaround is necessary to compile under OS X assembler. + #define SWITCH_CONTEXT _asm_switch_context + #define SWITCH_VERSION _asm_switch_version +#else + #define SWITCH_CONTEXT asm_switch_context + #define SWITCH_VERSION asm_switch_version +#endif + /* void asm_switch_context(void ** new_sp, void ** save_sp) */ -.globl asm_switch_context -asm_switch_context: +.globl SWITCH_CONTEXT +SWITCH_CONTEXT: pushl %eax pushl %ebx pushl %ecx @@ -37,8 +48,8 @@ asm_switch_context: ret /* int asm_switch_version(void) */ -.globl asm_switch_version -asm_switch_version: +.globl SWITCH_VERSION +SWITCH_VERSION: mov $1,%eax ret diff --git a/bertos/rules.mk b/bertos/rules.mk index 583c25fc..b83049dd 100644 --- a/bertos/rules.mk +++ b/bertos/rules.mk @@ -73,6 +73,12 @@ $(1)_MAP_FLAGS = $$(MAP_FLAGS_EMB) #In embedded we need s19, hex and bin $$(OUTDIR)/$(1).tgt : $$(OUTDIR)/$(1).s19 $$(OUTDIR)/$(1).hex $$(OUTDIR)/$(1).bin else +#On Darwin architecture the assembly doesn't link correctly if this flag is setted. +ifeq ($(shell uname | grep -c "Darwin"),1) +LIST_FLAGS = "" +MAP_FLAGS = "" +LDFLAGS = "" +endif #use hosted specific map flags $(1)_MAP_FLAGS = $$(MAP_FLAGS_HOST) #in hosted application we need only executable file.