From: Francis Joanis Date: 2004-03-17T09:44:33+09:00 Subject: mysql-ruby 2.4.5 + Ruby 1.8.1 + MSVCC (win32) Hello everyone, This is my first post in this group so please bear with me... I've found a way to compile mysql-ruby 2.4.5 with Ruby 1.8.1 on Windows with MSVCC after taking a makefile from http://www.softagency.co.jp/mysql/pro/win_ruby.html and tweaking it. I've tried this with mySQL 4.x and it DID NOT work. However it worked using mySQL 3.23.58. I am not a Makefile guru but if this can help you guys I'd be pretty happy! Here's what I did: (1) the makefile: (see end of message) (2) I've modified the included mysql.c.in directly into mysql.c (without running ruby extconf.rb): -Simply add these defines BEFORE any include statement ---BEGIN--- #define RUBY_VERSION_CODE 181 #define str2cstr TRUE #define HAVE_MYSQL_H TRUE ---END--- (3) Then, the usual nmake then nmake install. Of course... got a full load of warnings but it seemed to work OK. Thanks! Francis ---BEGIN--- SHELL = /bin/sh #### Start of system configuration section. #### srcdir = . topdir = $(rubylibdir)/$(arch) hdrdir = $(rubylibdir)/$(arch) VPATH = $(srcdir) CC = cl CFLAGS = -DIMPORT -nologo -DNT=1 -Zi -MD -O2b2x -G5 /I "C:/CML-ATMS/Root/mysql-3.23.58/include" /nologo /D "_WINDOWS" CPPFLAGS = -I$(hdrdir) -I$(srcdir) -I$(prefix)/include CXXFLAGS = $(CFLAGS) DLDFLAGS = $(CFLAGS) LDSHARED = cl -LD LIBPATH = $(exec_prefix)/lib RUBY_INSTALL_NAME = ruby RUBY_SO_NAME = msvcrt-ruby18 arch = i386-mswin32 ruby_version = 1.8 DESTDIR = C: prefix = $(DESTDIR)/CML-ATMS/Root/ruby-1.8.1 exec_prefix = $(prefix) libdir = $(exec_prefix)/lib rubylibdir = $(libdir)/ruby/$(ruby_version) archdir = $(rubylibdir)/$(arch) sitedir = $(prefix)/lib/ruby/site_ruby sitelibdir = $(sitedir)/$(ruby_version) sitearchdir = $(sitelibdir)/$(arch) target_prefix = #### End of system configuration section. #### LOCAL_LIBS = -link /INCREMENTAL:no /EXPORT:Init_$(TARGET) /nodefaultlib:msvcrt /nologo LIBS = $(RUBY_SO_NAME).lib C:/CML-ATMS/Root/mysql-3.23.58/lib/opt/mysqlclient.lib C:/CML-ATMS/Root/mysql-3.23.58/lib/opt/zlib.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib # wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo OBJS = mysql.obj TARGET = mysql DLLIB = $(TARGET).so RUBY = ruby RM = $(RUBY) -rftools -e "File::rm_f(*ARGV.map{|x|Dir[x]}.flatten.uniq)" EXEEXT = .exe all: $(DLLIB) clean:; @$(RM) *.obj *.so *.sl *.a $(DLLIB) @$(RM) $(TARGET).lib $(TARGET).exp $(TARGET).ilk *.pdb $(CLEANFILES) distclean: clean @$(RM) Makefile extconf.h conftest.* mkmf.log @$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES) realclean: distclean install: $(archdir)$(target_prefix)/$(DLLIB) site-install: $(sitearchdir)$(target_prefix)/$(DLLIB) $(archdir)$(target_prefix)/$(DLLIB): $(DLLIB) @$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(rubylibdir) $(archdir)$(target_prefix) @$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0555, true)' $(DLLIB) $(archdir)$(target_prefix)/$(DLLIB) $(sitearchdir)$(target_prefix)/$(DLLIB): $(DLLIB) @$(RUBY) -r ftools -e 'File::makedirs(*ARGV)' $(libdir) $(sitearchdir)$(target_prefix) @$(RUBY) -r ftools -e 'File::install(ARGV[0], ARGV[1], 0555, true)' $(DLLIB) $(sitearchdir)$(target_prefix)/$(DLLIB) {$(srcdir)}.c.obj: $(CC) $(CFLAGS) -I$(