SQLite

Check-in [80584e16]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove accommodation of the legacy-named shared libraries from the installation rules, per discussion. Rename install-includes to install-headers. Quote installation target dir names "just in case".
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 80584e165e4652e76cc3188befcee814f168298486743940bcf46696043686a0
User & Date: stephan 2024-10-30 04:07:16
References
2024-11-04
08:29
When installing the shared lib, re-activate the accommodation of legacy-style .so links (removed in [80584e165e4]) based on two reports that not having those will cause all clients linked against the legacy naming convention to fail to dynamically link (which would preclude an update of a system-level libsqlite3 package). Set up the infrastructure needed for adding an SONAME to the library but do not yet activate it. See discussion in/around forum post 046133a7da. (check-in: 1586eace user: stephan tags: trunk)
Context
2024-10-30
05:07
Clean up and add docs to the TCL vetting steps. Make warning and error messages bold if stdout isatty. (check-in: 47157dcf user: stephan tags: trunk)
04:07
Remove accommodation of the legacy-named shared libraries from the installation rules, per discussion. Rename install-includes to install-headers. Quote installation target dir names "just in case". (check-in: 80584e16 user: stephan tags: trunk)
03:51
Generic makefile cleanups. (check-in: 6f86ff2e user: stephan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to main.mk.
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
install-dir.include = $(DESTDIR)$(prefix)/include
install-dir.pkgconfig = $(DESTDIR)$(pkgconfigdir)
install-dir.man1 = $(DESTDIR)$(prefix)/share/man/man1
install-dir.all = $(install-dir.bin) $(install-dir.include) \
  $(install-dir.lib) $(install-dir.man1) \
  $(install-dir.pkgconfig)
$(install-dir.all):
	$(INSTALL) -d $@

#
# After jimsh is compiled, we run some sanity checks to ensure that
# it was built in a way compatible with this project's scripts:
#
# 1) Ensure that it was built with realpath() or _fullpath() support.
# Without that flag the [file normalize] command will always resolve







|







356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
install-dir.include = $(DESTDIR)$(prefix)/include
install-dir.pkgconfig = $(DESTDIR)$(pkgconfigdir)
install-dir.man1 = $(DESTDIR)$(prefix)/share/man/man1
install-dir.all = $(install-dir.bin) $(install-dir.include) \
  $(install-dir.lib) $(install-dir.man1) \
  $(install-dir.pkgconfig)
$(install-dir.all):
	$(INSTALL) -d "$@"

#
# After jimsh is compiled, we run some sanity checks to ensure that
# it was built in a way compatible with this project's scripts:
#
# 1) Ensure that it was built with realpath() or _fullpath() support.
# Without that flag the [file normalize] command will always resolve
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
	$(T.link.shared) -o $@ $(LIBOBJ) $(LDFLAGS.libsqlite3)
$(libsqlite3.SO)-1: $(libsqlite3.SO)
$(libsqlite3.SO)-0 $(libsqlite3.SO)-:
so: $(libsqlite3.SO)-$(ENABLE_SHARED)
all: so

#
# Install the $(libsqlite3.SO) as $(libsqlite3.SO).$(PACKAGE_VERSION) and
# create symlinks which point to it. Do we really need all of this
# hoop-jumping? Can we not simply install the .so as-is to
# libsqlite3.so (without the versioned bits)?
#
# Regarding the historcal installation name of libsqlite3.so.0.8.6:
#
# The historical SQLite build always used a version number of 0.8.6
# for reasons lost to history but having something to do with libtool
# (which is not longer used in this tree). In order to retain filename
# compatibility for systems which have libraries installed using those
# conventions:
#
# 1) If libsqlite3.so.0.8.6 is found in the target installation
#    directory then it is re-linked to point to the new
#    names. libsqlite3.so.0 historically symlinks to
#    libsqlite3.so.0.8.6, and that link is left in place. We cannot
#    retain both the old and new installation because they both share
#    the high-level name $(libsqlite3.SO). The down-side of this is
#    that it may well upset packaging tools when we replace
#    libsqlite3.so (from a legacy package) with a new symlink.
#
# 2) If INSTALL_SO_086_LINKS=1 and point (1) does not apply then links
#    to the legacy-style names are created. The primary intent of this
#    is to enable chains of operations such as the hypothetical (apt
#    remove sqlite3-3.47.0 && apt install sqlite3-3.48.0). In such
#    cases, condition (1) would never trigger but applications might
#    still expect to see the legacy file names.
#
# In either case we also delete libsqlite3.la because it cannot work
# with the non-libtool library this installation installs.
#
install-so-1: $(install-dir.lib) $(libsqlite3.SO)
	$(INSTALL) $(libsqlite3.SO) $(install-dir.lib)
	@echo "Setting up SO symlinks..."; \
		cd $(install-dir.lib) || exit $$?; \
		rm -f $(libsqlite3.SO).3 $(libsqlite3.SO).$(PACKAGE_VERSION) libsqlite3.la || exit $$?; \
		mv $(libsqlite3.SO) $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \
		ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).3 || exit $$?; \
		ln -s $(libsqlite3.SO).3 $(libsqlite3.SO) || exit $$?; \
		ls -la $(libsqlite3.SO) $(libsqlite3.SO).3* || exit $$?; \
		if [ -e $(libsqlite3.SO).0.8.6 ]; then \
			echo "ACHTUNG: legacy libtool-compatible install found. Re-linking it..."; \
			rm -f $(libsqlite3.SO).0.8.6 || exit $$?; \
			ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0.8.6 || exit $$?; \
			ls -la $(libsqlite3.SO).0*; \
		elif [ x1 = "x$(INSTALL_SO_086_LINKS)" ]; then \
			echo "ACHTUNG: installing legacy libtool-style links because INSTALL_SO_086_LINKS=1"; \
			rm -f $(libsqlite3.SO).0.8.6 $(libsqlite3.SO).0 || exit $$?; \
			ln -s $(libsqlite3.SO).0.8.6 $(libsqlite3.SO).0 || exit $$?; \
			ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0.8.6 || exit $$?; \
			ls -la $(libsqlite3.SO).0*; \
		fi
install-so-0 install-so-:
install-so: install-so-$(ENABLE_SHARED)
install: install-so

#
# Install $(libsqlite3.LIB)
#
install-lib-1: $(install-dir.lib) $(libsqlite3.LIB)
	$(INSTALL.noexec) $(libsqlite3.LIB) $(install-dir.lib)
install-lib-0 install-lib-:
install-lib: install-lib-$(ENABLE_STATIC)
install: install-lib

#
# Install C header files
#
install-includes: sqlite3.h $(install-dir.include)
	$(INSTALL.noexec) sqlite3.h "$(TOP)/src/sqlite3ext.h" $(install-dir.include)
install: install-includes

#
# libtclsqlite3...
#
pkgIndex.tcl:
	echo 'package ifneeded sqlite3 $(PACKAGE_VERSION) [list load [file join $$dir libtclsqlite3[info sharedlibextension]] sqlite3]' > $@
libtclsqlite3.SO = libtclsqlite3$(T.dll)







|
|
<
<

<
<
<
<
<
<
<
<
|
<
|
<
<
<
<
|

<
<
<
<
<
<
<
<
<
<

|

|
|



|
<
<
<
<
<
<
<
<
<
<
<
<








|







|
|
|







1339
1340
1341
1342
1343
1344
1345
1346
1347


1348








1349

1350




1351
1352










1353
1354
1355
1356
1357
1358
1359
1360
1361












1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
	$(T.link.shared) -o $@ $(LIBOBJ) $(LDFLAGS.libsqlite3)
$(libsqlite3.SO)-1: $(libsqlite3.SO)
$(libsqlite3.SO)-0 $(libsqlite3.SO)-:
so: $(libsqlite3.SO)-$(ENABLE_SHARED)
all: so

#
# Install the $(libsqlite3.SO) as $(libsqlite3.SO).$(PACKAGE_VERSION)
# and create symlinks which point to it:


#








# - libsqlite3.so.$(PACKAGE_VERSION)

# - libsqlite3.so.3 =symlink-> libsqlite3.so.$(PACKAGE_VERSION)




# - libsqlite3.so   =symlink-> libsqlite3.so.3
#










install-so-1: $(install-dir.lib) $(libsqlite3.SO)
	$(INSTALL) $(libsqlite3.SO) "$(install-dir.lib)"
	@echo "Setting up SO symlinks..."; \
		cd "$(install-dir.lib)" || exit $$?; \
		rm -f $(libsqlite3.SO).3 $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \
		mv $(libsqlite3.SO) $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \
		ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).3 || exit $$?; \
		ln -s $(libsqlite3.SO).3 $(libsqlite3.SO) || exit $$?; \
		ls -la $(libsqlite3.SO) $(libsqlite3.SO).3*












install-so-0 install-so-:
install-so: install-so-$(ENABLE_SHARED)
install: install-so

#
# Install $(libsqlite3.LIB)
#
install-lib-1: $(install-dir.lib) $(libsqlite3.LIB)
	$(INSTALL.noexec) $(libsqlite3.LIB) "$(install-dir.lib)"
install-lib-0 install-lib-:
install-lib: install-lib-$(ENABLE_STATIC)
install: install-lib

#
# Install C header files
#
install-headers: sqlite3.h $(install-dir.include)
	$(INSTALL.noexec) sqlite3.h "$(TOP)/src/sqlite3ext.h" "$(install-dir.include)"
install: install-headers

#
# libtclsqlite3...
#
pkgIndex.tcl:
	echo 'package ifneeded sqlite3 $(PACKAGE_VERSION) [list load [file join $$dir libtclsqlite3[info sharedlibextension]] sqlite3]' > $@
libtclsqlite3.SO = libtclsqlite3$(T.dll)
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
# _static_ makefile.
$(libtclsqlite3.SO)-1: $(libtclsqlite3.SO)
$(libtclsqlite3.SO)-0 $(libtclsqlite3.SO)-:
libtcl: $(libtclsqlite3.SO)-$(HAVE_TCL)
all: libtcl

install-tcl-1: $(libtclsqlite3.SO) pkgIndex.tcl
	@$(T.tcllibdir); set -x; dest="$(DESTDIR)$$tcllibdir"; \
	$(INSTALL) -d $$dest; \
	$(INSTALL) $(libtclsqlite3.SO) $$dest; \
	$(INSTALL.noexec) pkgIndex.tcl $$dest
install-tcl-0 install-tcl-:
install-tcl: install-tcl-$(HAVE_TCL)
install: install-tcl

tclsqlite3.c:	sqlite3.c
	echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
	cat sqlite3.c >>tclsqlite3.c







|
|
|
|







1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
# _static_ makefile.
$(libtclsqlite3.SO)-1: $(libtclsqlite3.SO)
$(libtclsqlite3.SO)-0 $(libtclsqlite3.SO)-:
libtcl: $(libtclsqlite3.SO)-$(HAVE_TCL)
all: libtcl

install-tcl-1: $(libtclsqlite3.SO) pkgIndex.tcl
	@$(T.tcllibdir); set -x; \
	$(INSTALL) -d "$(DESTDIR)$$tcllibdir"; \
	$(INSTALL) $(libtclsqlite3.SO) "$(DESTDIR)$$tcllibdir"; \
	$(INSTALL.noexec) pkgIndex.tcl "$(DESTDIR)$$tcllibdir"
install-tcl-0 install-tcl-:
install-tcl: install-tcl-$(HAVE_TCL)
install: install-tcl

tclsqlite3.c:	sqlite3.c
	echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
	cat sqlite3.c >>tclsqlite3.c
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
# semantics of 0 and 1 are confusingly swapped here.
#
sqlite3$(T.exe)-1:
sqlite3$(T.exe)-0 sqlite3$(T.exe)-: sqlite3$(T.exe)
all: sqlite3$(T.exe)-$(HAVE_WASI_SDK)

install-shell-0: sqlite3$(TEXT) $(install-dir.bin)
	$(INSTALL) -s sqlite3$(TEXT) $(install-dir.bin)
install-shell-1 install-shell-:
install: install-shell-$(HAVE_WASI_SDK)

sqldiff$(T.exe):	$(TOP)/tool/sqldiff.c $(TOP)/ext/misc/sqlite3_stdio.h sqlite3.o sqlite3.h
	$(T.link) -o $@ $(TOP)/tool/sqldiff.c sqlite3.o $(LDFLAGS.libsqlite3)

install-diff: sqldiff$(T.exe) $(install-dir.bin)
	$(INSTALL) -s sqldiff$(TEXT) $(install-dir.bin)
#install: install-diff

dbhash$(T.exe):	$(TOP)/tool/dbhash.c sqlite3.o sqlite3.h
	$(T.link) -o $@ $(TOP)/tool/dbhash.c sqlite3.o $(LDFLAGS.libsqlite3)
xbin: dbhash$(T.exe)

RSYNC_SRC = \







|







|







1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
# semantics of 0 and 1 are confusingly swapped here.
#
sqlite3$(T.exe)-1:
sqlite3$(T.exe)-0 sqlite3$(T.exe)-: sqlite3$(T.exe)
all: sqlite3$(T.exe)-$(HAVE_WASI_SDK)

install-shell-0: sqlite3$(TEXT) $(install-dir.bin)
	$(INSTALL) -s sqlite3$(TEXT) "$(install-dir.bin)"
install-shell-1 install-shell-:
install: install-shell-$(HAVE_WASI_SDK)

sqldiff$(T.exe):	$(TOP)/tool/sqldiff.c $(TOP)/ext/misc/sqlite3_stdio.h sqlite3.o sqlite3.h
	$(T.link) -o $@ $(TOP)/tool/sqldiff.c sqlite3.o $(LDFLAGS.libsqlite3)

install-diff: sqldiff$(T.exe) $(install-dir.bin)
	$(INSTALL) -s sqldiff$(TEXT) "$(install-dir.bin)"
#install: install-diff

dbhash$(T.exe):	$(TOP)/tool/dbhash.c sqlite3.o sqlite3.h
	$(T.link) -o $@ $(TOP)/tool/dbhash.c sqlite3.o $(LDFLAGS.libsqlite3)
xbin: dbhash$(T.exe)

RSYNC_SRC = \
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
  -DSQLITE_OMIT_DEPRECATED

sqlite3_rsync$(T.exe):	$(RSYNC_SRC)
	$(T.cc.sqlite) -o $@ $(RSYNC_OPT) $(RSYNC_SRC) $(LDFLAGS.libsqlite3)
xbin: sqlite3_rsync$(T.exe)

install-rsync: sqlite3_rsync$(T.exe) $(install-dir.bin)
	$(INSTALL) sqlite3_rsync$(TEXT) $(install-dir.bin)
#install: install-rsync

install-man1: $(install-dir.man1)
	$(INSTALL.noexec) $(TOP)/sqlite3.1 $(install-dir.man1)
install: install-man1

#
# sqlite3.pc is typically generated by the configure script but could
# conceivably be generated by hand.
install-pc: sqlite3.pc $(install-dir.pkgconfig)
	$(INSTALL.noexec) sqlite3.pc $(install-dir.pkgconfig)

scrub$(T.exe):	$(TOP)/ext/misc/scrub.c sqlite3.o
	$(T.link) -o $@ -I. -DSCRUB_STANDALONE \
		$(TOP)/ext/misc/scrub.c sqlite3.o $(LDFLAGS.libsqlite3)
xbin: scrub$(T.exe)

srcck1$(B.exe):	$(TOP)/tool/srcck1.c







|



|






|







1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
  -DSQLITE_OMIT_DEPRECATED

sqlite3_rsync$(T.exe):	$(RSYNC_SRC)
	$(T.cc.sqlite) -o $@ $(RSYNC_OPT) $(RSYNC_SRC) $(LDFLAGS.libsqlite3)
xbin: sqlite3_rsync$(T.exe)

install-rsync: sqlite3_rsync$(T.exe) $(install-dir.bin)
	$(INSTALL) sqlite3_rsync$(TEXT) "$(install-dir.bin)"
#install: install-rsync

install-man1: $(install-dir.man1)
	$(INSTALL.noexec) $(TOP)/sqlite3.1 "$(install-dir.man1)"
install: install-man1

#
# sqlite3.pc is typically generated by the configure script but could
# conceivably be generated by hand.
install-pc: sqlite3.pc $(install-dir.pkgconfig)
	$(INSTALL.noexec) sqlite3.pc "$(install-dir.pkgconfig)"

scrub$(T.exe):	$(TOP)/ext/misc/scrub.c sqlite3.o
	$(T.link) -o $@ -I. -DSCRUB_STANDALONE \
		$(TOP)/ext/misc/scrub.c sqlite3.o $(LDFLAGS.libsqlite3)
xbin: scrub$(T.exe)

srcck1$(B.exe):	$(TOP)/tool/srcck1.c