Compile of DB::DB2 on cygwin

Compile of DB::DB2 on cygwin

am 16.06.2005 03:38:06 von gimme_this_gimme_that

Any suggestions on how to get DBD::DB2 to compile using cygwin
and gcc?

Is it even possible, are the libaries compatible?

Changing the loader from ld2 to ld changes results in lots of
"undefined reference to `pthread_getspacific' error messages.

Might there be another loader to try?

PS. I read the CAVEATS.

Thanks.


/cygdrive/c/code/db2dbd/DBD-DB2-0.78>perl Makefile.PL

Configuring DBD::DB2...
Remember to actually read the README and CAVEATS files!

Using DB2 in "c:/PROGRA~1/IBM/SQLLIB"
System: perl5.008002 DBI1.48 cygwin_nt-5.0 troubardix 1.5.5(0.9432)
2003-09-20 16:31 i686 unknown unknown cygwin cygwin-thread-multi-64int
dl_dlopen.xs
Compiler: gcc -O2 -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing
Includes: -I"c:/PROGRA~1/IBM/SQLLIB/include"
-I"/usr/lib/perl5/site_perl/5.8.2/cygwin-thread-multi-64int/ auto/DBI"
Libraries: -Lc:/PROGRA~1/IBM/SQLLIB/lib -ldb2

Checking if your kit is complete...
Looks good
Checking if your kit is complete...
Looks good
Writing Makefile for DBD::DB2::Constants
Writing Makefile for DBD::DB2
/cygdrive/c/code/db2dbd/DBD-DB2-0.78>make
cp DB2.pm blib/lib/DBD/DB2.pm
cp lib/Bundle/DBD/DB2.pm blib/lib/Bundle/DBD/DB2.pm
cp DB2.pod blib/lib/DBD/DB2.pod
make[1]: Entering directory
`/cygdrive/c/code/db2dbd/DBD-DB2-0.78/Constants'
cp Constants.pm ../blib/lib/DBD/DB2/Constants.pm
AutoSplitting ../blib/lib/DBD/DB2/Constants.pm
(../blib/lib/auto/DBD/DB2/Constants)
/usr/bin/perl.exe /usr/lib/perl5/5.8.2/ExtUtils/xsubpp -typemap
/usr/lib/perl5/5.8.2/ExtUtils/typemap Constants.xs > Constants.xsc &&
mv Constants.xsc Constants.c
gcc -c -I"c:/PROGRA~1/IBM/SQLLIB/include" -DPERL_USE_SAFE_PUTENV
-fno-strict-aliasing -DUSEIMPORTLIB -O0 -DVERSION=\"0.22\"
-DXS_VERSION=\"0.22\"
"-I/usr/lib/perl5/5.8.2/cygwin-thread-multi-64int/CORE" Constants.c
In file included from Constants.xs:16:
c:/PROGRA~1/IBM/SQLLIB/include/sqlcli.h:319: warning: redefinition of
`UCHAR'
/usr/include/w32api/winnt.h:53: warning: `UCHAR' previously declared
here
c:/PROGRA~1/IBM/SQLLIB/include/sqlcli.h:320: warning: redefinition of
`ULONG'
/usr/include/w32api/winnt.h:55: warning: `ULONG' previously declared
here
c:/PROGRA~1/IBM/SQLLIB/include/sqlcli.h:321: warning: redefinition of
`USHORT'
/usr/include/w32api/winnt.h:54: warning: `USHORT' previously declared
here
Running Mkbootstrap for DBD::DB2::Constants ()
chmod 644 Constants.bs
rm -f ../blib/arch/auto/DBD/DB2/Constants/Constants.dll
LD_RUN_PATH="" ld2 -s -L/usr/local/lib Constants.o -o
.../blib/arch/auto/DBD/DB2/Constants/Constants.dll
/usr/lib/perl5/5.8.2/cygwin-thread-multi-64int/CORE/libperl. dll.a
gcc -shared -o Constants.dll -Wl,--out-implib=libConstants.dll.a
-Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--stack,8388608 \
-s -L/usr/local/lib Constants.o
/usr/lib/perl5/5.8.2/cygwin-thread-multi-64int/CORE/libperl. dll.a
Creating library file: libConstants.dll.a
mv Constants.dll libConstants.dll.a
.../blib/arch/auto/DBD/DB2/Constants/
chmod 755 ../blib/arch/auto/DBD/DB2/Constants/Constants.dll
cp Constants.bs ../blib/arch/auto/DBD/DB2/Constants/Constants.bs
chmod 644 ../blib/arch/auto/DBD/DB2/Constants/Constants.bs
make[1]: Leaving directory
`/cygdrive/c/code/db2dbd/DBD-DB2-0.78/Constants'
/usr/bin/perl.exe /usr/lib/perl5/5.8.2/ExtUtils/xsubpp -typemap
/usr/lib/perl5/5.8.2/ExtUtils/typemap DB2.xs > DB2.xsc && mv DB2.xsc
DB2.c
gcc -c -I"c:/PROGRA~1/IBM/SQLLIB/include"
-I"/usr/lib/perl5/site_perl/5.8.2/cygwin-thread-multi-64int/ auto/DBI"
-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -DUSEIMPORTLIB -O0
-DVERSION=\"0.78\" -DXS_VERSION=\"0.78\"
"-I/usr/lib/perl5/5.8.2/cygwin-thread-multi-64int/CORE" DB2.c
In file included from DB2.h:9,
from DB2.xs:7:
c:/PROGRA~1/IBM/SQLLIB/include/sqlcli.h:319: warning: redefinition of
`UCHAR'
/usr/include/w32api/winnt.h:53: warning: `UCHAR' previously declared
here
c:/PROGRA~1/IBM/SQLLIB/include/sqlcli.h:320: warning: redefinition of
`ULONG'
/usr/include/w32api/winnt.h:55: warning: `ULONG' previously declared
here
c:/PROGRA~1/IBM/SQLLIB/include/sqlcli.h:321: warning: redefinition of
`USHORT'
/usr/include/w32api/winnt.h:54: warning: `USHORT' previously declared
here
gcc -c -I"c:/PROGRA~1/IBM/SQLLIB/include"
-I"/usr/lib/perl5/site_perl/5.8.2/cygwin-thread-multi-64int/ auto/DBI"
-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -DUSEIMPORTLIB -O0
-DVERSION=\"0.78\" -DXS_VERSION=\"0.78\"
"-I/usr/lib/perl5/5.8.2/cygwin-thread-multi-64int/CORE" dbdimp.c
In file included from DB2.h:9,
from dbdimp.c:8:
c:/PROGRA~1/IBM/SQLLIB/include/sqlcli.h:319: warning: redefinition of
`UCHAR'
/usr/include/w32api/winnt.h:53: warning: `UCHAR' previously declared
here
c:/PROGRA~1/IBM/SQLLIB/include/sqlcli.h:320: warning: redefinition of
`ULONG'
/usr/include/w32api/winnt.h:55: warning: `ULONG' previously declared
here
c:/PROGRA~1/IBM/SQLLIB/include/sqlcli.h:321: warning: redefinition of
`USHORT'
/usr/include/w32api/winnt.h:54: warning: `USHORT' previously declared
here
dbdimp.c: In function `dbd_db_connect':
dbdimp.c:361: warning: cast to pointer from integer of different size
dbdimp.c: In function `db2_db_STORE_attrib':
dbdimp.c:839: warning: cast to pointer from integer of different size
dbdimp.c: In function `dbd_conn_opt':
dbdimp.c:2385: warning: cast to pointer from integer of different size
dbdimp.c: In function `db2_st_STORE_attrib':
dbdimp.c:2929: warning: cast to pointer from integer of different size
Running Mkbootstrap for DBD::DB2 ()
chmod 644 DB2.bs
rm -f blib/arch/auto/DBD/DB2/DB2.dll
LD_RUN_PATH="" ld2 -s -L/usr/local/lib DB2.o dbdimp.o -o
blib/arch/auto/DBD/DB2/DB2.dll
/usr/lib/perl5/5.8.2/cygwin-thread-multi-64int/CORE/libperl. dll.a
-Lc:/PROGRA~1/IBM/SQLLIB/lib -ldb2
gcc -shared -o DB2.dll -Wl,--out-implib=libDB2.dll.a
-Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--stack,8388608 \
-s -L/usr/local/lib DB2.o dbdimp.o
/usr/lib/perl5/5.8.2/cygwin-thread-multi-64int/CORE/libperl. dll.a
-Lc:/PROGRA~1/IBM/SQLLIB/lib -ldb2
Creating library file: libDB2.dll.a
dbdimp.o(.text+0x1e8):dbdimp.c: undefined reference to
`_SQLGetDiagRec@32'
dbdimp.o(.text+0xad0):dbdimp.c: undefined reference to
`_sqledosd_api@16'
dbdimp.o(.text+0xb68):dbdimp.c: undefined reference to
`_sqledgne_api@12'
dbdimp.o(.text+0xc93):dbdimp.c: undefined reference to
`_sqledcls_api@8'
dbdimp.o(.text+0xd44):dbdimp.c: undefined reference to
`_SQLAllocHandle@12'
dbdimp.o(.text+0xefc):dbdimp.c: undefined reference to
`_SQLSetConnectAttr@16'
dbdimp.o(.text+0xf66):dbdimp.c: undefined reference to `_SQLConnect@28'
dbdimp.o(.text+0xfc9):dbdimp.c: undefined reference to
`_SQLFreeHandle@8'
dbdimp.o(.text+0x1028):dbdimp.c: undefined reference to
`_SQLFreeHandle@8'
dbdimp.o(.text+0x113e):dbdimp.c: undefined reference to
`_SQLAllocHandle@12'
dbdimp.o(.text+0x11be):dbdimp.c: undefined reference to
`_SQLSetEnvAttr@16'
dbdimp.o(.text+0x13be):dbdimp.c: undefined reference to
`_SQLAllocHandle@12'
dbdimp.o(.text+0x1411):dbdimp.c: undefined reference to
`_SQLExecDirect@12'
dbdimp.o(.text+0x1468):dbdimp.c: undefined reference to
`_SQLRowCount@8'
dbdimp.o(.text+0x14be):dbdimp.c: undefined reference to
`_SQLFreeHandle@8'
dbdimp.o(.text+0x16f5):dbdimp.c: undefined reference to
`_SQLGetConnectAttr@20'
dbdimp.o(.text+0x17b8):dbdimp.c: undefined reference to
`_SQLAllocHandle@12'
dbdimp.o(.text+0x1846):dbdimp.c: undefined reference to
`_SQLSetStmtAttr@16'
dbdimp.o(.text+0x189e):dbdimp.c: undefined reference to
`_SQLPrepare@12'
dbdimp.o(.text+0x18ec):dbdimp.c: undefined reference to
`_SQLFreeHandle@8'
dbdimp.o(.text+0x1ad1):dbdimp.c: undefined reference to
`_SQLTransact@12'
dbdimp.o(.text+0x1b52):dbdimp.c: undefined reference to
`_SQLTransact@12'
dbdimp.o(.text+0x1c2d):dbdimp.c: undefined reference to
`_SQLDisconnect@4'
dbdimp.o(.text+0x1d0c):dbdimp.c: undefined reference to
`_SQLFreeHandle@8'
dbdimp.o(.text+0x1dbe):dbdimp.c: undefined reference to
`_SQLFreeHandle@8'
dbdimp.o(.text+0x26b8):dbdimp.c: undefined reference to
`_SQLSetConnectAttr@16'
dbdimp.o(.text+0x2954):dbdimp.c: undefined reference to
`_SQLGetConnectAttr@20'
dbdimp.o(.text+0x29c5):dbdimp.c: undefined reference to
`_SQLGetConnectAttr@20'
dbdimp.o(.text+0x2d00):dbdimp.c: undefined reference to
`_SQLNumResultCols@8'
dbdimp.o(.text+0x2d90):dbdimp.c: undefined reference to
`_SQLFreeStmt@8'
dbdimp.o(.text+0x30a7):dbdimp.c: undefined reference to
`_SQLDescribeCol@36'
dbdimp.o(.text+0x31b5):dbdimp.c: undefined reference to
`_SQLColAttribute@28'
dbdimp.o(.text+0x32e4):dbdimp.c: undefined reference to
`_SQLBindCol@24'
dbdimp.o(.text+0x3c04):dbdimp.c: undefined reference to
`_SQLAllocHandle@12'
dbdimp.o(.text+0x3f31):dbdimp.c: undefined reference to `_SQLTables@36'
dbdimp.o(.text+0x40b5):dbdimp.c: undefined reference to
`_SQLAllocHandle@12'
dbdimp.o(.text+0x4178):dbdimp.c: undefined reference to
`_SQLPrimaryKeys@28'
dbdimp.o(.text+0x430e):dbdimp.c: undefined reference to
`_SQLAllocHandle@12'
dbdimp.o(.text+0x443d):dbdimp.c: undefined reference to
`_SQLForeignKeys@52'
dbdimp.o(.text+0x45c3):dbdimp.c: undefined reference to
`_SQLAllocHandle@12'
dbdimp.o(.text+0x46bf):dbdimp.c: undefined reference to
`_SQLColumns@36'
dbdimp.o(.text+0x4831):dbdimp.c: undefined reference to
`_SQLAllocHandle@12'
dbdimp.o(.text+0x4890):dbdimp.c: undefined reference to
`_SQLGetTypeInfo@8'
dbdimp.o(.text+0x4aab):dbdimp.c: undefined reference to
`_SQLGetInfo@20'
dbdimp.o(.text+0x4be3):dbdimp.c: undefined reference to
`_SQLGetInfo@20'
dbdimp.o(.text+0x5284):dbdimp.c: undefined reference to
`_SQLAllocHandle@12'
dbdimp.o(.text+0x52f3):dbdimp.c: undefined reference to
`_SQLPrepare@12'
dbdimp.o(.text+0x53e4):dbdimp.c: undefined reference to
`_SQLNumParams@8'
dbdimp.o(.text+0x60ec):dbdimp.c: undefined reference to
`_SQLDescribeParam@24'
dbdimp.o(.text+0x6627):dbdimp.c: undefined reference to
`_SQLBindFileToParam@32'
dbdimp.o(.text+0x6706):dbdimp.c: undefined reference to
`_SQLBindParameter@40'
dbdimp.o(.text+0x6806):dbdimp.c: undefined reference to
`_SQLSetConnectAttr@16'
dbdimp.o(.text+0x6b1b):dbdimp.c: undefined reference to `_SQLExecute@4'
dbdimp.o(.text+0x6da0):dbdimp.c: undefined reference to
`_SQLRowCount@8'
dbdimp.o(.text+0x6fcb):dbdimp.c: undefined reference to `_SQLFetch@4'
dbdimp.o(.text+0x701f):dbdimp.c: undefined reference to
`_SQLMoreResults@4'
dbdimp.o(.text+0x796b):dbdimp.c: undefined reference to
`_SQLGetData@24'
dbdimp.o(.text+0x7a8e):dbdimp.c: undefined reference to
`_SQLFreeStmt@8'
dbdimp.o(.text+0x7d61):dbdimp.c: undefined reference to
`_SQLFreeHandle@8'
dbdimp.o(.text+0x8549):dbdimp.c: undefined reference to
`_SQLSetStmtAttr@16'
dbdimp.o(.text+0x8e4f):dbdimp.c: undefined reference to
`_SQLGetCursorName@16'
dbdimp.o(.text+0x938c):dbdimp.c: undefined reference to
`_SQLMoreResults@4'
dbdimp.o(.text+0x9971):dbdimp.c: undefined reference to
`_SQLGetStmtAttr@20'
dbdimp.o(.text+0x99e5):dbdimp.c: undefined reference to
`_SQLGetStmtAttr@20'
collect2: ld returned 1 exit status
perlld: *** system() failed to execute
gcc -shared -o DB2.dll -Wl,--out-implib=libDB2.dll.a
-Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--stack,8388608 \
-s -L/usr/local/lib DB2.o dbdimp.o
/usr/lib/perl5/5.8.2/cygwin-thread-multi-64int/CORE/libperl. dll.a
-Lc:/PROGRA~1/IBM/SQLLIB/lib -ldb2