Commit e72b4e73 authored by Patrick Monnerat's avatar Patrick Monnerat Committed by Daniel Veillard

OS400: Add compilation scripts.

parent e083c30e
This diff is collapsed.
#!/bin/sh
#
# Compilation script for the iconv names DFA builer.
#
# 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}/os400/iconv/bldcsndfa"
# This is for old XML library (bootstrapping).
#rm -rf xml.h xml
#ln -s /QSYS.LIB/XML.LIB/H.FILE/XML.MBR xml.h
#mkdir xml
#mkdir xml/h
#ln -s /QSYS.LIB/XML.LIB/H.FILE/UTF8.MBR xml/h/utf8
# Compile.
CMD="CRTCMOD MODULE(${TARGETLIB}/BLDCSNDFA) SRCSTMF('bldcsndfa.c')"
CMD="${CMD} SYSIFCOPT(*IFS64IO) LANGLVL(*EXTENDED) LOCALETYPE(*LOCALE)"
CMD="${CMD} INCDIR("
CMD="${CMD} '${IFSDIR}/include' ${INCLUDES})"
CMD="${CMD} TGTCCSID(${TGTCCSID}) TGTRLS(${TGTRLS})"
CMD="${CMD} OUTPUT(${OUTPUT})"
CMD="${CMD} OPTIMIZE(10)"
CMD="${CMD} DBGVIEW(${DEBUG})"
#CMD="${CMD} DEFINE('OLDXML' 'xmlXPathSetContextNode=xmlXPathSetCurrentNode')"
system "${CMD}"
# Link
CMD="CRTPGM PGM(${TARGETLIB}/BLDCSNDFA) MODULE(${TARGETLIB}/BLDCSNDFA)"
CMD="${CMD} BNDDIR(${TARGETLIB}/${DYNBNDDIR})"
#CMD="${CMD} BNDDIR(XML/XML)"
CMD="${CMD} TGTRLS(${TGTRLS})"
system "${CMD}"
#!/bin/sh
#
# Installation of the C header files in the OS/400 library.
#
# 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}/include"
# Create the OS/400 source program file for the C header files.
SRCPF="${LIBIFSNAME}/LIBXML.FILE"
if action_needed "${SRCPF}"
then CMD="CRTSRCPF FILE(${TARGETLIB}/LIBXML) RCDLEN(112)"
CMD="${CMD} CCSID(${TGTCCSID}) TEXT('libxml2: C/C++ header files')"
system "${CMD}"
fi
# Create the IFS directory for the C header files.
if action_needed "${IFSDIR}/include/libxml"
then mkdir -p "${IFSDIR}/include/libxml"
fi
# Enumeration values may be used as va_arg tagfields, so they MUST be
# integers.
copy_hfile()
{
sed -e '1i\
#pragma enum(int)\
' "${@}" -e '$a\
#pragma enum(pop)\
'
}
# Copy the header files to DB2 library. Link from IFS include directory.
for HFILE in "${TOPDIR}/os400/transcode.h" libxml/*.h libxml/*.h.in
do CMD="cat \"${HFILE}\""
DEST="${SRCPF}/`db2_name \"${HFILE}\" nomangle`.MBR"
case "`basename \"${HFILE}\"`" in
xmlwin32version.h*)
continue;; # Not on M$W !
*.in) CMD="${CMD} | versioned_copy";;
xmlschemastypes.h) # Special case: rename colliding file.
DEST="${SRCPF}/SCHMTYPES.MBR";;
esac
if action_needed "${DEST}" "${HFILE}"
then eval "${CMD}" | copy_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}"
fi
IFSFILE="${IFSDIR}/include/libxml/`basename \"${HFILE}\" .in`"
if action_needed "${IFSFILE}" "${DEST}"
then rm -f "${IFSFILE}"
ln -s "${DEST}" "${IFSFILE}"
fi
done
#!/bin/sh
#
# Installation of the ILE/RPG header files in the OS/400 library.
#
# 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}/os400/libxmlrpg"
# Create the OS/400 source program file for the ILE/RPG header files.
SRCPF="${LIBIFSNAME}/LIBXMLRPG.FILE"
if action_needed "${SRCPF}"
then CMD="CRTSRCPF FILE(${TARGETLIB}/LIBXMLRPG) RCDLEN(112)"
CMD="${CMD} CCSID(${TGTCCSID}) TEXT('libxml2: ILE/RPG header files')"
system "${CMD}"
fi
# Map file names to DB2 name syntax.
> tmpsubstfile
for HFILE in *.rpgle *.rpgle.in
do NAME="`basename \"${HFILE}\" .in`"
VAR="`basename \"${NAME}\" .rpgle`"
VAL="`db2_name \"${NAME}\" nomangle`"
if [ "${VAR}" = 'xmlschemastypes' ]
then VAL=SCHMTYPES
fi
echo "s/${VAR}/${VAL}/g" >> tmpsubstfile
eval "VAR_${VAR}=\"${VAL}\""
done
change_include()
{
sed -e '\#^....../include *"libxmlrpg/#{' \
-e 's///' \
-e 's/".*//' \
-f tmpsubstfile \
-e 's#.*# /include libxmlrpg,&#' \
-e '}'
}
# Create the IFS directory for the ILE/RPG header files.
RPGIFSDIR="${IFSDIR}/include/libxmlrpg"
if action_needed "${RPGIFSDIR}"
then mkdir -p "${RPGIFSDIR}"
fi
# Copy the header files to IFS ILE/RPG include directory.
# Copy them with include path editing to the DB2 library.
for HFILE in *.rpgle *.rpgle.in
do IFSCMD="cat \"${HFILE}\""
DB2CMD="change_include < \"${HFILE}\""
IFSFILE="`basename \"${HFILE}\" .in`"
case "${HFILE}" in
*.in) IFSCMD="${IFSCMD} | versioned_copy"
DB2CMD="${DB2CMD} | versioned_copy"
;;
esac
IFSDEST="${RPGIFSDIR}/${IFSFILE}"
if action_needed "${IFSDEST}" "${HFILE}"
then eval "${IFSCMD}" > "${IFSDEST}"
fi
eval DB2MBR="\"\${VAR_`basename \"${IFSDEST}\" .rpgle`}\""
DB2DEST="${SRCPF}/${DB2MBR}.MBR"
if action_needed "${DB2DEST}" "${HFILE}"
then eval "${DB2CMD}" | change_include > tmphdrfile
# Need to translate to target CCSID.
CMD="CPY OBJ('`pwd`/tmphdrfile') TOOBJ('${DB2DEST}')"
CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)"
system "${CMD}"
fi
done
This diff is collapsed.
#!/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 MEMBER="`basename \"${TEXT}\" .OS400`"
MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${MEMBER}\"`.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
# 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
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment