3 # Installation of the C header files in the OS/400 library.
5 # See Copyright for the status of this software.
7 # Author: Patrick Monnerat <pm@datasphere.ch>, DATASPHERE S.A.
10 SCRIPTDIR=`dirname "${0}"`
11 . "${SCRIPTDIR}/initscript.sh"
12 cd "${TOPDIR}/include"
15 # Create the OS/400 source program file for the C header files.
17 SRCPF="${LIBIFSNAME}/LIBXML.FILE"
19 if action_needed "${SRCPF}"
20 then CMD="CRTSRCPF FILE(${TARGETLIB}/LIBXML) RCDLEN(112)"
21 CMD="${CMD} CCSID(${TGTCCSID}) TEXT('libxml2: C/C++ header files')"
26 # Create the IFS directory for the C header files.
28 if action_needed "${IFSDIR}/include/libxml"
29 then mkdir -p "${IFSDIR}/include/libxml"
34 # Enumeration values may be used as va_arg tagfields, so they MUST be
47 # Copy the header files to DB2 library. Link from IFS include directory.
49 for HFILE in "${TOPDIR}/os400/transcode.h" libxml/*.h libxml/*.h.in
50 do CMD="cat \"${HFILE}\""
51 DEST="${SRCPF}/`db2_name \"${HFILE}\" nomangle`.MBR"
53 case "`basename \"${HFILE}\"`" in
56 continue;; # Not on M$W !
58 *.in) CMD="${CMD} | versioned_copy";;
60 xmlschemastypes.h) # Special case: rename colliding file.
61 DEST="${SRCPF}/SCHMTYPES.MBR";;
65 if action_needed "${DEST}" "${HFILE}"
66 then eval "${CMD}" | copy_hfile > tmphdrfile
68 # Need to translate to target CCSID.
70 CMD="CPY OBJ('`pwd`/tmphdrfile') TOOBJ('${DEST}')"
71 CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)"
75 IFSFILE="${IFSDIR}/include/libxml/`basename \"${HFILE}\" .in`"
77 if action_needed "${IFSFILE}" "${DEST}"
78 then rm -f "${IFSFILE}"
79 ln -s "${DEST}" "${IFSFILE}"