This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Backport #28674
authorJarkko Hietaniemi <jhi@iki.fi>
Tue, 8 Aug 2006 00:02:35 +0000 (03:02 +0300)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Mon, 4 Sep 2006 17:10:01 +0000 (17:10 +0000)
Subject: [PATCH] g++ stage 1 reached
       Message-ID: <44D7AA6B.4040802@iki.fi>

p4raw-id: //depot/metaconfig@28784

U/modified/d_const.U [new file with mode: 0644]
U/modified/d_dlopen.U [new file with mode: 0644]
U/modified/d_mmap.U
U/perl/d_cplusplus.U [new file with mode: 0644]

diff --git a/U/modified/d_const.U b/U/modified/d_const.U
new file mode 100644 (file)
index 0000000..0dc304a
--- /dev/null
@@ -0,0 +1,64 @@
+?RCS: $Id: d_const.U,v 3.0.1.1 1993/11/10 17:33:41 ram Exp $
+?RCS:
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS: 
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: $Log: d_const.U,v $
+?RCS: Revision 3.0.1.1  1993/11/10  17:33:41  ram
+?RCS: patch14: stronger const check with added typedef for MIPS cc
+?RCS:
+?RCS: Revision 3.0  1993/08/18  12:05:51  ram
+?RCS: Baseline for dist 3.0 netwide release.
+?RCS:
+?MAKE:d_const: cat cc ccflags Setvar
+?MAKE: -pick add $@ %<
+?S:d_const:
+?S:    This variable conditionally defines the HASCONST symbol, which
+?S:    indicates to the C program that this C compiler knows about the
+?S:    const type.
+?S:.
+?C:HASCONST ~ %<:
+?C:    This symbol, if defined, indicates that this C compiler knows about
+?C:    the const type. There is no need to actually test for that symbol
+?C:    within your programs. The mere use of the "const" keyword will
+?C:    trigger the necessary tests.
+?C:.
+?H:?%<:#$d_const HASCONST      /**/
+?H:?%<:#ifndef HASCONST
+?H:?%<:#define const
+?H:?%<:#endif
+?H:.
+?W:%<:const
+?LINT:set d_const
+?LINT:known const
+: check for const keyword
+echo " "
+echo 'Checking to see if your C compiler knows about "const"...' >&4
+$cat >const.c <<'EOCP'
+?X: mmcg@bruce.cs.monash.edu.au reports that:
+?X: The MIPS cc compiler (V2.10) on a dec 5000 running Ultrix 4.2A
+?X: pretends to understand `const' but doesn't - it'll also fail to
+?X: handle typedefs properly if they're declared const. To guard
+?X: against this, boost up the test by using an explicit typedef...
+typedef struct spug { int drokk; } spug;
+int main()
+{
+       const char *foo;
+       const spug y = { 0 };
+}
+EOCP
+if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
+       val="$define"
+       echo "Yup, it does."
+else
+       val="$undef"
+       echo "Nope, it doesn't."
+fi
+set d_const
+eval $setvar
+
diff --git a/U/modified/d_dlopen.U b/U/modified/d_dlopen.U
new file mode 100644 (file)
index 0000000..5700ad5
--- /dev/null
@@ -0,0 +1,57 @@
+?RCS: $Id: d_dlopen.U,v 3.0.1.2 1995/07/25 13:52:56 ram Exp $
+?RCS:
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS: 
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: Original Author: Andy Dougherty <doughera@lafcol.lafayette.edu>
+?RCS:
+?RCS: $Log: d_dlopen.U,v $
+?RCS: Revision 3.0.1.2  1995/07/25  13:52:56  ram
+?RCS: patch56: force compile-link test since symbol might lie in crt0.o (ADO)
+?RCS:
+?RCS: Revision 3.0.1.1  1994/08/29  16:07:34  ram
+?RCS: patch32: created by ADO
+?RCS:
+?MAKE:d_dlopen: Inlibc runnm d_cplusplus ccflags gccversion
+?MAKE: -pick add $@ %<
+?S:d_dlopen:
+?S:    This variable conditionally defines the HAS_DLOPEN symbol, which
+?S:    indicates to the C program that the dlopen() routine is available.
+?S:.
+?C:HAS_DLOPEN :
+?C:    This symbol, if defined, indicates that the dlopen routine is
+?C:    available.
+?C:.
+?H:#$d_dlopen HAS_DLOPEN               /**/
+?H:.
+?T: xxx_runnm
+?T: xxx_ccflags
+?LINT:set d_dlopen
+?X: We don't permanently change runnm and ccflags, but we do temporarily.
+?LINT: change runnm
+?LINT: change ccflags
+: see if dlopen exists
+?X: On NetBSD and FreeBSD, dlopen is available, but it is in 
+?X: /usr/lib/crt0.o, not in any of the libraries.  Therefore, do not
+?X: use the nm extraction, but use a real compile and link test instead.
+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"
+
index c78c46c..b3ca59c 100644 (file)
@@ -26,7 +26,7 @@
 ?C:Mmap_t:
 ?C:    This symbol holds the return type of the mmap() system call
 ?C:    (and simultaneously the type of the first argument).
-?C:    Usually set to 'void *' or 'cadd_t'.
+?C:    Usually set to 'void *' or 'caddr_t'.
 ?C:.
 ?H:#$d_mmap HAS_MMAP           /**/
 ?H:#define Mmap_t $mmaptype    /**/
diff --git a/U/perl/d_cplusplus.U b/U/perl/d_cplusplus.U
new file mode 100644 (file)
index 0000000..916d789
--- /dev/null
@@ -0,0 +1,48 @@
+?RCS: $Id$
+?RCS:
+?RCS: Copyright (c) 2005 H.Merijn Brand
+?RCS:
+?RCS: You may distribute under the terms of either the GNU General Public
+?RCS: License or the Artistic License, as specified in the README file.
+?RCS:
+?MAKE:d_cplusplus: Compile Inlibc Setvar run cat rm
+?MAKE: -pick add $@ %<
+?S:d_cplusplus (d_cplusplus.U):
+?S:    This variable conditionally defines the USE_CPLUSPLUS symbol, which
+?S:    indicates that a C++ compiler was used to compiled Perl and will be
+?S:    used to compile extensions.
+?S:.
+?C:USE_CPLUSPLUS:
+?C:    This symbol, if defined, indicates that a C++ compiler was
+?C:    used to compiled Perl and will be used to compile extensions.
+?C:.
+?H:#$d_cplusplus USE_CPLUSPLUS         /**/
+?H:.
+?LINT:set d_cplusplus
+
+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
+