nailed "our" declarations, and better warnings on duplicate
[p5sagit/p5-mst-13.2.git] / makedef.pl
index 1d585a2..f640f2f 100644 (file)
@@ -91,7 +91,8 @@ unless ($PLATFORM eq 'win32') {
 open(CFG,$config_h) || die "Cannot open $config_h: $!\n";
 while (<CFG>) {
     $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/;
-    $define{$1} = 1 if /^\s*#\s*define\s+(USE_THREADS)\b/;
+    $define{$1} = 1 if /^\s*#\s*define\s+(USE_5005THREADS)\b/;
+    $define{$1} = 1 if /^\s*#\s*define\s+(USE_ITHREADS)\b/;
     $define{$1} = 1 if /^\s*#\s*define\s+(USE_PERLIO)\b/;
     $define{$1} = 1 if /^\s*#\s*define\s+(MULTIPLICITY)\b/;
     $define{$1} = 1 if /^\s*#\s*define\s+(PERL_BINCOMPAT_5005)\b/;
@@ -116,14 +117,8 @@ if ($PLATFORM eq 'win32') {
 #    exit(0);
     }
     else {
-       if ($CCTYPE ne 'GCC') {
-           print "LIBRARY Perl\n";
-           print "DESCRIPTION 'Perl interpreter, export autogenerated'\n";
-       }
-       else {
-           $define{'PERL_GLOBAL_STRUCT'} = 1;
-           $define{'MULTIPLICITY'} = 1;
-       }
+       print "LIBRARY Perl\n";
+       print "DESCRIPTION 'Perl interpreter, export autogenerated'\n";
        print "EXPORTS\n";
     } 
 }
@@ -338,6 +333,11 @@ if ($define{'MYMALLOC'}) {
                    Perl_realloc
                    Perl_calloc
                    )];
+    if ($define{'USE_5005THREADS'} || $define{'USE_ITHREADS'}) {
+       emit_symbols [qw(
+                       PL_malloc_mutex
+                       )];
+    }
 }
 else {
     skip_symbols [qw(
@@ -351,13 +351,12 @@ else {
                    )];
 }
 
-unless ($define{'USE_THREADS'}) {
+unless ($define{'USE_5005THREADS'}) {
     skip_symbols [qw(
                    PL_thr_key
                    PL_sv_mutex
                    PL_strtab_mutex
                    PL_svref_mutex
-                   PL_malloc_mutex
                    PL_cred_mutex
                    PL_eval_mutex
                    PL_eval_cond
@@ -447,7 +446,7 @@ sub readvar {
     return \@syms;
 }
 
-if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'}) {
+if ($define{'USE_5005THREADS'} || $define{'MULTIPLICITY'}) {
     my $thrd = readvar($thrdvar_h);
     skip_symbols $thrd;
 }
@@ -503,7 +502,7 @@ else {
        my $glob = readvar($intrpvar_h);
        emit_symbols $glob;
     } 
-    unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'}) {
+    unless ($define{'MULTIPLICITY'} || $define{'USE_5005THREADS'}) {
        my $glob = readvar($thrdvar_h);
        emit_symbols $glob;
     }