[Gridflow-cvs] [svn] commit: r6554 - in /trunk: Makefile configure

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Sat Feb 5 18:38:16 EST 2011


Author: matju
Date: Sat Feb  5 18:38:15 2011
New Revision: 6554

Log:
split LDSOFLAGS in smaller pieces for use by individual .pd_linux files

Modified:
    trunk/Makefile
    trunk/configure

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Sat Feb  5 18:38:15 2011
@@ -4,8 +4,8 @@
 # dlltool -D /c/Program\ Files/pd/extra/Gem/Gem.dll -d Gem.def -l libGem.a
 
 include config.make
-#COMMON_DEPS = config.make Makefile src/source_filter.rb
-#COMMON_DEPS2 = $(COMMON_DEPS) src/gridflow.hxx.fcs
+COMMON_DEPS = config.make Makefile src/source_filter.rb
+COMMON_DEPS2 = $(COMMON_DEPS) src/gridflow.hxx.fcs
 RUBY = ruby
 
 SHELL = /bin/sh
@@ -41,10 +41,10 @@
     CFLAGS += -mms-bitfields
   else
     PDSUF = .pd_linux
-    PDBUNDLEFLAGS = -shared -rdynamic
+    LDSOFLAGS = -shared -rdynamic
     ifeq ($(HAVE_GCC64),yes)
       CFLAGS += -fPIC
-      PDBUNDLEFLAGS += -fPIC
+      LDSOFLAGS += -fPIC
     endif
   endif
 endif
@@ -94,22 +94,22 @@
 
 PDLIB1 = gridflow$(PDSUF)
 $(PDLIB1): $(OBJS2) $(OBJS) $(COMMON_DEPS2)
-	$(CXX) -DPDSUF=\"$(PDSUF)\" $(CFLAGS) -xnone $(OBJS2) $(OBJS) $(LDSOFLAGS) -o $@
+	$(CXX) -DPDSUF=\"$(PDSUF)\" $(CFLAGS) -xnone  -o $@ $(OBJS2) $(OBJS) $(LDSOFLAGS) $(LDSO_main)
 
 gridflow_gem_loader$(PDSUF): src/gem_loader.cxx.fcs $(COMMON_DEPS2)
-	$(CXX) $(CFLAGS)                               -o $@ -xc++ src/gem_loader.cxx.fcs $(LDSOFLAGS) $(GEMFLAGS)
+	$(CXX) $(CFLAGS)                               -o $@ -xc++ src/gem_loader.cxx.fcs $(LDSOFLAGS) $(LDSO_gem_loader)
 gridflow_gem9292$(PDSUF):    src/gem.cxx.fcs        $(COMMON_DEPS2)
-	$(CXX) $(CFLAGS)                               -o $@ -xc++ src/gem.cxx.fcs        $(LDSOFLAGS) $(GEMFLAGS)
+	$(CXX) $(CFLAGS)                               -o $@ -xc++ src/gem.cxx.fcs        $(LDSOFLAGS) $(LDSO_gem_loader)
 gridflow_gem9293$(PDSUF):    src/gem.cxx.fcs        $(COMMON_DEPS2)
-	$(CXX) $(CFLAGS) -DGEMSTATE93                 -o $@ -xc++ src/gem.cxx.fcs         $(LDSOFLAGS) $(GEMFLAGS)
+	$(CXX) $(CFLAGS) -DGEMSTATE93                 -o $@ -xc++ src/gem.cxx.fcs         $(LDSOFLAGS) $(LDSO_gem_loader)
 gridflow_gem9393$(PDSUF):    src/gem.cxx.fcs        $(COMMON_DEPS2)
-	$(CXX) $(CFLAGS) -DGEMSTATE93 -DIMAGESTRUCT93 -o $@ -xc++ src/gem.cxx.fcs         $(LDSOFLAGS) $(GEMFLAGS)
+	$(CXX) $(CFLAGS) -DGEMSTATE93 -DIMAGESTRUCT93 -o $@ -xc++ src/gem.cxx.fcs         $(LDSOFLAGS) $(LDSO_gem_loader)
 gridflow_pdp$(PDSUF):        src/pdp.cxx.fcs        $(COMMON_DEPS2)
-	$(CXX) $(CFLAGS)                              -o $@ -xc++ src/pdp.cxx.fcs         $(LDSOFLAGS)
+	$(CXX) $(CFLAGS)                              -o $@ -xc++ src/pdp.cxx.fcs         $(LDSOFLAGS) $(LDSO_pdp)
 gridflow_unicorn$(PDSUF):    src/unicorn.cxx.fcs    $(COMMON_DEPS2)
-	$(CXX) $(CFLAGS)                              -o $@ -xc++ src/unicorn.cxx.fcs     $(LDSOFLAGS)
+	$(CXX) $(CFLAGS)                              -o $@ -xc++ src/unicorn.cxx.fcs     $(LDSOFLAGS) $(LDSO_unicorn)
 gridflow_x11$(PDSUF):        src/x11.cxx.fcs        $(COMMON_DEPS2)
-	$(CXX) $(CFLAGS)                              -o $@ -xc++ src/x11.cxx.fcs         $(LDSOFLAGS)
+	$(CXX) $(CFLAGS)                              -o $@ -xc++ src/x11.cxx.fcs         $(LDSOFLAGS) $(LDSO_x11)
 
 beep::
 	@for z in 1 2 3 4 5; do echo -ne '\a'; sleep 1; done

Modified: trunk/configure
==============================================================================
--- trunk/configure (original)
+++ trunk/configure Sat Feb  5 18:38:15 2011
@@ -86,7 +86,8 @@
 OPTIONS = []
 DEFINES = {:CPU => nil}
 OBJS = []
-PDLIB = ["gridflow","gridflow_unicorn"]
+PDLIB = ["unicorn"]
+LDSO = {}
 
 def launch stdin,stdout,stderr,*command # -> returncode
 	child = fork
@@ -116,8 +117,8 @@
 	end
 	attr2 :tag
 	attr2 :name
+	attr2 :produces_pdlib
 	attr2 :status
-	attr2 :produces_pdlib
 	attr2 :uses_so
 	attr2 :produces_o
 	attr2 :uses_h
@@ -326,7 +327,7 @@
 	uses_so LIBX11
 	uses_h ["X11/Xlib.h"]
 	#produces_o ["src/x11.o"]
-	produces_pdlib ["gridflow_x11"]
+	produces_pdlib ["x11"]
 	test proc {c_test "
 		#include#
 		int main () {return XSetErrorHandler==0;}"}}
@@ -335,6 +336,7 @@
 	name "X11 acceleration by shared memory (XSHM plugin)"
 	uses_feature [:x11]
 	uses_so LIBX11+["-lXext"]
+	produces_pdlib ["x11"]
 	uses_h ["X11/Xlib.h","sys/shm.h","X11/extensions/XShm.h"]
 	options ["HAVE_X11_SHARED_MEMORY"]
 	test proc {c_test "
@@ -436,7 +438,7 @@
 	name "Video4linux I Driver Interface Library"
 	uses_h ["libv4l1.h"]
 	uses_so ["-lv4l1"]
-	defines ["HAVE_LIBV4L1"]
+	options ["HAVE_LIBV4L1"]
 	test proc {c_test "
 		#include <linux/videodev.h>
 		#include <sys/types.h>
@@ -527,7 +529,7 @@
 	tag :opengl
 	name "OpenGL/GLEW (for GEM support and [gf/gl])"
 	produces_o ["src/opengl.o"]
-	produces_pdlib ["gridflow_gem_loader","gridflow_gem9292","gridflow_gem9293","gridflow_gem9393"]
+	produces_pdlib ["gem_loader","gem9292","gem9293","gem9393"]
         uses_so LIBX11DIR+["-lGLEW"] if not WIN
 	uses_so ["-lglu32","-lopengl32","-lglew32"] if WIN
         uses_h ["GL/glew.h"]
@@ -683,10 +685,12 @@
 	end
 	feature.action.call if feature.action
 	FEATURES[feature.tag] = feature
-	LDSOFLAGS.concat(feature.uses_so||[]).uniq! # if not feature.produces_pdlib
+	category = "main"
+	category = feature.produces_pdlib[0] if feature.produces_pdlib
+	(LDSO[category]||=[]).concat(feature.uses_so||[]).uniq!
 	OPTIONS.concat(feature.options||[])
 	OBJS.concat(feature.produces_o    ||[])
-	PDLIB.concat(feature.produces_pdlib||[])
+	PDLIB.concat(feature.produces_pdlib||[]).uniq!
 	for k,v in feature.defines||{} do DEFINES[k]=(if Proc===v then v[] else v end) end
 	true
 end
@@ -715,21 +719,24 @@
 #--------------------------------#
 
 LOG.puts "-"*64
-LOG.puts        "#{CC}: #{CC.inspect}"
-LOG.puts "#{LDSOFLAGS}: #{LDSOFLAGS.inspect}"
-LOG.puts   "#{OPTIONS}: #{OPTIONS.inspect}"
-LOG.puts   "#{DEFINES}: #{DEFINES.inspect}"
-LOG.puts      "#{OBJS}: #{OBJS.inspect}"
-LOG.puts     "#{PDLIB}: #{PDLIB.inspect}"
+LOG.puts        "$CC: #{CC.inspect}"
+LOG.puts "$LDSOFLAGS: #{LDSOFLAGS.inspect}"
+LOG.puts   "$OPTIONS: #{OPTIONS.inspect}"
+LOG.puts   "$DEFINES: #{DEFINES.inspect}"
+LOG.puts      "$OBJS: #{OBJS.inspect}"
+LOG.puts     "$PDLIB: #{PDLIB.inspect}"
+for k in LDSO.keys.sort do
+  LOG.puts "$LDSO[#{k.inspect}]: #{LDSO[k].inspect}"
+end
 LOG.puts "-"*64
 RUBY = "$(RUBY_INSTALL_NAME)"
 
 puts "generating ./config.make"
 File.open("./config.make","w") {|f|
-  CFLAGS +=  " -mcpu=$(CPU)" if DEFINES[:CPU] and DEFINES[:GCC_VERSION] <  "4"
-  CFLAGS += " -mtune=$(CPU)" if DEFINES[:CPU] and DEFINES[:GCC_VERSION] >= "4"
-  CFLAGS += " -march=$(CPU)" if DEFINES[:CPU]
-  CFLAGS += " -DMACOSX" if OSX
+  CFLAGS <<  " -mcpu=$(CPU)" if DEFINES[:CPU] and DEFINES[:GCC_VERSION] <  "4"
+  CFLAGS << " -mtune=$(CPU)" if DEFINES[:CPU] and DEFINES[:GCC_VERSION] >= "4"
+  CFLAGS << " -march=$(CPU)" if DEFINES[:CPU]
+  CFLAGS << " -DMACOSX" if OSX
   f.puts "CFLAGS += " + CFLAGS
   f.puts "LDSOFLAGS += " + LDSOFLAGS.flatten.join(" ")
   for k   in OPTIONS do f.puts "#{k}=yes" end
@@ -738,7 +745,10 @@
   f.puts "OBJS = #{OBJS.join(" ")}"
   f.puts "DLEXT = #{CONFIG['DLEXT']}"
   f.puts ""
-  f.puts "PDLIB = "+PDLIB.map{|x|x+"$(PDSUF)"}.join(" ")
+  f.puts "PDLIB = gridflow$(PDSUF) "+PDLIB.map{|x|"gridflow_#{x}$(PDSUF)"}.join(" ")
+  for k in LDSO.keys.sort do
+    f.puts "LDSO_#{k} = "+LDSO[k].join(" ") if LDSO[k]
+  end
 } # end open config.make
 
 #--------------------------------#



More information about the Gridflow-cvs mailing list