# $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
#
-# Generated on Wed Oct 29 09:08:09 CET 2008 [metaconfig 3.5 PL0]
+# Generated on Thu Nov 6 21:06:19 CET 2008 [metaconfig 3.5 PL0]
# (with additional metaconfig patches by perlbug@perl.org)
cat >c1$$ <<EOF
i_math=''
i_memory=''
i_mntent=''
+d_gdbm_ndbm_h_uses_prototypes=''
+d_gdbmndbm_h_uses_prototypes=''
d_ndbm=''
+d_ndbm_h_uses_prototypes=''
i_gdbm_ndbm=''
i_gdbmndbm=''
i_ndbm=''
fi
$rm_try
+: see if ndbm.h is available
+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
+
+val="$undef"
+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)
+ i_ndbm="$undef"
+ i_gdbmndbm="$undef"
+ i_gdbm_ndbm="$undef"
+ echo "We won't be including <ndbm.h>"
+ val="$undef"
+ ;;
+ *) val="$define"
+ ;;
+ esac
+fi
+set d_ndbm
+eval $setvar
+
+ndbm_hdr_protochk='name=$1; hdr=$2;
+eval "ihdr=\$""i_$name";
+val="$undef";
+if $test "$ihdr" = "$define"; then
+ $echo "Checking if your <$hdr> uses prototypes..." >&4;
+ case "$d_cplusplus" in
+ $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
+ *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
+ esac;
+ case "$val" in
+ $define) $echo "Your <$hdr> seems to have prototypes";;
+ *) $echo "Your <$hdr> does not seem to have prototypes";;
+ esac;
+fi;
+set "d_${name}_h_uses_prototypes";
+eval $setvar'
+
+set ndbm ndbm.h
+eval $ndbm_hdr_protochk
+set gdbmndbm gdbm/ndbm.h
+eval $ndbm_hdr_protochk
+set gdbm_ndbm gdbm-ndbm.h
+eval $ndbm_hdr_protochk
+
: see if getcwd exists
set getcwd d_getcwd
eval $inlibc
set i_gdbm
eval $setvar
-: see if ndbm.h is available
-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
-
-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)
- i_ndbm="$undef"
- i_gdbmndbm="$undef"
- i_gdbm_ndbm="$undef"
- echo "We won't be including <ndbm.h>"
- val="$undef"
- ;;
- *) val="$define"
- ;;
- esac
-fi
-set d_ndbm
-eval $setvar
-
: see if this is a ieeefp.h system
case "$i_ieeefp" in
'' ) set ieeefp.h i_ieeefp
d_ftello='$d_ftello'
d_ftime='$d_ftime'
d_futimes='$d_futimes'
+d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
+d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
d_getcwd='$d_getcwd'
d_getespwnam='$d_getespwnam'
d_getfsstat='$d_getfsstat'
d_munmap='$d_munmap'
d_mymalloc='$d_mymalloc'
d_ndbm='$d_ndbm'
+d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
d_nice='$d_nice'
d_nl_langinfo='$d_nl_langinfo'
d_nv_preserves_uv='$d_nv_preserves_uv'
call-back unit so that long doubles can be formatted without
loss of precision.
+d_gdbm_ndbm_h_uses_prototypes (i_ndbm.U):
+ This variable conditionally defines the NDBM_H_USES_PROTOTYPES symbol,
+ which indicates that the gdbm-ndbm.h include file uses real ANSI C
+ prototypes instead of K&R style function declarations. K&R style
+ declarations are unsupported in C++, so the include file requires
+ special handling when using a C++ compiler and this variable is
+ undefined. Consult the different d_*ndbm_h_uses_prototypes variables
+ to get the same information for alternative ndbm.h include files.
+
+d_gdbmndbm_h_uses_prototypes (i_ndbm.U):
+ This variable conditionally defines the NDBM_H_USES_PROTOTYPES symbol,
+ which indicates that the gdbm/ndbm.h include file uses real ANSI C
+ prototypes instead of K&R style function declarations. K&R style
+ declarations are unsupported in C++, so the include file requires
+ special handling when using a C++ compiler and this variable is
+ undefined. Consult the different d_*ndbm_h_uses_prototypes variables
+ to get the same information for alternative ndbm.h include files.
+
d_getcwd (d_getcwd.U):
This variable conditionally defines the HAS_GETCWD symbol, which
indicates to the C program that the getcwd() routine is available
header file but not the library. This variable will only be set if
the system has both.
+d_ndbm_h_uses_prototypes (i_ndbm.U):
+ This variable conditionally defines the NDBM_H_USES_PROTOTYPES symbol,
+ which indicates that the ndbm.h include file uses real ANSI C
+ prototypes instead of K&R style function declarations. K&R style
+ declarations are unsupported in C++, so the include file requires
+ special handling when using a C++ compiler and this variable is
+ undefined. Consult the different d_*ndbm_h_uses_prototypes variables
+ to get the same information for alternative ndbm.h include files.
+
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.
* be included. This is the location of the ndbm.h compatibility file
* in Debian 4.0.
*/
+/* NDBM_H_USES_PROTOTYPES:
+ * This symbol, if defined, indicates that <ndbm.h> uses real ANSI C
+ * prototypes instead of K&R style function declarations without any
+ * parameter information. While ANSI C prototypes are supported in C++,
+ * K&R style function declarations will yield errors.
+ */
+/* GDBMNDBM_H_USES_PROTOTYPES:
+ * This symbol, if defined, indicates that <gdbm/ndbm.h> uses real ANSI C
+ * prototypes instead of K&R style function declarations without any
+ * parameter information. While ANSI C prototypes are supported in C++,
+ * K&R style function declarations will yield errors.
+ */
+/* GDBM_NDBM_H_USES_PROTOTYPES:
+ * This symbol, if defined, indicates that <gdbm-ndbm.h> uses real ANSI C
+ * prototypes instead of K&R style function declarations without any
+ * parameter information. While ANSI C prototypes are supported in C++,
+ * K&R style function declarations will yield errors.
+ */
#$i_ndbm I_NDBM /**/
#$i_gdbmndbm I_GDBMNDBM /**/
#$i_gdbm_ndbm I_GDBM_NDBM /**/
+#$d_ndbm_h_uses_prototypes NDBM_H_USES_PROTOTYPES /**/
+#$d_gdbmndbm_h_uses_prototypes GDBMNDBM_H_USES_PROTOTYPES /**/
+#$d_gdbm_ndbm_h_uses_prototypes GDBM_NDBM_H_USES_PROTOTYPES /**/
/* I_NETDB:
* This symbol, if defined, indicates that <netdb.h> exists and
-use Config;
use ExtUtils::MakeMaker;
-
-my $define = "";
-
-if($Config{i_gdbm} && $Config{i_gdbm} eq 'define') {
- $define .= " -DHAS_GDBM";
-}
-
WriteMakefile(
NAME => 'NDBM_File',
LIBS => ["-L/usr/local/lib -lndbm", "-ldbm -lucb"],
- DEFINE => $define,
MAN3PODS => {}, # Pods will be built by installman.
XSPROTOARG => '-noprototypes', # XXX remove later?
VERSION_FROM => 'NDBM_File.pm',
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
+#undef NDBM_HEADER_USES_PROTOTYPES
#if defined(I_GDBM_NDBM)
# include <gdbm-ndbm.h> /* Debian compatibility version */
+# ifdef GDBM_NDBM_H_USES_PROTOTYPES
+# define NDBM_HEADER_USES_PROTOTYPES
+# endif
#elif defined(I_GDBMNDBM)
# include <gdbm/ndbm.h> /* RedHat compatibility version */
+# ifdef GDBMNDBM_H_USES_PROTOTYPES
+# define NDBM_HEADER_USES_PROTOTYPES
+# endif
#elif defined(I_NDBM)
-#include <ndbm.h>
+# include <ndbm.h>
+# ifdef NDBM_H_USES_PROTOTYPES
+# define NDBM_HEADER_USES_PROTOTYPES
+# endif
#endif
typedef struct {
typedef datum datum_value ;
-#if defined(__cplusplus) && defined(HAS_GDBM)
+#if defined(__cplusplus) && !defined(NDBM_HEADER_USES_PROTOTYPES)
/* gdbm's header file used for compatibility with gdbm */
/* isn't compatible to C++ syntax, so we need these */
/* declarations to make everyone happy. */