postgres 0.7.9.2008.01.09 → 0.7.9.2008.01.24
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/ext/extconf.rb +43 -4
- metadata +2 -2
data/ext/extconf.rb
CHANGED
@@ -1,5 +1,45 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
|
2
|
+
|
3
|
+
# windows compatibility, need different library name
|
4
|
+
if(PLATFORM =~ /mingw|mswin/) then
|
5
|
+
$libname = '/ms/libpq.lib'
|
6
|
+
else
|
7
|
+
$libname = 'pq'
|
8
|
+
end
|
9
|
+
|
10
|
+
if(PLATFORM =~ /darwin/) then
|
11
|
+
# test if postgresql is probably universal
|
12
|
+
bindir = (IO.popen("pg_config --bindir").readline.chomp rescue nil)
|
13
|
+
filetype = (IO.popen("file #{bindir}/pg_config").
|
14
|
+
readline.chomp rescue nil)
|
15
|
+
# if it's not universal, ARCHFLAGS should be set
|
16
|
+
if((filetype !~ /universal binary/) && ENV['ARCHFLAGS'].nil?) then
|
17
|
+
arch = (IO.popen("uname -m").readline.chomp rescue nil)
|
18
|
+
$stderr.write %{
|
19
|
+
=========== WARNING ===========
|
20
|
+
|
21
|
+
You are building this extension on OS X without setting the
|
22
|
+
ARCHFLAGS environment variable, and PostgreSQL does not appear
|
23
|
+
to have been built as a universal binary. If you are seeing this
|
24
|
+
message, that means that the build will probably fail.
|
25
|
+
|
26
|
+
Try setting the environment variable ARCHFLAGS
|
27
|
+
to '-arch #{arch}' before building.
|
28
|
+
|
29
|
+
For example:
|
30
|
+
(in bash) $ export ARCHFLAGS='-arch #{arch}'
|
31
|
+
(in tcsh) $ setenv ARCHFLAGS '-arch #{arch}'
|
32
|
+
|
33
|
+
Then try building again.
|
34
|
+
|
35
|
+
===================================
|
36
|
+
}
|
37
|
+
# We don't exit here. Who knows? It might build.
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
if RUBY_VERSION < '1.8'
|
42
|
+
puts 'This library is for ruby-1.8 or higher.'
|
3
43
|
exit 1
|
4
44
|
end
|
5
45
|
|
@@ -14,7 +54,7 @@ def pg_config(type)
|
|
14
54
|
end
|
15
55
|
|
16
56
|
def have_build_env
|
17
|
-
have_library(
|
57
|
+
have_library($libname) && have_header('libpq-fe.h') && have_header('libpq/libpq-fs.h')
|
18
58
|
end
|
19
59
|
|
20
60
|
dir_config('pgsql', config_value('include'), config_value('lib'))
|
@@ -27,7 +67,6 @@ if have_build_env
|
|
27
67
|
required_libraries.each(&method(:have_library))
|
28
68
|
desired_functions.each(&method(:have_func))
|
29
69
|
$objs = ['postgres.o','libpq-compat.o'] if compat_functions.all?(&method(:have_func))
|
30
|
-
$CFLAGS << ' -Wall '
|
31
70
|
create_makefile("postgres")
|
32
71
|
else
|
33
72
|
puts 'Could not find PostgreSQL build environment (libraries & headers): Makefile not created'
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: postgres
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.7.9.2008.01.
|
7
|
-
date: 2008-01-
|
6
|
+
version: 0.7.9.2008.01.24
|
7
|
+
date: 2008-01-24 00:00:00 -08:00
|
8
8
|
summary: Ruby extension library providing an API to PostgreSQL
|
9
9
|
require_paths:
|
10
10
|
- lib
|