geom_gate userland utility improvements
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.
 
 
 
 

57 lines
1.2 KiB

  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('libssh2: Header files')"
  13. system "${CMD}"
  14. fi
  15. # Create the IFS directory for the header files.
  16. IFSINCLUDE="${IFSDIR}/include"
  17. if action_needed "${IFSINCLUDE}"
  18. then mkdir -p "${IFSINCLUDE}"
  19. fi
  20. copy_hfile()
  21. {
  22. destfile="${1}"
  23. srcfile="${2}"
  24. shift
  25. shift
  26. sed -e '1i\
  27. #pragma datamodel(P128)\
  28. ' "${@}" -e '$a\
  29. #pragma datamodel(pop)\
  30. ' < "${srcfile}" > "${destfile}"
  31. }
  32. # Copy the header files.
  33. for HFILE in *.h "${TOPDIR}/os400/libssh2_ccsid.h"
  34. do DEST="${SRCPF}/`db2_name \"${HFILE}\"`.MBR"
  35. if action_needed "${DEST}" "${HFILE}"
  36. then copy_hfile "${DEST}" "${HFILE}"
  37. IFSDEST="${IFSINCLUDE}/`basename \"${HFILE}\"`"
  38. rm -f "${IFSDEST}"
  39. ln -s "${DEST}" "${IFSDEST}"
  40. fi
  41. done