[Tinyos-devel] Patch to sim-sf.extra (for darwin)

Matthias Woehrle woehrle at tik.ee.ethz.ch
Wed Jul 1 07:26:04 PDT 2009


Hi,

I encountered a problem with compiling for tossim live on the mac.  
Seems like there's a problem in the handling in the extra file (sim- 
sf.extra).
If you follow the handling from regular tossim (sim.extra) it works  
just fine. Below is the patch (particular section from sim.extra to  
apply to sim-sf.extra).

Index: sim-sf.extra
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/support/make/sim-sf.extra,v
retrieving revision 1.1
diff -u -r1.1 sim-sf.extra
--- sim-sf.extra        3 Oct 2007 02:09:59 -0000       1.1
+++ sim-sf.extra        1 Jul 2009 13:56:51 -0000
@@ -81,12 +81,11 @@
   PLATFORM_BUILD_FLAGS= -fpic -W1,--enabled-auto-image-base
   PLATFORM_LIB_FLAGS =-shared -L/usr/lib/python$(PYTHON_VERSION)/ 
config -L/$(PYDIR)/config -lstdc++ -
lpython$(PYTHON_VERSION)
else
-ifeq ($(findstring darwin, $(OSTYPE)), darwin)
-  PLATFORM_FLAGS=-fPIC
-  PLATFORM_CC_FLAGS=-bundle
-  SHARED_OBJECT=_TOSSIMmodule.so
-  PLATFORM_BUILD_FLAGS=-flat_namespace -undefined suppress
-  PLATFORM_LIB_FLAGS = -lstdc++
+ifeq ($(findstring darwin, $(OSTYPE)), darwin)
+  SIM_DARWIN=TRUE
+else
+ifeq ($(findstring Darwin, $(shell uname)), Darwin)
+  SIM_DARWIN = TRUE
else # linux
   PLATFORM_FLAGS=-shared -fPIC
   SHARED_OBJECT=_TOSSIMmodule.so
@@ -95,6 +94,14 @@
endif
endif
endif
+endif
+ifdef SIM_DARWIN
+  PLATFORM_FLAGS=-fPIC
+  PLATFORM_CC_FLAGS=-bundle
+  SHARED_OBJECT=_TOSSIMmodule.so
+  PLATFORM_BUILD_FLAGS=-flat_namespace -undefined suppress
+  PLATFORM_LIB_FLAGS = -lstdc++
+endif

BUILD_DEPS = sim-exe


--matthias


More information about the Tinyos-devel mailing list