Thanks for the reply.

To answer your question using autoconf/configure terminology, my build system is Linux and my host system is MinGW32. That is I am building on Linux to generate libraries/executables to run under MinGW (on Windows essentially). I would however face exactly the same issue if I was building on Linux to run on, say, a RaspberryPi or an Android system.

To avoid confusion I recommend that you remove the option to cross-compile unless you seriously intend to support it in which case you will need to make some serious changes to your script. In any case you should remove the "--target" option as that is only used when building compilers (I am building on system A (build) a compiler which will run on system B (host) which will generate binaries that run on system C (target)). The determination of the executable extension is also broken with some confusion over "build" system extension and "target" system extension. The script is incorrectly determining that the "build" system extension is ".exe" by building an executable using the cross-compiler. It then incorrectly determines that the target extension is non-existent because it seems to somehow be assigning the build executable extension to that variable. It then goes on to decide that because of this the target OS is *nix and then SQLite fails to compile because some platform compatibility code tries to include a *nix specific header file. I solved this by simply deleting chunks of code in the configure script and setting the target extension to be the same as the build extension. However this is a hack and not a proper solution.

Also, I am not sure your suggestion of generating sqlite3.c natively and then cross-compiling it separately will work. The generated sqlite3.c has some platform dependent stuff (selective header inclusion as per above) in it.

Senior Software Engineer
H Scientific Ltd
023 9226 7607

On 06/12/2017 02:10, Richard Hipp wrote:
On 12/4/17, Alastair Growcott <> wrote:
Cross-compiling sqlite3 fails due to the use of binaries in the build
process that are generated during the build process.
I recommend that you do

     ./configure; make sqlite3.c


     nmake /f makefile.msc sqlite3.c

depending on whether your host system is unix or windows.  Then
manually compile the resulting sqlite3.c for your target platform.

What are the host and target systems for the build you are trying to do?

This email has been checked for viruses by AVG.

sqlite-users mailing list

Reply via email to