make-include.sh 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #!/bin/sh
  2. #***************************************************************************
  3. # _ _ ____ _
  4. # Project ___| | | | _ \| |
  5. # / __| | | | |_) | |
  6. # | (__| |_| | _ <| |___
  7. # \___|\___/|_| \_\_____|
  8. #
  9. # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  10. #
  11. # This software is licensed as described in the file COPYING, which
  12. # you should have received as part of this distribution. The terms
  13. # are also available at https://curl.se/docs/copyright.html.
  14. #
  15. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  16. # copies of the Software, and permit persons to whom the Software is
  17. # furnished to do so, under the terms of the COPYING file.
  18. #
  19. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  20. # KIND, either express or implied.
  21. #
  22. # SPDX-License-Identifier: curl
  23. #
  24. ###########################################################################
  25. #
  26. # Installation of the header files in the OS/400 library.
  27. #
  28. SCRIPTDIR=`dirname "${0}"`
  29. . "${SCRIPTDIR}/initscript.sh"
  30. cd "${TOPDIR}/include"
  31. # Create the OS/400 source program file for the header files.
  32. SRCPF="${LIBIFSNAME}/H.FILE"
  33. if action_needed "${SRCPF}"
  34. then CMD="CRTSRCPF FILE(${TARGETLIB}/H) RCDLEN(112)"
  35. CMD="${CMD} CCSID(${TGTCCSID}) TEXT('curl: Header files')"
  36. CLcommand "${CMD}"
  37. fi
  38. # Create the IFS directory for the header files.
  39. IFSINCLUDE="${IFSDIR}/include/curl"
  40. if action_needed "${IFSINCLUDE}"
  41. then mkdir -p "${IFSINCLUDE}"
  42. fi
  43. # Enumeration values are used as va_arg tagfields, so they MUST be
  44. # integers.
  45. copy_hfile()
  46. {
  47. destfile="${1}"
  48. srcfile="${2}"
  49. shift
  50. shift
  51. sed -e '1i\
  52. #pragma enum(int)\
  53. ' "${@}" -e '$a\
  54. #pragma enum(pop)\
  55. ' < "${srcfile}" > "${destfile}"
  56. }
  57. # Copy the header files.
  58. for HFILE in curl/*.h ${SCRIPTDIR}/ccsidcurl.h
  59. do case "`basename \"${HFILE}\" .h`" in
  60. stdcheaders|typecheck-gcc)
  61. continue;;
  62. esac
  63. DEST="${SRCPF}/`db2_name \"${HFILE}\" nomangle`.MBR"
  64. if action_needed "${DEST}" "${HFILE}"
  65. then copy_hfile "${DEST}" "${HFILE}"
  66. IFSDEST="${IFSINCLUDE}/`basename \"${HFILE}\"`"
  67. rm -f "${IFSDEST}"
  68. ln -s "${DEST}" "${IFSDEST}"
  69. fi
  70. done
  71. # Copy the ILE/RPG header file, setting-up version number.
  72. versioned_copy "${SCRIPTDIR}/curl.inc.in" "${SRCPF}/CURL.INC.MBR"
  73. rm -f "${IFSINCLUDE}/curl.inc.rpgle"
  74. ln -s "${SRCPF}/CURL.INC.MBR" "${IFSINCLUDE}/curl.inc.rpgle"
  75. # Duplicate file H as CURL to support more include path forms.
  76. if action_needed "${LIBIFSNAME}/CURL.FILE"
  77. then :
  78. else CLcommand "DLTF FILE(${TARGETLIB}/CURL)"
  79. fi
  80. CMD="CRTDUPOBJ OBJ(H) FROMLIB(${TARGETLIB}) OBJTYPE(*FILE) TOLIB(*FROMLIB)"
  81. CMD="${CMD} NEWOBJ(CURL) DATA(*YES)"
  82. CLcommand "${CMD}"