Re: DBD::mysql 3.000 Released

Randy Kobes <[email protected]>
Newsgroups gmane.comp.db.mysql.perl,gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
On Wed, 6 Jul 2005, Paul DuBois wrote:

> At 14:44 +0200 7/1/05, Jochen Wiedmann wrote:
> >On 7/1/05, Steve Hay <[email protected]> wrote:
> >
> >>  to remove all mention of mysql_config which doesn't exist on Win32, and
> >>  to sort out problems with "long long", "strncasecmp",
> >> etc.
> >
> >As Patrick seems to be an employee of MySQL AB: A
> >possibly better solution would be to finally add
> >mysql_config to the Windows distributions. I can think of
> >absolutely no reason, why this shouldn't be possible or
> >even difficult. And the advantages are quite obvious, as
> >the required libraries are varying, in particular on
> >Windows.
>
> I suppose one problem is that Windows doesn't have
> /bin/sh.  mysql_config is a shell script.

I've been playing around with a perl script for Win32
that emulates the mysql_config shell script - this is at
   http://theoryx5.uwinnipeg.ca/mysql_config_win32.pl
What this will do is install a mysql_config.pl (and
associated .bat file) under an installed $MYSQL/bin/
directory; to do so, either put $MYSQL/bin/ in the PATH
and run
   perl mysql_config_win32.pl
or else give the full path to the root MySQL directory as
   perl mysql_config_win32.pl --with-mysql=C:\Path\to\MySQL

With this, and the following patch to Makefile.PL of
DBD-mysql (version 3.0002):
==============================================================
--- Makefile.PL.orig	Sun Jul  3 16:01:18 2005
+++ Makefile.PL	Wed Jul 20 23:32:10 2005
@@ -3,7 +3,7 @@
 BEGIN {
     use Config;

-    if ($] == 5.008 && $ENV{"LANG"} ne "C") {
+    if ($] == 5.008 && $ENV{"LANG"} ne "C" && $^O ne 'MSWin32') {
 	$ENV{LANG} = "C";
 	print STDERR "\n\n\n\$ENV{LANG} is not 'C' execing 'perl Makefile.PL'".
 	" with ENV{LANG} == 'C'\n You can skip this check by: 'export ".
@@ -50,12 +50,13 @@

 my $source = {};

-if ($^O !~ /mswin32/i)
 {
   #Check for mysql_config first
   $source->{'mysql_config'}="guessed";
   if ($opt->{'mysql_config'})
-  {
+  {
+    $opt->{'mysql_config'} = Win32::GetShortPathName($opt->{'mysql_config'})
+        if $^O eq 'MSWin32';
     if (-f $opt->{'mysql_config'})
     {
       $source->{'mysql_config'} = "Users choice";
@@ -396,7 +397,6 @@
                          by default the port number is choosen from the
                          mysqlclient library
   --mysql_config=<path>  Specify <path> for mysql_config script
-                         (Not supported on Win32)
   --nocatchstderr        Supress using the "myld" script that redirects
                          STDERR while running the linker.
   --nofoundrows          Change the behavoiur of \$sth->rows() so that it
@@ -445,7 +445,6 @@
     return;
   }

-  if ($^O !~ /mswin32/i)
   {
     # First try to get options values from mysql_config
     my $command = $opt->{'mysql_config'} . " --$param";

====================================================================
one can configure DBD-mysql on Win32 either by having
$MYSQL/bin/ in the PATH, or by running
   perl Makefile.PL --mysql_config=C:\Path\to\MySQL\bin\mysql_config.bat

There may be, though, implicit assumptions in this that are
particular to my configuration - if you try this, and find
problems, please let me know.

-- 
best regards,
randy kobes

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.