Subject: Re: DBD::mysql on cygwin
From: "Gerrit P. Haase" <[email-masked]>
To: "Ted Shieh" <[email-masked]>
Cc: [email-masked]
Date: Sat, 8 Jun 2002 03:21:16 +0200

Hallo Ted,

Am Freitag, 7. Juni 2002 um 07:48 schriebst du:

> Hi, I've been searching the Internet to find out how to install DBD::mysql
> on Cygwin, and I found that you were successful in getting this to work:
> http://www.rosat.mpe-garching.mpg.de/mailing-lists/cpan-testers/2001-11/msg00057.html

Yes.

> Could you tell me how managed to do this?

> When I try to build DBD::mysql on Cygwin, I find that it is unable to
> build mysql.dll:
> $ make
> gcc -c -I/usr/lib/perl5/site_perl/5.6.1/cygwin-multi/auto/DBI -
> I'/mysql/usr/include/mysql' -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing
> -I/usr/local/include -DUSEIMPORTLIB -O2   -DVERSION=\"2.1017\"
> -DXS_VERSION=\"2.1017\"  -I/usr/lib/perl5/5.6.1/cygwin-multi/CORE
> dbdimp.c
> gcc -c -I/usr/lib/perl5/site_perl/5.6.1/cygwin-multi/auto/DBI
> -I'/mysql/usr/include/mysql' -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing
> -I/usr/local/include -DUSEIMPORTLIB -O2   -DVERSION=\"2.1017\"
> -DXS_VERSION=\"2.1017\"  -I/usr/lib/perl5/5.6.1/cygwin-multi/CORE
> mysql.c
> Running Mkbootstrap for DBD::mysql ()
> chmod 644 mysql.bs
> rm -f blib/arch/auto/DBD/mysql/mysql.dll
> LD_RUN_PATH="/mysql/usr/lib/mysql:/usr/lib" /usr/bin/perl myld ld2  -s
> -L/usr/local/lib dbdimp.o mysql.o  -o blib/arch/auto/DBD/mysql/mysql.dll
> /usr/lib/perl5/5.6.1/cygwin-multi/CORE/libperl5_6_1.a -L/mysql/usr/lib/mysql
> -lmysqlclient -lz -lcrypt -lm -lc
> dllwrap --dllname mysql.dll --driver-name gcc --dlltool dlltool
> --export-all-symbols --as as --output-def libmysql.def --output-lib libmysql.a \
> -s -L/usr/local/lib dbdimp.o mysql.o
> /usr/lib/perl5/5.6.1/cygwin-multi/CORE/libperl5_6_1.a -L/mysql/usr/lib/mysql
> -lmysqlclient -lz -lcrypt -lm -lc
> chmod 755 blib/arch/auto/DBD/mysql/mysql.dll
> chmod: getting attributes of `blib/arch/auto/DBD/mysql/mysql.dll': No such
> file or directory
> make: *** [blib/arch/auto/DBD/mysql/mysql.dll] Error 1

> I expanded a mysql Linux rpm into /mysql, so the header and include files
> are in /mysql/usr/include/mysql and /mysql/usr/lib/mysql, respectively.

You cannot link against a Linux version of MySQL.

> Then I decided to build MySQL on Cygwin and link to the resulting library
> files.

This is a better idea.

> This also didn't work (here is the last little bit):
[...]
> gcc -O3 -DDBUG_OFF -o conf_to_src conf_to_src.o -lz -lcrypt
> /usr/lib/libcygwin.a(libcmain.o)(.text+0x6a): undefined reference to
> `WinMain@16'
> collect2: ld returned 1 exit status
> make[2]: *** [conf_to_src] Error 1

Which version of MySQL?

> If you can help me out at all, I'd really appreciate it.  If not, that's
> understandable - I don't want to take up too much of your time.

You'll need to build MySQL on Cygwin (at least the client lib).
I built the server too, I have a patch uploaded:
http://timtowtdi.topcities.com/cygwin/mysql/
There is also my script where you can see which options I used.
I cannot say if a later version will build too, I tried 4.xxx somtimes
and this fails, but it was a beta release, maybe in the meantime
someone there has investigated some time in learning how to use
libtool, so it it may work now.  Just read the manual and look what
has been changed and if you can still use the flags I used.

BTW, the 'tarballs' at this site aren't there, they delete all that is
bigger than 1MB (uploading works fine...).

Gerrit
-- 
=^..^=
Please keep this on the list so others may benfit from our
conversation too, thanks.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/