You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

make-include.sh 2.0KB

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