Skip to content

Commit 7e492f8

Browse files
committed
Libtool fixes at runtime, including new compiler fixes
1 parent d614d6a commit 7e492f8

File tree

5 files changed

+21
-0
lines changed

5 files changed

+21
-0
lines changed

build/f_gawk_build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ fi
6161
if [[ -z $SKIP_STEP || $SKIP_STEP == "bootstrap" ]]; then
6262
gnulib_add_addl_modules_to_bootstrap;
6363
gnulib_ensure_buildaux_scripts_copied;
64+
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
6465
setup_gnulibtool_py_autoconfwrapper #needed for generated .mk/.ac files but if just stock then the below line likely works
66+
libtool_fixes "build-aux/ltmain.sh" "m4/libtool.m4"
6567
./bootstrap --no-bootstrap-sync --no-git --gnulib-srcdir=gnulib --skip-po --force
6668
gnulib_ensure_buildaux_scripts_copied --forced;
6769
SKIP_STEP=""

build/f_libhsts_build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ fi
3131
if [[ -z $SKIP_STEP || $SKIP_STEP == "autoconf" ]]; then #not empty allowed as if we bootstrapped above we dont need to run nautoconf
3232
gnulib_ensure_buildaux_scripts_copied
3333
autoreconf --symlink --verbose --install
34+
libtool_fixes "build-aux/ltmain.sh" "m4/libtool.m4"
3435
SKIP_STEP=""
3536
fi
3637

build/f_libpsl_build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ fi
5252
gnulib_add_addl_modules_to_bootstrap;
5353
gnulib_ensure_buildaux_scripts_copied;
5454
setup_gnulibtool_py_autoconfwrapper #needed for generated .mk/.ac files but if just stock then the below line likely works
55+
libtool_fixes "build-aux/ltmain.sh" "m4/libtool.m4"
5556
./bootstrap --no-bootstrap-sync --no-git --gnulib-srcdir=gnulib --skip-po
5657
SKIP_STEP=""
5758
fi

build/f_wolfcrypt_build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ fi
3535
if [[ -z $SKIP_STEP || $SKIP_STEP == "autoconf" ]]; then #not empty allowed as if we bootstrapped above we dont need to run nautoconf
3636
sed -i -E 's#(ESTS\],\[test .x)#\1ZZZ#g' configure.ac #disable unit tests that will fail
3737
sed -i -E 's#autoreconf --install --force#autoreconf --install#g' autogen.sh
38+
libtool_fixes "build-aux/ltmain.sh" "m4/libtool.m4"
3839
gnulib_ensure_buildaux_scripts_copied;
3940
./autogen.sh
4041
SKIP_STEP=""

helpers_gnu.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,22 @@ function gnulib_add_addl_modules_to_bootstrap(){
128128
echo "${BOOT_FILE/TOREPLACEZSTR/"$CUR_MODULES"$'\n'}" > bootstrap.conf
129129
fi
130130
}
131+
132+
function libtool_fixes(){
133+
# even when symlink is used for autotools the m4 macro and the build-aux/ltmain.sh are still copied so fine to edit directly
134+
# first the newer libtools have more windows support but that makes things actually a bit harder as it has some issues
135+
# 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
136+
# Secondly it does -Fe [arg] but it needs to be next to the -Fe[arg]
137+
# local POS_FILES=("build-aux/ltmain.sh" "m4/libtool.m4")
138+
# for fl in "${POS_FILES[@]}"; do
139+
# if [[ -e "$fl" ]]; then
140+
141+
sed -i -E "s/(\\.exp)/\1sym/g;s/expsymsym/expsym/g;s/-Fe /-Fe/g" "$@"
142+
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 (/" "$@"
143+
#sed -i -E "s#(gnulib_tool=.+gnulib-tool)\$#\1.py#" bootstrap
144+
# fi
145+
#done
146+
}
131147
function setup_gnulibtool_py_autoconfwrapper(){
132148
if [[ $BLD_CONFIG_GNU_LIBS_AUTORECONF_WRAPPER -eq 1 ]]; then
133149
local TARGET_FL="${BLD_CONFIG_BUILD_AUX_FOLDER}/AUTORECONF_prewrapper.sh"

0 commit comments

Comments
 (0)