os400: implement CLI tool

This is provided as a QADRT (ascii) program, a link to it in the IFS and
a minimal CL command.

Closes #11547
This commit is contained in:
Patrick Monnerat 2023-08-29 13:32:39 +02:00 committed by Daniel Stenberg
parent b137634ba3
commit 6f8d9cc4e9
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
11 changed files with 471 additions and 40 deletions

View file

@ -23,5 +23,76 @@
#
###########################################################################
#
#
# Not implemented yet on OS/400.
# Command line interface tool compilation script for the OS/400.
SCRIPTDIR=`dirname "${0}"`
. "${SCRIPTDIR}/initscript.sh"
cd "${TOPDIR}/src"
# Get source lists.
# CURL_CFILES are in the current directory.
# CURLX_CFILES are in the lib directory and need to be recompiled because
# some function names change using macros.
get_make_vars Makefile.inc
# Compile the sources into modules.
LINK=
MODULES=
INCLUDES="'${TOPDIR}/lib'"
for SRC in ${CURLX_CFILES}
do MODULE=`db2_name "${SRC}"`
MODULE=`db2_name "X${MODULE}"`
make_module "${MODULE}" "${SRC}"
done
for SRC in ${CURL_CFILES}
do MODULE=`db2_name "${SRC}"`
make_module "${MODULE}" "${SRC}"
done
# Link modules into program.
MODULES="`echo \"${MODULES}\" | sed \"s/[^ ][^ ]*/${TARGETLIB}\/&/g\"`"
CMD="CRTPGM PGM(${TARGETLIB}/CURL)"
CMD="${CMD} ENTMOD(${TARGETLIB}/CURLMAIN)"
CMD="${CMD} MODULE(${MODULES})"
CMD="${CMD} BNDSRVPGM(${TARGETLIB}/${SRVPGM} QADRTTS)"
CMD="${CMD} TGTRLS(${TGTRLS})"
CLcommand "${CMD}"
# Create the IFS command.
IFSBIN="${IFSDIR}/bin"
if action_needed "${IFSBIN}"
then mkdir -p "${IFSBIN}"
fi
rm -f "${IFSBIN}/curl"
ln -s "/QSYS.LIB/${TARGETLIB}.LIB/CURL.PGM" "${IFSBIN}/curl"
# Create the CL interface program.
if action_needed "${LIBIFSNAME}/CURLCL.PGM" "${SCRIPTDIR}/curlcl.c"
then CMD="CRTBNDC PGM(${TARGETLIB}/CURLCL)"
CMD="${CMD} SRCSTMF('${SCRIPTDIR}/curlcl.c')"
CMD="${CMD} TGTCCSID(${TGTCCSID})"
CLcommand "${CMD}"
fi
# Create the CL command.
if action_needed "${LIBIFSNAME}/CURL.CMD" "${SCRIPTDIR}/curl.cmd"
then CMD="CRTCMD CMD(${TARGETLIB}/CURL) PGM(${TARGETLIB}/CURLCL)"
CMD="${CMD} SRCSTMF('${SCRIPTDIR}/curl.cmd')"
CLcommand "${CMD}"
fi