pg 0.15.0.pre.432-x86-mingw32 → 0.15.0.pre.454-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data.tar.gz.sig +0 -0
- data/ChangeLog +191 -116
- data/History.rdoc +5 -2
- data/README.ja.rdoc +10 -3
- data/README.rdoc +13 -4
- data/Rakefile +15 -13
- data/Rakefile.cross +194 -169
- data/ext/extconf.rb +4 -1
- data/ext/pg_connection.c +102 -10
- data/lib/1.8/pg_ext.so +0 -0
- data/lib/1.9/pg_ext.so +0 -0
- data/lib/2.0/pg_ext.so +0 -0
- data/lib/pg.rb +1 -1
- data/lib/pg/connection.rb +0 -14
- data/spec/lib/helpers.rb +28 -4
- data/spec/pg/connection_spec.rb +27 -8
- metadata +45 -23
- metadata.gz.sig +0 -0
data/Rakefile
CHANGED
@@ -55,8 +55,8 @@ $hoespec = Hoe.spec 'pg' do
|
|
55
55
|
|
56
56
|
self.developer 'Michael Granger', 'ged@FaerieMUD.org'
|
57
57
|
|
58
|
-
self.dependency 'rake-compiler', '~> 0.
|
59
|
-
self.dependency 'hoe-deveiate', '~> 0.
|
58
|
+
self.dependency 'rake-compiler', '~> 0.8', :developer
|
59
|
+
self.dependency 'hoe-deveiate', '~> 0.2', :developer
|
60
60
|
|
61
61
|
self.spec_extras[:licenses] = ['BSD', 'Ruby', 'GPL']
|
62
62
|
self.spec_extras[:extensions] = [ 'ext/extconf.rb' ]
|
@@ -102,7 +102,7 @@ task :maint do
|
|
102
102
|
ENV['MAINTAINER_MODE'] = 'yes'
|
103
103
|
end
|
104
104
|
|
105
|
-
ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.2'
|
105
|
+
ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.2:2.0.0'
|
106
106
|
|
107
107
|
# Rake-compiler task
|
108
108
|
Rake::ExtensionTask.new do |ext|
|
@@ -112,15 +112,18 @@ Rake::ExtensionTask.new do |ext|
|
|
112
112
|
ext.lib_dir = 'lib'
|
113
113
|
ext.source_pattern = "*.{c,h}"
|
114
114
|
ext.cross_compile = true
|
115
|
-
ext.cross_platform =
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
115
|
+
ext.cross_platform = CrossLibraries.map(&:for_platform)[0,1]
|
116
|
+
|
117
|
+
ext.cross_config_options += CrossLibraries.map do |lib|
|
118
|
+
{
|
119
|
+
lib.for_platform => [
|
120
|
+
"--with-pg-include=#{lib.static_postgresql_libdir}",
|
121
|
+
"--with-opt-include=#{lib.static_postgresql_incdir}",
|
122
|
+
"--with-pg-lib=#{lib.static_postgresql_libdir}",
|
123
|
+
"--with-opt-lib=#{lib.static_openssl_builddir}",
|
124
|
+
]
|
125
|
+
}
|
126
|
+
end
|
124
127
|
end
|
125
128
|
|
126
129
|
|
@@ -131,7 +134,6 @@ end
|
|
131
134
|
file 'ChangeLog' => '.hg/branch' do |task|
|
132
135
|
$stderr.puts "Updating the changelog..."
|
133
136
|
begin
|
134
|
-
include Hoe::MercurialHelpers
|
135
137
|
content = make_changelog()
|
136
138
|
rescue NameError
|
137
139
|
abort "Packaging tasks require the hoe-mercurial plugin (gem install hoe-mercurial)"
|
data/Rakefile.cross
CHANGED
@@ -6,6 +6,7 @@ require 'rbconfig'
|
|
6
6
|
require 'rake/clean'
|
7
7
|
require 'rake/extensiontask'
|
8
8
|
require 'rake/extensioncompiler'
|
9
|
+
require 'ostruct'
|
9
10
|
|
10
11
|
MISCDIR = BASEDIR + 'misc'
|
11
12
|
|
@@ -17,218 +18,242 @@ else
|
|
17
18
|
1
|
18
19
|
end
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
POSTGRESQL_VERSION = ENV['POSTGRESQL_VERSION'] || '9.2.2'
|
21
|
+
class CrossLibrary < OpenStruct
|
22
|
+
include Rake::DSL
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
STATIC_BUILDDIR = COMPILE_HOME + 'builds'
|
24
|
+
def initialize(for_platform, openssl_config)
|
25
|
+
super()
|
27
26
|
|
28
|
-
|
29
|
-
|
27
|
+
self.for_platform = for_platform
|
28
|
+
self.openssl_config = openssl_config
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
OPENSSL_MAKEFILE = STATIC_OPENSSL_BUILDDIR + 'Makefile'
|
30
|
+
# Cross-compilation constants
|
31
|
+
self.openssl_version = ENV['OPENSSL_VERSION'] || '1.0.1e'
|
32
|
+
self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '9.2.3'
|
35
33
|
|
36
|
-
|
37
|
-
|
34
|
+
self.compile_home = Pathname( "./build" ).expand_path
|
35
|
+
self.static_sourcesdir = compile_home + 'sources'
|
36
|
+
self.static_builddir = compile_home + 'builds' + for_platform
|
38
37
|
|
39
|
-
|
38
|
+
# Static OpenSSL build vars
|
39
|
+
self.static_openssl_builddir = static_builddir + "openssl-#{openssl_version}"
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
[ POSTGRESQL_VERSION, POSTGRESQL_VERSION ]
|
46
|
-
URI( uristring )
|
47
|
-
end
|
48
|
-
POSTGRESQL_TARBALL = STATIC_SOURCESDIR + File.basename( POSTGRESQL_SOURCE_URI.path )
|
49
|
-
|
50
|
-
STATIC_POSTGRESQL_SRCDIR = STATIC_POSTGRESQL_BUILDDIR + 'src'
|
51
|
-
STATIC_POSTGRESQL_LIBDIR = STATIC_POSTGRESQL_SRCDIR + 'interfaces/libpq'
|
52
|
-
STATIC_POSTGRESQL_INCDIR = STATIC_POSTGRESQL_SRCDIR + 'include'
|
53
|
-
|
54
|
-
POSTGRESQL_GLOBAL_MAKEFILE = STATIC_POSTGRESQL_SRCDIR + 'Makefile.global'
|
55
|
-
POSTGRESQL_SHLIB_MAKEFILE = STATIC_POSTGRESQL_SRCDIR + 'Makefile.shlib'
|
56
|
-
POSTGRESQL_SHLIB_MF_ORIG = STATIC_POSTGRESQL_SRCDIR + 'Makefile.shlib.orig'
|
57
|
-
POSTGRESQL_LIB = STATIC_POSTGRESQL_LIBDIR + 'libpq.a'
|
58
|
-
POSTGRESQL_PATCHES = Rake::FileList[ (MISCDIR + "postgresql-#{POSTGRESQL_VERSION}.*.patch").to_s ]
|
59
|
-
|
60
|
-
CROSS_PREFIX = begin
|
61
|
-
Rake::ExtensionCompiler.mingw_host
|
62
|
-
rescue => err
|
63
|
-
$stderr.puts "Cross-compilation disabled -- %s" % [ err.message ]
|
64
|
-
'unknown'
|
65
|
-
end
|
41
|
+
self.openssl_source_uri =
|
42
|
+
URI( "http://www.openssl.org/source/openssl-#{openssl_version}.tar.gz" )
|
43
|
+
self.openssl_tarball = static_sourcesdir + File.basename( openssl_source_uri.path )
|
44
|
+
self.openssl_makefile = static_openssl_builddir + 'Makefile'
|
66
45
|
|
46
|
+
self.libssleay32 = static_openssl_builddir + 'libssleay32.a'
|
47
|
+
self.libeay32 = static_openssl_builddir + 'libeay32.a'
|
67
48
|
|
68
|
-
|
69
|
-
CLEAN.include( STATIC_BUILDDIR.to_s )
|
49
|
+
self.openssl_patches = Rake::FileList[ (MISCDIR + "openssl-#{openssl_version}.*.patch").to_s ]
|
70
50
|
|
51
|
+
# Static PostgreSQL build vars
|
52
|
+
self.static_postgresql_builddir = static_builddir + "postgresql-#{postgresql_version}"
|
53
|
+
self.postgresql_source_uri = begin
|
54
|
+
uristring = "http://ftp.postgresql.org/pub/source/v%s/postgresql-%s.tar.bz2" %
|
55
|
+
[ postgresql_version, postgresql_version ]
|
56
|
+
URI( uristring )
|
57
|
+
end
|
58
|
+
self.postgresql_tarball = static_sourcesdir + File.basename( postgresql_source_uri.path )
|
59
|
+
|
60
|
+
self.static_postgresql_srcdir = static_postgresql_builddir + 'src'
|
61
|
+
self.static_postgresql_libdir = static_postgresql_srcdir + 'interfaces/libpq'
|
62
|
+
self.static_postgresql_incdir = static_postgresql_srcdir + 'include'
|
63
|
+
|
64
|
+
self.postgresql_global_makefile = static_postgresql_srcdir + 'Makefile.global'
|
65
|
+
self.postgresql_shlib_makefile = static_postgresql_srcdir + 'Makefile.shlib'
|
66
|
+
self.postgresql_shlib_mf_orig = static_postgresql_srcdir + 'Makefile.shlib.orig'
|
67
|
+
self.postgresql_lib = static_postgresql_libdir + 'libpq.a'
|
68
|
+
self.postgresql_patches = Rake::FileList[ (MISCDIR + "postgresql-#{postgresql_version}.*.patch").to_s ]
|
69
|
+
|
70
|
+
# Use rake-compilers config.yml to determine the toolchain that was used
|
71
|
+
# to build Ruby for this platform.
|
72
|
+
self.host_platform = begin
|
73
|
+
config_file = YAML.load_file(File.expand_path("~/.rake-compiler/config.yml"))
|
74
|
+
_, rbfile = config_file.find{|key, fname| key.start_with?("rbconfig-#{for_platform}-") }
|
75
|
+
IO.read(rbfile).match(/CONFIG\["host"\] = "(.*)"/)[1]
|
76
|
+
end
|
71
77
|
|
72
|
-
ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.3'
|
73
78
|
|
74
|
-
|
75
|
-
|
76
|
-
sh "wget #{url.to_s.inspect} -O #{part.inspect} || curl #{url.to_s.inspect} -o #{part.inspect}"
|
77
|
-
FileUtils.mv part, save_to
|
78
|
-
end
|
79
|
+
# clean intermediate files and folders
|
80
|
+
CLEAN.include( static_builddir.to_s )
|
79
81
|
|
80
|
-
def run(*args)
|
81
|
-
sh *args
|
82
|
-
end
|
83
82
|
|
84
|
-
|
85
|
-
### C R O S S - C O M P I L A T I O N - T A S K S
|
86
|
-
#####################################################################
|
83
|
+
ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.3:2.0.0'
|
87
84
|
|
85
|
+
def download(url, save_to)
|
86
|
+
part = save_to+".part"
|
87
|
+
sh "wget #{url.to_s.inspect} -O #{part.inspect} || curl #{url.to_s.inspect} -o #{part.inspect}"
|
88
|
+
FileUtils.mv part, save_to
|
89
|
+
end
|
88
90
|
|
89
|
-
|
91
|
+
def run(*args)
|
92
|
+
sh *args
|
93
|
+
end
|
90
94
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
directory STATIC_OPENSSL_BUILDDIR.to_s
|
95
|
+
#####################################################################
|
96
|
+
### C R O S S - C O M P I L A T I O N - T A S K S
|
97
|
+
#####################################################################
|
95
98
|
|
96
|
-
# openssl source file should be stored there
|
97
|
-
file OPENSSL_TARBALL => STATIC_SOURCESDIR do |t|
|
98
|
-
download( OPENSSL_SOURCE_URI, t.name )
|
99
|
-
end
|
100
99
|
|
101
|
-
|
102
|
-
file STATIC_OPENSSL_BUILDDIR => OPENSSL_TARBALL do |t|
|
103
|
-
puts "extracting %s to %s" % [ OPENSSL_TARBALL, STATIC_OPENSSL_BUILDDIR.parent ]
|
104
|
-
STATIC_OPENSSL_BUILDDIR.mkpath
|
105
|
-
run 'tar', '-xzf', OPENSSL_TARBALL.to_s, '-C', STATIC_OPENSSL_BUILDDIR.parent.to_s
|
106
|
-
OPENSSL_MAKEFILE.unlink if OPENSSL_MAKEFILE.exist?
|
107
|
-
|
108
|
-
OPENSSL_PATCHES.each do |patchfile|
|
109
|
-
puts " applying patch #{patchfile}..."
|
110
|
-
run 'patch', '-Np1', '-d', STATIC_OPENSSL_BUILDDIR.to_s,
|
111
|
-
'-i', File.expand_path( patchfile, BASEDIR )
|
112
|
-
end
|
113
|
-
end
|
100
|
+
directory static_sourcesdir.to_s
|
114
101
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
"AR=#{CROSS_PREFIX}-ar",
|
120
|
-
"RANLIB=#{CROSS_PREFIX}-ranlib"
|
121
|
-
]
|
102
|
+
#
|
103
|
+
# Static OpenSSL build tasks
|
104
|
+
#
|
105
|
+
directory static_openssl_builddir.to_s
|
122
106
|
|
107
|
+
# openssl source file should be stored there
|
108
|
+
file openssl_tarball => static_sourcesdir do |t|
|
109
|
+
download( openssl_source_uri, t.name )
|
110
|
+
end
|
123
111
|
|
124
|
-
#
|
125
|
-
file
|
126
|
-
|
127
|
-
|
128
|
-
|
112
|
+
# Extract the openssl builds
|
113
|
+
file static_openssl_builddir => openssl_tarball do |t|
|
114
|
+
puts "extracting %s to %s" % [ openssl_tarball, static_openssl_builddir.parent ]
|
115
|
+
static_openssl_builddir.mkpath
|
116
|
+
run 'tar', '-xzf', openssl_tarball.to_s, '-C', static_openssl_builddir.parent.to_s
|
117
|
+
openssl_makefile.unlink if openssl_makefile.exist?
|
118
|
+
|
119
|
+
openssl_patches.each do |patchfile|
|
120
|
+
puts " applying patch #{patchfile}..."
|
121
|
+
run 'patch', '-Np1', '-d', static_openssl_builddir.to_s,
|
122
|
+
'-i', File.expand_path( patchfile, BASEDIR )
|
123
|
+
end
|
124
|
+
end
|
129
125
|
|
130
|
-
|
131
|
-
|
132
|
-
|
126
|
+
self.cmd_prelude = [
|
127
|
+
'env',
|
128
|
+
"CC=#{host_platform}-gcc",
|
129
|
+
"CFLAGS=-DDSO_WIN32",
|
130
|
+
"AR=#{host_platform}-ar",
|
131
|
+
"RANLIB=#{host_platform}-ranlib"
|
132
|
+
]
|
133
133
|
|
134
|
-
desc "compile static openssl libraries"
|
135
|
-
task :openssl_libs => [ LIBSSLEAY32, LIBEAY32 ]
|
136
134
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
135
|
+
# generate the makefile in a clean build location
|
136
|
+
file openssl_makefile => static_openssl_builddir do |t|
|
137
|
+
Dir.chdir( static_openssl_builddir ) do
|
138
|
+
cmd = cmd_prelude.dup
|
139
|
+
cmd << "./Configure" << openssl_config
|
141
140
|
|
142
|
-
|
143
|
-
|
144
|
-
end
|
141
|
+
run( *cmd )
|
142
|
+
end
|
143
|
+
end
|
145
144
|
|
146
|
-
desc "compile static
|
147
|
-
|
148
|
-
FileUtils.cp( STATIC_OPENSSL_BUILDDIR + 'libcrypto.a', LIBEAY32.to_s )
|
149
|
-
end
|
145
|
+
desc "compile static openssl libraries"
|
146
|
+
task :openssl_libs => [ libssleay32, libeay32 ]
|
150
147
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
148
|
+
task :compile_static_openssl => openssl_makefile do |t|
|
149
|
+
Dir.chdir( static_openssl_builddir ) do
|
150
|
+
cmd = cmd_prelude.dup
|
151
|
+
cmd << 'make' << "-j#{NUM_CPUS}" << 'build_libs'
|
155
152
|
|
153
|
+
run( *cmd )
|
154
|
+
end
|
155
|
+
end
|
156
156
|
|
157
|
+
desc "compile static #{libeay32}"
|
158
|
+
file libeay32 => :compile_static_openssl do |t|
|
159
|
+
FileUtils.cp( static_openssl_builddir + 'libcrypto.a', libeay32.to_s )
|
160
|
+
end
|
157
161
|
|
158
|
-
#
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
+
desc "compile static #{libssleay32}"
|
163
|
+
file libssleay32 => :compile_static_openssl do |t|
|
164
|
+
FileUtils.cp( static_openssl_builddir + 'libssl.a', libssleay32.to_s )
|
165
|
+
end
|
162
166
|
|
163
167
|
|
164
|
-
# postgresql source file should be stored there
|
165
|
-
file POSTGRESQL_TARBALL => STATIC_SOURCESDIR do |t|
|
166
|
-
download( POSTGRESQL_SOURCE_URI, t.name )
|
167
|
-
end
|
168
168
|
|
169
|
-
#
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
run 'tar', '-xjf', POSTGRESQL_TARBALL.to_s, '-C', STATIC_POSTGRESQL_BUILDDIR.parent.to_s
|
174
|
-
mv POSTGRESQL_SHLIB_MAKEFILE, POSTGRESQL_SHLIB_MF_ORIG
|
175
|
-
|
176
|
-
POSTGRESQL_PATCHES.each do |patchfile|
|
177
|
-
puts " applying patch #{patchfile}..."
|
178
|
-
run 'patch', '-Np1', '-d', STATIC_POSTGRESQL_BUILDDIR.to_s,
|
179
|
-
'-i', File.expand_path( patchfile, BASEDIR )
|
180
|
-
end
|
181
|
-
end
|
169
|
+
#
|
170
|
+
# Static PostgreSQL build tasks
|
171
|
+
#
|
172
|
+
directory static_postgresql_builddir.to_s
|
182
173
|
|
183
|
-
# generate the makefile in a clean build location
|
184
|
-
file POSTGRESQL_GLOBAL_MAKEFILE => [ STATIC_POSTGRESQL_BUILDDIR, :openssl_libs ] do |t|
|
185
|
-
options = [
|
186
|
-
'--target=i386-mingw32',
|
187
|
-
"--host=#{Rake::ExtensionCompiler.mingw_host}",
|
188
|
-
'--with-openssl',
|
189
|
-
'--without-zlib',
|
190
|
-
'--disable-shared',
|
191
|
-
]
|
192
|
-
|
193
|
-
Dir.chdir( STATIC_POSTGRESQL_BUILDDIR ) do
|
194
|
-
configure_path = STATIC_POSTGRESQL_BUILDDIR + 'configure'
|
195
|
-
cmd = [ configure_path.to_s, *options ]
|
196
|
-
cmd << "CFLAGS=-L#{STATIC_OPENSSL_BUILDDIR}"
|
197
|
-
cmd << "LDFLAGS=-L#{STATIC_OPENSSL_BUILDDIR}"
|
198
|
-
cmd << "LDFLAGS_SL=-L#{STATIC_OPENSSL_BUILDDIR}"
|
199
|
-
cmd << "LIBS=-lwsock32 -lws2_32 -lgdi32"
|
200
|
-
cmd << "CPPFLAGS=-I#{STATIC_OPENSSL_BUILDDIR}/include"
|
201
|
-
|
202
|
-
run( *cmd )
|
203
|
-
end
|
204
|
-
end
|
205
174
|
|
175
|
+
# postgresql source file should be stored there
|
176
|
+
file postgresql_tarball => static_sourcesdir do |t|
|
177
|
+
download( postgresql_source_uri, t.name )
|
178
|
+
end
|
206
179
|
|
207
|
-
#
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
180
|
+
# Extract the postgresql sources
|
181
|
+
file static_postgresql_builddir => postgresql_tarball do |t|
|
182
|
+
puts "extracting %s to %s" % [ postgresql_tarball, static_postgresql_builddir.parent ]
|
183
|
+
static_postgresql_builddir.mkpath
|
184
|
+
run 'tar', '-xjf', postgresql_tarball.to_s, '-C', static_postgresql_builddir.parent.to_s
|
185
|
+
mv postgresql_shlib_makefile, postgresql_shlib_mf_orig
|
186
|
+
|
187
|
+
postgresql_patches.each do |patchfile|
|
188
|
+
puts " applying patch #{patchfile}..."
|
189
|
+
run 'patch', '-Np1', '-d', static_postgresql_builddir.to_s,
|
190
|
+
'-i', File.expand_path( patchfile, BASEDIR )
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
# generate the makefile in a clean build location
|
195
|
+
file postgresql_global_makefile => [ static_postgresql_builddir, :openssl_libs ] do |t|
|
196
|
+
options = [
|
197
|
+
"--target=#{host_platform}",
|
198
|
+
"--host=#{host_platform}",
|
199
|
+
'--with-openssl',
|
200
|
+
'--without-zlib',
|
201
|
+
'--disable-shared',
|
202
|
+
]
|
203
|
+
|
204
|
+
Dir.chdir( static_postgresql_builddir ) do
|
205
|
+
configure_path = static_postgresql_builddir + 'configure'
|
206
|
+
cmd = [ configure_path.to_s, *options ]
|
207
|
+
cmd << "CFLAGS=-L#{static_openssl_builddir}"
|
208
|
+
cmd << "LDFLAGS=-L#{static_openssl_builddir}"
|
209
|
+
cmd << "LDFLAGS_SL=-L#{static_openssl_builddir}"
|
210
|
+
cmd << "LIBS=-lwsock32 -lgdi32"
|
211
|
+
cmd << "CPPFLAGS=-I#{static_openssl_builddir}/include"
|
212
|
+
|
213
|
+
run( *cmd )
|
214
|
+
end
|
214
215
|
end
|
215
|
-
end
|
216
|
-
tf.close
|
217
216
|
|
218
|
-
FileUtils.mv( tf.path, t.name, :verbose => $puts )
|
219
|
-
end
|
220
217
|
|
218
|
+
# patch the Makefile.shlib -- depend on the build dir so it's only
|
219
|
+
# rewritten if the tarball is re-extracted.
|
220
|
+
file postgresql_shlib_makefile => postgresql_shlib_mf_orig do |t|
|
221
|
+
tf = Tempfile.new( postgresql_shlib_makefile.basename.to_s )
|
222
|
+
postgresql_shlib_mf_orig.open( File::RDONLY ) do |ifh|
|
223
|
+
ifh.each_line do |line|
|
224
|
+
tf.print( line.sub(/^(\s*haslibarule\s*=\s*yes)/, "# \\1 ") )
|
225
|
+
end
|
226
|
+
end
|
227
|
+
tf.close
|
221
228
|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
229
|
+
FileUtils.mv( tf.path, t.name, :verbose => $puts )
|
230
|
+
end
|
231
|
+
|
232
|
+
|
233
|
+
# make libpq.a
|
234
|
+
task postgresql_lib => [ postgresql_global_makefile, postgresql_shlib_makefile ] do |t|
|
235
|
+
Dir.chdir( postgresql_lib.dirname ) do
|
236
|
+
sh 'make', "-j#{NUM_CPUS}", postgresql_lib.basename.to_s, 'PORTNAME=win32'
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
|
241
|
+
#desc 'compile static libpg.a'
|
242
|
+
task :static_libpq => postgresql_lib
|
226
243
|
end
|
227
244
|
end
|
228
245
|
|
229
|
-
|
230
|
-
|
231
|
-
|
246
|
+
if File.exist?(File.expand_path("~/.rake-compiler/config.yml"))
|
247
|
+
CrossLibraries = [
|
248
|
+
['i386-mingw32', 'mingw'],
|
249
|
+
['x64-mingw32', 'mingw64'],
|
250
|
+
].map do |platform, openssl_config|
|
251
|
+
CrossLibrary.new platform, openssl_config
|
252
|
+
end
|
253
|
+
else
|
254
|
+
$stderr.puts "Cross-compilation disabled -- rake-compiler not properly installed"
|
255
|
+
CrossLibraries = []
|
256
|
+
end
|
232
257
|
|
233
258
|
desc 'cross compile pg for win32'
|
234
259
|
task :cross do
|