source: trunk/lang/ruby/build.rb.in @ 3280

Last change on this file since 3280 was 1081, checked in by gah, 16 years ago

fix for perl, ruby bindings; visviewer SendBytes? method sends all data at once

File size: 2.9 KB
Line 
1#
2# build.rb
3# Configure and build Rappture extension
4
5##############################################################################
6# The configure script should set these local configuration options.
7# These are options which Ruby would not know (e.g. Rappture, C++).
8
9rappture_dir  = "@prefix@"
10cxx           = "@CXX@"
11cxxflags      = "@CXXFLAGS@"
12srcdir        = "@srcdir@"
13install       = "@INSTALL@"
14shlib_cflags  = "@SHLIB_CFLAGS@"
15shlib_ldflags  = "@SHLIB_LDFLAGS@"
16
17##############################################################################
18# Get the remaining configuration options from the Config module, created
19# during the Ruby installation process.
20
21require 'rbconfig'
22
23objext        = Config::CONFIG["OBJEXT"]
24dlext         = Config::CONFIG["DLEXT"]
25rubydir       = Config::CONFIG["prefix"]
26rb_archdir    = Config::CONFIG["archdir"]
27sitedir       = Config::CONFIG["sitedir"]
28ldshared      = Config::CONFIG["LDSHARED"]
29ldflags       = Config::CONFIG["LDFLAGS"]
30libs          = Config::CONFIG["LIBS"]
31cxx_dlflags   = Config::CONFIG["CCDLFLAGS"]  # XXX This is for CC, not CXX
32
33##############################################################################
34# Values needed in Makefile
35
36source        = "Ruby_Rappture"
37target        = "Rappture"
38exceptions    = "-DRAISE_EXCEPTIONS"
39
40##############################################################################
41# Create Makefile
42
43f = File.new("Makefile.ruby", "w")
44f.printf("\n")
45f.printf("srcdir        = #{srcdir}\n")
46f.printf("incdir        = $(RAPPTURE_DIR)/include\n")
47f.printf("archdir       = #{rb_archdir}\n")
48f.printf("SOURCE        = #{source}\n")
49f.printf("TARGET        = #{target}\n\n")
50f.printf("OBJEXT        = #{objext}\n")
51f.printf("DLEXT         = #{dlext}\n\n")
52f.printf("RAPPTURE_DIR  = #{rappture_dir}\n")
53f.printf("RUBY_DIR      = #{rubydir}\n")
54f.printf("SITE_DIR      = #{sitedir}\n\n")
55f.printf("SITE_DIR      = $(RAPPTURE_DIR)/lib/ruby/ruby_site\n\n")
56f.printf("CXX           = #{cxx}\n")
57f.printf("CFLAGS        = #{cxxflags}\n")
58f.printf("CXX_DLFLAGS   = #{cxx_dlflags}\n")
59f.printf("INCLUDES      = -I$(incdir) -I#{srcdir}/../../src/core -I$(archdir)/\n")
60f.printf("INSTALL       = #{install}\n")
61f.printf("SHLIB_FLAGS   = $(CFLAGS) $(CXX_DLFLAGS) $(LDFLAGS) $(INCLUDES)\n\n")
62f.printf("EXCEPTIONS    = #{exceptions}\n\n")
63f.printf("SHLIB_LD      = #{ldshared}\n")
64f.printf("LDFLAGS       = #{ldflags}\n")
65f.printf("LIBS          = -L../../src/core -lrappture #{libs}\n\n")
66f.printf("package       = $(TARGET).$(DLEXT)\n\n")
67f.printf("all: extension\n\n")
68f.printf("extension: $(package)\n")
69f.printf("$(package): $(srcdir)/$(SOURCE).cc\n")
70f.printf("      $(SHLIB_LD) $(SHLIB_FLAGS) $(EXCEPTIONS) $< -o $@ $(LIBS)\n\n")
71f.printf("install: $(package)\n")
72f.printf("      $(INSTALL) -m 0755 $(package) $(SITE_DIR)\n\n")
73f.close
74 
75##############################################################################
76# Build the extension
77
78#`make extension`
79#`make install`
80
Note: See TracBrowser for help on using the repository browser.