提交 d4654654 编写于 作者: M Mark Adler

Replace as400 with os400 for OS/400 support (Monnerat).

上级 f12d3dc3
/******************************************************************************/
/* */
/* ZLIB */
/* */
/* Compile sources into modules and link them into a service program. */
/* */
/******************************************************************************/
PGM
/* Configuration adjustable parameters. */
DCL VAR(&SRCLIB) TYPE(*CHAR) LEN(10) +
VALUE('ZLIB') /* Source library. */
DCL VAR(&SRCFILE) TYPE(*CHAR) LEN(10) +
VALUE('SOURCES') /* Source member file. */
DCL VAR(&CTLFILE) TYPE(*CHAR) LEN(10) +
VALUE('TOOLS') /* Control member file. */
DCL VAR(&MODLIB) TYPE(*CHAR) LEN(10) +
VALUE('ZLIB') /* Module library. */
DCL VAR(&SRVLIB) TYPE(*CHAR) LEN(10) +
VALUE('LGPL') /* Service program library. */
DCL VAR(&CFLAGS) TYPE(*CHAR) +
VALUE('OPTIMIZE(40)') /* Compile options. */
DCL VAR(&TGTRLS) TYPE(*CHAR) +
VALUE('V5R3M0') /* Target release. */
/* Working storage. */
DCL VAR(&CMDLEN) TYPE(*DEC) LEN(15 5) VALUE(300) /* Command length. */
DCL VAR(&CMD) TYPE(*CHAR) LEN(512)
DCL VAR(&FIXDCMD) TYPE(*CHAR) LEN(512)
/* Compile sources into modules. */
CHGVAR VAR(&FIXDCMD) VALUE('CRTCMOD' *BCAT &CFLAGS *BCAT +
'SYSIFCOPT(*IFS64IO)' *BCAT +
'DEFINE(''_LARGEFILE64_SOURCE''' *BCAT +
'''_LFS64_LARGEFILE=1'') TGTRLS(' *TCAT &TGTRLS *TCAT +
') SRCFILE(' *TCAT &SRCLIB *TCAT '/' *TCAT +
&SRCFILE *TCAT ') MODULE(' *TCAT &MODLIB *TCAT '/')
CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'ADLER32)')
CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'COMPRESS)')
CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'CRC32)')
CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'DEFLATE)')
CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'GZCLOSE)')
CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'GZLIB)')
CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'GZREAD)')
CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'GZWRITE)')
CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'INFBACK)')
CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'INFFAST)')
CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'INFLATE)')
CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'INFTREES)')
CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'TREES)')
CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'UNCOMPR)')
CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
CHGVAR VAR(&CMD) VALUE(&FIXDCMD *TCAT 'ZUTIL)')
CALL PGM(QCMDEXC) PARM(&CMD &CMDLEN)
/* Link modules into a service program. */
CRTSRVPGM SRVPGM(&SRVLIB/ZLIB) +
MODULE(&MODLIB/ADLER32 &MODLIB/COMPRESS +
&MODLIB/CRC32 &MODLIB/DEFLATE +
&MODLIB/GZCLOSE &MODLIB/GZLIB +
&MODLIB/GZREAD &MODLIB/GZWRITE +
&MODLIB/INFBACK &MODLIB/INFFAST +
&MODLIB/INFLATE &MODLIB/INFTREES +
&MODLIB/TREES &MODLIB/UNCOMPR +
&MODLIB/ZUTIL) +
SRCFILE(&SRCLIB/&CTLFILE) SRCMBR(BNDSRC) +
TEXT('ZLIB 1.2.8.1') TGTRLS(&TGTRLS)
ENDPGM
ZLIB version 1.2.8.1 for AS400 installation instructions
I) From an AS400 *SAVF file:
1) Unpacking archive to an AS400 save file
On the AS400:
_ Create the ZLIB AS400 library:
CRTLIB LIB(ZLIB) TYPE(*PROD) TEXT('ZLIB compression API library')
_ Create a work save file, for example:
CRTSAVF FILE(ZLIB/ZLIBSAVF)
On a PC connected to the target AS400:
_ Unpack the save file image to a PC file "ZLIBSAVF"
_ Upload this file into the save file on the AS400, for example
using ftp in BINARY mode.
2) Populating the ZLIB AS400 source library
On the AS400:
_ Extract the saved objects into the ZLIB AS400 library using:
RSTOBJ OBJ(*ALL) SAVLIB(ZLIB) DEV(*SAVF) SAVF(ZLIB/ZLIBSAVF) RSTLIB(ZLIB)
3) Customize installation:
_ Edit CL member ZLIB/TOOLS(COMPILE) and change parameters if needed,
according to the comments.
_ Compile this member with:
CRTCLPGM PGM(ZLIB/COMPILE) SRCFILE(ZLIB/TOOLS) SRCMBR(COMPILE)
4) Compile and generate the service program:
_ This can now be done by executing:
CALL PGM(ZLIB/COMPILE)
II) From the original source distribution:
1) On the AS400, create the source library:
CRTLIB LIB(ZLIB) TYPE(*PROD) TEXT('ZLIB compression API library')
2) Create the source files:
CRTSRCPF FILE(ZLIB/SOURCES) RCDLEN(112) TEXT('ZLIB library modules')
CRTSRCPF FILE(ZLIB/H) RCDLEN(112) TEXT('ZLIB library includes')
CRTSRCPF FILE(ZLIB/TOOLS) RCDLEN(112) TEXT('ZLIB library control utilities')
3) From the machine hosting the distribution files, upload them (with
FTP in text mode, for example) according to the following table:
Original AS400 AS400 AS400 AS400
file file member type description
SOURCES Original ZLIB C subprogram sources
adler32.c ADLER32 C ZLIB - Compute the Adler-32 checksum of a dta strm
compress.c COMPRESS C ZLIB - Compress a memory buffer
crc32.c CRC32 C ZLIB - Compute the CRC-32 of a data stream
deflate.c DEFLATE C ZLIB - Compress data using the deflation algorithm
gzclose.c GZCLOSE C ZLIB - Close .gz files
gzlib.c GZLIB C ZLIB - Miscellaneous .gz files IO support
gzread.c GZREAD C ZLIB - Read .gz files
gzwrite.c GZWRITE C ZLIB - Write .gz files
infback.c INFBACK C ZLIB - Inflate using a callback interface
inffast.c INFFAST C ZLIB - Fast proc. literals & length/distance pairs
inflate.c INFLATE C ZLIB - Interface to inflate modules
inftrees.c INFTREES C ZLIB - Generate Huffman trees for efficient decode
trees.c TREES C ZLIB - Output deflated data using Huffman coding
uncompr.c UNCOMPR C ZLIB - Decompress a memory buffer
zutil.c ZUTIL C ZLIB - Target dependent utility functions
H Original ZLIB C and ILE/RPG include files
crc32.h CRC32 C ZLIB - CRC32 tables
deflate.h DEFLATE C ZLIB - Internal compression state
gzguts.h GZGUTS C ZLIB - Definitions for the gzclose module
inffast.h INFFAST C ZLIB - Header to use inffast.c
inffixed.h INFFIXED C ZLIB - Table for decoding fixed codes
inflate.h INFLATE C ZLIB - Internal inflate state definitions
inftrees.h INFTREES C ZLIB - Header to use inftrees.c
trees.h TREES C ZLIB - Created automatically with -DGEN_TREES_H
zconf.h ZCONF C ZLIB - Compression library configuration
zlib.h ZLIB C ZLIB - Compression library C user interface
as400/zlib.inc ZLIB.INC RPGLE ZLIB - Compression library ILE RPG user interface
zutil.h ZUTIL C ZLIB - Internal interface and configuration
TOOLS Building source software & AS/400 README
as400/bndsrc BNDSRC Entry point exportation list
as400/compile.clp COMPILE CLP Compile sources & generate service program
as400/readme.txt README TXT Installation instructions
4) Continue as in I)3).
Notes: For AS400 ILE RPG programmers, a /copy member defining the ZLIB
API prototypes for ILE RPG can be found in ZLIB/H(ZLIB.INC).
Please read comments in this member for more information.
Remember that most foreign textual data are ASCII coded: this
implementation does not handle conversion from/to ASCII, so
text data code conversions must be done explicitely.
Mainly for the reason above, always open zipped files in binary mode.
ZLIB version 1.2.8 for OS/400 installation instructions
1) Download and unpack the zlib tarball to some IFS directory.
(i.e.: /path/to/the/zlib/ifs/source/directory)
If the installed IFS command suppors gzip format, this is straightforward,
else you have to unpack first to some directory on a system supporting it,
then move the whole directory to the IFS via the network (via SMB or FTP).
2) Edit the configuration parameters in the compilation script.
EDTF STMF('/path/to/the/zlib/ifs/source/directory/os400/make.sh')
Tune the parameters according to your needs if not matching the defaults.
Save the file and exit after edition.
3) Enter qshell, then work in the zlib OS/400 specific directory.
QSH
cd /path/to/the/zlib/ifs/source/directory/os400
4) Compile and install
sh make.sh
The script will:
- create the libraries, objects and IFS directories for the zlib environment,
- compile all modules,
- create a service program,
- create a static and a dynamic binding directory,
- install header files for C/C++ and for ILE/RPG, both for compilation in
DB2 and IFS environments.
That's all.
Notes: For OS/400 ILE RPG programmers, a /copy member defining the ZLIB
API prototypes for ILE RPG can be found in ZLIB/H(ZLIB.INC).
In the ILE environment, the same definitions are available from
file zlib.inc located in the same IFS include directory as the
C/C++ header files.
Please read comments in this member for more information.
Remember that most foreign textual data are ASCII coded: this
implementation does not handle conversion from/to ASCII, so
text data code conversions must be done explicitely.
Mainly for the reason above, always open zipped files in binary mode.
......@@ -4,30 +4,11 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB')
/* Version 1.1.3 entry points. */
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/********************************************************************/
/* *MODULE ADLER32 ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("adler32")
/********************************************************************/
/* *MODULE COMPRESS ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("compress")
EXPORT SYMBOL("compress2")
/********************************************************************/
/* *MODULE CRC32 ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("crc32")
EXPORT SYMBOL("get_crc_table")
/********************************************************************/
/* *MODULE DEFLATE ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("deflate")
EXPORT SYMBOL("deflateEnd")
EXPORT SYMBOL("deflateSetDictionary")
......@@ -37,11 +18,6 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB')
EXPORT SYMBOL("deflatePrime")
EXPORT SYMBOL("deflateInit_")
EXPORT SYMBOL("deflateInit2_")
/********************************************************************/
/* *MODULE GZIO ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("gzopen")
EXPORT SYMBOL("gzdopen")
EXPORT SYMBOL("gzsetparams")
......@@ -59,11 +35,6 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB')
EXPORT SYMBOL("gzeof")
EXPORT SYMBOL("gzclose")
EXPORT SYMBOL("gzerror")
/********************************************************************/
/* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("inflate")
EXPORT SYMBOL("inflateEnd")
EXPORT SYMBOL("inflateSetDictionary")
......@@ -72,17 +43,7 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB')
EXPORT SYMBOL("inflateInit_")
EXPORT SYMBOL("inflateInit2_")
EXPORT SYMBOL("inflateSyncPoint")
/********************************************************************/
/* *MODULE UNCOMPR ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("uncompress")
/********************************************************************/
/* *MODULE ZUTIL ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("zlibVersion")
EXPORT SYMBOL("zError")
......@@ -90,90 +51,32 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB')
/* Version 1.2.1 additional entry points. */
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/********************************************************************/
/* *MODULE COMPRESS ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("compressBound")
/********************************************************************/
/* *MODULE DEFLATE ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("deflateBound")
/********************************************************************/
/* *MODULE GZIO ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("gzungetc")
EXPORT SYMBOL("gzclearerr")
/********************************************************************/
/* *MODULE INFBACK ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("inflateBack")
EXPORT SYMBOL("inflateBackEnd")
EXPORT SYMBOL("inflateBackInit_")
/********************************************************************/
/* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("inflateCopy")
/********************************************************************/
/* *MODULE ZUTIL ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("zlibCompileFlags")
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/* Version 1.2.5 additional entry points. */
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/********************************************************************/
/* *MODULE ADLER32 ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("adler32_combine")
EXPORT SYMBOL("adler32_combine64")
/********************************************************************/
/* *MODULE CRC32 ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("crc32_combine")
EXPORT SYMBOL("crc32_combine64")
/********************************************************************/
/* *MODULE GZLIB ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("gzbuffer")
EXPORT SYMBOL("gzoffset")
EXPORT SYMBOL("gzoffset64")
EXPORT SYMBOL("gzopen64")
EXPORT SYMBOL("gzseek64")
EXPORT SYMBOL("gztell64")
/********************************************************************/
/* *MODULE GZREAD ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("gzclose_r")
/********************************************************************/
/* *MODULE GZWRITE ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("gzclose_w")
/********************************************************************/
/* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("inflateMark")
EXPORT SYMBOL("inflatePrime")
EXPORT SYMBOL("inflateReset2")
......@@ -183,33 +86,15 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB')
/* Version 1.2.6 additional entry points. */
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/********************************************************************/
/* *MODULE DEFLATE ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("deflateResetKeep")
EXPORT SYMBOL("deflatePending")
/********************************************************************/
/* *MODULE GZWRITE ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("gzgetc_")
/********************************************************************/
/* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("inflateResetKeep")
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/* Version 1.2.8 additional entry points. */
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/********************************************************************/
/* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */
/********************************************************************/
EXPORT SYMBOL("inflateGetDictionary")
ENDPGMEXP
#!/bin/sh
#
# ZLIB compilation script for the OS/400.
#
#
# This is a shell script since make is not a standard component of OS/400.
################################################################################
#
# Tunable configuration parameters.
#
################################################################################
TARGETLIB='ZLIB' # Target OS/400 program library
STATBNDDIR='ZLIB_A' # Static binding directory.
DYNBNDDIR='ZLIB' # Dynamic binding directory.
SRVPGM="ZLIB" # Service program.
IFSDIR='/zlib' # IFS support base directory.
TGTCCSID='500' # Target CCSID of objects
DEBUG='*NONE' # Debug level
OPTIMIZE='40' # Optimisation level
OUTPUT='*NONE' # Compilation output option.
TGTRLS='V6R1M0' # Target OS release
export TARGETLIB STATBNDDIR DYNBNDDIR SRVPGM IFSDIR
export TGTCCSID DEBUG OPTIMIZE OUTPUT TGTRLS
################################################################################
#
# OS/400 specific definitions.
#
################################################################################
LIBIFSNAME="/QSYS.LIB/${TARGETLIB}.LIB"
################################################################################
#
# Procedures.
#
################################################################################
# action_needed dest [src]
#
# dest is an object to build
# if specified, src is an object on which dest depends.
#
# exit 0 (succeeds) if some action has to be taken, else 1.
action_needed()
{
[ ! -e "${1}" ] && return 0
[ "${2}" ] || return 1
[ "${1}" -ot "${2}" ] && return 0
return 1
}
# make_module module_name source_name [additional_definitions]
#
# Compile source name into module if needed.
# As side effect, append the module name to variable MODULES.
# Set LINK to "YES" if the module has been compiled.
make_module()
{
MODULES="${MODULES} ${1}"
MODIFSNAME="${LIBIFSNAME}/${1}.MODULE"
CSRC="`basename \"${2}\"`"
if action_needed "${MODIFSNAME}" "${2}"
then :
elif [ ! "`sed -e \"/<source name=\\\"${CSRC}\\\">/,/<\\\\/source>/!d\" \
-e '/<depend /!d' \
-e 's/.* name=\"\\([^\"]*\\)\".*/\\1/' < \"${TOPDIR}/treebuild.xml\" |
while read HDR
do if action_needed \"${MODIFSNAME}\" \"${IFSDIR}/include/${HDR}\"
then echo recompile
break
fi
done`" ]
then return 0
fi
CMD="CRTCMOD MODULE(${TARGETLIB}/${1}) SRCSTMF('${2}')"
CMD="${CMD} SYSIFCOPT(*IFS64IO) OPTION(*INCDIRFIRST)"
CMD="${CMD} LOCALETYPE(*LOCALE) FLAG(10)"
CMD="${CMD} INCDIR('${IFSDIR}/include' ${INCLUDES})"
CMD="${CMD} TGTCCSID(${TGTCCSID}) TGTRLS(${TGTRLS})"
CMD="${CMD} OUTPUT(${OUTPUT})"
CMD="${CMD} OPTIMIZE(${OPTIMIZE})"
CMD="${CMD} DBGVIEW(${DEBUG})"
system "${CMD}"
LINK=YES
}
# Determine DB2 object name from IFS name.
db2_name()
{
basename "${1}" |
tr 'a-z-' 'A-Z_' |
sed -e 's/\..*//' \
-e 's/^\(.\).*\(.........\)$/\1\2/'
}
# Force enumeration types to be the same size as integers.
copy_hfile()
{
sed -e '1i\
#pragma enum(int)\
' "${@}" -e '$a\
#pragma enum(pop)\
'
}
################################################################################
#
# Script initialization.
#
################################################################################
SCRIPTDIR=`dirname "${0}"`
case "${SCRIPTDIR}" in
/*) ;;
*) SCRIPTDIR="`pwd`/${SCRIPTDIR}"
esac
while true
do case "${SCRIPTDIR}" in
*/.) SCRIPTDIR="${SCRIPTDIR%/.}";;
*) break;;
esac
done
# The script directory is supposed to be in ${TOPDIR}/os400.
TOPDIR=`dirname "${SCRIPTDIR}"`
export SCRIPTDIR TOPDIR
cd "${TOPDIR}"
# Extract the version from the master compilation XML file.
VERSION=`sed -e '/^<package /!d' \
-e 's/^.* version="\([0-9.]*\)".*$/\1/' -e 'q' \
< treebuild.xml`
export VERSION
################################################################################
# Create the OS/400 library if it does not exist.
if action_needed "${LIBIFSNAME}"
then CMD="CRTLIB LIB(${TARGETLIB}) TEXT('ZLIB: Data compression API')"
system "${CMD}"
fi
# Create the DOCS source file if it does not exist.
if action_needed "${LIBIFSNAME}/DOCS.FILE"
then CMD="CRTSRCPF FILE(${TARGETLIB}/DOCS) RCDLEN(112)"
CMD="${CMD} CCSID(${TGTCCSID}) TEXT('Documentation texts')"
system "${CMD}"
fi
# Copy some documentation files if needed.
for TEXT in "${TOPDIR}/ChangeLog" "${TOPDIR}/FAQ" \
"${TOPDIR}/README" "${SCRIPTDIR}/README400"
do MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${TEXT}\"`.MBR"
if action_needed "${MEMBER}" "${TEXT}"
then CMD="CPY OBJ('${TEXT}') TOOBJ('${MEMBER}') TOCCSID(${TGTCCSID})"
CMD="${CMD} DTAFMT(*TEXT) REPLACE(*YES)"
system "${CMD}"
fi
done
# Create the OS/400 source program file for the C header files.
SRCPF="${LIBIFSNAME}/H.FILE"
if action_needed "${SRCPF}"
then CMD="CRTSRCPF FILE(${TARGETLIB}/H) RCDLEN(112)"
CMD="${CMD} CCSID(${TGTCCSID}) TEXT('ZLIB: C/C++ header files')"
system "${CMD}"
fi
# Create the IFS directory for the C header files.
if action_needed "${IFSDIR}/include"
then mkdir -p "${IFSDIR}/include"
fi
# Copy the header files to DB2 library. Link from IFS include directory.
for HFILE in "${TOPDIR}/"*.h
do DEST="${SRCPF}/`db2_name \"${HFILE}\"`.MBR"
if action_needed "${DEST}" "${HFILE}"
then copy_hfile < "${HFILE}" > tmphdrfile
# Need to translate to target CCSID.
CMD="CPY OBJ('`pwd`/tmphdrfile') TOOBJ('${DEST}')"
CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)"
system "${CMD}"
# touch -r "${HFILE}" "${DEST}"
rm -f tmphdrfile
fi
IFSFILE="${IFSDIR}/include/`basename \"${HFILE}\"`"
if action_needed "${IFSFILE}" "${DEST}"
then rm -f "${IFSFILE}"
ln -s "${DEST}" "${IFSFILE}"
fi
done
# Install the ILE/RPG header file.
HFILE="${SCRIPTDIR}/zlib.inc"
DEST="${SRCPF}/ZLIB.INC.MBR"
if action_needed "${DEST}" "${HFILE}"
then CMD="CPY OBJ('${HFILE}') TOOBJ('${DEST}')"
CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)"
system "${CMD}"
# touch -r "${HFILE}" "${DEST}"
fi
IFSFILE="${IFSDIR}/include/`basename \"${HFILE}\"`"
if action_needed "${IFSFILE}" "${DEST}"
then rm -f "${IFSFILE}"
ln -s "${DEST}" "${IFSFILE}"
fi
# Create and compile the identification source file.
echo '#pragma comment(user, "ZLIB version '"${VERSION}"'")' > os400.c
echo '#pragma comment(user, __DATE__)' >> os400.c
echo '#pragma comment(user, __TIME__)' >> os400.c
echo '#pragma comment(copyright, "Copyright (C) 1995-2016 Jean-Loup Gailly, Mark Adler. OS/400 version by P. Monnerat.")' >> os400.c
make_module OS400 os400.c
LINK= # No need to rebuild service program yet.
MODULES=
# Get source list.
CSOURCES=`sed -e '/<source name="/!d' \
-e 's/.* name="\([^"]*\)".*/\1/' < treebuild.xml`
# Compile the sources into modules.
for SRC in ${CSOURCES}
do MODULE=`db2_name "${SRC}"`
make_module "${MODULE}" "${SRC}"
done
# If needed, (re)create the static binding directory.
if action_needed "${LIBIFSNAME}/${STATBNDDIR}.BNDDIR"
then LINK=YES
fi
if [ "${LINK}" ]
then rm -rf "${LIBIFSNAME}/${STATBNDDIR}.BNDDIR"
CMD="CRTBNDDIR BNDDIR(${TARGETLIB}/${STATBNDDIR})"
CMD="${CMD} TEXT('ZLIB static binding directory')"
system "${CMD}"
for MODULE in ${MODULES}
do CMD="ADDBNDDIRE BNDDIR(${TARGETLIB}/${STATBNDDIR})"
CMD="${CMD} OBJ((${TARGETLIB}/${MODULE} *MODULE))"
system "${CMD}"
done
fi
# The exportation file for service program creation must be in a DB2
# source file, so make sure it exists.
if action_needed "${LIBIFSNAME}/TOOLS.FILE"
then CMD="CRTSRCPF FILE(${TARGETLIB}/TOOLS) RCDLEN(112)"
CMD="${CMD} CCSID(${TGTCCSID}) TEXT('ZLIB: build tools')"
system "${CMD}"
fi
DEST="${LIBIFSNAME}/TOOLS.FILE/BNDSRC.MBR"
if action_needed "${SCRIPTDIR}/bndsrc" "${DEST}"
then CMD="CPY OBJ('${SCRIPTDIR}/bndsrc') TOOBJ('${DEST}')"
CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)"
system "${CMD}"
# touch -r "${SCRIPTDIR}/bndsrc" "${DEST}"
LINK=YES
fi
# Build the service program if needed.
if action_needed "${LIBIFSNAME}/${SRVPGM}.SRVPGM"
then LINK=YES
fi
if [ "${LINK}" ]
then CMD="CRTSRVPGM SRVPGM(${TARGETLIB}/${SRVPGM})"
CMD="${CMD} SRCFILE(${TARGETLIB}/TOOLS) SRCMBR(BNDSRC)"
CMD="${CMD} MODULE(${TARGETLIB}/OS400)"
CMD="${CMD} BNDDIR(${TARGETLIB}/${STATBNDDIR})"
CMD="${CMD} TEXT('ZLIB ${VERSION} dynamic library')"
CMD="${CMD} TGTRLS(${TGTRLS})"
system "${CMD}"
LINK=YES
# Duplicate the service program for a versioned backup.
BACKUP=`echo "${SRVPGM}${VERSION}" |
sed -e 's/.*\(..........\)$/\1/' -e 's/\./_/g'`
BACKUP="`db2_name \"${BACKUP}\"`"
BKUPIFSNAME="${LIBIFSNAME}/${BACKUP}.SRVPGM"
rm -f "${BKUPIFSNAME}"
CMD="CRTDUPOBJ OBJ(${SRVPGM}) FROMLIB(${TARGETLIB})"
CMD="${CMD} OBJTYPE(*SRVPGM) NEWOBJ(${BACKUP})"
system "${CMD}"
fi
# If needed, (re)create the dynamic binding directory.
if action_needed "${LIBIFSNAME}/${DYNBNDDIR}.BNDDIR"
then LINK=YES
fi
if [ "${LINK}" ]
then rm -rf "${LIBIFSNAME}/${DYNBNDDIR}.BNDDIR"
CMD="CRTBNDDIR BNDDIR(${TARGETLIB}/${DYNBNDDIR})"
CMD="${CMD} TEXT('ZLIB dynamic binding directory')"
system "${CMD}"
CMD="ADDBNDDIRE BNDDIR(${TARGETLIB}/${DYNBNDDIR})"
CMD="${CMD} OBJ((*LIBL/${SRVPGM} *SRVPGM))"
system "${CMD}"
fi
* ZLIB.INC - Interface to the general purpose compression library
*
* ILE RPG400 version by Patrick Monnerat, DATASPHERE.
* Version 1.2.8.1
* Version 1.2.8
*
*
* WARNING:
......@@ -22,14 +22,14 @@
*
* Versioning information.
*
D ZLIB_VERSION C '1.2.8.1'
D ZLIB_VERNUM C X'1281'
D ZLIB_VERSION C '1.2.8'
D ZLIB_VERNUM C X'1280'
D ZLIB_VER_MAJOR C 1
D ZLIB_VER_MINOR C 2
D ZLIB_VER_REVISION...
D C 8
D ZLIB_VER_SUBREVISION...
D C 1
D C 0
*
* Other equates.
*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册