aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <rhaberkorn@fmsbw.de>2025-09-23 03:03:13 +0200
committerRobin Haberkorn <rhaberkorn@fmsbw.de>2025-09-23 03:03:13 +0200
commita60821c3c663086020c80ba3e84d304edaab819f (patch)
treee39e125b3feeebb3b1bb2f0f49e98940d99c91cc
parent092f7d9919d9572219b7bf516933c37180e6f400 (diff)
downloadsciteco-a60821c3c663086020c80ba3e84d304edaab819f.tar.gz
freebsd14-msys-sciteco: force cross compilation in ./configure
Otherwise ./configure will try to execute compiled programs and this doesn't work since they require Wine. There is no binfmt for FreeBSD unfortunately and I couldn't get any other hack to work either. Even when adding build-system support for running SciTECO under Wine for the usual bootstrapping process, this doesn't yet fully work since there are some features that do not yet work under Wine.
-rwxr-xr-x.fmsbw/10-freebsd14-msys-sciteco30
1 files changed, 21 insertions, 9 deletions
diff --git a/.fmsbw/10-freebsd14-msys-sciteco b/.fmsbw/10-freebsd14-msys-sciteco
index a7ce73f..9244225 100755
--- a/.fmsbw/10-freebsd14-msys-sciteco
+++ b/.fmsbw/10-freebsd14-msys-sciteco
@@ -14,6 +14,7 @@ export ASSUME_ALWAYS_YES=yes
#git clone https://github.com/HolyBlackCat/quasi-msys2.git /opt/quasi-msys2
#cd /opt/quasi-msys2
#ln -s /usr/local/bin/gpgv2 /usr/local/bin/gpgv
+#ln -s /usr/local/bin/bash /bin/bash
# ln -s /usr/local/bin/clang20 gnu-overrides/clang
# ln -s /usr/local/bin/clang++20 gnu-overrides/clang++
# ln -s /usr/local/bin/llvm-windres20 gnu-overrides/llvm-windres
@@ -21,10 +22,15 @@ export ASSUME_ALWAYS_YES=yes
# ln -s /usr/local/bin/gmake gnu-overrides/make
# ln -s /usr/local/bin/gsed gnu-overrides/sed
# ln -s /usr/local/bin/greadlink gnu-overrides/readlink
+# ln -s /usr/local/bin/wine64 gnu-overrides/wine
#echo MINGW64 >msystem.txt
-#echo 'cd /opt/quasi-msys2' >activate
-#echo 'export PATH=`pwd`/gnu-overrides:$PATH' >>activate
-#echo '. env/all.src' >>activate
+# cat >activate << EOF
+#cd /opt/quasi-msys2
+#export PATH=`pwd`/gnu-overrides:$PATH
+#set +ex
+#. env/all.src
+#set -ex
+#EOF
#gmake install _autotools _gcc _glib2 _pdcurses _gtk3 _librsvg
#ln -nfs "/opt/quasi-msys2/root/mingw64" /mingw64
#pkg clean -a
@@ -57,10 +63,9 @@ cp ico/sciteco-48.png /opt/htdocs/graphics
# FIXME: This should be a separate job but currently we need the
# boostrapping with the FreeBSD version of SciTECO.
-# Theoretically, we can also run SciTECO under Wine,
-# but I am not sure how to do this by default since
-# FreeBSD does not have binfmt_misc.
-# Perhaps we will have to add build system support.
+# We can run with bootstrapping using --with-wine=wine64,
+# but it doesn't even generate all files correctly.
+# The test suite also doesn't fully work under Wine yet.
# Activate MSYS environment
. /opt/quasi-msys2/activate
cd /opt/build
@@ -79,10 +84,16 @@ export CFLAGS="-O3 -flto"
export CXXFLAGS="-O3 -flto"
export LDFLAGS="-flto"
+# We cannot run Windows binaries automatically through Wine,
+# so we must still force cross-compilation with --host.
+# Still make sure we don't pick up the MinGW pkg-config
+export PKG_CONFIG=pkg-config
+
#autoreconf -i
mkdir build-wingui build-wincon
cd build-wingui
-../configure --with-interface=pdcurses-gui --enable-html-docs --program-prefix=g \
+../configure --host=x86_64-w64-mingw32 \
+ --with-interface=pdcurses-gui --enable-html-docs --program-prefix=g \
--with-scitecodatadir=. \
--disable-bootstrap \
CURSES_LIBS="-lpdcurses_wingui -lgdi32 -lcomdlg32 -lwinmm"
@@ -91,7 +102,8 @@ make install-strip
#make check TESTSUITEFLAGS="--verbose --color=never"
cd ../build-wincon
-../configure --with-interface=pdcurses --enable-html-docs \
+../configure --host=x86_64-w64-mingw32 \
+ --with-interface=pdcurses --enable-html-docs \
--with-scitecodatadir=. \
--disable-bootstrap \
CURSES_LIBS="-lpdcurses_wincon -lgdi32 -lwinmm"