[Gridflow-cvs] [svn] commit: r3404 - in /trunk: Makefile configure rubyext.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Wed Apr 2 17:09:43 EDT 2008


Author: matju
Date: Wed Apr  2 17:09:42 2008
New Revision: 3404

Log:
merged gridflow.so into gridflow.pd_linux; however, it breaks ./configure's --lite, for mysterious reasons.

Modified:
    trunk/Makefile
    trunk/configure
    trunk/rubyext.c

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Wed Apr  2 17:09:42 2008
@@ -22,20 +22,30 @@
 	CFLAGS += -O2 -funroll-loops
 endif
 
-BRIDGE_LDFLAGS += $(LIBRUBYARG) $(LIBS)
-
-
+LDSOFLAGS += -lm
+BRIDGE_LDFLAGS += -lm $(LIBRUBYARG) $(LIBS)
 OBJS2 = base/main.o base/grid.o base/bitpacking.o base/flow_objects.o \
 base/number.1.o base/number.2.o base/number.3.o base/number.4.o format/main.o
+SYSTEM = $(shell uname -s | sed -e 's/^MINGW.*/NT/')
+FILT = $(RUBY) -w base/source_filter.rb
+ifeq ($(OS),darwin)
+  PDSUF = .pd_darwin
+  PDBUNDLEFLAGS = -bundle -flat_namespace -undefined suppress
+else
+  ifeq ($(OS),nt)
+    PDSUF = .dll
+    PDBUNDLEFLAGS = -shared
+  else
+    PDSUF = .pd_linux
+    PDBUNDLEFLAGS = -shared -rdynamic
+  endif
+endif
+PD_LIB = gridflow$(PDSUF)
 
-SYSTEM = $(shell uname -s | sed -e 's/^MINGW.*/NT/')
-DLLIB = gridflow.$(DLEXT)
-FILT = $(RUBY) -w base/source_filter.rb
-
-all:: $(DLLIB) gridflow-for-puredata
+all:: $(PD_LIB) deprecated
 
 clean::
-	@-$(RM) $(DLLIB) gridflow.pd_linux *.o */*.o *.so
+	@-$(RM) gridflow.pd_linux *.o */*.o *.so
 	rm -f $(OBJS2) $(OBJS) base/*.fcs format/*.fcs optional/*.fcs
 
 .SUFFIXES:
@@ -66,10 +76,6 @@
 %.e: %.c.fcs $(COMMON_DEPS) base/grid.h.fcs
 	$(CXX) $(CFLAGS) -E $< -o $@
 
-$(DLLIB): $(OBJS2) $(OBJS)
-	@-$(RM) $@
-	$(LDSHARED) $(LIBPATH) -o $@ $(OBJS2) $(OBJS) $(LDSOFLAGS)
-
 .PRECIOUS: %.h.fcs %.c.fcs %.m.fcs
 
 base/mmx.asm base/mmx_loader.c: base/mmx.rb
@@ -80,32 +86,9 @@
 unskew::
 	find . -mtime -0 -ls -exec touch '{}' ';'
 
-ifeq ($(OS),darwin)
-  PDSUF = .pd_darwin
-  PDBUNDLEFLAGS = -bundle -flat_namespace -undefined suppress
-else
-  ifeq ($(OS),nt)
-    PDSUF = .dll
-    PDBUNDLEFLAGS = -shared
-  else
-    PDSUF = .pd_linux
-    PDBUNDLEFLAGS = -shared -rdynamic
-  endif
-endif
-
-ifeq ($(HAVE_PUREDATA),yes)
-PD_LIB = gridflow$(PDSUF)
-
-$(PD_LIB): rubyext.c.fcs base/grid.h gridflow2.h $(COMMON_DEPS)
-	$(CXX) -DPDSUF=\"$(PDSUF)\" -Ibundled/pd $(LDSOFLAGS) $(BRIDGE_LDFLAGS) $(CFLAGS) $(PDBUNDLEFLAGS) \
-		$< -xnone -o $@
-
-gridflow-for-puredata:: $(PD_LIB) deprecated
-
-else
-gridflow-for-puredata::
-	@#nothing
-endif # HAVE_PUREDATA
+$(PD_LIB): rubyext.c.fcs $(OBJS2) $(OBJS) base/grid.h gridflow2.h $(COMMON_DEPS)
+	$(CXX) -DPDSUF=\"$(PDSUF)\" -Ibundled/pd $(LDSOFLAGS) $(BRIDGE_LDFLAGS) $(CFLAGS) $(PDBUNDLEFLAGS) $(LIBPATH) \
+		rubyext.c.fcs -xnone $(OBJS2) $(OBJS) -o $@
 
 beep::
 	@for z in 1 2 3 4 5; do echo -ne '\a'; sleep 1; done

Modified: trunk/configure
==============================================================================
--- trunk/configure (original)
+++ trunk/configure Wed Apr  2 17:09:42 2008
@@ -24,7 +24,6 @@
 require "rbconfig"
 require "ftools"
 $CFLAGS  = ""
-$LDFLAGS = ""
 include Config
 OSX = !!( CONFIG["arch"] =~ /darwin/ )
 
@@ -73,8 +72,7 @@
 end
 
 $conf={
-	:LDSOFLAGS => ["-lm"],
-	:BRIDGE_LDFLAGS => ["-lm"],
+	:LDSOFLAGS => [],
 	:FEATURES => {},
 	:OPTIONS => [],
 	:DEFINES => {
@@ -118,7 +116,6 @@
 	attr2 :name
 	attr2 :status
 	attr2 :uses_so
-	attr2 :uses_bridge_so
 	attr2 :uses_o
 	attr2 :uses_h
 	attr2 :uses_feature
@@ -323,17 +320,16 @@
 Feature.add {
 	tag :libruby
 	name "Ruby as a dynamic library"
-	#uses_bridge_so [CONFIG["LIBRUBY_DLDFLAGS"]]
 	#uses_h ["ruby.h"] # is in special directory
 	test proc {|f| c_test "#include <ruby.h>
-		int main () { return rb_rescue==0; }", f.uses_bridge_so }
+		int main () { return rb_rescue==0; }", f.uses_so }
 }
 Feature.add {
 	tag :librubystatic
 	unless_feature [:libruby]
 	name "Ruby as a static library"
 	#uses_h ["ruby.h"] # is in special directory
-	uses_bridge_so {
+	uses_so {
 		lib = " #{$LIBRUBY_A} #{CONFIG['LIBS']} "
 			lib = "-Wl,--whole-archive"+lib+"-Wl,--no-whole-archive" unless OSX
 		[lib]
@@ -803,12 +799,6 @@
 }
 
 def try feature
-	if Or===feature.uses_bridge_so
-		k=1; feature.uses_bridge_so.a.each {|i|
-			e=feature.dup; e.uses_bridge_so i; e.name(e.name+" (try \##{k})")
-			r=try e; k+=1; return r if r }
-		return false
-	end
 	if Proc===feature.uses_so then feature.uses_so(feature.uses_so[]) end
 	if Or===feature.uses_so
 		k=1; feature.uses_so.a.each {|i|
@@ -860,9 +850,6 @@
 				feature.uses_so.map! {|x|
 					"-Wl,--whole-archive #{x} -Wl,--no-whole-archive"
 				} if feature.uses_so
-				feature.uses_bridge_so.map! {|x|
-					"-Wl,--whole-archive #{x} -Wl,--no-whole-archive"
-				} if feature.uses_bridge_so
 			end
 		else
 			DUAL.puts Red+arrow+"missing "+(if e
@@ -884,7 +871,6 @@
 	feature.action.call if feature.action
 	$conf[:FEATURES][feature.tag] = feature
 	$conf[:LDSOFLAGS].concat(feature.uses_so||[])
-	$conf[:BRIDGE_LDFLAGS].concat(feature.uses_bridge_so||[])
 	$conf[:OBJS].concat(feature.uses_o||[])
 	$conf[:OPTIONS].concat(feature.options||[])
 	for k,v in feature.defines||{} do
@@ -906,8 +892,6 @@
 puts Light
 
 $conf[:LDSOFLAGS].uniq!
-$conf[:BRIDGE_LDFLAGS].uniq!
-
 $CFLAGS += " -falign-functions=16" if $conf[:FEATURES][:gcc3]
 
 if not $conf[:FEATURES][:gcc3]
@@ -923,7 +907,7 @@
 #--------------------------------#
 
 LOG.puts "-"*64
-for z in [:BRIDGE_LDFLAGS, :LDSOFLAGS, :OPTIONS, :DEFINES, :OBJS] do
+for z in [:LDSOFLAGS, :OPTIONS, :DEFINES, :OBJS] do
   LOG.puts "#{z}: #{$conf[z].inspect}"
 end
 LOG.puts "-"*64
@@ -959,8 +943,6 @@
 File.open("./config.make","w") {|f|
 
   f.puts "RUBYARCH=#{CONFIG['arch']}"
-  f.puts "BRIDGE_LDFLAGS = " + $conf[:BRIDGE_LDFLAGS].flatten.join(" ") + " " + $LDFLAGS
-
   $CFLAGS +=  " -mcpu=$(CPU)" if $conf[:DEFINES][:CPU] and $conf[:DEFINES][:GCC_VERSION] <  "4"
   $CFLAGS += " -mtune=$(CPU)" if $conf[:DEFINES][:CPU] and $conf[:DEFINES][:GCC_VERSION] >= "4"
   $CFLAGS += " -march=$(CPU)" if $conf[:DEFINES][:CPU]

Modified: trunk/rubyext.c
==============================================================================
--- trunk/rubyext.c (original)
+++ trunk/rubyext.c Wed Apr  2 17:09:42 2008
@@ -940,13 +940,8 @@
 	mGridFlow2 = EVAL("module GridFlow; class<<self; end; Pd=GridFlow; self end");
 	rb_const_set(mGridFlow2,SI(DIR),rb_str_new2(dirresult));
 	post("DIR = %s",rb_str_ptr(EVAL("GridFlow::DIR.inspect")));
-	EVAL("$:.unshift GridFlow::DIR+'/..', GridFlow::DIR, GridFlow::DIR+'/optional/rblti'");
-	if (!EVAL("begin require 'gridflow'; true; rescue Exception => e; "
-		"STDERR.puts \"[#{e.class}] [#{e.message}]:\n#{e.backtrace.join'\n'}\"; false; end"))
-	{
-		post("ERROR: Cannot load GridFlow-for-Ruby (gridflow.so)\n");
-		return;
-	}
+	EVAL("$:.unshift GridFlow::DIR+'/..', GridFlow::DIR");
+	Init_gridflow();
 	bindpatcher = class_new(gensym("bindpatcher"), (t_newmethod)bindpatcher_init, 0, sizeof(t_object),CLASS_DEFAULT,A_GIMME,0);
 	delete[] dirresult;
 	delete[] dirname;



More information about the Gridflow-cvs mailing list