[Python-Dev] Re: [Python-checkins] CVS: python/dist/src configure.in,1.156,1.157 configure,1.146,1.147 config.h.in,2.72,2.73

Trent Mick trentm@ActiveState.com
Thu, 14 Sep 2000 17:20:45 -0700


On Thu, Sep 14, 2000 at 08:47:10AM -0700, Fred L. Drake wrote:
> Update of /cvsroot/python/python/dist/src
> In directory slayer.i.sourceforge.net:/tmp/cvs-serv14790
> 
> Modified Files:
> 	configure.in configure config.h.in 
> Log Message:
> 
> Allow configure to detect whether ndbm.h or gdbm/ndbm.h is installed.
> This allows dbmmodule.c to use either without having to add additional
> options to the Modules/Setup file or make source changes.
> 
> (At least some Linux systems use gdbm to emulate ndbm, but only install
> the ndbm.h header as /usr/include/gdbm/ndbm.h.)
>
> Index: configure.in
> ===================================================================
> RCS file: /cvsroot/python/python/dist/src/configure.in,v
> retrieving revision 1.156
> retrieving revision 1.157
> diff -C2 -r1.156 -r1.157
> *** configure.in	2000/09/08 02:17:14	1.156
> --- configure.in	2000/09/14 15:47:04	1.157
> ***************
> *** 372,376 ****
>   sys/audioio.h sys/file.h sys/lock.h db_185.h db.h \
>   sys/param.h sys/select.h sys/socket.h sys/time.h sys/times.h \
> ! sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h)
>   AC_HEADER_DIRENT
>   
> --- 372,376 ----
>   sys/audioio.h sys/file.h sys/lock.h db_185.h db.h \
>   sys/param.h sys/select.h sys/socket.h sys/time.h sys/times.h \
> ! sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h ndbm.h gdbm/ndbm.h)
>   AC_HEADER_DIRENT

Is this the correct fix? Previously I had been compiling the dbmmodule on
Debain and RedHat boxes using /usr/include/db1/ndbm.h (I had to change the
Setup.in line to include this directory. Now the configure test says that
ndbm.h does not exist and this patch (see below) to dbmmodule.c now won't
compile.



> Index: dbmmodule.c
> ===================================================================
> RCS file: /cvsroot/python/python/dist/src/Modules/dbmmodule.c,v
> retrieving revision 2.22
> retrieving revision 2.23
> diff -C2 -r2.22 -r2.23
> *** dbmmodule.c   2000/09/01 23:29:26 2.22
> --- dbmmodule.c   2000/09/14 15:48:06 2.23
> ***************
> *** 8,12 ****
> --- 8,22 ----
>   #include <sys/stat.h>
>   #include <fcntl.h>
> +
> + /* Some Linux systems install gdbm/ndbm.h, but not ndbm.h.  This supports
> +  * whichever configure was able to locate.
> +  */
> + #if defined(HAVE_NDBM_H)
>   #include <ndbm.h>
> + #elif defined(HAVE_GDBM_NDBM_H)
> + #include <gdbm/ndbm.h>
> + #else
> + #error "No ndbm.h available!"
> + #endif
>
>   typedef struct {


-- 
Trent Mick
TrentM@ActiveState.com