# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Mon May 22 19:21:39 CEST 2006 [metaconfig 3.0 PL70]
+# Generated on Wed Sep 13 08:48:56 CEST 2006 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.org)
cat >c1$$ <<EOF
d_cmsghdr_s=''
d_const=''
d_copysignl=''
+d_cplusplus=''
cryptlib=''
d_crypt=''
crypt_r_proto=''
$cat >try.c <<EOM
#include <stdio.h>
int main() {
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
#ifdef __VERSION__
printf("%s\n", __VERSION__);
#else
else
echo "Nope, it doesn't, but that's ok." 2>&1
fi
-
- echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
- echo 'int main(void) { return 0; }' > gcctest.c
- if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
- echo "Yes, it does." 2>&1
- case "$ccflags" in
- *-Wdeclaration-after-statement*)
- echo "Leaving current flags $ccflags alone." 2>&1
- ;;
- *) dflt="$dflt -Wdeclaration-after-statement" ;;
- esac
- else
- echo "Nope, it doesn't, but that's ok." 2>&1
- fi
;;
esac
;;
{
#ifdef __GLIBC__
# ifdef __GLIBC_MINOR__
-# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
+# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
# include <gnu/libc-version.h>
printf("%s\n", gnu_get_libc_version());
# else
esac;;
esac'
+
+echo " "
+echo "Checking for C++..." >&4
+cat >try.c <<'EOCP'
+#include <stdio.h>
+int main(void)
+{
+#ifdef __cplusplus
+ printf("define\n");
+#else
+ printf("undef\n");
+#endif
+ return 0;
+}
+EOCP
+set try
+if eval $compile_ok && $run ./try >cplusplus$$; then
+ val=`$cat cplusplus$$`
+ echo "You are using a C++ compiler."
+else
+ val="$undef"
+ echo "You are not using a C++ compiler."
+fi
+$rm -f try try.* cplusplus$$
+set d_cplusplus
+eval $setvar
+
: see if dlopen exists
xxx_runnm="$runnm"
+xxx_ccflags="$ccflags"
runnm=false
+: with g++ one needs -shared to get is-in-libc to work for dlopen
+case "$gccversion" in
+'') ;;
+*) case "$d_cplusplus" in
+ "$define") ccflags="$ccflags -shared" ;;
+ esac
+ ;;
+esac
set dlopen d_dlopen
eval $inlibc
runnm="$xxx_runnm"
+ccflags="$xxx_ccflags"
+
+: see if this is a unistd.h system
+set unistd.h i_unistd
+eval $inhdr
: determine which dynamic loading, if any, to compile in
echo " "
#ifdef I_STDLIB
#include <stdlib.h>
#endif
+#$i_unistd I_UNISTD
+#ifdef I_UNISTD
+#include <unistd.h>
+#endif
int main() {
char b[4];
int i = open("a.out",O_RDONLY);
set bcopy d_bcopy
eval $inlibc
-: see if this is a unistd.h system
-set unistd.h i_unistd
-eval $inhdr
-
: see if getpgrp exists
set getpgrp d_getpgrp
eval $inlibc
p = va_arg(ap, char *);
#endif
va_end(ap);
+ return 0;
}
EOP
$cat > varargs <<EOP
#endif
#include <sys/types.h>
#include <signal.h>
-$signal_t blech(s) int s; { exit(3); }
+$signal_t blech(int s) { exit(3); }
int main()
{
$xxx i32;
#endif
#include <sys/types.h>
#include <signal.h>
-$signal_t blech(s) int s; { exit(7); }
-$signal_t blech_in_list(s) int s; { exit(4); }
-unsigned long dummy_long(p) unsigned long p; { return p; }
-unsigned int dummy_int(p) unsigned int p; { return p; }
-unsigned short dummy_short(p) unsigned short p; { return p; }
+$signal_t blech(int s) { exit(7); }
+$signal_t blech_in_list(int s) { exit(4); }
+unsigned long dummy_long(unsigned long p) { return p; }
+unsigned int dummy_int(unsigned int p) { return p; }
+unsigned short dummy_short(unsigned short p) { return p; }
int main()
{
double f;
int main()
{
const char *foo;
- const spug y;
+ const spug y = { 0 };
}
EOCP
if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
#else
#include <strings.h>
#endif
-$signal_t blech(x) int x; { exit(3); }
+$signal_t blech(int x) { exit(3); }
EOCP
$cat >> try.c <<'EOCP'
int main()
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
-$signal_t blech(x) int x; { exit(3); }
+$signal_t blech(int x) { exit(3); }
int main() {
#if defined(F_SETLK) && defined(F_SETLKW)
struct flock flock;
#include <signal.h>
#ifdef SIGFPE
$volatile int bletched = 0;
-$signal_t blech(s) int s; { bletched = 1; }
+$signal_t blech(int s) { bletched = 1; }
#endif
int main() {
$uvtype u = 0;
#include <signal.h>
#ifdef SIGFPE
$volatile int bletched = 0;
-$signal_t blech(s) int s; { bletched = 1; }
+$signal_t blech(int s) { bletched = 1; }
#endif
int checkit($nvtype d, char *where) {
#define U8 $u8type
#include <signal.h>
#ifdef SIGBUS
-$signal_t bletch(s) int s; { exit(4); }
+$signal_t bletch(int s) { exit(4); }
#endif
int main() {
#if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
#define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
#define NBITS (NBYTES * 8)
int main() {
- char *s = malloc(NBYTES);
+ char *s = (char *)malloc(NBYTES);
struct timeval t;
int i;
FILE* fp;
d_cmsghdr_s='$d_cmsghdr_s'
d_const='$d_const'
d_copysignl='$d_copysignl'
+d_cplusplus='$d_cplusplus'
d_crypt='$d_crypt'
d_crypt_r='$d_crypt_r'
d_csh='$d_csh'