make-include.sh 1.9 KB

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