fxruby 1.6.26-x86-mingw32 → 1.6.27-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig ADDED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 1.6.27 / 2013-04-05
2
+
3
+ * Add support for Ruby-2.0.
4
+ * Add cross compilation for x64-mingw32 target.
5
+
1
6
  === 1.6.26 / 2013-02-16
2
7
 
3
8
  * Mark all text strings retrieved from fox as UTF-8 when running on Ruby 1.9
data/Rakefile CHANGED
@@ -19,7 +19,8 @@ end
19
19
 
20
20
  # Some constants we'll need
21
21
  PKG_VERSION = Fox.fxrubyversion
22
- FXSCINTILLA_INSTALL_DIR = Pathname( "build/builds/fxscintilla-#{LIBFXSCINTILLA_VERSION}" ).expand_path
22
+ # TODO: Don't depend on cross compilation task
23
+ FXSCINTILLA_INSTALL_DIR = Pathname( CrossLibraries.first.static_libfxscintilla_builddir ).expand_path
23
24
 
24
25
  SWIG = (RUBY_PLATFORM =~ /mingw/) ? "swig-1.3.22.exe" : "swig-1.3.22"
25
26
  SWIGFLAGS = "-fcompact -noruntime -c++ -ruby -no_default -I../fox-includes"
@@ -91,14 +92,29 @@ task :test => [:compile]
91
92
 
92
93
  Rake::ExtensionTask.new("fox16_c", hoe.spec) do |ext|
93
94
  ext.cross_compile = true
94
- ext.cross_platform = ['i386-mingw32']
95
- ext.cross_config_options += [
96
- "--with-fox-include=#{STATIC_INSTALLDIR}/include/fox-1.6",
97
- "--with-fxscintilla-include=#{STATIC_INSTALLDIR}/include/fxscintilla",
98
- "--with-installed-dir=#{STATIC_INSTALLDIR}",
99
- "--enable-win32-static-build",
100
- "--with-fxscintilla",
101
- ]
95
+ ext.cross_platform = CrossLibraries.map &:ruby_platform
96
+
97
+ ext.cross_config_options += CrossLibraries.map do |lib|
98
+ {
99
+ lib.ruby_platform => [
100
+ "--with-fox-include=#{lib.static_installdir}/include/fox-1.6",
101
+ "--with-fxscintilla-include=#{lib.static_installdir}/include/fxscintilla",
102
+ "--with-installed-include=#{lib.static_installdir}/include",
103
+ "--with-installed-lib=#{lib.static_installdir}/lib",
104
+ "--enable-win32-static-build",
105
+ "--with-fxscintilla",
106
+ ]
107
+ }
108
+ end
109
+
110
+ end
111
+
112
+ CrossLibraries.each do |lib|
113
+ ENV['RUBY_CC_VERSION'].split(":").each do |ruby_version|
114
+ task "copy:fox16_c:#{lib.ruby_platform}:#{ruby_version}" do |t|
115
+ sh "#{lib.host_platform}-strip -S tmp/#{lib.ruby_platform}/stage/lib/#{ruby_version[0,3]}/fox16_c.so"
116
+ end
117
+ end
102
118
  end
103
119
 
104
120
  # Set environment variable SWIG_LIB to
data/Rakefile.cross CHANGED
@@ -9,20 +9,7 @@ require 'uri'
9
9
  require 'rbconfig'
10
10
  require 'pathname'
11
11
 
12
- ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.3'
13
-
14
- # Cross-compilation constants
15
- COMPILE_HOME = Pathname( "build" ).expand_path
16
- STATIC_SOURCESDIR = COMPILE_HOME + 'sources'
17
- STATIC_BUILDDIR = COMPILE_HOME + 'builds'
18
- STATIC_INSTALLDIR = COMPILE_HOME + 'install'
19
- RUBY_BUILD = RbConfig::CONFIG["host"]
20
- CROSS_PREFIX = begin
21
- Rake::ExtensionCompiler.mingw_host
22
- rescue => err
23
- $stderr.puts "Cross-compilation disabled -- %s" % [ err.message ]
24
- 'unknown'
25
- end
12
+ ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.3:2.0.0'
26
13
 
27
14
  NUM_CPUS = if File.exist?('/proc/cpuinfo')
28
15
  File.read('/proc/cpuinfo').scan('processor').length
@@ -32,354 +19,392 @@ else
32
19
  1
33
20
  end
34
21
 
35
-
36
- # Fetch zlib tarball
37
- LIBZ_VERSION = ENV['LIBZ_VERSION'] || '1.2.7'
38
- LIBZ_SOURCE_URI = URI( "http://downloads.sourceforge.net/project/libpng/zlib/#{LIBZ_VERSION}/zlib-#{LIBZ_VERSION}.tar.bz2" )
39
- LIBZ_TARBALL = STATIC_SOURCESDIR + File.basename( LIBZ_SOURCE_URI.path )
40
- STATIC_LIBZ_BUILDDIR = STATIC_BUILDDIR + LIBZ_TARBALL.basename(".tar.bz2")
41
- LIBZ_MAKEFILE = STATIC_LIBZ_BUILDDIR + 'Makefile'
42
- LIBZ_A = STATIC_INSTALLDIR + 'lib' + 'libz.a'
43
-
44
- # Fetch libpng tarball
45
- LIBPNG_VERSION = ENV['LIBPNG_VERSION'] || '1.5.13'
46
- LIBPNG_SOURCE_URI = URI( "http://prdownloads.sourceforge.net/libpng/libpng-#{LIBPNG_VERSION}.tar.gz?download" )
47
- LIBPNG_TARBALL = STATIC_SOURCESDIR + File.basename( LIBPNG_SOURCE_URI.path )
48
- STATIC_LIBPNG_BUILDDIR = STATIC_BUILDDIR + LIBPNG_TARBALL.basename(".tar.gz")
49
- LIBPNG_MAKEFILE = STATIC_LIBPNG_BUILDDIR + 'Makefile'
50
- LIBPNG_A = STATIC_INSTALLDIR + 'lib' + 'libpng.a'
51
-
52
-
53
- # Fetch libjpeg tarball
54
- LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '8d'
55
- LIBJPEG_SOURCE_URI = URI( "http://www.ijg.org/files/jpegsrc.v#{LIBJPEG_VERSION}.tar.gz" )
56
- LIBJPEG_TARBALL = STATIC_SOURCESDIR + File.basename( LIBJPEG_SOURCE_URI.path )
57
- STATIC_LIBJPEG_BUILDDIR = STATIC_BUILDDIR + "jpeg-#{LIBJPEG_VERSION}"
58
- LIBJPEG_MAKEFILE = STATIC_LIBJPEG_BUILDDIR + 'Makefile'
59
- LIBJPEG_A = STATIC_INSTALLDIR + 'lib' + 'libjpeg.a'
60
-
61
-
62
- # Fetch libtiff tarball
63
- LIBTIFF_VERSION = ENV['LIBTIFF_VERSION'] || '4.0.3'
64
- LIBTIFF_SOURCE_URI = URI( "http://download.osgeo.org/libtiff/tiff-#{LIBTIFF_VERSION}.tar.gz" )
65
- LIBTIFF_TARBALL = STATIC_SOURCESDIR + File.basename( LIBTIFF_SOURCE_URI.path )
66
- STATIC_LIBTIFF_BUILDDIR = STATIC_BUILDDIR + LIBTIFF_TARBALL.basename(".tar.gz")
67
- LIBTIFF_MAKEFILE = STATIC_LIBTIFF_BUILDDIR + 'Makefile'
68
- LIBTIFF_A = STATIC_INSTALLDIR + 'lib' + 'libtiff.a'
69
-
70
-
71
- # Fetch libfox tarball
72
- LIBFOX_VERSION = ENV['LIBFOX_VERSION'] || '1.6.47'
73
- LIBFOX_SOURCE_URI = URI( "http://ftp.fox-toolkit.org/pub/fox-#{LIBFOX_VERSION}.tar.gz" )
74
- LIBFOX_TARBALL = STATIC_SOURCESDIR + File.basename( LIBFOX_SOURCE_URI.path )
75
- STATIC_LIBFOX_BUILDDIR = STATIC_BUILDDIR + LIBFOX_TARBALL.basename(".tar.gz")
76
- LIBFOX_MAKEFILE = STATIC_LIBFOX_BUILDDIR + 'Makefile'
77
- LIBFOX_A = STATIC_INSTALLDIR + 'lib' + 'libfox.a'
78
-
79
- # Fetch fxscintilla tarball
80
- LIBFXSCINTILLA_VERSION = ENV['LIBFXSCINTILLA_VERSION'] || '2.28.0'
81
- LIBFXSCINTILLA_SOURCE_URI = URI( "http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-#{LIBFXSCINTILLA_VERSION}.tar.gz" )
82
- LIBFXSCINTILLA_TARBALL = STATIC_SOURCESDIR + File.basename( LIBFXSCINTILLA_SOURCE_URI.path )
83
- STATIC_LIBFXSCINTILLA_BUILDDIR = STATIC_BUILDDIR + LIBFXSCINTILLA_TARBALL.basename(".tar.gz")
84
- LIBFXSCINTILLA_MAKEFILE = STATIC_LIBFXSCINTILLA_BUILDDIR + 'Makefile'
85
- LIBFXSCINTILLA_A = STATIC_INSTALLDIR + 'lib' + 'libfxscintilla.a'
86
-
87
-
88
-
89
- # clean intermediate files and folders
90
- CLEAN.include( STATIC_BUILDDIR.to_s )
91
-
92
- #####################################################################
93
- ### C R O S S - C O M P I L A T I O N - T A S K S
94
- #####################################################################
95
-
96
- directory STATIC_SOURCESDIR.to_s
97
-
98
- #
99
- # Static libz build tasks
100
- #
101
- directory STATIC_LIBZ_BUILDDIR.to_s
102
-
103
- # libz source file should be stored there
104
- file LIBZ_TARBALL => STATIC_SOURCESDIR do |t|
105
- # download the source file using wget or curl
106
- chdir File.dirname(t.name) do
107
- sh "wget '#{LIBZ_SOURCE_URI}' -O #{LIBZ_TARBALL}"
108
- end
109
- end
110
-
111
- # Extract the libz builds
112
- file STATIC_LIBZ_BUILDDIR => LIBZ_TARBALL do |t|
113
- sh 'tar', '-xjf', LIBZ_TARBALL.to_s, '-C', STATIC_LIBZ_BUILDDIR.parent.to_s
114
- rm LIBZ_MAKEFILE
115
- end
116
-
117
- LIBZ_ENV = [
118
- "CC=#{CROSS_PREFIX}-gcc",
119
- "AR=#{CROSS_PREFIX}-ar",
120
- "RANLIB=#{CROSS_PREFIX}-ranlib",
121
- ]
122
-
123
- # generate the makefile in a clean build location
124
- file LIBZ_MAKEFILE => [STATIC_LIBZ_BUILDDIR] do |t|
125
- chdir( STATIC_LIBZ_BUILDDIR ) do
126
- options = [
127
- "--prefix=#{STATIC_INSTALLDIR}",
22
+ class CrossLibrary < OpenStruct
23
+ include Rake::DSL
24
+
25
+ def initialize(ruby_platform)
26
+ super()
27
+
28
+ self.ruby_platform = ruby_platform
29
+
30
+ # Cross-compilation constants
31
+ self.compile_home = Pathname( "build" ).expand_path
32
+ self.static_sourcesdir = compile_home + 'sources'
33
+ self.static_builddir = compile_home + 'builds' + ruby_platform
34
+ self.static_installdir = compile_home + 'install' + ruby_platform
35
+ self.ruby_build = RbConfig::CONFIG["host"]
36
+
37
+ # Use rake-compilers config.yml to determine the toolchain that was used
38
+ # to build Ruby for this platform.
39
+ self.host_platform = begin
40
+ config_file = YAML.load_file(File.expand_path("~/.rake-compiler/config.yml"))
41
+ _, rbfile = config_file.find{|key, fname| key.start_with?("rbconfig-#{ruby_platform}-") }
42
+ IO.read(rbfile).match(/CONFIG\["host"\] = "(.*)"/)[1]
43
+ rescue
44
+ nil
45
+ end
46
+
47
+ # Fetch zlib tarball
48
+ self.libz_version = ENV['libz_version'] || '1.2.7'
49
+ self.libz_source_uri = URI( "http://downloads.sourceforge.net/project/libpng/zlib/#{libz_version}/zlib-#{libz_version}.tar.bz2" )
50
+ self.libz_tarball = static_sourcesdir + File.basename( libz_source_uri.path )
51
+ self.static_libz_builddir = static_builddir + libz_tarball.basename(".tar.bz2")
52
+ self.libz_makefile = static_libz_builddir + 'Makefile'
53
+ self.libz_a = static_libz_builddir + 'libz.a'
54
+
55
+ # Fetch libpng tarball
56
+ self.libpng_version = ENV['libpng_version'] || '1.5.13'
57
+ self.libpng_source_uri = URI( "http://prdownloads.sourceforge.net/libpng/libpng-#{libpng_version}.tar.gz?download" )
58
+ self.libpng_tarball = static_sourcesdir + File.basename( libpng_source_uri.path )
59
+ self.static_libpng_builddir = static_builddir + libpng_tarball.basename(".tar.gz")
60
+ self.libpng_makefile = static_libpng_builddir + 'Makefile'
61
+ self.libpng_a = static_libpng_builddir + '.libs' + 'libpng15.a'
62
+
63
+
64
+ # Fetch libjpeg tarball
65
+ self.libjpeg_version = ENV['libjpeg_version'] || '8d'
66
+ self.libjpeg_source_uri = URI( "http://www.ijg.org/files/jpegsrc.v#{libjpeg_version}.tar.gz" )
67
+ self.libjpeg_tarball = static_sourcesdir + File.basename( libjpeg_source_uri.path )
68
+ self.static_libjpeg_builddir = static_builddir + "jpeg-#{libjpeg_version}"
69
+ self.libjpeg_makefile = static_libjpeg_builddir + 'Makefile'
70
+ self.libjpeg_a = static_libjpeg_builddir + '.libs' + 'libjpeg.a'
71
+
72
+
73
+ # Fetch libtiff tarball
74
+ self.libtiff_version = ENV['libtiff_version'] || '4.0.3'
75
+ self.libtiff_source_uri = URI( "http://download.osgeo.org/libtiff/tiff-#{libtiff_version}.tar.gz" )
76
+ self.libtiff_tarball = static_sourcesdir + File.basename( libtiff_source_uri.path )
77
+ self.static_libtiff_builddir = static_builddir + libtiff_tarball.basename(".tar.gz")
78
+ self.libtiff_makefile = static_libtiff_builddir + 'Makefile'
79
+ self.libtiff_a = static_libtiff_builddir + 'libtiff' + '.libs' + 'libtiff.a'
80
+
81
+
82
+ # Fetch libfox tarball
83
+ self.libfox_version = ENV['libfox_version'] || '1.6.47'
84
+ self.libfox_source_uri = URI( "http://ftp.fox-toolkit.org/pub/fox-#{libfox_version}.tar.gz" )
85
+ self.libfox_tarball = static_sourcesdir + File.basename( libfox_source_uri.path )
86
+ self.static_libfox_builddir = static_builddir + libfox_tarball.basename(".tar.gz")
87
+ self.libfox_makefile = static_libfox_builddir + 'Makefile'
88
+ self.libfox_a = static_libfox_builddir + 'src' + '.libs' + 'libFOX-1.6.a'
89
+
90
+ # Fetch fxscintilla tarball
91
+ self.libfxscintilla_version = ENV['libfxscintilla_version'] || '2.28.0'
92
+ self.libfxscintilla_source_uri = URI( "http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-#{libfxscintilla_version}.tar.gz" )
93
+ self.libfxscintilla_tarball = static_sourcesdir + File.basename( libfxscintilla_source_uri.path )
94
+ self.static_libfxscintilla_builddir = static_builddir + libfxscintilla_tarball.basename(".tar.gz")
95
+ self.libfxscintilla_makefile = static_libfxscintilla_builddir + 'Makefile'
96
+ self.libfxscintilla_a = static_libfxscintilla_builddir + 'fox' + '.libs' + 'libfxscintilla.a'
97
+
98
+
99
+
100
+ # clean intermediate files and folders
101
+ CLEAN.include( static_builddir.to_s )
102
+
103
+ #####################################################################
104
+ ### C R O S S - C O M P I L A T I O N - T A S K S
105
+ #####################################################################
106
+
107
+ directory static_sourcesdir.to_s
108
+
109
+ #
110
+ # Static libz build tasks
111
+ #
112
+ directory static_libz_builddir.to_s
113
+
114
+ # libz source file should be stored there
115
+ file libz_tarball => static_sourcesdir do |t|
116
+ # download the source file using wget or curl
117
+ chdir File.dirname(t.name) do
118
+ sh "wget '#{libz_source_uri}' -O #{libz_tarball}"
119
+ end
120
+ end
121
+
122
+ # Extract the libz builds
123
+ file static_libz_builddir => libz_tarball do |t|
124
+ sh 'tar', '-xjf', libz_tarball.to_s, '-C', static_libz_builddir.parent.to_s
125
+ rm libz_makefile
126
+ end
127
+
128
+ self.libz_env = [
129
+ "CC=#{host_platform}-gcc",
130
+ "AR=#{host_platform}-ar",
131
+ "RANLIB=#{host_platform}-ranlib",
128
132
  ]
129
133
 
130
- configure_path = STATIC_LIBZ_BUILDDIR + 'configure'
131
- sh "env #{[LIBZ_ENV, configure_path.to_s, *options].join(" ")}"
132
- end
133
- end
134
-
135
- # generate the makefile in a clean build location
136
- task LIBZ_A => LIBZ_MAKEFILE do |t|
137
- chdir( STATIC_LIBZ_BUILDDIR ) do
138
- sh "make -j#{NUM_CPUS} install 'LDSHAREDLIBC=-lmsvcrt'"
139
- end
140
- end
141
-
142
- #
143
- # Static libpng build tasks
144
- #
145
- directory STATIC_LIBPNG_BUILDDIR.to_s
146
-
147
- # libpng source file should be stored there
148
- file LIBPNG_TARBALL => STATIC_SOURCESDIR do |t|
149
- # download the source file using wget or curl
150
- chdir File.dirname(t.name) do
151
- sh "wget '#{LIBPNG_SOURCE_URI}' -O #{LIBPNG_TARBALL}"
152
- end
153
- end
154
-
155
- # Extract the libpng builds
156
- file STATIC_LIBPNG_BUILDDIR => LIBPNG_TARBALL do |t|
157
- sh 'tar', '-xzf', LIBPNG_TARBALL.to_s, '-C', STATIC_LIBPNG_BUILDDIR.parent.to_s
158
- end
159
-
160
- LIBPNG_ENV = [
161
- "'CPPFLAGS=-I#{STATIC_INSTALLDIR}/include'",
162
- "'LDFLAGS=-L#{STATIC_INSTALLDIR}/lib'",
163
- ]
164
- # generate the makefile in a clean build location
165
- file LIBPNG_MAKEFILE => [STATIC_LIBPNG_BUILDDIR, LIBZ_A] do |t|
166
- chdir( STATIC_LIBPNG_BUILDDIR ) do
167
- options = [
168
- "--target=#{CROSS_PREFIX}",
169
- "--host=#{CROSS_PREFIX}",
170
- "--build=#{RUBY_BUILD}",
171
- "--prefix=#{STATIC_INSTALLDIR}",
172
- "--disable-shared",
134
+ # generate the makefile in a clean build location
135
+ file libz_makefile => [static_libz_builddir] do |t|
136
+ chdir( static_libz_builddir ) do
137
+ options = [
138
+ "--prefix=#{static_installdir}",
139
+ ]
140
+
141
+ configure_path = static_libz_builddir + 'configure'
142
+ sh "env #{[libz_env, configure_path.to_s, *options].join(" ")}"
143
+ end
144
+ end
145
+
146
+ # generate the makefile in a clean build location
147
+ task libz_a => libz_makefile do |t|
148
+ chdir( static_libz_builddir ) do
149
+ sh "make -j#{NUM_CPUS} install 'LDSHAREDLIBC=-lmsvcrt'"
150
+ end
151
+ end
152
+
153
+ #
154
+ # Static libpng build tasks
155
+ #
156
+ directory static_libpng_builddir.to_s
157
+
158
+ # libpng source file should be stored there
159
+ file libpng_tarball => static_sourcesdir do |t|
160
+ # download the source file using wget or curl
161
+ chdir File.dirname(t.name) do
162
+ sh "wget '#{libpng_source_uri}' -O #{libpng_tarball}"
163
+ end
164
+ end
165
+
166
+ # Extract the libpng builds
167
+ file static_libpng_builddir => libpng_tarball do |t|
168
+ sh 'tar', '-xzf', libpng_tarball.to_s, '-C', static_libpng_builddir.parent.to_s
169
+ end
170
+
171
+ self.libpng_env = [
172
+ # Use build directory instead of install, to avoid unnecessary rebuilds of libpng
173
+ "'CPPFLAGS=-I#{static_libz_builddir}'",
174
+ "'LDFLAGS=-L#{static_libz_builddir}'",
173
175
  ]
174
-
175
- configure_path = STATIC_LIBPNG_BUILDDIR + 'configure'
176
- sh "env #{[LIBPNG_ENV, configure_path.to_s, *options].join(" ")}"
177
- end
178
- end
179
-
180
- # generate the makefile in a clean build location
181
- task LIBPNG_A => [LIBPNG_MAKEFILE, LIBZ_A] do |t|
182
- chdir( STATIC_LIBPNG_BUILDDIR ) do
183
- sh "make -j#{NUM_CPUS} install"
184
- end
185
- end
186
-
187
- #
188
- # Static libjpeg build tasks
189
- #
190
- directory STATIC_LIBJPEG_BUILDDIR.to_s
191
-
192
- # libjpeg source file should be stored there
193
- file LIBJPEG_TARBALL => STATIC_SOURCESDIR do |t|
194
- # download the source file using wget or curl
195
- chdir File.dirname(t.name) do
196
- sh "wget '#{LIBJPEG_SOURCE_URI}' -O #{LIBJPEG_TARBALL}"
197
- end
198
- end
199
-
200
- # Extract the libjpeg builds
201
- file STATIC_LIBJPEG_BUILDDIR => LIBJPEG_TARBALL do |t|
202
- sh 'tar', '-xzf', LIBJPEG_TARBALL.to_s, '-C', STATIC_LIBJPEG_BUILDDIR.parent.to_s
203
- end
204
-
205
- # generate the makefile in a clean build location
206
- file LIBJPEG_MAKEFILE => STATIC_LIBJPEG_BUILDDIR do |t|
207
- chdir( STATIC_LIBJPEG_BUILDDIR ) do
208
- options = [
209
- "--target=#{CROSS_PREFIX}",
210
- "--host=#{CROSS_PREFIX}",
211
- "--build=#{RUBY_BUILD}",
212
- "--prefix=#{STATIC_INSTALLDIR}",
213
- "--disable-shared",
176
+ # generate the makefile in a clean build location
177
+ file libpng_makefile => [static_libpng_builddir, libz_a] do |t|
178
+ chdir( static_libpng_builddir ) do
179
+ options = [
180
+ "--target=#{host_platform}",
181
+ "--host=#{host_platform}",
182
+ "--build=#{ruby_build}",
183
+ "--prefix=#{static_installdir}",
184
+ "--disable-shared",
185
+ ]
186
+
187
+ configure_path = static_libpng_builddir + 'configure'
188
+ sh "env #{[libpng_env, configure_path.to_s, *options].join(" ")}"
189
+ end
190
+ end
191
+
192
+ # generate the makefile in a clean build location
193
+ task libpng_a => [libpng_makefile, libz_a] do |t|
194
+ chdir( static_libpng_builddir ) do
195
+ sh "make -j#{NUM_CPUS} install"
196
+ end
197
+ end
198
+
199
+ #
200
+ # Static libjpeg build tasks
201
+ #
202
+ directory static_libjpeg_builddir.to_s
203
+
204
+ # libjpeg source file should be stored there
205
+ file libjpeg_tarball => static_sourcesdir do |t|
206
+ # download the source file using wget or curl
207
+ chdir File.dirname(t.name) do
208
+ sh "wget '#{libjpeg_source_uri}' -O #{libjpeg_tarball}"
209
+ end
210
+ end
211
+
212
+ # Extract the libjpeg builds
213
+ file static_libjpeg_builddir => libjpeg_tarball do |t|
214
+ sh 'tar', '-xzf', libjpeg_tarball.to_s, '-C', static_libjpeg_builddir.parent.to_s
215
+ end
216
+
217
+ # generate the makefile in a clean build location
218
+ file libjpeg_makefile => static_libjpeg_builddir do |t|
219
+ chdir( static_libjpeg_builddir ) do
220
+ options = [
221
+ "--target=#{host_platform}",
222
+ "--host=#{host_platform}",
223
+ "--build=#{ruby_build}",
224
+ "--prefix=#{static_installdir}",
225
+ "--disable-shared",
226
+ ]
227
+
228
+ configure_path = static_libjpeg_builddir + 'configure'
229
+ cmd = [ configure_path.to_s, *options ]
230
+ sh *cmd
231
+ end
232
+ end
233
+
234
+ # build libjpeg.a
235
+ task libjpeg_a => [libjpeg_makefile] do |t|
236
+ chdir( static_libjpeg_builddir ) do
237
+ sh "make -j#{NUM_CPUS} install"
238
+ end
239
+ end
240
+
241
+ #
242
+ # Static libtiff build tasks
243
+ #
244
+ directory static_libtiff_builddir.to_s
245
+
246
+ # libtiff source file should be stored there
247
+ file libtiff_tarball => static_sourcesdir do |t|
248
+ # download the source file using wget or curl
249
+ chdir File.dirname(t.name) do
250
+ sh "wget '#{libtiff_source_uri}' -O #{libtiff_tarball}"
251
+ end
252
+ end
253
+
254
+ # Extract the libtiff builds
255
+ file static_libtiff_builddir => libtiff_tarball do |t|
256
+ sh 'tar', '-xzf', libtiff_tarball.to_s, '-C', static_libtiff_builddir.parent.to_s
257
+ end
258
+
259
+ self.libtiff_env = [
260
+ "'CPPFLAGS=-I#{static_installdir}/include'",
261
+ "'LDFLAGS=-L#{static_installdir}/lib'",
214
262
  ]
215
263
 
216
- configure_path = STATIC_LIBJPEG_BUILDDIR + 'configure'
217
- cmd = [ configure_path.to_s, *options ]
218
- sh *cmd
219
- end
220
- end
221
-
222
- # build libjpeg.a
223
- task LIBJPEG_A => [LIBJPEG_MAKEFILE] do |t|
224
- chdir( STATIC_LIBJPEG_BUILDDIR ) do
225
- sh "make -j#{NUM_CPUS} install"
226
- end
227
- end
228
-
229
- #
230
- # Static libtiff build tasks
231
- #
232
- directory STATIC_LIBTIFF_BUILDDIR.to_s
233
-
234
- # libtiff source file should be stored there
235
- file LIBTIFF_TARBALL => STATIC_SOURCESDIR do |t|
236
- # download the source file using wget or curl
237
- chdir File.dirname(t.name) do
238
- sh "wget '#{LIBTIFF_SOURCE_URI}' -O #{LIBTIFF_TARBALL}"
239
- end
240
- end
241
-
242
- # Extract the libtiff builds
243
- file STATIC_LIBTIFF_BUILDDIR => LIBTIFF_TARBALL do |t|
244
- sh 'tar', '-xzf', LIBTIFF_TARBALL.to_s, '-C', STATIC_LIBTIFF_BUILDDIR.parent.to_s
245
- end
246
-
247
- LIBTIFF_ENV = [
248
- "'CPPFLAGS=-I#{STATIC_INSTALLDIR}/include'",
249
- "'LDFLAGS=-L#{STATIC_INSTALLDIR}/lib'",
250
- ]
251
-
252
- # generate the makefile in a clean build location
253
- file LIBTIFF_MAKEFILE => [STATIC_LIBTIFF_BUILDDIR, LIBJPEG_A, LIBZ_A] do |t|
254
- chdir( STATIC_LIBTIFF_BUILDDIR ) do
255
- options = [
256
- "--target=#{CROSS_PREFIX}",
257
- "--host=#{CROSS_PREFIX}",
258
- "--build=#{RUBY_BUILD}",
259
- "--prefix=#{STATIC_INSTALLDIR}",
260
- "--disable-shared",
261
- "--with-zlib-include-dir=#{STATIC_LIBZ_BUILDDIR}",
262
- "--with-zlib-lib-dir=#{File.dirname(LIBZ_A)}",
263
- "--with-jpeg-include-dir=#{STATIC_LIBJPEG_BUILDDIR}",
264
- "--with-jpeg-lib-dir=#{File.dirname(LIBJPEG_A)}",
264
+ # generate the makefile in a clean build location
265
+ file libtiff_makefile => [static_libtiff_builddir, libjpeg_a, libz_a] do |t|
266
+ chdir( static_libtiff_builddir ) do
267
+ options = [
268
+ "--target=#{host_platform}",
269
+ "--host=#{host_platform}",
270
+ "--build=#{ruby_build}",
271
+ "--prefix=#{static_installdir}",
272
+ "--disable-shared",
273
+ "--with-zlib-include-dir=#{static_libz_builddir}",
274
+ "--with-zlib-lib-dir=#{File.dirname(libz_a)}",
275
+ "--with-jpeg-include-dir=#{static_libjpeg_builddir}",
276
+ "--with-jpeg-lib-dir=#{File.dirname(libjpeg_a)}",
277
+ ]
278
+
279
+ configure_path = static_libtiff_builddir + 'configure'
280
+ sh "env #{[libtiff_env, configure_path.to_s, *options].join(" ")}"
281
+ end
282
+ end
283
+
284
+ # build libtiff.a
285
+ task libtiff_a => [libtiff_makefile] do |t|
286
+ chdir( static_libtiff_builddir ) do
287
+ sh "make -j#{NUM_CPUS} install"
288
+ end
289
+ end
290
+
291
+
292
+ #
293
+ # Static libfox build tasks
294
+ #
295
+ directory static_libfox_builddir.to_s
296
+
297
+ # libfox source file should be stored there
298
+ file libfox_tarball => static_sourcesdir do |t|
299
+ # download the source file using wget or curl
300
+ chdir File.dirname(t.name) do
301
+ sh "wget '#{libfox_source_uri}' -O #{libfox_tarball}"
302
+ end
303
+ end
304
+
305
+ # Extract the libfox builds
306
+ file static_libfox_builddir => libfox_tarball do |t|
307
+ sh 'tar', '-xzf', libfox_tarball.to_s, '-C', static_libfox_builddir.parent.to_s
308
+ end
309
+
310
+ self.libfox_env = [
311
+ "'CPPFLAGS=-I#{static_installdir}/include'",
312
+ "'LDFLAGS=-L#{static_installdir}/lib'",
265
313
  ]
266
314
 
267
- configure_path = STATIC_LIBTIFF_BUILDDIR + 'configure'
268
- sh "env #{[LIBTIFF_ENV, configure_path.to_s, *options].join(" ")}"
269
- end
270
- end
271
-
272
- # build libtiff.a
273
- task LIBTIFF_A => [LIBTIFF_MAKEFILE] do |t|
274
- chdir( STATIC_LIBTIFF_BUILDDIR ) do
275
- sh "make -j#{NUM_CPUS} install"
276
- end
277
- end
278
-
279
-
280
- #
281
- # Static libfox build tasks
282
- #
283
- directory STATIC_LIBFOX_BUILDDIR.to_s
284
-
285
- # libfox source file should be stored there
286
- file LIBFOX_TARBALL => STATIC_SOURCESDIR do |t|
287
- # download the source file using wget or curl
288
- chdir File.dirname(t.name) do
289
- sh "wget '#{LIBFOX_SOURCE_URI}' -O #{LIBFOX_TARBALL}"
290
- end
291
- end
292
-
293
- # Extract the libfox builds
294
- file STATIC_LIBFOX_BUILDDIR => LIBFOX_TARBALL do |t|
295
- sh 'tar', '-xzf', LIBFOX_TARBALL.to_s, '-C', STATIC_LIBFOX_BUILDDIR.parent.to_s
296
- end
297
-
298
- LIBFOX_ENV = [
299
- "'CPPFLAGS=-I#{STATIC_INSTALLDIR}/include'",
300
- "'LDFLAGS=-L#{STATIC_INSTALLDIR}/lib'",
301
- ]
302
-
303
- # generate the makefile in a clean build location
304
- file LIBFOX_MAKEFILE => [STATIC_LIBFOX_BUILDDIR, LIBJPEG_A, LIBZ_A] do |t|
305
- chdir( STATIC_LIBFOX_BUILDDIR ) do
306
- options = [
307
- "--target=#{CROSS_PREFIX}",
308
- "--host=#{CROSS_PREFIX}",
309
- "--build=#{RUBY_BUILD}",
310
- "--prefix=#{STATIC_INSTALLDIR}",
311
- "--disable-shared",
312
- "--without-xft",
313
- "--without-x",
315
+ # generate the makefile in a clean build location
316
+ file libfox_makefile => [static_libfox_builddir, libjpeg_a, libz_a] do |t|
317
+ chdir( static_libfox_builddir ) do
318
+ options = [
319
+ "--target=#{host_platform}",
320
+ "--host=#{host_platform}",
321
+ "--build=#{ruby_build}",
322
+ "--prefix=#{static_installdir}",
323
+ "--disable-shared",
324
+ "--without-xft",
325
+ "--without-x",
326
+ ]
327
+
328
+ configure_path = static_libfox_builddir + 'configure'
329
+ sh "env #{[libfox_env, configure_path.to_s, *options].join(" ")}"
330
+ end
331
+ end
332
+
333
+ # build libfox.a
334
+ task libfox_a => [libfox_makefile] do |t|
335
+ chdir( static_libfox_builddir ) do
336
+ sh "make -j#{NUM_CPUS} #{fox_env.join(" ")} install"
337
+ end
338
+ end
339
+
340
+
341
+ #
342
+ # Static libfxscintilla build tasks
343
+ #
344
+ directory static_libfxscintilla_builddir.to_s
345
+
346
+ # libfxscintilla source file should be stored there
347
+ file libfxscintilla_tarball => static_sourcesdir do |t|
348
+ # download the source file using wget or curl
349
+ chdir File.dirname(t.name) do
350
+ sh "wget '#{libfxscintilla_source_uri}' -O #{libfxscintilla_tarball}"
351
+ end
352
+ end
353
+
354
+ # Extract the libfxscintilla builds
355
+ file static_libfxscintilla_builddir => libfxscintilla_tarball do |t|
356
+ sh 'tar', '-xzf', libfxscintilla_tarball.to_s, '-C', static_libfxscintilla_builddir.parent.to_s
357
+ end
358
+
359
+ self.fox_env = [
360
+ "'CFLAGS=-I#{static_installdir}/include'",
361
+ "'CPPFLAGS=-I#{static_installdir}/include'",
362
+ "'LDFLAGS=-L#{static_installdir}/lib'",
363
+ "'FOX_CFLAGS=-I#{static_installdir}/include/fox-1.6 -DFOX_1_6'",
364
+ "'FOX_LIBS=-L#{static_installdir}/lib -lFOX-1.6'",
314
365
  ]
315
366
 
316
- configure_path = STATIC_LIBFOX_BUILDDIR + 'configure'
317
- sh "env #{[LIBFOX_ENV, configure_path.to_s, *options].join(" ")}"
367
+ # generate the makefile in a clean build location
368
+ file libfxscintilla_makefile => [static_libfxscintilla_builddir, libfox_a] do |t|
369
+ chdir( static_libfxscintilla_builddir ) do
370
+ options = [
371
+ "--target=#{host_platform}",
372
+ "--host=#{host_platform}",
373
+ "--build=#{ruby_build}",
374
+ "--prefix=#{static_installdir}",
375
+ "--disable-shared",
376
+ ]
377
+
378
+ configure_path = static_libfxscintilla_builddir + 'configure'
379
+ sh "env #{[fox_env, configure_path.to_s, *options].join(" ")}"
380
+ end
381
+ end
382
+
383
+ # build libfxscintilla.a
384
+ task libfxscintilla_a => [libfxscintilla_makefile] do |t|
385
+ chdir( static_libfxscintilla_builddir ) do
386
+ sh "make -j#{NUM_CPUS} #{fox_env.join(" ")} install"
387
+ end
388
+ end
389
+
390
+ desc "compile static libz libraries"
391
+ task :static_libs => [ libz_a, libpng_a, libjpeg_a, libtiff_a, libfox_a, libfxscintilla_a ]
318
392
  end
319
393
  end
320
394
 
321
- # build libfox.a
322
- task LIBFOX_A => [LIBFOX_MAKEFILE] do |t|
323
- chdir( STATIC_LIBFOX_BUILDDIR ) do
324
- sh "make -j#{NUM_CPUS} #{FOX_ENV.join(" ")} install"
325
- end
326
- end
327
-
328
-
329
- #
330
- # Static libfxscintilla build tasks
331
- #
332
- directory STATIC_LIBFXSCINTILLA_BUILDDIR.to_s
333
-
334
- # libfxscintilla source file should be stored there
335
- file LIBFXSCINTILLA_TARBALL => STATIC_SOURCESDIR do |t|
336
- # download the source file using wget or curl
337
- chdir File.dirname(t.name) do
338
- sh "wget '#{LIBFXSCINTILLA_SOURCE_URI}' -O #{LIBFXSCINTILLA_TARBALL}"
339
- end
340
- end
341
-
342
- # Extract the libfxscintilla builds
343
- file STATIC_LIBFXSCINTILLA_BUILDDIR => LIBFXSCINTILLA_TARBALL do |t|
344
- sh 'tar', '-xzf', LIBFXSCINTILLA_TARBALL.to_s, '-C', STATIC_LIBFXSCINTILLA_BUILDDIR.parent.to_s
345
- end
346
-
347
- FOX_ENV = [
348
- "'CFLAGS=-I#{STATIC_INSTALLDIR}/include'",
349
- "'CPPFLAGS=-I#{STATIC_INSTALLDIR}/include'",
350
- "'LDFLAGS=-L#{STATIC_INSTALLDIR}/lib'",
351
- "'FOX_CFLAGS=-I#{STATIC_INSTALLDIR}/include/fox-1.6 -DFOX_1_6'",
352
- "'FOX_LIBS=-L#{STATIC_INSTALLDIR}/lib -lFOX-1.6'",
353
- ]
354
-
355
- # generate the makefile in a clean build location
356
- file LIBFXSCINTILLA_MAKEFILE => [STATIC_LIBFXSCINTILLA_BUILDDIR, LIBFOX_A] do |t|
357
- chdir( STATIC_LIBFXSCINTILLA_BUILDDIR ) do
358
- options = [
359
- "--target=#{CROSS_PREFIX}",
360
- "--host=#{CROSS_PREFIX}",
361
- "--build=#{RUBY_BUILD}",
362
- "--prefix=#{STATIC_INSTALLDIR}",
363
- "--disable-shared",
364
- ]
365
-
366
- configure_path = STATIC_LIBFXSCINTILLA_BUILDDIR + 'configure'
367
- sh "env #{[FOX_ENV, configure_path.to_s, *options].join(" ")}"
368
- end
369
- end
370
-
371
- # build libfxscintilla.a
372
- task LIBFXSCINTILLA_A => [LIBFXSCINTILLA_MAKEFILE] do |t|
373
- chdir( STATIC_LIBFXSCINTILLA_BUILDDIR ) do
374
- sh "make -j#{NUM_CPUS} #{FOX_ENV.join(" ")} install"
395
+ if File.exist?(File.expand_path("~/.rake-compiler/config.yml"))
396
+ CrossLibraries = [
397
+ 'i386-mingw32',
398
+ 'x64-mingw32',
399
+ ].map do |platform|
400
+ CrossLibrary.new platform
375
401
  end
402
+ else
403
+ $stderr.puts "Cross-compilation disabled -- rake-compiler not properly installed"
404
+ CrossLibraries = []
376
405
  end
377
406
 
378
407
 
379
-
380
- desc "compile static libz libraries"
381
- task :static_libs => [ LIBZ_A, LIBPNG_A, LIBJPEG_A, LIBTIFF_A, LIBFOX_A, LIBFXSCINTILLA_A ]
382
-
383
408
  desc 'cross compile required libs for win32'
384
409
  task :cross => [ :mingw32, :static_libs ]
385
410
 
@@ -390,7 +415,6 @@ task :mingw32 do
390
415
  warn "Please refer to your distribution/package manager documentation about installation."
391
416
  fail
392
417
  end
393
- ENV['CROSS_PREFIX'] = Rake::ExtensionCompiler.mingw_host
394
418
  end
395
419
 
396
420
 
@@ -26,7 +26,7 @@
26
26
 
27
27
  #include "FXRbCommon.h"
28
28
 
29
- #ifndef RUBY_1_9
29
+ #if defined(RUBY_1_8)
30
30
  extern "C" {
31
31
  #include "rubysig.h" /* For CHECK_INTS */
32
32
  }
@@ -97,14 +97,14 @@ long FXRbApp::onChoreThreads(FXObject*,FXSelector,void*){
97
97
  wait.tv_usec=100*sleepTime;
98
98
 
99
99
  // Confirm that this thread can be interrupted, then go to sleep
100
- #ifndef RUBY_1_9
100
+ #if defined(RUBY_1_8)
101
101
  CHECK_INTS;
102
102
  if(!rb_thread_critical)
103
103
  rb_thread_wait_for(wait);
104
104
  #else
105
105
  // if(!rb_thread_critical) rb_thread_wait_for(wait);
106
106
  rb_thread_wait_for(wait);
107
- #endif /* RUBY_1_9 */
107
+ #endif /* RUBY_1_8 */
108
108
 
109
109
  // Re-register this chore for next time
110
110
  addChore(this,ID_CHORE_THREADS);
@@ -39,19 +39,19 @@
39
39
  #include <signal.h> // for definitions of SIGINT, etc.
40
40
  #endif
41
41
 
42
- #ifdef RUBY_1_9
43
-
44
- #include "ruby/io.h"
45
- #include "ruby/st.h"
46
-
47
- #else
42
+ #if defined(RUBY_1_8)
48
43
 
49
44
  extern "C" {
50
45
  #include "st.h"
51
46
  #include "rubyio.h" // for GetOpenFile(), etc.
52
47
  }
53
48
 
54
- #endif /* RUBY_1_9 */
49
+ #else
50
+
51
+ #include "ruby/io.h"
52
+ #include "ruby/st.h"
53
+
54
+ #endif /* RUBY_1_8 */
55
55
 
56
56
 
57
57
  // Opaque type declaration from SWIG runtime
@@ -204,17 +204,17 @@ FXInputHandle FXRbGetWriteFileHandle(VALUE obj) {
204
204
  VALUE vwrite = rb_intern("@write");
205
205
  if(rb_ivar_defined(obj, vwrite)) obj = rb_ivar_get(obj, vwrite);
206
206
  fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
207
- #elif defined(RUBY_1_9)
207
+ #elif defined(RUBY_1_8)
208
+ OpenFile *fptr;
209
+ GetOpenFile(obj, fptr);
210
+ FILE *fpw=GetWriteFile(fptr);
211
+ fd = fileno(fpw);
212
+ #else
208
213
  rb_io_t *fptr;
209
214
  GetOpenFile(obj, fptr);
210
215
  VALUE wrio = fptr->tied_io_for_writing;
211
216
  if(wrio) obj = wrio;
212
217
  fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
213
- #else
214
- OpenFile *fptr;
215
- GetOpenFile(obj, fptr);
216
- FILE *fpw=GetWriteFile(fptr);
217
- fd = fileno(fpw);
218
218
  #endif
219
219
  #ifdef WIN32
220
220
  #ifdef __CYGWIN__
@@ -552,7 +552,7 @@ static VALUE FXRbConvertMessageData(FXObject* sender,FXObject* recv,FXSelector s
552
552
  return to_ruby(reinterpret_cast<FXEvent*>(ptr));
553
553
  }
554
554
  else if(type==SEL_SIGNAL){
555
- return to_ruby(static_cast<int>(reinterpret_cast<long>(ptr)));
555
+ return to_ruby(static_cast<int>(reinterpret_cast<FXuval>(ptr)));
556
556
  }
557
557
  else if(type==SEL_IO_READ ||
558
558
  type==SEL_IO_WRITE ||
@@ -600,7 +600,7 @@ static VALUE FXRbConvertMessageData(FXObject* sender,FXObject* recv,FXSelector s
600
600
  }
601
601
  }
602
602
  else if(sender->isMemberOf(FXMETACLASS(FXColorDialog))){
603
- if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(static_cast<FXColor>(reinterpret_cast<unsigned long>(ptr)));
603
+ if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(static_cast<FXColor>(reinterpret_cast<FXuval>(ptr)));
604
604
  }
605
605
  else if(sender->isMemberOf(FXMETACLASS(FXColorRing))){
606
606
  if(type==SEL_CHANGED || type==SEL_COMMAND){
@@ -609,7 +609,7 @@ static VALUE FXRbConvertMessageData(FXObject* sender,FXObject* recv,FXSelector s
609
609
  }
610
610
  }
611
611
  else if(sender->isMemberOf(FXMETACLASS(FXColorSelector))){
612
- if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(static_cast<FXColor>(reinterpret_cast<unsigned long>(ptr)));
612
+ if(type==SEL_CHANGED || type==SEL_COMMAND) return to_ruby(static_cast<FXColor>(reinterpret_cast<FXuval>(ptr)));
613
613
  }
614
614
  else if(sender->isMemberOf(FXMETACLASS(FXColorWell))){
615
615
  if(type==SEL_CHANGED ||
@@ -617,7 +617,7 @@ static VALUE FXRbConvertMessageData(FXObject* sender,FXObject* recv,FXSelector s
617
617
  type==SEL_CLICKED ||
618
618
  type==SEL_DOUBLECLICKED ||
619
619
  type==SEL_TRIPLECLICKED) {
620
- VALUE v=to_ruby(static_cast<FXColor>(reinterpret_cast<unsigned long>(ptr)));
620
+ VALUE v=to_ruby(static_cast<FXColor>(reinterpret_cast<FXuval>(ptr)));
621
621
  return v;
622
622
  }
623
623
  }
@@ -819,7 +819,7 @@ static VALUE FXRbConvertMessageData(FXObject* sender,FXObject* recv,FXSelector s
819
819
  }
820
820
  else if(sender->isMemberOf(FXMETACLASS(FXSpinner))){
821
821
  if(type==SEL_CHANGED || type==SEL_COMMAND)
822
- return to_ruby(static_cast<FXint>(reinterpret_cast<long>(ptr)));
822
+ return to_ruby(static_cast<FXint>(reinterpret_cast<FXuval>(ptr)));
823
823
  }
824
824
  else if(sender->isMemberOf(FXMETACLASS(FXSplitter))){
825
825
  if(type==SEL_CHANGED || type==SEL_COMMAND)
@@ -79,7 +79,7 @@ def do_rake_compiler_setup
79
79
  have_library( 'opengl32' ) && append_library( $libs, 'opengl32' )
80
80
  have_library( 'winspool', 'EnumPrintersA') && append_library( $libs, 'winspool' )
81
81
 
82
- CONFIG['CC'] += "\nCXX=#{ENV['CROSS_PREFIX']}-g++" # Hack CXX into Makefile for cross compilation
82
+ CONFIG['CC'] += "\nCXX=#{RbConfig::CONFIG["host"]}-g++" # Hack CXX into Makefile for cross compilation
83
83
  CONFIG['LDSHARED'].gsub!('gcc', 'g++') # ensure C++ linker is used, so that libstdc++ is linked static
84
84
  $LDFLAGS += " -s -static-libgcc -static-libstdc++" # mingw-w64 v4.7 defaults to dynamic linking
85
85
  elsif RUBY_PLATFORM =~ /mingw/
@@ -145,8 +145,9 @@ end
145
145
  # Platform-specific modifications
146
146
  do_rake_compiler_setup
147
147
 
148
- # Check for Ruby 1.9
148
+ $CFLAGS += " -DRUBY_1_8" if RUBY_VERSION =~ /1\.8\./
149
149
  $CFLAGS += " -DRUBY_1_9" if RUBY_VERSION =~ /1\.9\./
150
+ $CFLAGS += " -DRUBY_2_0" if RUBY_VERSION =~ /2\.0\./
150
151
 
151
152
  # Last step: build the makefile
152
153
  create_makefile("fox16_c")
@@ -41,6 +41,13 @@
41
41
  #define RSTRING_PTR(s) RSTRING((s))->ptr
42
42
  #endif
43
43
 
44
+ #ifndef NUM2SIZET
45
+ #define NUM2SIZET(s) NUM2ULONG(s)
46
+ #endif
47
+ #ifndef SIZET2NUM
48
+ #define SIZET2NUM(s) ULONG2NUM(s)
49
+ #endif
50
+
44
51
  // Opaque type declaration for SWIG runtime support
45
52
  struct swig_type_info;
46
53
 
@@ -322,7 +329,7 @@ inline VALUE fxid_to_int(FXID id){
322
329
  #ifndef WIN32
323
330
  return UINT2NUM(static_cast<unsigned int>(id));
324
331
  #else
325
- return ULONG2NUM(reinterpret_cast<unsigned long>(id));
332
+ return SIZET2NUM(reinterpret_cast<size_t>(id));
326
333
  #endif
327
334
  }
328
335
 
@@ -334,7 +341,7 @@ inline FXID int_to_fxid(VALUE value){
334
341
  #ifndef WIN32
335
342
  return static_cast<FXID>(NUM2UINT(value));
336
343
  #else
337
- return reinterpret_cast<FXID>(NUM2ULONG(value));
344
+ return reinterpret_cast<FXID>(NUM2SIZET(value));
338
345
  #endif
339
346
  }
340
347
 
data/lib/1.8/fox16_c.so CHANGED
Binary file
data/lib/1.9/fox16_c.so CHANGED
Binary file
Binary file
data/lib/fox16/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Fox
2
2
  def Fox.fxrubyversion
3
- "1.6.26"
3
+ "1.6.27"
4
4
  end
5
5
  end
@@ -197,8 +197,8 @@ public:
197
197
 
198
198
  %extend {
199
199
  /// Return pointer to display
200
- unsigned long getDisplay() const {
201
- return reinterpret_cast<unsigned long>(self->getDisplay());
200
+ FXuval getDisplay() const {
201
+ return reinterpret_cast<FXuval>(self->getDisplay());
202
202
  }
203
203
  }
204
204
 
@@ -53,13 +53,13 @@ public:
53
53
 
54
54
  %extend {
55
55
  /// Return current context, if any
56
- static unsigned long getCurrentContext(){
57
- return reinterpret_cast<unsigned long>(FXGLCanvas::getCurrentContext());
56
+ static FXuval getCurrentContext(){
57
+ return reinterpret_cast<FXuval>(FXGLCanvas::getCurrentContext());
58
58
  }
59
59
 
60
60
  /// Get GL context handle
61
- unsigned long getContext() const {
62
- return reinterpret_cast<unsigned long>(self->getContext());
61
+ FXuval getContext() const {
62
+ return reinterpret_cast<FXuval>(self->getContext());
63
63
  }
64
64
  }
65
65
 
@@ -139,11 +139,12 @@ public:
139
139
  // Convert wParam argument
140
140
  uptr_t wp;
141
141
  switch(TYPE(wParam)){
142
+ case T_BIGNUM:
142
143
  case T_FIXNUM:
143
- wp=static_cast<uptr_t>(NUM2UINT(wParam));
144
+ wp=static_cast<uptr_t>(NUM2SIZET(wParam));
144
145
  break;
145
146
  case T_STRING:
146
- wp=static_cast<uptr_t>(reinterpret_cast<long>(RSTRING_PTR(wParam)));
147
+ wp=static_cast<uptr_t>(reinterpret_cast<FXuval>(RSTRING_PTR(wParam)));
147
148
  break;
148
149
  case T_TRUE:
149
150
  case T_FALSE:
@@ -157,11 +158,12 @@ public:
157
158
  // Convert lParam argument
158
159
  sptr_t lp;
159
160
  switch(TYPE(lParam)){
161
+ case T_BIGNUM:
160
162
  case T_FIXNUM:
161
- lp=static_cast<sptr_t>(NUM2UINT(lParam));
163
+ lp=static_cast<sptr_t>(NUM2SIZET(lParam));
162
164
  break;
163
165
  case T_STRING:
164
- lp=static_cast<sptr_t>(reinterpret_cast<long>(RSTRING_PTR(lParam)));
166
+ lp=static_cast<sptr_t>(reinterpret_cast<FXival>(RSTRING_PTR(lParam)));
165
167
  break;
166
168
  case T_TRUE:
167
169
  case T_FALSE:
metadata CHANGED
@@ -1,22 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fxruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 6
9
- - 26
10
- version: 1.6.26
9
+ - 27
10
+ version: 1.6.27
11
11
  platform: x86-mingw32
12
12
  authors:
13
13
  - Lyle Johnson
14
14
  - Lars Kanis
15
15
  autorequire:
16
16
  bindir: bin
17
- cert_chain: []
17
+ cert_chain:
18
+ - |
19
+ -----BEGIN CERTIFICATE-----
20
+ MIIDPDCCAiSgAwIBAgIBADANBgkqhkiG9w0BAQUFADBEMQ0wCwYDVQQDDARsYXJz
21
+ MR8wHQYKCZImiZPyLGQBGRYPZ3JlaXotcmVpbnNkb3JmMRIwEAYKCZImiZPyLGQB
22
+ GRYCZGUwHhcNMTMwMzExMjAyMjIyWhcNMTQwMzExMjAyMjIyWjBEMQ0wCwYDVQQD
23
+ DARsYXJzMR8wHQYKCZImiZPyLGQBGRYPZ3JlaXotcmVpbnNkb3JmMRIwEAYKCZIm
24
+ iZPyLGQBGRYCZGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZb4Uv
25
+ RFJfRu/VEWiy3psh2jinETjiuBrL0NeRFGf8H7iU9+gx/DI/FFhfHGLrDeIskrJx
26
+ YIWDMmEjVO10UUdj7wu4ZhmU++0Cd7Kq9/TyP/shIP3IjqHjVLCnJ3P6f1cl5rxZ
27
+ gqo+d3BAoDrmPk0rtaf6QopwUw9RBiF8V4HqvpiY+ruJotP5UQDP4/lVOKvA8PI9
28
+ P0GmVbFBrbc7Zt5h78N3UyOK0u+nvOC23BvyHXzCtcFsXCoEkt+Wwh0RFqVZdnjM
29
+ LMO2vULHKKHDdX54K/sbVCj9pN9h1aotNzrEyo55zxn0G9PHg/G3P8nMvAXPkUTe
30
+ brhXrfCwWRvOXA4TAgMBAAGjOTA3MAsGA1UdDwQEAwIEsDAJBgNVHRMEAjAAMB0G
31
+ A1UdDgQWBBRAHK81igrXodaDj8a8/BIKsaZrETANBgkqhkiG9w0BAQUFAAOCAQEA
32
+ Iswhcol3ytXthaUH3k5LopZ09viZrZHzAw0QleI3Opl/9QEGJ2BPV9+93iC0OrNL
33
+ hmnxig6vKK1EeJ5PHXJ8hOI3nTZBrOmQcEXNBqyToP1FHMWZqwZ8wiBPXtiCqDBR
34
+ ePQ25J9xFNzQ1ItgzNSpx5cs67QNKrx5woocoBHD6kStFbshZPJx4axl3GbUFQd5
35
+ H//3YdPQOH3jaVeUXhS+pz/gfbx8fhFAtsQ+855A3HO7g2ZRIg/atAp/0MFyn5s5
36
+ 0rq+VHOIPyvxF5khT0mYAcNmZTC8z1yPsqdgwfYNDjsSWwiIRSPUSmJRvfjM8hsW
37
+ mMFp4kPUHbWOqCp2mz9gCA==
38
+ -----END CERTIFICATE-----
18
39
 
19
- date: 2013-02-16 00:00:00 Z
40
+ date: 2013-04-05 00:00:00 Z
20
41
  dependencies:
21
42
  - !ruby/object:Gem::Dependency
22
43
  name: rdoc
@@ -973,30 +994,31 @@ files:
973
994
  - test/stress2.rb
974
995
  - test/stress3.rb
975
996
  - test/testcase.rb
976
- - ext/fox16_c/scintilla_wrap.cpp
977
- - ext/fox16_c/dc_wrap.cpp
978
- - ext/fox16_c/fx3d_wrap.cpp
979
- - ext/fox16_c/menu_wrap.cpp
980
- - ext/fox16_c/layout_wrap.cpp
981
- - ext/fox16_c/label_wrap.cpp
982
997
  - ext/fox16_c/ui_wrap.cpp
983
- - ext/fox16_c/frames_wrap.cpp
984
- - ext/fox16_c/treelist_wrap.cpp
985
998
  - ext/fox16_c/mdi_wrap.cpp
986
- - ext/fox16_c/list_wrap.cpp
987
- - ext/fox16_c/text_wrap.cpp
988
- - ext/fox16_c/icons_wrap.cpp
989
999
  - ext/fox16_c/iconlist_wrap.cpp
990
- - ext/fox16_c/table_wrap.cpp
1000
+ - ext/fox16_c/frames_wrap.cpp
991
1001
  - ext/fox16_c/dialogs_wrap.cpp
992
- - ext/fox16_c/image_wrap.cpp
1002
+ - ext/fox16_c/label_wrap.cpp
1003
+ - ext/fox16_c/icons_wrap.cpp
1004
+ - ext/fox16_c/treelist_wrap.cpp
993
1005
  - ext/fox16_c/core_wrap.cpp
1006
+ - ext/fox16_c/text_wrap.cpp
1007
+ - ext/fox16_c/menu_wrap.cpp
1008
+ - ext/fox16_c/list_wrap.cpp
1009
+ - ext/fox16_c/image_wrap.cpp
1010
+ - ext/fox16_c/scintilla_wrap.cpp
1011
+ - ext/fox16_c/fx3d_wrap.cpp
1012
+ - ext/fox16_c/table_wrap.cpp
1013
+ - ext/fox16_c/layout_wrap.cpp
1014
+ - ext/fox16_c/dc_wrap.cpp
994
1015
  - ext/fox16_c/include/inlinestubs.h
995
1016
  - ext/fox16_c/librb.c
996
1017
  - doap.rdf
997
1018
  - lib/fox16/kwargs.rb
998
1019
  - lib/1.8/fox16_c.so
999
1020
  - lib/1.9/fox16_c.so
1021
+ - lib/2.0/fox16_c.so
1000
1022
  homepage: http://github.com/larskanis/fxruby
1001
1023
  licenses: []
1002
1024
 
metadata.gz.sig ADDED
Binary file