1+-------------------------------------------------------------+
2| unixODBC                                                    |
3| Mac OSX                                                     |
4+-------------------------------------------------------------+
5
6README
7---------------------------------------------------------------
8
9It seems at least with 10.5 of OSX, that we can just configure as
10normal (--enable-gui=no) and build, no special instructions are
11needed.
12
13---------------------------------------------------------------
14
15Building With GNU Auto Tools (by Nick):
16
17	It looks as if Darwin (Mac OSX) doesn't support the normal
18	dlopen type process that unixODBC requires. However help is
19	at hand in the form of dlcompat-20010831.tar.gz. This file
20	contains wrappers to emulate the calls. I have put this in
21
22	ftp://ftp.unixodbc.org/pub/beta/unixODBC/dlcompat-20010831.tar.gz
23
24	It should be downloaded, unpacked then run make install
25
26	This should be done before configuring unixODBC
27
28	This file was created by Christoph Pfisterer <cp@chrisp.de> and
29	the original copy can be found at
30
31	    http://fink.sourceforge.net
32
33	If you get a "ld: multiple definitions of symbol " error,
34	then you should edit the file libtool in the unixODBC base
35	directory and find the line
36
37	    whole_archive_flag_spec="-all_load \$convenience"
38
39	and replace it with
40
41	    whole_archive_flag_spec=
42
43	As at the time of writing, Qt is not available on OSX, its best to
44	disable the search for X libs that may fail, by configuring with
45
46	    ./configure --enable-gui=no
47
48Problems:
49
50    There is a problem it seems with libtool on OSX that incorrectly sets
51    the SHLIBEXT. The Driver Manager code will now report this if its used
52    in this condition. There are two solutions. Either after running configure
53    check config.h, and search for the string SHLIBEXT. It should look like this:
54
55#define SHLIBEXT ".dylib"
56
57    But may look like this:
58
59#define SHLIBEXT "test .$module = .yes && echo .so || echo .dylib"
60
61    If it does, then change it to the first definition.
62
63    The other fix is to change the configure script to find the correct value,
64    search for the line:
65
66shrext_cmds='test .$module = .yes && echo .so || echo .dylib'
67
68    And change to
69
70shrext_cmds=`test .$module = .yes && echo .so || echo .dylib`
71
72    Then rerun configure
73
74
75Building With Qt qmake (by Peter):
76
77	Qt is now availible for OSX but unixODBC may not detect your Qt
78	libs... worse yet you may not be able sort out the GNU auto-tools
79	required to build on OSX.
80
81	If you want to build using qmake then read README.qmake.
82
83
84Creating Install Packages:
85
86	unixODBC contains a number of directories and files to help create
87	OSX Packages. The process of doing so is not nearly as automated
88	as creating RPM files using the GNU auto tools. Look for the
89	mac-install and mac-package directories.
90
91Cursor LIB
92
93The cursor lilb needs a manual stage build to create it as a OSX bundle
94it needs to be like that so the DM can load it at run time.
95
96To do this, after the "make" and "make install" have finished, go to the
97cur directory in the build tree. Then there issue these commands
98
99cc -bundle -flat_namespace -undefined suppress -o libodbccr.1.0.0.so *.lo
100cp libodbccr.1.0.0.so /usr/local/lib/libodbccr.1
101
102Replace /usr/local/lib/ in the above with whatever your actual unixODBC
103lib path is.
104
105You may also have to do the same with any driver you build. You can check
106this by testing the type of the lib, for example.
107
108file /usr/local/lib/libodbcpsql.2.0.0.so
109/usr/local/lib/libodbcpsql.2.0.0.so: Mach-O dynamically linked shared library ppc
110
111This is not the correct type.
112
113So to get it as you need :-
114
115cd Drivers/Postgre7.1
116cc -bundle -flat_namespace -undefined suppress -o libodbcpsql.2.0.0.so *.lo
117cp libodbcpsql.2.0.0.so /usr/local/lib/libodbcpsql.2.0.0.so
118
119Now to check
120
121file /usr/local/lib/libodbcpsql.2.0.0.so
122/usr/local/lib/libodbcpsql.2.0.0.so: Mach-O bundle ppc
123
124Thats how it should be to work under the driver manager
125
126+-------------------------------------------------------------+
127| Peter Harvey <pharvey@codebydesign.com>                     |
128| Added to by Nick Gorham <nick@lurcher.org>                  |
129+-------------------------------------------------------------+
130
131
132