Try 'make distclean' to completely clean
old binaries.
I have an older branch of 1.4 that is modified that has the 32-bit library and utilities built, now I need to build an amd64 version (on my 32bit linux OS) so I used:
./configure --enable-threads --enable-newprefix --disable-xrender --with-archflags="-m64" --prefix="/usr/local/x64"
(the newprefix is one of the custom items a patch was provided years ago)
Everything is build until it gets to the tests (which I really don't need) and fails with:
Generating fast_slow.cxx and header from fast_slow.fl...
../fluid/fluid: 1: Syntax error: word unexpected (expecting ")")
make[1]: *** [Makefile:279: fast_slow.cxx] Error 2
That file isn't modified, it says it's version 1.04 and I compared to file in git that is 1.05 but nothing changed with regards to any ")". Just some additional words.
If I try to run fluid from the newly built it fails as expected:
:fluid/fluid --version
bash: fluid/fluid: cannot execute binary file: Exec format error
So it must be using a 32bit version,
but any ideas to get a clean build?
I tried ./configure --help but I didn't see an option to turn off tests or even fluid in general, I don't use it.
--disable-test build test programs (default=yes)... which looks a little weird. In fact "default=yes" is equivalent to `--enable-test` and you could use `--disable-test` to prevent building the test programs. In my FLTK 1.4 branch (git current) `./configure --help` displays this option and I assume that this is very, very old (it supposedly predates FLTK 1.4.0).
$ make distclean
=== cleaning examples ===
...
=== cleaning documentation ===
make[1]: Entering directory '/git/fltk/branch-1.4/documentation'
make[1]: Leaving directory '/git/fltk/branch-1.4/documentation'
$ autoconf
$ export LDFLAGS='-static-libgcc -static-libstdc++'
$ ./configure --host=i686-w64-mingw32 --enable-localpng --enable-localjpeg --enable-localzlib
checking build system type... x86_64-unknown-linux-gnu
checking host system type... i686-w64-mingw32
checking for i686-w64-mingw32-gcc... i686-w64-mingw32-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether i686-w64-mingw32-gcc accepts -g... yes
checking for i686-w64-mingw32-gcc option to enable C11 features... none needed
checking for i686-w64-mingw32-g++... i686-w64-mingw32-g++
checking whether the compiler supports GNU C++... yes
checking whether i686-w64-mingw32-g++ accepts -g... yes
checking for i686-w64-mingw32-g++ option to enable C++11 features... none needed
checking for i686-w64-mingw32-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
configure: WARNING: using cross tools not prefixed with host triplet
checking for wtypes.h... yes
checking for gdiplus.h... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for nroff... /usr/bin/nroff
checking for doxygen... /usr/local/doxygen/v1.12.0/bin/doxygen
checking for i686-w64-mingw32-ranlib... i686-w64-mingw32-ranlib
checking for i686-w64-mingw32-ar... /usr/bin/i686-w64-mingw32-ar
checking for i686-w64-mingw32-windres... /usr/bin/i686-w64-mingw32-windres
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking size of short... 2
checking size of int... 4
checking size of long... 4
checking whether byte ordering is bigendian... no
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for sys/select.h... no
checking for sys/stdtypes.h... no
checking whether we have the POSIX compatible scandir() prototype... no
checking for scandir... no
checking for vsnprintf... yes
checking for snprintf... yes
checking for strings.h... (cached) yes
checking for strcasecmp... yes
checking for strlcat... no
checking for strlcpy... no
checking for locale.h... yes
checking for localeconv... yes
checking for setenv... no
checking for library containing pow... none required
checking for math.h... yes
checking for trunc... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for long long int... yes
checking for library containing dlsym... no
checking for dlfcn.h... no
checking how to run the C preprocessor... i686-w64-mingw32-gcc -E
checking for X... no
checking for GL/gl.h... yes
checking for GL/glu.h... yes
checking if GCC supports -fno-exceptions... yes
checking if GCC supports -fno-strict-aliasing... yes
checking if ld supports -no-undefined... yes
checking if ld supports -Bsymbolic-functions... yes
checking if toolchain supports sections... yes
Configuration Summary
-------------------------------------------------------------------------
Directories: prefix=/usr/local
bindir=${exec_prefix}/bin
datadir=${datarootdir}
datarootdir=${prefix}/share
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
mandir=${datarootdir}/man
MSys docpath=/local/share/doc/fltk
Build fluid: YES
Build tests: YES
Cross-compiling: YES
Build: x86_64-unknown-linux-gnu -> Host: i686-w64-mingw32 <<< Note: cross-building
Graphics: GDI+
Image Libraries: JPEG=Builtin
PNG=Builtin
ZLIB=Builtin
Forms library: YES
Large Files: YES
OpenGL: YES
Threads: YES
Allow std:: : NO
configure: creating ./config.status
...
```--host=i686-w64-mingw32 --enable-localpng --enable-localjpeg --enable-localzlibLDFLAGS='-static-libgcc -static-libstdc++' is required for building Windows executables.
$ make -j15 === making jpeg === make[1]: warning: -j15 forced in submake: resetting jobserver mode. make[1]: Entering directory '/git/fltk/branch-1.4/jpeg' Compiling jaricom.c... Compiling jcapimin.c... ... Compiling drivers/SVG/Fl_SVG_File_Surface.cxx... /usr/bin/i686-w64-mingw32-ar cr ../lib/libfltk.a ... <<< NOTE: using cross-build tools /usr/bin/i686-w64-mingw32-ar cr ../lib/libfltk_forms.a ... /usr/bin/i686-w64-mingw32-ar cr ../lib/libfltk_gl.a ... /usr/bin/i686-w64-mingw32-ar cr ../lib/libfltk_images.a ... ... Compiling ExternalCodeEditor_WIN32.cxx... Linking fluid.exe... <<< cross-building: `fluid.exe` ! ... make[1]: Entering directory '/git/fltk/branch-1.4/test' Compiling animated.cxx... Compiling adjuster.cxx... Compiling arc.cxx... ... Generating fast_slow.cxx and header from fast_slow.fl... Generating fast_slow.h and header from fast_slow.fl... ... Linking fast_slow.exe... Linking inactive.exe... ... (Build finished) Executing some tests: $ fluid --version # fluid on the build host in my PATH fluid v1.5.0 $ head -2 test/fast_slow.fl # data file for the Fltk User Interface Designer (fluid) version 1.0401 $ head -1 test/fast_slow.cxx // generated by Fast Light User Interface Designer (fluid) version 1.0500 $ file fluid/fluid.exe fluid/fluid.exe: PE32 executable (GUI) Intel 80386, for MS Windows, 17 sections $ wine fluid/fluid.exe --version # executing the just built fluid(.exe) under wine fluid v1.4.4 $ file test/fast_slow.exe test/fast_slow.exe: PE32 executable (GUI) Intel 80386, for MS Windows, 17 sections```