Skip to content

Commit

Permalink
Libtool fixes at runtime, including new compiler fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchcapper committed Dec 2, 2024
1 parent d614d6a commit 7e492f8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build/f_gawk_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ fi
if [[ -z $SKIP_STEP || $SKIP_STEP == "bootstrap" ]]; then
gnulib_add_addl_modules_to_bootstrap;
gnulib_ensure_buildaux_scripts_copied;
libtoolize --install --verbose #this is normally part of autoreconf to install the build-aux we removed earlier like ltmain.sh as we need the right version while bootstrap will run autoreconf it wont do the install at the parent dir level. We also want this run before the bootstrap so as to not override gnulibs installs
setup_gnulibtool_py_autoconfwrapper #needed for generated .mk/.ac files but if just stock then the below line likely works
libtool_fixes "build-aux/ltmain.sh" "m4/libtool.m4"
./bootstrap --no-bootstrap-sync --no-git --gnulib-srcdir=gnulib --skip-po --force
gnulib_ensure_buildaux_scripts_copied --forced;
SKIP_STEP=""
Expand Down
1 change: 1 addition & 0 deletions build/f_libhsts_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ fi
if [[ -z $SKIP_STEP || $SKIP_STEP == "autoconf" ]]; then #not empty allowed as if we bootstrapped above we dont need to run nautoconf
gnulib_ensure_buildaux_scripts_copied
autoreconf --symlink --verbose --install
libtool_fixes "build-aux/ltmain.sh" "m4/libtool.m4"
SKIP_STEP=""
fi

Expand Down
1 change: 1 addition & 0 deletions build/f_libpsl_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ fi
gnulib_add_addl_modules_to_bootstrap;
gnulib_ensure_buildaux_scripts_copied;
setup_gnulibtool_py_autoconfwrapper #needed for generated .mk/.ac files but if just stock then the below line likely works
libtool_fixes "build-aux/ltmain.sh" "m4/libtool.m4"
./bootstrap --no-bootstrap-sync --no-git --gnulib-srcdir=gnulib --skip-po
SKIP_STEP=""
fi
Expand Down
1 change: 1 addition & 0 deletions build/f_wolfcrypt_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ fi
if [[ -z $SKIP_STEP || $SKIP_STEP == "autoconf" ]]; then #not empty allowed as if we bootstrapped above we dont need to run nautoconf
sed -i -E 's#(ESTS\],\[test .x)#\1ZZZ#g' configure.ac #disable unit tests that will fail
sed -i -E 's#autoreconf --install --force#autoreconf --install#g' autogen.sh
libtool_fixes "build-aux/ltmain.sh" "m4/libtool.m4"
gnulib_ensure_buildaux_scripts_copied;
./autogen.sh
SKIP_STEP=""
Expand Down
16 changes: 16 additions & 0 deletions helpers_gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,22 @@ function gnulib_add_addl_modules_to_bootstrap(){
echo "${BOOT_FILE/TOREPLACEZSTR/"$CUR_MODULES"$'\n'}" > bootstrap.conf
fi
}

function libtool_fixes(){
# even when symlink is used for autotools the m4 macro and the build-aux/ltmain.sh are still copied so fine to edit directly
# first the newer libtools have more windows support but that makes things actually a bit harder as it has some issues
# first it puts the export symbol commands in a .exp file but that is used by the compiler too so .expsym is better and used elsewhere
# Secondly it does -Fe [arg] but it needs to be next to the -Fe[arg]
# local POS_FILES=("build-aux/ltmain.sh" "m4/libtool.m4")
# for fl in "${POS_FILES[@]}"; do
# if [[ -e "$fl" ]]; then

sed -i -E "s/(\\.exp)/\1sym/g;s/expsymsym/expsym/g;s/-Fe /-Fe/g" "$@"
sed -i -E "s/func_convert_core_msys_to_w32 \(/func_convert_core_msys_to_w32 (){func_convert_core_msys_to_w32_result=\$1;}\\nfunc_convert_core_msys_to_w32_old (/" "$@"
#sed -i -E "s#(gnulib_tool=.+gnulib-tool)\$#\1.py#" bootstrap
# fi
#done
}
function setup_gnulibtool_py_autoconfwrapper(){
if [[ $BLD_CONFIG_GNU_LIBS_AUTORECONF_WRAPPER -eq 1 ]]; then
local TARGET_FL="${BLD_CONFIG_BUILD_AUX_FOLDER}/AUTORECONF_prewrapper.sh"
Expand Down

0 comments on commit 7e492f8

Please sign in to comment.