Annotation of embedaddon/curl/packages/OS400/make-include.sh, revision 1.1

1.1     ! misho       1: #!/bin/sh
        !             2: #***************************************************************************
        !             3: #                                  _   _ ____  _
        !             4: #  Project                     ___| | | |  _ \| |
        !             5: #                             / __| | | | |_) | |
        !             6: #                            | (__| |_| |  _ <| |___
        !             7: #                             \___|\___/|_| \_\_____|
        !             8: #
        !             9: # Copyright (C) 1998 - 2020, 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.haxx.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: ###########################################################################
        !            23: #
        !            24: #       Installation of the header files in the OS/400 library.
        !            25: #
        !            26: 
        !            27: SCRIPTDIR=`dirname "${0}"`
        !            28: . "${SCRIPTDIR}/initscript.sh"
        !            29: cd "${TOPDIR}/include"
        !            30: 
        !            31: 
        !            32: #       Create the OS/400 source program file for the header files.
        !            33: 
        !            34: SRCPF="${LIBIFSNAME}/H.FILE"
        !            35: 
        !            36: if action_needed "${SRCPF}"
        !            37: then    CMD="CRTSRCPF FILE(${TARGETLIB}/H) RCDLEN(112)"
        !            38:         CMD="${CMD} CCSID(${TGTCCSID}) TEXT('curl: Header files')"
        !            39:         system "${CMD}"
        !            40: fi
        !            41: 
        !            42: 
        !            43: #       Create the IFS directory for the header files.
        !            44: 
        !            45: IFSINCLUDE="${IFSDIR}/include/curl"
        !            46: 
        !            47: if action_needed "${IFSINCLUDE}"
        !            48: then    mkdir -p "${IFSINCLUDE}"
        !            49: fi
        !            50: 
        !            51: 
        !            52: #       Enumeration values are used as va_arg tagfields, so they MUST be
        !            53: #               integers.
        !            54: 
        !            55: copy_hfile()
        !            56: 
        !            57: {
        !            58:         destfile="${1}"
        !            59:         srcfile="${2}"
        !            60:         shift
        !            61:         shift
        !            62:         sed -e '1i\
        !            63: #pragma enum(int)\
        !            64: ' "${@}" -e '$a\
        !            65: #pragma enum(pop)\
        !            66: ' < "${srcfile}" > "${destfile}"
        !            67: }
        !            68: 
        !            69: #       Copy the header files.
        !            70: 
        !            71: for HFILE in curl/*.h ${SCRIPTDIR}/ccsidcurl.h
        !            72: do      case "`basename \"${HFILE}\" .h`" in
        !            73:         stdcheaders|typecheck-gcc)
        !            74:                 continue;;
        !            75:         esac
        !            76: 
        !            77:         DEST="${SRCPF}/`db2_name \"${HFILE}\" nomangle`.MBR"
        !            78: 
        !            79:         if action_needed "${DEST}" "${HFILE}"
        !            80:         then    copy_hfile "${DEST}" "${HFILE}"
        !            81:                 IFSDEST="${IFSINCLUDE}/`basename \"${HFILE}\"`"
        !            82:                 rm -f "${IFSDEST}"
        !            83:                 ln -s "${DEST}" "${IFSDEST}"
        !            84:         fi
        !            85: done
        !            86: 
        !            87: 
        !            88: #       Copy the ILE/RPG header file, setting-up version number.
        !            89: 
        !            90: versioned_copy "${SCRIPTDIR}/curl.inc.in" "${SRCPF}/CURL.INC.MBR"
        !            91: rm -f "${IFSINCLUDE}/curl.inc.rpgle"
        !            92: ln -s "${SRCPF}/CURL.INC.MBR" "${IFSINCLUDE}/curl.inc.rpgle"
        !            93: 
        !            94: 
        !            95: #       Duplicate file H as CURL to support more include path forms.
        !            96: 
        !            97: if action_needed "${LIBIFSNAME}/CURL.FILE"
        !            98: then    :
        !            99: else    system "DLTF FILE(${TARGETLIB}/CURL)"
        !           100: fi
        !           101: 
        !           102: CMD="CRTDUPOBJ OBJ(H) FROMLIB(${TARGETLIB}) OBJTYPE(*FILE) TOLIB(*FROMLIB)"
        !           103: CMD="${CMD} NEWOBJ(CURL) DATA(*YES)"
        !           104: system "${CMD}"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>