2024-04-15 07:10:10 +08:00
|
|
|
#!/bin/sh
|
2020-03-23 21:44:29 +08:00
|
|
|
#***************************************************************************
|
|
|
|
# _ _ ____ _
|
|
|
|
# Project ___| | | | _ \| |
|
|
|
|
# / __| | | | |_) | |
|
|
|
|
# | (__| |_| | _ <| |___
|
|
|
|
# \___|\___/|_| \_\_____|
|
|
|
|
#
|
2023-01-02 20:51:48 +08:00
|
|
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2020-03-23 21:44:29 +08:00
|
|
|
#
|
|
|
|
# This software is licensed as described in the file COPYING, which
|
|
|
|
# you should have received as part of this distribution. The terms
|
2020-11-04 21:02:01 +08:00
|
|
|
# are also available at https://curl.se/docs/copyright.html.
|
2020-03-23 21:44:29 +08:00
|
|
|
#
|
|
|
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
# copies of the Software, and permit persons to whom the Software is
|
|
|
|
# furnished to do so, under the terms of the COPYING file.
|
|
|
|
#
|
|
|
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
# KIND, either express or implied.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: curl
|
2022-05-17 17:16:50 +08:00
|
|
|
#
|
2020-03-23 21:44:29 +08:00
|
|
|
###########################################################################
|
2007-08-23 22:30:24 +08:00
|
|
|
#
|
2023-08-29 19:32:39 +08:00
|
|
|
# Command line interface tool compilation script for the OS/400.
|
|
|
|
|
2024-04-07 20:39:59 +08:00
|
|
|
SCRIPTDIR=$(dirname "${0}")
|
2023-08-29 19:32:39 +08:00
|
|
|
. "${SCRIPTDIR}/initscript.sh"
|
2024-04-07 20:39:59 +08:00
|
|
|
cd "${TOPDIR}/src" || exit 1
|
2023-08-29 19:32:39 +08:00
|
|
|
|
|
|
|
|
2024-07-28 06:36:09 +08:00
|
|
|
# Check if built-in manual can be generated.
|
|
|
|
|
|
|
|
USE_MANUAL=
|
|
|
|
if [ -f "${IFSDIR}/docs/curl.txt" ] && [ -n "${PASEPERL}" ]
|
|
|
|
then "${PASEPERL}" ./mkhelp.pl < "${IFSDIR}/docs/curl.txt" > tool_hugehelp.c
|
|
|
|
USE_MANUAL="'USE_MANUAL'"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2023-08-29 19:32:39 +08:00
|
|
|
# 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.
|
|
|
|
|
2024-04-07 20:39:59 +08:00
|
|
|
# shellcheck disable=SC2034
|
2023-08-29 19:32:39 +08:00
|
|
|
LINK=
|
|
|
|
MODULES=
|
2024-04-07 20:39:59 +08:00
|
|
|
# shellcheck disable=SC2034
|
2023-08-29 19:32:39 +08:00
|
|
|
INCLUDES="'${TOPDIR}/lib'"
|
|
|
|
|
|
|
|
for SRC in ${CURLX_CFILES}
|
2024-04-07 20:39:59 +08:00
|
|
|
do MODULE=$(db2_name "${SRC}")
|
|
|
|
MODULE=$(db2_name "X${MODULE}")
|
2024-07-28 06:36:09 +08:00
|
|
|
make_module "${MODULE}" "${SRC}" "${USE_MANUAL}"
|
2023-08-29 19:32:39 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
for SRC in ${CURL_CFILES}
|
2024-04-07 20:39:59 +08:00
|
|
|
do MODULE=$(db2_name "${SRC}")
|
2024-07-28 06:36:09 +08:00
|
|
|
make_module "${MODULE}" "${SRC}" "${USE_MANUAL}"
|
2023-08-29 19:32:39 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
# Link modules into program.
|
|
|
|
|
2024-04-07 20:39:59 +08:00
|
|
|
MODULES="$(echo "${MODULES}" | sed "s/[^ ][^ ]*/${TARGETLIB}\/&/g")"
|
2023-07-31 02:04:25 +08:00
|
|
|
CMD="CRTPGM PGM(${TARGETLIB}/${CURLPGM})"
|
2023-08-29 19:32:39 +08:00
|
|
|
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"
|
2023-07-31 02:04:25 +08:00
|
|
|
ln -s "/QSYS.LIB/${TARGETLIB}.LIB/${CURLPGM}.PGM" "${IFSBIN}/curl"
|
2023-08-29 19:32:39 +08:00
|
|
|
|
|
|
|
|
|
|
|
# Create the CL interface program.
|
|
|
|
|
|
|
|
if action_needed "${LIBIFSNAME}/CURLCL.PGM" "${SCRIPTDIR}/curlcl.c"
|
2023-07-31 02:04:25 +08:00
|
|
|
then CMD="CRTBNDC PGM(${TARGETLIB}/${CURLCLI})"
|
2023-08-29 19:32:39 +08:00
|
|
|
CMD="${CMD} SRCSTMF('${SCRIPTDIR}/curlcl.c')"
|
2023-07-31 02:04:25 +08:00
|
|
|
CMD="${CMD} DEFINE('CURLPGM=\"${CURLPGM}\"')"
|
2023-08-29 19:32:39 +08:00
|
|
|
CMD="${CMD} TGTCCSID(${TGTCCSID})"
|
|
|
|
CLcommand "${CMD}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Create the CL command.
|
|
|
|
|
2023-07-31 02:04:25 +08:00
|
|
|
if action_needed "${LIBIFSNAME}/${CURLCMD}.CMD" "${SCRIPTDIR}/curl.cmd"
|
|
|
|
then CMD="CRTCMD CMD(${TARGETLIB}/${CURLCMD}) PGM(${TARGETLIB}/${CURLCLI})"
|
2023-08-29 19:32:39 +08:00
|
|
|
CMD="${CMD} SRCSTMF('${SCRIPTDIR}/curl.cmd')"
|
|
|
|
CLcommand "${CMD}"
|
|
|
|
fi
|