diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2015-10-19 15:37:26 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2015-10-19 15:37:26 +0300 |
commit | 6c6e567eb34ad0f5a3bd90f6585c521543106401 (patch) | |
tree | 7f8dc62f12dd2b720ffdc738d393cd1a8f82921c /os400/make.sh | |
parent | 7421ae696c1ef2fb48adc73ba8564ef2f276d618 (diff) | |
parent | 218d404f34d79a8837f9c0230dd9d9f1180b4068 (diff) | |
download | libxml2-pristine-tar.tar.gz |
Merge branch 'pristine-tar' of git://anonscm.debian.org/debian-xml-sgml/libxml2 into pristine-tarpristine-tar
Diffstat (limited to 'os400/make.sh')
-rw-r--r-- | os400/make.sh | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/os400/make.sh b/os400/make.sh new file mode 100644 index 0000000..864e72b --- /dev/null +++ b/os400/make.sh @@ -0,0 +1,75 @@ +#!/bin/sh +# +# libxml2 compilation script for the OS/400. +# This is a shell script since make is not a standard component of OS/400. +# +# See Copyright for the status of this software. +# +# Author: Patrick Monnerat <pm@datasphere.ch>, DATASPHERE S.A. +# + +SCRIPTDIR=`dirname "${0}"` +. "${SCRIPTDIR}/initscript.sh" +cd "${TOPDIR}" + + +# Create the OS/400 library if it does not exist. + +if action_needed "${LIBIFSNAME}" +then CMD="CRTLIB LIB(${TARGETLIB})" + CMD="${CMD} TEXT('libxml2: XML parser and toolkit 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}/AUTHORS" "${TOPDIR}/ChangeLog" \ + "${TOPDIR}/Copyright" "${TOPDIR}/HACKING" "${TOPDIR}/README" \ + "${TOPDIR}/MAINTAINERS" "${TOPDIR}/NEWS" "${TOPDIR}/TODO" \ + "${TOPDIR}/TODO_SCHEMAS" "${TOPDIR}/os400/README400" +do if [ -f "${TEXT}" ] + then MEMBER="`basename \"${TEXT}\" .OS400`" + MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${MEMBER}\"`.MBR" + + if action_needed "${MEMBER}" "${TEXT}" + then CMD="CPY OBJ('${TEXT}') TOOBJ('${MEMBER}')" + CMD="${CMD} TOCCSID(${TGTCCSID})" + CMD="${CMD} DTAFMT(*TEXT) REPLACE(*YES)" + system "${CMD}" + fi + fi +done + + +# Build files from template. + +configFile() + +{ + args=`set | sed -e '/^[A-Za-z_][A-Za-z0-9_]*=/!d' \ + -e 's/[\/\\\\&]/\\\\&/g' \ + -e "s/'/'\\\\\\''/g" \ + -e 's/^\([^=]*\)=\(.*\)$/-e '\''s\/@\1@\/\2\/g'\'/` + eval sed ${args} < "${1}".in > "${1}" +} + +configFile include/libxml/xmlversion.h +configFile os400/os400config.h +mv os400/os400config.h config.h + + +# Build in each directory. + +for SUBDIR in include rpg src +do "${SCRIPTDIR}/make-${SUBDIR}.sh" +done |