Discussion:
[BitPim-devel] Instructions for building universal apsw/sqlite
Sean Burke
2007-09-04 12:51:06 UTC
Permalink
Ok,
I spent a couple hours mashing this through, so here is an update to the
things I had to do to get a static universal apsw build.

1) Edit your python makefile:
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/Makefile

Add the following to the LDFLAGS field:
-Wl,-F.,-search_paths_first

The whole line should look like this:
-arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g
-Wl,-F.,-search_paths_first

2) Download sqlite 3.4.1 into your apsw folder:
cd apsw-3.3.13-r1
wget http://www.sqlite.org/sqlite-3.4.1.tar.gz

3) Unzip, move to "sqlite3" directory:
tar zxvf sqlite-3.4.1.tar.gz
mv sqlite-3.4.1 sqlite3

4) Configure sqlite a la Roger's prescription:
env CC="gcc -fPIC" CFLAGS="-DHAVE_DLOPEN" ./configure
--enable-threadsafe --disable-tcl

5) Add the following line to you makefile AFTER the variable TCC is defined:
TCC += -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk

6) Build sqlite3 and copy library to source root:
make && cp .libs/*.a && ranlib *.a

You will get the following errors - this is OK:
ranlib: for architecture: ppc file: libsqlite3.a(loadext.o) has no symbols
ranlib: for architecture: ppc file: libsqlite3.a(os_win.o) has no symbols
ranlib: for architecture: ppc file: libsqlite3.a(os_os2.o) has no symbols
ranlib: for architecture: i386 file: libsqlite3.a(loadext.o) has no symbols
ranlib: for architecture: i386 file: libsqlite3.a(os_win.o) has no symbols
ranlib: for architecture: i386 file: libsqlite3.a(os_os2.o) has no symbols

If you get 3 errors instead of six, your build is not universal.

7) Build and install apsw:
python setup.py install

(Again, if you are going to get errors, it will be at this step or the
previous one.)

Hope this helps. Email with questions, comments.

Sean
--
Sean Patrick Burke
Imaging Analysis Specialist
Albert Einstein College of Medicine
Yeshiva University
Allen Hancock
2007-09-07 03:01:36 UTC
Permalink
a couple of extra notes for the more green at this (hi)

and I am bracketing [ ] anything that needs to be all on one line,
as email tends to throw in line breaks
Post by Sean Burke
Ok,
I spent a couple hours mashing this through, so here is an update to the
things I had to do to get a static universal apsw build.
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
config/Makefile
-Wl,-F.,-search_paths_first
The whole line should look like this, with python 2.5.1, it is line 66
[ LDFLAGS= -arch i386 -arch ppc -isysroot /Developer/SDKs/
MacOSX10.4u.sdk -g -Wl,-F.,-search_paths_first ]
Post by Sean Burke
2) Download sqlite 3.4.1 into your apsw folder somewhere on your
cd apsw-3.3.13-r1
wget http://www.sqlite.org/sqlite-3.4.1.tar.gz
tar zxvf sqlite-3.4.1.tar.gz
mv sqlite-3.4.1 sqlite3
Post by Sean Burke
4) Configure sqlite a la Roger's prescription (just run this in
the terminal while in the sqlite directory:)
[ env CC="gcc -fPIC" CFLAGS="-DHAVE_DLOPEN" ./configure --enable-
threadsafe --disable-tcl ]
Post by Sean Burke
5) Add the following line to your Makefile AFTER the variable TCC
is defined: (putting it just after line 29 is good)
[ TCC += -arch ppc -arch i386 -isysroot /Developer/SDKs/
MacOSX10.4u.sdk ]
Post by Sean Burke
6) Build sqlite3 and copy library to source root: (fixed a typo here)
make && cp .libs/*.a . && ranlib *.a
Post by Sean Burke
ranlib: for architecture: ppc file: libsqlite3.a(loadext.o) has no symbols
ranlib: for architecture: ppc file: libsqlite3.a(os_win.o) has no symbols
ranlib: for architecture: ppc file: libsqlite3.a(os_os2.o) has no symbols
ranlib: for architecture: i386 file: libsqlite3.a(loadext.o) has no symbols
ranlib: for architecture: i386 file: libsqlite3.a(os_win.o) has no symbols
ranlib: for architecture: i386 file: libsqlite3.a(os_os2.o) has no symbols
If you get 3 errors instead of six, your build is not universal.
7) now get into the apsw directory
cd ..
python setup.py install
Post by Sean Burke
(Again, if you are going to get errors, it will be at this step or
the previous one.)
Hope this helps. Email with questions, comments.
Sean
Thanks a million Sean!

that did the trick!
Joe Pham
2007-09-07 21:37:50 UTC
Permalink
Thanks for the notes. We'll put them in the Wiki once we get it going.

-Joe Pham

_____________________________________________________________
Click to find local singles for dating, romance and fun
http://3rdpartyoffers.netzero.net/TGL2211/fc/Ioyw6ijm1uSbyEI88wSnN5pDXQerhGMUm5gyGNhniN3Qujmke4MBlq/
Loading...