db2 2.6.2 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +17 -0
- data/README +79 -141
- data/ext/Makefile.nt32 +3 -3
- data/ext/Makefile.nt32.191 +212 -0
- data/ext/extconf.rb +75 -14
- data/ext/ibm_db.c +504 -47
- data/ext/ruby_ibm_db.h +4 -1
- data/ext/ruby_ibm_db_cli.c +108 -1
- data/ext/ruby_ibm_db_cli.h +54 -1
- data/lib/active_record/connection_adapters/ibm_db_adapter.rb +423 -124
- data/lib/active_record/connection_adapters/ibm_db_pstmt.rb +1 -1
- data/test/cases/adapter_test.rb +169 -164
- data/test/cases/associations/belongs_to_associations_test.rb +268 -43
- data/test/cases/associations/cascaded_eager_loading_test.rb +31 -33
- data/test/cases/associations/has_and_belongs_to_many_associations_test.rb +90 -156
- data/test/cases/associations/join_model_test.rb +100 -150
- data/test/cases/attribute_methods_test.rb +259 -58
- data/test/cases/base_test.rb +785 -138
- data/test/cases/calculations_test.rb +128 -8
- data/test/cases/migration_test.rb +680 -286
- 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 +41 -17
- data/test/cases/transaction_callbacks_test.rb +300 -0
- data/test/cases/validations/uniqueness_validation_test.rb +38 -22
- data/test/cases/xml_serialization_test.rb +408 -0
- data/test/config.yml +154 -0
- data/test/connections/native_ibm_db/connection.rb +2 -0
- data/test/models/warehouse_thing.rb +4 -4
- data/test/schema/i5/ibm_db_specific_schema.rb +3 -1
- data/test/schema/ids/ibm_db_specific_schema.rb +3 -1
- data/test/schema/luw/ibm_db_specific_schema.rb +2 -0
- data/test/schema/schema.rb +196 -92
- data/test/schema/zOS/ibm_db_specific_schema.rb +3 -1
- metadata +73 -68
- data/.gitignore +0 -1
- data/test/cases/associations/eager_test.rb +0 -862
- data/test/cases/associations/has_many_through_associations_test.rb +0 -461
- data/test/cases/finder_test.rb +0 -1088
- data/test/cases/fixtures_test.rb +0 -684
data/CHANGES
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
Change Log
|
2
2
|
==============
|
3
|
+
2012/05/01 (IBM_DB adapter 2.5.10, driver 2.5.10) :
|
4
|
+
- Support for Rails-3.2
|
5
|
+
- Changes in installation process. Now user should set only one environment variable IBM_DB_HOME to DB2/IBM_Data_Server_Driver installation directory
|
6
|
+
- Fixed bug #29541 - Serialize data when corresponding field maps to CLOB type on Database
|
7
|
+
- Fixed bug #29561 - Fixed data truncation error when client and server codepages are different
|
8
|
+
- Updated IBM_DB specifics of AR test suite as per Rails-3.2.3
|
9
|
+
|
10
|
+
2012/01/03 (IBM_DB adapter 2.5.9, driver 2.5.9) :
|
11
|
+
- Support for Create and Drop database on DB2 LUW with DB2 client version V97fp4 and above
|
12
|
+
- Fixed bug #29482 - Fixed bigint being returned as string in the adapter
|
13
|
+
|
14
|
+
2011/09/18 (IBM_DB adapter 2.5.7, driver 2.5.7) :
|
15
|
+
- Support for Rails-3.1.0
|
16
|
+
- Fixed bug #29052 -> prepare results in empty error message
|
17
|
+
- Support for continuation of method IBM_DB.conn_error and IBM_DB.conn_errormsg - #29324
|
18
|
+
- Test suite update as for Rails-3.1.0
|
19
|
+
|
3
20
|
2011/02/07 (IBM_DB adapter 2.5.6, driver 2.5.6) :
|
4
21
|
- Fixed Bug #28622, #28881
|
5
22
|
- Decimal datatypes will now be returned as BigDecimal type from the driver
|
data/README
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
=====================================================================
|
2
|
-
README for the IBM_DB Adapter (2.5.
|
2
|
+
README for the IBM_DB Adapter (2.5.10) and Driver (2.5.10) (2012/04/30)
|
3
3
|
For ActiveRecord Version >= 1.15.5 (and Rails >= 1.2.5)
|
4
4
|
=====================================================================
|
5
5
|
|
@@ -14,11 +14,11 @@ Supported Operating Systems
|
|
14
14
|
|
15
15
|
Supported Databases
|
16
16
|
====================
|
17
|
-
- IBM DB2 Universal Database on Linux/Unix/Windows versions
|
17
|
+
- IBM DB2 Universal Database on Linux/Unix/Windows versions 9 Fixpak2 and above
|
18
18
|
- Remote connections to IBM DB2 Universal Database on i5/OS versions V5R3 and V5R4.
|
19
19
|
Please ensure PTF SI27358 (includes SI27250) is installed in i5/OS version 5R3 and
|
20
20
|
and PTF SI27256 is installed while using i5/OS version 5R4.
|
21
|
-
- Remote connections to IBM DB2 Universal Database on z/OS version 8 and
|
21
|
+
- Remote connections to IBM DB2 Universal Database on z/OS version 8, 9 and 10
|
22
22
|
- Informix Dynamic Server 11.10 and beyond.
|
23
23
|
Please ensure that the IBM DataServer Viper 2 client is installed.
|
24
24
|
|
@@ -37,32 +37,18 @@ Note : - 1) If using activerecord version below 2.0 then it requires that the ib
|
|
37
37
|
INSTALL (as Ruby gem)
|
38
38
|
To remove previous gem version (optionally):
|
39
39
|
D:\>gem uninstall ibm_db
|
40
|
-
Successfully uninstalled ibm_db version 0.
|
40
|
+
Successfully uninstalled ibm_db version 1.0.0
|
41
41
|
|
42
42
|
Example:
|
43
43
|
D:\>gem install ibm_db
|
44
|
-
|
45
|
-
|
46
|
-
1
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
Running gem install ibm_db you are presented with two choices for each release
|
52
|
-
(mswin32 or ruby)choose mswin32. This will install the IBM_DB gem containing
|
53
|
-
the pre-built binary file of the driver which is a C-extension of Ruby.
|
54
|
-
|
55
|
-
TEST (simple gem install verification)
|
56
|
-
Note: The manual step after install if using activerecord version below 2.0:
|
44
|
+
Fetching: ibm_db-2.5.9-x86-mingw32.gem (100%)
|
45
|
+
Successfully installed ibm_db-2.5.9-x86-mingw32
|
46
|
+
1 gem installed
|
47
|
+
Installing ri documentation for ibm_db-2.5.9-x86-mingw32...
|
48
|
+
Installing RDoc documentation for ibm_db-2.5.9-x86-mingw32...
|
49
|
+
|
50
|
+
Note: The manual step after install if using activerecord version below 2.0:
|
57
51
|
add ibm_db into GEM_HOME\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
|
58
|
-
D:\rails NewApp
|
59
|
-
D:\cd NewApp
|
60
|
-
D:\NewApp>irb
|
61
|
-
irb(main):001:0> gem 'ibm_db'
|
62
|
-
irb(main):002:0> require 'mswin32/ibm_db' // notice the [mswin32] in the library path
|
63
|
-
irb(main):003:0> IBM_DB.connect 'sample', 'db2admin', 'secret'
|
64
|
-
D:\NewApp>ruby script\console
|
65
|
-
|
66
52
|
|
67
53
|
2. Linux and Unix platforms:
|
68
54
|
============================
|
@@ -75,32 +61,13 @@ Note : - 1) If using activerecord version below 2.0 then it requires that the ib
|
|
75
61
|
Note: DB2 environment is required while using an arbitrary user account
|
76
62
|
(other than the DB2 install user account)
|
77
63
|
$ . /home/db2inst1/sqllib/db2profile
|
78
|
-
$ export
|
79
|
-
$ export IBM_DB_LIB=DB2HOME/lib (eg. /home/db2inst1/sqllib/lib or /opt/ibm/db2/V9.5/lib32)
|
64
|
+
$ export IBM_DB_DIR=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
|
80
65
|
$ gem install ibm_db
|
81
|
-
Select which gem to install for your platform (i686-linux)
|
82
|
-
1. ibm_db 1.0.0 (mswin32)
|
83
|
-
2. ibm_db 1.0.0 (ruby)
|
84
|
-
3. ibm_db 0.10.0 (ruby)
|
85
|
-
4. ibm_db 0.10.0 (mswin32)
|
86
|
-
...
|
87
|
-
Running gem install ibm_db you are presented with two choices for each release
|
88
|
-
(mswin32 or ruby) choose ruby. This will build the native extension (ibm_db driver) and installs the ibm_db gem.
|
89
|
-
...
|
90
|
-
> 2
|
91
66
|
Building native extensions. This could take a while...
|
92
|
-
Successfully installed ibm_db-
|
93
|
-
|
94
|
-
Installing
|
95
|
-
|
96
|
-
TEST (simple gem install verification)
|
97
|
-
Note: The manual step after install, if using activerecord version below 2.0 is:
|
98
|
-
add ibm_db into GEM_HOME\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
|
99
|
-
$ irb
|
100
|
-
irb(main):001:0> gem 'ibm_db'
|
101
|
-
irb(main):002:0> require 'ibm_db' // notice the library path (different on win32, use require 'mswin32/ibm_db')
|
102
|
-
irb(main):003:0> IBM_DB.connect 'sample', 'db2admin', 'secret'
|
103
|
-
$
|
67
|
+
Successfully installed ibm_db-2.5.9
|
68
|
+
1 gem installed
|
69
|
+
Installing ri documentation for ibm_db-2.5.9...
|
70
|
+
Installing RDoc documentation for ibm_db-2.5.9...
|
104
71
|
|
105
72
|
BUILD (optionally) ibm_db gem from sources (ibm_db-x.x.x.tar.gz):
|
106
73
|
1. Download source from Rubyforge
|
@@ -109,80 +76,84 @@ Note : - 1) If using activerecord version below 2.0 then it requires that the ib
|
|
109
76
|
$ cd IBM_DB_Adapter/ibm_db
|
110
77
|
$ gem build IBM_DB.gemspec
|
111
78
|
|
79
|
+
Note: The manual step after install if using activerecord version below 2.0:
|
80
|
+
add ibm_db into GEM_HOME\1.8\gems\activerecord-1.15.3\lib\active_record.rb (Line 77)
|
112
81
|
|
82
|
+
TEST (simple gem install verification)
|
83
|
+
======================================
|
84
|
+
$ rails new myApp -d ibm_db
|
85
|
+
$ cd myApp
|
86
|
+
$ rails generate scaffold Wood name:string price:float
|
87
|
+
$ vi config/database.yml
|
88
|
+
$ rake db:migrate
|
89
|
+
$ rails console #rails server
|
90
|
+
|
113
91
|
Instructions for building and installing the IBM_DB driver from source
|
114
92
|
=======================================================================
|
115
93
|
Building the driver manually as described below is not required if the install
|
116
94
|
process above has been pursued. This manual procedure is in fact automated
|
117
95
|
on Linux and UNIX platforms by the IBM_DB gem install, but is presented
|
118
|
-
here only for reference
|
96
|
+
here only for reference.
|
119
97
|
|
120
98
|
Prerequisites:
|
121
99
|
Install Ruby from:
|
122
100
|
http://rubyforge.org
|
123
101
|
|
124
|
-
|
125
|
-
Note: commands may vary depending on the shell used
|
126
|
-
- To setup DB2 environment while using an arbitrary user account
|
127
|
-
(other than the DB2 install user account):
|
128
|
-
Example:
|
129
|
-
$ . /home/db2inst1/sqllib/db2profile
|
130
|
-
|
131
|
-
- To configure test database:
|
132
|
-
DB2 v9.x: some IBM_DB driver tests require a UTF-8 database:
|
133
|
-
$ db2 CREATE DATABASE testdrv USING CODESET UTF-8 \
|
134
|
-
TERRITORY US COLLATE USING SYSTEM PAGESIZE 32768
|
135
|
-
DB2 v8.x: driver tests 195 and 52949 requires XML functionality
|
136
|
-
only available in DB2 v9.x
|
137
|
-
|
138
|
-
- To configure database connection parameters edit config.yaml
|
139
|
-
Example:
|
140
|
-
database: testdrv
|
141
|
-
user: db2inst1
|
142
|
-
password: password
|
143
|
-
hostname: localhost
|
144
|
-
port: 50000
|
145
|
-
|
146
|
-
- To compile and link with DB2 client libraries:
|
147
|
-
$ export IBM_DB_INCLUDE=DB2HOME/include (eg. /home/db2inst1/sqllib/include or /opt/ibm/db2/v9.5/include)
|
148
|
-
$ export IBM_DB_LIB=DB2HOME/lib (eg. /home/db2inst1/sqllib/lib or /opt/ibm/db2/V9.5/lib32)
|
149
|
-
|
150
|
-
Windows platforms:
|
151
|
-
- Install Visual C++ 2005, Platform SDK (latest), .Net SDK (latest)
|
152
|
-
- Set environment:
|
153
|
-
CALL "C:\Program Files\Microsoft Platform SDK for Windows Server 2005\SetEnv.Cmd"
|
154
|
-
CALL "C:\Program Files\Microsoft Visual C++ Toolkit 2005\vcvars32.bat"
|
155
|
-
SET LIB=%LIB%;C:\Program Files\Microsoft Visual Studio .NET 2005\Vc8\lib
|
156
|
-
- To configure database connection parameters edit config.yml
|
102
|
+
Setup the environment
|
157
103
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
104
|
+
Linux and Unix platforms:
|
105
|
+
Note: commands may vary depending on the shell used
|
106
|
+
- To setup DB2 environment while using an arbitrary user account
|
107
|
+
(other than the DB2 install user account):
|
108
|
+
Example:
|
109
|
+
$ . /home/db2inst1/sqllib/db2profile
|
110
|
+
|
111
|
+
- To compile and link with DB2 client libraries:
|
112
|
+
$ export IBM_DB_DIR=DB2HOME (eg. /home/db2inst1/sqllib or /opt/ibm/db2/v9.5)
|
113
|
+
|
114
|
+
Windows platforms:
|
115
|
+
- Set ruby devkit environment:
|
116
|
+
- To compile and link with DB2 client libraries:
|
117
|
+
$ set IBM_DB_DIR=DB2HOME (eg. C:\Program Files\IBM\SQLLIB)
|
118
|
+
|
119
|
+
Build the driver:
|
120
|
+
- $ cd rubyibm_source/IBM_DB_Adapter/ibm_db/ext
|
121
|
+
- $ ruby extconf.rb
|
122
|
+
- $ make
|
123
|
+
|
124
|
+
Build the ibm_db gem
|
125
|
+
- $ cp rubyibm_source/IBM_DB_Adapter/ibm_db/ext/ibm_db.so rubyibm_source/IBM_DB_Adapter/ibm_db/lib
|
126
|
+
# Not on windows separate binaries are generated for 1.8 and 1.9 version of ruby
|
127
|
+
# and placed under rb18x and rb19x directories respectively. The file ibm_db_mswin32.rb is renamed to ibm_db.rb to ensure proper binary is loaded based on runtime
|
128
|
+
# You will need to similarly ensure that the generated binary is placed on rb18x or rb19x directory under lib based on ruby version being used
|
129
|
+
- $ cd rubyibm_source/IBM_DB_Adapter/ibm_db
|
130
|
+
- $ gem build IBM_DB.gemspec
|
131
|
+
|
132
|
+
Running tests
|
133
|
+
=============
|
134
|
+
Testing the IBM_DB Adapter
|
135
|
+
|
136
|
+
1) a) Copy the files under test directory of ibm_db gem to the test directory of Activerecord following the same directory structure.
|
137
|
+
These files contain modifications in some test files of AR suite to handle ibm_db specifics. Hence make sure these files are replaced in the AR test suite properly.
|
138
|
+
b) Rename warhouse-things.yml to warehouse_things.yml under fixtures directory
|
139
|
+
2) Edit the Rakefile to include ibm_db in list of adapters
|
140
|
+
%w( mysql mysql2 postgresql sqlite3 sqlite3_mem firebird db2 oracle sybase openbase ibm_db frontbase jdbcmysql jdbcpostgresql jdbcsqlite3 jdbcderby jdbch2 jdbchsqldb )
|
141
|
+
3) Configure the connection information in test/config.yml for ibm_db
|
142
|
+
4) run the test suite - rake test_ibm_db
|
143
|
+
|
144
|
+
Running IBM_DB driver test suite
|
145
|
+
|
146
|
+
1) Copy over the test directory under source to lib directory of installed ibm_db under $GEM_HOME
|
147
|
+
2) Edit config.yml file to provide database connection information
|
148
|
+
3) Run the test suite
|
149
|
+
$ rake onlytests
|
150
|
+
4) To run single test
|
151
|
+
export SINGLE_RUBY_TEST=<test file name> #Eg: export SINGLE_RUBY_TEST=test_000_PrepareDb.rb
|
152
|
+
rake onlytests
|
168
153
|
|
169
154
|
Limitations and known problems
|
170
155
|
==============================
|
171
|
-
- ActiveRecord rename_column method is not supported for DB2 LUW, zOS and i5
|
172
156
|
- ActiveRecord remove_column method is not supported for DB2 zOS
|
173
|
-
- The following tests from the ActiveRecord 1.15.3 test suite with ibm_db gem < 0.9.5 are expected to fail
|
174
|
-
- test_limited_eager_with_multiple_order_columns
|
175
|
-
- test_limited_eager_with_order
|
176
|
-
- test_assign_ids_ignoring_blanks
|
177
|
-
- test_build_by_new_record
|
178
|
-
- test_get_ids
|
179
|
-
- test_select_limited_ids_list
|
180
|
-
- test_add_index
|
181
|
-
- The following tests from the driver test suite are expected to fail on DB2 version 8
|
182
|
-
on Linux/Unix/Windows and Informix Dynamic Server because of missing native XML support. If you want to
|
183
|
-
make use of the native XML features in DB2, please upgrade to version 9 or later
|
184
|
-
- test_195.rb
|
185
|
-
- test_52949.rb
|
186
157
|
- The driver returns an error when you try to insert a TIMESTAMP value into a DATE column.
|
187
158
|
To fix this, please ensure that the following configuration keyword PATCH2=58 is set
|
188
159
|
in the COMMON section of your DB2 CLI initialization file (db2cli.ini):
|
@@ -191,7 +162,7 @@ Limitations and known problems
|
|
191
162
|
Please refer to http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.apdv.cli.doc/doc/c0007882.htm
|
192
163
|
for more information.
|
193
164
|
- The behaviour of ActiveRecord::Base.find(:first) without an :order attribute can be unpredictable.
|
194
|
-
The first record (i.e. the record with the minimum id) may be not
|
165
|
+
The first record (i.e. the record with the minimum id) may be not retrieved. In a relational model,
|
195
166
|
the order of the rows returned is unpredictable and independent of the order of insertion.
|
196
167
|
This issue may be addressed in a future release.
|
197
168
|
- Rails applications on DB2 9 require the APPLHEAPSZ database configuration parameter to be
|
@@ -202,32 +173,17 @@ Limitations and known problems
|
|
202
173
|
To enable this parameter, you need to restart your DB2 instance.
|
203
174
|
- If you see connectivity issues with Informix Dynamic Server, please ensure that the server is configured to accept DRDA connections.
|
204
175
|
Please refer to http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.admin.doc/admin154.htm for more information.
|
205
|
-
- The following tests from the ActiveRecord 1.15.3 test suite with ibm_db gem < 0.9.5 are expected to fail on Informix Dynamic Server
|
206
|
-
- test_quote
|
207
|
-
- test_to_xml
|
208
|
-
- test_should_calculate_grouped_by_function
|
209
|
-
- test_should_calculate_grouped_by_function_with_table_alias
|
210
|
-
- test_inserts_with_pre_and_suffix
|
211
|
-
- test_add_table_with_decimals
|
212
|
-
- test_no_limits_datatypes_IBM_DB
|
213
|
-
- test_instance_update_should_quote_pkey
|
214
|
-
- test_integer_columns
|
215
|
-
- test_arguments_line_up
|
216
|
-
- test_no_dump_errors
|
217
|
-
- test_schema_dump_includes_decimal_options
|
218
176
|
- IBM_DB is not supported on JRuby. As stated in the JRuby Wiki, "Basics of Getting JRuby Running":
|
219
177
|
'You may install other gems, but keep in mind that libraries with C extension dependencies
|
220
178
|
will not work in JRuby.' http://www.headius.com/jrubywiki/index.php/Getting_Started
|
221
179
|
The IBM_DB adapter relies on IBM_DB driver (C extension) and the IBM Driver for ODBC and
|
222
180
|
CLI to access databases on IBM data servers. Alternatively, you can either use the regular C
|
223
181
|
implementation of Ruby, or use ActiveRecord-JDBC adapter to access databases.
|
224
|
-
- Query caching feature of ActiveRecord-2.0 not supported
|
225
182
|
- When using ActiveRecord-2.1.0 it requires that ActiveRecord be patched, with the patch in the link below:
|
226
183
|
http://rails.lighthouseapp.com/attachments/26975/association_preloading.diff
|
227
184
|
The patch is required because, ActiveRecord 2.1.0 generates a non-standard SQL identifier,while preloading has_and_belongs_to_many associations,
|
228
185
|
which standard compliant databases like DB2 do not support. The bug report, against ActiveRecord, can be found in the link below
|
229
186
|
http://rails.lighthouseapp.com/projects/8994/tickets/394-patch-fixed-non-standard-sql-generated-by-preloading-has_and_belongs_to_many-associations
|
230
|
-
- ActiveRecord-2.1.0 test suite changes appropriate for DB2/IDS will be updated in the next release of the gem.(Updated in release 0.10.0)
|
231
187
|
- The following tests from the ActiveRecord 2.1.0 test suite with ibm_db gem 0.10.0 are expected to fail on DB2 LUW
|
232
188
|
- test_read_attributes_before_type_cast_on_datetime
|
233
189
|
- test_to_xml
|
@@ -241,24 +197,6 @@ Limitations and known problems
|
|
241
197
|
the complete suite. However they pass when run standalone.
|
242
198
|
2) Also there are two test cases (test_validate_uniqueness_with_non_standard_table_names, test_update_all_with_non_standard_table_name)which run against table with non-standard name. Given that DB2/IDS is standard compliant these test cases are expected to fail.
|
243
199
|
To have these test cases passing rename the fixtures file warehouse-things to warehouse_things.
|
244
|
-
- The following tests from the ActiveRecord 2.1.0 test suite with ibm_db gem 0.10.0 are expected to fail on Informix Dynamic Server
|
245
|
-
- test_attributes_on_dummy_time
|
246
|
-
- test_quote
|
247
|
-
- test_read_attributes_before_type_cast_on_datetime
|
248
|
-
- test_save_for_record_with_only_primary_key
|
249
|
-
- test_save_for_record_with_only_primary_key_that_is_provided
|
250
|
-
- test_to_xml
|
251
|
-
- test_utc_as_time_zone
|
252
|
-
- test_should_calculate_grouped_by_function
|
253
|
-
- test_should_calculate_grouped_by_function_with_table_alias
|
254
|
-
- test_include_query
|
255
|
-
- test_binary_in_fixtures
|
256
|
-
- test_inserts_with_pre_and_suffix
|
257
|
-
- test_create
|
258
|
-
- test_add_column_with_precision_and_scale
|
259
|
-
- test_add_table_with_decimals
|
260
|
-
- test_native_types
|
261
|
-
- test_schema_dump_includes_decimal_options
|
262
200
|
- Usage with Rails-3.0.3/Rails-3.0.4
|
263
201
|
- To use with Rails-3.0.3/4 patch latest Arel with the patch available at https://gist.github.com/814491
|
264
202
|
|
data/ext/Makefile.nt32
CHANGED
@@ -4,12 +4,12 @@ SHELL = /bin/sh
|
|
4
4
|
#### Start of system configuration section. ####
|
5
5
|
|
6
6
|
srcdir = .
|
7
|
-
topdir =$(TOP)/opendbad/win/ruby_1.8.6/lib/ruby/1.8/i386-mswin32
|
7
|
+
topdir =$(TOP)/opendbad/win/ruby_win_exes/ruby_1.8.6/lib/ruby/1.8/i386-mswin32
|
8
8
|
hdrdir = $(topdir)
|
9
9
|
VPATH = $(srcdir);$(topdir);$(hdrdir)
|
10
10
|
|
11
11
|
|
12
|
-
DESTDIR = $(TOP)/opendbad/win
|
12
|
+
DESTDIR = $(TOP)/opendbad/win/ruby_win_exes
|
13
13
|
prefix = $(DESTDIR)/ruby_1.8.6
|
14
14
|
exec_prefix = $(DESTDIR)/ruby_1.8.6
|
15
15
|
sitedir = $(prefix)/lib/ruby/site_ruby
|
@@ -51,7 +51,7 @@ RUBY_SO_NAME = msvcrt-ruby18
|
|
51
51
|
arch = i386-mswin32
|
52
52
|
sitearch = i386-msvcrt
|
53
53
|
ruby_version = 1.8
|
54
|
-
ruby = $(TOP)/opendbad/win/ruby_1.8.6/bin/ruby.exe
|
54
|
+
ruby = $(TOP)/opendbad/win/ruby_win_exes/ruby_1.8.6/bin/ruby.exe
|
55
55
|
RUBY = $(ruby:/=\)
|
56
56
|
RM = $(RUBY) -run -e rm -- -f
|
57
57
|
MAKEDIRS = @$(RUBY) -run -e mkdir -- -p
|
@@ -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)
|