qoobaa-pg 0.8.1

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/compat.h ADDED
@@ -0,0 +1,180 @@
1
+
2
+ #ifndef __compat_h
3
+ #define __compat_h
4
+
5
+ #include <stdlib.h>
6
+
7
+ #include "libpq-fe.h"
8
+ #include "libpq/libpq-fs.h" /* large-object interface */
9
+
10
+ #include "ruby.h"
11
+
12
+ /* pg_config.h does not exist in older versions of
13
+ * PostgreSQL, so I can't effectively use PG_VERSION_NUM
14
+ * Instead, I create some #defines to help organization.
15
+ */
16
+ #ifndef HAVE_PQCONNECTIONUSEDPASSWORD
17
+ #define PG_BEFORE_080300
18
+ #endif
19
+
20
+ #ifndef HAVE_PQISTHREADSAFE
21
+ #define PG_BEFORE_080200
22
+ #endif
23
+
24
+ #ifndef HAVE_LO_CREATE
25
+ #define PG_BEFORE_080100
26
+ #endif
27
+
28
+ #ifndef HAVE_PQPREPARE
29
+ #define PG_BEFORE_080000
30
+ #endif
31
+
32
+ #ifndef HAVE_PQEXECPARAMS
33
+ #define PG_BEFORE_070400
34
+ #endif
35
+
36
+ #ifndef HAVE_PQESCAPESTRINGCONN
37
+ #define PG_BEFORE_070300
38
+ #error PostgreSQL client version too old, requires 7.3 or later.
39
+ #endif
40
+
41
+ /* This is necessary because NAMEDATALEN is defined in
42
+ * pg_config_manual.h in 8.3, and that include file doesn't
43
+ * exist before 7.4
44
+ */
45
+ #ifndef PG_BEFORE_070400
46
+ #include "pg_config_manual.h"
47
+ #endif
48
+
49
+ #ifndef PG_DIAG_INTERNAL_POSITION
50
+ #define PG_DIAG_INTERNAL_POSITION 'p'
51
+ #endif /* PG_DIAG_INTERNAL_POSITION */
52
+
53
+ #ifndef PG_DIAG_INTERNAL_QUERY
54
+ #define PG_DIAG_INTERNAL_QUERY 'q'
55
+ #endif /* PG_DIAG_INTERNAL_QUERY */
56
+
57
+ #ifdef PG_BEFORE_080300
58
+
59
+ #ifndef HAVE_PG_ENCODING_TO_CHAR
60
+ #define pg_encoding_to_char(x) "SQL_ASCII"
61
+ #else
62
+ /* Some versions ofPostgreSQL prior to 8.3 define pg_encoding_to_char
63
+ * but do not declare it in a header file, so this declaration will
64
+ * eliminate an unecessary warning
65
+ */
66
+ extern char* pg_encoding_to_char(int);
67
+ #endif /* HAVE_PG_ENCODING_TO_CHAR */
68
+
69
+ int PQconnectionNeedsPassword(PGconn *conn);
70
+ int PQconnectionUsedPassword(PGconn *conn);
71
+ int lo_truncate(PGconn *conn, int fd, size_t len);
72
+
73
+ #endif /* PG_BEFORE_080300 */
74
+
75
+ #ifdef PG_BEFORE_080200
76
+ int PQisthreadsafe(void);
77
+ int PQnparams(const PGresult *res);
78
+ Oid PQparamtype(const PGresult *res, int param_number);
79
+ PGresult * PQdescribePrepared(PGconn *conn, const char *stmtName);
80
+ PGresult * PQdescribePortal(PGconn *conn, const char *portalName);
81
+ int PQsendDescribePrepared(PGconn *conn, const char *stmtName);
82
+ int PQsendDescribePortal(PGconn *conn, const char *portalName);
83
+ char *PQencryptPassword(const char *passwd, const char *user);
84
+ #endif /* PG_BEFORE_080200 */
85
+
86
+ #ifdef PG_BEFORE_080100
87
+ Oid lo_create(PGconn *conn, Oid lobjId);
88
+ #endif /* PG_BEFORE_080100 */
89
+
90
+ #ifdef PG_BEFORE_080000
91
+ PGresult *PQprepare(PGconn *conn, const char *stmtName, const char *query,
92
+ int nParams, const Oid *paramTypes);
93
+ int PQsendPrepare(PGconn *conn, const char *stmtName, const char *query,
94
+ int nParams, const Oid *paramTypes);
95
+ int PQserverVersion(const PGconn* conn);
96
+ #endif /* PG_BEFORE_080000 */
97
+
98
+ #ifdef PG_BEFORE_070400
99
+
100
+ #define PG_DIAG_SEVERITY 'S'
101
+ #define PG_DIAG_SQLSTATE 'C'
102
+ #define PG_DIAG_MESSAGE_PRIMARY 'M'
103
+ #define PG_DIAG_MESSAGE_DETAIL 'D'
104
+ #define PG_DIAG_MESSAGE_HINT 'H'
105
+ #define PG_DIAG_STATEMENT_POSITION 'P'
106
+ #define PG_DIAG_CONTEXT 'W'
107
+ #define PG_DIAG_SOURCE_FILE 'F'
108
+ #define PG_DIAG_SOURCE_LINE 'L'
109
+ #define PG_DIAG_SOURCE_FUNCTION 'R'
110
+
111
+ #define PQfreemem(ptr) free(ptr)
112
+ #define PGNOTIFY_EXTRA(notify) ""
113
+
114
+ /* CONNECTION_SSL_STARTUP was added to an enum type
115
+ * after 7.3. For 7.3 in order to compile, we just need
116
+ * it to evaluate to something that is not present in that
117
+ * enum.
118
+ */
119
+ #define CONNECTION_SSL_STARTUP 1000000
120
+
121
+ typedef void (*PQnoticeReceiver) (void *arg, const PGresult *res);
122
+
123
+ typedef enum
124
+ {
125
+ PQERRORS_TERSE, /* single-line error messages */
126
+ PQERRORS_DEFAULT, /* recommended style */
127
+ PQERRORS_VERBOSE /* all the facts, ma'am */
128
+ } PGVerbosity;
129
+
130
+ typedef enum
131
+ {
132
+ PQTRANS_IDLE, /* connection idle */
133
+ PQTRANS_ACTIVE, /* command in progress */
134
+ PQTRANS_INTRANS, /* idle, within transaction block */
135
+ PQTRANS_INERROR, /* idle, within failed transaction */
136
+ PQTRANS_UNKNOWN /* cannot determine status */
137
+ } PGTransactionStatusType;
138
+
139
+ PGresult *PQexecParams(PGconn *conn, const char *command, int nParams,
140
+ const Oid *paramTypes, const char * const * paramValues, const int *paramLengths,
141
+ const int *paramFormats, int resultFormat);
142
+ PGTransactionStatusType PQtransactionStatus(const PGconn *conn);
143
+ char *PQparameterStatus(const PGconn *conn, const char *paramName);
144
+ int PQprotocolVersion(const PGconn *conn);
145
+ PGresult *PQexecPrepared(PGconn *conn, const char *stmtName, int nParams,
146
+ const char * const *ParamValues, const int *paramLengths, const int *paramFormats,
147
+ int resultFormat);
148
+ int PQsendQueryParams(PGconn *conn, const char *command, int nParams,
149
+ const Oid *paramTypes, const char * const * paramValues, const int *paramLengths,
150
+ const int *paramFormats, int resultFormat);
151
+ int PQsendQueryPrepared(PGconn *conn, const char *stmtName, int nParams,
152
+ const char * const *ParamValues, const int *paramLengths, const int *paramFormats,
153
+ int resultFormat);
154
+ int PQputCopyData(PGconn *conn, const char *buffer, int nbytes);
155
+ int PQputCopyEnd(PGconn *conn, const char *errormsg);
156
+ int PQgetCopyData(PGconn *conn, char **buffer, int async);
157
+ PGVerbosity PQsetErrorVerbosity(PGconn *conn, PGVerbosity verbosity);
158
+ Oid PQftable(const PGresult *res, int column_number);
159
+ int PQftablecol(const PGresult *res, int column_number);
160
+ int PQfformat(const PGresult *res, int column_number);
161
+ char *PQresultErrorField(const PGresult *res, int fieldcode);
162
+ PQnoticeReceiver PQsetNoticeReceiver(PGconn *conn, PQnoticeReceiver proc, void *arg);
163
+
164
+ #else
165
+ #define PGNOTIFY_EXTRA(notify) ((notify)->extra)
166
+ #endif /* PG_BEFORE_070400 */
167
+
168
+ #ifdef PG_BEFORE_070300
169
+ #error unsupported postgresql version, requires 7.3 or later.
170
+ int PQsetClientEncoding(PGconn *conn, const char *encoding)
171
+ size_t PQescapeString(char *to, const char *from, size_t length);
172
+ unsigned char * PQescapeBytea(const unsigned char *bintext, size_t binlen, size_t *bytealen);
173
+ unsigned char * PQunescapeBytea(const unsigned char *strtext, size_t *retbuflen);
174
+ size_t PQescapeStringConn(PGconn *conn, char *to, const char *from,
175
+ size_t length, int *error);
176
+ unsigned char *PQescapeByteaConn(PGconn *conn, const unsigned char *from,
177
+ size_t from_length, size_t *to_length);
178
+ #endif /* PG_BEFORE_070300 */
179
+
180
+ #endif /* __compat_h */
data/ext/extconf.rb ADDED
@@ -0,0 +1,87 @@
1
+ require 'mkmf'
2
+
3
+ begin
4
+ IO.popen("pg_config --version").readline.chomp
5
+ rescue
6
+ $stderr.write("ERROR: can't find pg_config.\n")
7
+ $stderr.write("HINT: Make sure pg_config is in your PATH\n")
8
+ exit 1
9
+ end
10
+
11
+ # OS X compatibility
12
+ if(RUBY_PLATFORM =~ /darwin/) then
13
+ # test if postgresql is probably universal
14
+ bindir = (IO.popen("pg_config --bindir").readline.chomp rescue nil)
15
+ filetype = (IO.popen("file #{bindir}/pg_config").
16
+ readline.chomp rescue nil)
17
+ # if it's not universal, ARCHFLAGS should be set
18
+ if((filetype !~ /universal binary/) && ENV['ARCHFLAGS'].nil?) then
19
+ arch_tmp = (IO.popen("uname -p").readline.chomp rescue nil)
20
+ if(arch_tmp == 'powerpc')
21
+ arch = 'ppc'
22
+ else
23
+ arch = 'i386'
24
+ end
25
+ $stderr.write %{
26
+ =========== WARNING ===========
27
+
28
+ You are building this extension on OS X without setting the
29
+ ARCHFLAGS environment variable, and PostgreSQL does not appear
30
+ to have been built as a universal binary. If you are seeing this
31
+ message, that means that the build will probably fail.
32
+
33
+ Try setting the environment variable ARCHFLAGS
34
+ to '-arch #{arch}' before building.
35
+
36
+ For example:
37
+ (in bash) $ export ARCHFLAGS='-arch #{arch}'
38
+ (in tcsh) % setenv ARCHFLAGS '-arch #{arch}'
39
+
40
+ Then try building again.
41
+
42
+ ===================================
43
+ }
44
+ # We don't exit here. Who knows? It might build.
45
+ end
46
+ end
47
+
48
+ if RUBY_VERSION < '1.8'
49
+ puts 'This library is for ruby-1.8 or higher.'
50
+ exit 1
51
+ end
52
+
53
+ def config_value(type)
54
+ ENV["POSTGRES_#{type.upcase}"] || pg_config(type)
55
+ end
56
+
57
+ def pg_config(type)
58
+ IO.popen("pg_config --#{type}dir").readline.chomp rescue nil
59
+ end
60
+
61
+ def have_build_env
62
+ (have_library('pq') || have_library('libpq') || have_library('ms/libpq')) &&
63
+ have_header('libpq-fe.h') && have_header('libpq/libpq-fs.h')
64
+ end
65
+
66
+ dir_config('pg', config_value('include'), config_value('lib'))
67
+
68
+ desired_functions = %w(
69
+ PQconnectionUsedPassword
70
+ PQisthreadsafe
71
+ PQprepare
72
+ PQexecParams
73
+ PQescapeString
74
+ PQescapeStringConn
75
+ lo_create
76
+ pg_encoding_to_char
77
+ PQsetClientEncoding
78
+ )
79
+
80
+ if have_build_env
81
+ desired_functions.each(&method(:have_func))
82
+ $OBJS = ['pg.o','compat.o']
83
+ create_makefile("pg")
84
+ else
85
+ puts 'Could not find PostgreSQL build environment (libraries & headers): Makefile not created'
86
+ end
87
+
@@ -0,0 +1,24 @@
1
+ # We can't use Ruby's standard build procedures
2
+ # on Windows because the Ruby executable is
3
+ # built with VC++ while here we want to build
4
+ # with MingW. So just roll our own...
5
+
6
+ require 'fileutils'
7
+ require 'rbconfig'
8
+
9
+ EXTENSION_NAME = "pg.#{Config::CONFIG["DLEXT"]}"
10
+
11
+ # This is called when the Windows GEM is installed!
12
+ task :install do
13
+ # Gems will pass these two environment variables:
14
+ # RUBYARCHDIR=#{dest_path}
15
+ # RUBYLIBDIR=#{dest_path}
16
+
17
+ dest_path = ENV['RUBYLIBDIR']
18
+ mkdir_p(dest_path)
19
+
20
+ # Copy the extension
21
+ cp(EXTENSION_NAME, dest_path)
22
+ end
23
+
24
+ task :default => :install
@@ -0,0 +1,40 @@
1
+ # We can't use Ruby's standard build procedures
2
+ # on Windows because the Ruby executable is
3
+ # built with VC++ while here we want to build
4
+ # with MingW. So just roll our own...
5
+
6
+ require 'rake/clean'
7
+ require 'rbconfig'
8
+
9
+ RUBY_INCLUDE_DIR = Config::CONFIG["archdir"]
10
+ RUBY_BIN_DIR = Config::CONFIG["bindir"]
11
+ RUBY_LIB_DIR = Config::CONFIG["libdir"]
12
+ RUBY_SHARED_LIB = Config::CONFIG["LIBRUBY"]
13
+ RUBY_SHARED_DLL = RUBY_SHARED_LIB.gsub(/lib$/, 'dll')
14
+
15
+ EXTENSION_NAME = "pg.#{Config::CONFIG["DLEXT"]}"
16
+
17
+ CLEAN.include('*.o')
18
+ CLOBBER.include(EXTENSION_NAME)
19
+
20
+ task :default => "pg"
21
+
22
+ DEFINES = "-DHAVE_LIBPQ_FE_H -DHAVE_LIBPQ_LIBPQ_FS_H -DHAVE_PQCONNECTIONUSEDPASSWORD -DHAVE_PQISTHREADSAFE -DHAVE_LO_CREATE -DHAVE_PQPREPARE -DHAVE_PQEXECPARAMS -DHAVE_PQESCAPESTRING -DHAVE_PQESCAPESTRINGCONN -DHAVE_PG_ENCODING_TO_CHAR -DHAVE_PQSETCLIENTENCODING"
23
+ LIBS = "-lpq -lm"
24
+ SRC = FileList['../*.c']
25
+ OBJ = SRC.collect do |file_name|
26
+ File.basename(file_name).ext('o')
27
+ end
28
+
29
+ SRC.each do |srcfile|
30
+ objfile = File.basename(srcfile).ext('o')
31
+ file objfile => srcfile do
32
+ command = "gcc -c -O2 -Wall #{DEFINES} -o #{objfile} -I/usr/local/include #{srcfile} -I#{RUBY_INCLUDE_DIR}"
33
+ sh "sh -c '#{command}'"
34
+ end
35
+ end
36
+
37
+ file "pg" => OBJ do
38
+ command = "gcc -shared -o #{EXTENSION_NAME} #{OBJ} -L/usr/local/lib #{LIBS} #{RUBY_BIN_DIR}/#{RUBY_SHARED_DLL}"
39
+ sh "sh -c '#{command}'"
40
+ end
data/ext/mkmf.log ADDED
@@ -0,0 +1,316 @@
1
+ have_library: checking for main() in -lpq... -------------------- yes
2
+
3
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpthread -lrt -ldl -lcrypt -lm -lc"
4
+ checked program was:
5
+ /* begin */
6
+ 1: #include "ruby.h"
7
+ 2:
8
+ 3: int main() {return 0;}
9
+ /* end */
10
+
11
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
12
+ checked program was:
13
+ /* begin */
14
+ 1: #include "ruby.h"
15
+ 2:
16
+ 3: /*top*/
17
+ 4: int main() {return 0;}
18
+ 5: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }
19
+ /* end */
20
+
21
+ --------------------
22
+
23
+ have_header: checking for libpq-fe.h... -------------------- yes
24
+
25
+ "gcc -E -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -o conftest.i"
26
+ checked program was:
27
+ /* begin */
28
+ 1: #include "ruby.h"
29
+ 2:
30
+ 3: #include <libpq-fe.h>
31
+ /* end */
32
+
33
+ --------------------
34
+
35
+ have_header: checking for libpq/libpq-fs.h... -------------------- yes
36
+
37
+ "gcc -E -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -o conftest.i"
38
+ checked program was:
39
+ /* begin */
40
+ 1: #include "ruby.h"
41
+ 2:
42
+ 3: #include <libpq/libpq-fs.h>
43
+ /* end */
44
+
45
+ --------------------
46
+
47
+ have_func: checking for PQconnectionUsedPassword()... -------------------- yes
48
+
49
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
50
+ conftest.c: In function ‘t’:
51
+ conftest.c:5: error: ‘PQconnectionUsedPassword’ undeclared (first use in this function)
52
+ conftest.c:5: error: (Each undeclared identifier is reported only once
53
+ conftest.c:5: error: for each function it appears in.)
54
+ checked program was:
55
+ /* begin */
56
+ 1: #include "ruby.h"
57
+ 2:
58
+ 3: /*top*/
59
+ 4: int main() {return 0;}
60
+ 5: int t() { void ((*volatile p)()); p = (void ((*)()))PQconnectionUsedPassword; return 0; }
61
+ /* end */
62
+
63
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
64
+ conftest.c: In function ‘t’:
65
+ conftest.c:5: warning: implicit declaration of function ‘PQconnectionUsedPassword’
66
+ checked program was:
67
+ /* begin */
68
+ 1: #include "ruby.h"
69
+ 2:
70
+ 3: /*top*/
71
+ 4: int main() {return 0;}
72
+ 5: int t() { PQconnectionUsedPassword(); return 0; }
73
+ /* end */
74
+
75
+ --------------------
76
+
77
+ have_func: checking for PQisthreadsafe()... -------------------- yes
78
+
79
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
80
+ conftest.c: In function ‘t’:
81
+ conftest.c:5: error: ‘PQisthreadsafe’ undeclared (first use in this function)
82
+ conftest.c:5: error: (Each undeclared identifier is reported only once
83
+ conftest.c:5: error: for each function it appears in.)
84
+ checked program was:
85
+ /* begin */
86
+ 1: #include "ruby.h"
87
+ 2:
88
+ 3: /*top*/
89
+ 4: int main() {return 0;}
90
+ 5: int t() { void ((*volatile p)()); p = (void ((*)()))PQisthreadsafe; return 0; }
91
+ /* end */
92
+
93
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
94
+ conftest.c: In function ‘t’:
95
+ conftest.c:5: warning: implicit declaration of function ‘PQisthreadsafe’
96
+ checked program was:
97
+ /* begin */
98
+ 1: #include "ruby.h"
99
+ 2:
100
+ 3: /*top*/
101
+ 4: int main() {return 0;}
102
+ 5: int t() { PQisthreadsafe(); return 0; }
103
+ /* end */
104
+
105
+ --------------------
106
+
107
+ have_func: checking for PQprepare()... -------------------- yes
108
+
109
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
110
+ conftest.c: In function ‘t’:
111
+ conftest.c:5: error: ‘PQprepare’ undeclared (first use in this function)
112
+ conftest.c:5: error: (Each undeclared identifier is reported only once
113
+ conftest.c:5: error: for each function it appears in.)
114
+ checked program was:
115
+ /* begin */
116
+ 1: #include "ruby.h"
117
+ 2:
118
+ 3: /*top*/
119
+ 4: int main() {return 0;}
120
+ 5: int t() { void ((*volatile p)()); p = (void ((*)()))PQprepare; return 0; }
121
+ /* end */
122
+
123
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
124
+ conftest.c: In function ‘t’:
125
+ conftest.c:5: warning: implicit declaration of function ‘PQprepare’
126
+ checked program was:
127
+ /* begin */
128
+ 1: #include "ruby.h"
129
+ 2:
130
+ 3: /*top*/
131
+ 4: int main() {return 0;}
132
+ 5: int t() { PQprepare(); return 0; }
133
+ /* end */
134
+
135
+ --------------------
136
+
137
+ have_func: checking for PQexecParams()... -------------------- yes
138
+
139
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
140
+ conftest.c: In function ‘t’:
141
+ conftest.c:5: error: ‘PQexecParams’ undeclared (first use in this function)
142
+ conftest.c:5: error: (Each undeclared identifier is reported only once
143
+ conftest.c:5: error: for each function it appears in.)
144
+ checked program was:
145
+ /* begin */
146
+ 1: #include "ruby.h"
147
+ 2:
148
+ 3: /*top*/
149
+ 4: int main() {return 0;}
150
+ 5: int t() { void ((*volatile p)()); p = (void ((*)()))PQexecParams; return 0; }
151
+ /* end */
152
+
153
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
154
+ conftest.c: In function ‘t’:
155
+ conftest.c:5: warning: implicit declaration of function ‘PQexecParams’
156
+ checked program was:
157
+ /* begin */
158
+ 1: #include "ruby.h"
159
+ 2:
160
+ 3: /*top*/
161
+ 4: int main() {return 0;}
162
+ 5: int t() { PQexecParams(); return 0; }
163
+ /* end */
164
+
165
+ --------------------
166
+
167
+ have_func: checking for PQescapeString()... -------------------- yes
168
+
169
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
170
+ conftest.c: In function ‘t’:
171
+ conftest.c:5: error: ‘PQescapeString’ undeclared (first use in this function)
172
+ conftest.c:5: error: (Each undeclared identifier is reported only once
173
+ conftest.c:5: error: for each function it appears in.)
174
+ checked program was:
175
+ /* begin */
176
+ 1: #include "ruby.h"
177
+ 2:
178
+ 3: /*top*/
179
+ 4: int main() {return 0;}
180
+ 5: int t() { void ((*volatile p)()); p = (void ((*)()))PQescapeString; return 0; }
181
+ /* end */
182
+
183
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
184
+ conftest.c: In function ‘t’:
185
+ conftest.c:5: warning: implicit declaration of function ‘PQescapeString’
186
+ checked program was:
187
+ /* begin */
188
+ 1: #include "ruby.h"
189
+ 2:
190
+ 3: /*top*/
191
+ 4: int main() {return 0;}
192
+ 5: int t() { PQescapeString(); return 0; }
193
+ /* end */
194
+
195
+ --------------------
196
+
197
+ have_func: checking for PQescapeStringConn()... -------------------- yes
198
+
199
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
200
+ conftest.c: In function ‘t’:
201
+ conftest.c:5: error: ‘PQescapeStringConn’ undeclared (first use in this function)
202
+ conftest.c:5: error: (Each undeclared identifier is reported only once
203
+ conftest.c:5: error: for each function it appears in.)
204
+ checked program was:
205
+ /* begin */
206
+ 1: #include "ruby.h"
207
+ 2:
208
+ 3: /*top*/
209
+ 4: int main() {return 0;}
210
+ 5: int t() { void ((*volatile p)()); p = (void ((*)()))PQescapeStringConn; return 0; }
211
+ /* end */
212
+
213
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
214
+ conftest.c: In function ‘t’:
215
+ conftest.c:5: warning: implicit declaration of function ‘PQescapeStringConn’
216
+ checked program was:
217
+ /* begin */
218
+ 1: #include "ruby.h"
219
+ 2:
220
+ 3: /*top*/
221
+ 4: int main() {return 0;}
222
+ 5: int t() { PQescapeStringConn(); return 0; }
223
+ /* end */
224
+
225
+ --------------------
226
+
227
+ have_func: checking for lo_create()... -------------------- yes
228
+
229
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
230
+ conftest.c: In function ‘t’:
231
+ conftest.c:5: error: ‘lo_create’ undeclared (first use in this function)
232
+ conftest.c:5: error: (Each undeclared identifier is reported only once
233
+ conftest.c:5: error: for each function it appears in.)
234
+ checked program was:
235
+ /* begin */
236
+ 1: #include "ruby.h"
237
+ 2:
238
+ 3: /*top*/
239
+ 4: int main() {return 0;}
240
+ 5: int t() { void ((*volatile p)()); p = (void ((*)()))lo_create; return 0; }
241
+ /* end */
242
+
243
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
244
+ conftest.c: In function ‘t’:
245
+ conftest.c:5: warning: implicit declaration of function ‘lo_create’
246
+ checked program was:
247
+ /* begin */
248
+ 1: #include "ruby.h"
249
+ 2:
250
+ 3: /*top*/
251
+ 4: int main() {return 0;}
252
+ 5: int t() { lo_create(); return 0; }
253
+ /* end */
254
+
255
+ --------------------
256
+
257
+ have_func: checking for pg_encoding_to_char()... -------------------- yes
258
+
259
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
260
+ conftest.c: In function ‘t’:
261
+ conftest.c:5: error: ‘pg_encoding_to_char’ undeclared (first use in this function)
262
+ conftest.c:5: error: (Each undeclared identifier is reported only once
263
+ conftest.c:5: error: for each function it appears in.)
264
+ checked program was:
265
+ /* begin */
266
+ 1: #include "ruby.h"
267
+ 2:
268
+ 3: /*top*/
269
+ 4: int main() {return 0;}
270
+ 5: int t() { void ((*volatile p)()); p = (void ((*)()))pg_encoding_to_char; return 0; }
271
+ /* end */
272
+
273
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
274
+ conftest.c: In function ‘t’:
275
+ conftest.c:5: warning: implicit declaration of function ‘pg_encoding_to_char’
276
+ checked program was:
277
+ /* begin */
278
+ 1: #include "ruby.h"
279
+ 2:
280
+ 3: /*top*/
281
+ 4: int main() {return 0;}
282
+ 5: int t() { pg_encoding_to_char(); return 0; }
283
+ /* end */
284
+
285
+ --------------------
286
+
287
+ have_func: checking for PQsetClientEncoding()... -------------------- yes
288
+
289
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
290
+ conftest.c: In function ‘t’:
291
+ conftest.c:5: error: ‘PQsetClientEncoding’ undeclared (first use in this function)
292
+ conftest.c:5: error: (Each undeclared identifier is reported only once
293
+ conftest.c:5: error: for each function it appears in.)
294
+ checked program was:
295
+ /* begin */
296
+ 1: #include "ruby.h"
297
+ 2:
298
+ 3: /*top*/
299
+ 4: int main() {return 0;}
300
+ 5: int t() { void ((*volatile p)()); p = (void ((*)()))PQsetClientEncoding; return 0; }
301
+ /* end */
302
+
303
+ "gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -I/usr/include/postgresql -O2 -g -Wall -Wno-parentheses conftest.c -L. -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L. -rdynamic -Wl,-export-dynamic -lpq -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static -lpq -lpthread -lrt -ldl -lcrypt -lm -lc"
304
+ conftest.c: In function ‘t’:
305
+ conftest.c:5: warning: implicit declaration of function ‘PQsetClientEncoding’
306
+ checked program was:
307
+ /* begin */
308
+ 1: #include "ruby.h"
309
+ 2:
310
+ 3: /*top*/
311
+ 4: int main() {return 0;}
312
+ 5: int t() { PQsetClientEncoding(); return 0; }
313
+ /* end */
314
+
315
+ --------------------
316
+