SQLite

Check-in [24aba7ee]
Login

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

Overview
Comment:Add autotools-compatible overridable dir name vars for the various installation targets, calculated at make-time instead of exported at configure-time for reasons explained at length in the accompanying comments.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 24aba7ee58f3048d70ff0c2b2cda26bc04bfb46b3055d25d62ab5ff97b106be2
User & Date: stephan 2024-11-02 03:34:04
Context
2024-11-03
01:31
Fix T.exe typos in main.mk which break installation on platforms where that value is not empty. Also some unrelated doc tweaks. (check-in: ab97ff44 user: stephan tags: trunk)
2024-11-02
05:50
An experiment in hybridizing overriding of autotools-conventional XYZdir vars, the goal being to be able to provide both overrriding of them at configure-time and make-time with sensible semantics. Based on notes from forum post 00d12a41f7. (Closed-Leaf check-in: cc259bf5 user: stephan tags: autosetup-dir-overrides)
03:34
Add autotools-compatible overridable dir name vars for the various installation targets, calculated at make-time instead of exported at configure-time for reasons explained at length in the accompanying comments. (check-in: 24aba7ee user: stephan tags: trunk)
2024-11-01
01:56
When configuring with --with-wasi-sdk, ensure that we use that SDK's 'ar' tool instead of whatever is in the PATH. When pushing/popping the define var scope for the jimsh compatility check, include more defines per consultation with autosetup's creator. (check-in: 2dcc465a user: stephan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to Makefile.in.
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

#
# The top-most directory of the source tree.  This is the directory
# that contains this "Makefile.in" and the "configure" script.
#
TOP = @abs_top_srcdir@
#
# Some standard variables and programs
prefix ?= @prefix@
#
# Just testing some default dir expansions...
# srcdir = @srcdir@
# builddir = @builddir@
# top_srcdir = @top_srcdir@
# abs_top_srcdir = @abs_top_srcdir@
# abs_top_builddir = @abs_top_builddir@
#






















































INSTALL = @BIN_INSTALL@
AR = @AR@
AR.flags = cr # TODO? Add a configure test to determine this?
CC = @CC@
B.cc = @CC_FOR_BUILD@ @BUILD_CFLAGS@
T.cc = $(CC)
#







<
<
<








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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

#
# The top-most directory of the source tree.  This is the directory
# that contains this "Makefile.in" and the "configure" script.
#
TOP = @abs_top_srcdir@
#



# Just testing some default dir expansions...
# srcdir = @srcdir@
# builddir = @builddir@
# top_srcdir = @top_srcdir@
# abs_top_srcdir = @abs_top_srcdir@
# abs_top_builddir = @abs_top_builddir@
#

#
# Autotools-conventional vars which are used by package installation
# rules in main.mk.
#
# Autosetup allows the various XYZdir vars to be overridden at
# configure-time with, e.g. --libdir=X and --mandir=Y. However,
# defining them at configure-time, instead of at make-time, leads to
# later awkwardness:
#
# $ ./configure --prefix=/usr
# $ make prefix=/bar
#
# In that invocation, libdir will be /usr/foo, not /bar/foo as it
# normally should, unless the user _also_ passes libdir=... to make.
#
# In 99%+ of use cases, setting prefix=X has the desired effect of
# calculating conventional defaults for various other dirs, like
# $prefix/lib, $prefix/include, etc. If, however, we export those at
# configure-time, the passing prefix=... to make will update only
# $prefix and none of its derived dirs.
#
# Because it is more important (for our use cases) that these vars be
# overridable via a make invocation than a configure invocation, and
# they conventionally derive from $(prefix) in all but the most exotic
# of use cases, we do not export the configure-defined overrides of
# those vars to this makefile.  Instead, we export only $prefix and
# its derived vars are set to their conventional default values in
# main.mk, which users can then override at make-time as needed.
# Overriding $prefix via make will also calculate any derived vars, as
# one would expect, unless each is specifically overridden.
#
# For completeness's sake, the aforementioned conventional vars which
# are relevant to our installation rules are:
#
# datadir     = $(prefix)/share
# mandir      = $(datadir)/man
# includedir  = $(prefix)/include
# exec_prefix = $(prefix)
# bindir      = $(exec_prefix)/bin
# libdir      = $(exec_prefix)/lib
#
# Our builds do not require any of their relatives:
#
# sbindir        = $(exec_prefix)/sbin
# sysconfdir     = /etc
# sharedstatedir = $(prefix)/com
# localstatedir  = /var
# runstatedir    = /run
# infodir        = $(datadir)/info
# libexec        = $(exec_prefix)/libexec
#
prefix      = @prefix@

INSTALL = @BIN_INSTALL@
AR = @AR@
AR.flags = cr # TODO? Add a configure test to determine this?
CC = @CC@
B.cc = @CC_FOR_BUILD@ @BUILD_CFLAGS@
T.cc = $(CC)
#
Changes to main.mk.
115
116
117
118
119
120
121

122
123
124
125
126
127


128
129
















130
131
132
133
134
135
136
# in-tree JimTCL ($(JIMSH)) or the canonical TCL ($(TCLSH_CMD). If
# it's JimTCL, it must be compiled with -DHAVE_REALPATH or
# -DHAVE__FULLPATH.
#
B.tclsh ?= $(JIMSH)

#

# Various system-level directories, mostly needed for installation and
# for finding system-level dependencies.
#
# Aside from ${prefix}, we do not need to (and intentionally do not)
# export any of the dozen-ish shorthand ${XYZdir} vars the autotools
# conventionally defines.


#
prefix       ?= /usr/local
















#
# $(LDFLAGS.{feature}) and $(CFLAGS.{feature}) =
#
# Linker resp. C/CPP flags required by a specific feature, e.g.
# $(LDFLAGS.pthread) or $(CFLAGS.readline).
#
# Rather that stuffing all CFLAGS and LDFLAGS into a single set, we







>
|
<

<
|
|
>
>

|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
# in-tree JimTCL ($(JIMSH)) or the canonical TCL ($(TCLSH_CMD). If
# it's JimTCL, it must be compiled with -DHAVE_REALPATH or
# -DHAVE__FULLPATH.
#
B.tclsh ?= $(JIMSH)

#
# Autotools-conventional vars which are (in this tree) used only by
# package installation rules.

#

# The following ${XYZdir} vars are provided for the sake of clients
# who expect to be able to override these using autotools-conventional
# dir name vars. In this build they apply only to installation-related
# rules.
#
prefix      ?= /usr/local
datadir     ?= $(prefix)/share
mandir      ?= $(datadir)/man
includedir  ?= $(prefix)/include
exec_prefix ?= $(prefix)
bindir      ?= $(exec_prefix)/bin
libdir      ?= $(exec_prefix)/lib
# This makefile does not use any of:
# sbindir        ?= $(exec_prefix)/sbin
# sysconfdir     ?= /etc
# sharedstatedir ?= $(prefix)/com
# localstatedir  ?= /var
# runstatedir    ?= /run
# infodir        ?= $(datadir)/info
# libexec        ?= $(exec_prefix)/libexec


#
# $(LDFLAGS.{feature}) and $(CFLAGS.{feature}) =
#
# Linker resp. C/CPP flags required by a specific feature, e.g.
# $(LDFLAGS.pthread) or $(CFLAGS.readline).
#
# Rather that stuffing all CFLAGS and LDFLAGS into a single set, we
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# double-quotes so that targets which have spaces in their paths will
# work, but that leads to Make treating the quotes as part of the dir
# name, which in turn leads to it never finding a matching name in the
# filesystem and always invoking ($(INSTALL) -d ...) for them. The
# moral of this story is that spaces in installation paths will break
# the install process.
#
install-dir.bin = $(DESTDIR)$(prefix)/bin
install-dir.lib = $(DESTDIR)$(prefix)/lib
install-dir.include = $(DESTDIR)$(prefix)/include
install-dir.pkgconfig = $(DESTDIR)$(prefix)/lib/pkgconfig
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 "$@"

#







|
|
|
|
|







368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# double-quotes so that targets which have spaces in their paths will
# work, but that leads to Make treating the quotes as part of the dir
# name, which in turn leads to it never finding a matching name in the
# filesystem and always invoking ($(INSTALL) -d ...) for them. The
# moral of this story is that spaces in installation paths will break
# the install process.
#
install-dir.bin = $(DESTDIR)$(bindir)
install-dir.lib = $(DESTDIR)$(libdir)
install-dir.include = $(DESTDIR)$(includedir)
install-dir.pkgconfig = $(DESTDIR)$(libdir)/pkgconfig
install-dir.man1 = $(DESTDIR)$(mandir)/man1
install-dir.all = $(install-dir.bin) $(install-dir.include) \
  $(install-dir.lib) $(install-dir.man1) \
  $(install-dir.pkgconfig)
$(install-dir.all):
	$(INSTALL) -d "$@"

#