diff options
| author | Mark Adler <madler@alumni.caltech.edu> | 2016-12-30 19:48:07 -0800 |
|---|---|---|
| committer | Mark Adler <madler@alumni.caltech.edu> | 2016-12-30 20:00:57 -0800 |
| commit | d46546544a1ec20671c7e5a9135ad7c6e83bb927 (patch) | |
| tree | 1a53b5523d77adb3e27a5bb3f09afe9f4e448b9a | |
| parent | f12d3dc367e51bcefba80217c645fa5de05e699c (diff) | |
| download | zlib-d46546544a1ec20671c7e5a9135ad7c6e83bb927.tar.gz zlib-d46546544a1ec20671c7e5a9135ad7c6e83bb927.tar.bz2 zlib-d46546544a1ec20671c7e5a9135ad7c6e83bb927.zip | |
Replace as400 with os400 for OS/400 support (Monnerat).
| -rw-r--r-- | as400/bndsrc | 215 | ||||
| -rw-r--r-- | as400/compile.clp | 110 | ||||
| -rw-r--r-- | as400/readme.txt | 115 | ||||
| -rw-r--r-- | os400/README400 | 48 | ||||
| -rw-r--r-- | os400/bndsrc | 100 | ||||
| -rw-r--r-- | os400/make.sh | 366 | ||||
| -rw-r--r-- | os400/zlib.inc (renamed from as400/zlib.inc) | 8 |
7 files changed, 518 insertions, 444 deletions
diff --git a/as400/bndsrc b/as400/bndsrc deleted file mode 100644 index 98814fd4..00000000 --- a/as400/bndsrc +++ /dev/null | |||
| @@ -1,215 +0,0 @@ | |||
| 1 | STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB') | ||
| 2 | |||
| 3 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 4 | /* Version 1.1.3 entry points. */ | ||
| 5 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 6 | |||
| 7 | /********************************************************************/ | ||
| 8 | /* *MODULE ADLER32 ZLIB 01/02/01 00:15:09 */ | ||
| 9 | /********************************************************************/ | ||
| 10 | |||
| 11 | EXPORT SYMBOL("adler32") | ||
| 12 | |||
| 13 | /********************************************************************/ | ||
| 14 | /* *MODULE COMPRESS ZLIB 01/02/01 00:15:09 */ | ||
| 15 | /********************************************************************/ | ||
| 16 | |||
| 17 | EXPORT SYMBOL("compress") | ||
| 18 | EXPORT SYMBOL("compress2") | ||
| 19 | |||
| 20 | /********************************************************************/ | ||
| 21 | /* *MODULE CRC32 ZLIB 01/02/01 00:15:09 */ | ||
| 22 | /********************************************************************/ | ||
| 23 | |||
| 24 | EXPORT SYMBOL("crc32") | ||
| 25 | EXPORT SYMBOL("get_crc_table") | ||
| 26 | |||
| 27 | /********************************************************************/ | ||
| 28 | /* *MODULE DEFLATE ZLIB 01/02/01 00:15:09 */ | ||
| 29 | /********************************************************************/ | ||
| 30 | |||
| 31 | EXPORT SYMBOL("deflate") | ||
| 32 | EXPORT SYMBOL("deflateEnd") | ||
| 33 | EXPORT SYMBOL("deflateSetDictionary") | ||
| 34 | EXPORT SYMBOL("deflateCopy") | ||
| 35 | EXPORT SYMBOL("deflateReset") | ||
| 36 | EXPORT SYMBOL("deflateParams") | ||
| 37 | EXPORT SYMBOL("deflatePrime") | ||
| 38 | EXPORT SYMBOL("deflateInit_") | ||
| 39 | EXPORT SYMBOL("deflateInit2_") | ||
| 40 | |||
| 41 | /********************************************************************/ | ||
| 42 | /* *MODULE GZIO ZLIB 01/02/01 00:15:09 */ | ||
| 43 | /********************************************************************/ | ||
| 44 | |||
| 45 | EXPORT SYMBOL("gzopen") | ||
| 46 | EXPORT SYMBOL("gzdopen") | ||
| 47 | EXPORT SYMBOL("gzsetparams") | ||
| 48 | EXPORT SYMBOL("gzread") | ||
| 49 | EXPORT SYMBOL("gzwrite") | ||
| 50 | EXPORT SYMBOL("gzprintf") | ||
| 51 | EXPORT SYMBOL("gzputs") | ||
| 52 | EXPORT SYMBOL("gzgets") | ||
| 53 | EXPORT SYMBOL("gzputc") | ||
| 54 | EXPORT SYMBOL("gzgetc") | ||
| 55 | EXPORT SYMBOL("gzflush") | ||
| 56 | EXPORT SYMBOL("gzseek") | ||
| 57 | EXPORT SYMBOL("gzrewind") | ||
| 58 | EXPORT SYMBOL("gztell") | ||
| 59 | EXPORT SYMBOL("gzeof") | ||
| 60 | EXPORT SYMBOL("gzclose") | ||
| 61 | EXPORT SYMBOL("gzerror") | ||
| 62 | |||
| 63 | /********************************************************************/ | ||
| 64 | /* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */ | ||
| 65 | /********************************************************************/ | ||
| 66 | |||
| 67 | EXPORT SYMBOL("inflate") | ||
| 68 | EXPORT SYMBOL("inflateEnd") | ||
| 69 | EXPORT SYMBOL("inflateSetDictionary") | ||
| 70 | EXPORT SYMBOL("inflateSync") | ||
| 71 | EXPORT SYMBOL("inflateReset") | ||
| 72 | EXPORT SYMBOL("inflateInit_") | ||
| 73 | EXPORT SYMBOL("inflateInit2_") | ||
| 74 | EXPORT SYMBOL("inflateSyncPoint") | ||
| 75 | |||
| 76 | /********************************************************************/ | ||
| 77 | /* *MODULE UNCOMPR ZLIB 01/02/01 00:15:09 */ | ||
| 78 | /********************************************************************/ | ||
| 79 | |||
| 80 | EXPORT SYMBOL("uncompress") | ||
| 81 | |||
| 82 | /********************************************************************/ | ||
| 83 | /* *MODULE ZUTIL ZLIB 01/02/01 00:15:09 */ | ||
| 84 | /********************************************************************/ | ||
| 85 | |||
| 86 | EXPORT SYMBOL("zlibVersion") | ||
| 87 | EXPORT SYMBOL("zError") | ||
| 88 | |||
| 89 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 90 | /* Version 1.2.1 additional entry points. */ | ||
| 91 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 92 | |||
| 93 | /********************************************************************/ | ||
| 94 | /* *MODULE COMPRESS ZLIB 01/02/01 00:15:09 */ | ||
| 95 | /********************************************************************/ | ||
| 96 | |||
| 97 | EXPORT SYMBOL("compressBound") | ||
| 98 | |||
| 99 | /********************************************************************/ | ||
| 100 | /* *MODULE DEFLATE ZLIB 01/02/01 00:15:09 */ | ||
| 101 | /********************************************************************/ | ||
| 102 | |||
| 103 | EXPORT SYMBOL("deflateBound") | ||
| 104 | |||
| 105 | /********************************************************************/ | ||
| 106 | /* *MODULE GZIO ZLIB 01/02/01 00:15:09 */ | ||
| 107 | /********************************************************************/ | ||
| 108 | |||
| 109 | EXPORT SYMBOL("gzungetc") | ||
| 110 | EXPORT SYMBOL("gzclearerr") | ||
| 111 | |||
| 112 | /********************************************************************/ | ||
| 113 | /* *MODULE INFBACK ZLIB 01/02/01 00:15:09 */ | ||
| 114 | /********************************************************************/ | ||
| 115 | |||
| 116 | EXPORT SYMBOL("inflateBack") | ||
| 117 | EXPORT SYMBOL("inflateBackEnd") | ||
| 118 | EXPORT SYMBOL("inflateBackInit_") | ||
| 119 | |||
| 120 | /********************************************************************/ | ||
| 121 | /* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */ | ||
| 122 | /********************************************************************/ | ||
| 123 | |||
| 124 | EXPORT SYMBOL("inflateCopy") | ||
| 125 | |||
| 126 | /********************************************************************/ | ||
| 127 | /* *MODULE ZUTIL ZLIB 01/02/01 00:15:09 */ | ||
| 128 | /********************************************************************/ | ||
| 129 | |||
| 130 | EXPORT SYMBOL("zlibCompileFlags") | ||
| 131 | |||
| 132 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 133 | /* Version 1.2.5 additional entry points. */ | ||
| 134 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 135 | |||
| 136 | /********************************************************************/ | ||
| 137 | /* *MODULE ADLER32 ZLIB 01/02/01 00:15:09 */ | ||
| 138 | /********************************************************************/ | ||
| 139 | |||
| 140 | EXPORT SYMBOL("adler32_combine") | ||
| 141 | EXPORT SYMBOL("adler32_combine64") | ||
| 142 | |||
| 143 | /********************************************************************/ | ||
| 144 | /* *MODULE CRC32 ZLIB 01/02/01 00:15:09 */ | ||
| 145 | /********************************************************************/ | ||
| 146 | |||
| 147 | EXPORT SYMBOL("crc32_combine") | ||
| 148 | EXPORT SYMBOL("crc32_combine64") | ||
| 149 | |||
| 150 | /********************************************************************/ | ||
| 151 | /* *MODULE GZLIB ZLIB 01/02/01 00:15:09 */ | ||
| 152 | /********************************************************************/ | ||
| 153 | |||
| 154 | EXPORT SYMBOL("gzbuffer") | ||
| 155 | EXPORT SYMBOL("gzoffset") | ||
| 156 | EXPORT SYMBOL("gzoffset64") | ||
| 157 | EXPORT SYMBOL("gzopen64") | ||
| 158 | EXPORT SYMBOL("gzseek64") | ||
| 159 | EXPORT SYMBOL("gztell64") | ||
| 160 | |||
| 161 | /********************************************************************/ | ||
| 162 | /* *MODULE GZREAD ZLIB 01/02/01 00:15:09 */ | ||
| 163 | /********************************************************************/ | ||
| 164 | |||
| 165 | EXPORT SYMBOL("gzclose_r") | ||
| 166 | |||
| 167 | /********************************************************************/ | ||
| 168 | /* *MODULE GZWRITE ZLIB 01/02/01 00:15:09 */ | ||
| 169 | /********************************************************************/ | ||
| 170 | |||
| 171 | EXPORT SYMBOL("gzclose_w") | ||
| 172 | |||
| 173 | /********************************************************************/ | ||
| 174 | /* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */ | ||
| 175 | /********************************************************************/ | ||
| 176 | |||
| 177 | EXPORT SYMBOL("inflateMark") | ||
| 178 | EXPORT SYMBOL("inflatePrime") | ||
| 179 | EXPORT SYMBOL("inflateReset2") | ||
| 180 | EXPORT SYMBOL("inflateUndermine") | ||
| 181 | |||
| 182 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 183 | /* Version 1.2.6 additional entry points. */ | ||
| 184 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 185 | |||
| 186 | /********************************************************************/ | ||
| 187 | /* *MODULE DEFLATE ZLIB 01/02/01 00:15:09 */ | ||
| 188 | /********************************************************************/ | ||
| 189 | |||
| 190 | EXPORT SYMBOL("deflateResetKeep") | ||
| 191 | EXPORT SYMBOL("deflatePending") | ||
| 192 | |||
| 193 | /********************************************************************/ | ||
| 194 | /* *MODULE GZWRITE ZLIB 01/02/01 00:15:09 */ | ||
| 195 | /********************************************************************/ | ||
| 196 | |||
| 197 | EXPORT SYMBOL("gzgetc_") | ||
| 198 | |||
| 199 | /********************************************************************/ | ||
| 200 | /* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */ | ||
| 201 | /********************************************************************/ | ||
| 202 | |||
| 203 | EXPORT SYMBOL("inflateResetKeep") | ||
| 204 | |||
| 205 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 206 | /* Version 1.2.8 additional entry points. */ | ||
| 207 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 208 | |||
| 209 | /********************************************************************/ | ||
| 210 | /* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */ | ||
| 211 | /********************************************************************/ | ||
| 212 | |||
| 213 | EXPORT SYMBOL("inflateGetDictionary") | ||
| 214 | |||
| 215 | ENDPGMEXP | ||
diff --git a/as400/compile.clp b/as400/compile.clp deleted file mode 100644 index 83478d00..00000000 --- a/as400/compile.clp +++ /dev/null | |||
| @@ -1,110 +0,0 @@ | |||
| 1 | /******************************************************************************/ | ||
| 2 | /* */ | ||
| 3 | /* ZLIB */ | ||
| 4 | /* */ | ||
| 5 | /* Compile sources into modules and link them into a service program. */ | ||
| 6 | /* */ | ||
| 7 | /******************************************************************************/ | ||
| 8 | |||
| 9 | PGM | ||
| 10 | |||
| 11 | /* Configuration adjustable parameters. */ | ||
| 12 | |||
| 13 | DCL VAR(&SRCLIB) TYPE(*CHAR) LEN(10) + | ||
| 14 | VALUE('ZLIB') /* Source library. */ | ||
| 15 | DCL VAR(&SRCFILE) TYPE(*CHAR) LEN(10) + | ||
| 16 | VALUE('SOURCES') /* Source member file. */ | ||
| 17 | DCL VAR(&CTLFILE) TYPE(*CHAR) LEN(10) + | ||
| 18 | VALUE('TOOLS') /* Control member file. */ | ||
| 19 | |||
| 20 | DCL VAR(&MODLIB) TYPE(*CHAR) LEN(10) + | ||
| 21 | VALUE('ZLIB') /* Module library. */ | ||
| 22 | |||
| 23 | DCL VAR(&SRVLIB) TYPE(*CHAR) LEN(10) + | ||
| 24 | VALUE('LGPL') /* Service program library. */ | ||
| 25 | |||
| 26 | DCL VAR(&CFLAGS) TYPE(*CHAR) + | ||
| 27 | VALUE('OPTIMIZE(40)') /* Compile options. */ | ||
| 28 | |||
| 29 | DCL VAR(&TGTRLS) TYPE(*CHAR) + | ||
| 30 | VALUE('V5R3M0') /* Target release. */ | ||
| 31 | |||
| 32 | |||
| 33 | /* Working storage. */ | ||
| 34 | |||
| 35 | DCL VAR(&CMDLEN) TYPE(*DEC) LEN(15 5) VALUE(300) /* Command length. */ | ||
| 36 | DCL VAR(&CMD) TYPE(*CHAR) LEN(512) | ||
| 37 | DCL VAR(&FIXDCMD) TYPE(*CHAR) LEN(512) | ||
| 38 | |||
| 39 | |||
| 40 | /* Compile sources into modules. */ | ||
| 41 | |||
| 42 | CHGVAR VAR(&FIXDCMD) VALUE('CRTCMOD' *BCAT &CFLAGS *BCAT + | ||
| 43 | 'SYSIFCOPT(*IFS64IO)' *BCAT + | ||
| 44 | 'DEFINE(''_LARGEFILE64_SOURCE''' *BCAT + | ||
| 45 | '''_LFS64_LARGEFILE=1'') TGTRLS(' *TCAT &TGTRLS *TCAT + | ||
| 46 | ') SRCFILE(' *TCAT &SRCLIB *TCAT '/' *TCAT + | ||
| 47 | &SRCFILE *TCAT ') MODULE(' *TCAT &MODLIB *TCAT '/') | ||
| 48 | |||
| 49 | |||
| 50 | CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'ADLER32)') | ||
| 51 | CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN) | ||
| 52 | |||
| 53 | CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'COMPRESS)') | ||
| 54 | CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN) | ||
| 55 | |||
| 56 | CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'CRC32)') | ||
| 57 | CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN) | ||
| 58 | |||
| 59 | CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'DEFLATE)') | ||
| 60 | CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN) | ||
| 61 | |||
| 62 | CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'GZCLOSE)') | ||
| 63 | CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN) | ||
| 64 | |||
| 65 | CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'GZLIB)') | ||
| 66 | CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN) | ||
| 67 | |||
| 68 | CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'GZREAD)') | ||
| 69 | CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN) | ||
| 70 | |||
| 71 | CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'GZWRITE)') | ||
| 72 | CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN) | ||
| 73 | |||
| 74 | CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'INFBACK)') | ||
| 75 | CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN) | ||
| 76 | |||
| 77 | CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'INFFAST)') | ||
| 78 | CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN) | ||
| 79 | |||
| 80 | CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'INFLATE)') | ||
| 81 | CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN) | ||
| 82 | |||
| 83 | CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'INFTREES)') | ||
| 84 | CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN) | ||
| 85 | |||
| 86 | CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'TREES)') | ||
| 87 | CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN) | ||
| 88 | |||
| 89 | CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'UNCOMPR)') | ||
| 90 | CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN) | ||
| 91 | |||
| 92 | CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'ZUTIL)') | ||
| 93 | CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN) | ||
| 94 | |||
| 95 | |||
| 96 | /* Link modules into a service program. */ | ||
| 97 | |||
| 98 | CRTSRVPGM SRVPGM(&SRVLIB/ZLIB) + | ||
| 99 | MODULE(&MODLIB/ADLER32 &MODLIB/COMPRESS + | ||
| 100 | &MODLIB/CRC32 &MODLIB/DEFLATE + | ||
| 101 | &MODLIB/GZCLOSE &MODLIB/GZLIB + | ||
| 102 | &MODLIB/GZREAD &MODLIB/GZWRITE + | ||
| 103 | &MODLIB/INFBACK &MODLIB/INFFAST + | ||
| 104 | &MODLIB/INFLATE &MODLIB/INFTREES + | ||
| 105 | &MODLIB/TREES &MODLIB/UNCOMPR + | ||
| 106 | &MODLIB/ZUTIL) + | ||
| 107 | SRCFILE(&SRCLIB/&CTLFILE) SRCMBR(BNDSRC) + | ||
| 108 | TEXT('ZLIB 1.2.8.1') TGTRLS(&TGTRLS) | ||
| 109 | |||
| 110 | ENDPGM | ||
diff --git a/as400/readme.txt b/as400/readme.txt deleted file mode 100644 index 77a17207..00000000 --- a/as400/readme.txt +++ /dev/null | |||
| @@ -1,115 +0,0 @@ | |||
| 1 | ZLIB version 1.2.8.1 for AS400 installation instructions | ||
| 2 | |||
| 3 | I) From an AS400 *SAVF file: | ||
| 4 | |||
| 5 | 1) Unpacking archive to an AS400 save file | ||
| 6 | |||
| 7 | On the AS400: | ||
| 8 | |||
| 9 | _ Create the ZLIB AS400 library: | ||
| 10 | |||
| 11 | CRTLIB LIB(ZLIB) TYPE(*PROD) TEXT('ZLIB compression API library') | ||
| 12 | |||
| 13 | _ Create a work save file, for example: | ||
| 14 | |||
| 15 | CRTSAVF FILE(ZLIB/ZLIBSAVF) | ||
| 16 | |||
| 17 | On a PC connected to the target AS400: | ||
| 18 | |||
| 19 | _ Unpack the save file image to a PC file "ZLIBSAVF" | ||
| 20 | _ Upload this file into the save file on the AS400, for example | ||
| 21 | using ftp in BINARY mode. | ||
| 22 | |||
| 23 | |||
| 24 | 2) Populating the ZLIB AS400 source library | ||
| 25 | |||
| 26 | On the AS400: | ||
| 27 | |||
| 28 | _ Extract the saved objects into the ZLIB AS400 library using: | ||
| 29 | |||
| 30 | RSTOBJ OBJ(*ALL) SAVLIB(ZLIB) DEV(*SAVF) SAVF(ZLIB/ZLIBSAVF) RSTLIB(ZLIB) | ||
| 31 | |||
| 32 | |||
| 33 | 3) Customize installation: | ||
| 34 | |||
| 35 | _ Edit CL member ZLIB/TOOLS(COMPILE) and change parameters if needed, | ||
| 36 | according to the comments. | ||
| 37 | |||
| 38 | _ Compile this member with: | ||
| 39 | |||
| 40 | CRTCLPGM PGM(ZLIB/COMPILE) SRCFILE(ZLIB/TOOLS) SRCMBR(COMPILE) | ||
| 41 | |||
| 42 | |||
| 43 | 4) Compile and generate the service program: | ||
| 44 | |||
| 45 | _ This can now be done by executing: | ||
| 46 | |||
| 47 | CALL PGM(ZLIB/COMPILE) | ||
| 48 | |||
| 49 | |||
| 50 | |||
| 51 | II) From the original source distribution: | ||
| 52 | |||
| 53 | 1) On the AS400, create the source library: | ||
| 54 | |||
| 55 | CRTLIB LIB(ZLIB) TYPE(*PROD) TEXT('ZLIB compression API library') | ||
| 56 | |||
| 57 | 2) Create the source files: | ||
| 58 | |||
| 59 | CRTSRCPF FILE(ZLIB/SOURCES) RCDLEN(112) TEXT('ZLIB library modules') | ||
| 60 | CRTSRCPF FILE(ZLIB/H) RCDLEN(112) TEXT('ZLIB library includes') | ||
| 61 | CRTSRCPF FILE(ZLIB/TOOLS) RCDLEN(112) TEXT('ZLIB library control utilities') | ||
| 62 | |||
| 63 | 3) From the machine hosting the distribution files, upload them (with | ||
| 64 | FTP in text mode, for example) according to the following table: | ||
| 65 | |||
| 66 | Original AS400 AS400 AS400 AS400 | ||
| 67 | file file member type description | ||
| 68 | SOURCES Original ZLIB C subprogram sources | ||
| 69 | adler32.c ADLER32 C ZLIB - Compute the Adler-32 checksum of a dta strm | ||
| 70 | compress.c COMPRESS C ZLIB - Compress a memory buffer | ||
| 71 | crc32.c CRC32 C ZLIB - Compute the CRC-32 of a data stream | ||
| 72 | deflate.c DEFLATE C ZLIB - Compress data using the deflation algorithm | ||
| 73 | gzclose.c GZCLOSE C ZLIB - Close .gz files | ||
| 74 | gzlib.c GZLIB C ZLIB - Miscellaneous .gz files IO support | ||
| 75 | gzread.c GZREAD C ZLIB - Read .gz files | ||
| 76 | gzwrite.c GZWRITE C ZLIB - Write .gz files | ||
| 77 | infback.c INFBACK C ZLIB - Inflate using a callback interface | ||
| 78 | inffast.c INFFAST C ZLIB - Fast proc. literals & length/distance pairs | ||
| 79 | inflate.c INFLATE C ZLIB - Interface to inflate modules | ||
| 80 | inftrees.c INFTREES C ZLIB - Generate Huffman trees for efficient decode | ||
| 81 | trees.c TREES C ZLIB - Output deflated data using Huffman coding | ||
| 82 | uncompr.c UNCOMPR C ZLIB - Decompress a memory buffer | ||
| 83 | zutil.c ZUTIL C ZLIB - Target dependent utility functions | ||
| 84 | H Original ZLIB C and ILE/RPG include files | ||
| 85 | crc32.h CRC32 C ZLIB - CRC32 tables | ||
| 86 | deflate.h DEFLATE C ZLIB - Internal compression state | ||
| 87 | gzguts.h GZGUTS C ZLIB - Definitions for the gzclose module | ||
| 88 | inffast.h INFFAST C ZLIB - Header to use inffast.c | ||
| 89 | inffixed.h INFFIXED C ZLIB - Table for decoding fixed codes | ||
| 90 | inflate.h INFLATE C ZLIB - Internal inflate state definitions | ||
| 91 | inftrees.h INFTREES C ZLIB - Header to use inftrees.c | ||
| 92 | trees.h TREES C ZLIB - Created automatically with -DGEN_TREES_H | ||
| 93 | zconf.h ZCONF C ZLIB - Compression library configuration | ||
| 94 | zlib.h ZLIB C ZLIB - Compression library C user interface | ||
| 95 | as400/zlib.inc ZLIB.INC RPGLE ZLIB - Compression library ILE RPG user interface | ||
| 96 | zutil.h ZUTIL C ZLIB - Internal interface and configuration | ||
| 97 | TOOLS Building source software & AS/400 README | ||
| 98 | as400/bndsrc BNDSRC Entry point exportation list | ||
| 99 | as400/compile.clp COMPILE CLP Compile sources & generate service program | ||
| 100 | as400/readme.txt README TXT Installation instructions | ||
| 101 | |||
| 102 | 4) Continue as in I)3). | ||
| 103 | |||
| 104 | |||
| 105 | |||
| 106 | |||
| 107 | Notes: For AS400 ILE RPG programmers, a /copy member defining the ZLIB | ||
| 108 | API prototypes for ILE RPG can be found in ZLIB/H(ZLIB.INC). | ||
| 109 | Please read comments in this member for more information. | ||
| 110 | |||
| 111 | Remember that most foreign textual data are ASCII coded: this | ||
| 112 | implementation does not handle conversion from/to ASCII, so | ||
| 113 | text data code conversions must be done explicitely. | ||
| 114 | |||
| 115 | Mainly for the reason above, always open zipped files in binary mode. | ||
diff --git a/os400/README400 b/os400/README400 new file mode 100644 index 00000000..601f1aef --- /dev/null +++ b/os400/README400 | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | ZLIB version 1.2.8 for OS/400 installation instructions | ||
| 2 | |||
| 3 | 1) Download and unpack the zlib tarball to some IFS directory. | ||
| 4 | (i.e.: /path/to/the/zlib/ifs/source/directory) | ||
| 5 | |||
| 6 | If the installed IFS command suppors gzip format, this is straightforward, | ||
| 7 | else you have to unpack first to some directory on a system supporting it, | ||
| 8 | then move the whole directory to the IFS via the network (via SMB or FTP). | ||
| 9 | |||
| 10 | 2) Edit the configuration parameters in the compilation script. | ||
| 11 | |||
| 12 | EDTF STMF('/path/to/the/zlib/ifs/source/directory/os400/make.sh') | ||
| 13 | |||
| 14 | Tune the parameters according to your needs if not matching the defaults. | ||
| 15 | Save the file and exit after edition. | ||
| 16 | |||
| 17 | 3) Enter qshell, then work in the zlib OS/400 specific directory. | ||
| 18 | |||
| 19 | QSH | ||
| 20 | cd /path/to/the/zlib/ifs/source/directory/os400 | ||
| 21 | |||
| 22 | 4) Compile and install | ||
| 23 | |||
| 24 | sh make.sh | ||
| 25 | |||
| 26 | The script will: | ||
| 27 | - create the libraries, objects and IFS directories for the zlib environment, | ||
| 28 | - compile all modules, | ||
| 29 | - create a service program, | ||
| 30 | - create a static and a dynamic binding directory, | ||
| 31 | - install header files for C/C++ and for ILE/RPG, both for compilation in | ||
| 32 | DB2 and IFS environments. | ||
| 33 | |||
| 34 | That's all. | ||
| 35 | |||
| 36 | |||
| 37 | Notes: For OS/400 ILE RPG programmers, a /copy member defining the ZLIB | ||
| 38 | API prototypes for ILE RPG can be found in ZLIB/H(ZLIB.INC). | ||
| 39 | In the ILE environment, the same definitions are available from | ||
| 40 | file zlib.inc located in the same IFS include directory as the | ||
| 41 | C/C++ header files. | ||
| 42 | Please read comments in this member for more information. | ||
| 43 | |||
| 44 | Remember that most foreign textual data are ASCII coded: this | ||
| 45 | implementation does not handle conversion from/to ASCII, so | ||
| 46 | text data code conversions must be done explicitely. | ||
| 47 | |||
| 48 | Mainly for the reason above, always open zipped files in binary mode. | ||
diff --git a/os400/bndsrc b/os400/bndsrc new file mode 100644 index 00000000..934d781a --- /dev/null +++ b/os400/bndsrc | |||
| @@ -0,0 +1,100 @@ | |||
| 1 | STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB') | ||
| 2 | |||
| 3 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 4 | /* Version 1.1.3 entry points. */ | ||
| 5 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 6 | |||
| 7 | EXPORT SYMBOL("adler32") | ||
| 8 | EXPORT SYMBOL("compress") | ||
| 9 | EXPORT SYMBOL("compress2") | ||
| 10 | EXPORT SYMBOL("crc32") | ||
| 11 | EXPORT SYMBOL("get_crc_table") | ||
| 12 | EXPORT SYMBOL("deflate") | ||
| 13 | EXPORT SYMBOL("deflateEnd") | ||
| 14 | EXPORT SYMBOL("deflateSetDictionary") | ||
| 15 | EXPORT SYMBOL("deflateCopy") | ||
| 16 | EXPORT SYMBOL("deflateReset") | ||
| 17 | EXPORT SYMBOL("deflateParams") | ||
| 18 | EXPORT SYMBOL("deflatePrime") | ||
| 19 | EXPORT SYMBOL("deflateInit_") | ||
| 20 | EXPORT SYMBOL("deflateInit2_") | ||
| 21 | EXPORT SYMBOL("gzopen") | ||
| 22 | EXPORT SYMBOL("gzdopen") | ||
| 23 | EXPORT SYMBOL("gzsetparams") | ||
| 24 | EXPORT SYMBOL("gzread") | ||
| 25 | EXPORT SYMBOL("gzwrite") | ||
| 26 | EXPORT SYMBOL("gzprintf") | ||
| 27 | EXPORT SYMBOL("gzputs") | ||
| 28 | EXPORT SYMBOL("gzgets") | ||
| 29 | EXPORT SYMBOL("gzputc") | ||
| 30 | EXPORT SYMBOL("gzgetc") | ||
| 31 | EXPORT SYMBOL("gzflush") | ||
| 32 | EXPORT SYMBOL("gzseek") | ||
| 33 | EXPORT SYMBOL("gzrewind") | ||
| 34 | EXPORT SYMBOL("gztell") | ||
| 35 | EXPORT SYMBOL("gzeof") | ||
| 36 | EXPORT SYMBOL("gzclose") | ||
| 37 | EXPORT SYMBOL("gzerror") | ||
| 38 | EXPORT SYMBOL("inflate") | ||
| 39 | EXPORT SYMBOL("inflateEnd") | ||
| 40 | EXPORT SYMBOL("inflateSetDictionary") | ||
| 41 | EXPORT SYMBOL("inflateSync") | ||
| 42 | EXPORT SYMBOL("inflateReset") | ||
| 43 | EXPORT SYMBOL("inflateInit_") | ||
| 44 | EXPORT SYMBOL("inflateInit2_") | ||
| 45 | EXPORT SYMBOL("inflateSyncPoint") | ||
| 46 | EXPORT SYMBOL("uncompress") | ||
| 47 | EXPORT SYMBOL("zlibVersion") | ||
| 48 | EXPORT SYMBOL("zError") | ||
| 49 | |||
| 50 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 51 | /* Version 1.2.1 additional entry points. */ | ||
| 52 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 53 | |||
| 54 | EXPORT SYMBOL("compressBound") | ||
| 55 | EXPORT SYMBOL("deflateBound") | ||
| 56 | EXPORT SYMBOL("gzungetc") | ||
| 57 | EXPORT SYMBOL("gzclearerr") | ||
| 58 | EXPORT SYMBOL("inflateBack") | ||
| 59 | EXPORT SYMBOL("inflateBackEnd") | ||
| 60 | EXPORT SYMBOL("inflateBackInit_") | ||
| 61 | EXPORT SYMBOL("inflateCopy") | ||
| 62 | EXPORT SYMBOL("zlibCompileFlags") | ||
| 63 | |||
| 64 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 65 | /* Version 1.2.5 additional entry points. */ | ||
| 66 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 67 | |||
| 68 | EXPORT SYMBOL("adler32_combine") | ||
| 69 | EXPORT SYMBOL("adler32_combine64") | ||
| 70 | EXPORT SYMBOL("crc32_combine") | ||
| 71 | EXPORT SYMBOL("crc32_combine64") | ||
| 72 | EXPORT SYMBOL("gzbuffer") | ||
| 73 | EXPORT SYMBOL("gzoffset") | ||
| 74 | EXPORT SYMBOL("gzoffset64") | ||
| 75 | EXPORT SYMBOL("gzopen64") | ||
| 76 | EXPORT SYMBOL("gzseek64") | ||
| 77 | EXPORT SYMBOL("gztell64") | ||
| 78 | EXPORT SYMBOL("gzclose_r") | ||
| 79 | EXPORT SYMBOL("gzclose_w") | ||
| 80 | EXPORT SYMBOL("inflateMark") | ||
| 81 | EXPORT SYMBOL("inflatePrime") | ||
| 82 | EXPORT SYMBOL("inflateReset2") | ||
| 83 | EXPORT SYMBOL("inflateUndermine") | ||
| 84 | |||
| 85 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 86 | /* Version 1.2.6 additional entry points. */ | ||
| 87 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 88 | |||
| 89 | EXPORT SYMBOL("deflateResetKeep") | ||
| 90 | EXPORT SYMBOL("deflatePending") | ||
| 91 | EXPORT SYMBOL("gzgetc_") | ||
| 92 | EXPORT SYMBOL("inflateResetKeep") | ||
| 93 | |||
| 94 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 95 | /* Version 1.2.8 additional entry points. */ | ||
| 96 | /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ | ||
| 97 | |||
| 98 | EXPORT SYMBOL("inflateGetDictionary") | ||
| 99 | |||
| 100 | ENDPGMEXP | ||
diff --git a/os400/make.sh b/os400/make.sh new file mode 100644 index 00000000..ddbfb16b --- /dev/null +++ b/os400/make.sh | |||
| @@ -0,0 +1,366 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # ZLIB compilation script for the OS/400. | ||
| 4 | # | ||
| 5 | # | ||
| 6 | # This is a shell script since make is not a standard component of OS/400. | ||
| 7 | |||
| 8 | |||
| 9 | ################################################################################ | ||
| 10 | # | ||
| 11 | # Tunable configuration parameters. | ||
| 12 | # | ||
| 13 | ################################################################################ | ||
| 14 | |||
| 15 | TARGETLIB='ZLIB' # Target OS/400 program library | ||
| 16 | STATBNDDIR='ZLIB_A' # Static binding directory. | ||
| 17 | DYNBNDDIR='ZLIB' # Dynamic binding directory. | ||
| 18 | SRVPGM="ZLIB" # Service program. | ||
| 19 | IFSDIR='/zlib' # IFS support base directory. | ||
| 20 | TGTCCSID='500' # Target CCSID of objects | ||
| 21 | DEBUG='*NONE' # Debug level | ||
| 22 | OPTIMIZE='40' # Optimisation level | ||
| 23 | OUTPUT='*NONE' # Compilation output option. | ||
| 24 | TGTRLS='V6R1M0' # Target OS release | ||
| 25 | |||
| 26 | export TARGETLIB STATBNDDIR DYNBNDDIR SRVPGM IFSDIR | ||
| 27 | export TGTCCSID DEBUG OPTIMIZE OUTPUT TGTRLS | ||
| 28 | |||
| 29 | |||
| 30 | ################################################################################ | ||
| 31 | # | ||
| 32 | # OS/400 specific definitions. | ||
| 33 | # | ||
| 34 | ################################################################################ | ||
| 35 | |||
| 36 | LIBIFSNAME="/QSYS.LIB/${TARGETLIB}.LIB" | ||
| 37 | |||
| 38 | |||
| 39 | ################################################################################ | ||
| 40 | # | ||
| 41 | # Procedures. | ||
| 42 | # | ||
| 43 | ################################################################################ | ||
| 44 | |||
| 45 | # action_needed dest [src] | ||
| 46 | # | ||
| 47 | # dest is an object to build | ||
| 48 | # if specified, src is an object on which dest depends. | ||
| 49 | # | ||
| 50 | # exit 0 (succeeds) if some action has to be taken, else 1. | ||
| 51 | |||
| 52 | action_needed() | ||
| 53 | |||
| 54 | { | ||
| 55 | [ ! -e "${1}" ] && return 0 | ||
| 56 | [ "${2}" ] || return 1 | ||
| 57 | [ "${1}" -ot "${2}" ] && return 0 | ||
| 58 | return 1 | ||
| 59 | } | ||
| 60 | |||
| 61 | |||
| 62 | # make_module module_name source_name [additional_definitions] | ||
| 63 | # | ||
| 64 | # Compile source name into module if needed. | ||
| 65 | # As side effect, append the module name to variable MODULES. | ||
| 66 | # Set LINK to "YES" if the module has been compiled. | ||
| 67 | |||
| 68 | make_module() | ||
| 69 | |||
| 70 | { | ||
| 71 | MODULES="${MODULES} ${1}" | ||
| 72 | MODIFSNAME="${LIBIFSNAME}/${1}.MODULE" | ||
| 73 | CSRC="`basename \"${2}\"`" | ||
| 74 | |||
| 75 | if action_needed "${MODIFSNAME}" "${2}" | ||
| 76 | then : | ||
| 77 | elif [ ! "`sed -e \"/<source name=\\\"${CSRC}\\\">/,/<\\\\/source>/!d\" \ | ||
| 78 | -e '/<depend /!d' \ | ||
| 79 | -e 's/.* name=\"\\([^\"]*\\)\".*/\\1/' < \"${TOPDIR}/treebuild.xml\" | | ||
| 80 | while read HDR | ||
| 81 | do if action_needed \"${MODIFSNAME}\" \"${IFSDIR}/include/${HDR}\" | ||
| 82 | then echo recompile | ||
| 83 | break | ||
| 84 | fi | ||
| 85 | done`" ] | ||
| 86 | then return 0 | ||
| 87 | fi | ||
| 88 | |||
| 89 | CMD="CRTCMOD MODULE(${TARGETLIB}/${1}) SRCSTMF('${2}')" | ||
| 90 | CMD="${CMD} SYSIFCOPT(*IFS64IO) OPTION(*INCDIRFIRST)" | ||
| 91 | CMD="${CMD} LOCALETYPE(*LOCALE) FLAG(10)" | ||
| 92 | CMD="${CMD} INCDIR('${IFSDIR}/include' ${INCLUDES})" | ||
| 93 | CMD="${CMD} TGTCCSID(${TGTCCSID}) TGTRLS(${TGTRLS})" | ||
| 94 | CMD="${CMD} OUTPUT(${OUTPUT})" | ||
| 95 | CMD="${CMD} OPTIMIZE(${OPTIMIZE})" | ||
| 96 | CMD="${CMD} DBGVIEW(${DEBUG})" | ||
| 97 | system "${CMD}" | ||
| 98 | LINK=YES | ||
| 99 | } | ||
| 100 | |||
| 101 | |||
| 102 | # Determine DB2 object name from IFS name. | ||
| 103 | |||
| 104 | db2_name() | ||
| 105 | |||
| 106 | { | ||
| 107 | basename "${1}" | | ||
| 108 | tr 'a-z-' 'A-Z_' | | ||
| 109 | sed -e 's/\..*//' \ | ||
| 110 | -e 's/^\(.\).*\(.........\)$/\1\2/' | ||
| 111 | } | ||
| 112 | |||
| 113 | |||
| 114 | # Force enumeration types to be the same size as integers. | ||
| 115 | |||
| 116 | copy_hfile() | ||
| 117 | |||
| 118 | { | ||
| 119 | sed -e '1i\ | ||
| 120 | #pragma enum(int)\ | ||
| 121 | ' "${@}" -e '$a\ | ||
| 122 | #pragma enum(pop)\ | ||
| 123 | ' | ||
| 124 | } | ||
| 125 | |||
| 126 | |||
| 127 | ################################################################################ | ||
| 128 | # | ||
| 129 | # Script initialization. | ||
| 130 | # | ||
| 131 | ################################################################################ | ||
| 132 | |||
| 133 | SCRIPTDIR=`dirname "${0}"` | ||
| 134 | |||
| 135 | case "${SCRIPTDIR}" in | ||
| 136 | /*) ;; | ||
| 137 | *) SCRIPTDIR="`pwd`/${SCRIPTDIR}" | ||
| 138 | esac | ||
| 139 | |||
| 140 | while true | ||
| 141 | do case "${SCRIPTDIR}" in | ||
| 142 | */.) SCRIPTDIR="${SCRIPTDIR%/.}";; | ||
| 143 | *) break;; | ||
| 144 | esac | ||
| 145 | done | ||
| 146 | |||
| 147 | # The script directory is supposed to be in ${TOPDIR}/os400. | ||
| 148 | |||
| 149 | TOPDIR=`dirname "${SCRIPTDIR}"` | ||
| 150 | export SCRIPTDIR TOPDIR | ||
| 151 | cd "${TOPDIR}" | ||
| 152 | |||
| 153 | |||
| 154 | # Extract the version from the master compilation XML file. | ||
| 155 | |||
| 156 | VERSION=`sed -e '/^<package /!d' \ | ||
| 157 | -e 's/^.* version="\([0-9.]*\)".*$/\1/' -e 'q' \ | ||
| 158 | < treebuild.xml` | ||
| 159 | export VERSION | ||
| 160 | |||
| 161 | ################################################################################ | ||
| 162 | |||
| 163 | |||
| 164 | # Create the OS/400 library if it does not exist. | ||
| 165 | |||
| 166 | if action_needed "${LIBIFSNAME}" | ||
| 167 | then CMD="CRTLIB LIB(${TARGETLIB}) TEXT('ZLIB: Data compression API')" | ||
| 168 | system "${CMD}" | ||
| 169 | fi | ||
| 170 | |||
| 171 | |||
| 172 | # Create the DOCS source file if it does not exist. | ||
| 173 | |||
| 174 | if action_needed "${LIBIFSNAME}/DOCS.FILE" | ||
| 175 | then CMD="CRTSRCPF FILE(${TARGETLIB}/DOCS) RCDLEN(112)" | ||
| 176 | CMD="${CMD} CCSID(${TGTCCSID}) TEXT('Documentation texts')" | ||
| 177 | system "${CMD}" | ||
| 178 | fi | ||
| 179 | |||
| 180 | # Copy some documentation files if needed. | ||
| 181 | |||
| 182 | for TEXT in "${TOPDIR}/ChangeLog" "${TOPDIR}/FAQ" \ | ||
| 183 | "${TOPDIR}/README" "${SCRIPTDIR}/README400" | ||
| 184 | do MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${TEXT}\"`.MBR" | ||
| 185 | |||
| 186 | if action_needed "${MEMBER}" "${TEXT}" | ||
| 187 | then CMD="CPY OBJ('${TEXT}') TOOBJ('${MEMBER}') TOCCSID(${TGTCCSID})" | ||
| 188 | CMD="${CMD} DTAFMT(*TEXT) REPLACE(*YES)" | ||
| 189 | system "${CMD}" | ||
| 190 | fi | ||
| 191 | done | ||
| 192 | |||
| 193 | |||
| 194 | # Create the OS/400 source program file for the C header files. | ||
| 195 | |||
| 196 | SRCPF="${LIBIFSNAME}/H.FILE" | ||
| 197 | |||
| 198 | if action_needed "${SRCPF}" | ||
| 199 | then CMD="CRTSRCPF FILE(${TARGETLIB}/H) RCDLEN(112)" | ||
| 200 | CMD="${CMD} CCSID(${TGTCCSID}) TEXT('ZLIB: C/C++ header files')" | ||
| 201 | system "${CMD}" | ||
| 202 | fi | ||
| 203 | |||
| 204 | |||
| 205 | # Create the IFS directory for the C header files. | ||
| 206 | |||
| 207 | if action_needed "${IFSDIR}/include" | ||
| 208 | then mkdir -p "${IFSDIR}/include" | ||
| 209 | fi | ||
| 210 | |||
| 211 | # Copy the header files to DB2 library. Link from IFS include directory. | ||
| 212 | |||
| 213 | for HFILE in "${TOPDIR}/"*.h | ||
| 214 | do DEST="${SRCPF}/`db2_name \"${HFILE}\"`.MBR" | ||
| 215 | |||
| 216 | if action_needed "${DEST}" "${HFILE}" | ||
| 217 | then copy_hfile < "${HFILE}" > tmphdrfile | ||
| 218 | |||
| 219 | # Need to translate to target CCSID. | ||
| 220 | |||
| 221 | CMD="CPY OBJ('`pwd`/tmphdrfile') TOOBJ('${DEST}')" | ||
| 222 | CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)" | ||
| 223 | system "${CMD}" | ||
| 224 | # touch -r "${HFILE}" "${DEST}" | ||
| 225 | rm -f tmphdrfile | ||
| 226 | fi | ||
| 227 | |||
| 228 | IFSFILE="${IFSDIR}/include/`basename \"${HFILE}\"`" | ||
| 229 | |||
| 230 | if action_needed "${IFSFILE}" "${DEST}" | ||
| 231 | then rm -f "${IFSFILE}" | ||
| 232 | ln -s "${DEST}" "${IFSFILE}" | ||
| 233 | fi | ||
| 234 | done | ||
| 235 | |||
| 236 | |||
| 237 | # Install the ILE/RPG header file. | ||
| 238 | |||
| 239 | |||
| 240 | HFILE="${SCRIPTDIR}/zlib.inc" | ||
| 241 | DEST="${SRCPF}/ZLIB.INC.MBR" | ||
| 242 | |||
| 243 | if action_needed "${DEST}" "${HFILE}" | ||
| 244 | then CMD="CPY OBJ('${HFILE}') TOOBJ('${DEST}')" | ||
| 245 | CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)" | ||
| 246 | system "${CMD}" | ||
| 247 | # touch -r "${HFILE}" "${DEST}" | ||
| 248 | fi | ||
| 249 | |||
| 250 | IFSFILE="${IFSDIR}/include/`basename \"${HFILE}\"`" | ||
| 251 | |||
| 252 | if action_needed "${IFSFILE}" "${DEST}" | ||
| 253 | then rm -f "${IFSFILE}" | ||
| 254 | ln -s "${DEST}" "${IFSFILE}" | ||
| 255 | fi | ||
| 256 | |||
| 257 | |||
| 258 | # Create and compile the identification source file. | ||
| 259 | |||
| 260 | echo '#pragma comment(user, "ZLIB version '"${VERSION}"'")' > os400.c | ||
| 261 | echo '#pragma comment(user, __DATE__)' >> os400.c | ||
| 262 | echo '#pragma comment(user, __TIME__)' >> os400.c | ||
| 263 | echo '#pragma comment(copyright, "Copyright (C) 1995-2016 Jean-Loup Gailly, Mark Adler. OS/400 version by P. Monnerat.")' >> os400.c | ||
| 264 | make_module OS400 os400.c | ||
| 265 | LINK= # No need to rebuild service program yet. | ||
| 266 | MODULES= | ||
| 267 | |||
| 268 | |||
| 269 | # Get source list. | ||
| 270 | |||
| 271 | CSOURCES=`sed -e '/<source name="/!d' \ | ||
| 272 | -e 's/.* name="\([^"]*\)".*/\1/' < treebuild.xml` | ||
| 273 | |||
| 274 | # Compile the sources into modules. | ||
| 275 | |||
| 276 | for SRC in ${CSOURCES} | ||
| 277 | do MODULE=`db2_name "${SRC}"` | ||
| 278 | make_module "${MODULE}" "${SRC}" | ||
| 279 | done | ||
| 280 | |||
| 281 | |||
| 282 | # If needed, (re)create the static binding directory. | ||
| 283 | |||
| 284 | if action_needed "${LIBIFSNAME}/${STATBNDDIR}.BNDDIR" | ||
| 285 | then LINK=YES | ||
| 286 | fi | ||
| 287 | |||
| 288 | if [ "${LINK}" ] | ||
| 289 | then rm -rf "${LIBIFSNAME}/${STATBNDDIR}.BNDDIR" | ||
| 290 | CMD="CRTBNDDIR BNDDIR(${TARGETLIB}/${STATBNDDIR})" | ||
| 291 | CMD="${CMD} TEXT('ZLIB static binding directory')" | ||
| 292 | system "${CMD}" | ||
| 293 | |||
| 294 | for MODULE in ${MODULES} | ||
| 295 | do CMD="ADDBNDDIRE BNDDIR(${TARGETLIB}/${STATBNDDIR})" | ||
| 296 | CMD="${CMD} OBJ((${TARGETLIB}/${MODULE} *MODULE))" | ||
| 297 | system "${CMD}" | ||
| 298 | done | ||
| 299 | fi | ||
| 300 | |||
| 301 | |||
| 302 | # The exportation file for service program creation must be in a DB2 | ||
| 303 | # source file, so make sure it exists. | ||
| 304 | |||
| 305 | if action_needed "${LIBIFSNAME}/TOOLS.FILE" | ||
| 306 | then CMD="CRTSRCPF FILE(${TARGETLIB}/TOOLS) RCDLEN(112)" | ||
| 307 | CMD="${CMD} CCSID(${TGTCCSID}) TEXT('ZLIB: build tools')" | ||
| 308 | system "${CMD}" | ||
| 309 | fi | ||
| 310 | |||
| 311 | |||
| 312 | DEST="${LIBIFSNAME}/TOOLS.FILE/BNDSRC.MBR" | ||
| 313 | |||
| 314 | if action_needed "${SCRIPTDIR}/bndsrc" "${DEST}" | ||
| 315 | then CMD="CPY OBJ('${SCRIPTDIR}/bndsrc') TOOBJ('${DEST}')" | ||
| 316 | CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)" | ||
| 317 | system "${CMD}" | ||
| 318 | # touch -r "${SCRIPTDIR}/bndsrc" "${DEST}" | ||
| 319 | LINK=YES | ||
| 320 | fi | ||
| 321 | |||
| 322 | |||
| 323 | # Build the service program if needed. | ||
| 324 | |||
| 325 | if action_needed "${LIBIFSNAME}/${SRVPGM}.SRVPGM" | ||
| 326 | then LINK=YES | ||
| 327 | fi | ||
| 328 | |||
| 329 | if [ "${LINK}" ] | ||
| 330 | then CMD="CRTSRVPGM SRVPGM(${TARGETLIB}/${SRVPGM})" | ||
| 331 | CMD="${CMD} SRCFILE(${TARGETLIB}/TOOLS) SRCMBR(BNDSRC)" | ||
| 332 | CMD="${CMD} MODULE(${TARGETLIB}/OS400)" | ||
| 333 | CMD="${CMD} BNDDIR(${TARGETLIB}/${STATBNDDIR})" | ||
| 334 | CMD="${CMD} TEXT('ZLIB ${VERSION} dynamic library')" | ||
| 335 | CMD="${CMD} TGTRLS(${TGTRLS})" | ||
| 336 | system "${CMD}" | ||
| 337 | LINK=YES | ||
| 338 | |||
| 339 | # Duplicate the service program for a versioned backup. | ||
| 340 | |||
| 341 | BACKUP=`echo "${SRVPGM}${VERSION}" | | ||
| 342 | sed -e 's/.*\(..........\)$/\1/' -e 's/\./_/g'` | ||
| 343 | BACKUP="`db2_name \"${BACKUP}\"`" | ||
| 344 | BKUPIFSNAME="${LIBIFSNAME}/${BACKUP}.SRVPGM" | ||
| 345 | rm -f "${BKUPIFSNAME}" | ||
| 346 | CMD="CRTDUPOBJ OBJ(${SRVPGM}) FROMLIB(${TARGETLIB})" | ||
| 347 | CMD="${CMD} OBJTYPE(*SRVPGM) NEWOBJ(${BACKUP})" | ||
| 348 | system "${CMD}" | ||
| 349 | fi | ||
| 350 | |||
| 351 | |||
| 352 | # If needed, (re)create the dynamic binding directory. | ||
| 353 | |||
| 354 | if action_needed "${LIBIFSNAME}/${DYNBNDDIR}.BNDDIR" | ||
| 355 | then LINK=YES | ||
| 356 | fi | ||
| 357 | |||
| 358 | if [ "${LINK}" ] | ||
| 359 | then rm -rf "${LIBIFSNAME}/${DYNBNDDIR}.BNDDIR" | ||
| 360 | CMD="CRTBNDDIR BNDDIR(${TARGETLIB}/${DYNBNDDIR})" | ||
| 361 | CMD="${CMD} TEXT('ZLIB dynamic binding directory')" | ||
| 362 | system "${CMD}" | ||
| 363 | CMD="ADDBNDDIRE BNDDIR(${TARGETLIB}/${DYNBNDDIR})" | ||
| 364 | CMD="${CMD} OBJ((*LIBL/${SRVPGM} *SRVPGM))" | ||
| 365 | system "${CMD}" | ||
| 366 | fi | ||
diff --git a/as400/zlib.inc b/os400/zlib.inc index e6d33970..7341a6d8 100644 --- a/as400/zlib.inc +++ b/os400/zlib.inc | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | * ZLIB.INC - Interface to the general purpose compression library | 1 | * ZLIB.INC - Interface to the general purpose compression library |
| 2 | * | 2 | * |
| 3 | * ILE RPG400 version by Patrick Monnerat, DATASPHERE. | 3 | * ILE RPG400 version by Patrick Monnerat, DATASPHERE. |
| 4 | * Version 1.2.8.1 | 4 | * Version 1.2.8 |
| 5 | * | 5 | * |
| 6 | * | 6 | * |
| 7 | * WARNING: | 7 | * WARNING: |
| @@ -22,14 +22,14 @@ | |||
| 22 | * | 22 | * |
| 23 | * Versioning information. | 23 | * Versioning information. |
| 24 | * | 24 | * |
| 25 | D ZLIB_VERSION C '1.2.8.1' | 25 | D ZLIB_VERSION C '1.2.8' |
| 26 | D ZLIB_VERNUM C X'1281' | 26 | D ZLIB_VERNUM C X'1280' |
| 27 | D ZLIB_VER_MAJOR C 1 | 27 | D ZLIB_VER_MAJOR C 1 |
| 28 | D ZLIB_VER_MINOR C 2 | 28 | D ZLIB_VER_MINOR C 2 |
| 29 | D ZLIB_VER_REVISION... | 29 | D ZLIB_VER_REVISION... |
| 30 | D C 8 | 30 | D C 8 |
| 31 | D ZLIB_VER_SUBREVISION... | 31 | D ZLIB_VER_SUBREVISION... |
| 32 | D C 1 | 32 | D C 0 |
| 33 | * | 33 | * |
| 34 | * Other equates. | 34 | * Other equates. |
| 35 | * | 35 | * |
