summaryrefslogtreecommitdiff
path: root/vms
diff options
context:
space:
mode:
authorDan Sugalski <dan@sidhe.org>1998-06-19 08:36:34 -0700
committerGurusamy Sarathy <gsar@cpan.org>1998-06-21 06:55:18 +0000
commit429a5e67a8cd7868f6400fb40a70246ad7548973 (patch)
treea6ee82a5dae271a7ae918a6b654d9d8026af2e8f /vms
parent4318d5a0158916acc059aa8e6af84037cb7296b9 (diff)
downloadperl-429a5e67a8cd7868f6400fb40a70246ad7548973.tar.gz
applied VMS patch from Dan Sugalski
Message-Id: <980619153634.2063ee12@cedar.osshe.edu> Subject: [PATCH 5.004_67] Enhancements to the VMS configuration procedures p4raw-id: //depot/perl@1174
Diffstat (limited to 'vms')
-rw-r--r--vms/descrip_mms.template70
-rw-r--r--vms/gen_shrfls.pl26
-rw-r--r--vms/subconfigure.com111
3 files changed, 144 insertions, 63 deletions
diff --git a/vms/descrip_mms.template b/vms/descrip_mms.template
index e27fbebec5..1cf96bada5 100644
--- a/vms/descrip_mms.template
+++ b/vms/descrip_mms.template
@@ -10,31 +10,6 @@
#:
#: Lines beginning with "#:" will be removed by mms2make.pl when converting
#: this file to MAKE syntax.
-#:
-#: Usage:
-#: Building with VAX C, on system without DEC C installed or with VAX C default:
-#: $ MMS
-#: Building with VAX C, on system with DEC C installed as default C compiler:
-#: $ MMS /MACRO=("cc=CC/VAXC")
-#: Building with DEC C, on system without VAX C installed or with DEC C default:
-#: $ MMS /MACRO=("decc=1")
-#: Building with DEC C, on system with VAX C installed as default C compiler:
-#: $ MMS /MACRO=("decc=1","cc=CC/DECC")
-#: Building with GNU C
-#: $ MMS /MACRO=("gnuc=1")
-#: To each of the above, add /Macro="__AXP__=1" if building on an AXP,
-#: /Macro="__DEBUG__=1" to build a debug version
-#: (i.e. VMS debugger, not perl -D), and
-#: /Macro="SOCKETSHR_SOCKETS=1" to include
-#: SOCKETSHR socket support.
-#: /Macro="DECC_SOCKETS=1" to include UCX (or
-#: compatible) socket support
-#: /Macro="OLDTHREADED=1" to compile with the old
-#: pthreads API (VMS version 6.2 and previous)
-#: /Macro="THREADED=1" to compile with full POSIX
-#: threads. (VMS 7.0 and above)
-#: /Macro="FAKETHREADED=1" to compile with the
-#: fake threads package
#
# tidy -- purge files generated by executing this file
# clean -- remove all intermediate (e.g. object files, C files generated
@@ -52,6 +27,9 @@
~ARCH-TYPE~ = 1
~THREAD~
~SOCKET~
+~MALLOC~
+~CC~
+~MT~
#: >>>>> Architecture-specific options <<<<<
.ifdef AXE
@@ -71,7 +49,6 @@ E = .exe
.endif
.ifdef __AXP__
-DECC = 1
ARCH = VMS_AXP
OBJVAL = $(O)
.else
@@ -79,9 +56,13 @@ ARCH = VMS_VAX
OBJVAL = $(MMS$TARGET_NAME)$(O)
.endif
-# Updated by fndvers.com -- do not edit by hand
PERL_VERSION = 5_00$PATCHLEVEL$SUBVERSION
+.ifdef MALLOC
+MALLOC_O = ,malloc$(O)
+MALLOC_C = ,malloc$(C)
+.endif
+
.ifdef DECC_SOCKETS
SOCKET=1
.endif
@@ -127,7 +108,7 @@ PIPES_BROKEN = 1
# (fixed in gcc 2.6.3)
XTRACCFLAGS = /Obj=$(MMS$TARGET_NAME)$(O)/NoCase_Hack/Optimize=2
DBGSPECFLAGS =
-XTRADEF = ,GNUC_ATTRIBUTE_CHECK
+XTRADEF =
XTRAOBJS =
LIBS1 = GNU_CC:[000000]GCCLIB.OLB/Library
LIBS2 = Sys$Share:VAXCRTL/Shareable
@@ -151,7 +132,6 @@ DBGSPECFLAGS = /Show=All
@ If F$TrnLnm("Sys").eqs."" .and. F$TrnLnm("DECC$System_Include").eqs."" Then Define/NoLog SYS DECC$Library_Include
.endif
-LIBS2 =
XTRACCFLAGS = /Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=$(OBJVAL)
XTRADEF =
POSIX = POSIX
@@ -185,10 +165,10 @@ DBG =
#: for information on changing socket support
.ifdef SOCKET
.ifdef DECC_SOCKETS
-SOCKDEF = ,VMS_DO_SOCKETS,DECCRTL_SOCKETS
+SOCKDEF =
SOCKLIB =
.else
-SOCKDEF = ,VMS_DO_SOCKETS
+SOCKDEF =
SOCKLIB = SocketShr/Share
.endif
# N.B. the targets for $(SOCKC) and $(SOCKH) assume that the permanent
@@ -211,24 +191,26 @@ SOCKOBJ =
SOCKPM =
.endif
-THREAD =
-
.ifdef THREADED
THREADDEF =
THREAD = THREAD
.endif
.ifdef OLDTHREADED
-THREADDEF = ,OLD_PTHREADS_API
+THREADDEF =
THREAD = THREAD
+.ifdef LIBS2
+LIBS2 = $(LIBS2),sys$share:cma$lib_shr/share,cma$rtl/share
+.else
LIBS2 = sys$share:cma$lib_shr/share,cma$rtl/share
+.endif
.ifdef __AXP__
LIBS2 = $(LIBS2),sys$share:cma$open_lib_shr/share,cma$open_rtl/share
.endif
.endif
.ifdef FAKETHREADED
-THREADDEF = ,FAKE_THREADS
+THREADDEF =
THREADH = fakethr.h
acth = $(ARCHCORE)fakethr.h
THREAD = THREAD
@@ -238,7 +220,7 @@ acth =
.endif
# C preprocessor manifest "DEBUGGING" ==> perl -D, not the VMS debugger
-CFLAGS = /Define=(DEBUGGING$(SOCKDEF)$(XTRADEF)$(THREADDEF))$(XTRACCFLAGS)$(DBGCCFLAGS)
+CFLAGS = $(XTRACCFLAGS)$(DBGCCFLAGS)
LINKFLAGS = $(DBGLINKFLAGS)
MAKE = $(MMS)
@@ -273,6 +255,10 @@ EXT = $(MYEXT)
extobj = $(myextobj)
.endif
+.ifdef LIBS2
+.else
+LIBS2=
+.endif
#### End of system configuration section. ####
@@ -285,12 +271,12 @@ h5 = embedvar.h, intrpvar.h, perlvars.h, thrdvar.h, atomic.h
h = $(h1), $(h2), $(h3), $(h4), $(h5) $(SOCKHLIS) $(THREADH)
c1 = av.c, scope.c, op.c, doop.c, doio.c, dump.c, hv.c, mg.c, universal.c, perlio.c
-c2 = perl.c, perly.c, pp.c, pp_hot.c, pp_ctl.c, pp_sys.c, regcomp.c, regexec.c
+c2 = perl.c, perly.c, pp.c, pp_hot.c, pp_ctl.c, pp_sys.c, regcomp.c, regexec.c $(MALLOC_C)
c3 = gv.c, sv.c, taint.c, toke.c, util.c, deb.c, run.c, globals.c, vms.c, byterun.c $(SOCKCLIS)
c = $(c1), $(c2), $(c3), miniperlmain.c, perlmain.c, byteperl.c
-obj1 = perl$(O), gv$(O), toke$(O), perly$(O), op$(O), regcomp$(O), dump$(O), util$(O), mg$(O), perlio$(O)
+obj1 = perl$(O), gv$(O), toke$(O), perly$(O), op$(O), regcomp$(O), dump$(O), util$(O), mg$(O), perlio$(O) $(MALLOC_O)
obj2 = hv$(O), av$(O), run$(O), pp_hot$(O), sv$(O), pp$(O), scope$(O), pp_ctl$(O), pp_sys$(O)
obj3 = doop$(O), doio$(O), regexec$(O), taint$(O), deb$(O), universal$(O), globals$(O), vms$(O), byterun$(O) $(SOCKOBJ)
@@ -408,7 +394,11 @@ perl : $(DBG)perl$(E) $(DBG)byteperl$(E)
$(DBG)perl$(E) : perlmain$(O), $(DBG)perlshr$(E), $(MINIPERL_EXE)
@ @[.vms]genopt "PerlShr.Opt/Write" "|" "''F$Environment("Default")'$(DBG)PerlShr$(E)/Share"
+.ifdef MT
+ Link $(LINKFLAGS)/Exe=$(MMS$TARGET) perlmain$(O), perlshr.opt/Option, perlshr_attr.opt/Option $(CRTLOPTS)/THREAD=(MULTI,UPCALL)
+.else
Link $(LINKFLAGS)/Exe=$(MMS$TARGET) perlmain$(O), perlshr.opt/Option, perlshr_attr.opt/Option $(CRTLOPTS)
+.endif
$(DBG)byteperl$(E) : byteperl$(O), $(DBG)perlshr$(E), $(MINIPERL_EXE)
@ @[.vms]genopt "PerlShr.Opt/Write" "|" "''F$Environment("Default")'$(DBG)PerlShr$(E)/Share"
@@ -450,7 +440,7 @@ $(ARCHDIR)config.pm : [.lib]config.pm
[.lib]config.pm : config.h $(MINIPERL_EXE)
$(MINIPERL) ConfigPM.
-[.ext.dynaloader]dl_vms.c : $(ARCHDIR)Config.pm [.ext.dynaloader]dl_vms.xs [.lib.ExtUtils]XSSymSet.pm $(MINIPERL_EXE)
+[.ext.dynaloader]dl_vms.c : [.ext.dynaloader]dl_vms.xs $(ARCHDIR)Config.pm [.lib.ExtUtils]XSSymSet.pm $(MINIPERL_EXE)
$(XSUBPP) $(MMS$SOURCE) >$(MMS$TARGET)
[.ext.dynaloader]dl_vms$(O) : [.ext.dynaloader]dl_vms.c
@@ -461,7 +451,7 @@ $(ARCHDIR)config.pm : [.lib]config.pm
@ If F$Search("[.lib]auto.dir").eqs."" Then Create/Directory [.lib.auto]
@ $(MINIPERL) -e "use AutoSplit; autosplit_lib_modules(@ARGV)" [.lib]DynaLoader.pm
-[.ext.dynaloader]dynaloader.pm : [.ext.dynaloader]dynaloader.pm_pl
+[.ext.dynaloader]dynaloader.pm : [.ext.dynaloader]dynaloader_pm.pl
$(MINIPERL) $(MMS$SOURCE)
@ Rename/Log dynaloader.pm [.ext.dynaloader]
diff --git a/vms/gen_shrfls.pl b/vms/gen_shrfls.pl
index 9d5748d499..f07b8850ac 100644
--- a/vms/gen_shrfls.pl
+++ b/vms/gen_shrfls.pl
@@ -64,11 +64,24 @@ $docc = ($cc_cmd !~ /^~~/);
print "\$docc = $docc\n" if $debug;
if ($docc) {
+ if (-f 'perl.h') { $dir = '[]'; }
+ elsif (-f '[-]perl.h') { $dir = '[-]'; }
+ else { die "$0: Can't find perl.h\n"; }
+
+ # Go see if debugging is enabled in config.h
+ $config = $dir . "config.h";
+ open CONFIG, "< $config";
+ while(<CONFIG>) {
+ $debugging_enabled++ if /define\s+DEBUGGING/;
+ $hide_mymalloc++ if /define\s+EMBEDMYMALLOC/;
+ $use_mymalloc++ if /define\s+MYMALLOC/;
+ }
+
# put quotes back onto defines - they were removed by DCL on the way in
if (($prefix,$defines,$suffix) =
($cc_cmd =~ m#(.*)/Define=(.*?)([/\s].*)#i)) {
$defines =~ s/^\((.*)\)$/$1/;
- $debugging_enabled = $defines =~ /\bDEBUGGING\b/;
+ $debugging_enabled ||= $defines =~ /\bDEBUGGING\b/;
@defines = split(/,/,$defines);
$cc_cmd = "$prefix/Define=(" . join(',',grep($_ = "\"$_\"",@defines))
. ')' . $suffix;
@@ -88,9 +101,6 @@ if ($docc) {
print "\$isvaxc: $isvaxc\n" if $debug;
print "\$debugging_enabled: $debugging_enabled\n" if $debug;
- if (-f 'perl.h') { $dir = '[]'; }
- elsif (-f '[-]perl.h') { $dir = '[-]'; }
- else { die "$0: Can't find perl.h\n"; }
}
else {
($junk,$junk,$cpp_file,$cc_cmd) = split(/~~/,$cc_cmd,4);
@@ -188,6 +198,14 @@ sub scan_func {
}
}
+# Go add some right up front if we need 'em
+if ($use_mymalloc) {
+ $fcns{'Perl_malloc'}++;
+ $fcns{'Perl_calloc'}++;
+ $fcns{'Perl_realloc'}++;
+ $fcns{'Perl_myfree'}++;
+}
+
$used_expectation_enum = $used_opcode_enum = 0; # avoid warnings
if ($docc) {
open(CPP,"${cc_cmd}/NoObj/PreProc=Sys\$Output ${dir}perl.h|")
diff --git a/vms/subconfigure.com b/vms/subconfigure.com
index 50d178f898..8222860122 100644
--- a/vms/subconfigure.com
+++ b/vms/subconfigure.com
@@ -16,6 +16,14 @@ $ Dec_C_Version := "''Dec_C_Version'"
$ Dec_C_Version = Dec_C_Version + 0
$ Vms_Ver := "''f$extract(1,3, f$getsyi(""version""))'"
$ perl_extensions := "''extensions'"
+$ if f$length(Mcc) .eq. 0 then Mcc := "cc"
+$ MCC = f$edit(mcc, "UPCASE")
+$ IF Mcc.eqs."CC
+$ THEN
+$ C_Compiler_Replace := "CC="
+$ ELSE
+$ C_Compiler_Replace := "CC=CC=''Mcc'"
+$ ENDIF
$ if "''Using_Dec_C'" .eqs. "Yes"
$ THEN
$ Checkcc := "''Mcc'/prefix=all"
@@ -23,7 +31,6 @@ $ ELSE
$ Checkcc := "''Mcc'"
$ ENDIF
$ cc_flags = ""
-$ if f$length(Mcc) .eq. 0 then Mcc := "cc"
$! Some constant defaults.
$
$ hwname = f$getsyi("HW_NAME")
@@ -31,13 +38,7 @@ $ myname = myhostname
$ if "''myname'" .eqs. "" THEN myname = f$trnlnm("SYS$NODE")
$ perl_package="''package'"
$ perl_baserev = "''baserev'"
-$ cc_defines="DEBUGGING"
-$ IF ("''Has_Socketshr'".eqs."T") .or. ("''Has_Dec_C_Sockets'".eqs."T") THEN cc_defines = cc_defines + ",VMS_DO_SOCKETS"
-$ if ("''Has_Dec_C_Sockets'".eqs."T") then cc_defines = cc_defines + ",DECCRTL_SOCKETS"
-$! if ("''Use_Threads'".eqs."T")
-$! then
-$! cc_defines = cc_defines + ",MULTIPLICITY"
-$! endif
+$ cc_defines=""
$ perl_CONFIG="true"
$ perl_i_netdb="undef"
$ perl_d_gnulibc="undef"
@@ -409,7 +410,9 @@ $ WS "#endif
$ WS "#include <stdio.h>
$ WS "int main()
$ WS "{"
-$ WS "printf(""%i\n"", sizeof(double));
+$ WS "int foo;
+$ WS "foo = sizeof(double);
+$ WS "printf(""%d\n"", foo);
$ WS "exit(0);
$ WS "}"
$ CS
@@ -450,7 +453,7 @@ $ WS "#endif
$ WS "#include <stdio.h>
$ WS "int main()
$ WS "{"
-$ WS "printf(""%i\n"", sizeof(long double));
+$ WS "printf(""%d\n"", sizeof(long double));
$ WS "exit(0);
$ WS "}"
$ CS
@@ -508,7 +511,7 @@ $ WS "#endif
$ WS "#include <stdio.h>
$ WS "int main()
$ WS "{"
-$ WS "printf(""%i\n"", sizeof(long long));
+$ WS "printf(""%d\n"", sizeof(long long));
$ WS "exit(0);
$ WS "}"
$ CS
@@ -557,7 +560,7 @@ $ WS "#endif
$ WS "#include <stdio.h>
$ WS "int main()
$ WS "{"
-$ WS "printf(""%i\n"", sizeof(int));
+$ WS "printf(""%d\n"", sizeof(int));
$ WS "exit(0);
$ WS "}"
$ CS
@@ -603,7 +606,7 @@ $ WS "#endif
$ WS "#include <stdio.h>
$ WS "int main()
$ WS "{"
-$ WS "printf(""%i\n"", sizeof(short));
+$ WS "printf(""%d\n"", sizeof(short));
$ WS "exit(0);
$ WS "}"
$ CS
@@ -643,7 +646,9 @@ $ WS "#endif
$ WS "#include <stdio.h>
$ WS "int main()
$ WS "{"
-$ WS "printf(""%i\n"", sizeof(long));
+$ WS "int foo;
+$ WS "foo = sizeof(long);
+$ WS "printf(""%d\n"", foo);
$ WS "exit(0);
$ WS "}"
$ CS
@@ -1599,10 +1604,14 @@ $ WS "#endif
$ WS "#include <stdio.h>
$ WS "int main()
$ WS "{"
-$ WS "printf(""%i\n"", sizeof(void *));
+$ WS "int foo;
+$ WS "foo = sizeof(char *);
+$ WS "printf(""%d\n"", foo);
$ WS "exit(0);
$ WS "}"
$ CS
+$! copy temp.c sys$output
+$!
$ DEFINE SYS$ERROR _NLA0:
$ DEFINE SYS$OUTPUT _NLA0:
$ ON ERROR THEN CONTINUE
@@ -1818,11 +1827,11 @@ $ perl_sitearchexp="''perl_prefix':[lib.site_perl.''perl_arch']"
$ perl_sitearch="''perl_prefix':[lib.site_perl.''perl_arch']"
$ if "''Using_Dec_C'" .eqs. "Yes"
$ THEN
-$ perl_ccflags="/Define=(''cc_defines')/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=''perl_obj_ext'/NoList''cc_flags'"
+$ perl_ccflags="/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=''perl_obj_ext'/NoList''cc_flags'"
$ ELSE
$ IF "''Using_Vax_C'" .eqs. "Yes"
$ THEN
-$ perl_ccflags="/Define=(''cc_defines')/Include=[]/Obj=''perl_obj_ext'/NoList''cc_flags'"
+$ perl_ccflags="/Include=[]/Obj=''perl_obj_ext'/NoList''cc_flags'"
$ ENDIF
$ ENDIF
$!
@@ -2228,8 +2237,64 @@ $ else
$ link munchconfig
$ endif
$ WRITE_RESULT "Writing config.h"
-$ define/user sys$output [-]config.h
+$ !
+$ ! we need an fdl file
+$ CREATE [-]CONFIG.FDL
+RECORD
+ FORMAT STREAM_LF
+$ CREATE /FDL=[-]CONFIG.FDL [-]CONFIG.LOCAL
+$ ! First spit out the header info with the local defines (to get
+$ ! around the 255 character command line limit)
+$ OPEN/APPEND CONFIG [-]config.local
+$ if use_debugging_perl.eqs."Y"
+$ THEN
+$ WRITE CONFIG "#define DEBUGGING"
+$ ENDIF
+$ if preload_env.eqs."Y"
+$ THEN
+$ WRITE CONFIG "#define PRIME_ENV_AT_STARTUP"
+$ ENDIF
+$ if use_two_pot_malloc.eqs."Y"
+$ THEN
+$ WRITE CONFIG "#define TWO_POT_OPTIMIZE"
+$ endif
+$ if mymalloc.eqs."Y"
+$ THEN
+$ WRITE CONFIG "#define EMBEDMYMALLOC"
+$ ENDIF
+$ if use_pack_malloc.eqs."Y"
+$ THEN
+$ WRITE CONFIG "#define PACK_MALLOC"
+$ endif
+$ if use_debugmalloc.eqs."Y"
+$ THEN
+$ write config "#define DEBUGGING_MSTATS"
+$ ENDIF
+$ if "''Using_Gnu_C'" .eqs."Yes"
+$ THEN
+$ WRITE CONFIG "#define GNUC_ATTRIBUTE_CHECK"
+$ ENDIF
+$ if "''Has_Dec_C_Sockets'".eqs."T"
+$ THEN
+$ WRITE CONFIG "#define VMS_DO_SOCKETS"
+$ WRITE CONFIG "#define DECCRTL_SOCKETS"
+$ ENDIF
+$ if "''Has_Socketshr'".eqs."T"
+$ THEN
+$ WRITE CONFIG "#define VMS_DO_SOCKETS"
+$ ENDIF
+$ CLOSE CONFIG
+$!
+$! Now build the normal config.h
+$ define/user sys$output [-]config.main
$ mcr []munchconfig [-]config.sh [-]config_h.sh
+$ ! Concatenate them together
+$ copy [-]config.local,[-]config.main [-]config.h
+$! Clean up
+$ DELETE/NOLOG [-]CONFIG.MAIN;*
+$ DELETE/NOLOG [-]CONFIG.LOCAL;*
+$ DELETE/NOLOG [-]CONFIG.FDL;*
+$!
$ if "''Using_Dec_C'" .eqs."Yes"
$ THEN
$ DECC_REPLACE = "DECC=decc=1"
@@ -2261,6 +2326,14 @@ $ THREAD_REPLACE = "THREAD=OLDTHREADED=1"
$ ELSE
$ THREAD_REPLACE = "THREAD=THREADED=1"
$ ENDIF
+$ ELSE
+$ THREAD_REPLACE = "THREAD="
+$ ENDIF
+$ if mymalloc.eqs."Y"
+$ THEN
+$ MALLOC_REPLACE = "MALLOC=MALLOC=1"
+$ ELSE
+$ MALLOC_REPLACE = "MALLOC="
$ ENDIF
$ if f$getsyi("HW_MODEL").ge.1024
$ THEN
@@ -2271,7 +2344,7 @@ $ ENDIF
$ WRITE_RESULT "Writing DESCRIP.MMS"
$!set ver
$ define/user sys$output [-]descrip.mms
-$ mcr []munchconfig [-]config.sh descrip_mms.template "''DECC_REPLACE'" "''ARCH_TYPE'" "''GNUC_REPLACE'" "''SOCKET_REPLACE'" "''THREAD_REPLACE'" "''C_Compiler_Replace'"
+$ mcr []munchconfig [-]config.sh descrip_mms.template "''DECC_REPLACE'" "''ARCH_TYPE'" "''GNUC_REPLACE'" "''SOCKET_REPLACE'" "''THREAD_REPLACE'" "''C_Compiler_Replace'" "''MALLOC_REPLACE'" "''Thread_Live_Dangerously'"
$! set nover
$!
$! Clean up after ourselves