MySQL Ruby Module ver2.4.2-1 for windows binaries

This is MySQL Ruby API. This use for Windows Environment. Cygwin,Mingw binary.

ruby version is 1.6.6. test suite(test.rb) all OK.

Server:

Linux    3.23.41
WinNT4WS 3.23.38-nt(same host)

[Install]

% ruby install.rb -n 
ex.
  install
    mingw32/mysql.so => e:/usr/local/mingw/lib/ruby/site_ruby/1.6/i686-mingw32
(alternative by hand see.  ruby -e 'p $:' )

Enjoy :-)

[Howto build]

Cygwin-binary

Cygwin-1.3.9 and mysql-3.23.47.tar.gz. compile only client

use zlib static link.(zlib-1.1.3 -> libzstatic.a) and packed upx.

$ cat extconf.rb
require 'mkmf'
have_library('zstatic')
inc, lib = dir_config('mysql', '/usr/local')
find_library('mysqlclient', 'mysql_query', lib, "#{lib}/mysql") or exit 1
# If you have error such as 'undefined symbol', delete '#' mark follow
# lines:
#have_library('m')
#have_library('z')
have_header('mysql.h') or have_header('mysql/mysql.h') or exit 1
create_makefile("mysql")

mingw-binary

download from libmysqlclient MinGW port <URL:http://www.johnydog.cz/projects.php> MySQL 3.23.43 mingw Source

quick hack.

#
--- Makefile.org        Thu Oct  4 01:52:38 2001
+++ Makefile    Wed Jan 23 21:59:39 2002
@@ -14,18 +14,18 @@
 # team. Please see http://www.mysql.com in that case.
 #

-CROSS_DIR = /usr/local/cross-tools/i386-mingw32msvc
-CFLAGS = -O2 -Wall
+CROSS_DIR = /usr/local/mingw
+CFLAGS = -Os -Wall
 LIBS =
 INCLUDES = -I./include

 INSTALL_INCLUDES = $(CROSS_DIR)/include/mysql/
 INSTALL_LIBS = $(CROSS_DIR)/lib/

-CC = $(CROSS_DIR)/bin/gcc
-RANLIB = $(CROSS_DIR)/bin/ranlib
-AR = $(CROSS_DIR)/bin/ar
-ARFLAGS = cr
+CC = gcc -bmingw #$(CROSS_DIR)/bin/gcc
+#RANLIB = $(CROSS_DIR)/bin/ranlib
+#AR = $(CROSS_DIR)/bin/ar
+ARFLAGS = cru
 RM = rm -f
 CP = cp
 MV = mv
@@ -83,4 +83,4 @@
 clean:
        rm -f $(OBJECTS) libmysqlclient.a

-
\ No newline at end of file
+
--- include/mysql.h-orig        Thu Oct 18 01:24:52 2001
+++ include/mysql.h     Wed Jan 23 21:03:18 2002
@@ -48,6 +48,10 @@
 #else
 #define STDCALL __stdcall
 #endif
+#if !defined(__MINGW32__)
+#define STDCALL
+#endif
+
 typedef char * gptr;

 #ifndef ST_USED_MEM_DEFINED

edit extconf.rb for link error.(add wsock32,zlib)

$ cat extconf.rb
require 'mkmf'
inc, lib = dir_config('mysql', '/usr/local')

have_library('z')
have_library('wsock32')
# find_library('mysqlclient', 'mysql_query', lib, "#{lib}/mysql") or exit 1
have_library('mysqlclient')

# If you have error such as 'undefined symbol', delete '#' mark follow
# lines:
#have_library('m')
have_header('mysql.h') or have_header('mysql/mysql.h') or exit 1
create_makefile("mysql")

mswin32-binary

copy mswin32-ruby16.lib current from <URL:http://www.ruby-lang.org/~usa/mswin32/> and modified mingw's Makefile -lmingw32-ruby16 to -lmswin32-ruby16 :-)

[URLs]

MySQL/Ruby

<URL:http://www.tmtm.org/mysql/ruby/>

<URL:http://www.ruby-lang.org/en/raa-list.rhtml?name=MySQL%2FRuby>

Ruby

<URL:http://www.ruby-lang.org/>

MySQL

<URL:http://www.mysql.com/>

[History]

2002-02-04 2.4.2-1

2002-01-29 2.4.2

TAMURA.Kenichi <URL:mailto:sgs02516@nifty.com>