Path: blob/main/external/curl/packages/OS400/make-include.sh
2066 views
#!/bin/sh1#***************************************************************************2# _ _ ____ _3# Project ___| | | | _ \| |4# / __| | | | |_) | |5# | (__| |_| | _ <| |___6# \___|\___/|_| \_\_____|7#8# Copyright (C) Daniel Stenberg, <[email protected]>, et al.9#10# This software is licensed as described in the file COPYING, which11# you should have received as part of this distribution. The terms12# are also available at https://curl.se/docs/copyright.html.13#14# You may opt to use, copy, modify, merge, publish, distribute and/or sell15# copies of the Software, and permit persons to whom the Software is16# furnished to do so, under the terms of the COPYING file.17#18# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY19# KIND, either express or implied.20#21# SPDX-License-Identifier: curl22#23###########################################################################24#25# Installation of the header files in the OS/400 library.26#2728SCRIPTDIR=$(dirname "${0}")29. "${SCRIPTDIR}/initscript.sh"30cd "${TOPDIR}/include" || exit 1313233# Create the OS/400 source program file for the header files.3435SRCPF="${LIBIFSNAME}/H.FILE"3637if action_needed "${SRCPF}"38then CMD="CRTSRCPF FILE(${TARGETLIB}/H) RCDLEN(112)"39CMD="${CMD} CCSID(${TGTCCSID}) TEXT('curl: Header files')"40CLcommand "${CMD}"41fi424344# Create the IFS directory for the header files.4546IFSINCLUDE="${IFSDIR}/include/curl"4748if action_needed "${IFSINCLUDE}"49then mkdir -p "${IFSINCLUDE}"50fi515253# Enumeration values are used as va_arg tagfields, so they MUST be54# integers.5556copy_hfile()5758{59destfile="${1}"60srcfile="${2}"61shift62shift63sed -e '1i\64#pragma enum(int)\65' "${@}" -e '$a\66#pragma enum(pop)\67' < "${srcfile}" > "${destfile}"68}6970# Copy the header files.7172for HFILE in curl/*.h ${SCRIPTDIR}/ccsidcurl.h73do case "$(basename "${HFILE}" .h)" in74stdcheaders|typecheck-gcc)75continue;;76esac7778DEST="${SRCPF}/$(db2_name "${HFILE}" nomangle).MBR"7980if action_needed "${DEST}" "${HFILE}"81then copy_hfile "${DEST}" "${HFILE}"82IFSDEST="${IFSINCLUDE}/$(basename "${HFILE}")"83rm -f "${IFSDEST}"84ln -s "${DEST}" "${IFSDEST}"85fi86done878889# Copy the ILE/RPG header file, setting-up version number.9091versioned_copy "${SCRIPTDIR}/curl.inc.in" "${SRCPF}/CURL.INC.MBR"92rm -f "${IFSINCLUDE}/curl.inc.rpgle"93ln -s "${SRCPF}/CURL.INC.MBR" "${IFSINCLUDE}/curl.inc.rpgle"949596# Duplicate file H as CURL to support more include path forms.9798if action_needed "${LIBIFSNAME}/CURL.FILE"99then :100else CLcommand "DLTF FILE(${TARGETLIB}/CURL)"101fi102103CMD="CRTDUPOBJ OBJ(H) FROMLIB(${TARGETLIB}) OBJTYPE(*FILE) TOLIB(*FROMLIB)"104CMD="${CMD} NEWOBJ(CURL) DATA(*YES)"105CLcommand "${CMD}"106107108