1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-16 06:25:03 -05:00
curl/packages/OS400/make-include.sh

80 lines
1.8 KiB
Bash
Raw Normal View History

2007-08-23 10:30:24 -04:00
#!/bin/sh
#
# Installation of the include files in the OS/400 library.
#
# $Id$
SCRIPTDIR=`dirname "${0}"`
. "${SCRIPTDIR}/initscript.sh"
cd "${TOPDIR}/include"
# Produce the curlbuild.h include file if not yet in distribution (CVS).
if action_needed curl/curlbuild.h
then if action_needed curl/curlbuild.h curl/curlbuild.h.dist
then cp -p curl/curlbuild.h.dist curl/curlbuild.h
fi
fi
2007-08-23 10:30:24 -04:00
# 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')"
2007-08-23 10:30:24 -04:00
system "${CMD}"
fi
# Enumeration values are used as va_arg tagfields, so they MUST be
# integers.
copy_hfile()
{
destfile="${1}"
srcfile="${2}"
shift
shift
2007-08-23 10:30:24 -04:00
sed -e '1i\
#pragma enum(int)\
' "${@}" -e '$a\
2007-08-23 10:30:24 -04:00
#pragma enum(pop)\
' < "${srcfile}" > "${destfile}"
2007-08-23 10:30:24 -04:00
}
# Copy the header files.
DEST="${SRCPF}/`db2_name curl/curl.h`.MBR"
if action_needed "${DEST}" curl/curl.h
then copy_hfile "${DEST}" curl/curl.h -e \
's/^# *include *[<"]curl\/curlbuild.h[">]/#include "curlbuild.h"/'
fi
2007-08-23 10:30:24 -04:00
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"
# Duplicate file H as CURL to support more include path forms.
if action_needed "${LIBIFSNAME}/CURL.FILE"
then :
else system "DLTF FILE(${TARGETLIB}/CURL)"
fi
CMD="CRTDUPOBJ OBJ(H) FROMLIB(${TARGETLIB}) OBJTYPE(*FILE) TOLIB(*FROMLIB)"
CMD="${CMD} NEWOBJ(CURL) DATA(*YES)"
system "${CMD}"