From: razvanm Date: Sat, 14 Nov 2009 06:51:21 +0000 (+0000) Subject: Fix for null platform for Snow Leopard (10.6). X-Git-Tag: rc_6_tinyos_2_1_1~137 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=8aee3e65d2935dbf9d89074360ea21a2d6764929 Fix for null platform for Snow Leopard (10.6). --- diff --git a/support/make/null/null.rules b/support/make/null/null.rules index 58632258..6514cec5 100644 --- a/support/make/null/null.rules +++ b/support/make/null/null.rules @@ -10,6 +10,7 @@ define NULL_HELP endef HELP += $(NULL_HELP) +export GCC=gcc OBJCOPY = objcopy OBJDUMP = objdump NCC = ncc @@ -23,7 +24,7 @@ INSTALL_SREC = $(MAIN_SREC).out$(if $(NODEID),-$(NODEID),) VOLUMEFILE = volumes-at45db.xml VOLUME_ALLOCATOR ?= tos-storage-at45db -PFLAGS += -Wall -Wshadow $(NESC_FLAGS) +PFLAGS += -Wall -Wshadow -fnesc-gcc=$(GCC) $(NESC_FLAGS) PFLAGS += -target=$(PLATFORM) -fnesc-cfile=$(BUILDDIR)/app.c ifdef MSG_SIZE PFLAGS += -DTOSH_DATA_LENGTH=$(MSG_SIZE) @@ -31,6 +32,11 @@ endif ifdef DEFAULT_LOCAL_GROUP PFLAGS += -DDEFINED_TOS_AM_GROUP=$(DEFAULT_LOCAL_GROUP) endif +ifeq ($(findstring Darwin, $(shell uname)), Darwin) + CFLAGS += -D_FORTIFY_SOURCE=0 + OBJCOPY = /usr/bin/true + OBJDUMP = /usr/bin/true +endif BUILDLESS_DEPS += bytes @@ -69,5 +75,5 @@ builddir: FORCE mkdir -p $(BUILDDIR) bytes: FORCE - @objdump -h $(MAIN_EXE) | perl -ne '$$b{$$1}=hex $$2 if /^\s*\d+\s*\.(text|data|bss)\s+(\S+)/; END { printf("%16d bytes in ROM\n%16d bytes in RAM\n",$$b{text}+$$b{data},$$b{data}+$$b{bss}); }' + @$(OBJDUMP) -h $(MAIN_EXE) | perl -ne '$$b{$$1}=hex $$2 if /^\s*\d+\s*\.(text|data|bss)\s+(\S+)/; END { printf("%16d bytes in ROM\n%16d bytes in RAM\n",$$b{text}+$$b{data},$$b{data}+$$b{bss}); }' diff --git a/tos/platforms/null/.platform b/tos/platforms/null/.platform index 9ae17389..c9e8dc3b 100644 --- a/tos/platforms/null/.platform +++ b/tos/platforms/null/.platform @@ -14,10 +14,14 @@ push( @includes, qw( @opts = qw( - -gcc=gcc -fnesc-target=pc -fnesc-no-debug ); +if (defined($ENV{"GCC"})) { + push @opts, "-gcc=$ENV{'GCC'}"; +} else { + push @opts, "-gcc=gcc"; +} push @opts, "-fnesc-scheduler=TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask" if !$with_scheduler_flag;