3 # libxml2 compilation script for the OS/400.
4 # This is a shell script since make is not a standard component of OS/400.
6 # See Copyright for the status of this software.
8 # Author: Patrick Monnerat <pm@datasphere.ch>, DATASPHERE S.A.
11 SCRIPTDIR=`dirname "${0}"`
12 . "${SCRIPTDIR}/initscript.sh"
16 # Create the OS/400 library if it does not exist.
18 if action_needed "${LIBIFSNAME}"
19 then CMD="CRTLIB LIB(${TARGETLIB})"
20 CMD="${CMD} TEXT('libxml2: XML parser and toolkit API')"
25 # Create the DOCS source file if it does not exist.
27 if action_needed "${LIBIFSNAME}/DOCS.FILE"
28 then CMD="CRTSRCPF FILE(${TARGETLIB}/DOCS) RCDLEN(112)"
29 CMD="${CMD} CCSID(${TGTCCSID}) TEXT('Documentation texts')"
34 # Copy some documentation files if needed.
36 for TEXT in "${TOPDIR}/AUTHORS" "${TOPDIR}/ChangeLog" \
37 "${TOPDIR}/Copyright" "${TOPDIR}/HACKING" "${TOPDIR}/README" \
38 "${TOPDIR}/MAINTAINERS" "${TOPDIR}/NEWS" "${TOPDIR}/TODO" \
39 "${TOPDIR}/TODO_SCHEMAS" "${TOPDIR}/os400/README400"
40 do if [ -f "${TEXT}" ]
41 then MEMBER="`basename \"${TEXT}\" .OS400`"
42 MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${MEMBER}\"`.MBR"
44 if action_needed "${MEMBER}" "${TEXT}"
45 then CMD="CPY OBJ('${TEXT}') TOOBJ('${MEMBER}')"
46 CMD="${CMD} TOCCSID(${TGTCCSID})"
47 CMD="${CMD} DTAFMT(*TEXT) REPLACE(*YES)"
54 # Build files from template.
59 args=`set | sed -e '/^[A-Za-z_][A-Za-z0-9_]*=/!d' \
60 -e 's/[\/\\\\&]/\\\\&/g' \
61 -e "s/'/'\\\\\\''/g" \
62 -e 's/^\([^=]*\)=\(.*\)$/-e '\''s\/@\1@\/\2\/g'\'/`
63 eval sed ${args} < "${1}".in > "${1}"
66 configFile include/libxml/xmlversion.h
67 configFile os400/os400config.h
68 mv os400/os400config.h config.h
71 # Build in each directory.
73 for SUBDIR in include rpg src
74 do "${SCRIPTDIR}/make-${SUBDIR}.sh"