This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: perl-5.6.1 DB_file support


Reini Urban wrote:
> However, something new:
> A minor required db-3.2.3f patch for cygwin
> 
> --- db-3.2.3f/os/os_tmpdir.c.orig       Tue Jul  4 21:30:16 2000
> +++ db-3.2.3f/os/os_tmpdir.c    Sun Jan  7 21:58:30 2001
> @@ -96,6 +96,9 @@
>         }
>  #endif
>  #ifdef _WIN32
> +# ifndef _MAX_PATH
> +#  define _MAX_PATH 260
> +# endif
>         /* Get the path to the temporary directory. */
>         {int len;
>          char temp[_MAX_PATH + 1];

AARRGHH.  No no no.  Cygwin is not WIN32.  While some packages, when
ported to cygwin, do rely on code within #ifdef _WIN32 blocks, this is a
mistake.  If you want to use code for WIN32 and for cygwin, then do:

#if defined(_WIN32) || defined(__CYGWIN__)

To accommodate *bad* ports, cygwin's gcc used to define _WIN32, but that
behavior will be dropped soon IIRC.  Also, IMO, burying a constant
definition like that in the middle of a .c is just poor programming. 
Put it in a header file somewhere, at the very least.  Best, find out
where the appropriate cygwin MAXPATH constant is defined in cygwin's
system headers and #include the appropriate .h.
 
> And the DB_File patch for perl, tested with db-3.2.3f:
> One could also copy the three db headers to /usr/include, but the
> installer leaves them in /usr/local/BerkeleyDB.3.2/include
> 
> 2001-01-08 02:40:33 rurban
>   * support latest BerkeleyDB.3.2 paths
> 
> --- perl-5.6.1-1/ext/DB_File/Makefile.PL~       Mon Oct 16 09:12:44 2000
> +++ perl-5.6.1-1/ext/DB_File/Makefile.PL        Mon Jan  8 03:38:00 2001
> @@ -10,14 +10,13 @@
> 
>  WriteMakefile(
>         NAME            => 'DB_File',
> -       LIBS            => ["-L/usr/local/lib $LIB"],
> +       LIBS            => ["-L/usr/local/lib -L/usr/local/BerkeleyDB.3.2/lib $LIB"],

Ugh. I installed my berkdb into /usr/local/berk/.  This should come from
the environment or something, not hardcoded into the Makefile.

--Chuck Wilson

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]