public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: DBD-DB2-1.78 driver for Perl V5.10 under CYGWIN 1.7.4
@ 2010-04-17 20:09 ERIC HO
  2010-04-17 21:11 ` Reini Urban
  0 siblings, 1 reply; 5+ messages in thread
From: ERIC HO @ 2010-04-17 20:09 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 134 bytes --]


The attached script file was provided to me by T.Allsopp and it works. His email to cygwin somehow never delivered.

Regards,

Eric.

[-- Attachment #2: fix.sh --]
[-- Type: application/octet-stream, Size: 1742 bytes --]

#!/bin/bash

set -ex

# Make sure that DB2PATH is set and contains a Cygwin path with no spaces.
: ${DB2PATH:=$DB2_HOME}
: ${DB2PATH:?DB2_HOME or DB2PATH must be set}
DB2PATH=$(cygpath -u $(cygpath -d "$DB2PATH"))

if [ -z "$DB2LIB" ]; then
    case $(uname -s) in
        *64) DB2LIB=$DB2PATH/lib/Win32;;
        *)   DB2LIB=$DB2PATH/lib;;
    esac
    export DB2LIB
fi

# Create links with proper names for GCC of DB2 libraries
{
    cd "$DB2LIB"
    ln -fv db2api.lib libdb2api.a
    ln -fv db2cli.lib libdb2cli.a
}

# Perl on Cygwin, when linking to DLLs, passes ld the
# --export-all-symbols option.  For some reason, this fails when
# linking against DB2, so we disable this feature temporarily.
#
# For Perl 5.8 we need to edit this in the /usr/bin/perlld script.
# For Perl 5.10 we disable it in Makefile.PL in the below patch.

if [ -e /usr/bin/perlld ]; then
    if [ -e /usr/bin/perlld.bak ]; then
        mv /usr/bin/perlld.bak /usr/bin/perlld
    fi
    sed -i.bak -e 's/EXPORT_ALL = 1/EXPORT_ALL = 0/' /usr/bin/perlld
fi

set +e

# Download, unpack, patch, install DBD::DB2
perl -MCPAN -e 'CPAN::Shell->look("DBD::DB2")' <<'EOF'
set -e
patch Makefile.PL <<'END_PATCH'
--- Makefile.PL.orig	2008-07-01 14:35:53.356596500 +1200
+++ Makefile.PL	2008-07-01 14:39:09.480356700 +1200
@@ -134,8 +134,14 @@
       }
     }
   }
-      
-  $sysliblist = "-L$DB2LIB -ldb2";
+
+  if ($os eq 'cygwin') { 
+    $sysliblist = "-L$DB2LIB -ldb2cli -ldb2api";
+    $opts{LDDLFLAGS} = $Config{lddlflags};
+    $opts{LDDLFLAGS} =~ s/-Wl,--export-all-symbols //;
+  } else {
+    $sysliblist = "-L$DB2LIB -ldb2";
+  }

END_PATCH
cpan .
EOF

if [ -e /usr/bin/perlld ] && [ -e /usr/bin/perlld.bak ]; then
    mv /usr/bin/perlld.bak /usr/bin/perlld
fi

[-- Attachment #3: Type: text/plain, Size: 218 bytes --]

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: DBD-DB2-1.78 driver for Perl V5.10 under CYGWIN 1.7.4
@ 2010-04-13  0:33 ERIC HO
  0 siblings, 0 replies; 5+ messages in thread
From: ERIC HO @ 2010-04-13  0:33 UTC (permalink / raw)
  To: cygwin


Thanks Reini.
I suppose Gerrits's advice is to create an import lib of the IBM db2.dll and link against it. Not sure how to do it. Please let me know if someone has done this on a DB2 V9 system. Thanks.

Eric

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread
* DBD-DB2-1.78 driver for Perl V5.10 under CYGWIN 1.7.4
@ 2010-04-10 14:01 ERIC HO
  2010-04-11 20:29 ` Reini Urban
  0 siblings, 1 reply; 5+ messages in thread
From: ERIC HO @ 2010-04-10 14:01 UTC (permalink / raw)
  To: cygwin

Just wondering if anyone has successfully installed DBD-DB2-1.78 driver
for Perl V5.10 under CYGWIN 1.7.4 successfully. Please let me know the 
changes required to install it. Thanks.

Regards,

Eric

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-04-17 21:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-17 20:09 DBD-DB2-1.78 driver for Perl V5.10 under CYGWIN 1.7.4 ERIC HO
2010-04-17 21:11 ` Reini Urban
  -- strict thread matches above, loose matches on Subject: below --
2010-04-13  0:33 ERIC HO
2010-04-10 14:01 ERIC HO
2010-04-11 20:29 ` Reini Urban

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).