UnixODBC installation under IBM AIX

Download unixODBC-2.2.14.tar.gz from http://www.unixodbc.org/ first.

Accoring to introduction in the document of http://www.ibm.com/developerworks/cn/data/library/techarticles/dm-0402walker/index.html, we can get the installation directory by using gzip -d  and tar xvf .

Then issue the following command:
./configure --prefix=/home/unixodbc --disable-gui --disable-drivers CC=xlc_r CXX=xlC_r

 

But when I issue the command, an error stating xlc not found occured. Check the PATH environment variable, I found the directory vacpp is missing because we didn't add this path in PATH environment variable for the root user.

Modify /etc/environment to add /usr/vacpp/bin into PATH environment variable  and re-issue the above command. It's ok this time.

 

After the configure process finished, I checked the config.log and found some information like:

configure:23014: checking if platform is 64 bit
configure:23017: result: No


It seemed the installation program considered the platform is 32 bit. That must be for the reason we didn't set the OBJECT_MODE environment variable to 64 bit. So issue the command export OBJECT_MODE=64 and then start the configure process again. It's also ok now.

 

The second setp is to make.   It took a little bit time to make. The process in the beginning is very well, but the following error raised when making the file SQLGetPrivateProfileString.c in the directory odbcinst:
        source='SQLGetPrivateProfileString.c' object='SQLGetPrivateProfileString.lo' libtool=yes  DEPDIR=.deps depmode=none /bin/sh ../depcomp  /bin/sh ../libtool --tag=CC --mode=compile xlc_r -DPACKAGE_NAME=/"/" -DPACKAGE_TARNAME=/"/" -DPACKAGE_VERSION=/"/" -DPACKAGE_STRING=/"/" -DPACKAGE_BUGREPORT=/"/" -DPACKAGE=/"unixODBC/" -DVERSION=/"2.2.14/" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_SEM_H=1 -DHAVE_DLFCN_H=1 -DHAVE_ICONV=1 -DICONV_CONST= -DHAVE_LIBCRYPT=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_SYS_TIME_H=1 -DSIZEOF_LONG=8 -DPLATFORM64=1 -DHAVE_LONG_LONG=1 -DSIZEOF_LONG_INT=8 -DHAVE_STRCASECMP=1 -DHAVE_STRNCASECMP=1 -DHAVE_VSNPRINTF=1 -DHAVE_STRTOL=1 -DHAVE_ATOLL=1 -DHAVE_STRTOLL=1 -DHAVE_ENDPWENT=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_FTIME=1 -DHAVE_TIME=1 -DHAVE_LIBTHREAD=1 -D_REENTRANT=1 -DHAVE_LOCALTIME_R=1 -DHAVE_FTOK=1 -DHAVE_SEMGET=1 -DHAVE_SHMGET=1 -DHAVE_SEMOP=1 -DHAVE_SNPRINTF=1 -DNEED_SEMUNDO_UNION=1 -DCOLLECT_STATS=1 -DSTDC_HEADERS=1 -DHAVE_MALLOC_H=1 -DHAVE_UNISTD_H=1 -DHAVE_PWD_H=1 -DHAVE_CRYPT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYNCH_H=1 -DHAVE_STRINGS_H=1 -DHAVE_STRING_H=1 -DHAVE_LOCALE_H=1 -DHAVE_SYS_MALLOC_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_SEM_H=1 -DHAVE_STDARG_H=1 -DHAVE_VARARGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TIMEB_H=1 -DHAVE_TIME_H=1 -DHAVE_DIRENT_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_VPRINTF=1 -DHAVE_DOPRNT=1 -DHAVE_PUTENV=1 -DHAVE_SOCKET=1 -DHAVE_STRDUP=1 -DHAVE_STRSTR=1 -DHAVE_SETENV=1 -DHAVE_SETLOCALE=1 -DHAVE_STRCHR=1 -DUNIXODBC_SOURCE=1  -I. -I. -I../include  -DSYSTEM_FILE_PATH=/"/ztebsn/unixodbc/etc/"  -DDEFLIB_PATH=/"/ztebsn/unixodbc/lib/"  -DSHLIBEXT=/".so/"  -DUNIXODBC_SOURCE  -I../libltdl     -g -DENABLE_INI_CACHING -c -o SQLGetPrivateProfileString.lo SQLGetPrivateProfileString.c


 xlc_r -DPACKAGE_NAME=/"/" -DPACKAGE_TARNAME=/"/" -DPACKAGE_VERSION=/"/" -DPACKAGE_STRING=/"/" -DPACKAGE_BUGREPORT=/"/" -DPACKAGE=/"unixODBC/" -DVERSION=/"2.2.14/" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_SEM_H=1 -DHAVE_DLFCN_H=1 -DHAVE_ICONV=1 -DICONV_CONST= -DHAVE_LIBCRYPT=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_SYS_TIME_H=1 -DSIZEOF_LONG=8 -DPLATFORM64=1 -DHAVE_LONG_LONG=1 -DSIZEOF_LONG_INT=8 -DHAVE_STRCASECMP=1 -DHAVE_STRNCASECMP=1 -DHAVE_VSNPRINTF=1 -DHAVE_STRTOL=1 -DHAVE_ATOLL=1 -DHAVE_STRTOLL=1 -DHAVE_ENDPWENT=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_FTIME=1 -DHAVE_TIME=1 -DHAVE_LIBTHREAD=1 -D_REENTRANT=1 -DHAVE_LOCALTIME_R=1 -DHAVE_FTOK=1 -DHAVE_SEMGET=1 -DHAVE_SHMGET=1 -DHAVE_SEMOP=1 -DHAVE_SNPRINTF=1 -DNEED_SEMUNDO_UNION=1 -DCOLLECT_STATS=1 -DSTDC_HEADERS=1 -DHAVE_MALLOC_H=1 -DHAVE_UNISTD_H=1 -DHAVE_PWD_H=1 -DHAVE_CRYPT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYNCH_H=1 -DHAVE_STRINGS_H=1 -DHAVE_STRING_H=1 -DHAVE_LOCALE_H=1 -DHAVE_SYS_MALLOC_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_SEM_H=1 -DHAVE_STDARG_H=1 -DHAVE_VARARGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TIMEB_H=1 -DHAVE_TIME_H=1 -DHAVE_DIRENT_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_VPRINTF=1 -DHAVE_DOPRNT=1 -DHAVE_PUTENV=1 -DHAVE_SOCKET=1 -DHAVE_STRDUP=1 -DHAVE_STRSTR=1 -DHAVE_SETENV=1 -DHAVE_SETLOCALE=1 -DHAVE_STRCHR=1 -DUNIXODBC_SOURCE=1 -I. -I. -I../include -DSYSTEM_FILE_PATH=/"/ztebsn/unixodbc/etc/" -DDEFLIB_PATH=/"/ztebsn/unixodbc/lib/" -DSHLIBEXT=/".so/" -DUNIXODBC_SOURCE -I../libltdl -g -DENABLE_INI_CACHING -c SQLGetPrivateProfileString.c -o SQLGetPrivateProfileString.o


"SQLGetPrivateProfileString.c", line 66.8: 1506-166 (S) Definition of function mutex_t requires parentheses.
"SQLGetPrivateProfileString.c", line 66.16: 1506-276 (S) Syntax error: possible missing '{'?
"SQLGetPrivateProfileString.c", line 70.24: 1506-045 (S) Undeclared identifier mutex.
"SQLGetPrivateProfileString.c", line 73.32: 1506-277 (S) Syntax error: possible missing ')' or ','?
"SQLGetPrivateProfileString.c", line 75.26: 1506-045 (S) Undeclared identifier mutex.
"SQLGetPrivateProfileString.c", line 261.23: 1506-045 (S) Undeclared identifier mutex_ini.
"SQLGetPrivateProfileString.c", line 281.23: 1506-045 (S) Undeclared identifier mutex_ini.
make: 1254-004 The error code from the last command is 1.


According to the error message, the complier can not find the definition of mutex_t.  But it is defined in system header file /usr/include/synch.h, so this file sync.h should be directly or indirectly refered to by the file SQLGetPrivateProfileString.c.

 

Google this error information I found some useful information in http://bbs.chinaunix.net/archiver/tid-1354992.html, this link presents a solution: copy $(SOURCEDIR)/DriverManager/drivermanager.h and __stats.h to the directory $(SOURCEDIR)/include. I did that but unfortunately it didn't work yet. The same error persisted. 


After careful review for the file drivermanager.h, I found it does include synch.h if the pre-compile macro HAVE_SYNCH_H is defined and we can find -DHAVE_SYNCH_H=1 from the options in the compile command.

Then I checked SQLGetPrivateProfileString.c and found only two head files time.h and odbcinstext.h are included. I checked all the header files level by level but did not find synch.h or drivermanager.h. So I was convinced that the program should be modified so that the file synch.h can be refered to by file SQLGetPrivateProfileString.c.  OK, let's do it.

 

Modify $(SOURCEDIR)/include/odbcinstext.h just like this:

add a new line

#include <drivermanager.h>

after the following line:
#include <odbcinst.h>

And  then make again and no error occured.

 

The last step is to install, issue the command:

make install

 

Now the unixodbc is successfully installed.

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值