ibm_db 2.5.17-universal-darwin-13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGES +221 -0
- data/LICENSE +18 -0
- data/MANIFEST +14 -0
- data/ParameterizedQueries README +39 -0
- data/README +225 -0
- data/ext/Makefile.nt32 +181 -0
- data/ext/Makefile.nt32.191 +212 -0
- data/ext/extconf.rb +127 -0
- data/ext/ibm_db.c +11719 -0
- data/ext/ruby_ibm_db.h +240 -0
- data/ext/ruby_ibm_db_cli.c +845 -0
- data/ext/ruby_ibm_db_cli.h +489 -0
- data/init.rb +42 -0
- data/lib/IBM_DB.rb +16 -0
- data/lib/active_record/connection_adapters/ibm_db_adapter.rb +3031 -0
- data/lib/active_record/connection_adapters/ibm_db_pstmt.rb +1965 -0
- data/lib/active_record/connection_adapters/ibmdb_adapter.rb +2 -0
- data/lib/active_record/vendor/db2-i5-zOS.yaml +328 -0
- data/lib/linux/rb18x/ibm_db.bundle +0 -0
- data/lib/linux/rb19x/ibm_db.bundle +0 -0
- data/lib/linux/rb20x/ibm_db.bundle +0 -0
- data/lib/linux/rb21x/ibm_db.bundle +0 -0
- data/test/cases/adapter_test.rb +207 -0
- data/test/cases/associations/belongs_to_associations_test.rb +711 -0
- data/test/cases/associations/cascaded_eager_loading_test.rb +181 -0
- data/test/cases/associations/has_and_belongs_to_many_associations_test.rb +851 -0
- data/test/cases/associations/join_model_test.rb +743 -0
- data/test/cases/attribute_methods_test.rb +822 -0
- data/test/cases/base_test.rb +2133 -0
- data/test/cases/calculations_test.rb +482 -0
- data/test/cases/migration_test.rb +2408 -0
- data/test/cases/persistence_test.rb +642 -0
- data/test/cases/query_cache_test.rb +257 -0
- data/test/cases/relations_test.rb +1182 -0
- data/test/cases/schema_dumper_test.rb +256 -0
- data/test/cases/transaction_callbacks_test.rb +300 -0
- data/test/cases/validations/uniqueness_validation_test.rb +299 -0
- data/test/cases/xml_serialization_test.rb +408 -0
- data/test/config.yml +154 -0
- data/test/connections/native_ibm_db/connection.rb +44 -0
- data/test/ibm_db_test.rb +25 -0
- data/test/models/warehouse_thing.rb +5 -0
- data/test/schema/i5/ibm_db_specific_schema.rb +137 -0
- data/test/schema/ids/ibm_db_specific_schema.rb +140 -0
- data/test/schema/luw/ibm_db_specific_schema.rb +137 -0
- data/test/schema/schema.rb +751 -0
- data/test/schema/zOS/ibm_db_specific_schema.rb +208 -0
- metadata +109 -0
data/ext/Makefile.nt32
ADDED
@@ -0,0 +1,181 @@
|
|
1
|
+
|
2
|
+
SHELL = /bin/sh
|
3
|
+
|
4
|
+
#### Start of system configuration section. ####
|
5
|
+
|
6
|
+
srcdir = .
|
7
|
+
topdir =$(TOP)/opendbad/win/ruby_win_exes/ruby_1.8.6/lib/ruby/1.8/i386-mswin32
|
8
|
+
hdrdir = $(topdir)
|
9
|
+
VPATH = $(srcdir);$(topdir);$(hdrdir)
|
10
|
+
|
11
|
+
|
12
|
+
DESTDIR = $(TOP)/opendbad/win/ruby_win_exes
|
13
|
+
prefix = $(DESTDIR)/ruby_1.8.6
|
14
|
+
exec_prefix = $(DESTDIR)/ruby_1.8.6
|
15
|
+
sitedir = $(prefix)/lib/ruby/site_ruby
|
16
|
+
rubylibdir = $(libdir)/ruby/$(ruby_version)
|
17
|
+
archdir = $(rubylibdir)/$(arch)
|
18
|
+
sbindir = $(exec_prefix)/sbin
|
19
|
+
datadir = $(prefix)/share
|
20
|
+
includedir = $(prefix)/include
|
21
|
+
infodir = $(prefix)/info
|
22
|
+
sysconfdir = $(prefix)/etc
|
23
|
+
mandir = $(prefix)/man
|
24
|
+
libdir = $(DESTDIR)/ruby_1.8.6/lib
|
25
|
+
sharedstatedir = $(DESTDIR)/etc
|
26
|
+
oldincludedir = $(DESTDIR)/usr/include
|
27
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
28
|
+
localstatedir = $(DESTDIR)/var
|
29
|
+
bindir = $(exec_prefix)/bin
|
30
|
+
sitelibdir = $(sitedir)/$(ruby_version)
|
31
|
+
libexecdir = $(exec_prefix)/libexec
|
32
|
+
|
33
|
+
CC = cl -nologo
|
34
|
+
LIBRUBY = $(RUBY_SO_NAME).lib
|
35
|
+
LIBRUBY_A = msvcrt-ruby18-static.lib
|
36
|
+
LIBRUBYARG_SHARED = $(LIBRUBY)
|
37
|
+
LIBRUBYARG_STATIC = $(LIBRUBY_A)
|
38
|
+
|
39
|
+
RUBY_EXTCONF_H =
|
40
|
+
CFLAGS = -MT -Zi -O2b2xg- -G6
|
41
|
+
INCFLAGS = -I. -I. -I$(topdir) -I.
|
42
|
+
CPPFLAGS =
|
43
|
+
CXXFLAGS = $(CFLAGS)
|
44
|
+
DLDFLAGS = -link -incremental:no -debug -opt:ref -opt:icf -dll $(LIBPATH) -def:$(DEFFILE) -implib:$(*F:.so=)-$(arch).lib -pdb:$(*F:.so=)-$(arch).pdb
|
45
|
+
LDSHARED = cl -nologo -LD
|
46
|
+
AR = lib -nologo
|
47
|
+
EXEEXT = .exe
|
48
|
+
|
49
|
+
RUBY_INSTALL_NAME = ruby
|
50
|
+
RUBY_SO_NAME = msvcrt-ruby18
|
51
|
+
arch = i386-mswin32
|
52
|
+
sitearch = i386-msvcrt
|
53
|
+
ruby_version = 1.8
|
54
|
+
ruby = $(TOP)/opendbad/win/ruby_win_exes/ruby_1.8.6/bin/ruby.exe
|
55
|
+
RUBY = $(ruby:/=\)
|
56
|
+
RM = $(RUBY) -run -e rm -- -f
|
57
|
+
MAKEDIRS = @$(RUBY) -run -e mkdir -- -p
|
58
|
+
INSTALL = @$(RUBY) -run -e install -- -vp
|
59
|
+
INSTALL_PROG = $(INSTALL) -m 0755
|
60
|
+
INSTALL_DATA = $(INSTALL) -m 0644
|
61
|
+
COPY = copy > nul
|
62
|
+
|
63
|
+
#### End of system configuration section. ####
|
64
|
+
|
65
|
+
preload =
|
66
|
+
|
67
|
+
libpath = $(libdir)
|
68
|
+
LIBPATH = -libpath:"$(libdir)"
|
69
|
+
DEFFILE = $(TARGET)-$(arch).def
|
70
|
+
|
71
|
+
CLEANFILES =
|
72
|
+
DISTCLEANFILES = vc*.pdb $(DEFFILE)
|
73
|
+
|
74
|
+
extout =
|
75
|
+
extout_prefix =
|
76
|
+
target_prefix =
|
77
|
+
LOCAL_LIBS =
|
78
|
+
LIBS = $(LIBRUBYARG_SHARED) db2cli.lib oldnames.lib user32.lib advapi32.lib ws2_32.lib libcmt.lib
|
79
|
+
SRCS = ibm_db.c ruby_ibm_db_cli.c
|
80
|
+
OBJS = ibm_db.obj ruby_ibm_db_cli.obj
|
81
|
+
TARGET = ibm_db
|
82
|
+
DLLIB = $(TARGET).so
|
83
|
+
EXTSTATIC =
|
84
|
+
STATIC_LIB =
|
85
|
+
|
86
|
+
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
87
|
+
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
88
|
+
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
89
|
+
|
90
|
+
TARGET_SO = $(DLLIB)
|
91
|
+
CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
|
92
|
+
CLEANOBJS = *.obj *.lib *.s[ol] *.pdb *.exp *.bak
|
93
|
+
|
94
|
+
all: $(DLLIB)
|
95
|
+
static: $(STATIC_LIB)
|
96
|
+
|
97
|
+
clean:
|
98
|
+
@-$(RM) $(CLEANLIBS:/=\) $(CLEANOBJS:/=\) $(CLEANFILES:/=\)
|
99
|
+
|
100
|
+
distclean: clean
|
101
|
+
@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
102
|
+
@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES:/=\)
|
103
|
+
|
104
|
+
realclean: distclean
|
105
|
+
install: install-so install-rb
|
106
|
+
|
107
|
+
install-so: $(RUBYARCHDIR)
|
108
|
+
install-so: $(RUBYARCHDIR)/$(DLLIB)
|
109
|
+
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
|
110
|
+
$(INSTALL_PROG) $(DLLIB:/=\) $(RUBYARCHDIR:/=\)
|
111
|
+
install-rb: pre-install-rb install-rb-default
|
112
|
+
install-rb-default: pre-install-rb-default
|
113
|
+
pre-install-rb: Makefile
|
114
|
+
pre-install-rb-default: Makefile
|
115
|
+
$(RUBYARCHDIR):
|
116
|
+
$(MAKEDIRS) $@
|
117
|
+
|
118
|
+
site-install: site-install-so site-install-rb
|
119
|
+
site-install-so: install-so
|
120
|
+
site-install-rb: install-rb
|
121
|
+
|
122
|
+
.SUFFIXES: .c .m .cc .cxx .cpp .obj
|
123
|
+
|
124
|
+
{$(srcdir)}.cc{}.obj:
|
125
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
126
|
+
|
127
|
+
{$(topdir)}.cc{}.obj:
|
128
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
129
|
+
|
130
|
+
{$(hdrdir)}.cc{}.obj:
|
131
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
132
|
+
|
133
|
+
.cc.obj:
|
134
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
135
|
+
|
136
|
+
{$(srcdir)}.cxx{}.obj:
|
137
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
138
|
+
|
139
|
+
{$(topdir)}.cxx{}.obj:
|
140
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
141
|
+
|
142
|
+
{$(hdrdir)}.cxx{}.obj:
|
143
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
144
|
+
|
145
|
+
.cxx.obj:
|
146
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
147
|
+
|
148
|
+
{$(srcdir)}.cpp{}.obj:
|
149
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
150
|
+
|
151
|
+
{$(topdir)}.cpp{}.obj:
|
152
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
153
|
+
|
154
|
+
{$(hdrdir)}.cpp{}.obj:
|
155
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
156
|
+
|
157
|
+
.cpp.obj:
|
158
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)
|
159
|
+
|
160
|
+
{$(srcdir)}.c{}.obj:
|
161
|
+
$(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
|
162
|
+
|
163
|
+
{$(topdir)}.c{}.obj:
|
164
|
+
$(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
|
165
|
+
|
166
|
+
{$(hdrdir)}.c{}.obj:
|
167
|
+
$(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
|
168
|
+
|
169
|
+
.c.obj:
|
170
|
+
$(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)
|
171
|
+
|
172
|
+
$(DLLIB): $(DEFFILE) $(OBJS)
|
173
|
+
@-$(RM) $@
|
174
|
+
$(LDSHARED) -Fe$(@) $(OBJS) $(LIBS) $(LOCAL_LIBS) $(DLDFLAGS)
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
$(DEFFILE):
|
179
|
+
$(RUBY) -e "puts 'EXPORTS', 'Init_$(TARGET)'" > $@
|
180
|
+
|
181
|
+
$(OBJS): {.;$(srcdir);$(topdir);$(hdrdir)}ruby.h {.;$(srcdir);$(topdir);$(hdrdir)}defines.h
|
@@ -0,0 +1,212 @@
|
|
1
|
+
|
2
|
+
SHELL = /bin/sh
|
3
|
+
|
4
|
+
#### Start of system configuration section. ####
|
5
|
+
|
6
|
+
srcdir = .
|
7
|
+
topdir = $(TOP)/opendbad/win/ruby_win_exes/ruby191/include/ruby-1.9.1
|
8
|
+
hdrdir = $(TOP)/opendbad/win/ruby_win_exes/ruby191/include/ruby-1.9.1
|
9
|
+
arch_hdrdir = $(TOP)/opendbad/win/ruby_win_exes/ruby191/include/ruby-1.9.1/$(arch)
|
10
|
+
VPATH = $(srcdir);$(arch_hdrdir)/ruby;$(hdrdir)/ruby
|
11
|
+
|
12
|
+
DESTDIR = $(TOP)/opendbad/win/ruby_win_exes
|
13
|
+
prefix = $(DESTDIR)/ruby191
|
14
|
+
exec_prefix = $(prefix)
|
15
|
+
bindir = $(exec_prefix)/bin
|
16
|
+
sbindir = $(exec_prefix)/sbin
|
17
|
+
libexecdir = $(exec_prefix)/libexec
|
18
|
+
datadir = $(prefix)/share
|
19
|
+
sysconfdir = $(prefix)/etc
|
20
|
+
sharedstatedir = $(DESTDIR)/etc
|
21
|
+
localstatedir = $(DESTDIR)/var
|
22
|
+
libdir = $(exec_prefix)/lib
|
23
|
+
includedir = $(prefix)/include
|
24
|
+
oldincludedir = $(DESTDIR)/usr/include
|
25
|
+
infodir = $(prefix)/info
|
26
|
+
mandir = $(prefix)/man
|
27
|
+
sitedir = $(prefix)/lib/$(RUBY_INSTALL_NAME)/site_ruby
|
28
|
+
vendordir = $(prefix)/lib/$(RUBY_INSTALL_NAME)/vendor_ruby
|
29
|
+
rubyhdrdir = $(includedir)/$(RUBY_INSTALL_NAME)-$(ruby_version)
|
30
|
+
sitehdrdir = $(rubyhdrdir)/site_ruby
|
31
|
+
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
32
|
+
rubylibdir = $(libdir)/$(ruby_install_name)/$(ruby_version)
|
33
|
+
archdir = $(rubylibdir)/$(arch)
|
34
|
+
sitelibdir = $(sitedir)/$(ruby_version)
|
35
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
36
|
+
vendorlibdir = $(vendordir)/$(ruby_version)
|
37
|
+
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
38
|
+
|
39
|
+
CC = cl -nologo
|
40
|
+
CXX = $(CC)
|
41
|
+
LIBRUBY = $(RUBY_SO_NAME).lib
|
42
|
+
LIBRUBY_A = $(RUBY_SO_NAME)-static.lib
|
43
|
+
LIBRUBYARG_SHARED = $(LIBRUBY)
|
44
|
+
LIBRUBYARG_STATIC = $(LIBRUBY_A)
|
45
|
+
OUTFLAG = -Fe
|
46
|
+
COUTFLAG = -Fo
|
47
|
+
|
48
|
+
RUBY_EXTCONF_H = unicode_support_version
|
49
|
+
cflags =
|
50
|
+
optflags =
|
51
|
+
debugflags =
|
52
|
+
warnflags =
|
53
|
+
CFLAGS = -MT -Zi -O2b2xg- -G6 -Zm600
|
54
|
+
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
|
55
|
+
DEFS =
|
56
|
+
CPPFLAGS = -DRUBY_EXTCONF_H=\"$(RUBY_EXTCONF_H)\"
|
57
|
+
CXXFLAGS = $(CFLAGS) -MT -Zi -O2b2xg- -G6 -Zm600
|
58
|
+
ldflags =
|
59
|
+
dldflags = -link -incremental:no -debug -opt:ref -opt:icf -dll $(LIBPATH)
|
60
|
+
archflag =
|
61
|
+
DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
|
62
|
+
LDSHARED = cl -nologo -LD
|
63
|
+
LDSHAREDXX = $(LDSHARED)
|
64
|
+
AR = lib -nologo
|
65
|
+
EXEEXT = .exe
|
66
|
+
|
67
|
+
RUBY_INSTALL_NAME = ruby
|
68
|
+
RUBY_SO_NAME = msvcrt-ruby191
|
69
|
+
arch = i386-mswin32
|
70
|
+
sitearch = i386-msvcrt
|
71
|
+
ruby_version = 1.9.1
|
72
|
+
ruby = $(TOP)/opendbad/win/ruby_win_exes/ruby191/bin/ruby
|
73
|
+
RUBY = $(ruby:/=\)
|
74
|
+
RM = $(RUBY) -run -e rm -- -f
|
75
|
+
RM_RF = $(RUBY) -run -e rm -- -rf
|
76
|
+
RMDIRS = $(RUBY) -run -e rmdir -- -p
|
77
|
+
MAKEDIRS = @$(RUBY) -run -e mkdir -- -p
|
78
|
+
INSTALL = @$(RUBY) -run -e install -- -vp
|
79
|
+
INSTALL_PROG = $(INSTALL) -m 0755
|
80
|
+
INSTALL_DATA = $(INSTALL) -m 0644
|
81
|
+
COPY = copy > nul
|
82
|
+
|
83
|
+
#### End of system configuration section. ####
|
84
|
+
|
85
|
+
preload =
|
86
|
+
|
87
|
+
libpath = . $(libdir) C:/Progra~1/IBM/SQLLIB/lib
|
88
|
+
LIBPATH = -libpath:"." -libpath:"$(libdir)"
|
89
|
+
DEFFILE = $(TARGET)-$(arch).def
|
90
|
+
|
91
|
+
CLEANFILES = mkmf.log
|
92
|
+
DISTCLEANFILES = vc*.pdb $(DEFFILE)
|
93
|
+
DISTCLEANDIRS =
|
94
|
+
|
95
|
+
extout =
|
96
|
+
extout_prefix =
|
97
|
+
target_prefix =
|
98
|
+
LOCAL_LIBS =
|
99
|
+
LIBS = $(LIBRUBYARG_SHARED) db2cli.lib oldnames.lib user32.lib advapi32.lib shell32.lib ws2_32.lib libcmt.lib
|
100
|
+
SRCS = ibm_db.c ruby_ibm_db_cli.c
|
101
|
+
OBJS = ibm_db.obj ruby_ibm_db_cli.obj
|
102
|
+
TARGET = ibm_db
|
103
|
+
DLLIB = $(TARGET).so
|
104
|
+
EXTSTATIC =
|
105
|
+
STATIC_LIB =
|
106
|
+
|
107
|
+
BINDIR = $(bindir)
|
108
|
+
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
109
|
+
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
110
|
+
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
111
|
+
HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
|
112
|
+
ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
|
113
|
+
|
114
|
+
TARGET_SO = $(DLLIB)
|
115
|
+
CLEANLIBS = $(TARGET).so
|
116
|
+
CLEANOBJS = *.obj $(TARGET).exp $(TARGET).lib $(TARGET).pdb *.bak
|
117
|
+
|
118
|
+
all: $(DLLIB)
|
119
|
+
static: $(STATIC_LIB)
|
120
|
+
|
121
|
+
clean-rb-default::
|
122
|
+
clean-rb::
|
123
|
+
clean-so::
|
124
|
+
clean: clean-so clean-rb-default clean-rb
|
125
|
+
@-$(RM) $(CLEANLIBS:/=\) $(CLEANOBJS:/=\) $(CLEANFILES:/=\)
|
126
|
+
|
127
|
+
distclean-rb-default::
|
128
|
+
distclean-rb::
|
129
|
+
distclean-so::
|
130
|
+
distclean: clean distclean-so distclean-rb-default distclean-rb
|
131
|
+
@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
132
|
+
@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES:/=\)
|
133
|
+
@-$(RMDIRS) $(DISTCLEANDIRS:/=\)
|
134
|
+
|
135
|
+
realclean: distclean
|
136
|
+
install: install-so install-rb
|
137
|
+
|
138
|
+
install-so: $(RUBYARCHDIR)
|
139
|
+
install-so: $(RUBYARCHDIR)/$(DLLIB)
|
140
|
+
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
|
141
|
+
$(INSTALL_PROG) $(DLLIB:/=\) $(RUBYARCHDIR:/=\)
|
142
|
+
install-rb: pre-install-rb install-rb-default
|
143
|
+
install-rb-default: pre-install-rb-default
|
144
|
+
pre-install-rb: Makefile
|
145
|
+
pre-install-rb-default: Makefile
|
146
|
+
$(RUBYARCHDIR):
|
147
|
+
$(MAKEDIRS) $@
|
148
|
+
|
149
|
+
site-install: site-install-so site-install-rb
|
150
|
+
site-install-so: install-so
|
151
|
+
site-install-rb: install-rb
|
152
|
+
|
153
|
+
.SUFFIXES: .c .m .cc .cxx .cpp .obj
|
154
|
+
|
155
|
+
{$(hdrdir)}.cc.obj:
|
156
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tp$(<:\=/)
|
157
|
+
|
158
|
+
{$(topdir)}.cc.obj:
|
159
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tp$(<:\=/)
|
160
|
+
|
161
|
+
{$(srcdir)}.cc.obj:
|
162
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tp$(<:\=/)
|
163
|
+
|
164
|
+
.cc.obj:
|
165
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tp$(<:\=/)
|
166
|
+
|
167
|
+
{$(hdrdir)}.cxx.obj:
|
168
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tp$(<:\=/)
|
169
|
+
|
170
|
+
{$(topdir)}.cxx.obj:
|
171
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tp$(<:\=/)
|
172
|
+
|
173
|
+
{$(srcdir)}.cxx.obj:
|
174
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tp$(<:\=/)
|
175
|
+
|
176
|
+
.cxx.obj:
|
177
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tp$(<:\=/)
|
178
|
+
|
179
|
+
{$(hdrdir)}.cpp.obj:
|
180
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tp$(<:\=/)
|
181
|
+
|
182
|
+
{$(topdir)}.cpp.obj:
|
183
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tp$(<:\=/)
|
184
|
+
|
185
|
+
{$(srcdir)}.cpp.obj:
|
186
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tp$(<:\=/)
|
187
|
+
|
188
|
+
.cpp.obj:
|
189
|
+
$(CXX) $(INCFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tp$(<:\=/)
|
190
|
+
|
191
|
+
{$(hdrdir)}.c.obj:
|
192
|
+
$(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tc$(<:\=/)
|
193
|
+
|
194
|
+
{$(topdir)}.c.obj:
|
195
|
+
$(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tc$(<:\=/)
|
196
|
+
|
197
|
+
{$(srcdir)}.c.obj:
|
198
|
+
$(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tc$(<:\=/)
|
199
|
+
|
200
|
+
.c.obj:
|
201
|
+
$(CC) $(INCFLAGS) $(CFLAGS) $(CPPFLAGS) $(COUTFLAG)$(@) -c -Tc$(<:\=/)
|
202
|
+
|
203
|
+
$(DLLIB): $(DEFFILE) $(OBJS) Makefile
|
204
|
+
@-$(RM) $(@:/=\)
|
205
|
+
$(LDSHARED) -Fe$(@) $(OBJS) $(LIBS) $(LOCAL_LIBS) $(DLDFLAGS) -implib:$(*F:.so=)-$(arch).lib -pdb:$(*F:.so=)-$(arch).pdb -def:$(DEFFILE)
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
$(DEFFILE):
|
210
|
+
$(RUBY) -e "puts 'EXPORTS', 'Init_$(TARGET)'" > $@
|
211
|
+
|
212
|
+
$(OBJS): {.;$(VPATH)}$(hdrdir)/ruby.h {.;$(VPATH)}$(hdrdir)/ruby/defines.h $(arch_hdrdir)/ruby/config.h $(RUBY_EXTCONF_H)
|
data/ext/extconf.rb
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# +----------------------------------------------------------------------+
|
4
|
+
# | Licensed Materials - Property of IBM |
|
5
|
+
# | |
|
6
|
+
# | (C) Copyright IBM Corporation 2006 - 2012 |
|
7
|
+
# +----------------------------------------------------------------------+
|
8
|
+
|
9
|
+
WIN = RUBY_PLATFORM =~ /mswin/ || RUBY_PLATFORM =~ /mingw/
|
10
|
+
|
11
|
+
# use ENV['IBM_DB_HOME'] or latest db2 you can find
|
12
|
+
IBM_DB_HOME = ENV['IBM_DB_HOME']
|
13
|
+
|
14
|
+
machine_bits = ['ibm'].pack('p').size * 8
|
15
|
+
|
16
|
+
is64Bit = true
|
17
|
+
|
18
|
+
module Kernel
|
19
|
+
def suppress_warnings
|
20
|
+
origVerbosity = $VERBOSE
|
21
|
+
$VERBOSE = nil
|
22
|
+
result = yield
|
23
|
+
$VERBOSE = origVerbosity
|
24
|
+
return result
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
if machine_bits == 64
|
29
|
+
is64Bit = true
|
30
|
+
puts "Detected 64-bit Ruby\n "
|
31
|
+
else
|
32
|
+
is64Bit = false
|
33
|
+
puts "Detected 32-bit Ruby\n "
|
34
|
+
end
|
35
|
+
|
36
|
+
if(IBM_DB_HOME == nil || IBM_DB_HOME == '')
|
37
|
+
IBM_DB_INCLUDE = ENV['IBM_DB_INCLUDE']
|
38
|
+
IBM_DB_LIB = ENV['IBM_DB_LIB']
|
39
|
+
|
40
|
+
if( ( (IBM_DB_INCLUDE.nil?) || (IBM_DB_LIB.nil?) ) ||
|
41
|
+
( IBM_DB_INCLUDE == '' || IBM_DB_LIB == '' )
|
42
|
+
)
|
43
|
+
puts "Environment variable IBM_DB_HOME is not set. Set it to your DB2/IBM_Data_Server_Driver installation directory and retry gem install.\n "
|
44
|
+
exit 1
|
45
|
+
end
|
46
|
+
else
|
47
|
+
IBM_DB_INCLUDE = "#{IBM_DB_HOME}/include"
|
48
|
+
|
49
|
+
if(is64Bit)
|
50
|
+
IBM_DB_LIB="#{IBM_DB_HOME}/lib64"
|
51
|
+
else
|
52
|
+
IBM_DB_LIB="#{IBM_DB_HOME}/lib32"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
if( !(File.directory?(IBM_DB_LIB)) )
|
57
|
+
suppress_warnings{IBM_DB_LIB = "#{IBM_DB_HOME}/lib"}
|
58
|
+
if( !(File.directory?(IBM_DB_LIB)) )
|
59
|
+
puts "Cannot find #{IBM_DB_LIB} directory. Check if you have set the IBM_DB_HOME environment variable's value correctly\n "
|
60
|
+
exit 1
|
61
|
+
end
|
62
|
+
notifyString = "Detected usage of IBM Data Server Driver package. Ensure you have downloaded "
|
63
|
+
|
64
|
+
if(is64Bit)
|
65
|
+
notifyString = notifyString + "64-bit package "
|
66
|
+
else
|
67
|
+
notifyString = notifyString + "32-bit package "
|
68
|
+
end
|
69
|
+
notifyString = notifyString + "of IBM_Data_Server_Driver and retry the 'gem install ibm_db' command\n "
|
70
|
+
|
71
|
+
puts notifyString
|
72
|
+
end
|
73
|
+
|
74
|
+
if( !(File.directory?(IBM_DB_INCLUDE)) )
|
75
|
+
puts " #{IBM_DB_HOME}/include folder not found. Check if you have set the IBM_DB_HOME environment variable's value correctly\n "
|
76
|
+
exit 1
|
77
|
+
end
|
78
|
+
|
79
|
+
require 'mkmf'
|
80
|
+
|
81
|
+
dir_config('IBM_DB',IBM_DB_INCLUDE,IBM_DB_LIB)
|
82
|
+
|
83
|
+
def crash(str)
|
84
|
+
printf(" extconf failure: %s\n", str)
|
85
|
+
exit 1
|
86
|
+
end
|
87
|
+
|
88
|
+
if( RUBY_VERSION =~ /1.9/ || RUBY_VERSION =~ /2./)
|
89
|
+
create_header('gil_release_version')
|
90
|
+
create_header('unicode_support_version')
|
91
|
+
end
|
92
|
+
|
93
|
+
unless (have_library(WIN ? 'db2cli' : 'db2','SQLConnect') or find_library(WIN ? 'db2cli' : 'db2','SQLConnect', IBM_DB_LIB))
|
94
|
+
crash(<<EOL)
|
95
|
+
Unable to locate libdb2.so/a under #{IBM_DB_LIB}
|
96
|
+
|
97
|
+
Follow the steps below and retry
|
98
|
+
|
99
|
+
Step 1: - Install IBM DB2 Universal Database Server/Client
|
100
|
+
|
101
|
+
step 2: - Set the environment variable IBM_DB_HOME as below
|
102
|
+
|
103
|
+
(assuming bash shell)
|
104
|
+
|
105
|
+
export IBM_DB_HOME=<DB2/IBM_Data_Server_Driver installation directory> #(Eg: export IBM_DB_HOME=/opt/ibm/db2/v10)
|
106
|
+
|
107
|
+
step 3: - Retry gem install
|
108
|
+
|
109
|
+
EOL
|
110
|
+
end
|
111
|
+
|
112
|
+
alias :libpathflag0 :libpathflag
|
113
|
+
def libpathflag(libpath)
|
114
|
+
libpathflag0 + case Config::CONFIG["arch"]
|
115
|
+
when /solaris2/
|
116
|
+
libpath[0..-2].map {|path| " -R#{path}"}.join
|
117
|
+
when /linux/
|
118
|
+
libpath[0..-2].map {|path| " -Wl,-rpath,#{path}"}.join
|
119
|
+
else
|
120
|
+
""
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
have_header('gil_release_version')
|
125
|
+
have_header('unicode_support_version')
|
126
|
+
|
127
|
+
create_makefile('ibm_db')
|