Hi,

The enclosed patch incorporates a suggestion that Dan Sugalski had
last week regarding the h_errno mess with DECC 5.3 and this patch
overrides the goofy '#define H_ERRNO_NOT_EXTERN' patch that I had sent
last Tursday or Friday.

This patch also includes Dan's work on configure.com and subconfigure.com
that was already sent in but extends both of them.  There may be merge/patch
conflicts in configure.com and vms/subconfigure.com because of this 
replication.  Please notify me of any trouble encountered.

I've added a few defined($Config{$var}) check into lib/lib.pm to help broken
installations (e.g. those without a good Config.pm) but I have also
added the inc_version_list to VMS' config.sh so that it is not so broken.

This patch includes some changes to descrip_mms.template that: 

   0) invoke @perl_setup before running `perl installperl` as
      part of the `mms install` target.  This alters, though corrects,
      current behavior.  Folks are encouraged to examine perl_root 
      in perl_setup.com before typing `mms install`.  Or at least
      answer the first "Where install?" question that configure.com asks
      carefully.

   1) includes a semi-working install.html target.  The known brokennesses
      at this time include a) --split$foo stuff does not work at all
      owing to filepath mangling b) relative hyperlinks are messed up
      again owing to filepath mangling.

An example of the latter problem can be seen after running `mms install`
and `mms install.html` wherein we find relative links such as:

 <A HREF=".././pod.dir/perlapio.html">perlapio</A>            Perl internal
          ^^^^^^^^^^^^
          this part still needs work on VMS.

BTW - this patched kit still will not build with DECC 6.0 on VMS 7.1
due to the exception caught in by _ckvmssts(retsts); in vms.c:cando_by_name().

Files affected:

  configure.com
  installhtml
  lib/lib.pm
  vms/descrip_mms.template
  vms/subconfigure.com
  vms/vms.c

diff -ru cfgperl_orig/configure.com cfgperl/configure.com
--- cfgperl_orig/configure.com  Fri Mar  3 11:31:03 2000
+++ cfgperl/configure.com       Mon Mar  6 18:22:31 2000
@@ -39,7 +39,7 @@
 $ gcc_symbol = "gcc"
 $ ans = ""
 $ macros = ""
-$ extra_fags = ""
+$ extra_flags = ""
 $ user_c_flags = ""
 $ use_debugging_perl = "y"
 $ use_ieee_math = "n"
@@ -1793,10 +1793,11 @@
 $     echo "If you're a casual user, you probably don't want
 $     echo "interpreter-threads at this time.  There doesn't yet exist
 $     echo "a way to create threads from within Perl in this model,
-$     echo "i.e., "use Thread;" will NOT work.
+$     echo "i.e., ""use Thread;"" will NOT work.
 $     echo "
 $     dflt = "n"
 $     rp = "Build with Interpreter threads? [''dflt']
+$     GOSUB myread
 $     if ans.eqs."" then ans = dflt
 $     if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
 $     THEN
@@ -2184,6 +2185,8 @@
 $   echo ""
 $   echo4 "%Config-I-VMS, The perl.cld file is now being written..."
 $   OPEN/WRITE CONFIG 'file_2_find'
+$   ext = ".exe"
+$   IF ((sharedperl) .AND. (f$getsyi("ARCH_NAME") .NES. "VAX")) THEN ext := .AXE
 $   IF (use_vmsdebug_perl)
 $   THEN
 $     WRITE CONFIG "define verb dbgperl"
diff -ru cfgperl_orig/installhtml cfgperl/installhtml
--- cfgperl_orig/installhtml    Thu Jan 13 01:35:32 2000
+++ cfgperl/installhtml Mon Mar  6 19:06:05 2000
@@ -159,6 +159,10 @@
 
 usage("") unless @ARGV;
 
+# Overcome shell's p1,..,p8 limitation.  
+# See vms/descrip_mms.template -> descrip.mms for invokation.
+if ( $^O eq 'VMS' ) { @ARGV = split(/\s+/,$ARGV[0]); }
+
 # parse the command-line
 $result = GetOptions( qw(
        help
diff -ru cfgperl_orig/lib/lib.pm cfgperl/lib/lib.pm
--- cfgperl_orig/lib/lib.pm     Tue Feb  8 12:58:37 2000
+++ cfgperl/lib/lib.pm  Mon Mar  6 18:21:18 2000
@@ -3,9 +3,10 @@
 use 5.005_64;
 use Config;
 
-my $archname = $Config{'archname'};
-my $ver = $Config{'version'};
-my @inc_version_list = reverse split / /, $Config{'inc_version_list'};
+my $archname = defined($Config{'archname'}) ? $Config{'archname'} : '';
+my $ver = defined($Config{'version'}) ? $Config{'version'} : '';
+my @inc_version_list = defined($Config{'inc_version_list'}) ?
+   reverse split / /, $Config{'inc_version_list'} : ();
 
 our @ORIG_INC = @INC;  # take a handy copy of 'original' value
 our $VERSION = '0.5564';
diff -ru cfgperl_orig/vms/descrip_mms.template cfgperl/vms/descrip_mms.template
--- cfgperl_orig/vms/descrip_mms.template       Fri Mar  3 11:33:13 2000
+++ cfgperl/vms/descrip_mms.template    Mon Mar  6 18:57:43 2000
@@ -799,10 +799,10 @@
        @ If F$Search("[.lib]pod.dir").eqs."" Then Create/Directory [.lib.pod]
        Copy/Log $(MMS$SOURCE) $(MMS$TARGET)
 
-install.html : []perl_setup.com installhtml. install $(perlpods)
-       @ @perl_setup
-       @ If F$Search("[.lib]html.dir").eqs."" Then Create/Directory [.lib.html]
-       $(MINIPERL) installhtml. "--podroot=/perl_root --recurse --htmldir=lib/html 
--htmlroot=lib/html --splithead=pod/perlipc --splititem=pod/perlfunc 
--libpods=perlfunc:perlguts:perlvar:perlrun:perlop --verbose"
+install.html : $(perlpods)
+       @ @perl_setup.com
+       @ If F$Search("perl_root:[lib]html.dir").eqs."" Then Create/Directory 
+perl_root:[lib.html]
+       $(MINIPERL) installhtml. "--podroot=. --recurse --htmldir=/perl_root/lib/html 
+--htmlroot=.. --verbose"
 
 printconfig :
         @ @[.vms]make_command $(MMS) $(MMSQUALIFIERS) $(MMSTARGETS)
@@ -882,6 +882,7 @@
 # install ought not need a source, but it doesn't work if one's not
 # there. Go figure...
 install : $(MINIPERL_EXE)
+       @ @perl_setup.com
        If F$TrnLnm("Sys") .nes. "" Then Deass SYS
        $(MINIPERL) installperl
 
diff -ru cfgperl_orig/vms/subconfigure.com cfgperl/vms/subconfigure.com
--- cfgperl_orig/vms/subconfigure.com   Fri Mar  3 11:33:20 2000
+++ cfgperl/vms/subconfigure.com        Mon Mar  6 18:22:52 2000
@@ -84,6 +84,8 @@
 $ perl_d_iconv="undef"
 $ perl_d_madvise="undef"
 $ perl_selectminbits=32
+$ perl_d_vendorarch="define"
+$ perl_vendorarchexp=""
 $ perl_d_msync="undef"
 $ perl_d_mprotect="undef"
 $ perl_d_munmap="undef"
@@ -1034,6 +1036,53 @@
 $   ENDIF
 $ WRITE_RESULT "i_inttypes is ''perl_i_inttypes'"
 $!
+$! Check for h_errno
+$!
+$ OS
+$ WS "#ifdef __DECC
+$ WS "#include <stdlib.h>
+$ WS "#endif
+$ WS "#include <stdio.h>
+$ WS "#include <unistd.h>
+$ WS "#include <netdb.h>
+$ WS "int main()
+$ WS "{"
+$ WS "h_errno = 3;
+$ WS "exit(0);
+$ WS "}"
+$ CS
+$   DEFINE SYS$ERROR _NLA0:
+$   DEFINE SYS$OUTPUT _NLA0:
+$   on error then continue
+$   on warning then continue
+$   'Checkcc' temp.c
+$   savedstatus = $status
+$   teststatus = f$extract(9,1,savedstatus)
+$   if (teststatus.nes."1")
+$   THEN
+$     perl_d_herrno="undef"
+$     DEASSIGN SYS$OUTPUT
+$     DEASSIGN SYS$ERROR
+$   ELSE
+$     If (Needs_Opt)
+$     THEN
+$       link temp.obj,temp.opt/opt
+$     else
+$       link temp.obj
+$     endif
+$     savedstatus = $status
+$     teststatus = f$extract(9,1,savedstatus)
+$     DEASSIGN SYS$OUTPUT
+$     DEASSIGN SYS$ERROR
+$     if (teststatus.nes."1")
+$     THEN
+$       perl_d_herrno="undef"
+$     ELSE
+$       perl_d_herrno="define"
+$     ENDIF
+$   ENDIF
+$ WRITE_RESULT "d_herrno is ''perl_d_herrno'"
+$!
 $! Check to see if int64_t exists
 $!
 $ OS
@@ -3536,7 +3585,7 @@
 $ gosub type_size_check
 $ perl_u32size="''line'"
 $
-$ If use_64bitint
+$ If use64bitint
 $ Then
 $   type = "''perl_i64type'"
 $   size_name = "i64size"
@@ -4103,6 +4152,7 @@
 $ WC "d_llseek='" + perl_d_llseek + "'"
 $ WC "d_iconv='" + perl_d_iconv +"'"
 $ WC "i_iconv='" + perl_i_iconv +"'"
+$ WC "inc_version_list='0'"
 $ WC "inc_version_list_init='0'"
 $ WC "uselargefiles='" + perl_uselargefiles + "'"
 $ WC "uselongdouble='" + perl_uselongdouble + "'"
@@ -4120,6 +4170,8 @@
 $ WC "d_statfs_f_flags='" + perl_d_statfs_f_flags + "'"
 $ WC "d_statfs_s='" + perl_d_statfs_s + "'"
 $ WC "d_ustat='" + perl_d_ustat + "'"
+$ WC "d_vendorarch='" + perl_d_vendorarch + "'"
+$ WC "vendorarchexp='" + perl_vendorarchexp + "'"
 $ WC "i_sysstatfs='" + perl_i_sysstatfs + "'"
 $ WC "i_sysvfs='" + perl_i_sysvfs + "'"
 $ WC "i_ustat='" + perl_i_ustat + "'"
@@ -4241,6 +4293,10 @@
 $ then
 $    write config "#define VMS_WE_ARE_CASE_SENSITIVE"
 $ endif
+$ if perl_d_herrno .eqs. "undef"
+$ THEN
+$    write config "#define NEED_AN_H_ERRNO"
+$ ENDIF
 $ WRITE CONFIG "#define HAS_ENVGETENV"
 $ WRITE CONFIG "#define PERL_EXTERNAL_GLOB"
 $ CLOSE CONFIG
diff -ru cfgperl_orig/vms/vms.c cfgperl/vms/vms.c
--- cfgperl_orig/vms/vms.c      Fri Mar  3 11:33:23 2000
+++ cfgperl/vms/vms.c   Mon Mar  6 18:23:26 2000
@@ -68,6 +68,9 @@
 #  define prv$v_sysprv  prv$r_prvdef_bits0.prv$v_sysprv
 #endif
 
+#if defined(NEED_AN_H_ERRNO)
+dEXT int h_errno;
+#endif
 
 struct itmlst_3 {
   unsigned short int buflen;
End of Patch.

Peter Prymmer

Reply via email to