I'm sure everyone is thrilled by the plethora of unique
ways you can install and use python on MacOSX. (Apple's
built-in, Fink pkg manager, various ZOPE binaries,
source, etc)
Unfortunately, this leads to much confusion for the
makefiles.
In my case...
I am using Fink for OS10.2x's version of ZOPE
and therefore need to use its matching 'fink installed
python' as opposed to Apple's.
Below is the Post I made to the Fink Developer's
Mailinglist detailing how I was able to configure
setup.py to work with Fink installed Zope (and python).
Ok, I figured it out.
I'm not using any binaries, fink installed everything
(mySQL, Zope and python 2.1)
When I commanded 'python setup.py build' it tried to
use Apple's Python
and I get the weird i386 problem.(Macs aren't i386)
When I commanded '/sw/bin/python2.1 setup.py build' it
uses the python from Fink. I don't get the -i386 problem.
HOWEVER,
the default setup.py in MySQL-python-0.9.2.tgz
which I downloaded from it's official home at
http://sourceforge.net/projects/mysql-python
DOES NOT WORK!
To get MySQL-python-0.9.2.tgz to build and install
correctly I had to make the following changes to
setup.py and then remember to use /sw/bin/python2.1 for
build and install.
>>>>scroll down to the line
mysqlclient = thread_safe_library and
"mysqlclient_r" or "mysqlclient"
>>>>remove the words "mysqlclient_r" or
>>>>scroll down to the section
elif sys.platform[:6] == "darwin": # Mac OS X
include_dirs.append('/sw/include')
library_dirs.append('/sw/lib')
extra_link_args.append('-flat_namespace')
>>>>Change it to replace the previous definitions
elif sys.platform[:6] == "darwin": # Mac OS X
include_dirs = ['/sw/include/mysql']
library_dirs = ['/sw/lib/mysql']
extra_link_args.append('-flat_namespace')
Logged In: YES
user_id=71372
Try this:
elif sys.platform[:6] == "darwin": # Mac OS X
include_dirs.extend(['/sw/include', '/sw/include/mysql'])
library_dirs.extend(['/sw/lib', '/sw/lib/mysql'])
extra_link_args.append('-flat_namespace')
Does that work OK? mysqlclient issue should be fixed in CVS.
Logged In: YES
user_id=71372
New setup.py should fix at least some of this
Logged In: YES
user_id=71372
This has been fixed in the current CVS tree.