Windows/msys2 compilation problems
On the latest msys2/mingw (fully updated) I'm getting this error:
cd /home/ag/purr-data/externals/OSCx && ./configure
configure: loading site script /mingw32/etc/config.site
checking build system type... i686-w64-mingw32
checking host system type... i686-w64-mingw32
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/ag/purr-data/externals/OSCx':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[3]: *** [Makefile:1362: /home/ag/purr-data/externals/OSCx/Makefile] Error 77
make[3]: Leaving directory '/home/ag/purr-data/externals'
make[2]: *** [Makefile:209: externals_install] Error 2
make[2]: Leaving directory '/home/ag/purr-data/packages'
make[1]: *** [Makefile:69: prebuilt_install] Error 2
make[1]: Leaving directory '/home/ag/purr-data/packages/win32_inno'
config.log shows:
configure:2634: gcc -DPD -I/home/ag/purr-data/pd/src -Wall -W -Wno-unused-parameter -ggdb -I/home/ag/purr-data/Gem/src -mms-bitfields -DMSW -DNT -D'O_NONBLOCK=1' -D'srand48(n)=srand((n))' -D'drand48()=((double)rand()/RAND_MAX)' -D'bzero(p,n)=memset(p,0,n)' conftest.c >&5
<command-line>: error: macro names must be identifiers
<command-line>: error: macro names must be identifiers
<command-line>: error: macro names must be identifiers
<command-line>: error: macro names must be identifiers
configure:2638: $? = 1
configure:2676: result: no
This is 100% reproducible for me. I'm not sure why we don't see these in the Windows runner, maybe it uses an older version of the msys2 base system?
Anyway, I can get rid of this error simply by removing the definitions -D'srand48(n)=srand((n))'
and -D'drand48()=((double)rand()/RAND_MAX)' -D'bzero(p,n)=memset(p,0,n)'
from the WINDOWS_HACKS
variable in externals/Makefile, i.e.:
diff --git a/externals/Makefile b/externals/Makefile
index a193a457..ef699e9c 100644
--- a/externals/Makefile
+++ b/externals/Makefile
@@ -73,8 +73,9 @@ ifeq ($(OS_NAME),linux)
endif
ifeq ($(OS_NAME),windows)
BUILDSRC_OS_NAME = win
- WINDOWS_HACKS = -D'O_NONBLOCK=1' -D'srand48(n)=srand((n))' \
- -D'drand48()=((double)rand()/RAND_MAX)' -D'bzero(p,n)=memset(p,0,n)'
+ WINDOWS_HACKS = -DO_NONBLOCK=1
+# -D'srand48(n)=srand((n))' \
+# -D'drand48()=((double)rand()/RAND_MAX)' -D'bzero(p,n)=memset(p,0,n)'
# These don't seem to be needed:
# -D'PROT_READ=1' \
# -D'MAP_PRIVATE=2' \
Should I submit this as a merge request so that we can see whether this breaks the Windows runner? It goes without saying that having to patch up the sources each time I try to build the Windows version is a bit inconvenient, and other users might run into this issue as well, thus the sooner we can get rid of these Windows-specific hacks the better.