From: Andy Dougherty Date: Tue, 13 May 2008 12:28:45 +0000 (-0400) Subject: Re: [perl #50180] NDBM_File fails to build X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a33f2d9ff72e8b22b6fbbee1f295dee14d2436b5;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #50180] NDBM_File fails to build Message-ID: p4raw-id: //depot/perl@33845 --- diff --git a/Configure b/Configure index 847a90a..faec0da 100755 --- a/Configure +++ b/Configure @@ -25,7 +25,7 @@ # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $ # -# Generated on Sat May 17 15:55:21 CEST 2008 [metaconfig 3.5 PL0] +# Generated on Sat May 17 16:03:30 CEST 2008 [metaconfig 3.5 PL0] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ < found.' - ccflags="$ccflags -I/usr/include/gdbm" - cppflags="$cppflags -I/usr/include/gdbm" - t_ndbm=$define - fi - ;; -esac - -case "$t_ndbm" in -$define) +if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then : see if dbm_open exists set dbm_open d_dbm_open eval $inlibc case "$d_dbm_open" in $undef) - t_ndbm="$undef" + i_ndbm="$undef" + i_gdbmndbm="$undef" + i_gdbm_ndbm="$undef" echo "We won't be including " + val="$undef" ;; + *) val="$define" + ;; esac - ;; -esac -val="$t_ndbm" -set i_ndbm +fi +set d_ndbm eval $setvar : see if net/errno.h is available @@ -21674,7 +21672,7 @@ sunos*X4*) ;; *) case "$usedl" in $define|true|[yY]*) - set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'` + set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'` shift perllibs="$*" ;; @@ -22074,6 +22072,7 @@ d_msgsnd='$d_msgsnd' d_msync='$d_msync' d_munmap='$d_munmap' d_mymalloc='$d_mymalloc' +d_ndbm='$d_ndbm' d_nice='$d_nice' d_nl_langinfo='$d_nl_langinfo' d_nv_preserves_uv='$d_nv_preserves_uv' @@ -22373,6 +22372,8 @@ i_float='$i_float' i_fp='$i_fp' i_fp_class='$i_fp_class' i_gdbm='$i_gdbm' +i_gdbm_ndbm='$i_gdbm_ndbm' +i_gdbmndbm='$i_gdbmndbm' i_grp='$i_grp' i_ieeefp='$i_ieeefp' i_inttypes='$i_inttypes' diff --git a/Porting/Glossary b/Porting/Glossary index 0b82f91..af6fa64 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -1429,6 +1429,14 @@ d_mymalloc (mallocsrc.U): of the source want to take special action if MYMALLOC is used. This may include different sorts of profiling or error detection. +d_ndbm (i_ndbm.U): + This variable conditionally defines the HAS_NDBM symbol, which + indicates that both the ndbm.h include file and an appropriate ndbm + library exist. Consult the different i_*ndbm variables + to find out the actual include location. Sometimes, a system has the + header file but not the library. This variable will only be set if + the system has both. + d_nice (d_nice.U): This variable conditionally defines the HAS_NICE symbol, which indicates to the C program that the nice() routine is available. @@ -2886,6 +2894,18 @@ i_gdbm (i_gdbm.U): indicates to the C program that exists and should be included. +i_gdbm_ndbm (i_ndbm.U): + This variable conditionally defines the I_GDBM_NDBM symbol, which + indicates to the C program that exists and should + be included. This is the location of the ndbm.h compatibility file + in Debian 4.0. + +i_gdbmndbm (i_ndbm.U): + This variable conditionally defines the I_GDBMNDBM symbol, which + indicates to the C program that exists and should + be included. This was the location of the ndbm.h compatibility file + in RedHat 7.1. + i_grp (i_grp.U): This variable conditionally defines the I_GRP symbol, and indicates whether a C program should include . diff --git a/config_h.SH b/config_h.SH index 2543cb5..a28e2f3 100644 --- a/config_h.SH +++ b/config_h.SH @@ -689,12 +689,6 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un */ #$i_locale I_LOCALE /**/ -/* I_MALLOCMALLOC: - * This symbol, if defined, indicates to the C program that it should - * include . - */ -#$i_mallocmalloc I_MALLOCMALLOC /**/ - /* I_MATH: * This symbol, if defined, indicates to the C program that it should * include . @@ -4109,6 +4103,12 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un */ #$i_libutil I_LIBUTIL /**/ +/* I_MALLOCMALLOC: + * This symbol, if defined, indicates to the C program that it should + * include . + */ +#$i_mallocmalloc I_MALLOCMALLOC /**/ + /* I_MNTENT: * This symbol, if defined, indicates that exists and * should be included. diff --git a/ext/NDBM_File/NDBM_File.xs b/ext/NDBM_File/NDBM_File.xs index 53403a5..5e08330 100644 --- a/ext/NDBM_File/NDBM_File.xs +++ b/ext/NDBM_File/NDBM_File.xs @@ -1,7 +1,13 @@ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" +#if defined(I_GDBM_NDBM) +# include /* Debian compatibility version */ +#elif defined(I_GDBMNDBM) +# include /* RedHat compatibility version */ +#elif defined(I_NDBM) #include +#endif typedef struct { DBM * dbp ; diff --git a/hints/linux.sh b/hints/linux.sh index af73cc8..220e6a0 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -54,6 +54,9 @@ set `echo X "$libswanted "| sed -e 's/ bsd / /' -e 's/ net / /' -e 's/ bind / /' shift libswanted="$*" +# Debian 4.0 puts ndbm in the -lgdbm_compat library. +libswanted="$libswanted gdbm_compat" + # If you have glibc, then report the version for ./myconfig bug reporting. # (Configure doesn't need to know the specific version since it just uses # gcc to load the library for all tests.)