summaryrefslogtreecommitdiffstats
path: root/libxml2/os400/make-include.sh
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2016-10-19 18:28:08 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2016-10-19 18:28:08 (GMT)
commit7f402e480a04b974617c04142993d3919457d342 (patch)
treea39cf901d49b9767df3fe076ebf8a06c92277995 /libxml2/os400/make-include.sh
parent818fd731f62993dc8aa5d07b82e1d1b2c04aae7d (diff)
parent6c75f0dc676d73c4cbcdca5a9cf05c6797a2ac0b (diff)
downloadblt-7f402e480a04b974617c04142993d3919457d342.zip
blt-7f402e480a04b974617c04142993d3919457d342.tar.gz
blt-7f402e480a04b974617c04142993d3919457d342.tar.bz2
Merge commit '6c75f0dc676d73c4cbcdca5a9cf05c6797a2ac0b' as 'libxml2'
Diffstat (limited to 'libxml2/os400/make-include.sh')
-rw-r--r--libxml2/os400/make-include.sh81
1 files changed, 81 insertions, 0 deletions
diff --git a/libxml2/os400/make-include.sh b/libxml2/os400/make-include.sh
new file mode 100644
index 0000000..4e5b058
--- /dev/null
+++ b/libxml2/os400/make-include.sh
@@ -0,0 +1,81 @@
+#!/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