make-include.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/sh
  2. #
  3. # Installation of the include files in the OS/400 library.
  4. #
  5. SCRIPTDIR=`dirname "${0}"`
  6. . "${SCRIPTDIR}/initscript.sh"
  7. cd "${TOPDIR}/include"
  8. # Produce the curlbuild.h include file if not yet in distribution (CVS).
  9. if action_needed curl/curlbuild.h
  10. then if action_needed curl/curlbuild.h curl/curlbuild.h.dist
  11. then cp -p curl/curlbuild.h.dist curl/curlbuild.h
  12. fi
  13. fi
  14. # Create the OS/400 source program file for the include files.
  15. SRCPF="${LIBIFSNAME}/H.FILE"
  16. if action_needed "${SRCPF}"
  17. then CMD="CRTSRCPF FILE(${TARGETLIB}/H) RCDLEN(112)"
  18. CMD="${CMD} CCSID(${TGTCCSID}) TEXT('curl: Header files')"
  19. system "${CMD}"
  20. fi
  21. # Enumeration values are used as va_arg tagfields, so they MUST be
  22. # integers.
  23. copy_hfile()
  24. {
  25. destfile="${1}"
  26. srcfile="${2}"
  27. shift
  28. shift
  29. sed -e '1i\
  30. #pragma enum(int)\
  31. ' "${@}" -e '$a\
  32. #pragma enum(pop)\
  33. ' < "${srcfile}" > "${destfile}"
  34. }
  35. # Copy the header files.
  36. for HFILE in curl/*.h ${SCRIPTDIR}/ccsidcurl.h
  37. do DEST="${SRCPF}/`db2_name \"${HFILE}\"`.MBR"
  38. if action_needed "${DEST}" "${HFILE}"
  39. then copy_hfile "${DEST}" "${HFILE}"
  40. fi
  41. done
  42. # Copy the ILE/RPG include file, setting-up version number.
  43. versioned_copy "${SCRIPTDIR}/curl.inc.in" "${SRCPF}/CURL.INC.MBR"
  44. # Duplicate file H as CURL to support more include path forms.
  45. if action_needed "${LIBIFSNAME}/CURL.FILE"
  46. then :
  47. else system "DLTF FILE(${TARGETLIB}/CURL)"
  48. fi
  49. CMD="CRTDUPOBJ OBJ(H) FROMLIB(${TARGETLIB}) OBJTYPE(*FILE) TOLIB(*FROMLIB)"
  50. CMD="${CMD} NEWOBJ(CURL) DATA(*YES)"
  51. system "${CMD}"