Annotation of pkgsrc/databases/sqlite3/Makefile, revision 1.172
1.172 ! wiz 1: # $NetBSD: Makefile,v 1.171 2025/05/08 04:57:14 adam Exp $
1.109 kamil 2:
1.172 ! wiz 3: PKGREVISION= 1
1.109 kamil 4: .include "Makefile.common"
1.22 tnn 5:
1.122 adam 6: DISTNAME= sqlite-autoconf-${SQLITE3_DISTVERSION}
1.95 khorben 7: PKGNAME= sqlite3-${SQLITE3_VERSION}
1.22 tnn 8: CATEGORIES= databases
9:
10: MAINTAINER= pkgsrc-users@NetBSD.org
11: COMMENT= SQL Database Engine in a C Library
1.9 heinz 12:
1.37 agc 13: .include "options.mk"
14:
1.164 adam 15: # Disable ccache; see autosetup/cc.tcl
16: CONFIGURE_ENV+= CCACHE=none
17:
1.32 adam 18: USE_LIBTOOL= yes
19: USE_TOOLS+= gmake
1.164 adam 20: HAS_CONFIGURE= yes
21: CONFIGURE_ARGS+= --mandir=${PREFIX}/${PKGMANDIR}
22: CONFIGURE_ARGS+= --prefix=${PREFIX}
1.110 kamil 23: PKGCONFIG_OVERRIDE+= sqlite3.pc.in
24:
1.28 obache 25: .include "../../mk/bsd.prefs.mk"
26:
1.167 riastrad 27: .if ${USE_CROSS_COMPILE:tl} == "yes"
28: CONFIGURE_ENV+= CC_FOR_BUILD=${TOOLS_CMD.native-cc:Q}
29: TOOLS_CREATE+= native-cc
30: TOOLS_SCRIPT.native-cc= exec ${NATIVE_CC} "$$@"
31: .endif
32:
1.161 riastrad 33: # sqlite3 compile options are documented at:
34: #
35: # https://www.sqlite.org/compile.html
36: #
37: # We always enable those options that:
38: #
39: # (a) are not dynamically loadable, but
40: # (b) enable functionality applications are likely to require, and
41: # (c) do not change default settings, and
42: # (d) do not bring unwieldy dependencies, and
43: # (e) do not incur unreasonable burden on users not needing them if
44: # applicable only to niche use cases.
45: #
46: # We also always enable options that are necessary to build, or are
47: # performance optimizations that do not affect functionality.
48: #
49: # Other options -- those that can be dynamically loaded, those that
50: # change defaults which applications could override anyway, or those
51: # that bring in unwieldy dependencies -- are relegated to options.mk,
52: # e.g. the `icu' option which brings in the unwieldy dependency of
53: # textproc/icu.
54: #
55: # Where both a configure argument option and a C preprocessor macro
56: # option are available, we prefer the configure argument so that it is
57: # checked by the configure script to detect potential bitrot in the
58: # future.
59:
60: ### Build fixes
1.35 joerg 61:
1.28 obache 62: # Darwin < 9 (Mac OS X < 10.5 "Leopard") doesn't have gethostuuid(2)
1.81 wiz 63: # and lacks the zone memory allocator
1.166 jperkin 64: .if ${MACHINE_PLATFORM:MDarwin-[0-8].*-*}
1.170 schmonz 65: CFLAGS+= -DSQLITE_ENABLE_LOCKING_STYLE=0
66: CFLAGS+= -DSQLITE_WITHOUT_ZONEMALLOC
1.28 obache 67: .endif
1.170 schmonz 68: # Sufficiently old ld(1) only has -dylib_*_version; newer ld(1) still has them
69: BUILDLINK_TRANSFORM.Darwin+= opt:-Wl,-compatibility_version:-Wl,-dylib_compatibility_version
70: BUILDLINK_TRANSFORM.Darwin+= opt:-Wl,-current_version:-Wl,-dylib_current_version
1.28 obache 71:
1.161 riastrad 72: ### Performance optimizations
73:
74: # In the past, Linux had database corruption issues with pread, so only
75: # enable it on safe platforms. This (undocumented) option enables the
76: # use of pread(2), instead of the sequence of syscalls
77: # lseek(2)-then-read(2), to read from a specific position in a file.
78: CFLAGS.NetBSD+= -DUSE_PREAD
79:
80: ### Enabled functionality
1.139 adam 81:
1.161 riastrad 82: # SQLITE_THREADSAFE. Some applications of sqlite3 in pkgsrc require
83: # thread-safety, so we enable this for everyone. Applications that
84: # really benefit from omitting mutexes and similar can statically link
85: # a custom build of sqlite3. We pass the arguments to make sure they
86: # stay enabled in case upstream ever changes the default until we
87: # review the change.
88: CONFIGURE_ARGS+= --enable-threadsafe
89:
90: # The column metadata API provides some additional information about
91: # the provenance of columns in query results, and is not dynamically
92: # loadable:
93: #
94: # https://www.sqlite.org/c3ref/column_database_name.html
95: # https://www.sqlite.org/compile.html#enable_column_metadata
1.164 adam 96: CFLAGS+= -DSQLITE_ENABLE_COLUMN_METADATA
1.161 riastrad 97:
98: # The DBSTAT virtual table provides information about disk space
99: # utilization, is required by lang/tcl's bin/sqlite3_analyzer, and is
100: # not (as far as I can tell) dynamically loadable:
101: #
102: # https://www.sqlite.org/dbstat.html
103: # https://www.sqlite.org/compile.html#enable_dbstat_vtab
1.164 adam 104: CFLAGS+= -DSQLITE_ENABLE_DBSTAT_VTAB
1.161 riastrad 105:
106: # Full-text search engines. There are two full-text search engines,
107: # fts3/4 and fts5. The options SQLITE_ENABLE_FTS3 and
108: # SQLITE_ENABLE_FTS4 are equivalent; we enable both to make it clear
109: # that that is intended. fts3 has been available since 3.5.0 in 2007,
110: # the fts4 extension (which is unconditionally bundled with the fts3
111: # build option now) since 3.7.4 in 2010, fts5 since 3.9.0 in 2015, and
112: # all are enabled by default. We pass the arguments to make sure they
113: # stay enabled in case upstream ever changes the default until we
114: # review the change.
115: #
116: # In principle, fts5 is dynamically loadable, but since upstream
117: # enables it by default anyway we treat that as a moot point.
118: #
119: # https://www.sqlite.org/fts3.html
120: # https://www.sqlite.org/fts5.html
121: # https://www.sqlite.org/compile.html#enable_fts3
122: # https://www.sqlite.org/compile.html#enable_fts4
123: # https://www.sqlite.org/compile.html#enable_fts5
1.164 adam 124: CONFIGURE_ARGS+= --fts3 # -DSQLITE_ENABLE_FTS3
125: CONFIGURE_ARGS+= --fts4 # -DSQLITE_ENABLE_FTS4
126: CONFIGURE_ARGS+= --fts5 # -DSQLITE_ENABLE_FTS5
1.161 riastrad 127:
128: # Nested queries and AND/OR operators for fts3/4.
129: #
130: # https://www.sqlite.org/fts3.html#_set_operations_using_the_enhanced_query_syntax
131: # https://www.sqlite.org/compile.html#enable_fts3_parenthesis
1.164 adam 132: CFLAGS+= -DSQLITE_ENABLE_FTS3_PARENTHESIS
1.161 riastrad 133:
134: # SQLITE_ENABLE_GEOPOLY, SQLITE_ENABLE_RTREE -- R*Tree and Geopoly
135: # interface for geospatial queries. Enabled by default since 2018. We
136: # pass the arguments to make sure they stay enabled in case upstream
137: # ever changes the default until we review the change.
138: #
139: # https://www.sqlite.org/geopoly.html
140: # https://www.sqlite.org/rtree.html
141: # https://www.sqlite.org/compile.html#enable_geopoly
142: # https://www.sqlite.org/compile.html#enable_rtree
1.164 adam 143: CONFIGURE_ARGS+= --geopoly
144: CONFIGURE_ARGS+= --rtree
1.161 riastrad 145:
146: # SQLITE_ENABLE_ICU -- unwieldy dependency, relegated to options.mk.
147: # https://www.sqlite.org/compile.html#enable_icu
148:
149: # SQLITE_ENABLE_IOTRACE -- experimental and may be discontinued in a
150: # future release.
151: # https://www.sqlite.org/compile.html#enable_iotrace
152:
153: # Hidden columns. Allows virtual tables to declare certain columns
154: # HIDDEN, which hides them from PRAGMA table_info, SELECT *, and
155: # implicit INSERT.
156: #
157: # https://www.sqlite.org/vtab.html#hiddencol
158: # https://www.sqlite.org/compile.html#enable_hidden_columns
1.164 adam 159: CFLAGS+= -DSQLITE_ENABLE_HIDDEN_COLUMNS
1.161 riastrad 160:
161: # SQLITE_ENABLE_JSON1 -- JSON1 support, built-in functions for
162: # manipulating JSON. Enabled by default since 2022, configure option
163: # removed, compile-time option switched from opt-in to opt-out in
164: # sqlite3>=3.38.0.
165: #
166: # https://www.sqlite.org/json1.html
167: # https://www.sqlite.org/compile.html#enable_json1
168:
169: # SQLITE_ENABLE_LOCKING_STYLE -- relevant mainly (only?) on Apple
170: # systems, where it is enabled by default anyway.
171: #
172: # This option enables additional logic in the OS interface layer
173: # for Mac OS X. The additional logic attempts to determine the
174: # type of the underlying filesystem and choose and alternative
175: # locking strategy that works correctly for that filesystem type.
176: #
177: # Note issue with Darwin < 9 (Mac OS X < 10.5 "Leopard") above.
178: #
179: # https://www.sqlite.org/compile.html#enable_locking_style
180:
181: # SQLITE_ENABLE_MATH_FUNCTIONS -- SQL math functions: sin/cos/tan,
182: # log/exp, floor/ceil/trunc, &c. We pass the arguments to make sure
183: # they stay enabled in case upstream ever changes the default until we
184: # review the change.
185: #
186: # https://www.sqlite.org/lang_mathfunc.html
187: # https://www.sqlite.org/compile.html#enable_math_functions
188: CONFIGURE_ARGS+= --enable-math
189:
190: # XXX Consider SQLITE_ENABLE_MEMORY_MANAGEMENT.
191: #
192: # This option adds extra logic to SQLite that allows it to
193: # release unused memory upon request. This option must be
194: # enabled in order for the sqlite3_release_memory() interface to
195: # work. If this compile-time option is not used, the
196: # sqlite3_release_memory() interface is a no-op.
197: #
198: # https://www.sqlite.org/compile.html#enable_memory_management
199:
200: # SQLITE_ENABLE_MEMSYS3, SQLITE_ENABLE_MEMSYS5 -- alternative memory
201: # allocators, mutually exclusive. These seem likely to be relevant
202: # only for specialized applications having unusual dynamic memory
203: # allocation requirements, so although this does enable extra
204: # functionality (SQLITE_CONFIG_HEAP,
205: # https://www.sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigheap),
206: # it's not clear which allocator is appropriate to ship by default so
207: # we will not enable either one.
208: #
209: # https://www.sqlite.org/compile.html#enable_memsys3
210: # https://www.sqlite.org/compile.html#enable_memsys5
211:
212: # XXX Consider -DSQLITE_ENABLE_NORMALIZE.
213: #
214: # This option includes the sqlite3_normalized_sql() API.
215: #
216: # Unclear what runtime consequences this has. Unclear what
217: # applications outside https://github.com/bloomberg/comdb2 use this.
218: #
219: # https://www.sqlite.org/compile.html#enable_normalize
220: #
221: # Gentoo enables: https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-db/sqlite/sqlite-3.47.2.ebuild?id=be159693998b95bddf9c118b2425d9f8a2365a67#n211
222: #
223: # Arch Linux does not: https://gitlab.archlinux.org/archlinux/packaging/packages/sqlite/-/blob/bf41f088e6ca945d9374838780d5bacb47653277/PKGBUILD#L42-53
224: # Debian does not: https://sources.debian.org/src/sqlite3/3.46.1-1/debian/rules/#line43
225: # Fedora does not: https://src.fedoraproject.org/rpms/sqlite/blob/182717934c83e9d3ec80f9f818961fd21640c964/f/sqlite.spec#_189
226: # FreeBSD does not: https://cgit.freebsd.org/ports/tree/databases/sqlite3/Makefile?id=8d38e8fbf53dfc94507a466b7269b38a55b167ac#n70
227: # Homebrew does not: https://github.com/Homebrew/homebrew-core/blob/f6ac42c098379841c21ed3a30e150f26187f34b1/Formula/s/sqlite.rb#L35-L58
228: # OpenBSD does not: https://cvsweb.openbsd.org/ports/databases/sqlite3/Makefile?rev=1.132&content-type=text/x-cvsweb-markup
229: #
230: # https://www.sqlite.org/compile.html#enable_normalize
231:
232: # SQLITE_ENABLE_NULL_TRIM -- minor on-disk space optimization with some
233: # compatibility issues and potentially blob API bugs. We will let
234: # sleeping dogs lie here.
235: #
236: # https://www.sqlite.org/compile.html#enable_null_trim
237:
238: # XXX Consider -DSQLITE_ENABLE_OFFSET_SQL_FUNC.
239: #
240: # Unclear what applications need this. Gentoo and Fedora enable this;
241: # others I checked do not.
242: #
243: # This option enables support for the sqlite_offset(X) SQL
244: # function.
245: #
246: # The sqlite_offset(X) SQL function requires a new interface on
247: # the B-tree storage engine, a new opcode in the virtual machine
248: # that runs SQL statements, and a new conditional in a critical
249: # path of the code generator. To avoid that overhead in
250: # applications that do not need the utility of sqlite_offset(X),
251: # the function is disabled by default.
252: #
253: # https://www.sqlite.org/compile.html#enable_offset_sql_func
254: #
255: # The sqlite_offset(X) function returns the byte offset in the
256: # database file for the beginning of the record from which value
257: # would be read. If X is not a column in an ordinary table, then
258: # sqlite_offset(X) returns NULL. The value returned by
259: # sqlite_offset(X) might reference either the original table or
260: # an index, depending on the query. If the value X would
261: # normally be extracted from an index, the sqlite_offset(X)
262: # returns the offset to the corresponding index record. If the
263: # value X would be extracted from the original table, then
264: # sqlite_offset(X) returns the offset to the table record.
265: #
266: # https://www.sqlite.org/lang_corefunc.html#sqlite_offset
267:
268: # XXX Consider SQLITE_ENABLE_ORDERED_SET_AGGREGATES.
269: #
270: # This option enables support for the "WITHIN GROUP ORDER BY"
271: # ordered-set aggregate syntax. For example:
272: #
273: # SELECT percentile_cont(0.75) WITHIN GROUP (ORDER BY x) FROM tab;
274: #
275: # The above is the SQL-standard way to compute the 75-percentile
276: # value of a distribution. The usual way to do this in SQLite is
277: # as follows:
278: #
279: # SELECT percentile_cont(x,0.75) FROM tab;
280: #
281: # Though simpler, easier to read, and easier to type, this syntax
282: # is not compliant with standard SQL. The simpler, non-standard
283: # syntax is always available in SQLite. But the SQL-standard
284: # compliant syntax is only available if compiled using
285: # -DSQLITE_ENABLE_ORDERED_SET_AGGREGATES. The SQL-standard
286: # compliant syntax is disabled by default because (A) it requires
287: # about 1,200 bytes of extra code in the compiled SQLite binary
288: # and (B) because it makes your SQL code more difficult to read,
289: # write, and understand without adding any value. Use this
290: # option only if you need to write cross-platform SQL that uses
291: # ordered-set aggregate functions such as percentile_cont().
292: #
293: # This might be useful for generic database wrappers that use this
294: # package for a sqlite3 backend. But nobody else seems to enable this.
295: # So let's hold off until the need arises.
296: #
297: # https://www.sqlite.org/compile.html#enable_ordered_set_aggregates
298:
299: # SQLITE_ENABLE_PREUPDATE_HOOK, SQLITE_ENABLE_SESSION -- enables the
300: # sqlite3_preupdate_* for pre-update hooks, and the sqlite3session_*
301: # APIs for reifying changesets.
302: #
303: # https://www.sqlite.org/c3ref/preupdate_blobwrite.html
304: # https://www.sqlite.org/sessionintro.html
305: # https://www.sqlite.org/compile.html#enable_preupdate_hook
306: # https://www.sqlite.org/compile.html#enable_session
1.164 adam 307: CONFIGURE_ARGS+= --session
1.161 riastrad 308:
309: # SQLITE_ENABLE_QPSG -- query planner stability guarantee. Off by
310: # default. This option turns it on by default. Applications can
311: # always use sqlite3_db_config(SQLITE_DBCONFIG_ENABLE_QPSG) to enable
312: # it at run-time, so no need for us to build sqlite3 with it.
313: #
314: # https://www.sqlite.org/queryplanner-ng.html#qpstab
315: # https://www.sqlite.org/compile.html#enable_qpsg
316:
317: # XXX Consider SQLITE_ENABLE_RBU, Resumable Bulk Updates.
318: #
319: # Gentoo enables this; nobody else I found does.
320: #
321: # https://www.sqlite.org/rbu.html
322: # https://www.sqlite.org/compile.html#enable_rbu
323:
324: # XXX Consider SQLITE_ENABLE_SNAPSHOT, write-ahead log snapshots.
325: #
326: # Unclear what applications might use this. Nobody else seems to
327: # enable this.
328: #
329: # https://www.sqlite.org/c3ref/snapshot.html
330: # https://www.sqlite.org/compile.html#enable_snapshot
331:
332: # SQLITE_ENABLE_SORTER_REFERENCES -- potential optimization whose value
333: # is not clear, off by default.
334: #
335: # https://www.sqlite.org/compile.html#enable_sorter_references
336:
337: # SQLITE_ENABLE_STMT_SCANSTATUS -- enables sqlite3_stmt_scanstatus and
338: # sqlite3_stmt_scanstatus_v2.
339: #
340: # Those interfaces are normally omitted from the build because
341: # they imposes a performance penalty, even on statements that do
342: # not use the feature.
343: #
344: # https://www.sqlite.org/c3ref/stmt_scanstatus.html
345: # https://www.sqlite.org/compile.html#enable_stmt_scanstatus
346:
347: # The SQLITE_STMT virtual table provides information about all prepared
348: # statements associated with the database connection. This is likely
349: # to be useful for performance analysis of applications and does not
350: # appear to have any performance penalty for applications that don't
351: # use it.
352: #
353: # https://www.sqlite.org/stmt.html
354: # https://www.sqlite.org/compile.html#enable_stmtvtab
1.164 adam 355: CFLAGS+= -DSQLITE_ENABLE_STMTVTAB
1.161 riastrad 356:
357: # SQLITE_RTREE_INT_ONLY
358: #
359: # This compile-time option is deprecated and untested.
360: #
361: # https://www.sqlite.org/compile.html#rtree_int_only
362:
363: # SQLITE_ENABLE_SQLLOG
364: #
365: # This option enables extra code (especially the
366: # SQLITE_CONFIG_SQLLOG option to sqlite3_config()) that can be
367: # used to create logs of all SQLite processing performed by an
368: # application.
369: #
370: # Unclear what applications use this or what it does beyond
371: # sqlite3_trace_v2 (https://www.sqlite.org/c3ref/trace_v2.html). Can't
372: # find anyone else who enables this.
373: #
374: # https://www.sqlite.org/c3ref/c_config_covering_index_scan.html#sqliteconfigsqllog
375: # https://www.sqlite.org/compile.html#enable_sqllog
376:
377: # SQLITE_ENABLE_STAT2, SQLITE_ENABLE_STAT3, SQLITE_ENABLE_STAT4 --
378: # statistics tables created by the ANALYZE command.
379: # SQLITE_ENABLE_STAT2 and SQLITE_ENABLE_STAT3 are now ignored.
380: # SQLITE_ENABLE_STAT4 is not enabled by default and it's unclear what
381: # the performance implications are, but it appears likely to expand
382: # disk usage and potentially break the query planner stability
383: # guarantee, so we'll leave it off for now.
384: #
385: # https://www.sqlite.org/fileformat2.html#stat4tab
386: # https://www.sqlite.org/compile.html#enable_stat2
387: # https://www.sqlite.org/compile.html#enable_stat3
388: # https://www.sqlite.org/compile.html#enable_stat4
389:
390: # SQLITE_ENABLE_TREE_EXPLAIN
391: #
392: # This compile-time option is no longer used.
393: #
394: # https://www.sqlite.org/compile.html#enable_tree_explain
395:
396: # XXX Consider SQLITE_ENABLE_UPDATE_DELETE_LIMIT:
397: #
398: # This option enables an optional ORDER BY and LIMIT clause on
399: # UPDATE and DELETE statements.
400: #
401: # Unclear what applications might rely on this. Debian and Gentoo
402: # enable this by default; others do not.
403: #
404: # https://www.sqlite.org/compile.html#enable_update_delete_limit
405:
406: # XXX Consider SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION -- enables the
407: # `unknown()' function for (and only for) EXPLAIN or EXPLAIN QUERY
408: # PLAN, as a substitute for any functions sqlite3 does not recognize.
409: #
410: # When used in the command-line shell, the
411: # SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION feature allows SQL text that
412: # contains application-defined functions to be pasted into the
413: # shell for analysis and debugging without having to create and
414: # load an extension that implements the application-defined
415: # functions.
416: #
417: # However, this might be useful _only_ for the command-line shell;
418: # unclear what applications might rely on failure vs unknown().
419: #
420: # https://www.sqlite.org/compile.html#enable_unknown_sql_function
421:
422: # SQLITE_ENABLE_UNLOCK_NOTIFY -- enables sqlite3_unlock_notify(),
423: # needed for various sqlite3 API calls to sleep rather than fail with
424: # SQLITE_LOCKED when another thread is using another connection to the
425: # same database, so they can be woken by the other thread when it is
426: # done. Needed by, e.g., Firefox.
427: #
428: # https://www.sqlite.org/unlock_notify.html
429: # https://www.sqlite.org/compile.html#enable_unlock_notify
1.164 adam 430: CFLAGS+= -DSQLITE_ENABLE_UNLOCK_NOTIFY
1.161 riastrad 431:
432: # SQLITE_INTROSPECTION_PRAGMAS
433: #
434: # This option is obsolete.
435: #
436: # https://www.sqlite.org/compile.html#introspection_pragmas
437:
438: # XXX Consider SQLITE_SOUNDEX:
439: #
440: # This option enables the soundex() SQL function.
441: #
442: # Debian and Gentoo enable this by default; others do not.
443: #
444: # https://www.sqlite.org/lang_corefunc.html#soundex
445: # https://www.sqlite.org/compile.html#soundex
446:
447: # XXX Consider SQLITE_STRICT_SUBTYPE=1:
448: #
449: # This option causes application-defined SQL functions to raise
450: # an SQL error if they invoke the sqlite3_result_subtype()
451: # interface but where not registered with the
452: # SQLITE_RESULT_SUBTYPE property. This recommended option helps
453: # to identify problems in the implementation of
454: # application-defined SQL functions early in the development
455: # cycle.
456: #
457: # Debian and FreeBSD enable this; others do not.
458: #
459: # https://www.sqlite.org/compile.html#strict_subtype
460:
461: # XXX Consider SQLITE_USE_ALLOCA:
462: #
463: # If this option is enabled, then the alloca() memory allocator
464: # will be used in a few situations where it is appropriate. This
465: # results in a slightly smaller and faster binary. The
466: # SQLITE_USE_ALLOCA compile-time only works, of course, on
467: # systems that support alloca().
468: #
469: # Nobody else seems to enable this.
470: #
471: # https://www.sqlite.org/compile.html#use_alloca
472:
473: # XXX Consider SQLITE_USE_FCNTL_TRACE:
474: #
475: # This option causes SQLite to issue extra SQLITE_FCNTL_TRACE
476: # file controls to provide supplementary information to the VFS.
477: # The "vfslog.c" extension makes use of this to provide enhanced
478: # logs of VFS activity.
479: #
480: # Nobody else seems to enable this. Unclear what applications this
481: # benefits.
482: #
483: # https://www.sqlite.org/compile.html#use_fcntl_trace
484:
485: # SQLITE_USE_SEH
486: #
487: # Client code should not use this define, as it is used
488: # internally by the library.
489: #
490: # https://www.sqlite.org/compile.html#use_seh
491:
492: # XXX Consider SQLITE_HAVE_ZLIB:
493: #
494: # This option has no effect on the SQLite core. It is only used
495: # by extensions. This is option is necessary for the compression
496: # and decompression functions that are part of SQL Archive
497: # support in the command-line shell.
498: #
499: # https://www.sqlite.org/compile.html#have_zlib
1.165 riastrad 500: #
501: # XXX sqlite3 appears to automatically pull zlib in if it's available
502: # in the system, even if buildlink3 hasn't authorized it. And on some
503: # platforms with pkgsrc zlib and system zlib, this may confuse the
504: # REQUIRES processing, making pkg_add choke on the sqlite3 package.
505: # Let's forcibly disable it for now (can't find a --disable-zlib
506: # option, so we'll have to use a big buildlink3 hammer) until we
507: # discuss whether sqlite3 should have zlib linked in, as a conscious
508: # decision rather than an accident.
509: BUILDLINK_TRANSFORM+= rm:-lz
510: BUILDLINK_TRANSFORM+= rm:-DSQLITE_HAVE_ZLIB=1
1.161 riastrad 511:
512: # XXX Consider YYTRACKMAXSTACKDEPTH:
513: #
514: # This option causes the LALR(1) parser stack depth to be tracked
515: # and reported using the
516: # sqlite3_status(SQLITE_STATUS_PARSER_STACK,...) interface.
517: # SQLite's LALR(1) parser has a fixed stack depth (determined at
518: # compile-time using the YYSTACKDEPTH options). This option can
519: # be used to help determine if an application is getting close to
520: # exceeding the maximum LALR(1) stack depth.
521:
522: # SQLITE_OMIT_LOAD_EXTENSION (old: !SQLITE_ENABLE_LOAD_EXTENSION)
523: #
524: # Make sure this is consistently enabled on all platforms -- this way
525: # the build fails early if something goes wrong with getting at dlopen.
526: # (XXX If we have platforms without dlopen, we may want to disable this
527: # on those platforms.)
528: #
529: # https://www.sqlite.org/compile.html#omit_load_extension
1.164 adam 530: CONFIGURE_ARGS+= --enable-load-extension
1.29 tnn 531:
1.16 epg 532: # Uses dlopen and friends but doesn't use -ldl on Linux.
533: # See http://www.sqlite.org/cvstrac/tktview?tn=3555
1.164 adam 534: LIBS+= ${BUILDLINK_LDADD.dl}
1.16 epg 535:
1.161 riastrad 536: # Solaris needs -lrt for nanosleep, PR pkg/58714
1.164 adam 537: LIBS.SunOS+= -lrt
1.156 nia 538:
1.168 nia 539: CFLAGS.UnixWare+= -DHAVE_NANOSLEEP=0 -DHAVE_USLEEP=1
540: LDFLAGS.UnixWare+= -lthread
541:
1.80 ryoon 542: LDFLAGS.SCO_SV+= -lpthread
543:
1.164 adam 544: .if ${OPSYS} == "Darwin"
545: post-install:
546: install_name_tool -id ${PREFIX}/lib/libsqlite3.dylib \
547: ${DESTDIR}${PREFIX}/lib/libsqlite3.dylib
548: .endif
549:
550: .include "../../mk/dlopen.buildlink3.mk"
1.127 sevan 551: .include "../../mk/pthread.buildlink3.mk"
1.67 ryoon 552: .include "../../mk/readline.buildlink3.mk"
1.1 tv 553: .include "../../mk/bsd.pkg.mk"
CVSweb <webmaster@jp.NetBSD.org>