This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Backport Configure change #30897
authorH.Merijn Brand <h.m.brand@xs4all.nl>
Thu, 12 Apr 2007 16:01:04 +0000 (16:01 +0000)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Thu, 12 Apr 2007 16:01:04 +0000 (16:01 +0000)
p4raw-link: @30897 on //depot/perl: 469eca228363087130e4b953569a5e409e27a976

p4raw-id: //depot/metaconfig@30933

U/compline/Csym.U
U/perl/d_cplusplus.U

index 0b9f476..cdf45d2 100644 (file)
@@ -27,7 +27,7 @@
 ?RCS: Baseline for dist 3.0 netwide release.
 ?RCS:
 ?MAKE:Csym mistrustnm: Options contains libc libs runnm test \
-       +cc +optimize +ccflags +ldflags run rm _exe
+       +cc +optimize +ccflags +ldflags run rm _exe d_cplusplus
 ?MAKE: -pick add $@ %<
 ?LINT:define csym
 ?LINT:use libc
@@ -53,7 +53,7 @@
 ?S:    "run", the test program will be run as well as being compiled.
 ?S:.
 ?V:csym
-?T:tval tx tlook tf tdc
+?T:tval tx tlook tf tdc extern_C
 : is a C symbol defined?
 csym='tlook=$1;
 case "$3" in
@@ -85,17 +85,20 @@ yes)
 ?X: trick is obsoleted by future gcc releases). -- RAM
 ?X:
        tval=false;
+       case "$d_cplusplus" in
+               $define) extern_C=\"C\";;
+       esac;
        if $test "$runnm" = true; then
                if $contains $tlook $tf >/dev/null 2>&1; then
                        tval=true;
                elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
-                       echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
+                       echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
                        $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
                        $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
                        $rm -f try$_exe try.c core core.* try.core;
                fi;
        else
-               echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
+               echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
                $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
                $rm -f try$_exe try.c;
        fi;
index 916d789..b21df10 100644 (file)
@@ -5,7 +5,7 @@
 ?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:d_cplusplus: Compile Setvar run cat rm
 ?MAKE: -pick add $@ %<
 ?S:d_cplusplus (d_cplusplus.U):
 ?S:    This variable conditionally defines the USE_CPLUSPLUS symbol, which