PowerBook G4 "12 Mac OS X 10.3.4 (Build 7H63) Perl 5.8.1-RC3 XCode 1.1 DBI 1.43 (attempting to install) MySqld Ver 4.0.16-standard for apple-darwin6.6 on powerpc
For one reason or another, I've decided to install DBI/DBD on my laptop. In attempting to do that, I've run across a few problems and questions.
I attempted to download and install the DBI on my laptop. Prior to attempting the install I modified the config.pm file as per Ed Foy's note. I have the developer tools installed - so I have gcc 3.3. I downloaded the module from CPAN. I extracted it to a directory on my desktop. At the CLI, I made the DBI directory my current directory. I executed the following sequence of commands:
perl MakeFile.PL
Mac OS X Perl List,
Regarding DBD-mysql and DBI on Mac OS X SERVER-- this is my success story after a many days of research and attempts to get it all compiled.
I am posting my notes on the install of DBI and DBD-mysql on Mac OS X 10.3 server in the hopes that others may find it useful. If you are new to this particular topic here is some background reading for you.
Others will want to skip down to the "OK HERE GOES" part. As it stands right now I am still stuck on the DBD-mysql build, having
BACKGROUND READING see http://www.truerwords.net/articles/osx/install_dbd_mysql.html and http://caseywest.com/journal/archives/000510.html
also this post from apple....
We recently discovered the DBD::mysql problem as well. The patch is to edit /System/Library/Perl/5.8.1/darwin-thread-multi-2level/Config.pm, replacing:
ld='MACOSX_DEPLOYMENT_TARGET=10.3 cc'
with
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc'
Unfortunately, this change is too late to get into Panther
OK HERE GOES
I was having some problems installing the DBI (perl Makefile.PL gave an error message about a need for complete specification for a library).
I got around this specific hold-up by running the XCode 1.1 installer again. Note that I had to do a "customize" install and I chose everything except the Cross-Development stuff and the last item on the list which has something to do with system tests. Only once I had re-done a custom install of XCode 1.1 did my DBI modules build correctly (perl Makefile.pl, make, make test, sudo make install)
DBD-mysql module
I downloaded DBD-mysql 2.9003 and untarred it
ran "perl Makefile.pl" and got these errors:
Unrecognized argument in LIBS ignored: '-arch' Unrecognized argument in LIBS ignored: 'i386' Unrecognized argument in LIBS ignored: '-arch' Unrecognized argument in LIBS ignored: 'ppc' Unrecognized argument in LIBS ignored: '-pipe'
ran "make" got more errors:
[www:~/perl_source/DBD-mysql-2.9003] jason% make
-I/usr/include/mysql -O3 -fno-omit-frame-pointer -arch i386 -arch ppc -pipe -g -pipe -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -Os -DVERSION=\"2.9003\" -DXS_VERSION=\"2.9003\" "-I/System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE" dbdimp.c
cc: cannot read specs file for arch `i386'
make: *** [dbdimp.o] Error 1
There are some notes about how it is necessary to remove three instances of "-arch i386" in the Makefile which gets produced
OK, then I cleaned out my makefile (make distclean) and ran "perl Makefile.pl --testdb=test --testuser=XXX --testpassword=XXX" again
Then I manually edited the Makefile and removed all three mentions of "-arch i386"
When I run "make" the files get through a bunch of cp statements ...
cp lib/Mysql.pm blib/lib/Mysql.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Mysql/Statement.pm blib/lib/Mysql/Statement.pm
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cc -c -I/Library/Perl/5.8.1/darwin-thread-multi-2level/auto/DBI -I/usr/include/mysql -O3 -fno-omit-frame-pointer -arch ppc -pipe -g -pipe -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -Os -DVERSION=\"2.9003\" -DXS_VERSION=\"2.9003\" "-I/System/Library/Perl/5.8.1/darwin-thread-multi-2level/CORE" dbdimp.c
Then I get some errors, specifically that it could not find a "mysql.h" file
In file included from dbdimp.c:19: dbdimp.h:21:49: mysql.h: No such file or directory dbdimp.h:22:49: errmsg.h: No such file or directory
After I get this error, it spirals out of control for pages and pages of undefined functions and routes, etc. I assume that all these routines are found to be undefined because the "mysql.h" file is not included correctly.
I had to open up the "dbdinc.h" file the statements which read
#incldue <mysql.h> #incldue <errmsg.h>
to include complete path names:
#include </usr/local/mysql-standard-4.0.12-apple-darwin6.4-powerpc/include/mysq\
l.h> /* Comes with MySQL-devel */
and the cooresponding for the errmsg.h include statement
(I also had to do this in the "constants.h" file)
Then I go to do "make" without any errors.
Then when I did "make test" I got some "Access Denied" errors for the mysql user that I had origionally used when I build the "perl Makefile.PL ....".
So then I had to fiddle with the users on my MySQL install and then I rebuilt the perl Makefile.PL a coupe of times trying to get it rigth (of course, repeating the steps in between of removing the 'arch -i386' from the makefile each time)
Finally I got the tests to work and the install and it works now.
So these are my complete notes for those who may want to follow down this path.
-Jason FB