os400: make programs and command name configurable

Closes #11547
This commit is contained in:
Patrick Monnerat 2023-07-30 20:04:25 +02:00 committed by Daniel Stenberg
parent 45a2502d51
commit 665c61a509
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
4 changed files with 16 additions and 8 deletions

View File

@ -29,6 +29,9 @@ setenv TARGETLIB 'CURL' # Target OS/400 program library.
setenv STATBNDDIR 'CURL_A' # Static binding directory. setenv STATBNDDIR 'CURL_A' # Static binding directory.
setenv DYNBNDDIR 'CURL' # Dynamic binding directory. setenv DYNBNDDIR 'CURL' # Dynamic binding directory.
setenv SRVPGM "CURL.${SONAME}" # Service program. setenv SRVPGM "CURL.${SONAME}" # Service program.
setenv CURLPGM 'CURL' # CLI tool bound program.
setenv CURLCMD 'CURL' # CL command name.
setenv CURLCLI 'CURLCL' # CL interface program.
setenv TGTCCSID '500' # Target CCSID of objects. setenv TGTCCSID '500' # Target CCSID of objects.
setenv DEBUG '*ALL' # Debug level. setenv DEBUG '*ALL' # Debug level.
setenv OPTIMIZE '10' # Optimization level setenv OPTIMIZE '10' # Optimization level

View File

@ -32,6 +32,10 @@
#include <miptrnam.h> #include <miptrnam.h>
#include <mih/callpgmv.h> #include <mih/callpgmv.h>
#ifndef CURLPGM
#define CURLPGM "CURL"
#endif
/* Variable-length string, with 16-bit length. */ /* Variable-length string, with 16-bit length. */
typedef struct { typedef struct {
@ -158,7 +162,7 @@ main(int argsc, arguments *args)
exitcode = -2; exitcode = -2;
} }
else { else {
_SYSPTR pgmptr = rslvsp(WLI_PGM, (char *) "CURL", library, _AUTH_NONE); _SYSPTR pgmptr = rslvsp(WLI_PGM, (char *) CURLPGM, library, _AUTH_NONE);
_LU_Work_Area_T *luwrka = (_LU_Work_Area_T *) _LUWRKA(); _LU_Work_Area_T *luwrka = (_LU_Work_Area_T *) _LUWRKA();
parse_command_line(args->cmdargs->string, args->cmdargs->len, parse_command_line(args->cmdargs->string, args->cmdargs->len,

View File

@ -62,11 +62,11 @@ SONAME=`sed -e '/^VERSIONCHANGE=/!d;s/^.*=\([0-9]*\).*/\1/' \
< "${TOPDIR}/lib/Makefile.soname"` < "${TOPDIR}/lib/Makefile.soname"`
export SONAME export SONAME
# Get OS/400 configuration parameters. # Get OS/400 configuration parameters.
. "${SCRIPTDIR}/config400.default" . "${SCRIPTDIR}/config400.default"
if [ -f "${SCRIPTDIR}/config400.override" ] if [ -f "${SCRIPTDIR}/config400.override" ]
then . "${SCRIPTDIR}/config400.override" then . "${SCRIPTDIR}/config400.override"
fi fi
# Need to get the version definitions. # Need to get the version definitions.

View File

@ -59,7 +59,7 @@ done
# Link modules into program. # Link modules into program.
MODULES="`echo \"${MODULES}\" | sed \"s/[^ ][^ ]*/${TARGETLIB}\/&/g\"`" MODULES="`echo \"${MODULES}\" | sed \"s/[^ ][^ ]*/${TARGETLIB}\/&/g\"`"
CMD="CRTPGM PGM(${TARGETLIB}/CURL)" CMD="CRTPGM PGM(${TARGETLIB}/${CURLPGM})"
CMD="${CMD} ENTMOD(${TARGETLIB}/CURLMAIN)" CMD="${CMD} ENTMOD(${TARGETLIB}/CURLMAIN)"
CMD="${CMD} MODULE(${MODULES})" CMD="${CMD} MODULE(${MODULES})"
CMD="${CMD} BNDSRVPGM(${TARGETLIB}/${SRVPGM} QADRTTS)" CMD="${CMD} BNDSRVPGM(${TARGETLIB}/${SRVPGM} QADRTTS)"
@ -76,14 +76,15 @@ then mkdir -p "${IFSBIN}"
fi fi
rm -f "${IFSBIN}/curl" rm -f "${IFSBIN}/curl"
ln -s "/QSYS.LIB/${TARGETLIB}.LIB/CURL.PGM" "${IFSBIN}/curl" ln -s "/QSYS.LIB/${TARGETLIB}.LIB/${CURLPGM}.PGM" "${IFSBIN}/curl"
# Create the CL interface program. # Create the CL interface program.
if action_needed "${LIBIFSNAME}/CURLCL.PGM" "${SCRIPTDIR}/curlcl.c" if action_needed "${LIBIFSNAME}/CURLCL.PGM" "${SCRIPTDIR}/curlcl.c"
then CMD="CRTBNDC PGM(${TARGETLIB}/CURLCL)" then CMD="CRTBNDC PGM(${TARGETLIB}/${CURLCLI})"
CMD="${CMD} SRCSTMF('${SCRIPTDIR}/curlcl.c')" CMD="${CMD} SRCSTMF('${SCRIPTDIR}/curlcl.c')"
CMD="${CMD} DEFINE('CURLPGM=\"${CURLPGM}\"')"
CMD="${CMD} TGTCCSID(${TGTCCSID})" CMD="${CMD} TGTCCSID(${TGTCCSID})"
CLcommand "${CMD}" CLcommand "${CMD}"
fi fi
@ -91,8 +92,8 @@ fi
# Create the CL command. # Create the CL command.
if action_needed "${LIBIFSNAME}/CURL.CMD" "${SCRIPTDIR}/curl.cmd" if action_needed "${LIBIFSNAME}/${CURLCMD}.CMD" "${SCRIPTDIR}/curl.cmd"
then CMD="CRTCMD CMD(${TARGETLIB}/CURL) PGM(${TARGETLIB}/CURLCL)" then CMD="CRTCMD CMD(${TARGETLIB}/${CURLCMD}) PGM(${TARGETLIB}/${CURLCLI})"
CMD="${CMD} SRCSTMF('${SCRIPTDIR}/curl.cmd')" CMD="${CMD} SRCSTMF('${SCRIPTDIR}/curl.cmd')"
CLcommand "${CMD}" CLcommand "${CMD}"
fi fi