Skip to content

Commit

Permalink
Fixed the _write bug with proper codegen modification
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchcapper committed Dec 19, 2024
1 parent e7140a8 commit bb0394e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions build/f_gnutls_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ BLD_CONFIG_BUILD_ADDL_CFLAGS=( "-I../gl/" )
BLD_CONFIG_BUILD_ADDL_CFLAGS_STATIC=("-DASN1_STATIC")
BLD_CONFIG_OUR_LIB_DEPS=("libtasn1" "p11-kit" "zlib")
BLD_CONFIG_OUR_LIB_BINS_PATH=("libtasn1")
BLD_CONFIG_BUILD_MSVC_IGNORE_WARNINGS=( "4068" "4061" "4820" "5045" "4668" )
BLD_CONFIG_BUILD_MSVC_IGNORE_WARNINGS=( "4068" "4061" "4820" "5045" "4668" "4996" )

# BLD_CONFIG_BUILD_FOLDER_NAME="myapp2"; #if you want it compiling in a diff folder
# BLD_CONFIG_BUILD_DEBUG=1
Expand All @@ -29,6 +29,13 @@ fi

if [[ -z $SKIP_STEP || $SKIP_STEP == "our_patch" ]]; then
apply_our_repo_patch; # Applies from patches folder repo_BUILD_NAME.patch to the sources
P11_FILE="cligen/cligen/code.py"
if [[ -e "${P11_FILE}" ]]; then
if grep -q "^struct {struct_name} {global_name};" "${P11_FILE}"; then
ex sed -i -E 's/^struct \{struct_name\} \{global_name\};/struct {struct_name} {global_name} ;\n#undef write/' "${P11_FILE}" # fix issue where write is refined to _write but then .write on a struct has problems
echo "Fixed ${P11_FILE} for _write bug"
fi
fi
fi

if [[ $BLD_CONFIG_GNU_LIBS_USED -eq "1" ]]; then
Expand Down Expand Up @@ -72,13 +79,7 @@ fi
else
setup_build_env;
fi
P11_FILE="src/p11tool-options.c"
if [[ -e "${P11_FILE}" ]]; then
if grep -Fq " p11tool_options;" "${P11_FILE}"; then
sed -i -E 's/ p11tool_options;/ p11tool_options ;\n#undef write/' "${P11_FILE}" # fix issue where write is refined to _write but then .write on a struct has problems
echo "Fixed ${P11_FILE} for _write bug"
fi
fi


run_make
make_install
Expand Down

0 comments on commit bb0394e

Please sign in to comment.