Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling SQLite3 in MinGW

I am trying to build SQLite3 in MinGW. I downloaded the sqlite-autoconf-3071000.tar.gz, untar it and type the following command:

./configure --prefix=/mingw
make && make install

When I try to make it, errors reported:

$ make && make install
C:/MinGW/msys/1.0/bin/sh.exe ./libtool --tag=CC   --mode=compile gcc 
-DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.7.10\" 
-DPACKAGE_STRING=\"sqlite\ 3.7.10\" -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\" 
-DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.7.10\" -DSTDC_HEADERS=1 -DHAVE_
SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEM
ORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H
=1 -DHAVE_USLEEP=1 -DHAVE_DECL_STRERROR_R=0 -I.@am__isrc@    -D_REENTRANT=1 -DSQ
LITE_THREADSAFE=1  -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -O2 -MT sqlite3
.lo -MD -MP -MF .deps/sqlite3.Tpo -c -o sqlite3.lo sqlite3.c
Xsqlite3.Tpo -c -o sqlite3.lo sqlite3.lo
libtool: compile: libobj name `sqlite3.Tpo -c -o sqlite3.lo sqlite3.lo' may not
contain shell special characters.
rm: invalid option -- c
Try `rm --help' for more information.
mkdir .libs
gcc "-DPACKAGE_NAME=\\sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\
"3.7.10\" -DPACKAGE_STRING=\\sqlite 3.7.10\"" "-DPACKAGE_BUGREPORT=\\http://www.
sqlite.org\" -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.7.10\" -DSTDC
_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STR
ING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H
=1 -DHAVE_UNISTD_H=1 -DHAVE_USLEEP=1 -DHAVE_DECL_STRERROR_R=0 -I.@am__isrc@ -D_R
EENTRANT=1 -DSQLITE_THREADSAFE=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE -g -
O2 -MT sqlite3.lo -MD -MP -MF .deps/sqlite3.Tpo -c -o sqlite3.lo sqlite3.c"  -DD
LL_EXPORT -DPIC -o .libs/sqlite3.Tpo -c -o sqlite3.lo sqlite3.o
gcc.exe: error: sqlite3.o: No such file or directory
gcc.exe: fatal error: no input files
compilation terminated.
make: *** [sqlite3.lo] Error 1

Can anyone help me with it? Many thanks!

like image 268
Jia Avatar asked Oct 09 '22 15:10

Jia


1 Answers

It's a strange bug in MinGW/autotools/automake/etc, I dunno exactly where.

If you lists all files in the current working directory (or build directory or even in all source tree, IIRC) then you'll find a file named 'sqlite3.Tpo -c -o sqlite3.lo sqlite3.lo'. The name is similiar to arguments list for a some command! So I guess that the problem lies in the wrong process of a commands in Makefile (escaping is missing or even misprint).

As we can see libtool and gcc complains about illegal file's name or missing file.

Fortunately I was able to build sqlite successfuly with this workaround

$ make -n > cmds.sh && sh cmds.sh

Hope this helps.

like image 191
gshep Avatar answered Oct 12 '22 10:10

gshep