diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-31 13:12:51 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-05-31 13:12:51 +0000 |
commit | f355267cae69288cbad383cfc3cf2811969d730e (patch) | |
tree | e80a2dd536fd9fd7dc700af3a1268eedc51da68a /NetWare | |
parent | 11676840748f5f7ca2c49139b3da8352772177ee (diff) | |
download | perl-f355267cae69288cbad383cfc3cf2811969d730e.tar.gz |
NetWare update from Ananth Kesari.
p4raw-id: //depot/perl@16922
Diffstat (limited to 'NetWare')
-rw-r--r-- | NetWare/Makefile | 226 | ||||
-rw-r--r-- | NetWare/Nwmain.c | 31 | ||||
-rw-r--r-- | NetWare/bat/BldNWExt-Exist.bat | 39 | ||||
-rw-r--r-- | NetWare/bat/BldNWExt.bat | 39 | ||||
-rw-r--r-- | NetWare/bat/CWbuild.bat | 4 | ||||
-rw-r--r-- | NetWare/bat/MPKBuild.bat | 64 | ||||
-rw-r--r-- | NetWare/bat/SetCodeWar.bat | 86 | ||||
-rw-r--r-- | NetWare/bat/SetNWDef.bat | 73 | ||||
-rw-r--r-- | NetWare/bat/Setcw.bat | 35 | ||||
-rw-r--r-- | NetWare/bat/Setmpksdk.bat | 27 | ||||
-rw-r--r-- | NetWare/bat/ToggleXDC.bat | 43 | ||||
-rw-r--r-- | NetWare/nw5.c | 14 |
12 files changed, 253 insertions, 428 deletions
diff --git a/NetWare/Makefile b/NetWare/Makefile index aae82e7ce2..bb40515f70 100644 --- a/NetWare/Makefile +++ b/NetWare/Makefile @@ -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 diff --git a/NetWare/Nwmain.c b/NetWare/Nwmain.c index 219ab6cd7a..b49fc80f70 100644 --- a/NetWare/Nwmain.c +++ b/NetWare/Nwmain.c @@ -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 index bdeddbbe56..0000000000 --- a/NetWare/bat/BldNWExt-Exist.bat +++ /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 index c3598c03c9..0000000000 --- a/NetWare/bat/BldNWExt.bat +++ /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 index e3f72bf9da..0000000000 --- a/NetWare/bat/CWbuild.bat +++ /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 index 0740906d1a..0000000000 --- a/NetWare/bat/MPKBuild.bat +++ /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 index 0000000000..c70ff02839 --- /dev/null +++ b/NetWare/bat/SetCodeWar.bat @@ -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
+@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
diff --git a/NetWare/bat/SetNWDef.bat b/NetWare/bat/SetNWDef.bat deleted file mode 100644 index 3b53cfdf7e..0000000000 --- a/NetWare/bat/SetNWDef.bat +++ /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 index a2c2f804af..0000000000 --- a/NetWare/bat/Setcw.bat +++ /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 index 3404fa4fd9..0000000000 --- a/NetWare/bat/Setmpksdk.bat +++ /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 index eafe4ed2a0..0000000000 --- a/NetWare/bat/ToggleXDC.bat +++ /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 diff --git a/NetWare/nw5.c b/NetWare/nw5.c index 5fe6ad3b16..fa57c6ea79 100644 --- a/NetWare/nw5.c +++ b/NetWare/nw5.c @@ -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 |