home *** CD-ROM | disk | FTP | other *** search
-
-
- The Sybase DB-Library - Perl savestr() conflict
- ------------------------------------------------
-
-
- Ah! The joys of tying different packages together!
-
- Both Perl and DB-Library have a function called savestr(). The
- DB-Library version is used in dbcmd() to add an SQL command to the
- list of commands pointed to by dpproc->dbcmdbuf, and in dbuse() as
- well. Now there are several ways to work around this problem.
-
- 1) Compile sybperl.c with -DBROKEN_DBCMD. I've written some code
- that emulates calls to dbcmd() and dbuse(). This works OK on my
- machine/OS/Version of Perl/Version of DBlib, but it relies on
- the internal storing method used by DBlib, and that might
- change in the future.
-
- 2) Recompile Perl (specifically, uperl.o in the Perl source
- directory) with some suitable flags (eg -Dsavestr=p_savestr).
- This does not create any compatibility problems, but is a
- lengthy procedure.
-
- 3) Do something like:
- cc -c sybperl.c
- ld -r -o sybperl2.o sybperl.o -lsybdb
- [edit sybperl2.o and replace `_savestr' with something like `_savest1']
- cc -o sybperl uperl.o sybperl2.o
- This is not a bad solution, but won't work if you have shared
- library versions of libsybdb.a
-
- 4) Edit uperl.o and replace savestr with something else. This is
- the solution I've chosen as the default. It is relatively fast,
- does not rely on any internal knowledge of DB-Library, and does
- not require Perl to be recompiled.
-
- The Makefile gives some information on how to achieve these
- different options.
-
- Thanks to Teemu Torma for providing the initial input on this problem.
-
-
- Michael
-