This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Casting nit
[perl5.git] / configure.com
index 1406d26..aeb18fe 100644 (file)
@@ -37,7 +37,7 @@ $ echo = "write sys$output "
 $ cat  = "type"
 $ delete := delete ! local symbol overrides globals with qualifiers
 $ gcc_symbol = "gcc"
-$ ld = "Link"
+$ ld = "Link/nodebug"
 $ ans = ""
 $ macros = ""
 $ extra_flags = ""
@@ -45,13 +45,16 @@ $ user_c_flags = ""
 $ use_ieee_math = "y"
 $ be_case_sensitive = "n"
 $ unlink_all_versions = "n"
+$ builder = "MMK"
 $ use_vmsdebug_perl = "n"
 $ use64bitall = "n"
 $ use64bitint = "n"
 $ uselargefiles = "n"
+$ usestdstat = "n"
 $ usesitecustomize = "n"
 $ C_Compiler_Replace = "CC="
-$ Thread_Live_Dangerously = "MT="
+$ thread_upcalls = "MTU="
+$ thread_kernel = "MTK="
 $ use_two_pot_malloc = "N"
 $ use_pack_malloc = "N"
 $ use_debugmalloc = "N"
@@ -509,6 +512,8 @@ $       ELSE
 $         file_2_find = "[-]" + file_2_find
 $       ENDIF
 $!
+$       tmp = F$PARSE(file_2_find + ";",,,,"SYNTAX_ONLY")
+$       IF F$SEARCH(tmp) .NES. "" THEN file_2_find = tmp
 $       dirname = F$EXTRACT(0,F$LOCATE("]",file_2_find),file_2_find) + "]"
 $       file_2_find = file_2_find - dirname
 $!
@@ -790,7 +795,12 @@ Many of the questions will have default answers in square
 brackets; typing carriage return will give you the default.
 
 $   EOD
-$   READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
+$   if (fastread)
+$   then
+$     echo4 ""
+$   else
+$     READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
+$   endif
 $   TYPE SYS$INPUT:
 $   DECK
 
@@ -800,7 +810,12 @@ there was already a config.sh file). Type '@Configure "-h"' for a list of
 options.
 
 $   EOD
-$   READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
+$   if (fastread)
+$   then
+$     echo4 ""
+$   else
+$     READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
+$   endif
 $   TYPE SYS$INPUT:
 $   DECK
 
@@ -821,7 +836,12 @@ $!
 $!If you make a mistake on a question, there is no easy way to back up to it
 $!currently.
 $!
-$   READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
+$   if (fastread)
+$   then
+$     echo4 ""
+$   else
+$     READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
+$   endif
 $   IF (F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
 $   THEN
 $     OPEN/WRITE CONFIG [-.CONFIG]INSTRUCT.
@@ -840,7 +860,7 @@ $! echo "I don't know where '$file' is, and my life depends on it."
 $! echo "Go find a public domain implementation or fix your PATH setting!"
 $! echo ""
 $! echo "Don't worry if any of the following aren't found..."
-$!: determine whether symbolic links are supported !sfn
+$!: determine whether symbolic links are supported !sfn !jem- further down
 $!: see whether [:lower:] and [:upper:] are supported character classes !sfn
 $!: set up the translation script tr, must be called with ./tr of course !sfn
 $!
@@ -885,6 +905,7 @@ $   config_symbols1 ="|installprivlib|installscript|installsitearch|installsitel
 $   config_symbols2 ="|prefix|privlib|privlibexp|scriptdir|sitearch|sitearchexp|sitebin|sitelib|sitelib_stem|sitelibexp|try_cxx|use64bitall|use64bitint|"
 $   config_symbols3 ="|usecasesensitive|usedefaulttypes|usedevel|useieee|useithreads|usemultiplicity|usemymalloc|usedebugging_perl|useperlio|usesecurelog|"
 $   config_symbols4 ="|usethreads|usevmsdebug|usefaststdio|usemallocwrap|unlink_all_versions|uselargefiles|usesitecustomize|"
+$   config_symbols5 ="|buildmake|builder|usethreadupcalls|usekernelthreads"
 $!  
 $   open/read CONFIG 'config_sh'
 $   rd_conf_loop:
@@ -900,7 +921,7 @@ $         syms = config_symbols'k'
 $         j = f$locate(dsym, syms)
 $         if j .lt. f$length(syms) then goto erd_ck_loop
 $         k = k + 1
-$     if k .lt. 5 then goto rd_ck_loop
+$     if k .lt. 6 then goto rd_ck_loop
 $     goto rd_conf_loop
 $     erd_ck_loop:
 $     val = f$element(1,"=",line)
@@ -915,6 +936,7 @@ $   delete/symbol config_symbols1
 $   delete/symbol config_symbols2
 $   delete/symbol config_symbols3
 $   delete/symbol config_symbols4
+$   delete/symbol config_symbols5
 $   delete/symbol sym
 $   delete/symbol val
 $   delete/symbol dsym
@@ -1174,6 +1196,9 @@ $   prefixbase = prefix - "]"
 $!  Add _ROOT to make install PERL_ROOT differ from build directory.
 $   prefix = prefixbase + "_ROOT.]"
 $ ENDIF
+$ ! more redundant scrubbing of values
+$ prefix = prefix - "000000."
+$ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN prefix = prefix - "]" + ".]"
 $ src = prefix
 $!: determine root of directory hierarchy where package will be installed.
 $ dflt = prefix
@@ -1467,7 +1492,7 @@ $!: determine where public executables go
 $   IF F$TYPE(bin) .NES. ""
 $   THEN dflt = bin
 $!   ELSE dflt = prefix - ".]" + ".BIN]"
-$   ELSE dflt = "/''vms_prefix'/000000"
+$   ELSE dflt = "/''vms_prefix'"
 $   ENDIF
 $   rp = "Pathname where the public executables will reside? "
 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
@@ -1495,7 +1520,7 @@ $ ELSE ! skipping "where install" questions, we must set some symbols
 $   IF F$TYPE(archlib).EQS."" THEN -
       archlib="''vms_prefix':[lib.''archname'.''version']"
 $   IF F$TYPE(bin) .EQS. "" THEN -
-      bin="/''vms_prefix'/000000"
+      bin="/''vms_prefix'"
 $   IF F$TYPE(privlib) .EQS. "" THEN -
       privlib ="''vms_prefix':[lib]"
 $   IF F$TYPE(sitearch) .EQS. "" THEN -
@@ -1686,7 +1711,7 @@ $! Which linker?
 $   SET NOON
 $   DEFINE/USER_MODE SYS$OUTPUT NL:
 $   DEFINE/USER_MODE SYS$ERROR NL:
-$   link ccvms.obj
+$   link/nodebug ccvms.obj
 $   tmp = $status
 $   SET ON
 $   ! success $status with:
@@ -1817,7 +1842,7 @@ $   tmp = $status
 $   IF (silent) THEN GOSUB Shut_up
 $   DEFINE/USER_MODE SYS$ERROR NL:
 $   DEFINE/USER_MODE SYS$OUTPUT NL:
-$   link deccvers.obj
+$   link/nodebug deccvers.obj
 $   tmp = $status
 $   IF (silent) THEN GOSUB Shut_up
 $   OPEN/WRITE CONFIG deccvers.out
@@ -1914,17 +1939,17 @@ $     IF vaxcrtl_exe .EQS. ""
 $     THEN 
 $       IF F$LOCATE("VAXCRTL",gcclib_olb).NE.F$LENGTH(gcclib_olb)
 $       THEN 
-$         link gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
+$         link/nodebug gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
 $         tmp = $status
 $       ELSE
-$         link gccvers.obj,'gcclib_olb'
+$         link/nodebug gccvers.obj,'gcclib_olb'
 $         tmp = $status
 $       ENDIF
 $     ELSE
 $       OPEN/WRITE CONFIG GCCVERS.OPT
 $       WRITE CONFIG "SYS$SHARE:VAXCRTL/SHARE"
 $       CLOSE CONFIG
-$       link gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
+$       link/nodebug gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
 $       tmp = $status
 $     ENDIF
 $     DEASSIGN SYS$ERROR
@@ -2002,7 +2027,10 @@ $   DELETE/NOLOG/NOCONFIRM cxxvers.*;
 $   echo "You are using CXX ''line'"
 $   cxxversion = line
 $   ccversion = line
+$   d_cplusplus = "define"
 $   CALL Cxx_demangler_cleanup
+$ ELSE
+$   d_cplusplus = "undef"
 $ ENDIF
 $!
 $Cxx_demangler_cleanup: SUBROUTINE
@@ -2323,10 +2351,11 @@ $   THEN
 $     echo ""
 $     echo "Since you have chosen a maximally 64-bit build, I'm also turning on"
 $     echo "the use of 64-bit integers."
+$     echo "I am also setting the default to use large files if available."
 $     use64bitint="Y"
 $   ENDIF
 $!
-$   bool_dflt = "n"
+$   bool_dflt = use64bitall
 $   IF F$TYPE(uselargefiles) .NES. "" 
 $   THEN
 $       IF uselargefiles .OR. uselargefiles .eqs. "define" THEN bool_dflt = "y"
@@ -2409,28 +2438,50 @@ $       use_5005_threads="N"
 $     ELSE
 $       use_5005_threads="Y"
 $     ENDIF
-$     ! Are they on VMS 7.1 on an alpha or itanium?
-$     if (archname.nes."VMS_VAX").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
+$     ! Are they on VMS 7.1 or greater?
+$     IF "''f$extract(1,3, f$getsyi(""version""))'" .GES. "7.1"
 $     THEN
 $       echo ""
-$       echo "Threaded perl can be linked to use multiple kernel threads"
-$       echo "and system upcalls on VMS 7.1+ on Alpha systems.  This feature"
-$       echo "allows multiple threads to execute simultaneously on an SMP"
-$       echo "system as well as preventing a single thread from blocking"
-$       echo "all the threads in a program, even on a single-processor"
-$       echo "machine.  Unfortunately, this feature isn't safe on an"
-$       echo "unpatched 7.1 system (several OS patches were required when"
-$       echo "this procedure was written)."
-$       bool_dflt = "n"
-$       rp = "Enable multiple kernel threads and upcalls? [''bool_dflt'] "
+$      echo "Threaded Perl can be linked to use system upcalls on your system. This feature"
+$      echo "allows the thread scheduler to be made aware of system events (such as I/O)"
+$      echo "so as to prevent a single thread from blocking all the threads in a program,"
+$      echo "even on a single-processor machine."
+$      bool_dflt = "y"
+$      IF f$type(usethreadupcalls) .NES. ""
+$      THEN
+$              if .not. usethreadupcalls .or. usethreadupcalls .eqs. "undef" then bool_dflt="n"
+$      ENDIF
+$       rp = "Enable thread upcalls? [''bool_dflt'] "
 $       gosub myread
-$       if ans
+$       IF ans
 $       THEN
-$         Thread_Live_Dangerously = "MT=MT=1"
+$           thread_upcalls = "MTU=MTU=1"
+$          usethreadupcalls = "define"
+$          ! Are they on alpha or itanium?
+$          IF (archname .NES. "VMS_VAX") .AND. ("''f$extract(1,3, f$getsyi(""version""))'" .GES. "7.2")
+$          THEN
+$              echo ""
+$              echo "Threaded Perl can be linked to use multiple kernel threads on your system."
+$              echo "This feature allows multiple user threads to make use of multiple CPUs on
+$              echo "a multi-processor machine."
+$              bool_dflt = "n"
+$              IF f$type(usekernelthreads) .nes. ""
+$              THEN
+$                      if usekernelthreads .or. usekernelthreads .eqs. "define" then bool_dflt="y"
+$              ENDIF
+$              rp = "Enable multiple kernel threads? [''bool_dflt'] "
+$              gosub myread
+$              IF ans
+$              THEN
+$                  thread_kernel = "MTK=MTK=1"
+$                  usekernelthreads = "define"
+$           ENDIF
 $       ENDIF
 $     ENDIF
 $   ENDIF
 $ ENDIF
+$ IF F$TYPE(usethreadupcalls) .EQS. "" THEN usethreadupcalls = "undef"
+$ IF F$TYPE(usekernelthreads) .EQS. "" THEN usekernelthreads = "undef"
 $ IF archname .NES. "VMS_VAX"
 $ THEN
 $! Case sensitive?
@@ -2693,7 +2744,8 @@ $ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
 $ probers  = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
 $ max_build = 7
 $!
-$ orig_dflt = "MMK"
+$ orig_dflt = f$edit(builder,"UPCASE")
+$ if orig_dflt .eqs. "" then orig_dflt = "MMK"
 $ default_set = ""
 $ ok_builders = ""
 $ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
@@ -3487,6 +3539,13 @@ $ tmp = "unistd.h"
 $ GOSUB inhdr
 $ i_unistd = tmp
 $!
+$! Check to see if we've got utime.h (which we should use if we have)
+$!
+$ i_netdb = "undef"
+$ tmp = "utime.h"
+$ GOSUB inhdr
+$ i_utime = tmp
+$!
 $! do we have getppid()?
 $!
 $ IF i_unistd .EQS. "define"
@@ -4015,24 +4074,6 @@ $ tmp = "strtoq"
 $ GOSUB inlibc
 $ d_strtoq = tmp
 $!
-$! Check for strtoq
-$!
-$ OS
-$ WS "#if defined(__DECC) || defined(__DECCXX)"
-$ WS "#include <stdlib.h>"
-$ WS "#endif"
-$ WS "#include <string.h>"
-$ WS "int main()"
-$ WS "{"
-$ WS "__int64 result;"
-$ WS "result = strtoq(""123123"", NULL, 10);"
-$ WS "exit(0);"
-$ WS "}"
-$ CS
-$ tmp = "strtoq"
-$ GOSUB inlibc
-$ d_strtoq = tmp
-$!
 $! Check for strtold
 $!
 $ OS
@@ -4803,6 +4844,174 @@ $   echo4 "I'm disabling large file support."
 $   uselargefiles = "undef"
 $ ENDIF
 $!
+$! Tests for hard link, symbolic links, and 7.3 + CRTL features
+$!
+$  d_lchown = "undef"
+$  d_link = "undef"
+$  d_lstat = "undef"
+$  d_readlink = "undef"
+$  d_symlink = "undef"
+$  d_realpath = "undef"
+$!
+$! Hard link support has been present since 7.3-1 except for the
+$! easy to use DCL test to see if hardlinks are enabled on the build
+$! disk.  That would require more work to test, and I am only testing
+$! this on 8.2, so that is why the 8.2 test.
+$!
+$  IF (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
+$  THEN
+$   IF f$getdvi("SYS$DISK","HARDLINKS_SUPPORTED")
+$   THEN
+$       echo "I Found 64 bit OpenVMS 8.2 or later, and hard links enabled on build disk."
+$      echo "I will build with hard link support"
+$      d_link = "define"
+$   ELSE
+$      echo "I Found 64 bit OpenVMS 8.2 or later, and hard links disabled on build disk."
+$      echo "I will not build with hard link support."
+$   ENDIF
+$  ELSE
+$    echo4 "I can not detect if your CRTL and build disk support hard links."
+$    echo4 "I am disabling hard link support."
+$  ENDIF
+$!
+$  IF uselargefiles .OR. uselargefiles .eqs. "define"
+$  THEN
+$    echo4 "Largefile support enabled (plus standard stat support on V8.2 and later)"
+$    usestdstat = "y"
+$    IF (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
+$    THEN
+$      echo4 -
+   "Looking for the realpath() function to indicate symbolic link support..."
+$      OS
+$!      WS "#include <stdlib.h>"
+$      WS "void exit(int foo);"
+$      WS "char *realpath(const char *file_name, char * resolved_name, ...);"
+$      WS "int main()"
+$      WS "{"
+$      WS "char result[255];"
+$      WS "realpath(""foo"",result);"
+$      WS "exit(0);"
+$      WS "}"
+$      CS
+$      GOSUB link_ok
+$      IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
+$      THEN
+$        echo -
+           "Found realpath() which indicates symbolic link support is present."
+$       d_lchown = "define"
+$       d_lstat = "define"
+$       d_readlink = "define"
+$       d_symlink = "define"
+$!      d_realpath = "define" ! Perl will not put it in the config.h file?
+$!     Perl apparently does not use a built in realpath() on other platforms,
+$!      but there is a severe performance penatly on OpenVMS to use the Perl
+$!      script that implements a realpath().  The d_symlink symbol is used
+$!      as a replacement for the d_realpath since they are related and both
+$!      were activated by the CRTL at the same time.
+$!
+$       ELSE
+$        echo4 "Your system does not support symbolic links."
+$        echo4 "I am disabling symbolic link support."
+$      ENDIF
+$    ELSE
+$       echo4 "Your system does not support symbolic links."
+$       echo4 "I am disabling symbolic link support."
+$    ENDIF
+$  ELSE
+$    IF (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
+$    THEN
+$       echo4 "-Duselargefiles is required for symbolic link support."
+$       echo4 "You did not specify that, so I am disabling symbolic link support."
+$    ENDIF
+$  ENDIF
+$!
+$!
+$! Check for grp.h -- should be 7.3 and later, but test to be sure
+$!
+$ tmp = "grp.h"
+$ GOSUB inhdr
+$ i_grp = tmp
+$!
+$! VMS V7.3-2 powered options
+$! We know that it is only available for V7.3-2 and later on 64 bit platforms.
+$!
+$  d_getgrgid_r = "undef"
+$  getgrgid_r_proto = "0"
+$  d_getgrnam_r = "undef"
+$  getgrnam_r_proto = "0"
+$  d_getpgid = "undef"
+$  d_getpgrp = "undef"
+$! N.B.  We already have home-grown thread-safe versions of
+$!       getpwnam and getpwuid -- no need to use CRTL versions
+$  d_getpwnam_r = "undef"
+$  getpwnam_r_proto = "0"
+$  d_getpwuid_r = "undef"
+$  getpwuid_r_proto = "0"
+$  d_setgrent = "undef"
+$  d_ttyname_r = "undef"
+$  ttyname_r_proto = "0"
+$  d_snprintf = "undef"
+$  d_vsnprintf = "undef"
+$  if (vms_ver .GES. "7.3-2") .AND. (archname .NES. "VMS_VAX")
+$  then
+$    echo "Found 64 bit OpenVMS ''vms_ver' -- will build with V7.3-2 routines"
+$    d_getgrgid_r = "define"
+$    getgrgid_r_proto = "1"
+$    d_getgrnam_r = "define"
+$    getgrnam_r_proto = "1"
+$    if d_symlink .or. d_symlink .EQS. "define"
+$    then
+$!      FIXME: Need to find how to activate this.
+$!       d_getpgid = "define"
+$!       d_getpgrp = "define"
+$    endif
+$    d_setgrent = "define"
+$    d_ttyname_r = "define"
+$    ttyname_r_proto = "1"
+$    d_snprintf = "define"
+$    d_vsnprintf = "define"
+$  endif
+$!
+$! VMS V7.3-2 powered options
+$! We know that it is only available for V7.3-2 and later on 64 bit platforms.
+$! Only implementing right now on 8.2 because that is what I am testing
+$! These functions may require POSIX UIDs/GIDs to be active, so I am
+$! not activating the features at this time, just preparing this file
+$! to easily use them in the future.
+$!
+$  d_seteuid = "undef"
+$  d_setpgid = "undef"
+$  d_setpgrp = "undef"
+$  d_setregid = "undef"
+$  d_setreuid = "undef"
+$  d_setsid = "undef"
+$  ! Disable this section for now.
+$!$  if (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
+$  if .NOT. 1
+$  then
+$    echo "Found 64 bit OpenVMS ''vms_ver' -- will build with V7.3-2 UID setting routines"
+$    d_seteuid = "define"
+$    d_setpgid = "define"
+$    d_setpgrp = "define"
+$    d_setregid = "define"
+$    d_setreuid = "define"
+$    d_setsid = "define"
+$  endif
+$!
+$! VMS V8 powered options
+$! We know that it is only available for 8.2 and later on 64 bit platforms.
+$!
+$  d_fstatvfs = "undef"
+$!  d_statvfs = "undef"
+$  i_sysstatvfs = "undef"
+$  if (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
+$  then
+$    echo "Found 64 bit OpenVMS ''vms_ver' -- will build with 8.2 routines"
+$    d_fstatvfs = "define"
+$!    d_statvfs = "define"
+$    i_sysstatvfs = "define"
+$  endif
+$!
 $! Check rand48 and its ilk
 $!
 $ echo4 "Looking for a random number function..."
@@ -4893,6 +5102,9 @@ $   d_munmap="define"
 $   d_msync="define"
 $   d_ualarm="define"
 $   d_uname="define"
+$!   d_unsetenv="define" ! Fix me - Activating requires changing VMS code
+$   d_unsetenv="undef"   ! Change will be needed to allow GNV integration
+$   d_clearenv="undef"
 $   d_usleep="define"
 $   d_setitimer="define"
 $   d_sigaction="define"
@@ -4901,37 +5113,41 @@ $   d_truncate="define"
 $   d_wait4="define"
 $   d_index="define"
 $   pidtype="pid_t"
-$   sig_name1="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM "
-$   sig_name2="TERM ABRT USR1 USR2 SPARE18 SPARE19 CHLD CONT STOP TSTP TTIN TTOU "
-$   sig_name3="DEBUG SPARE27 SPARE28 SPARE29 SPARE30 SPARE31 SPARE32 "
-$   sig_name4="WINCH "
-$   sig_namert="RTMIN RTMAX"
-$   psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
-$   psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",""USR1"",""USR2"",""SPARE18"",""SPARE19"",""CHLD"",""CONT"",""STOP"",""TSTP"","
-$   psnwc3="""TTIN"",""TTOU"",""DEBUG"",""SPARE27"",""SPARE28"",""SPARE29"",""SPARE30"",""SPARE31"",""SPARE32"","
-$   psnwc4_v7_3="""WINCH"","
-$   psnwcrt="""RTMIN"",""RTMAX"",0"
-$   sig_num1="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 "
-$   sig_num_v7_3="28 "
-$   sig_numrt="33 64"
-$   sig_num_init1="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,6,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,"
-$   sig_num_init_v7_3="28,"
-$   sig_num_initrt="33,64,0"
-$   if (vms_ver .GES. "7.3")
-$   then
-$      sig_name = sig_name1 + sig_name2 + sig_name3 + sig_name4 + sig_namert
-$       sig_name_init = psnwc1 + psnwc2 + psnwc3 + psnwc4_v7_3 + psnwcrt
-$      sig_num = sig_num1 + sig_num_v7_3 + sig_numrt
-$      sig_num_init = sig_num_init1 + sig_num_v7_3 + sig_num_initrt
-$      sig_size="37"
-$   else
-$      sig_name = sig_name1 + sig_name2 + sig_name3 + sig_namert
-$       sig_name_init = psnwc1 + psnwc2 + psnwc3 + psnwcrt
-$      sig_num = sig_num1 + sig_numrt
-$      sig_num_init = sig_num_init1 + sig_num_initrt
-$      sig_size="36"
-$   endif
-$   sig_count="64"
+$   sig_name1="ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE"
+$   sig_name2=" ALRM TERM USR1 USR2 NUM18 NUM19 CHLD CONT STOP TSTP TTIN TTOU DEBUG"
+$   IF (vms_ver .GES. "7.3")
+$   THEN
+$     sig_name2 = sig_name2 + " NUM27 WINCH"
+$   ENDIF
+$!* signal.h defines SIGRTMIN as 33 and SIGRTMAX as 64, but there is no 
+$!* sigqueue function or other apparent means to do realtime signalling,
+$!* so let's not try to include the realtime range for now.
+$!* sig_name3=" NUM29 NUM30 NUM31 NUM32 RTMIN NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43"
+$!* sig_name4=" NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58"
+$!* sig_name5=" NUM59 NUM60 NUM61 NUMT62 NUM63 RTMAX"
+$   sig_name = sig_name1 + sig_name2
+$   sig_num = ""
+$   sig_num_init = ""
+$   sig_name_init = ""
+$   sig_index = 0
+$!
+$ PARSE_SIG_NAME_LOOP:
+$!
+$   tmp = F$ELEMENT(sig_index, " ", sig_name)
+$   IF F$LENGTH(F$EDIT(tmp,"TRIM")) .eq. 0 THEN GOTO END_SIG_NAME_LOOP
+$   sig_name_init = sig_name_init + """''tmp'"","
+$   sig_num = sig_num + "''sig_index' "
+$   sig_num_init = sig_num_init + "''sig_index',"
+$   sig_index = sig_index + 1
+$   GOTO PARSE_SIG_NAME_LOOP
+$!
+$ END_SIG_NAME_LOOP:
+$!
+$   sig_name_init = sig_name_init + "0"
+$   sig_num_init = sig_num_init + "0"
+$   sig_size = "''sig_index'"
+$   sig_index = sig_index - 1
+$   sig_count = "''sig_index'"
 $   uidtype="uid_t"
 $   d_pathconf="define"
 $   d_fpathconf="define"
@@ -4948,6 +5164,8 @@ $   d_munmap="undef"
 $   d_msync="undef"
 $   d_ualarm="undef"
 $   d_uname="undef"
+$   d_unsetenv="undef"
+$   d_clearenv="undef"
 $   d_usleep="undef"
 $   d_setitimer="undef"
 $   d_sigaction="undef"
@@ -5051,6 +5269,12 @@ $ THEN
 $   d_vms_do_sockets="define"
 $   d_htonl="define"
 $   d_socket="define"
+$   d_sockpair = "undef"
+$   if (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
+$   then
+$     echo "Found 64 bit OpenVMS 8.2, will build with socketpair support"
+$     d_sockpair = "define"
+$   endif
 $   d_select="define"
 $   netdb_hlen_type="int"
 $   netdb_host_type="char *"
@@ -5078,6 +5302,7 @@ $ ELSE
 $   d_vms_do_sockets="undef"
 $   d_htonl="undef"
 $   d_socket="undef"
+$   d_socketpair = "undef"
 $   d_select="undef"
 $   netdb_hlen_type="int"
 $   netdb_host_type="char *"
@@ -5297,20 +5522,12 @@ $   THEN
 $       echo4 "Yep, we can."
 $       kill_by_sigprc = "define"
 $!
-$!      since SIGBUS and SIGSEGV indistinguishable, make them the same here.
-$!      sigusr1 and sigusr2 show up in VMS6.2 and later
+$!     Use the same list of signals the CRTL does for recent systems, but cook our own for very old systems.
+$!     Note that the list controls what signals can be caught by name as well as what can be raised via kill().
 $!
-$       if  vms_ver .GES. "6.2"
-$       then
-$           sig_name="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM ABRT USR1 USR2"
-$           psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
-$           psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",""USR1"",""USR2"",0"
-$           sig_name_init = psnwc1 + psnwc2
-$           sig_num="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 16 17"
-$           sig_num_init="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,6,16,17,0"
-$           sig_size="19"
-$          sig_count="17"
-$       else
+$       if  vms_ver .LT. "6.2"
+$      then
+$!          since SIGBUS and SIGSEGV indistinguishable, make them the same here.
 $           sig_name="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM ABRT"
 $           psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
 $           psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",0"
@@ -5401,7 +5618,18 @@ $ WC "cccdlflags='" + cccdlflags + "'"
 $ WC "ccdlflags='" + ccdlflags + "'"
 $ IF uselargefiles .OR. uselargefiles .EQS. "define"
 $ THEN
-$   WC "ccflags='" + ccflags + "/Define=_LARGEFILE'"
+$    IF usestdstat .OR. usestdstat .EQS. "define"
+$    THEN
+$      ccdefines = "_USE_STD_STAT=1"
+$    ELSE
+$      ccdefines = "_LARGEFILE=1"
+$    ENDIF
+$ ELSE
+$     ccdefines = ""
+$ ENDIF
+$ IF ccdefines .NES. ""
+$ THEN
+$   WC "ccflags='" + ccflags + "/Define=" + ccdefines + "'"
 $ ELSE
 $   WC "ccflags='" + ccflags + "'"
 $ ENDIF
@@ -5458,6 +5686,8 @@ $ WC "d_bincompat3='undef'"
 $! WC "d_bsdpgrp='undef'"
 $ WC "d_bsdgetpgrp='undef'"
 $ WC "d_bsdsetpgrp='undef'"
+$ WC "d_builtin_choose_expr='undef'" ! GCC only
+$ WC "d_builtin_expect='undef'" ! GCC only
 $ WC "d_bzero='" + d_bzero + "'"
 $ WC "d_casti32='define'"
 $ WC "d_castneg='define'"
@@ -5469,12 +5699,16 @@ $ WC "d_class='undef'"
 $ WC "d_cmsghdr_s='undef'"
 $ WC "d_const='define'"
 $ WC "d_copysignl='define'"
+$ WC "d_cplusplus='" + d_cplusplus + "'"
 $ WC "d_crypt='define'"
 $ WC "d_csh='undef'"
+$ WC "d_ctermid='define'"
 $ WC "d_cuserid='define'"
+$ WC "d_c99_variadic_macros='undef'"
 $ WC "d_dbl_dig='define'"
 $ WC "d_dbminitproto='undef'"
 $ WC "d_difftime='define'"
+$ WC "d_dir_dd_fd='undef'"
 $ WC "d_dirfd='undef'"
 $ WC "d_dirnamlen='define'"
 $ WC "d_dlerror='undef'"
@@ -5515,9 +5749,10 @@ $ WC "d_fs_data_s='undef'"
 $ WC "d_fseeko='" + d_fseeko + "'"
 $ WC "d_fsetpos='define'"
 $ WC "d_fstatfs='undef'"
-$ WC "d_fstatvfs='undef'"
+$ WC "d_fstatvfs='" + d_fstatvfs + "'"
 $ WC "d_fsync='undef'"
 $ WC "d_ftello='" + d_ftello + "'"
+$ WC "d_futimes='undef'"
 $ WC "d_getcwd='define'"
 $ WC "d_getespwnam='undef'"
 $ WC "d_getfsstat='undef'"
@@ -5540,9 +5775,9 @@ $ WC "d_getpagsz='undef'"
 $ WC "d_getpbyname='" + d_getpbyname + "'"
 $ WC "d_getpbynumber='" + d_getpbynumber + "'"
 $ WC "d_getpent='" + d_getpent + "'"
-$ WC "d_getpgid='undef'"
+$ WC "d_getpgid='" + d_getpgid + "'"
 $ WC "d_getpgrp2='undef'"
-$ WC "d_getpgrp='undef'"
+$ WC "d_getpgrp='" + d_getpgrp + "'"
 $ WC "d_getppid='" + d_getppid + "'"
 $ WC "d_getprior='undef'"
 $ WC "d_getprotoprotos='" + d_getprotoprotos + "'"
@@ -5559,6 +5794,7 @@ $ WC "d_grpasswd='undef'"
 $ WC "d_hasmntopt='undef'"
 $ WC "d_htonl='" + d_htonl + "'"
 $ WC "d_ilogbl='undef'"
+$ WC "d_inc_version_list='undef'"
 $ WC "d_index='" + d_index + "'"
 $ WC "d_inetaton='undef'"
 $ WC "d_int64_t='" + d_int64_t + "'"
@@ -5568,17 +5804,17 @@ $ WC "d_isinf='undef'"
 $ WC "d_isnan='" + d_isnan + "'"
 $ WC "d_isnanl='" + d_isnanl + "'"
 $ WC "d_killpg='undef'"
-$ WC "d_lchown='undef'"
+$ WC "d_lchown='" + d_lchown + "'"
 $ WC "d_ldbl_dig='define'"
 $ WC "d_libm_lib_version='undef'"
-$ WC "d_link='undef'"
+$ WC "d_link='" + d_link + "'"
 $ WC "d_llseek='undef'"
 $ WC "d_locconv='" + d_locconv + "'"
 $ WC "d_lockf='undef'"
 $ WC "d_longdbl='" + d_longdbl + "'"
 $ WC "d_longlong='" + d_longlong + "'"
 $ WC "d_lseekproto='define'"
-$ WC "d_lstat='undef'"
+$ WC "d_lstat='" + d_lstat + "'"
 $ WC "d_madvise='undef'"
 $ WC "d_malloc_size='undef'"
 $ WC "d_malloc_good_size='undef'"
@@ -5645,9 +5881,9 @@ $ WC "d_pwquota='undef'"
 $ WC "d_qgcvt='undef'"
 $ WC "d_quad='" + d_quad + "'"
 $ WC "d_readdir='define'"
-$ WC "d_readlink='undef'"
+$ WC "d_readlink='" + d_readlink + "'"
 $ WC "d_readv='undef'"
-$ WC "d_realpath='undef'"
+$ WC "d_realpath='" + d_realpath + "'"
 $ WC "d_recvmsg='undef'"
 $ WC "d_rename='define'"
 $ WC "d_rewinddir='define'"
@@ -5667,8 +5903,8 @@ $ WC "d_semctl_semun='undef'"
 $ WC "d_sendmsg='undef'"
 $ WC "d_setegid='undef'"
 $ WC "d_setenv='" + d_setenv + "'"
-$ WC "d_seteuid='undef'"
-$ WC "d_setgrent='undef'"
+$ WC "d_seteuid='" + d_seteuid + "'"
+$ WC "d_setgrent='" + d_setgrent + "'"
 $ WC "d_setgrps='undef'"
 $ WC "d_sethent='" + d_sethent + "'"
 $ WC "d_setitimer='" + d_setitimer + "'"
@@ -5676,20 +5912,20 @@ $ WC "d_setlinebuf='undef'"
 $ WC "d_setlocale='" + d_setlocale + "'"
 $ WC "d_setnent='" + d_setnent + "'"
 $ WC "d_setpent='" + d_setpent + "'"
-$ WC "d_setpgid='undef'"
+$ WC "d_setpgid='" + d_setpgid + "'"
 $ WC "d_setpgrp2='undef'"
-$ WC "d_setpgrp='undef'"
+$ WC "d_setpgrp='" + d_setpgrp + "'"
 $ WC "d_setprior='undef'"
 $ WC "d_setproctitle='" + d_setproctitle + "'"
 $ WC "d_setpwent='define'"
-$ WC "d_setregid='undef'"
+$ WC "d_setregid='" + d_setregid + "'"
 $ WC "d_setresgid='undef'"
 $ WC "d_setresuid='undef'"
-$ WC "d_setreuid='undef'"
+$ WC "d_setreuid='" + d_setreuid + "'"
 $ WC "d_setrgid='undef'"
 $ WC "d_setruid='undef'"
 $ WC "d_setsent='" + d_setsent + "'"
-$ WC "d_setsid='undef'"
+$ WC "d_setsid='" + d_setsid + "'"
 $ WC "d_setvbuf='" + d_setvbuf + "'"
 $ WC "d_sfio='undef'"
 $ WC "d_shm='undef'"
@@ -5697,12 +5933,14 @@ $ WC "d_shmatprototype='undef'"
 $ WC "d_sigaction='" + d_sigaction + "'"
 $ WC "d_sigprocmask='" + d_sigprocmask + "'"
 $ WC "d_sigsetjmp='" + d_sigsetjmp + "'"
+$ WC "d_sitearch='define'"
 $ WC "d_sockatmark='undef'"
 $ WC "d_sockatmarkproto='undef'"
 $ WC "d_socket='" + d_socket + "'"
 $ WC "d_socklen_t='" + d_socklen_t + "'"
-$ WC "d_sockpair='undef'"
+$ WC "d_sockpair='" + d_sockpair + "'"
 $ WC "d_socks5_init='undef'"
+$ WC "d_sprintf_returns_strlen='define'"
 $ WC "d_sqrtl='define'"
 $ WC "d_sresgproto='undef'"
 $ WC "d_sresgproto='undef'"
@@ -5732,13 +5970,13 @@ $ WC "d_strtod='define'"
 $ WC "d_strtol='define'"
 $ WC "d_strtold='" + d_strtold + "'"
 $ WC "d_strtoll='" + d_strtoll + "'"
-$ WC "d_strtoq='define'"
+$ WC "d_strtoq='" + d_strtoq + "'"
 $ WC "d_strtoul='define'"
 $ WC "d_strtoull='" + d_strtoull + "'"
 $ WC "d_strtouq='" + d_strtouq + "'"
 $ WC "d_strxfrm='" + d_strxfrm  + "'"
 $ WC "d_suidsafe='undef'"
-$ WC "d_symlink='undef'"
+$ WC "d_symlink='" + d_symlink + "'"
 $ WC "d_syscall='undef'"
 $ WC "d_syscallproto='undef'"
 $ WC "d_sysconf='" + d_sysconf + "'"
@@ -5767,6 +6005,8 @@ $ WC "d_uname='" + d_uname + "'"
 $ WC "d_union_semun='undef'"
 $ WC "d_unlink_all_versions='" + d_unlink_all_versions + "'"   ! VMS-specific
 $ WC "d_unordered='undef'"
+$ WC "d_unsetenv='" + d_unsetenv + "'"
+$ WC "d_clearenv='" + d_clearenv + "'"
 $ WC "d_usleep='" + d_usleep + "'"
 $ WC "d_usleepproto='" + d_usleep + "'"
 $ WC "d_ustat='undef'"
@@ -5778,6 +6018,7 @@ $ WC "d_vms_do_sockets='" + d_vms_do_sockets + "'" ! VMS
 $ WC "d_void_closedir='define'"
 $ WC "d_volatile='define'"
 $ WC "d_vprintf='define'"
+$ WC "d_vsnprintf='" + d_vsnprintf + "'"
 $ WC "d_wait4='" + d_wait4 + "'"
 $ WC "d_waitpid='define'"
 $ WC "d_wcstombs='" + d_wcstombs + "'"
@@ -5847,7 +6088,8 @@ $ WC "i_fcntl='" + i_fcntl + "'"
 $ WC "i_float='define'"
 $ WC "i_fp='undef'"
 $ WC "i_fp_class='undef'"
-$ WC "i_grp='undef'"
+$ WC "i_gdbm='undef'"
+$ WC "i_grp='" + i_grp + "'"
 $ WC "i_ieeefp='undef'"
 $ WC "i_inttypes='" + i_inttypes + "'"
 $ WC "i_langinfo='" + i_langinfo + "'"
@@ -5894,7 +6136,7 @@ $ WC "i_sysselct='undef'"
 $ WC "i_syssockio='undef'"
 $ WC "i_sysstat='define'"
 $ WC "i_sysstatfs='undef'"
-$ WC "i_sysstatvfs='undef'"
+$ WC "i_sysstatvfs='" + i_sysstatvfs + "'"
 $ WC "i_systime='undef'"
 $ WC "i_systimek='undef'"
 $ WC "i_systimes='undef'"
@@ -5909,7 +6151,7 @@ $ WC "i_termios='undef'"
 $ WC "i_time='define'"
 $ WC "i_unistd='" + i_unistd + "'"
 $ WC "i_ustat='undef'"
-$ WC "i_utime='undef'"
+$ WC "i_utime='" + i_utime + "'"
 $ WC "i_values='undef'"
 $ WC "i_varargs='undef'"
 $ WC "i_vfork='undef'"
@@ -5959,6 +6201,7 @@ $   WC "lseeksize='4'"
 $   WC "lseektype='int'"
 $ ENDIF
 $ WC "mab='" + "'"
+$ WC "mad='undef'"
 $ WC "make='" + make + "'"
 $ WC "malloctype='void *'"
 $ WC "usemallocwrap='" + usemallocwrap + "'"
@@ -6040,10 +6283,22 @@ $ WC "sh='MCR'"
 $ WC "shmattype='" + " '"
 $ WC "shortsize='" + shortsize + "'"
 $ WC "shrplib='define'"
-$ WC "sig_name='" + sig_name + "'"
-$ tmp = "sig_name_init='" + sig_name_init + "'"
-$ WC/symbol tmp
-$ DELETE/SYMBOL tmp
+$ IF (f$length(sig_name) .GE. 244)
+$ THEN
+$     tmp = "sig_name='" + sig_name + "'"
+$     WC/symbol tmp
+$     DELETE/SYMBOL tmp
+$ ELSE
+$     WC "sig_name='" + sig_name + "'"
+$ ENDIF
+$ IF (f$length(sig_name_init) .GE. 244)
+$ THEN
+$     tmp = "sig_name_init='" + sig_name_init + "'"
+$     WC/symbol tmp
+$     DELETE/SYMBOL tmp
+$ ELSE
+$     WC "sig_name_init='" + sig_name_init + "'"
+$ ENDIF
 $ WC "sig_num='" + sig_num + "'"
 $ WC "sig_num_init='" + sig_num_init + "'"
 $ WC "sig_count='" + sig_count + "'"
@@ -6099,6 +6354,7 @@ $ WC "usedl='" + usedl + "'"
 $ WC "usefaststdio='" + usefaststdio + "'"
 $ WC "useieee='" + useieee + "'"                    ! VMS-specific
 $ WC "useithreads='" + useithreads + "'"
+$ WC "usekernelthreads='" + usekernelthreads + "'"     ! VMS-specific
 $ WC "uselargefiles='" + uselargefiles + "'"
 $ WC "uselongdouble='" + uselongdouble + "'"
 $ WC "usemorebits='" + usemorebits + "'"
@@ -6112,6 +6368,7 @@ $ WC "usesecurelog='" + usesecurelog + "'"  ! VMS-specific
 $ WC "usesitecustomize='" + usesitecustomize + "'"
 $ WC "usesocks='undef'"
 $ WC "usethreads='" + usethreads + "'"
+$ WC "usethreadupcalls='" + usethreadupcalls + "'"     ! VMS-specific
 $ WC "usevendorprefix='" + "'" ! try to say no, though we'll be ignored as of MM 5.90_01
 $ WC "usevfork='true'"
 $ WC "usevmsdebug='" + usevmsdebug + "'"     ! VMS-specific
@@ -6163,8 +6420,8 @@ $ WC "d_endprotoent_r='undef'"
 $ WC "d_endpwent_r='undef'"
 $ WC "d_endservent_r='undef'"
 $ WC "d_getgrent_r='undef'"
-$ WC "d_getgrgid_r='undef'"
-$ WC "d_getgrnam_r='undef'"
+$ WC "d_getgrgid_r='" + d_getgrgid_r + "'"
+$ WC "d_getgrnam_r='" + d_getgrnam_r + "'"
 $ WC "d_gethostbyaddr_r='undef'"
 $ WC "d_gethostbyname_r='undef'"
 $ WC "d_gethostent_r='undef'"
@@ -6176,14 +6433,15 @@ $ WC "d_getprotobyname_r='undef'"
 $ WC "d_getprotobynumber_r='undef'"
 $ WC "d_getprotoent_r='undef'"
 $ WC "d_getpwent_r='undef'"
-$ WC "d_getpwnam_r='undef'"
-$ WC "d_getpwuid_r='undef'"
+$ WC "d_getpwnam_r='" + d_getpwnam_r + "'"
+$ WC "d_getpwuid_r='" + d_getpwuid_r + "'"
 $ WC "d_getservbyname_r='undef'"
 $ WC "d_getservbyport_r='undef'"
 $ WC "d_getservent_r='undef'"
 $ WC "d_getspnam_r='undef'"
 $ WC "d_gmtime_r='undef'"      ! leave undef'd; we use my_gmtime
 $ WC "d_localtime_r='undef'"   ! leave undef'd; we use my_localtime
+$ WC "d_localtime_r_needs_tzset='undef'"
 $ WC "d_random_r='undef'"
 $ WC "d_readdir_r='define'"    ! always defined; we roll our own
 $ WC "d_readdir64_r='undef'"
@@ -6194,11 +6452,12 @@ $ WC "d_setnetent_r='undef'"
 $ WC "d_setprotoent_r='undef'"
 $ WC "d_setpwent_r='undef'"
 $ WC "d_setservent_r='undef'"
+$ WC "d_snprintf='" + d_snprintf + "'"
 $ WC "d_srand48_r='undef'"
 $ WC "d_srandom_r='undef'"
 $ WC "d_strerror_r='undef'"
 $ WC "d_tmpnam_r='undef'"
-$ WC "d_ttyname_r='undef'"
+$ WC "d_ttyname_r='" + d_ttyname_r + "'"
 $ WC "ctermid_r_proto='0'"
 $ WC "crypt_r_proto='0'"
 $ WC "drand48_r_proto='0'"
@@ -6209,8 +6468,8 @@ $ WC "endprotoent_r_proto='0'"
 $ WC "endpwent_r_proto='0'"
 $ WC "endservent_r_proto='0'"
 $ WC "getgrent_r_proto='0'"
-$ WC "getgrgid_r_proto='0'"
-$ WC "getgrnam_r_proto='0'"
+$ WC "getgrgid_r_proto='" + getgrgid_r_proto + "'"
+$ WC "getgrnam_r_proto='" + getgrnam_r_proto + "'"
 $ WC "gethostbyaddr_r_proto='0'"
 $ WC "gethostbyname_r_proto='0'"
 $ WC "gethostent_r_proto='0'"
@@ -6244,7 +6503,7 @@ $ WC "srand48_r_proto='0'"
 $ WC "srandom_r_proto='0'"
 $ WC "strerror_r_proto='0'"
 $ WC "tmpnam_r_proto='0'"
-$ WC "ttyname_r_proto='0'"
+$ WC "ttyname_r_proto='" + ttyname_r_proto + "'"
 $!
 $! ##END WRITE NEW CONSTANTS HERE##
 $!
@@ -6415,7 +6674,12 @@ $   MALLOC_REPLACE = "MALLOC="
 $ ENDIF
 $ IF uselargefiles .OR. uselargefiles .EQS. "define"
 $ THEN
-$   LARGEFILE_REPLACE = "LARGEFILE=LARGEFILE=1"
+$   IF usestdstat .or. usestdstat .eqs. "define"
+$   THEN
+$      LARGEFILE_REPLACE = "LARGEFILE=LARGEFILE=_USE_STD_STAT=1"
+$   ELSE
+$      LARGEFILE_REPLACE = "LARGEFILE=LARGEFILE=_LARGEFILE=1"
+$   ENDIF
 $ ELSE
 $   LARGEFILE_REPLACE = "LARGEFILE="
 $ ENDIF
@@ -6423,7 +6687,7 @@ $ echo4 "Extracting ''defmakefile' (with variable substitutions)"
 $ DEFINE/USER_MODE sys$output 'UUmakefile'
 $ mcr []munchconfig 'config_sh' 'Makefile_SH' "''DECC_REPLACE'" "''DECCXX_REPLACE'" "''ARCH_TYPE'" "''GNUC_REPLACE'" -
 "''SOCKET_REPLACE'" "''THREAD_REPLACE'" "''C_Compiler_Replace'" "''MALLOC_REPLACE'" -
-"''Thread_Live_Dangerously'" "PV=''version'" "FLAGS=FLAGS=''extra_flags'" "''LARGEFILE_REPLACE'"
+"''THREAD_UPCALLS'" "''THREAD_KERNEL'" "PV=''version'" "FLAGS=FLAGS=''extra_flags'" "''LARGEFILE_REPLACE'"
 $! Clean up after ourselves
 $ DELETE/NOLOG/NOCONFIRM []munchconfig.exe;
 $!
@@ -6659,9 +6923,25 @@ $ ELSE
 $ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
 $ ENDIF
 $ WRITE CONFIG "$!"
-$ prefix = prefix - "000000."
-$ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN prefix = prefix - "]" + ".]" 
-$ WRITE CONFIG "$ define/translation=concealed ''vms_prefix' ''prefix'"
+$! HP hack to make distributing binaries easier
+$!----------------------------------------------
+$ pcsi_producer = f$trnlnm("PCSI_PRODUCER")
+$ if pcsi_producer .eqs. ""
+$ then
+$   WRITE CONFIG "$ define/translation=concealed ''vms_prefix' ''prefix'"
+$ else
+$  WRITE CONFIG "$ myproc = f$environment(""PROCEDURE"")"
+$  WRITE CONFIG "$ myroot_dev = f$parse(myproc,,,""DEVICE"",""NO_CONCEAL"")"
+$  WRITE CONFIG "$ myroot_dir = f$parse(myproc,,,""DIRECTORY"",""NO_CONCEAL"")"
+$  WRITE CONFIG "$ myroot_dir = myroot_dir - ""][000000."" - ""><000000."""
+$  WRITE CONFIG "$ myroot_dir = myroot_dir - ""][000000]"" - ""><000000>"""
+$  WRITE CONFIG "$ myroot_dir = myroot_dir - ""]["" - ""><"""
+$  WRITE CONFIG "$ myroot_dir = myroot_dir - "".]"" - "".>"" - ""["" - ""]"" - ""<"" - "">"""
+$  WRITE CONFIG "$ if f$trnlnm(""HP_BUILD_PERL_BIN_KIT"",""LNM$PROCESS_TABLE"") .EQS. """""
+$  WRITE CONFIG "$ then"
+$  WRITE CONFIG "$  define/translation=concealed ''vms_prefix' 'myroot_dev'['myroot_dir'.]"
+$  WRITE CONFIG "$ endif"
+$ endif
 $ WRITE CONFIG "$ ext = "".exe"""
 $ IF sharedperl
 $ THEN
@@ -6693,9 +6973,6 @@ $   THEN
 $     WRITE CONFIG "$ set command ''vms_prefix':[000000]''packageup'.CLD"
 $   ENDIF
 $ ENDIF !  perl_symbol
-$ WRITE CONFIG "$ define/nolog pod2text ''vms_prefix':[lib.pod]pod2text.com"
-$ WRITE CONFIG "$ define/nolog pod2html ''vms_prefix':[lib.pod]pod2html.com"
-$ WRITE CONFIG "$ define/nolog pod2man  ''vms_prefix':[lib.pod]pod2man.com"
 $!
 $ IF (tzneedset)
 $ THEN
@@ -6718,16 +6995,15 @@ $ WRITE CONFIG "$ h2ph       == """ + perl_setup_perl + " ''vms_prefix':[utils]h
 $ WRITE CONFIG "$ h2xs       == """ + perl_setup_perl + " ''vms_prefix':[utils]h2xs.com"""
 $ WRITE CONFIG "$ instmodsh  == """ + perl_setup_perl + " ''vms_prefix':[utils]instmodsh.com"""
 $ WRITE CONFIG "$ libnetcfg  == """ + perl_setup_perl + " ''vms_prefix':[utils]libnetcfg.com"""
-$ WRITE CONFIG "$ perlbug    == """ + perl_setup_perl + " ''vms_prefix':[lib]perlbug.com"""
-$ WRITE CONFIG "$!perlcc     == """ + perl_setup_perl + " ''vms_prefix':[utils]perlcc.com"""
-$ WRITE CONFIG "$ perldoc    == """ + perl_setup_perl + " ''vms_prefix':[lib.pod]perldoc.com -t"""
+$ WRITE CONFIG "$ perlbug    == """ + perl_setup_perl + " ''vms_prefix':[utils]perlbug.com"""
+$ WRITE CONFIG "$ perldoc    == """ + perl_setup_perl + " ''vms_prefix':[utils]perldoc.com """"-t"""""""
 $ WRITE CONFIG "$ perlivp    == """ + perl_setup_perl + " ''vms_prefix':[utils]perlivp.com"""
 $ WRITE CONFIG "$ piconv     == """ + perl_setup_perl + " ''vms_prefix':[utils]piconv.com"""
 $ WRITE CONFIG "$ pl2pm      == """ + perl_setup_perl + " ''vms_prefix':[utils]pl2pm.com"""
-$ WRITE CONFIG "$ pod2html   == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2html"""
-$ WRITE CONFIG "$ pod2latex  == """ + perl_setup_perl + " ''vms_prefix':[lib.pod]pod2latex.com"""
-$ WRITE CONFIG "$ pod2text   == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2text"""
-$ WRITE CONFIG "$!pod2man    == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2man"""
+$ WRITE CONFIG "$ pod2html   == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2html.com"""
+$ WRITE CONFIG "$ pod2latex  == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2latex.com"""
+$ WRITE CONFIG "$ pod2text   == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2text.com"""
+$ WRITE CONFIG "$!pod2man    == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2man.com"""
 $ WRITE CONFIG "$ pod2usage  == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2usage.com"""
 $ WRITE CONFIG "$ podchecker == """ + perl_setup_perl + " ''vms_prefix':[utils]podchecker.com"""
 $ WRITE CONFIG "$ podselect  == """ + perl_setup_perl + " ''vms_prefix':[utils]podselect.com"""