Skip to content

Commit

Permalink
os400: fixes to make-lib.sh and initscript.sh
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jonrumsey authored and bagder committed Jan 10, 2023
1 parent 33ac97e commit 9749a37
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/OS400/initscript.sh
Expand Up @@ -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"
Expand Down
23 changes: 17 additions & 6 deletions packages/OS400/make-lib.sh
Expand Up @@ -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.

Expand Down

0 comments on commit 9749a37

Please sign in to comment.