forked from lurcher/unixODBC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.AIX
88 lines (58 loc) · 2.63 KB
/
README.AIX
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
Building on AIX
===============
Install
=======
AIX seems to ship with a install tool /usr/bin/bsdinstall, unfortunatly
the version of autoconf that unixODBC uses doesn't seem to like this, so
make sure it doesn't find this. It may be best to define INSTALL as a
empty string before building, forcing it to use the builtin install-sh.
Threads
=======
You need to decide to build with or without threads, if you want threads
I would do this
export CC=xlc_r
export CXX=xlC_r
./configure
If you don't want threads, do this
export CC=xlc
export CXX=xlC
./configure --enable-threads=no
Shared Libs
===========
Because of the way that AIX builds its shared libs there are a couple of
points to remember
1. All drivers need changing into .so
The drivers will be build as a .a, containing a .so, BUT dlopen only is
able to open a .so, so to fix this, for each driver that is needed, do
the following (in this case the postgres driver).
Go to the target lib directory
cd /usr/local/lib
extract the .so from the .a
ar -x libodbcpsql.a
This will create libodbcpsql.so.2
The same will need doing for the seyup libs
ar -x libodbcpsqlS.a
2. Shared libs containing C++ are special
This is only a issue with the libodbcinstQ.a lib that is opened by
ODBCConfig. There are two things, first because libtool decides that
shared libs ar lib*.a the code trys to load libodbcinstQ.a, and also
we maye have to rebuild the lib using the IBM util makeC++SharedLib
(the name gives its away :-)
I have tried this with a current AIX, and it seems that all is needed is to extract the .so
from the .a by running ar -x libodbcinstQ.a to get the .so
If that doesn't help, or on older AIX's the following may need doing.
After the make install is done, go into the odbcinstQ dir on thE
build tree, and do the following
makeC++SharedLib -p 0 -o libodbcinstQ.so.1.0 -L$QTDIR/lib -lqt -L$PREFIX/lib -lodbc -lodbcinst .libs/libodbcinstQ.lax/libodbcextraslc.al/strcasecmp.o *.o ../ini/*.lo
where QTDIR is set to the top of the qt tree, so $QTDIR/lib will contain libqt.a
and PREFIX is set to the unixODBC install tree, so $PREFIX/lib contains libodbc.a.
Ignore any duplicate symbol warnings they are due to the same things being in libodbc.a
and libodbcinst.a
this will then build a libodbcinstQ.so.1.0, we can copy that to the target lib dir,
and delete the existing lib, and link it (again replace $PREFIX with the correct path
cp libodbcinstQ.so.1.0 $PREFIX/lib
cd $PREFIX/lib
rm libodbcinstQ.a
ln -s libodbcinstQ.so.1.0 libodbcinstQ.a
Then all should be OK with ODBCConfig
Nick Gorham