File: README.OSX

package info (click to toggle)
unixodbc 2.3.11-2%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,924 kB
  • sloc: ansic: 86,782; makefile: 1,125; sh: 1,059; yacc: 972; sql: 1
file content (136 lines) | stat: -rw-r--r-- 4,464 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
+-------------------------------------------------------------+
| unixODBC                                                    |
| Mac OSX                                                     |
+-------------------------------------------------------------+

README
---------------------------------------------------------------

It seems at least with 10.5 of OSX, that we can just configure as
normal (--enable-gui=no) and build, no special instructions are
needed.

---------------------------------------------------------------

Building With GNU Auto Tools (by Nick):

	It looks as if Darwin (Mac OSX) doesn't support the normal
	dlopen type process that unixODBC requires. However help is
	at hand in the form of dlcompat-20010831.tar.gz. This file
	contains wrappers to emulate the calls. I have put this in
	
	ftp://ftp.unixodbc.org/pub/beta/unixODBC/dlcompat-20010831.tar.gz
	
	It should be downloaded, unpacked then run make install
	
	This should be done before configuring unixODBC
	
	This file was created by Christoph Pfisterer <cp@chrisp.de> and
	the original copy can be found at 
	
	    http://fink.sourceforge.net
	
	If you get a "ld: multiple definitions of symbol " error, 
	then you should edit the file libtool in the unixODBC base 
	directory and find the line
	
	    whole_archive_flag_spec="-all_load \$convenience"
	
	and replace it with
	
	    whole_archive_flag_spec=
	
	As at the time of writing, Qt is not available on OSX, its best to
	disable the search for X libs that may fail, by configuring with
	
	    ./configure --enable-gui=no

Problems:

    There is a problem it seems with libtool on OSX that incorrectly sets 
    the SHLIBEXT. The Driver Manager code will now report this if its used
    in this condition. There are two solutions. Either after running configure
    check config.h, and search for the string SHLIBEXT. It should look like this:

#define SHLIBEXT ".dylib"

    But may look like this:

#define SHLIBEXT "test .$module = .yes && echo .so || echo .dylib"

    If it does, then change it to the first definition.

    The other fix is to change the configure script to find the correct value, 
    search for the line:

shrext_cmds='test .$module = .yes && echo .so || echo .dylib'

    And change to 

shrext_cmds=`test .$module = .yes && echo .so || echo .dylib`

    Then rerun configure

It also seems that Makefile.,svn needs some help, this thread seems to cover 
it and solutions.

https://stackoverflow.com/questions/15448582/installed-libtool-but-libtoolize-not-found/15448876


Building With Qt qmake (by Peter):

	Qt is now available for OSX but unixODBC may not detect your Qt
	libs... worse yet you may not be able sort out the GNU auto-tools
	required to build on OSX.
	
	If you want to build using qmake then read README.qmake.
	

Creating Install Packages:

	unixODBC contains a number of directories and files to help create
	OSX Packages. The process of doing so is not nearly as automated 
	as creating RPM files using the GNU auto tools. Look for the
	mac-install and mac-package directories.

Cursor LIB

The cursor lilb needs a manual stage build to create it as a OSX bundle
it needs to be like that so the DM can load it at run time.

To do this, after the "make" and "make install" have finished, go to the
cur directory in the build tree. Then there issue these commands

cc -bundle -flat_namespace -undefined suppress -o libodbccr.1.0.0.so *.lo
cp libodbccr.1.0.0.so /usr/local/lib/libodbccr.1

Replace /usr/local/lib/ in the above with whatever your actual unixODBC 
lib path is.

You may also have to do the same with any driver you build. You can check
this by testing the type of the lib, for example.

file /usr/local/lib/libodbcpsql.2.0.0.so
/usr/local/lib/libodbcpsql.2.0.0.so: Mach-O dynamically linked shared library ppc

This is not the correct type.

So to get it as you need :-

cd Drivers/Postgre7.1
cc -bundle -flat_namespace -undefined suppress -o libodbcpsql.2.0.0.so *.lo
cp libodbcpsql.2.0.0.so /usr/local/lib/libodbcpsql.2.0.0.so

Now to check

file /usr/local/lib/libodbcpsql.2.0.0.so
/usr/local/lib/libodbcpsql.2.0.0.so: Mach-O bundle ppc

Thats how it should be to work under the driver manager

+-------------------------------------------------------------+
| Peter Harvey <pharvey@codebydesign.com>                     |
| Added to by Nick Gorham <nick@lurcher.org>                  |
+-------------------------------------------------------------+