Make perl_exp.SH smarter about what to include and what to exclude.
Jarkko Hietaniemi [Mon, 5 Jul 1999 10:31:43 +0000 (10:31 +0000)]
p4raw-id: //depot/cfgperl@3587

perl_exp.SH

index ffacdac..436bfd1 100644 (file)
@@ -52,9 +52,8 @@ echo "#!" > perl.exp
 # No interp.sym since 5.005_03.
 # perlio.sym will added later if needed.
 
-syms="global.sym pp.sym"
-
-cat $syms                                              >> perl.exp
+grep '^Perl_' global.sym                               >> perl.exp
+grep '^Perl_' pp.sym                                   >> perl.exp
 sed -n '/^[A-Za-z]/ s/^/PL_/p'   globvar.sym           >> perl.exp
 
 sed -n 's/^PERLVAR.*(G\([^[,]*\).*/PL_\1/p' perlvars.h >> perl.exp
@@ -78,6 +77,48 @@ fi
 #cat >>perl.exp <<END
 #END
 
+# Remove mymalloc if needed.
+case "$usemymalloc$d_mymalloc" in
+ydefine) ;;
+*)
+       egrep -v '^(Perl_(calloc|malloc|malloced_size|mfree|realloc|safexcalloc|safexfree|safexmalloc|safexrealloc)|^PL_malloc_mutex)$' < perl.exp > perl.exp$$
+       mv -f perl.exp$$ perl.exp
+       case "$ccflags" in
+       *DEBUGGING*) ;;
+       *)
+               egrep -v '^(Perl_dump_mstats)$' < perl.exp > perl.exp$$
+               mv -f perl.exp$$ perl.exp
+               ;;
+       esac
+       ;;
+esac
+
+# Remove unneeded utility functions.
+egrep -v '^(Perl_my_(bcopy|bzero|chsize|htonl|memcmp|memset|ntohl|swap))$' < perl.exp > perl.exp$$
+mv -f perl.exp$$ perl.exp
+
+# Remove thread symbols if needed.
+case "$usethreads" in
+y)     ;;
+*)
+       egrep -v '^(Perl_(condpair_magic|find_threadsv|magic_mutexfree|new_struct_thread|unlock_condpair)|^PL_((eval|nthreads)_cond|curthr|eval_owner|(cred|eval|strtab|sv|svref|threads|malloc|vtbl)_mutex|nthreads|threadnum|threadsv_names|thr_key|thrsv))$' < perl.exp > perl.exp$$
+       mv -f perl.exp$$ perl.exp
+       ;;
+esac
+
+# Remove debugging symbols if needed.
+case "$ccflags" in
+*DEBUGGING*) ;;
+*)
+       egrep -v '^(PL_(block_type|watchaddr|watchok))$' < perl.exp > perl.exp$$
+       mv -f perl.exp$$ perl.exp
+       ;;
+esac
+
+# Remove unneeded globals.
+egrep -v '^(Perl_(ErrorNo|GetVars|same_dirent|unlnk)|PL_(cryptseen|statusvalue_vms))' < perl.exp > perl.exp$$
+mv -f perl.exp$$ perl.exp
+
 # The shebang line nicely sorts as the first one.
 sort -o perl.exp -u perl.exp