summaryrefslogtreecommitdiff
path: root/packages/OS400
diff options
context:
space:
mode:
authorjonrumsey <jrumsey@uk.ibm.com>2023-01-09 13:22:36 +0000
committerDaniel Stenberg <daniel@haxx.se>2023-01-10 09:29:04 +0100
commit9749a379e01d0cf314a3fb7be831d1bb4af6846d (patch)
tree7b3d2982bf81183c03f58f1c5ec431534cd8ba6d /packages/OS400
parent33ac97e1cb99e04f4833a2fa70636a5bbc23c4ef (diff)
downloadcurl-9749a379e01d0cf314a3fb7be831d1bb4af6846d.tar.gz
os400: fixes to make-lib.sh and initscript.sh
Adjust how exports list is generated from header files to account for declarations across multiple lines and CURL_DEPRECATED(...) tags. Update initscript.sh Specify qadrt_use_inline to prevent unistd.h in ASCII runtime defining close(a) -> close_a(a) Fixes #10266 Closes #10267
Diffstat (limited to 'packages/OS400')
-rwxr-xr-xpackages/OS400/initscript.sh2
-rwxr-xr-xpackages/OS400/make-lib.sh23
2 files changed, 18 insertions, 7 deletions
diff --git a/packages/OS400/initscript.sh b/packages/OS400/initscript.sh
index 75431f5a5..2a9eb419c 100755
--- a/packages/OS400/initscript.sh
+++ b/packages/OS400/initscript.sh
@@ -234,7 +234,7 @@ make_module()
CMD="${CMD} OPTIMIZE(${OPTIMIZE})"
CMD="${CMD} DBGVIEW(${DEBUG})"
- DEFINES="${3} BUILDING_LIBCURL"
+ DEFINES="${3} BUILDING_LIBCURL 'qadrt_use_inline'"
if [ "${WITH_ZLIB}" != "0" ]
then DEFINES="${DEFINES} HAVE_LIBZ"
diff --git a/packages/OS400/make-lib.sh b/packages/OS400/make-lib.sh
index b870ad3fc..d6be13a3f 100755
--- a/packages/OS400/make-lib.sh
+++ b/packages/OS400/make-lib.sh
@@ -129,15 +129,26 @@ fi
# Gather the list of symbols to export.
+# First use awk to pull all CURL_EXTERN function prototypes from
+# the header files, pass through to sed to strip CURL_DEPRECATED(..)
+# then back to awk to pull the string immediately to the left of a
+# bracket stripping any spaces or *'s.
-EXPORTS=`grep '^CURL_EXTERN[[:space:]]' \
+EXPORTS=`awk '/^CURL_EXTERN/,/;/' \
"${TOPDIR}"/include/curl/*.h \
"${SCRIPTDIR}/ccsidcurl.h" |
- sed -e 's/^.*CURL_EXTERN[[:space:]]\(.*\)(.*$/\1/' \
- -e 's/[[:space:]]*$//' \
- -e 's/^.*[[:space:]][[:space:]]*//' \
- -e 's/^\*//' \
- -e 's/(\(.*\))/\1/'`
+ sed 's| CURL_DEPRECATED(.*)||g' |
+ awk '{br=index($0,"("); \
+ if (br) { \
+ for(c=br-1; ;c--) { \
+ if (c==1) { \
+ print substr($0,c,br-1); break \
+ } else if (match(substr($0, c, br-c), "[ *]") != 0) { \
+ print substr($0, c+1, br-c-1); break \
+ } \
+ } \
+ } \
+ }'`
# Create the service program exportation file in DB2 member if needed.