sourcemod/extensions/curl/curl-src/packages/OS400/make-include.sh

56 lines
1.2 KiB
Bash
Raw Normal View History

2009-01-09 00:31:00 +01:00
#!/bin/sh
#
# Installation of the include files in the OS/400 library.
#
2013-03-18 01:55:59 +01:00
# $Id: make-include.sh,v 1.3 2008-08-25 13:58:45 patrickm Exp $
2009-01-09 00:31:00 +01:00
SCRIPTDIR=`dirname "${0}"`
. "${SCRIPTDIR}/initscript.sh"
cd "${TOPDIR}/include"
2013-03-18 01:55:59 +01:00
# Produce the curlbuild.h include file.
2009-01-09 00:31:00 +01:00
2013-03-18 01:55:59 +01:00
if action_needed curl/curlbuild.h curl/curlbuild.h.dist
then cp -p curl/curlbuild.h.dist curl/curlbuild.h
2009-01-09 00:31:00 +01:00
fi
# Create the OS/400 source program file for the include files.
SRCPF="${LIBIFSNAME}/H.FILE"
if action_needed "${SRCPF}"
then CMD="CRTSRCPF FILE(${TARGETLIB}/H) RCDLEN(112)"
CMD="${CMD} CCSID(${TGTCCSID}) TEXT('curl: Header files')"
system "${CMD}"
fi
# Enumeration values are used as va_arg tagfields, so they MUST be
# integers.
copy_hfile()
{
sed -e '1i\
#pragma enum(int)\
2013-03-18 01:55:59 +01:00
' -e '$a\
2009-01-09 00:31:00 +01:00
#pragma enum(pop)\
2013-03-18 01:55:59 +01:00
' < "${2}" > "${1}"
2009-01-09 00:31:00 +01:00
}
# Copy the header files.
for HFILE in curl/*.h ${SCRIPTDIR}/ccsidcurl.h
do DEST="${SRCPF}/`db2_name \"${HFILE}\"`.MBR"
if action_needed "${DEST}" "${HFILE}"
then copy_hfile "${DEST}" "${HFILE}"
fi
done
# Copy the ILE/RPG include file, setting-up version number.
versioned_copy "${SCRIPTDIR}/curl.inc.in" "${SRCPF}/CURL.INC.MBR"