1#!/bin/sh 2#*************************************************************************** 3# _ _ ____ _ 4# Project ___| | | | _ \| | 5# / __| | | | |_) | | 6# | (__| |_| | _ <| |___ 7# \___|\___/|_| \_\_____| 8# 9# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 10# 11# This software is licensed as described in the file COPYING, which 12# you should have received as part of this distribution. The terms 13# are also available at https://curl.se/docs/copyright.html. 14# 15# You may opt to use, copy, modify, merge, publish, distribute and/or sell 16# copies of the Software, and permit persons to whom the Software is 17# furnished to do so, under the terms of the COPYING file. 18# 19# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 20# KIND, either express or implied. 21# 22# SPDX-License-Identifier: curl 23# 24########################################################################### 25# 26# Command line interface tool compilation script for the OS/400. 27 28SCRIPTDIR=`dirname "${0}"` 29. "${SCRIPTDIR}/initscript.sh" 30cd "${TOPDIR}/src" 31 32 33# Get source lists. 34# CURL_CFILES are in the current directory. 35# CURLX_CFILES are in the lib directory and need to be recompiled because 36# some function names change using macros. 37 38get_make_vars Makefile.inc 39 40 41# Compile the sources into modules. 42 43LINK= 44MODULES= 45INCLUDES="'${TOPDIR}/lib'" 46 47for SRC in ${CURLX_CFILES} 48do MODULE=`db2_name "${SRC}"` 49 MODULE=`db2_name "X${MODULE}"` 50 make_module "${MODULE}" "${SRC}" 51done 52 53for SRC in ${CURL_CFILES} 54do MODULE=`db2_name "${SRC}"` 55 make_module "${MODULE}" "${SRC}" 56done 57 58 59# Link modules into program. 60 61MODULES="`echo \"${MODULES}\" | sed \"s/[^ ][^ ]*/${TARGETLIB}\/&/g\"`" 62CMD="CRTPGM PGM(${TARGETLIB}/${CURLPGM})" 63CMD="${CMD} ENTMOD(${TARGETLIB}/CURLMAIN)" 64CMD="${CMD} MODULE(${MODULES})" 65CMD="${CMD} BNDSRVPGM(${TARGETLIB}/${SRVPGM} QADRTTS)" 66CMD="${CMD} TGTRLS(${TGTRLS})" 67CLcommand "${CMD}" 68 69 70# Create the IFS command. 71 72IFSBIN="${IFSDIR}/bin" 73 74if action_needed "${IFSBIN}" 75then mkdir -p "${IFSBIN}" 76fi 77 78rm -f "${IFSBIN}/curl" 79ln -s "/QSYS.LIB/${TARGETLIB}.LIB/${CURLPGM}.PGM" "${IFSBIN}/curl" 80 81 82# Create the CL interface program. 83 84if action_needed "${LIBIFSNAME}/CURLCL.PGM" "${SCRIPTDIR}/curlcl.c" 85then CMD="CRTBNDC PGM(${TARGETLIB}/${CURLCLI})" 86 CMD="${CMD} SRCSTMF('${SCRIPTDIR}/curlcl.c')" 87 CMD="${CMD} DEFINE('CURLPGM=\"${CURLPGM}\"')" 88 CMD="${CMD} TGTCCSID(${TGTCCSID})" 89 CLcommand "${CMD}" 90fi 91 92 93# Create the CL command. 94 95if action_needed "${LIBIFSNAME}/${CURLCMD}.CMD" "${SCRIPTDIR}/curl.cmd" 96then CMD="CRTCMD CMD(${TARGETLIB}/${CURLCMD}) PGM(${TARGETLIB}/${CURLCLI})" 97 CMD="${CMD} SRCSTMF('${SCRIPTDIR}/curl.cmd')" 98 CLcommand "${CMD}" 99fi 100