packageBinaries.cmd
上传用户:huihehuasu
上传日期:2007-01-10
资源大小:6948k
文件大小:8k
源码类别:
xml/soap/webservice
开发平台:
C/C++
- /****************************************************************************
- * Create directories and package binaries for Xerces-C OS/2 port
- */
- IF LoadRexxUtil() THEN EXIT
- sourcedir = ''
- targetdir = ''
- msgloader = 'InMemory'
- transcoder = 'Iconv'
- argv = cli(arg(1))
- DO i = 1 TO argv~items
- SELECT
- WHEN argv[i] = "-s" THEN
- DO
- i = i + 1
- sourcedir = argv[i]
- END
- WHEN argv[i] = "-o" THEN
- DO
- i = i + 1
- targetdir = argv[i]
- END
- WHEN argv[i] = "-t" THEN
- DO
- i = i + 1
- transcoder = argv[i]
- END
- WHEN argv[i] = "-m" THEN
- DO
- i = i + 1
- msgloader = argv[i]
- END
- WHEN argv[i] = "-h" THEN
- DO
- CALL Usage
- EXIT -1
- END
- OTHERWISE
- NOP
- END
- END
- IF targetdir = '' | sourcedir = '' THEN
- DO
- CALL Usage
- EXIT -1
- END
- CALL MakeTargetDirectories targetdir
- CALL CopyHeaderFiles targetdir, sourcedir
- CALL CopyBinaries targetdir, sourcedir
- CALL CopySamples targetdir, sourcedir
- EXIT
- /*---------------------------------- Usage ----------------------------------
- * Display a usage message
- */
- ::routine Usage
- SAY "Usage is:"
- SAY " packageBinaries <options>"
- SAY " options are:"
- SAY " -s <source_directory>"
- SAY " -o <target_directory>"
- /*
- SAY " -c <C compiler name> (e.g. gcc, cc or xlc_r)"
- SAY " -x <C++ compiler name> (e.g. g++, CC, aCC, c++ or xlC_r)"
- */
- SAY " -m <message loader> can be 'inmem' (default), 'icu' or 'iconv'"
- SAY " -n <net accessor> can be 'fileonly' or 'socket' (default)"
- SAY " -t <transcoder> can be 'icu' or 'native' (default)"
- SAY " -h to get help on these commands"
- SAY "Example:"
- SAY " packageBinaries -s D:xml-xercesc -o E:xerces-c_1_1_0 -m inmem -n fileonly"
- RETURN
- /*-------------------------- MakeTargetDirectories --------------------------
- * Make the target directory and its main subdirectories
- */
- ::routine MakeTargetDirectories
- USE ARG targetdir
- CALL SysMkDir targetdir
- CALL SysMkDir targetdir || "bin"
- CALL SysMkDir targetdir || "lib"
- CALL SysMkDir targetdir || "include"
- CALL SysMkDir targetdir || "samples"
- CALL SysMkDir targetdir || "samplesProjects"
- CALL SysMkDir targetdir || "samplesProjectsOS2"
- CALL SysMkDir targetdir || "samplesProjectsOS2VACPP40"
- CALL SysMkDir targetdir || "samplesdata"
- CALL SysMkDir targetdir || "samplesSAXCount"
- CALL SysMkDir targetdir || "samplesSAX2Count"
- CALL SysMkDir targetdir || "samplesSAXPrint"
- CALL SysMkDir targetdir || "samplesSAX2Print"
- CALL SysMkDir targetdir || "samplesDOMCount"
- CALL SysMkDir targetdir || "samplesDOMPrint"
- CALL SysMkDir targetdir || "samplesIDOMCount"
- CALL SysMkDir targetdir || "samplesIDOMPrint"
- CALL SysMkDir targetdir || "samplesRedirect"
- CALL SysMkDir targetdir || "samplesMemParse"
- CALL SysMkDir targetdir || "samplesPParse"
- CALL SysMkDir targetdir || "samplesStdInParse"
- CALL SysMkDir targetdir || "samplesEnumVal"
- CALL SysMkDir targetdir || "samplesCreateDOMDocument"
- CALL SysMkDir targetdir || "doc"
- CALL SysMkDir targetdir || "dochtml"
- CALL SysMkDir targetdir || "dochtmlapiDocs"
- RETURN
- /*------------------------------- CopySamples -------------------------------
- */
- ::routine CopySamples
- USE ARG targetdir, sourcedir
- project = "samplesProjectsOS2VACPP40"
- /* Copy the project files */
- srcSpec = sourcedir || project || "*"
- CALL SysFileTree srcSpec, 'F.', 'FO'
- DO i = 1 TO f.0
- srcfn = f.i
- trgfn = targetdir || project || "" || Filespec('N', f.i)
- 'copy' srcfn trgfn '> nul'
- END
- samples = .array~of( ,
- "SAXCount", ,
- "SAX2Count", ,
- "SAXPrint", ,
- "SAX2Print", ,
- "DOMCount", ,
- "DOMPrint", ,
- "IDOMCount", ,
- "IDOMPrint", ,
- "Redirect", ,
- "MemParse", ,
- "PParse", ,
- "StdInParse", ,
- "EnumVal", ,
- "CreateDOMDocument" ,
- )
- /* Copy the sample code */
- DO sample OVER samples
- srcSpec = sourcedir || "samples" || sample || "*.?pp"
- CALL SysFileTree srcSpec, 'F.', 'FO'
- DO i = 1 TO f.0
- srcfn = f.i
- trgfn = targetdir || "samples" || sample || "" || Filespec('N', f.i)
- 'copy' srcfn trgfn '> nul'
- END
- END
- RETURN
- /*------------------------------ CopyBinaries -------------------------------
- * Copy the DLL and LIB files to their destination directories
- */
- ::routine CopyBinaries
- USE ARG targetdir, sourcedir
- srcdll = sourcedir || "ProjectsOS2VACPP40xerces-c.dll"
- trgdll = targetdir || "binxerces-c.dll"
- srclib = sourcedir || "ProjectsOS2VACPP40xerces-c.lib"
- trglib = targetdir || "libxerces-c.lib"
- 'copy' srcdll trgdll '> nul'
- 'copy' srclib trglib '> nul'
- RETURN
- /*----------------------------- CopyHeaderFiles -----------------------------
- * Copy the header files to the target include directory
- */
- ::routine CopyHeaderFiles
- USE ARG targetdir, sourcedir
- hdirs = .array~of( ,
- "sax", ,
- "sax2", ,
- "framework", ,
- "dom", ,
- "idom", ,
- "internal", ,
- "parsers", ,
- "util", ,
- "utilCompilers", ,
- "utilMsgLoaders", ,
- "utilMsgLoadersICU", ,
- "utilMsgLoadersInMemory", ,
- "utilMsgLoadersMsgCatalog", ,
- "utilPlatforms", ,
- "utilPlatformsAIX", ,
- "utilPlatformsHPUX", ,
- "utilPlatformsLinux", ,
- "utilPlatformsMacOS", ,
- "utilPlatformsOS2", ,
- "utilPlatformsOS390", ,
- "utilPlatformsPTX", ,
- "utilPlatformsSolaris", ,
- "utilPlatformsTandem", ,
- "utilPlatformsWin32", ,
- "utilTranscoders", ,
- "utilTranscodersICU", ,
- "utilTranscodersIconv", ,
- "utilregx", ,
- "validators", ,
- "validatorscommon", ,
- "validatorsdatatype", ,
- "validatorsDTD" )
- DO dir OVER hdirs
- CALL SysMkDir targetdir || "include" || dir
- /* Copy the *.hpp files */
- hppSpec = sourcedir || "src" || dir || "*.hpp"
- CALL SysFileTree hppSpec, 'F.', 'FO'
- DO i = 1 TO f.0
- srcfn = f.i
- trgfn = targetdir || "include" || dir || "" || Filespec('N', f.i)
- IF srcfn~pos("dom") > 0 THEN
- IF srcfn~pos("Impl.hpp") > 0 | srcfn~pos("domDS") > 0 THEN
- ITERATE
- IF srcfn~pos("idom") > 0 THEN
- IF srcfn~pos("Impl.hpp") > 0 | srcfn~pos("idomIDS") > 0 THEN
- ITERATE
- 'copy' srcfn trgfn '> nul'
- END
- /* Copy the *.c files */
- cSpec = sourcedir || "src" || dir || "*.c"
- CALL SysFileTree cSpec, 'F.', 'FO'
- DO i = 1 TO f.0
- srcfn = f.i
- trgfn = targetdir || "include" || dir || "" || Filespec('N', f.i)
- 'copy' srcfn trgfn '> nul'
- END
- END
- RETURN
- /*------------------------------ LoadRexxUtil -------------------------------
- * Load the RexxUtil library
- */
- ::routine LoadRexxUtil
- IF RxFuncQuery('SysLoadFuncs') THEN
- DO
- IF RxFuncAdd('SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs') THEN
- DO
- .output~lineout("Error: Couldn't load RexxUtil library.")
- RETURN 1
- END
- CALL SysLoadFuncs
- END
- RETURN 0
- /*----------------------------------- cli -----------------------------------
- * Command Line Interpreter
- */
- ::routine cli
- USE ARG cmdline
- argv = .array~new
- DO i = 1 WHILE cmdline <> ''
- cmdline = cmdline~strip
- IF cmdline~left(1) = '"' THEN
- PARSE VAR cmdline '"' thisArg '"' cmdline
- ELSE
- PARSE VAR cmdline thisArg cmdline
- argv[i] = thisArg
- END
- RETURN argv