forked from nalgeon/sqlean
-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto.def
131 lines (110 loc) · 3.46 KB
/
auto.def
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
use system
array set names {}
foreach ext [lsort [split [glob -tails -directory $autosetup(srcdir)/src sqlite3-*.c] ] ] {
set ext [string range $ext 0 [expr {[string length $ext] - 3}]]
set ext [string range $ext 8 end]
set names($ext) 1
append disable_opts "$ext=1 => {Disable the '$ext' extension}\n"
}
options "
abs-dirs => {Enable absolute directory names in Makefile}
local-sqlite => {Force bundled sqlite headers (make LOCAL_SQLITE=1)}
sqlite-incdir: => {Local sqlite header dir (make SQLITE_INCDIR=\$dir)}
compile-debug => {Compile with debug info (make SQLEAN_DEBUG=1)}
$disable_opts
"
use cc cc-shared cc-lib
cc-check-functions timespec_get
define SHOBJ_LDFLAGS_ipaddr {}
if { ![cc-check-includes "arpa/inet.h"] } {
if { [cc-check-includes "Ws2tcpip.h"] && [opt-bool ipaddr] } {
define SHOBJ_LDFLAGS_ipaddr -lws2_32
} else {
msg-result " Extension 'ipaddr' is unsupported here."
array unset names ipaddr
}
}
define local_sqlite {}
if {[opt-bool local-sqlite]} {
msg-result "Using local SQLite headers (forced)"
define local_sqlite 1
} else {
cc-check-includes sqlite3ext.h
if {![get-define HAVE_SQLITE3EXT_H]} {
msg-result " Using local SQLite headers"
define local_sqlite 1
}
}
set cflag_max_errors {}
cc-with {-lang c} {
if {[cc-check-flags -ferror-limit=5]} {
set cflag_max_errors "-ferror-limit=5"
} elseif {[cc-check-flags -fmax-errors=5]} {
set cflag_max_errors "-fmax-errors=5"
}
}
define CFLAG_MAX_ERRORS "$cflag_max_errors"
unset cflag_max_errors
# TODO stop tests when no sqlite3?
cc-path-progs [get-define CC] 7z cygpath git make realpath sqlite3 tar zip
set targetwin 0
if {[get-define CYGPATH] ne "false"} {
define REALPATH "cygpath --absolute --windows"
set targetwin 1
} elseif {[get-env MSYSTEM ""] ne ""} {
set targetwin 1
}
if {$targetwin} {
if {[get-define ZIP] ne "false"} {
define TARZIP "zip -r --quiet"
# Not ever tested as far as I know.. remove and just require zip?
} elseif {[get-define 7Z] ne "false"} {
define TARZIP "7z a -bd"
}
} else {
define TARZIP "tar czf"
}
unset targetwin
# MacOS strip does not even accept --version... Options:
# 1. Just strip regardless
#, not sure if this is worth
# it to be honest.
#set strip_version [exec strip --version]
#if {[regexp {GNU} $strip_version]} {
# define STRIP "strip --strip-unneeded --remove-section=.comment --remove-section=.note"
#} else {
# define STRIP strip
#}
define SQLEAN_MSYSTEM [env-is-set MSYSTEM]
if {[get-define SQLEAN_MSYSTEM]} {
msg-result "Enabling MSYS2 ([get-env MSYSTEM {}]) test support"
}
if {[get-define GIT] ne ""} {
set version "v[exec git tag --points-at HEAD]"
if {$version eq "v"} {
set version [exec git rev-parse --short HEAD]
}
} else {
set version "UNKNOWN"
}
msg-result "Configured sqlean version $version"
define SQLEAN_VERSION $version
unset version
foreach ext [array names names ] {
if {![opt-bool $ext]} {
array unset names $ext
define [string toupper SQLEAN_$ext] 0
} else {
define [string toupper SQLEAN_$ext] 1
}
}
define TARGETS [array names names]
define sqlite_incdir {}
if {[opt-str sqlite-incdir o]} {
msg-result "User-defined SQLITE_INCDIR"
define sqlite_incdir $o
define local_sqlite 1
}
make-config-header build/[get-define host]/_config.h \
-str SQLEAN_VERSION -auto SQLEAN_*
make-template Makefile.in