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

Last change on this file since 6221 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
RevLine 
[896]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@"
[1018]12srcdir        = "@srcdir@"
13install       = "@INSTALL@"
14shlib_cflags  = "@SHLIB_CFLAGS@"
15shlib_ldflags  = "@SHLIB_LDFLAGS@"
[896]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"]
[1081]26rb_archdir    = Config::CONFIG["archdir"]
[896]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
[1018]43f = File.new("Makefile.ruby", "w")
[896]44f.printf("\n")
[1018]45f.printf("srcdir        = #{srcdir}\n")
46f.printf("incdir        = $(RAPPTURE_DIR)/include\n")
47f.printf("archdir       = #{rb_archdir}\n")
[896]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")
[1018]55f.printf("SITE_DIR      = $(RAPPTURE_DIR)/lib/ruby/ruby_site\n\n")
[896]56f.printf("CXX           = #{cxx}\n")
[1018]57f.printf("CFLAGS        = #{cxxflags}\n")
[896]58f.printf("CXX_DLFLAGS   = #{cxx_dlflags}\n")
[1018]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")
[896]62f.printf("EXCEPTIONS    = #{exceptions}\n\n")
[1018]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")
[896]73f.close
74 
75##############################################################################
76# Build the extension
77
[1018]78#`make extension`
[896]79#`make install`
80
Note: See TracBrowser for help on using the repository browser.