make-include.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/sh
  2. #
  3. # Installation of the include files in the OS/400 library.
  4. #
  5. # $Id$
  6. SCRIPTDIR=`dirname "${0}"`
  7. . "${SCRIPTDIR}/initscript.sh"
  8. cd "${TOPDIR}/include"
  9. # Produce the curlbuild.h include file.
  10. if action_needed curl/curlbuild.h curl/curlbuild.h.dist
  11. then cp -p curl/curlbuild.h.dist curl/curlbuild.h
  12. fi
  13. # Create the OS/400 source program file for the include files.
  14. SRCPF="${LIBIFSNAME}/H.FILE"
  15. if action_needed "${SRCPF}"
  16. then CMD="CRTSRCPF FILE(${TARGETLIB}/H) RCDLEN(112)"
  17. CMD="${CMD} CCSID(${TGTCCSID}) TEXT('curl: Header files')"
  18. system "${CMD}"
  19. fi
  20. # Enumeration values are used as va_arg tagfields, so they MUST be
  21. # integers.
  22. copy_hfile()
  23. {
  24. sed -e '1i\
  25. #pragma enum(int)\
  26. ' -e '$a\
  27. #pragma enum(pop)\
  28. ' < "${2}" > "${1}"
  29. }
  30. # Copy the header files.
  31. for HFILE in curl/*.h ${SCRIPTDIR}/ccsidcurl.h
  32. do DEST="${SRCPF}/`db2_name \"${HFILE}\"`.MBR"
  33. if action_needed "${DEST}" "${HFILE}"
  34. then copy_hfile "${DEST}" "${HFILE}"
  35. fi
  36. done
  37. # Copy the ILE/RPG include file, setting-up version number.
  38. versioned_copy "${SCRIPTDIR}/curl.inc.in" "${SRCPF}/CURL.INC.MBR"