From: jonrumsey Date: Mon, 9 Jan 2023 13:22:36 +0000 (+0000) Subject: os400: fixes to make-lib.sh and initscript.sh X-Git-Tag: curl-7_88_0~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9749a379e01d0cf314a3fb7be831d1bb4af6846d;p=thirdparty%2Fcurl.git 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 --- diff --git a/packages/OS400/initscript.sh b/packages/OS400/initscript.sh index 75431f5a5d..2a9eb419cd 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 b870ad3fca..d6be13a3f1 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.