0
0
mirror of https://github.com/sqlite/sqlite.git synced 2024-11-21 19:29:09 +01:00

If any autotools-conventional dir names are explicitly overridden via ./configure --dirname=X then export those names as-is to the makefile, otherwise derive them from $prefix. This is, at least in part, a compromise to provide package maintainers a way to specify a libdir which will be incorporated into the -rpath link flag (which we can only determine at configure-time).

FossilOrigin-Name: 832abe8a8a347718e47f73a1f9be1fb084a1c28cac6b1c70f6c9a9cabeb0fb53
This commit is contained in:
stephan 2024-11-03 19:42:41 +00:00
commit 97c709b5be
5 changed files with 100 additions and 10 deletions

View File

@ -116,6 +116,12 @@ TOP = @abs_top_srcdir@
# libexec = $(exec_prefix)/libexec
#
prefix = @prefix@
datadir = @datadir@
mandir = @mandir@
includedir = @includedir@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
INSTALL = @BIN_INSTALL@
AR = @AR@

View File

@ -216,6 +216,12 @@ proj-xfer-options-aliases {
with-readline-inc => with-readline-cflags
with-readline-lib => with-readline-ldflags
}
#
# "Re-export" the autoconf-conventional --XYZdir flags into something
# which is more easily overridable from a make invocation. See the docs
# for [proj-redirect-autoconf-dir-vars] for the explanation of why.
#
proj-redirect-autoconf-dir-vars
set srcdir $::autosetup(srcdir)
set top_srcdir [get-define abs_top_srcdir]

View File

@ -790,12 +790,20 @@ proc proj-check-emsdk {} {
# flag. Defines LDFLAGS_RPATH to that/those flag(s) or an empty
# string. Returns 1 if it finds an option, else 0.
#
# By default, the rpath is set to $prefix/lib. However, if
# --libdir=... is explicitly passed to configure then that value is
# used.
#
# Achtung: we have seen platforms which report that a given option
# checked here will work but then fails at build-time, and the current
# order of checks reflects that.
proc proj-check-rpath {} {
set rc 1
set lp "[get-define prefix]/lib"
if {[proj-opt-was-provided libdir]} {
set lp "[get-define libdir]"
} else {
set lp "[get-define prefix]/lib"
}
# If we _don't_ use cc-with {} here (to avoid updating the global
# CFLAGS or LIBS or whatever it is that cc-check-flags updates) then
# downstream tests may fail because the resulting rpath gets
@ -1012,3 +1020,73 @@ proc proj-which-linenoise {dotH} {
return 1
}
}
########################################################################
#
# "Re-export" the autoconf-conventional --XYZdir flags into something
# which is more easily overridable from a make invocation.
#
# Based off of notes in <https://sqlite.org/forum/forumpost/00d12a41f7>.
#
# Consider:
#
# $ ./configure --prefix=/foo
# $ make install prefix=/blah
#
# In that make invocation, $(libdir) would, at make-time, normally be
# hard-coded to /foo/lib, rather than /blah/lib. That happens because
# the autosetup exports conventional $prefix-based values for the
# numerious autoconfig-compatible XYZdir vars at configure-time. What
# we would normally want, however, is that --libdir derives from the
# make-time $(prefix). The distinction between configure-time and
# make-time is the significant factor there.
#
# This function attempts to reconcile those vars in such a way that
# they will derive, at make-time, from $(prefix) in a conventional
# manner unless they are explicitly overridden at configure-time, in
# which case those overrides takes precedence.
#
# Each --XYZdir flag which is explicitly passed to configure is
# exported as-is, as are those which default to some top-level system
# directory, e.g. /etc or /var. All which derive from either $prefix
# or $exec_prefix are exported in the form of a Makefile var
# reference, e.g. libdir=${exec_prefix}/lib. Ergo, if
# --exec-prefix=FOO is passed to configure, libdir will still derive,
# at make-time, from whatever exec_prefix is passed to make, and will
# use FOO if exec_prefix is not overridden. Without this
# post-processing, libdir would be cemented in as FOO/lib at
# configure-time, so would be tedious to override properly via a make
# invocation.
#
proc proj-redirect-autoconf-dir-vars {} {
set prefix [get-define prefix]
set exec_prefix [get-define exec_prefix $prefix]
# Note that the ${...} here refers to make-side var derefs, not
# TCL-side vars.
foreach {flag makeVar makeDeref} {
exec-prefix exec_prefix ${prefix}
libdir libdir ${exec_prefix}/lib
datadir datadir ${prefix}/share
mandir mandir ${datadir}/man
includedir includedir ${prefix}/include
bindir bindir ${exec_prefix}/bin
libdir libdir ${exec_prefix}/lib
sbindir sbindir ${exec_prefix}/sbin
sysconfdir sysconfdir /etc
sharedstatedir sharedstatedir ${prefix}/com
localstatedir localstatedir /var
runstatedir runstatedir /run
infodir infodir ${datadir}/info
libexec libexec ${exec_prefix}/libexec
} {
# puts "flag=$flag var=$makeVar makeDeref=$makeDeref"
if {[proj-opt-was-provided $flag]} {
#set x "+"
define $makeVar [opt-val $flag]
} else {
#set x "~"
define $makeVar $makeDeref
}
#puts "$x $makeVar = [get-define $makeVar]"
}
}

View File

@ -1,9 +1,9 @@
C Workaround\sfor\sa\scompiler-specific\sjimsh\scompilation\serror\sreported\sin\s[forum:18e420d0b1404d63|forum\spost\s18e420d0].\sReported\supstream\sas\s[https://github.com/msteveb/jimtcl/issues/322|ticket\s#322].
D 2024-11-03T18:30:45.368
C If\sany\sautotools-conventional\sdir\snames\sare\sexplicitly\soverridden\svia\s./configure\s--dirname=X\sthen\sexport\sthose\snames\sas-is\sto\sthe\smakefile,\sotherwise\sderive\sthem\sfrom\s$prefix.\sThis\sis,\sat\sleast\sin\spart,\sa\scompromise\sto\sprovide\spackage\smaintainers\sa\sway\sto\sspecify\sa\slibdir\swhich\swill\sbe\sincorporated\sinto\sthe\s-rpath\slink\sflag\s(which\swe\scan\sonly\sdetermine\sat\sconfigure-time).
D 2024-11-03T19:42:41.677
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md c5b4009dca54d127d2d6033c22fd9cc34f53bedb6ef12c7cbaa468381c74ab28
F Makefile.in 55cd298aa41436c426351d7a4f387d5502431f07c96b52f2b4154f0193379150
F Makefile.in 6c595d1a09516770375dd466a91ba2f88ff8d6c1b12c2e0eb2b0ef645b6ed94f
F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0
F Makefile.msc a92237976eb92c5efaa0dd2524746aec12c196e12df8d4dbff9543a4648c3312
F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159
@ -13,7 +13,7 @@ F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
F auto.def 9cf971c8877aa7b999c3b3b41fe802feea49a50ea98afc0f9964cfc5cc69057b
F auto.def d47bb3030f1b77a3131a4192fe17fb50da13bb6d9405306368ae9c06bca9455c
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
@ -49,7 +49,7 @@ F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bd
F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82
F autosetup/jimsh0.c 9860c2bd7825cb9d21616237e59a2dfa29acbd98c00da5f842e5abe222e69288
F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
F autosetup/proj.tcl cb7983c8eb47c9518c3039556e655e5237952d9c068fe36c624e9f6a73cd1098
F autosetup/proj.tcl d0008015b481ed5a4e952b72e703a905ba232f979a3740614d2ea716a19f6718
F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb
F autosetup/tmake.auto eaebc74ad538dfdd3c817c27eefc31930c20510c4f3a3704071f6cb0629ed71f
F autosetup/tmake.tcl a275793ec1b6f8708179af0acef1f6f10d46c2920739743f7a8720c6d700c7a9
@ -2198,8 +2198,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P ad19237845b7791dd90fa4b3586f39f6ab700462e826baf53d4cde7f7fa06449
R fbc9af98c69bf3f4eab9e4f1eaa6856c
P 29b94495956802d0eedcd669e45308c56278e43aab62bd7c3bb7153b47c9d4c0 cc259bf5f176bf89b6effedfc716d19d2437fc761c20870d1c69205d4bcee12b
R 79d48715ac1148c0c1fcdae652e09505
U stephan
Z cd366cd0592f2836fdc5215675eb9eb6
Z 9bbd3b23f124df01ef5b1e7cf0c3306e
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
29b94495956802d0eedcd669e45308c56278e43aab62bd7c3bb7153b47c9d4c0
832abe8a8a347718e47f73a1f9be1fb084a1c28cac6b1c70f6c9a9cabeb0fb53