NetWare update from Ananth Kesari.
Jarkko Hietaniemi [Fri, 31 May 2002 13:12:51 +0000 (13:12 +0000)]
p4raw-id: //depot/perl@16922

20 files changed:
MANIFEST
NetWare/Makefile
NetWare/Nwmain.c
NetWare/bat/BldNWExt-Exist.bat [deleted file]
NetWare/bat/BldNWExt.bat [deleted file]
NetWare/bat/CWbuild.bat [deleted file]
NetWare/bat/MPKBuild.bat [deleted file]
NetWare/bat/SetCodeWar.bat [new file with mode: 0644]
NetWare/bat/SetNWDef.bat [deleted file]
NetWare/bat/Setcw.bat [deleted file]
NetWare/bat/Setmpksdk.bat [deleted file]
NetWare/bat/ToggleXDC.bat [deleted file]
NetWare/nw5.c
README.netware
ext/DynaLoader/DynaLoader_pm.PL
lib/ExtUtils/MM_NW5.pm
lib/ExtUtils/t/MM_NW5.t [new file with mode: 0644]
lib/File/Spec/NW5.pm [new file with mode: 0644]
makedef.pl
toke.c

index 881adf9..f61d77b 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1946,18 +1946,11 @@ mpeix/nm                        MPE/iX port
 mpeix/relink                   MPE/iX port
 mv-if-diff                     Script to mv a file if it changed
 myconfig.SH                    Prints summary of the current configuration
-NetWare/bat/BldNWExt-Exist.bat NetWare port
-NetWare/bat/BldNWExt.bat       NetWare port
 NetWare/bat/Buildtype.bat      NetWare port
-NetWare/bat/CWbuild.bat                NetWare port
-NetWare/bat/MPKBuild.bat       NetWare port
-NetWare/bat/Setcw.bat          NetWare port
-NetWare/bat/Setmpksdk.bat      NetWare port
+NetWare/bat/SetCodeWar.bat     NetWare port
 NetWare/bat/Setnlmsdk.bat      NetWare port
 NetWare/bat/SetNWBld.bat       NetWare port
-NetWare/bat/SetNWDef.bat       NetWare port
 NetWare/bat/ToggleD2.bat       NetWare port
-NetWare/bat/ToggleXDC.bat      NetWare port
 NetWare/CLIBsdio.h             NetWare port
 NetWare/CLIBstr.h              NetWare port
 NetWare/CLIBstuf.c             NetWare port
index aae82e7..bb40515 100644 (file)
@@ -14,8 +14,8 @@
 
 ## This file is created by using the makefile that creates Windows Perl as the reference
 ## Author:
-## Date Created: 25th March 2002
-## Date Modified: 
+## Date Created: 13th July 2000
+## Date Modified: 21st March 2002
 # Name of the NLM
 
 
@@ -34,47 +34,59 @@ DEB_DIR = Debug
 
 
 !ifndef MAKE_TYPE
-#MAKE_TYPE = Release
+!ifndef NLMSDKBASE
+!message "Run bat\SetNWBld.bat to set the NetWare SDK before continuing.\n"
+!error
+!endif                                                                                 # !ifndef NLMSDKBASE
+
+!ifndef CODEWAR                                                                        # !ifdef CODEWAR
+!message "CodeWarrior tools base directory is not defined. Run bat\setnwbld.bat before proceeding"
+!error
+!endif                                                                                 # !ifdef CODEWAR
+
+!ifndef MAKE_TYPE
 !message "Run bat\buildtype.bat to set the build type before continuing.\n"
 !error
-!endif                                                                                                                         #!ifndef MAKE_TYPE
+!endif                                                                                 # !ifndef MAKE_TYPE
 
 !ifdef USE_MPK
 MPKFLAGS       = -DMPK_ON -DIAPX386
 MPKMESSAGE = MPK Build...
 XDCTOOL        = mpkxdc
 !ifndef MPKBASE
-#MPKBASE                       = p:\mpk
-!message "Run bat\setnwbld.bat to set the NetWare MPK SDK before continuing.\n"
-!endif                                                                                                                         #ifndef MPKBASE
+!message "Run bat\setmpksdk.bat to set the NetWare MPK SDK before continuing.\n"
+!error
+!endif                                                                                 # !ifndef MPKBASE
 NLM_INCLUDE_MP         = -I$(MPKBASE)\include
 MPKTOOL = $(MPKBASE)\$(XDCTOOL)
-!else
+!else                                                                                  # !ifdef USE_MPK
 MPKMESSAGE = Non MPK Build...
 NLM_INCLUDE_MP =
 MPKTOOL = 
-!endif                                 #ifdef USE_MPK
+!endif                                                                                 # !ifdef USE_MPK
+
+#!ifndef SECURITYBASE
+#!message "Run bat\SetSecSdk.bat to set the Security path before continuing.\n"
+#!error
+#!endif                                                                                        # !ifndef SECURITYBASE
+
+#!ifndef UCSINC
+#!message "Run bat\BldNWExt.bat to set the UCS Include path before continuing.\n"
+#!error
+#!endif                                                                                        # !ifndef UCSINC
+
+NLMIMPORTS                     = $(NLMSDKBASE)\imports
+
+!ifdef SECURITYBASE
+SECURITY_IMPORTS       = $(SECURITYBASE)\imports
+!endif                                                                                 # !ifdef SECURITYBASE
 
 !ifndef NLM_VERSION
 NLM_VERSION    = 3,20,0
 !endif
 
-!ifndef NLMSDKBASE
-#NLMSDKBASE            = P:\ndk\nwsdk
-!message "Run bat\setnwbld.bat to set the NetWare SDK before continuing.\n"
-!error
-!endif                                                                                                         #ifndef NLMSDKBASE
-UCSINC          = p:\apps\script\sw\ucs-inc
-NLMIMPORTS      = $(NLMSDKBASE)\imports
-
-!ifndef SECURITYBASE
-SECURITYBASE           = P:\apps\script\sw\nwsec
-!message "Run bat\SetSecSdk.bat to set the Security paths before continuing.\n"
-#!error
-!endif                                                                                                                         #!ifndef MAKE_TYPE
-SECURITY_IMPORTS       = $(SECURITYBASE)\imports
 
-    # Here comes the CW tools - TO BE FILLED TO BUILD WITH CW -
+# Here comes the CW tools - TO BE FILLED TO BUILD WITH CW -
 MODULE_DESC     = "Perl 5.8.0 for NetWare"
 CCTYPE          = CodeWarrior
 C_COMPILER             = mwccnlm -c
@@ -86,15 +98,14 @@ TOOL_HEADERS        =
 TOOL_PATH              = 
 CWCPPFLAGS      = -cpp_exceptions on -wchar_t off -bool on -w on -ansi off
 CCFLAGS                        = -maxerrors 25 -processor Pentium -align packed \
-                  -w nounusedarg -msext on -sym on -sym codeview4 -sym internal \
+                  -w nounusedarg -msext on \
                   -DN_PLAT_NLM -DNLM=1 -D__NO_MATH_OPS -msgstyle gcc
 COMPILER_FLAG  = -d NETWARE
 ERROR_FLAG             = -sym on -sym codeview4 -sym internal
 LDFLAGS         = -type generic -stacksize 16384 -zerobss \
                   -nofail -msgstyle gcc -nostderr -w on \
                   -nlmversion $(NLM_VERSION) \
-                  -copy "Copyright (C) 2000-01\, 2002 Novell\, Inc. All Rights Reserved." \
-                  -sym on -sym codeview4 -sym internal -osym perl.sym
+                  -copy "Copyright (C) 2000-01\, 2002 Novell\, Inc. All Rights Reserved."
 
 # Debug flags comes here - Not mandatory - required only for debug build
 !if "$(MAKE_TYPE)"=="Debug"
@@ -103,22 +114,27 @@ BLDMESG       = Debug version,
 !ifdef USE_D2
 BS_CFLAGS      = -opt off -inline off -sym on -sym codeview4 -sym internal -DDEBUGGING -DDKFBPON
 BLDMESG                = $(BLDMESG) Using /d2 option
-##LDFLAGS              = $(LDFLAGS) -sym on -sym codeview4 -sym internal -osym $(BLDDIR)\$*.sym
-LDFLAGS                = $(LDFLAGS) -sym on -sym codeview4 -sym internal
-## -osym $(BLDDIR)\$(NLM_NAME8).sym
-!else
+!ifdef NLM_NAME8
+LDFLAGS                = $(LDFLAGS) -sym on -sym codeview4 -sym internal -osym $(NLM_NAME8).sym
+!else                                                                                          # !ifdef NLM_NAME8
+LDFLAGS                = $(LDFLAGS) -sym on -sym codeview4 -sym internal -osym $(NLM_NAME).sym
+!endif                                                                                         # !ifdef NLM_NAME8
+!else                                                                                          # !ifdef USE_D2
 BS_CFLAGS      = -opt off -inline off -sym on -sym codeview4 -sym internal -DDEBUGGING -DDKFBPON
 BLDMESG                = $(BLDMESG) Using /d1 option
-##LDFLAGS              = $(LDFLAGS) -sym on -sym codeview4 -sym internal -osym $(BLDDIR)\$*.sym
-LDFLAGS                = $(LDFLAGS) -sym on -sym codeview4 -sym internal
-## -osym $(BLDDIR)\$(NLM_NAME8).sym
-!endif                                                                                 #!ifdef USE_D2  
-!else
+!ifdef NLM_NAME8
+LDFLAGS                = $(LDFLAGS) -sym on -sym codeview4 -sym internal -osym $(NLM_NAME8).sym
+!else                                                                                          # !ifdef NLM_NAME8
+LDFLAGS                = $(LDFLAGS) -sym on -sym codeview4 -sym internal -osym $(NLM_NAME).sym
+!endif                                                                                         # !ifdef NLM_NAME8
+!endif                                                                                         # !ifdef USE_D2
+!else                                                                                          # !if "$(MAKE_TYPE)"=="Debug"
 BLDDIR      = $(REL_DIR)
 BLDMESG                = Release version
 ##BS_CFLAGS    = -opt speed -inline smart -inline auto -sym off
 BS_CFLAGS      = 
-!endif                                                                                         #if "$(MAKE_TYPE)"=="Debug"                                                                                             #!ifdef CODEWARRIOR
+!endif                                                                                         # !if "$(MAKE_TYPE)"=="Debug"
+
 
 ADD_LOCDEFS =  -DPERL_CORE
 
@@ -126,16 +142,35 @@ NLM_INCLUDE                       = -I$(NLMSDKBASE)\include
 NLM_INCLUDE_NLM                = -I$(NLMSDKBASE)\include\nlm
 NLM_INCLUDE_NLM_SYS = -I$(NLMSDKBASE)\include\nlm\sys
 NLM_INCLUDE_OBSLETE = -I$(NLMSDKBASE)\include\nlm\obsolete
-# SECURITY_INCLUDE     = -I$(SECURITYBASE)\include
+
+!ifdef SECURITYBASE
+SECURITY_INCLUDE       = -I$(SECURITYBASE)\include
+!endif                                                                                 #!ifdef SECURITYBASE
+
+!ifdef UCSINC
 NLM_INCLUDE_UCS     = -I$(UCSINC)
+!endif                                                                                 #!ifndef UCSINC
+
 !if "$(NW_EXTNS)"=="yes" 
 INCLUDE_NW          = -I.\include
 !endif
+
+
 INC_PREV                       = -I..
 INC_THIS                       = -I.
 
+
 NLM_INCLUDE_PATH = $(NLM_INCLUDE) $(NLM_INCLUDE_NLM) $(NLM_INCLUDE_NLM_SYS) $(NLM_INCLUDE_OBSLETE) \
-                   $(NLM_INCLUDE_MP) $(NLM_INCLUDE_UCS) $(TOOL_HEADERS) 
+                   $(NLM_INCLUDE_MP) $(TOOL_HEADERS)
+
+!ifdef SECURITYBASE
+NLM_INCLUDE_PATH = $(NLM_INCLUDE_PATH) $(SECURITY_INCLUDE)
+!endif                                                                                 #!ifdef SECURITYBASE
+
+!ifdef UCSINC
+NLM_INCLUDE_PATH = $(NLM_INCLUDE_PATH) $(NLM_INCLUDE_UCS)
+!endif                                                                                 #!ifndef UCSINC
+
 INCLUDE = $(INC_THIS) $(INC_PREV) -I- $(NLM_INCLUDE_PATH)
 
 PATH = $(PATH);$(TOOL_PATH)
@@ -177,6 +212,7 @@ CLIB_H_FILES                =       \
 
 NW_SRC                         =       \
                                                .\CLIBstuf.c    \
+                                               .\sv_nw.c               \
                                                .\nw5.c         \
                                                .\nw5sck.c      \
                                                .\nw5thread.c \
@@ -297,6 +333,14 @@ XSTYPEMAP_NLM              = $(EXTDIR)\XS\Typemap\Typemap.NLM
 UNICODENORMALIZE_NLM   = $(EXTDIR)\Unicode\Normalize\Normalize.NLM
 
 EXTENSION_NLM  =               \
+               $(FCNTL_NLM)    \
+               $(BYTELOADER_NLM)       \
+               $(IO_NLM)               \
+               $(SOCKET_NLM)   \
+               $(OPCODE_NLM)   \
+               $(B_NLM)                \
+               $(ATTRS_NLM)    \
+               $(SDBM_FILE_NLM)        \
                $(POSIX_NLM)    \
                $(THREAD_NLM)   \
                $(DUMPER_NLM)   \
@@ -310,17 +354,10 @@ EXTENSION_NLM     =               \
                $(LISTUTIL_NLM)         \
                $(MIMEBASE64_NLM)       \
                $(XSTYPEMAP_NLM)        \
-               $(FCNTL_NLM)    \
-               $(SOCKET_NLM)   \
-               $(OPCODE_NLM)   \
-               $(B_NLM)                \
-               $(ATTRS_NLM)    \
-               $(BYTELOADER_NLM)       \
-               $(IO_NLM)               \
-               $(UNICODENORMALIZE_NLM)   \
-               $(SDBM_FILE_NLM)        
-# Begin - Following is required to build NetWare specific extensions CGI2Perl, Perl2UCS and UCSExt
+               $(UNICODENORMALIZE_NLM)  \
+               $(FILTER_NLM)   
 
+# Begin - Following is required to build NetWare specific extensions CGI2Perl, Perl2UCS and UCSExt
 CGI2PERL               = CGI2Perl\CGI2Perl
 PERL2UCS               = $(EXTDIR)\Perl2UCS\Perl2UCS
 UCSExt                 = $(EXTDIR)\Perl2UCS\UCSExt
@@ -331,12 +368,11 @@ UCSExt_NLM = $(AUTODIR)\UCSExt\UCSExt.NLM
 
 NETWARE_EXTNS =        \
                $(CGI2PERL_NLM) \
-               $(UCSExt_NLM)   \
                $(PERL2UCS_NLM) \
-
-
+               $(UCSExt_NLM)
 # End
 
+
 ECHO_SRC                       = TestNLM\echo\echo.c
 TYPE_SRC                       = TestNLM\type\type.c
 ECHO_SRC_OBJ                   = $(ECHO_SRC:.c=.obj)
@@ -371,9 +407,13 @@ BUILT     = $(BLDDIR)\$(NLM_NAME8).$(NLM_EXT)
 
 !ifndef BASE_IMPORT_FILES
 BASE_IMPORT_FILES = Import @$(NLMIMPORTS)\clib.imp, @$(NLMIMPORTS)\nlmlib.imp, @$(NLMIMPORTS)\threads.imp, @$(NLMIMPORTS)\nit.imp, @$(NLMIMPORTS)\socklib.imp, \
-@$(NLMIMPORTS)\fpsm.imp, @$(NLMIMPORTS)\lib0.imp, @$(SECURITY_IMPORTS)\nwsec.imp
+@$(NLMIMPORTS)\fpsm.imp, @$(NLMIMPORTS)\lib0.imp
 !endif
 
+!ifdef SECURITYBASE
+BASE_IMPORT_FILES = $(BASE_IMPORT_FILES), @$(SECURITY_IMPORTS)\nwsec.imp
+!endif                                                                                 # !ifdef SECURITYBASE
+
 !ifdef USE_MPK
 BASE_IMPORT_FILES = $(BASE_IMPORT_FILES), @$(MPKBASE)\import\mpkorg.imp
 !endif
@@ -381,18 +421,26 @@ BASE_IMPORT_FILES = $(BASE_IMPORT_FILES), @$(MPKBASE)\import\mpkorg.imp
 !ifndef BASE_IMPORT_FNS
 BASE_IMPORT_FNS = Import ImportSymbol, GetSystemConsoleScreen, LoadModule
 !endif
-                                                                                                                               
-                                                                                                                               
+
+!ifdef CODEWAR
+NWLIBPATH  = 
+LIBPATH386 = 
+LIBPATH = 
+!else                                                                                  # !ifdef CODEWAR
+!error Please define the tools base directory before proceeding
+!endif                                                                                 # !ifdef CODEWAR
+
 !ifndef BASE_LIBRARIES
-#!ifdef WATCOM
-#BASE_LIBRARIES = Library plib3s.lib,math3s.lib,clib3s.lib
-#!else
+!ifdef WATCOM
+BASE_LIBRARIES = Library plib3s.lib, math3s.lib, clib3s.lib
+!endif                                                                                 # !ifdef WATCOM
 !ifdef CODEWAR
 BASE_LIBRARIES = 
-!endif                                                                                                                         #!ifdef CODEWARRIOR
-!endif                                                                                                                         
-                                                                                                                               
-COPYRIGHT = (C) Copyright 2002 Novell Inc. All Rights Reserved.
+!endif                                                                                 # !ifdef CODEWAR
+!endif                                                                                 # !ifndef BASE_LIBRARIES
+
+
+COPYRIGHT = Copyright (C) 2000-01, 2002 Novell, Inc. All Rights Reserved.
 
 EXPORTS = Export @perl.imp
 
@@ -667,8 +715,7 @@ NULL                =
 #
 # filenames given to xsubpp must have forward slashes (since it puts
 # full pathnames in #line strings)
-XSUBPP         = ..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp \
-               -C++ -prototypes
+XSUBPP         = ..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp -C++ -prototypes
 
 MICROCORE_SRC  =               \
                ..\av.c         \
@@ -838,7 +885,7 @@ POD2TEXT    = $(PODDIR)\pod2text
 # Top targets
 #
 
-all : .cleanoldfiles .\nwconfig.h $(CONFIGPM) $(NLM_NAME) $(EXTENSION_NPM) $(NETWARE_EXTNS) $(TEST_NLMS) $(EXTENSION_NLM) 
+all : .cleanoldfiles .\nwconfig.h $(CONFIGPM) $(NLM_NAME) $(EXTENSION_NLM) $(EXTENSION_NPM) $(TEST_NLMS) $(NETWARE_EXTNS)
 
 #------------------------------------------------------------
 
@@ -868,6 +915,7 @@ $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
        if exist include\* $(RCOPY) include $(COREDIR)\*.*
        $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \
            || $(MAKE) /$(MAKEFLAGS) $(CONFIGPM)
+        @echo CONFIGPM Done
 
 $(MINIPERL) : 
        $(error)Please build $(MINIPERL) before continuing
@@ -924,7 +972,7 @@ HEADERS :
        @copy << stdio.h >\nul
 
 /*
- * (C) Copyright 2002 Novell Inc. All Rights Reserved.
+ * Copyright (C) 2000-01 Novell, Inc. All Rights Reserved.
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Artistic License, as specified in the README file.
@@ -961,7 +1009,7 @@ HEADERS :
        @copy << string.h >\nul
 
 /*
- * (C) Copyright 2002 Novell Inc. All Rights Reserved.
+ * Copyright (C) 2000-01 Novell, Inc. All Rights Reserved.
  *
  * You may distribute under the terms of either the GNU General Public
  * License or the Artistic License, as specified in the README file.
@@ -1003,7 +1051,9 @@ $(NLM_NAME): MESSAGE HEADERS $(BLDDIR)\nul $(NLM_OBJ) $(NEWTARE_OBJ_DEP) $(NEWTA
        @echo $(BASE_IMPORT_FILES) > $*.def
        @echo MODULE clib >> $*.def
        @echo MODULE netdb >> $*.def
-#   @echo MODULE nwsec >> $*.def
+!ifdef SECURITYBASE
+   @echo MODULE nwsec >> $*.def
+!endif                                                                                 #!ifdef SECURITYBASE
        @echo $(EXPORTS) >> $*.def
 !ifdef USE_XDC
        @echo======= Creating XDC file
@@ -1021,13 +1071,15 @@ $(NLM_NAME): MESSAGE HEADERS $(BLDDIR)\nul $(NLM_OBJ) $(NEWTARE_OBJ_DEP) $(NEWTA
        copy splittree.pl .. 
        $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
        @echo ========Linked $@ ==========
-##!if "$(MAKE_TYPE)"=="Debug"
-##!ifdef NLM_NAME8
-##     .\bat\cvpack $(BLDDIR)\$(NLM_NAME8).sym
-##!else
-##     .\bat\cvpack $(BLDDIR)\$(NLM_NAME).sym
-##!endif
-##!endif
+
+!if "$(MAKE_TYPE)"=="Debug"
+!ifdef NLM_NAME8
+       .\bat\cvpack $(BLDDIR)\$(NLM_NAME8).sym
+!else
+       .\bat\cvpack $(BLDDIR)\$(NLM_NAME).sym
+!endif
+!endif
+
        @echo======= Finished building $(BUILT).
 
 # Create the debug or release directory if not existing
@@ -1040,6 +1092,11 @@ MESSAGE:
        @echo======= $(MAKE_ACTION)ing $(NLM_NAME) at $(MAKEDIR)\$(BLDDIR) ======= 
   
 $(PERLIMPLIB): perllib.imp
+#    @echo Building $(PERLIMPLIB)...
+#    $(LD) -type library $(NLM_OBJ) $(BLDDIR)\nw5.obj $(BLDDIR)\nwmain.obj $(BLDDIR)\nw5thread.obj $(BLDDIR)\nwtinfo.obj \
+#    $(BLDDIR)\nwutil.obj $(BLDDIR)\interface.obj $(BLDDIR)\perllib.obj $(PERL_IO_OBJ_DEP) $(DLL_OBJ) -o $@
+#      $(XCOPY) $(PERLIMPLIB) $(COREDIR)
+#      @echo $(PERLIMPLIB) Done
 
 perllib.imp : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
 #      $(MINIPERL) -w ..\makedef.pl PLATFORM=netware FILETYPE=def $(ADD_BUILDOPT) \
@@ -1110,7 +1167,7 @@ $(EXT_MAIN_OBJ) : $(CLIB_H_FILES)
        -del /f /q ..\lib\core
 
 .\nwconfig.h : $(NW_CFGH_TMPL)
-       -del /f /q config.h
+       @if exist .\config.h del /f /q .\config.h
        copy $(NW_CFGH_TMPL) config.h
 
 # REQUIRED WHEN WE INCLUDE CONFIGPM OR REGEN_CONFIG - sgp
@@ -1336,10 +1393,10 @@ nwclean:
        -rmdir /s /q $(DEB_DIR)
        @if exist .\stdio.h del /f /q .\stdio.h
        @if exist .\string.h del /f /q .\string.h
-       @if exist .\Main.obj del /f /q .\Main.obj
-       @if exist .\Main.lib del /f /q .\Main.lib
+       @if exist .\config.h del /f /q .\config.h
        @if exist .\config.nw5 del /f /q .\config.nw5
        @if exist .\perl.imp del /f /q .\perl.imp
+       -del /f /q *.obj *.lib *.def *.sym *.map *.xdc *.err
        cd testnlm\echo
        -del /f /q *.obj *.map *.link *.options *.nlm *.sym *.xdc *.err
        cd ..\type
@@ -1365,10 +1422,12 @@ utils: $(BLDDIR)\$(NLM_NAME8).$(NLM_EXT) $(X2P)
 
 distclean: clean nwclean
        -del /f /q $(PERLIMPLIB) ..\miniperl.lib $(MINIMOD)
-       -del /f /q *.def *.map
        -del /f /q $(EXTENSION_NPM)
        -del /f /q $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm
        -del /f /q $(EXTDIR)\DynaLoader\dl_netware.xs
+       -del /f /q $(EXTDIR)\DynaLoader\dl_win32.xs
+       -del /f /q $(EXTDIR)\DynaLoader\DynaLoader.pm
+       -del /f /q $(EXTDIR)\DynaLoader\XSLoader.pm
        -del /f /q $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
        -del /f /q $(LIBDIR)\XSLoader.pm
        -del /f /q $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
@@ -1391,14 +1450,14 @@ distclean: clean nwclean
        cd ..\netware
        cd ..\x2p
        -del /f /q find2perl s2p
-       -del /f /q *.bat
+       -del /f /q *.bat *.exe
        -del /f /q *.obj *.map *.link *.xdc *.err
        cd ..\netware
        -del /f /q ..\config.sh ..\splittree.pl dlutils.c config.h.new
        -del /f /q $(CONFIGPM)
        -del /f /q bin\*.bat
        cd $(EXTDIR)
-       -del /s /f /q *.lib *.def *.map *.pdb *.bs Makefile *$(o) pm_to_blib *.xdc *.err
+    -del /s /f /q *.lib *.def *.map *.pdb *.bs Makefile *$(o) pm_to_blib *.xdc *.err
        cd ..\netware
 !if "$(NW_EXTNS)"=="yes"
        cd cgi2perl
@@ -1418,7 +1477,10 @@ distclean: clean nwclean
 installwin:
        $(MINIPERL) -I..\lib ..\installperl
 
-install : utils installwin
+install : utils installwin perlimp
+
+perlimp :
+       copy perl.imp $(INST_COREDIR)
 
 installnw:
        $(MINIPERL) -I..\lib ..\installperl -netware
index 219ab6c..b49fc80 100644 (file)
@@ -529,7 +529,6 @@ void fnLaunchPerl(void* context)
 
        errno = 0;
 
-
        if (psdata->m_fromConsole)
        {
                // get the default working directory name
@@ -548,12 +547,10 @@ void fnLaunchPerl(void* context)
        if (psdata->m_fromConsole)
                chdir(defaultDir);
 
-
        // run the script
        //
        fnRunScript(psdata);
 
-
        // May have to check this, I am blindly calling UCSTerminate, irrespective of
        // whether it is initialized or not
        // Copied from the previous Perl - sgp - 31st Oct 2000
@@ -565,7 +562,6 @@ void fnLaunchPerl(void* context)
                        (*ucsterminate)();
        }
 
-
        if (psdata->m_fromConsole)
        {
                // change thread groups for the call to free the memory
@@ -607,7 +603,6 @@ void fnLaunchPerl(void* context)
 //             ExitThread(EXIT_THREAD, 0);
        #endif
 
-
        return;
 }
 
@@ -654,13 +649,11 @@ void fnRunScript(ScriptData* psdata)
        int stderr_fd=-1, stderr_fd_dup=-1;
 
 
-
        // Main callback instance
        //
        if (fnRegisterWithThreadTable() == FALSE)
                return;
 
-
        // parse the command line into argc/argv style:
        // number of params and char array of params
        //
@@ -671,7 +664,6 @@ void fnRunScript(ScriptData* psdata)
                return;
        }
 
-
        // Initialise the variables
        pclp->m_isValid = TRUE;
        pclp->m_redirInName = NULL;
@@ -694,7 +686,6 @@ void fnRunScript(ScriptData* psdata)
        pclp->m_argc = 0;
        pclp->m_argv_len = 1;
 
-
        // Allocate memory
        pclp->m_argv = (char **) malloc(pclp->m_argv_len * sizeof(char *));
        if (pclp->m_argv == NULL)
@@ -719,7 +710,6 @@ void fnRunScript(ScriptData* psdata)
                return;
        }
 
-
        // Parse the command line
        fnCommandLineParser(pclp, (char *)psdata->m_commandLine, FALSE);
        if (!pclp->m_isValid)
@@ -771,7 +761,6 @@ void fnRunScript(ScriptData* psdata)
                        pclp->m_redirBothName = NULL;
                }
 
-
                // Signal a semaphore, if indicated by "-{" option, to indicate that
                // the script has terminated and files are closed
                //
@@ -791,7 +780,6 @@ void fnRunScript(ScriptData* psdata)
                return;
        }
 
-
        // Simulating a shell on NetWare can be difficult. If you don't
        // create a new screen for the script to run in, you can output to
        // the console but you can't get any input from the console. Therefore,
@@ -840,7 +828,6 @@ void fnRunScript(ScriptData* psdata)
        else if (use_system_console)
          CreateScreen((char *)"System Console", 0);
 
-
        if (pclp->m_redirInName)
        {
                if ((stdin_fd = fileno(stdin)) != -1)
@@ -942,14 +929,12 @@ void fnRunScript(ScriptData* psdata)
                }
        }
 
-
        env = NULL;
        fnSetUpEnvBlock(&env);  // Set up the ENV block
 
        // Run the Perl script
        exitstatus = RunPerl(pclp->m_argc, pclp->m_argv, env);
 
-
        // clean up any redirection
        //
        if (pclp->m_redirInName && redirIn)
@@ -1004,9 +989,14 @@ void fnRunScript(ScriptData* psdata)
                DestroyScreen(newscreenhandle);
        }
 
+/**
+       // Commented since a few abends were happening in fnFpSetMode
        // Set the mode for stdin and stdout
        fnFpSetMode(stdin, O_TEXT, dummy);
        fnFpSetMode(stdout, O_TEXT, dummy);
+**/
+       setmode(stdin, O_TEXT);
+       setmode(stdout, O_TEXT);
 
        // Cleanup
        if(pclp->m_argv)
@@ -1056,7 +1046,6 @@ void fnRunScript(ScriptData* psdata)
                pclp->m_redirBothName = NULL;
        }
 
-
        // Signal a semaphore, if indicated by -{ option, to indicate that
        // the script has terminated and files are closed
        //
@@ -1076,12 +1065,15 @@ void fnRunScript(ScriptData* psdata)
        }
 
        if(env)
+       {
                fnDestroyEnvBlock(env);
+               env = NULL;
+       }
+
        fnUnregisterWithThreadTable();
        // Remove the thread context set during Perl_set_context
        Remove_Thread_Ctx();
 
-
        return;
 }
 
@@ -1118,7 +1110,6 @@ void fnSetUpEnvBlock(char*** penv)
        // add one for null termination
        totalcnt++;
 
-
        env = (char **) malloc (totalcnt * sizeof(char *));
        if (env)
        {
@@ -1227,7 +1218,6 @@ int fnFpSetMode(FILE* fp, int mode, int *err)
 
        PFFSETMODE pf_fsetmode;
 
-
        if (mode == O_BINARY || mode == O_TEXT)
        {
                if (fp)
@@ -1248,7 +1238,6 @@ int fnFpSetMode(FILE* fp, int mode, int *err)
                        }
                        if (errno)
                                err = &errno;
-
                }
                else
                {
@@ -1262,7 +1251,6 @@ int fnFpSetMode(FILE* fp, int mode, int *err)
                err = &errno;
        }
 
-
        return ret;
 }
 
@@ -1286,7 +1274,6 @@ void fnInternalPerlLaunchHandler(char* cmdLine)
 
        ScriptData* psdata=NULL;
 
-
        // Create a safe copy of the command line and pass it to the
        // new thread for parsing. The new thread will be responsible
        // to delete it when it is finished with it.
diff --git a/NetWare/bat/BldNWExt-Exist.bat b/NetWare/bat/BldNWExt-Exist.bat
deleted file mode 100644 (file)
index bdeddbb..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-@echo off
-@rem AUTHOR: sgp
-@rem CREATED: Sat Apr 14 13:05:44 2001
-@rem LAST REVISED: Sat Apr 14 2001
-@rem Batch file to toggle b/n building and not building NetWare
-@rem specific extns - cgi2perl & perl2ucs.
-
-if "%1" == "" goto Usage
-
-if "%1" == "/now" goto now
-if "%1" == "on" goto yes
-if "%1" == "off" goto no
-if "%1" == "/?" goto usage
-if "%1" == "/h" goto usage
-goto dontknow
-
-:now
-if not "%NW_EXTNS%" == "yes" echo NW_EXTNS is removed, doesn't build NetWare specific extensions
-if "%NW_EXTNS%"  == "yes" echo NW_EXTNS is set, builds NetWare specific extensions
-goto exit
-
-:yes
-Set NW_EXTNS=yes
-echo ....NW_EXTNS is set, builds NetWare specific extensions
-goto exit
-
-:no
-Set NW_EXTNS=
-echo ....NW_EXTNS is removed, doesn't build NetWare specific extensions
-goto exit
-
-:dontknow
-goto Usage
-
-:Usage
- @echo on
- @echo "Usage: BldNWExt [on|off]"
- @echo "Usage: BldNWExt /now" - To display current setting
-:exit
diff --git a/NetWare/bat/BldNWExt.bat b/NetWare/bat/BldNWExt.bat
deleted file mode 100644 (file)
index c3598c0..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-@echo off
-@rem AUTHOR: sgp
-@rem CREATED: Sat Apr 14 13:05:44 2001
-@rem LAST REVISED: Sat Apr 14 2001
-@rem Batch file to toggle b/n building and not building NetWare
-@rem specific extns - cgi2perl, perl2ucs & ucsext.
-
-if "%1" == "" goto Usage
-
-if "%1" == "/now" goto now
-if "%1" == "on" goto yes
-if "%1" == "off" goto no
-if "%1" == "/?" goto usage
-if "%1" == "/h" goto usage
-goto dontknow
-
-:now
-if not "%NW_EXTNS%" == "yes" echo NW_EXTNS is removed, doesn't build NetWare specific extensions
-if "%NW_EXTNS%"  == "yes" echo NW_EXTNS is set, builds NetWare specific extensions
-goto exit
-
-:yes
-Set NW_EXTNS=yes
-echo ....NW_EXTNS is set, builds NetWare specific extensions
-goto exit
-
-:no
-Set NW_EXTNS=
-echo ....NW_EXTNS is removed, doesn't build NetWare specific extensions
-goto exit
-
-:dontknow
-goto Usage
-
-:Usage
- @echo on
- @echo "Usage: BldNWExt [on|off]"
- @echo "Usage: BldNWExt /now" - To display current setting
-:exit
diff --git a/NetWare/bat/CWbuild.bat b/NetWare/bat/CWbuild.bat
deleted file mode 100644 (file)
index e3f72bf..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-call buildtype r
-call setsecsdk p:\apps\script\sw\nwsec
-call setnwbld p:\apps\ndk\nwsdk p:\apps\script\sw\cw p:\apps\mpk
-call mpkbuild on
diff --git a/NetWare/bat/MPKBuild.bat b/NetWare/bat/MPKBuild.bat
deleted file mode 100644 (file)
index 0740906..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-@echo off
-@rem AUTHOR: sgp
-@rem CREATED: 22nd May 2000
-@rem LAST REVISED: 6th April 2001
-@rem Batch file to set MPK/Non-MPK builds and toggle XDC flag setting
-@rem This file calls ToggleXDC.bat
-
-if "%1" == "" goto Usage
-
-if "%1" == "/now" goto now
-if "%1" == "on" goto yes
-if "%1" == "off" goto no
-if "%1" == "/?" goto usage
-goto dontknow
-
-:now
-if "%USE_MPK%" == "" echo USE_MPK is removed, doesn't use MPK APIs
-if not "%USE_MPK%"  == "" echo USE_MPK is set, uses MPK APIs, MPKBASE set to %MPKBASE%
-call ToggleXDC %1
-goto exit
-
-:yes
-Set USE_MPK=1
-echo ....USE_MPK is set, uses MPK APIs
-if "%2" == "" goto setdef
-if "%2" == "default" goto setdef
-SET MPKBASE=%2
-:yescon1
-call ToggleXDC on %3 %4
-echo ....MPKBASE set to %MPKBASE%
-goto exit
-
-:no
-Set USE_MPK=
-SET MPKBASE=
-if not "%2" == "" goto xdc_u
-call ToggleXDC off
-:nocon1
-echo ....USE_MPK is removed. doesn't use MPK APIs
-goto exit
-
-:dontknow
-goto Usage
-
-:setdef
-SET MPKBASE=p:\apps\mpk
-goto yescon1
-
-:xdc_u
-call ToggleXDC on %2 %3
-goto nocon1
-
-:Usage
- @echo on
- @echo "Usage: MPKBuild [on][off] [[path][default]] [[flag1] [flag2]]"
- @echo "Usage: MPKBuild /now"  - To display current setting
- @echo Scenarios...
- @echo ...Use MPK, path set to default and XDC set to -u     :MPKBuild on
- @echo ...Use MPK, path set to default and XDC set to -u     :MPKBuild on default -n
- @echo ...Use MPK, path set to "path" and XDC set to -n      :MPKBuild on "path" -n
- @echo ...Use MPK, path set to default and XDC set to -n, -u :MPKBuild on default -n -u
- @echo ...No MPK, No XDC                                     :MPKBuild off
- @echo ...No MPK, Use XDC with -u flag                       :MPKBuild off -u
-:exit
diff --git a/NetWare/bat/SetCodeWar.bat b/NetWare/bat/SetCodeWar.bat
new file mode 100644 (file)
index 0000000..c70ff02
--- /dev/null
@@ -0,0 +1,86 @@
+@echo off
+@rem AUTHOR: sgp & apc
+@rem CREATED: 24th July 2000
+@rem LAST REVISED: 6th April 2001
+@rem LAST REVISED: 22nd May 2002
+@rem AUTHOR: apc
+@rem Batch file to set the path to CodeWarrior directories
+@rem This file is called from SetNWBld.bat.
+
+if "%1" == "/now" goto now
+if "%1" == "" goto Usage
+if "%1" == "/?" goto usage
+if "%1" == "/h" goto usage
+
+set CODEWAR=%1
+ECHO CODEWAR=%1
+
+call buildtype r
+@echo Buildtype set to Release type
+
+set MWCIncludes=%1\include
+@echo MWCIncludes=%1\include
+set MWLibraries=%1\lib
+@echo MWLibraries=%1\lib
+set MWLibraryFiles=%1\lib\nwpre.obj;%1\lib\mwcrtld.lib
+@echo MWLibraryFiles=%1\lib\nwpre.obj;%1\lib\mwcrtld.lib
+
+set PATH=%PATH%;%1\bin;
+@echo PATH=%PATH%;%1\bin;
+
+goto exit
+
+:now
+@echo CODEWAR=%CODEWAR%
+goto exit
+
+:Usage
+ @echo on
+ @echo "Usage: setCodeWar <Path to CodeWarrior binaries>"
+ @echo "Usage: setCodeWar /now" - To display current setting
+ @echo Ex. setCodeWar d:\CodeWar
+
+:exit
+@echo off\r
+@rem AUTHOR: sgp & apc\r
+@rem CREATED: 24th July 2000\r
+@rem LAST REVISED: 6th April 2001\r
+@rem LAST REVISED: 22nd May 2002\r
+@rem AUTHOR: apc\r
+@rem Batch file to set the path to CodeWarrior directories\r
+@rem This file is called from SetNWBld.bat.\r
+\r
+if "%1" == "/now" goto now\r
+if "%1" == "" goto Usage\r
+if "%1" == "/?" goto usage\r
+if "%1" == "/h" goto usage\r
+\r
+set CODEWAR=%1\r
+ECHO CODEWAR=%1\r
+\r
+call buildtype r\r
+@echo Buildtype set to Release type\r
+\r
+set MWCIncludes=%1\include\r
+@echo MWCIncludes=%1\include\r
+set MWLibraries=%1\lib\r
+@echo MWLibraries=%1\lib\r
+set MWLibraryFiles=%1\lib\nwpre.obj;%1\lib\mwcrtld.lib\r
+@echo MWLibraryFiles=%1\lib\nwpre.obj;%1\lib\mwcrtld.lib\r
+\r
+set PATH=%PATH%;%1\bin;\r
+@echo PATH=%PATH%;%1\bin;\r
+\r
+goto exit\r
+\r
+:now\r
+@echo CODEWAR=%CODEWAR%\r
+goto exit\r
+\r
+:Usage\r
+ @echo on\r
+ @echo "Usage: setCodeWar <Path to CodeWarrior binaries>"\r
+ @echo "Usage: setCodeWar /now" - To display current setting\r
+ @echo Ex. setCodeWar d:\CodeWar\r
+\r
+:exit\r
diff --git a/NetWare/bat/SetNWDef.bat b/NetWare/bat/SetNWDef.bat
deleted file mode 100644 (file)
index 3b53cfd..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-@echo off
-@rem AUTHOR: apc
-@rem CREATED: Thu 18th Jan 2001 09:18:08
-@rem LAST REVISED: 6th April 2001
-@rem LAST REVISED: 6th May 2002
-@rem Batch file to set the path to Default Buildtype,NetWare SDK, CodeWarrior directories & MPK SDK and MPKbuild options
-@rem This file calls buildtype with release as defualt,setnlmsdk.bat, setcw.bat & setmpksdk.bat and MpkBuild with off as default
-
-REM If no parameters are passed, display usage
-if "%1" == "" goto Usage
-if "%1" == "/?" goto Usage
-if "%1" == "/h" goto Usage
-
-REM Display the current settings
-if "%1" == "/now" goto now
-
-REM If na is passed, don't set that parameter
-if "%1" == "na" goto skip_nlmsdk_msg
-
-:setnwsdk
-call setnlmsdk %1
-goto skip_nlmsdk_nomsg
-
-:skip_nlmsdk_msg
-@echo Retaining NLMSDKBASE=%NLMSDKBASE%
-
-:skip_nlmsdk_nomsg
-if "%2" == "" goto err_exit
-if "%2" == "na" goto skip_cw_msg
-:setcw
-call setcw %2
-goto skip_cw_nomsg
-
-:skip_cw_msg
-@echo Retaining CODEWAR=%CODEWAR%
-:skip_cw_nomsg
-
-if "%3" == "" goto exit
-if "%3" == "na" goto skip_mpksdk_msg
-
-:setmpk
-call setmpksdk %3
-goto exit
-
-:mpksdk_off
-call mpkbuild off
-@echo mpkbuild off
-goto exit
-
-:skip_mpksdk_msg
-@echo Retaining MPKBASE=%MPKBASE%
-goto exit
-
-:now
-@echo NLMSDKBASE=%NLMSDKBASE%
-@echo cw=%cw%
-@echo MPKBASE=%MPKBASE%
-goto exit
-
-goto exit
-
-:err_exit
-@echo Not Enough Parameters
-goto Usage
-
-:Usage
- @echo on
- @echo "Usage: setnwbld <path to NetWare SDK> [<path to CodeWarrior dir>] "
- @echo "Usage: setnwbld /now" - To display current setting
- @echo Pass na if you don't want to change a setting
- @echo Ex. setnwbld d:\ndk\nwsdk na 
- @echo Ex. setnwbld d:\ndk\
-:exit
diff --git a/NetWare/bat/Setcw.bat b/NetWare/bat/Setcw.bat
deleted file mode 100644 (file)
index a2c2f80..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-@echo off
-@rem AUTHOR: sgp
-@rem CREATED: 24th July 2000
-@rem LAST REVISED: 6th April 2001
-@rem LAST REVISED: 6th Mayl 2002
-@rem AUTHOR: apc
-@rem Batch file to set the path to CodeWarrior directories
-@rem This file is called from SetNWBld.bat. 
-
-if "%1" == "/now" goto now
-if "%1" == "" goto Usage
-if "%1" == "/?" goto usage
-if "%1" == "/h" goto usage
-
-
-set CODEWAR=%1
-call buildtype r
-@echo Buildtype set to Release type
-set MWCIncludes=%1\include
-set MWLibraries=%1\lib
-set MWLibraryFiles=%1\lib\nwpre.obj;p:\apps\script\sw\cw\lib\mwcrtld.lib
-set PATH=%PATH%;p:\apps\script\sw\cw\bin;
-goto exit
-
-:now
-@echo CODEWAR=%CODEWAR%
-goto exit
-
-:Usage
- @echo on
- @echo "Usage: setcw <path to CodeWarrior>"
- @echo "Usage: setcw /now" - To display current setting
- @echo Ex. setcw d:\CodeWar
-:exit
-
diff --git a/NetWare/bat/Setmpksdk.bat b/NetWare/bat/Setmpksdk.bat
deleted file mode 100644 (file)
index 3404fa4..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-@echo off
-@rem AUTHOR: sgp
-@rem CREATED: 24th July 2000
-@rem LAST REVISED: 6th April 2001
-@rem Batch file to set the path to MPK SDK
-@rem This file is called from SetNWBld.bat. 
-
-if "%1" == "/now" goto now
-if "%1" == "" goto Usage
-if "%1" == "/?" goto usage
-if "%1" == "/h" goto usage
-
-SET MPKBASE=%1
-echo MPKBASE set to %1
-
-goto exit
-
-:now
-@echo MPKBASE=%MPKBASE%
-goto exit
-
-:Usage
- @echo on
- @echo "Usage: setmpksdk <path to MPK sdk>"
- @echo "Usage: setmpksdk /now" - To display current setting
- @echo Ex. setmpksdk p:\sw\mpk
-:exit
diff --git a/NetWare/bat/ToggleXDC.bat b/NetWare/bat/ToggleXDC.bat
deleted file mode 100644 (file)
index eafe4ed..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-@echo off
-@rem AUTHOR: sgp
-@rem CREATED: 2nd November 1999
-@rem LAST REVISED: 6th April 2001
-@rem Batch file to toggle XDC flag setting, to link with XDC or not
-@rem This file is called from MPKBuild.bat. 
-
-if "%1" == "" goto Usage
-
-if "%1" == "/now" goto now
-if "%1" == "on" goto yes
-if "%1" == "off" goto no
-if "%1" == "/?" goto usage
-goto dontknow
-
-:now
-if "%USE_XDC%" == "" echo USE_XDC is removed, doesn't link with XDCDATA
-if not "%USE_XDC%"  == "" echo USE_XDC is set, links with XDCDATA, XDCFLAGS = %XDCFLAGS%
-goto exit
-
-:yes
-Set USE_XDC=1
-echo ....USE_XDC is set, links with XDCDATA
-if "%2" == "" SET XDCFLAGS=-n
-if not "%2" == "" SET XDCFLAGS=%2
-if not "%3" == "" SET XDCFLAGS=%XDCFLAGS% %3
-echo ....XDCFLAGS set to %XDCFLAGS%
-goto exit
-
-:no
-Set USE_XDC=
-SET XDCFLAGS=
-echo ....USE_XDC is removed. doesn't link with XDCDATA
-goto exit
-
-:dontknow
-goto Usage
-
-:Usage
- @echo on
- @echo "Usage: ToggleXDC [on|off] [[flag1] [flag2]]"
- @echo "Usage: ToggleD2 /now"  - To display current setting
-:exit
index 5fe6ad3..fa57c6e 100644 (file)
@@ -104,8 +104,22 @@ nw_setbuf(FILE *pf, char *buf)
 int
 nw_setmode(FILE *fp, int mode)
 {
+/**
+       // Commented since a few abends were happening in fnFpSetMode
        int *dummy = 0;
        return(fnFpSetMode(fp, mode, dummy));
+**/
+
+       int handle = -1;
+       errno = 0;
+
+       handle = fileno(fp);
+       if (errno)
+       {
+               errno = 0;
+               return -1;
+       }
+       return setmode(handle, mode);
 }
 
 int
index f453086..33866cc 100644 (file)
@@ -33,46 +33,30 @@ The build process is dependent on the location of the NetWare SDK.
 Once the Tools & SDK are installed, the build environment has to
 be setup.  The following batch files setup the environment.
 
-=over 4
-
 =item *
 
-If you want to build with Default settings you can follow the One step
-process given below to create the default Build Environment.
-
-=item SetNWDef.bat
-
-The Execution of this file takes 2 parameters as input.The first being
-the NetWare SDK path, Second being the path for CodeWarrior Compiler &
-other tools. Execution of this file sets the Build type to
-Release(default) , the NetWare SDK path, path for Compiler & other
-tools.
+=item SetNWBld.bat
 
-=item Custom Build Environment
+The Execution of this file takes 2 parameters as input. The first
+being the NetWare SDK path, second being the path for CodeWarrior
+Compiler & tools. Execution of this file sets these paths and also
+sets the build type to Release by default.
 
-If you want to change the default settings you could do so by
-following the steps listed below.
+=back
 
 =item Buildtype.bat
 
-This sets the build type to release or debug.
+This is used to set the build type to debug or release. Change the
+build type only after executing SetNWBld.bat
 
 =item *
 
-Example: Typing "buildtype d on" at the command prompt causes the
-buildtype to be set to Debug type.  Typing "buildtype r" at the
-command prompt sets it to Release Build type.
-
-=item SetNWBld.bat
-
-This sets the NetWare SDK path, path to Compiler & other tools.
-
-These batch files are under NetWare\bat folder.  These batch files
-call a couple of other batch files to setup the environment.  Invoking
-the batch file with I</now> will show the current settings and I</h>
-or I</?> gives the usage help.
-
-=back
+Example:
+  1. Typing "buildtype d on" at the command prompt causes the buildtype
+     to be set to Debug type with D2 flag set. 
+  2. Typing "buildtype d off" or "buildtype d" at the command prompt causes
+     the buildtype to be set to Debug type with D1 flag set. 
+  2. Typing "buildtype r" at the command prompt sets it to Release Build type.
 
 =head2 Make
 
@@ -120,11 +104,13 @@ and module files onto the NetWare server under I<sys:\Perl>
 folder. The Perl interpreter, I<perl.nlm>, is copied under
 I<sys:\perl\system> folder.  Copy this to I<sys:\system> folder.
 
-Example: At the command prompt Type "nmake nwinstall".  This will
-install NetWare Perl on the NetWare Server.  Similarly if you type
-"nmake install", This will cause the binaries to be installed on the
-local machine.  (Typically under the c:\perl folder)
+Example: At the command prompt Type "nmake nwinstall".
+          This will install NetWare Perl on the NetWare Server.
+          Similiarly if you type "nmake install",
+          This will cause the binaries to be installed on the local machine.
+          (Typically under the c:\perl folder)
 
+         
 =head1 Build new extensions
 
 To build extensions other than standard extensions, NetWare Perl has
@@ -176,11 +162,14 @@ Example: You can execute the following on the command prompt.
           perl -Ic:/perl/5.7.2/lib/NetWare-x86-multi-thread -Ic:\perl\5.7.2\lib MakeFile.pl
           INSTALLSITELIB=i:\perl\lib
 
-=item * 
+=back
+
+= item * 
 
-Note: Some modules downloaded from CPAN may require NetWare related API
-in order to build on NetWare.Other modules may however build smoothly with or
-without minor changes depending on the type of module.
+Note: Some modules downloaded from CPAN may require NetWare related
+API in order to build on NetWare.Other modules may however build
+smoothly with or without minor changes depending on the type of
+module.
 
 =back
 
@@ -213,6 +202,6 @@ Modified - 13 July 2001
 
 =item *
 
-Modified - 8 May 2002
+Modified - 28 May 2002
 
 =back
index d6e6dc6..7e1b8cb 100644 (file)
@@ -234,6 +234,10 @@ sub bootstrap {
     # It may also edit @modparts if required.
     $modfname = &mod2fname(\@modparts) if defined &mod2fname;
 
+       if (($^O eq 'NetWare') && (length($modfname) > 8)) {
+               $modfname = substr($modfname, 0, 8);
+       }
+
     my $modpname = join(($Is_MacOS ? ':' : '/'),@modparts);
 
     print STDERR "DynaLoader::bootstrap for $module ",
@@ -252,11 +256,21 @@ sub bootstrap {
        } else {
            $dir = "$_/auto/$modpname";
        }
-       next unless -d $dir; # skip over uninteresting directories
+       if ($^O ne 'NetWare') {
+               next unless -d $dir; # skip over uninteresting directories
+       }
+       else {
+               next if -f $dir; # skip over uninteresting directories
+       }
 
        # check for common cases to avoid autoload of dl_findfile
        my $try = $Is_MacOS ? "$dir:$modfname.$dl_dlext" : "$dir/$modfname.$dl_dlext";
-       last if $file = ($do_expand) ? dl_expandspec($try) : (-f $try && $try);
+       if ($^O ne 'NetWare') {
+               last if $file = ($do_expand) ? dl_expandspec($try) : ((-f $try) && $try);
+       }
+       elsif (!(-d $try)) {
+               last if $file = ($do_expand) ? dl_expandspec($try) : ($try);
+       }
 
        # no luck here, save dir for possible later dl_findfile search
        push @dirs, $dir;
index 61d6436..03a565f 100644 (file)
@@ -107,8 +107,7 @@ sub constants {
     push @m, "BOOT_SYMBOL = $self->{'BOOT_SYMBOL'}\n";
 
     # If the final binary name is greater than 8 chars,
-    # truncate it here and rename it after creation
-    # otherwise, Watcom Linker fails
+    # truncate it here.
     if(length($self->{'BASEEXT'}) > 8) {
         $self->{'NLM_SHORT_NAME'} = substr($self->{'BASEEXT'},0,8);
         push @m, "NLM_SHORT_NAME = $self->{'NLM_SHORT_NAME'}\n";
@@ -335,8 +334,7 @@ MAKE_FRAG
     # Taking care of long names like FileHandle, ByteLoader, SDBM_File etc
     if($self->{NLM_SHORT_NAME}) {
         # In case of nlms with names exceeding 8 chars, build nlm in the 
-        # current dir, rename and move to auto\lib.  If we create in auto\lib
-        # in the first place, we can't rename afterwards.
+        # current dir, rename and move to auto\lib.
         $m .= q{ -o $(NLM_SHORT_NAME).$(DLEXT)}
     } else {
         $m .= q{ -o $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT)}
@@ -347,12 +345,10 @@ MAKE_FRAG
 
     $m .= q{ $(PERL_INC)\Main.lib -commandfile $(BASEEXT).def}."\n";
 
-    # If it is having a short name, rename it 
     if($self->{NLM_SHORT_NAME}) {
         $m .= <<'MAKE_FRAG';
-       if exist $(INST_AUTODIR)\$(BASEEXT).$(DLEXT) del $(INST_AUTODIR)\$(BASEEXT).$(DLEXT) 
-       rename $(NLM_SHORT_NAME).$(DLEXT) $(BASEEXT).$(DLEXT) 
-       move $(BASEEXT).$(DLEXT) $(INST_AUTODIR)
+       if exist $(INST_AUTODIR)\$(NLM_SHORT_NAME).$(DLEXT) del $(INST_AUTODIR)\$(NLM_SHORT_NAME).$(DLEXT) 
+       move $(NLM_SHORT_NAME).$(DLEXT) $(INST_AUTODIR)
 MAKE_FRAG
     }
 
diff --git a/lib/ExtUtils/t/MM_NW5.t b/lib/ExtUtils/t/MM_NW5.t
new file mode 100644 (file)
index 0000000..d2046ee
--- /dev/null
@@ -0,0 +1,324 @@
+#!/usr/bin/perl
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        unshift @INC, '../lib';
+    }
+    else {
+        unshift @INC, 't/lib';
+    }
+}
+chdir 't';
+
+
+use Test::More;
+
+BEGIN {
+       if ($^O =~ /NetWare/i) {
+               plan tests => 40;
+       } else {
+               plan skip_all => 'This is not NW5';
+       }
+}
+
+use Config;
+use File::Spec;
+use File::Basename;
+use ExtUtils::MM;
+
+require_ok( 'ExtUtils::MM_NW5' );
+
+# Dummy MM object until we have a real MM init method.
+my $MM = bless {
+                DIR     => [],
+                NOECHO  => '@',
+                XS      => {},
+                MAKEFILE => 'Makefile',
+                RM_RF   => 'rm -rf',
+                MV      => 'mv',
+               }, 'MM';
+
+
+# replace_manpage_separator() => tr|/|.|s ?
+{
+    my $man = 'a/path/to//something';
+    ( my $replaced = $man ) =~ tr|/|.|s;
+    is( $MM->replace_manpage_separator( $man ),
+        $replaced, 'replace_manpage_separator()' );
+}
+
+# maybe_command()
+SKIP: {
+    skip( '$ENV{COMSPEC} not set', 2 )
+        unless $ENV{COMSPEC} =~ m!((?:[a-z]:)?[^|<>]+)!i;
+    my $comspec = $1;
+    is( $MM->maybe_command( $comspec ), 
+        $comspec, 'COMSPEC is a maybe_command()' );
+    ( my $comspec2 = $comspec ) =~ s|\..{3}$||;
+    like( $MM->maybe_command( $comspec2 ), 
+          qr/\Q$comspec/i, 
+          'maybe_command() without extension' );
+}
+
+my $had_pathext = exists $ENV{PATHEXT};
+{
+    local $ENV{PATHEXT} = '.exe';
+    ok( ! $MM->maybe_command( 'not_a_command.com' ), 
+        'not a maybe_command()' );
+}
+# Bug in Perl.  local $ENV{FOO} won't delete the key afterward.
+delete $ENV{PATHEXT} unless $had_pathext;
+
+# file_name_is_absolute() [Does not support UNC-paths]
+{
+    ok( $MM->file_name_is_absolute( 'SYS:/' ), 
+        'file_name_is_absolute()' );
+    ok( ! $MM->file_name_is_absolute( 'some/path/' ),
+        'not file_name_is_absolute()' );
+
+}
+
+# find_perl() 
+# Should be able to find running perl... $^X is OK on NW5
+{
+    my $my_perl = $1 if $^X  =~ /(.*)/; # are we in -T or -t?
+    my( $perl, $path ) = fileparse( $my_perl );
+    like( $MM->find_perl( $], [ $perl ], [ $path ] ), 
+          qr/^\Q$my_perl\E$/i, 'find_perl() finds this perl' );
+}
+
+# catdir() (calls MM_NW5->canonpath)
+{
+    my @path_eg = qw( SYS trick dir/now_OK );
+
+    is( $MM->catdir( @path_eg ), 
+         'SYS\\trick\\dir\\now_OK', 'catdir()' );
+    is( $MM->catdir( @path_eg ), 
+        File::Spec->catdir( @path_eg ), 
+        'catdir() eq File::Spec->catdir()' );
+
+# catfile() (calls MM_NW5->catdir)
+    push @path_eg, 'file.ext';
+
+    is( $MM->catfile( @path_eg ),
+        'SYS\\trick\\dir\\now_OK\\file.ext', 'catfile()' );
+
+    is( $MM->catfile( @path_eg ), 
+        File::Spec->catfile( @path_eg ), 
+        'catfile() eq File::Spec->catfile()' );
+}
+
+# init_others(): check if all keys are created and set?
+# qw( TOUCH CHMOD CP RM_F RM_RF MV NOOP TEST_F LD AR LDLOADLIBS DEV_NUL )
+{
+    my $mm_w32 = bless( {}, 'MM' );
+    $mm_w32->init_others();
+    my @keys = qw( TOUCH CHMOD CP RM_F RM_RF MV NOOP 
+                   TEST_F LD AR LDLOADLIBS DEV_NULL );
+    for my $key ( @keys ) {
+        ok( $mm_w32->{ $key }, "init_others: $key" );
+    }
+}
+
+# constants()
+{
+    my $mm_w32 = bless {
+        NAME         => 'TestMM_NW5', 
+        VERSION      => '1.00',
+        VERSION_FROM => 'TestMM_NW5',
+        PM           => { 'MM_NW5.pm' => 1 },
+    }, 'MM';
+
+    # XXX Hack until we have a proper init method.
+    # Flesh out some necessary keys in the MM object.
+    foreach my $key (qw(XS C O_FILES H HTMLLIBPODS HTMLSCRIPTPODS
+                        MAN1PODS MAN3PODS PARENT_NAME)) {
+        $mm_w32->{$key} = '';
+    }
+    my $s_PM = join( " \\\n\t", sort keys %{$mm_w32->{PM}} );
+    my $k_PM = join( " \\\n\t", %{$mm_w32->{PM}} );
+
+    like( $mm_w32->constants(),
+          qr|^NAME\ =\ TestMM_NW5\s+VERSION\ =\ 1\.00.+
+             MAKEMAKER\ =\ \Q$INC{'ExtUtils/MakeMaker.pm'}\E\s+
+             MM_VERSION\ =\ \Q$ExtUtils::MakeMaker::VERSION\E.+
+             VERSION_FROM\ =\ TestMM_NW5.+
+             TO_INST_PM\ =\ \Q$s_PM\E\s+
+             PM_TO_BLIB\ =\ \Q$k_PM\E
+          |xs, 'constants()' );
+
+}
+
+# path()
+my $had_path = exists $ENV{PATH};
+{
+    my @path_eg = ( qw( . .. ), 'SYS:\\Program Files' );
+    local $ENV{PATH} = join ';', @path_eg;
+    ok( eq_array( [ $MM->path() ], [ @path_eg ] ),
+        'path() [preset]' );
+}
+# Bug in Perl.  local $ENV{FOO} will not delete key afterwards.
+delete $ENV{PATH} unless $had_path;
+
+# static_lib() should look into that
+# dynamic_bs() should look into that
+# dynamic_lib() should look into that
+
+# clean()
+{
+    my $clean = $Config{cc} =~ /^gcc/i ? 'dll.base dll.exp' : '*.pdb';
+    like( $MM->clean(), qr/^clean ::\s+\Q-$(RM_F) $clean\E\s+$/m,
+          'clean() Makefile target' );
+}
+
+# perl_archive()
+{
+    my $libperl = $Config{libperl} || 'libperl.a';
+    is( $MM->perl_archive(), File::Spec->catfile('$(PERL_INC)', $libperl ),
+           'perl_archive() should respect libperl setting' );
+}
+
+# export_list
+{
+    my $mm_w32 = bless { BASEEXT => 'someext' }, 'MM';
+    is( $mm_w32->export_list(), 'someext.def', 'export_list()' );
+}
+
+# canonpath()
+{
+    my $path = 'SYS:/TEMP';
+    is( $MM->canonpath( $path ), File::Spec->canonpath( $path ),
+           'canonpath() eq File::Spec->canonpath' );
+}
+
+# perl_script()
+my $script_ext  = '';
+my $script_name = 'mm_w32tmp';
+SKIP: {
+    local *SCRIPT;
+    skip( "Can't create temp file: $!", 4 )
+        unless open SCRIPT, "> $script_name";
+    print SCRIPT <<'EOSCRIPT';
+#! perl
+__END__
+EOSCRIPT
+    skip( "Can't write to temp file: $!", 4 )
+        unless close SCRIPT;
+    # now start tests:
+    is( $MM->perl_script( $script_name ), 
+        "${script_name}$script_ext", "perl_script ($script_ext)" );
+
+    skip( "Can't rename temp file: $!", 3 )
+        unless rename $script_name, "${script_name}.pl";
+    $script_ext = '.pl';
+    is( $MM->perl_script( $script_name ), 
+        "${script_name}$script_ext", "perl_script ($script_ext)" );
+
+    skip( "Can't rename temp file: $!", 2 )
+        unless rename "${script_name}$script_ext", "${script_name}.bat";
+    $script_ext = '.bat';
+    is( $MM->perl_script( $script_name ), 
+        "${script_name}$script_ext", "perl_script ($script_ext)" );
+
+    skip( "Can't rename temp file: $!", 1 )
+        unless rename "${script_name}$script_ext", "${script_name}.noscript";
+    $script_ext = '.noscript';
+
+    isnt( $MM->perl_script( $script_name ),
+          "${script_name}$script_ext", 
+          "not a perl_script anymore ($script_ext)" );
+    is( $MM->perl_script( $script_name ), undef,
+        "perl_script ($script_ext) returns empty" );
+}
+unlink "${script_name}$script_ext" if -f "${script_name}$script_ext";
+
+
+# pm_to_blib()
+{
+    like( $MM->pm_to_blib(),
+          qr/^pm_to_blib: \Q$(TO_INST_PM)\E.+\Q$(TOUCH) \E\$@\s+$/ms,
+          'pm_to_blib' );
+}
+
+# tool_autosplit()
+{
+    my %attribs = ( MAXLEN => 255 );
+    like( $MM->tool_autosplit( %attribs ),
+          qr/^\#\ Usage:\ \$\(AUTOSPLITFILE\)
+             \ FileToSplit\ AutoDirToSplitInto.+
+             AUTOSPLITFILE\ =\ \$\(PERLRUN\)\ .+
+             \$AutoSplit::Maxlen=$attribs{MAXLEN};
+          /xms,
+          'tool_autosplit()' );
+}
+
+# tools_other()
+{
+    ( my $mm_w32 = bless { }, 'MM' )->init_others();
+        
+    my $bin_sh = ( $Config{make} =~ /^dmake/i 
+               ? "" : ($Config{sh} || 'cmd /c') . "\n" );
+    $bin_sh = "SHELL = $bin_sh" if $bin_sh;
+
+    my $tools = join "\n", map "$_ = $mm_w32->{ $_ }"
+       => qw(CHMOD CP LD MV NOOP RM_F RM_RF TEST_F TOUCH UMASK_NULL DEV_NULL);
+
+    like( $mm_w32->tools_other(),
+          qr/^\Q$bin_sh$tools/m,
+          'tools_other()' );
+};
+
+# xs_o() should look into that
+# top_targets() should look into that
+
+# manifypods()
+{
+    my $mm_w32 = bless { NOECHO    => '' }, 'MM';
+    like( $mm_w32->manifypods(),
+          qr/^\nmanifypods :\n\t\$\Q(NOOP)\E\n$/,
+          'manifypods() Makefile target' );
+}
+
+# dist_ci() should look into that
+# dist_core() should look into that
+
+# pasthru()
+{
+    my $pastru = "PASTHRU = " . ($Config{make} =~ /^nmake/i ? "-nologo" : "");
+    is( $MM->pasthru(), $pastru, 'pasthru()' );
+}
+
+package FakeOut;
+
+sub TIEHANDLE {
+       bless(\(my $scalar), $_[0]);
+}
+
+sub PRINT {
+       my $self = shift;
+       $$self .= shift;
+}
+
+__END__
+
+=head1 NAME
+
+MM_NW5.t - Tests for ExtUtils::MM_NW5
+
+=head1 TODO
+
+ - Methods to still be checked:
+ # static_lib() should look into that
+ # dynamic_bs() should look into that
+ # dynamic_lib() should look into that
+ # xs_o() should look into that
+ # top_targets() should look into that
+ # dist_ci() should look into that
+ # dist_core() should look into that
+
+=head1 AUTHOR
+
+20011228 Abe Timmerman <abe@ztreet.demon.nl>
+
+=cut
diff --git a/lib/File/Spec/NW5.pm b/lib/File/Spec/NW5.pm
new file mode 100644 (file)
index 0000000..30cdd67
--- /dev/null
@@ -0,0 +1,363 @@
+package File::Spec::NW5;
+
+
+use Cwd;
+use vars qw(@ISA $VERSION);
+require File::Spec::Unix;
+
+$VERSION = '1.3';
+
+@ISA = qw(File::Spec::Unix);
+
+=head1 NAME
+
+File::Spec::NW5 - methods for NW5 file specs
+
+=head1 SYNOPSIS
+
+ require File::Spec::NW5; # Done internally by File::Spec if needed
+
+=head1 DESCRIPTION
+
+See File::Spec::Unix for a documentation of the methods provided
+there. This package overrides the implementation of these methods, not
+the semantics.
+
+=over 4
+
+=item devnull
+
+Returns a string representation of the null device.
+
+=cut
+
+sub devnull {
+    return "nul";
+}
+
+=item tmpdir
+
+Returns a string representation of the first existing directory
+from the following list:
+
+    $ENV{TMPDIR}
+    $ENV{TEMP}
+    $ENV{TMP}
+    SYS:/temp
+    /tmp
+    /
+
+Since perl 5.8.0, if running under taint mode, and if the environment
+variables are tainted, they are not used.
+
+=cut
+
+my $tmpdir;
+sub tmpdir {
+    return $tmpdir if defined $tmpdir;
+    my $self = shift;
+    my @dirlist = (@ENV{qw(TMPDIR TEMP TMP)}, qw(SYS:/temp /tmp /));
+    {
+       no strict 'refs';
+       if (${"\cTAINT"}) { # Check for taint mode on perl >= 5.8.0
+           require Scalar::Util;
+           @dirlist = grep { ! Scalar::Util::tainted $_ } @dirlist;
+       }
+    }
+    foreach (@dirlist) {
+       next unless defined && -d;
+       $tmpdir = $_;
+       last;
+    }
+    $tmpdir = '' unless defined $tmpdir;
+    $tmpdir = $self->canonpath($tmpdir);
+    return $tmpdir;
+}
+
+sub case_tolerant {
+    return 1;
+}
+
+sub file_name_is_absolute {
+    my ($self,$file) = @_;
+    return scalar($file =~ m{^([a-z]:)?[\\/]}is);
+}
+
+=item catfile
+
+Concatenate one or more directory names and a filename to form a
+complete path ending with a filename
+
+=cut
+
+sub catfile {
+    my $self = shift;
+    my $file = pop @_;
+    return $file unless @_;
+    my $dir = $self->catdir(@_);
+    $dir .= "\\" unless substr($dir,-1) eq "\\";
+    return $dir.$file;
+}
+
+sub path {
+    my $path = $ENV{'PATH'} || $ENV{'Path'} || $ENV{'path'};
+    my @path = split(';',$path);
+    foreach (@path) { $_ = '.' if $_ eq '' }
+    return @path;
+}
+
+=item canonpath
+
+No physical check on the filesystem, but a logical cleanup of a
+path. On UNIX eliminated successive slashes and successive "/.".
+
+=cut
+
+sub canonpath {
+    my ($self,$path) = @_;
+    $path =~ s/^([a-z]:)/\u$1/s;
+    $path =~ s|/|\\|g;
+    $path =~ s|([^\\])\\+|$1\\|g;                  # xx\\\\xx  -> xx\xx
+    $path =~ s|(\\\.)+\\|\\|g;                     # xx\.\.\xx -> xx\xx
+    $path =~ s|^(\.\\)+||s unless $path eq ".\\";  # .\xx      -> xx
+    $path =~ s|\\\Z(?!\n)||
+             unless $path =~ m#^([A-Z]:)?\\\Z(?!\n)#s;   # xx\       -> xx
+    return $path;
+}
+
+=item splitpath
+
+    ($volume,$directories,$file) = File::Spec->splitpath( $path );
+    ($volume,$directories,$file) = File::Spec->splitpath( $path, $no_file );
+
+Splits a path in to volume, directory, and filename portions. Assumes that 
+the last file is a path unless the path ends in '\\', '\\.', '\\..'
+or $no_file is true.  On NW5 this means that $no_file true makes this return 
+( $volume, $path, undef ).
+
+Separators accepted are \ and /.
+
+Volumes can be drive letters or UNC sharenames (\\server\share).
+
+The results can be passed to L</catpath> to get back a path equivalent to
+(usually identical to) the original path.
+
+=cut
+
+sub splitpath {
+    my ($self,$path, $nofile) = @_;
+    my ($volume,$directory,$file) = ('','','');
+    if ( $nofile ) {
+        $path =~ 
+            m{^( (?:[a-zA-Z]:|(?:\\\\|//)[^\\/]+[\\/][^\\/]+)? ) 
+                 (.*)
+             }xs;
+        $volume    = $1;
+        $directory = $2;
+    }
+    else {
+        $path =~ 
+            m{^ ( (?: [a-zA-Z]: |
+                      (?:\\\\|//)[^\\/]+[\\/][^\\/]+
+                  )?
+                )
+                ( (?:.*[\\\\/](?:\.\.?\Z(?!\n))?)? )
+                (.*)
+             }xs;
+        $volume    = $1;
+        $directory = $2;
+        $file      = $3;
+    }
+
+    return ($volume,$directory,$file);
+}
+
+
+=item splitdir
+
+The opposite of L<catdir()|File::Spec/catdir()>.
+
+    @dirs = File::Spec->splitdir( $directories );
+
+$directories must be only the directory portion of the path on systems 
+that have the concept of a volume or that have path syntax that differentiates
+files from directories.
+
+Unlike just splitting the directories on the separator, leading empty and 
+trailing directory entries can be returned, because these are significant
+on some OSs. So,
+
+    File::Spec->splitdir( "/a/b/c" );
+
+Yields:
+
+    ( '', 'a', 'b', '', 'c', '' )
+
+=cut
+
+sub splitdir {
+    my ($self,$directories) = @_ ;
+    #
+    # split() likes to forget about trailing null fields, so here we
+    # check to be sure that there will not be any before handling the
+    # simple case.
+    #
+    if ( $directories !~ m|[\\/]\Z(?!\n)| ) {
+        return split( m|[\\/]|, $directories );
+    }
+    else {
+        #
+        # since there was a trailing separator, add a file name to the end, 
+        # then do the split, then replace it with ''.
+        #
+        my( @directories )= split( m|[\\/]|, "${directories}dummy" ) ;
+        $directories[ $#directories ]= '' ;
+        return @directories ;
+    }
+}
+
+
+=item catpath
+
+Takes volume, directory and file portions and returns an entire path. Under
+Unix, $volume is ignored, and this is just like catfile(). On other OSs,
+the $volume become significant.
+
+=cut
+
+sub catpath {
+    my ($self,$volume,$directory,$file) = @_;
+
+    # If it's UNC, make sure the glue separator is there, reusing
+    # whatever separator is first in the $volume
+    $volume .= $1
+        if ( $volume =~ m@^([\\/])[\\/][^\\/]+[\\/][^\\/]+\Z(?!\n)@s &&
+             $directory =~ m@^[^\\/]@s
+           ) ;
+
+    $volume .= $directory ;
+
+    # If the volume is not just A:, make sure the glue separator is 
+    # there, reusing whatever separator is first in the $volume if possible.
+    if ( $volume !~ m@^[a-zA-Z]:\Z(?!\n)@s &&
+         $volume =~ m@[^\\/]\Z(?!\n)@      &&
+         $file   =~ m@[^\\/]@
+       ) {
+        $volume =~ m@([\\/])@ ;
+        my $sep = $1 ? $1 : '\\' ;
+        $volume .= $sep ;
+    }
+
+    $volume .= $file ;
+
+    return $volume ;
+}
+
+
+sub abs2rel {
+    my($self,$path,$base) = @_;
+
+    # Clean up $path
+    if ( ! $self->file_name_is_absolute( $path ) ) {
+        $path = $self->rel2abs( $path ) ;
+    }
+    else {
+        $path = $self->canonpath( $path ) ;
+    }
+
+    # Figure out the effective $base and clean it up.
+    if ( !defined( $base ) || $base eq '' ) {
+        $base = cwd() ;
+    }
+    elsif ( ! $self->file_name_is_absolute( $base ) ) {
+        $base = $self->rel2abs( $base ) ;
+    }
+    else {
+        $base = $self->canonpath( $base ) ;
+    }
+
+    # Split up paths
+    my ( undef, $path_directories, $path_file ) =
+        $self->splitpath( $path, 1 ) ;
+
+    my $base_directories = ($self->splitpath( $base, 1 ))[1] ;
+
+    # Now, remove all leading components that are the same
+    my @pathchunks = $self->splitdir( $path_directories );
+    my @basechunks = $self->splitdir( $base_directories );
+
+    while ( @pathchunks && 
+            @basechunks && 
+            lc( $pathchunks[0] ) eq lc( $basechunks[0] ) 
+          ) {
+        shift @pathchunks ;
+        shift @basechunks ;
+    }
+
+    # No need to catdir, we know these are well formed.
+    $path_directories = CORE::join( '\\', @pathchunks );
+    $base_directories = CORE::join( '\\', @basechunks );
+
+    # $base_directories now contains the directories the resulting relative
+    # path must ascend out of before it can descend to $path_directory.  So, 
+    # replace all names with $parentDir
+
+    #FA Need to replace between backslashes...
+    $base_directories =~ s|[^\\]+|..|g ;
+
+    # Glue the two together, using a separator if necessary, and preventing an
+    # empty result.
+
+    #FA Must check that new directories are not empty.
+    if ( $path_directories ne '' && $base_directories ne '' ) {
+        $path_directories = "$base_directories\\$path_directories" ;
+    } else {
+        $path_directories = "$base_directories$path_directories" ;
+    }
+
+    return $self->canonpath( 
+        $self->catpath( "", $path_directories, $path_file ) 
+    ) ;
+}
+
+
+sub rel2abs {
+    my ($self,$path,$base ) = @_;
+
+    if ( ! $self->file_name_is_absolute( $path ) ) {
+
+        if ( !defined( $base ) || $base eq '' ) {
+            $base = cwd() ;
+        }
+        elsif ( ! $self->file_name_is_absolute( $base ) ) {
+            $base = $self->rel2abs( $base ) ;
+        }
+        else {
+            $base = $self->canonpath( $base ) ;
+        }
+
+        my ( $path_directories, $path_file ) =
+            ($self->splitpath( $path, 1 ))[1,2] ;
+
+        my ( $base_volume, $base_directories ) =
+            $self->splitpath( $base, 1 ) ;
+
+        $path = $self->catpath( 
+            $base_volume, 
+            $self->catdir( $base_directories, $path_directories ), 
+            $path_file
+        ) ;
+    }
+
+    return $self->canonpath( $path ) ;
+}
+
+=back
+
+=head1 SEE ALSO
+
+L<File::Spec>
+
+=cut
+
+1;
index 0a1e7ed..e864f68 100644 (file)
@@ -1275,6 +1275,8 @@ foreach my $symbol (qw(
                        Perl_sv_catsv
                        Perl_sv_catpvn
                        Perl_sv_2pv
+                       nw_freeenviron
+                       Remove_Thread_Ctx
                           ))
     {
        try_symbol($symbol);
diff --git a/toke.c b/toke.c
index 7e9efdc..7cd0983 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -7577,15 +7577,33 @@ Perl_yyerror(pTHX_ char *s)
        where = "at EOF";
     else if (PL_bufptr > PL_oldoldbufptr && PL_bufptr - PL_oldoldbufptr < 200 &&
       PL_oldoldbufptr != PL_oldbufptr && PL_oldbufptr != PL_bufptr) {
+       /*
+               Only for NetWare:
+               The code below is removed for NetWare because it abends/crashes on NetWare
+               when the script has error such as not having the closing quotes like:
+                   if ($var eq "value)
+               Checking of white spaces is anyway done in NetWare code.
+       */
+#ifndef NETWARE
        while (isSPACE(*PL_oldoldbufptr))
            PL_oldoldbufptr++;
+#endif
        context = PL_oldoldbufptr;
        contlen = PL_bufptr - PL_oldoldbufptr;
     }
     else if (PL_bufptr > PL_oldbufptr && PL_bufptr - PL_oldbufptr < 200 &&
       PL_oldbufptr != PL_bufptr) {
+       /*
+               Only for NetWare:
+               The code below is removed for NetWare because it abends/crashes on NetWare
+               when the script has error such as not having the closing quotes like:
+                   if ($var eq "value)
+               Checking of white spaces is anyway done in NetWare code.
+       */
+#ifndef NETWARE
        while (isSPACE(*PL_oldbufptr))
            PL_oldbufptr++;
+#endif
        context = PL_oldbufptr;
        contlen = PL_bufptr - PL_oldbufptr;
     }