1#!/bin/sh
2#
3#       curl compilation script for the OS/400.
4#
5#
6#       This is a shell script since make is not a standard component of OS/400.
7
8SCRIPTDIR=`dirname "${0}"`
9. "${SCRIPTDIR}/initscript.sh"
10cd "${TOPDIR}"
11
12
13#       Create the OS/400 library if it does not exist.
14
15if action_needed "${LIBIFSNAME}"
16then    CMD="CRTLIB LIB(${TARGETLIB}) TEXT('curl: multiprotocol support API')"
17        system "${CMD}"
18fi
19
20
21#       Create the DOCS source file if it does not exist.
22
23if action_needed "${LIBIFSNAME}/DOCS.FILE"
24then    CMD="CRTSRCPF FILE(${TARGETLIB}/DOCS) RCDLEN(112)"
25        CMD="${CMD} CCSID(${TGTCCSID}) TEXT('Documentation texts')"
26        system "${CMD}"
27fi
28
29
30#       Copy some documentation files if needed.
31
32for TEXT in "${TOPDIR}/COPYING" "${SCRIPTDIR}/README.OS400"             \
33    "${TOPDIR}/CHANGES" "${TOPDIR}/docs/THANKS" "${TOPDIR}/docs/FAQ"    \
34    "${TOPDIR}/docs/FEATURES" "${TOPDIR}/docs/SSLCERTS"                 \
35    "${TOPDIR}/docs/RESOURCES" "${TOPDIR}/docs/VERSIONS"                \
36    "${TOPDIR}/docs/HISTORY"
37do      MEMBER="`basename \"${TEXT}\" .OS400`"
38        MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${MEMBER}\"`.MBR"
39
40        if action_needed "${MEMBER}" "${TEXT}"
41        then    CMD="CPY OBJ('${TEXT}') TOOBJ('${MEMBER}') TOCCSID(${TGTCCSID})"
42                CMD="${CMD} DTAFMT(*TEXT) REPLACE(*YES)"
43                system "${CMD}"
44        fi
45done
46
47
48#       Build in each directory.
49
50# for SUBDIR in include lib src tests
51for SUBDIR in include lib src
52do      "${SCRIPTDIR}/make-${SUBDIR}.sh"
53done
54