-
Notifications
You must be signed in to change notification settings - Fork 36
/
mf-sqlite3rtree.mingw-cross
183 lines (155 loc) · 4.97 KB
/
mf-sqlite3rtree.mingw-cross
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#!/usr/make
#
# Makefile for SQLITE rtree extensions, use in conjunction with
# mingw-cross-build.sh
#### The toplevel directory of the source tree. This is the directory
# that contains this "Makefile.in" and the "configure.in" script.
#
TOP = ../sqlite3
#### C Compiler and options for use in building executables that
# will run on the platform that is doing the build.
#
BCC = gcc -g -O2
#BCC = /opt/ancic/bin/c89 -0
#### If the target operating system supports the "usleep()" system
# call, then define the HAVE_USLEEP macro for all C modules.
#
USLEEP =
#USLEEP = -DHAVE_USLEEP=1
#### If you want the SQLite library to be safe for use within a
# multi-threaded program, then define the following macro
# appropriately:
#
THREADSAFE = -DSQLITE_THREADSAFE=1
#THREADSAFE = -DSQLITE_THREADSAFE=0
#### Specify any extra linker options needed to make the library
# thread safe
#
#THREADLIB = -lpthread
THREADLIB =
#### Specify any extra libraries needed to access required functions.
#
#TLIBS = -lrt # fdatasync on Solaris 8
TLIBS =
#### Leave SQLITE_DEBUG undefined for maximum speed. Use SQLITE_DEBUG=1
# to check for memory leaks. Use SQLITE_DEBUG=2 to print a log of all
# malloc()s and free()s in order to track down memory leaks.
#
# SQLite uses some expensive assert() statements in the inner loop.
# You can make the library go almost twice as fast if you compile
# with -DNDEBUG=1
#
#OPTS = -DSQLITE_DEBUG=2
#OPTS = -DSQLITE_DEBUG=1
#OPTS =
OPTS = -DNDEBUG=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_RTREE=1 \
-DSQLITE_ENABLE_MEMSYS5=1 \
-DWIN32=1 -DSQLITE_OS_WIN=1 $(THREADSAFE)
#OPTS += -DHAVE_FDATASYNC=1
#### The suffix to add to executable files. ".exe" for windows.
# Nothing for unix.
#
EXE = .exe
#EXE =
#### C Compile and options for use in building executables that
# will run on the target platform. This is usually the same
# as BCC, unless you are cross-compiling.
#
#TCC = gcc -O6
#TCC = gcc -g -O0 -Wall
#TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
TCC = /opt/mingw64/bin/x86_64-w64-mingw32-gcc -m32 -march=i386 -mtune=i386 \
-O2 -DNO_TCL
#TCC = /opt/ansic/bin/c89 -O +z -Wl,-a,archive
#### Tools used to build a static library.
#
#AR = ar cr
AR = /opt/mingw64/bin/x86_64-w64-mingw32-ar cr
#RANLIB = ranlib
RANLIB = /opt/mingw64/bin/x86_64-w64-mingw32-ranlib
# MKSHLIB = gcc -shared
# SO = so
# SHPREFIX = lib
MKSHLIB = /opt/mingw64/bin/x86_64-w64-mingw32-ar -shared
SO = dll
SHPREFIX =
#### Extra compiler options needed for programs that use the TCL library.
#
TCL_FLAGS =
#TCL_FLAGS = -DSTATIC_BUILD=1
#TCL_FLAGS = -I/home/drh/tcltk/8.4linux
#TCL_FLAGS = -I/home/drh/tcltk/8.4win -DSTATIC_BUILD=1
#TCL_FLAGS = -I/home/drh/tcltk/8.3hpux
#### Linker options needed to link against the TCL library.
#
LIBTCL =
#LIBTCL = -ltcl -lm -ldl
#LIBTCL = /home/drh/tcltk/8.4linux/libtcl8.4g.a -lm -ldl
#LIBTCL = /home/drh/tcltk/8.4win/libtcl84s.a -lmsvcrt
#LIBTCL = /home/drh/tcltk/8.3hpux/libtcl8.3.a -ldld -lm -lc
#### Compiler options needed for programs that use the readline() library.
#
READLINE_FLAGS =
#READLINE_FLAGS = -DHAVE_READLINE=1 -I/usr/include/readline
#### Linker options needed by programs using readline() must link against.
#
LIBREADLINE =
#LIBREADLINE = -static -lreadline -ltermcap
#### Which "awk" program provides nawk compatibilty
#
# NAWK = nawk
NAWK = awk
# This is how we compile
#
TCCX = $(TCC) $(OPTS) $(THREADSAFE) $(USLEEP) -I. -I$(TOP) -I$(TOP)/src
ifeq ($(MSVCRT),70)
TCCX += -D__MSVCRT_VERSION=0x0700
LMSVCRT = -nodefaultlibs -lmingw32 -lgcc_eh -lmoldname -lmingwex -lgcc -lmsvcr70
endif
ifeq ($(MSVCRT),80)
TCCX += -D__MSVCRT_VERSION=0x0800
LMSVCRT = -nodefaultlibs -lmingw32 -lgcc_eh -lmoldname -lmingwex -lgcc -lmsvcr80
endif
ifeq ($(MSVCRT),90)
TCCX += -D__MSVCRT_VERSION=0x0900
LMSVCRT = -nodefaultlibs -lmingw32 -lgcc_eh -lmoldname -lmingwex -lgcc -lmsvcr90 -lmsvcrt
endif
ifeq ($(MSVCRT),100)
TCCX += -D__MSVCRT_VERSION=0x0A00
LMSVCRT = -nodefaultlibs -lmingw32 -lgcc_eh -lmoldname -lmingwex -lgcc -lmsvcr100 -lmsvcrt
endif
ifeq ($(LMSVCRT),)
TCCX += -D_USE_32BIT_TIME_T=1
LMSVCRT = -lmsvcrt
endif
# Object files for rtree
#
RTREEOBJ+= rtree.o
# rtree source code files.
#
RTREESRC += \
$(TOP)/ext/rtree/rtree.h \
$(TOP)/ext/rtree/rtree.c
# Common headers
HDR += $(TOP)/sqlite3.h \
$(TOP)/src/sqlite3ext.h
# Header files used by rtree
#
RTREEHDR += \
$(TOP)/ext/rtree/rtree.h
# This is the default Makefile target. The objects listed here
# are what get build when you type just "make" with no arguments.
#
all: sqlite3_mod_rtree.$(SO)
# Rules to build individual files
#
sqlite3_mod_rtree.$(SO): $(RTREEOBJ)
$(TCCX) -shared -Wl,--kill-at \
-Wl,-out-implib,libsqlite3rtree.a -Wl,--strip-all \
-o sqlite3_mod_rtree.$(SO) $(RTREEOBJ) $(LMSVCRT) \
-lgdi32 -lcomdlg32 \
-ladvapi32 -lshell32 -luser32 -lkernel32
rtree.o: $(TOP)/ext/rtree/rtree.c $(RTREEHDR) $(HDR)
$(TCCX) -c $(TOP)/ext/rtree/rtree.c
clean:
rm -f $(RTREEOBJ) libsqlite3rtree.a sqlite3_mod_rtree.$(SO)