OS400: make it compilable again. Make RPG binding up to date.
authorPatrick Monnerat <pm@datasphere.ch>
Wed, 18 Jun 2014 18:22:44 +0000 (20:22 +0200)
committerPatrick Monnerat <pm@datasphere.ch>
Wed, 18 Jun 2014 18:22:44 +0000 (20:22 +0200)
packages/OS400/curl.inc.in
packages/OS400/initscript.sh
packages/OS400/make-lib.sh

index 8cd70b6..565df61 100644 (file)
      d  CURLFTPMETHOD_SINGLECWD...
      d                 c                   3
       *
+     d  CURLHEADER_UNIFIED...
+     d                 c                   X'00000000'
+     d  CURLHEADER_SEPARATE...
+     d                 c                   X'00000001'
+      *
      d  CURLPROTO_HTTP...
      d                 c                   X'00000001'
      d  CURLPROTO_HTTPS...
      d                 c                   X'02000000'
       *
      d CURLoption      s             10i 0 based(######ptr######)               Enum
-     d  CURLOPT_FILE   c                   10001
      d  CURLOPT_WRITEDATA...
      d                 c                   10001
      d  CURLOPT_URL    c                   10002
      d  CURLOPT_PROXYUSERPWD...
      d                 c                   10006
      d  CURLOPT_RANGE  c                   10007
-     d  CURLOPT_INFILE...
-     d                 c                   10009
      d  CURLOPT_READDATA...
      d                 c                   10009
      d  CURLOPT_ERRORBUFFER...
      d                 c                   10026
      d  CURLOPT_CRLF   c                   00027
      d  CURLOPT_QUOTE  c                   10028
-     d  CURLOPT_WRITEHEADER...
-     d                 c                   10029
      d  CURLOPT_HEADERDATA...
      d                 c                   10029
      d  CURLOPT_COOKIEFILE...
      d                 c                   10037
      d  CURLOPT_POSTQUOTE...
      d                 c                   10039
-     d  CURLOPT_WRITEINFO...
-     d                 c                   10040
      d  CURLOPT_VERBOSE...
      d                 c                   00041
      d  CURLOPT_HEADER...
      d                 c                   10070
      d  CURLOPT_MAXCONNECTS...
      d                 c                   00071
-     d  CURLOPT_CLOSEPOLICY...
-     d                 c                   00072
      d  CURLOPT_FRESH_CONNECT...
      d                 c                   00074
      d  CURLOPT_FORBID_REUSE...
      d                 c                   00226
      d  CURLOPT_EXPECT_100_TIMEOUT_MS...
      d                 c                   00227
+     d  CURLOPT_PROXYHEADER...
+     d                 c                   10228
+     d  CURLOPT_HEADEROPT...
+     d                 c                   00229
       *
       /if not defined(CURL_NO_OLDIES)
+     d  CURLOPT_FILE   c                   10001
+     d  CURLOPT_INFILE...
+     d                 c                   10009
      d  CURLOPT_SSLKEYPASSWD...
      d                 c                   10026
      d  CURLOPT_SSLCERTPASSWD...
      d                 c                   10026
+     d  CURLOPT_WRITEHEADER...
+     d                 c                   10029
+     d  CURLOPT_WRITEINFO...
+     d                 c                   10040
      d  CURLOPT_FTPLISTONLY...
      d                 c                   00048
      d  CURLOPT_FTPAPPEND...
      d                 c                   00050
+     d  CURLOPT_CLOSEPOLICY...
+     d                 c                   00072
      d  CURLOPT_KRB4LEVEL...
      d                 c                   10063
      d  CURLOPT_ENCODING...
index 64147e3..0105f5a 100644 (file)
@@ -119,6 +119,41 @@ action_needed()
 }
 
 
+#       canonicalize_path path
+#
+#       Return canonicalized path as:
+#       - Absolute
+#       - No . or .. component.
+
+canonicalize_path()
+
+{
+        if expr "${1}" : '^/' > /dev/null
+        then    P="${1}"
+        else    P="`pwd`/${1}"
+        fi
+
+        R=
+        IFSSAVE="${IFS}"
+        IFS="/"
+
+        for C in ${P}
+        do      IFS="${IFSSAVE}"
+                case "${C}" in
+                .)      ;;
+                ..)     R=`expr "${R}" : '^\(.*/\)..*'`
+                        ;;
+                ?*)     R="${R}${C}/"
+                        ;;
+                *)      ;;
+                esac
+        done
+
+        IFS="${IFSSAVE}"
+        echo "/`expr "${R}" : '^\(.*\)/'`"
+}
+
+
 #       make_module module_name source_name [additional_definitions]
 #
 #       Compile source name into ASCII module if needed.
@@ -131,6 +166,7 @@ make_module()
         MODULES="${MODULES} ${1}"
         MODIFSNAME="${LIBIFSNAME}/${1}.MODULE"
         action_needed "${MODIFSNAME}" "${2}" || return 0;
+        SRCDIR=`dirname \`canonicalize_path "${2}"\``
 
         #       #pragma convert has to be in the source file itself, i.e.
         #               putting it in an include file makes it only active
@@ -147,7 +183,7 @@ make_module()
         CMD="${CMD} SYSIFCOPT(*IFS64IO) OPTION(*INCDIRFIRST)"
         CMD="${CMD} LOCALETYPE(*LOCALE)"
         CMD="${CMD} INCDIR('/qibm/proddata/qadrt/include'"
-        CMD="${CMD} '${TOPDIR}/include/curl' '${TOPDIR}/include'"
+        CMD="${CMD} '${TOPDIR}/include/curl' '${TOPDIR}/include' '${SRCDIR}'"
         CMD="${CMD} '${TOPDIR}/packages/OS400'"
 
         if [ "${WITH_ZLIB}" != "0" ]
index 5e1f204..ec9e2f0 100644 (file)
@@ -21,21 +21,18 @@ MODULES=
 
 #       Get source list.
 
-CSOURCES()
-
-{
-        shift                   # Drop the equal sign.
-        CSOURCES="$*"           # Get the file names.
-}
-
-HHEADERS()
-
-{
-        shift                   # Drop the equal sign.
-        HHEADERS="$*"           # Get the file names.
-}
-
-. Makefile.inc
+sed -e ':begin'                                                         \
+    -e '/\\$/{'                                                         \
+    -e 's/\\$/ /'                                                       \
+    -e 'N'                                                              \
+    -e 'bbegin'                                                         \
+    -e '}'                                                              \
+    -e 's/\n//g'                                                        \
+    -e 's/[[:space:]]*$//'                                              \
+    -e 's/^\([A-Za-z][A-Za-z0-9_]*\)[[:space:]]*=[[:space:]]*\(.*\)/\1="\2"/' \
+    -e 's/\$(\([A-Za-z][A-Za-z0-9_]*\))/${\1}/g'                        \
+        < Makefile.inc > tmpscript.sh
+. ./tmpscript.sh
 
 
 #       Compile the sources into modules.