[GRASS-SVN] r42479 - in grass/trunk/lib/python/ctypes: . ctypesgencore/parser

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jun 4 00:43:40 EDT 2010


Author: glynn
Date: 2010-06-04 00:43:38 -0400 (Fri, 04 Jun 2010)
New Revision: 42479

Modified:
   grass/trunk/lib/python/ctypes/Makefile
   grass/trunk/lib/python/ctypes/ctypesgencore/parser/preprocessor.py
Log:
Add necessary -I switches to ctypesgen command
Undefine __BLOCKS__ on OSX


Modified: grass/trunk/lib/python/ctypes/Makefile
===================================================================
--- grass/trunk/lib/python/ctypes/Makefile	2010-06-03 19:51:29 UTC (rev 42478)
+++ grass/trunk/lib/python/ctypes/Makefile	2010-06-04 04:43:38 UTC (rev 42479)
@@ -30,24 +30,28 @@
 ogsf_LIBS       = $(OGSFLIB)
 nviz_LIBS       = $(NVIZLIB)
 
-date_INC        = datetime.h P_datetime.h
-grass_INC       = gis.h gisdefs.h
-raster_INC      = raster.h rasterdefs.h
-gmath_INC       = gmath.h
-proj_INC        = gprojects.h
-imagery_INC     = imagery.h imagedefs.h
-vector_INC      = vector.h vect/dig_structs.h vect/dig_defines.h
-display_INC     = display.h
-stats_INC       = stats.h
-dbmi_INC        = dbmi.h
-g3d_INC         = G3d.h
-arraystats_INC  = arraystats.h
-cluster_INC     = cluster.h
-trans_INC       = transform.h
-vedit_INC       = vedit.h
-ogsf_INC	= ogsf_proto.h gstypes.h gsurf.h kftypes.h keyframe.h
-nviz_INC        = nviz.h
+date_HDRS       = datetime.h P_datetime.h
+grass_HDRS      = gis.h gisdefs.h
+raster_HDRS     = raster.h rasterdefs.h
+gmath_HDRS      = gmath.h
+proj_HDRS       = gprojects.h
+imagery_HDRS    = imagery.h imagedefs.h
+vector_HDRS     = vector.h vect/dig_structs.h vect/dig_defines.h
+display_HDRS    = display.h
+stats_HDRS      = stats.h
+dbmi_HDRS       = dbmi.h
+g3d_HDRS        = G3d.h
+arraystats_HDRS = arraystats.h
+cluster_HDRS    = cluster.h
+trans_HDRS      = transform.h
+vedit_HDRS      = vedit.h
+ogsf_HDRS       = ogsf_proto.h gstypes.h gsurf.h kftypes.h keyframe.h
+nviz_HDRS       = nviz.h
 
+proj_INC        = $(PROJINC)
+vector_INC      = $(VECT_INC)
+vedit_INC       = $(VECT_INC)
+
 SED = sed
 CTYPESGEN = ./ctypesgen.py
 CTYPESFLAGS = $(INC)
@@ -86,8 +90,8 @@
 $(DSTDIR)/ctypes_%.py: %.py | $(DSTDIR)
 	$(INSTALL_DATA) $< $@
 
-%.py: $(%_INC) $(%_LIBS)
-	$(call run_grass,$(CTYPESGEN) $(CTYPESFLAGS) $($*_LIBS) $(EXTRA_LIBS) $(patsubst %.h,$(ARCH_INCDIR)/%.h,$($*_INC)) -o $@)
+%.py: $(%_HDRS) $(%_LIBS)
+	$(call run_grass,$(CTYPESGEN) $(CTYPESFLAGS) $($*_LIBS) $($*_FLAGS) $(EXTRA_LIBS) $(patsubst %.h,$(ARCH_INCDIR)/%.h,$($*_HDRS)) -o $@)
 
 $(PYDIR):
 	$(MKDIR) $@

Modified: grass/trunk/lib/python/ctypes/ctypesgencore/parser/preprocessor.py
===================================================================
--- grass/trunk/lib/python/ctypes/ctypesgencore/parser/preprocessor.py	2010-06-03 19:51:29 UTC (rev 42478)
+++ grass/trunk/lib/python/ctypes/ctypesgencore/parser/preprocessor.py	2010-06-04 04:43:38 UTC (rev 42479)
@@ -129,7 +129,11 @@
         """Parse a file and save its output"""
         
         cmd = self.options.cpp
-        cmd += " -U __GNUC__ -dD"
+        if sys.platform == 'darwin':
+            cmd += " -U __BLOCKS__"
+        else:
+            cmd += " -U __GNUC__"
+        cmd += " -dD"
         for path in self.options.include_search_paths:
             cmd += " -I%s" % path 
         for define in self.defines:



More information about the grass-commit mailing list