Change 33845 by [EMAIL PROTECTED] on 2008/05/17 14:29:24
Subject: [PATCH] Re: [perl #50180] NDBM_File fails to build
From: Andy Dougherty <[EMAIL PROTECTED]>
Date: Tue, 13 May 2008 12:28:45 -0400 (EDT)
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/Configure#691 edit
... //depot/perl/Porting/Glossary#190 edit
... //depot/perl/config_h.SH#345 edit
... //depot/perl/ext/NDBM_File/NDBM_File.xs#17 edit
... //depot/perl/hints/linux.sh#66 edit
Differences ...
==== //depot/perl/Configure#691 (xtext) ====
Index: perl/Configure
--- perl/Configure#690~33843~ 2008-05-17 06:56:26.000000000 -0700
+++ perl/Configure 2008-05-17 07:29:24.000000000 -0700
@@ -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 [EMAIL PROTECTED])
cat >c1$$ <<EOF
@@ -873,6 +873,9 @@
i_math=''
i_memory=''
i_mntent=''
+d_ndbm=''
+i_gdbm_ndbm=''
+i_gdbmndbm=''
i_ndbm=''
i_netdb=''
i_neterrno=''
@@ -20818,37 +20821,32 @@
eval $inhdr
: see if ndbm.h is available
-set ndbm.h t_ndbm
+set ndbm.h i_ndbm
+eval $inhdr
+: Compatibility location for RedHat 7.1
+set gdbm/ndbm.h i_gdbmndbm
+eval $inhdr
+: Compatibility location for Debian 4.0
+set gdbm-ndbm.h i_gdbm_ndbm
eval $inhdr
-case "$t_ndbm" in
-$undef)
- # Some Linux distributions such as RedHat 7.1 put the
- # ndbm.h header in /usr/include/gdbm/ndbm.h.
- if $test -f /usr/include/gdbm/ndbm.h; then
- echo '<gdbm/ndbm.h> 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 <ndbm.h>"
+ 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 @@
;;
*) 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_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_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'
==== //depot/perl/Porting/Glossary#190 (text) ====
Index: perl/Porting/Glossary
--- perl/Porting/Glossary#189~33598~ 2008-03-29 04:21:46.000000000 -0700
+++ perl/Porting/Glossary 2008-05-17 07:29:24.000000000 -0700
@@ -1429,6 +1429,14 @@
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 @@
indicates to the C program that <gdbm.h> 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 <gdbm-ndbm.h> 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 <gdbm/ndbm.h> 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 <grp.h>.
==== //depot/perl/config_h.SH#345 (text) ====
Index: perl/config_h.SH
--- perl/config_h.SH#344~33598~ 2008-03-29 04:21:46.000000000 -0700
+++ perl/config_h.SH 2008-05-17 07:29:24.000000000 -0700
@@ -689,12 +689,6 @@
*/
#$i_locale I_LOCALE /**/
-/* I_MALLOCMALLOC:
- * This symbol, if defined, indicates to the C program that it should
- * include <malloc/malloc.h>.
- */
-#$i_mallocmalloc I_MALLOCMALLOC /**/
-
/* I_MATH:
* This symbol, if defined, indicates to the C program that it should
* include <math.h>.
@@ -4109,6 +4103,12 @@
*/
#$i_libutil I_LIBUTIL /**/
+/* I_MALLOCMALLOC:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <malloc/malloc.h>.
+ */
+#$i_mallocmalloc I_MALLOCMALLOC /**/
+
/* I_MNTENT:
* This symbol, if defined, indicates that <mntent.h> exists and
* should be included.
==== //depot/perl/ext/NDBM_File/NDBM_File.xs#17 (text) ====
Index: perl/ext/NDBM_File/NDBM_File.xs
--- perl/ext/NDBM_File/NDBM_File.xs#16~28996~ 2006-10-11 07:48:45.000000000
-0700
+++ perl/ext/NDBM_File/NDBM_File.xs 2008-05-17 07:29:24.000000000 -0700
@@ -1,7 +1,13 @@
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
+#if defined(I_GDBM_NDBM)
+# include <gdbm-ndbm.h> /* Debian compatibility version */
+#elif defined(I_GDBMNDBM)
+# include <gdbm/ndbm.h> /* RedHat compatibility version */
+#elif defined(I_NDBM)
#include <ndbm.h>
+#endif
typedef struct {
DBM * dbp ;
==== //depot/perl/hints/linux.sh#66 (text) ====
Index: perl/hints/linux.sh
--- perl/hints/linux.sh#65~31404~ 2007-06-17 07:48:11.000000000 -0700
+++ perl/hints/linux.sh 2008-05-17 07:29:24.000000000 -0700
@@ -54,6 +54,9 @@
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.)
End of Patch.