mirror of
https://github.com/sqlite/sqlite.git
synced 2024-11-21 19:29:09 +01:00
Re-order the auto.def flags logical groups. Add some discrete bold formatting to select configure output. Remove some dead code. Account for behavior misunderstanding of user-notice. Add the start of a 'make help' target. General cosmetic cleanups.
FossilOrigin-Name: ab95ee33dfe56bd3b223f978626e6014414881c30443a2b88c782de724c39ae1
This commit is contained in:
parent
2005250d7f
commit
3a92a5c4b3
250
auto.def
250
auto.def
@ -14,31 +14,6 @@
|
||||
#
|
||||
use cc cc-db cc-shared cc-lib hwaci-common pkg-config
|
||||
|
||||
# Are we cross-compiling?
|
||||
set cross_compiling [hwaci-is-cross-compiling]
|
||||
if {0
|
||||
&& !$cross_compiling
|
||||
&& "nope" eq [get-env CC_FOR_BUILD "nope"]
|
||||
&& [get-define CC] ne [get-define CC_FOR_BUILD]} {
|
||||
# Arguable/debatable...
|
||||
#
|
||||
# When _not_ cross-compiling and CC_FOR_BUILD is _not_ explcitely
|
||||
# specified, force CC_FOR_BUILD to be the same as CC, so that:
|
||||
#
|
||||
# ./configure CC=clang
|
||||
#
|
||||
# will use CC_FOR_BUILD=clang, instead of cc, for building in-tree
|
||||
# tools. This is based off of an email discussion and is thought to
|
||||
# be likely to cause less confusion than seeing 'cc' invocations
|
||||
# will when the user passes CC=clang.
|
||||
#
|
||||
# Sidebar: if we do this before the cc package is installed, it gets
|
||||
# reverted by that package. Ergo, the cc package init will tell the
|
||||
# user "Build C compiler...cc" shortly before we tell them:
|
||||
msg-result "Re-defining CC_FOR_BUILD to CC=[get-define CC]. To avoid this, explicitly pass CC_FOR_BUILD=..."
|
||||
define CC_FOR_BUILD [get-define CC]
|
||||
}
|
||||
|
||||
# $DUMP_DEFINES_TXT is the file emitted by --dump-defines, intended
|
||||
# only for build debugging and not part of the public build interface.
|
||||
set DUMP_DEFINES_TXT ./config.defines.txt
|
||||
@ -151,34 +126,16 @@ set DUMP_DEFINES_JSON ""; #./config.defines.json
|
||||
#
|
||||
########################################################################
|
||||
set flags {
|
||||
# <build-modes>
|
||||
with-debug:=1 => {Enable debug build flags}
|
||||
with-tclsh:PATH => {Full pathname of tclsh to use}
|
||||
with-tcl:DIR => {Directory containing tclConfig.sh}
|
||||
tcl=1 => {Disable components which require TCL-dev}
|
||||
test-status => {Enable status of tests}
|
||||
shared=1 => {Disable build of shared libary}
|
||||
static=1 => {Disable build of static library (mostly)}
|
||||
amalgamation=1 => {Disable the amalgamation and instead build all files separately.}
|
||||
# </build-modes>
|
||||
# <lib-feature>
|
||||
threadsafe=1 => {Disable mutexing}
|
||||
with-tempstore:=no => {Use an in-ram database for temporary tables: never,no,yes,always}
|
||||
editline=0 => {BSD editline support}
|
||||
readline=1 => {Disable readline support}
|
||||
largefile=1 => {Disable large file support}
|
||||
shared=1 => {Disable build of shared libary}
|
||||
static=1 => {Disable build of static library}
|
||||
# --with-readline-lib is a backwards-compatible alias for
|
||||
# --with-readline-ldflags
|
||||
with-readline-lib:
|
||||
with-readline-ldflags:=auto
|
||||
=> {Readline LDFLAGS, e.g. -lreadline -lncurses}
|
||||
# --with-readline-inc is a backwards-compatible alias for
|
||||
# --with-readline-cflags
|
||||
with-readline-inc:
|
||||
with-readline-cflags:=auto
|
||||
=> {Readline CFLAGS, e.g. -I/path/to/includes}
|
||||
with-readline-header:PATH
|
||||
=> {Full path to readline.h, from which --with-readline-cflags will be derived}
|
||||
with-linenoise:DIR => {Source directory for linenoise.c and linenoise.h}
|
||||
with-icu-ldflags:LDFLAGS => {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries}
|
||||
icu-collations=0 => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=...}
|
||||
amalgamation=1 => {Disable the amalgamation and instead build all files separately}
|
||||
load-extension=1 => {Disable loading of external extensions}
|
||||
math=1 => {Disable math functions}
|
||||
json=1 => {Disable JSON functions}
|
||||
@ -192,12 +149,44 @@ set flags {
|
||||
geopoly => {Enable the GEOPOLY extension}
|
||||
rtree => {Enable the RTREE extension}
|
||||
session => {Enable the SESSION extension}
|
||||
gcov=0 => {Enable coverage testing using gcov}
|
||||
linemacros => {Enable #line macros in the amalgamation.}
|
||||
# </lib-feature>
|
||||
# <tcl>
|
||||
with-tclsh:PATH => {Full pathname of tclsh to use}
|
||||
with-tcl:DIR => {Directory containing tclConfig.sh}
|
||||
tcl=1 => {Disable components which require TCL-dev}
|
||||
# <tcl>
|
||||
# <line-editing>
|
||||
readline=1 => {Disable readline support}
|
||||
# --with-readline-lib is a backwards-compatible alias for
|
||||
# --with-readline-ldflags
|
||||
with-readline-lib:
|
||||
with-readline-ldflags:=auto
|
||||
=> {Readline LDFLAGS, e.g. -lreadline -lncurses}
|
||||
# --with-readline-inc is a backwards-compatible alias for
|
||||
# --with-readline-cflags
|
||||
with-readline-inc:
|
||||
with-readline-cflags:=auto
|
||||
=> {Readline CFLAGS, e.g. -I/path/to/includes}
|
||||
with-readline-header:PATH
|
||||
=> {Full path to readline.h, from which --with-readline-cflags will be derived}
|
||||
with-linenoise:DIR => {Source directory for linenoise.c and linenoise.h}
|
||||
editline=0 => {BSD editline support}
|
||||
# </line-editing>
|
||||
# <icu>
|
||||
with-icu-ldflags:LDFLAGS => {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries}
|
||||
icu-collations=0 => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=...}
|
||||
# </icu>
|
||||
# <alternative-builds>
|
||||
with-wasi-sdk:=/opt/wasi-sdk
|
||||
=> {Top-most dir of the wasi-sdk for a WASI build}
|
||||
with-emsdk:DIR => {Top-most dir of the Emscripten SDK installation}
|
||||
# </alternative-builds>
|
||||
# <developer>
|
||||
test-status => {Enable status of tests}
|
||||
gcov=0 => {Enable coverage testing using gcov}
|
||||
linemacros => {Enable #line macros in the amalgamation.}
|
||||
dump-defines=0 => {Dump autosetup defines to $DUMP_DEFINES_TXT (for build debugging)}
|
||||
# </developer>
|
||||
}
|
||||
if {"" ne $DUMP_DEFINES_JSON} {
|
||||
lappend flags \
|
||||
@ -227,7 +216,7 @@ define PACKAGE_BUGREPORT [get-define PACKAGE_URL]/forum
|
||||
|
||||
msg-result "srcdir = $srcdir"
|
||||
msg-result "top_srcdir = $top_srcdir"
|
||||
msg-result "VERSION = $PACKAGE_VERSION"
|
||||
msg-result [hwaci-bold "Configuring SQLite version $PACKAGE_VERSION"]
|
||||
|
||||
define-append SQLITE_AUTOREMAKE cd '$srcdir' && '$top_srcdir/configure'
|
||||
#{*}$::autosetup(argv) breaks with --flag='val with spaces', so...
|
||||
@ -235,90 +224,36 @@ foreach arg $::autosetup(argv) {
|
||||
define-append SQLITE_AUTOREMAKE '$arg'
|
||||
}
|
||||
|
||||
set outOfTreeBuild 0
|
||||
|
||||
# Are we cross-compiling?
|
||||
set cross_compiling [hwaci-is-cross-compiling]
|
||||
if {![file exists sqlite3.pc.in]} {
|
||||
msg-result "This appears to be an out-of-tree build."
|
||||
set outOfTreeBuild 1
|
||||
}
|
||||
|
||||
cc-check-tools ld ar
|
||||
|
||||
define OPT_FEATURE_FLAGS {} ; # -DSQLITE_OMIT/ENABLE flags.
|
||||
define OPT_SHELL {} ; # CFLAGS for the sqlite3 CLI app
|
||||
########################################################################
|
||||
# The build process allows for using a cross-compiler. But the default
|
||||
# action is to target the same platform that we are running on. The
|
||||
# configure script needs to discover the following properties of the
|
||||
# build and target systems:
|
||||
#
|
||||
# srcdir
|
||||
#
|
||||
# The is the name of the directory that contains the
|
||||
# "configure" shell script. All source files are
|
||||
# located relative to this directory.
|
||||
#
|
||||
# bindir
|
||||
#
|
||||
# The name of the directory where executables should be
|
||||
# written by the "install" target of the makefile.
|
||||
#
|
||||
# program_prefix
|
||||
#
|
||||
# Add this prefix to the names of all executables that run
|
||||
# on the target machine. Default: ""
|
||||
#
|
||||
# ENABLE_SHARED
|
||||
#
|
||||
# True if shared libraries should be generated.
|
||||
#
|
||||
# BUILD_CC
|
||||
#
|
||||
# The name of a command that is used to convert C
|
||||
# source files into executables that run on the build
|
||||
# platform.
|
||||
#
|
||||
# BUILD_CFLAGS
|
||||
#
|
||||
# Switches that the build compiler needs in order to construct
|
||||
# command-line programs.
|
||||
#
|
||||
# BUILD_LIBS
|
||||
#
|
||||
# Libraries that the build compiler needs in order to construct
|
||||
# command-line programs.
|
||||
#
|
||||
# TCL_*
|
||||
#
|
||||
# Lots of values are read in from the tclConfig.sh script,
|
||||
# if that script is available. This values are used for
|
||||
# constructing and installing the TCL extension.
|
||||
#
|
||||
# TARGET_READLINE_LIBS
|
||||
#
|
||||
# This is the library directives passed to the target linker
|
||||
# that cause the executable to link against the readline library.
|
||||
# This might be a switch like "-lreadline" or pathnames of library
|
||||
# file like "../../src/libreadline.a".
|
||||
#
|
||||
# TARGET_READLINE_INC
|
||||
#
|
||||
# This variables define the directory that contain header
|
||||
# files for the readline library. If the compiler is able
|
||||
# to find <readline.h> on its own, then this can be blank.
|
||||
|
||||
#
|
||||
# OPT_FEATURE_FLAGS = -DSQLITE_OMIT/ENABLE flags.
|
||||
define OPT_FEATURE_FLAGS {}
|
||||
define OPT_SHELL {}; # CFLAGS for the sqlite3 CLI app
|
||||
|
||||
# Adds $args, if not empty, to OPT_FEATURE_FLAGS.
|
||||
proc add-feature-flag {args} {
|
||||
# If the first arg is -shell then it strips that arg
|
||||
# and passes the remaining args th sqlite-add-shell-opt
|
||||
# before adding them to OPF_FEATURE_FLAGS.
|
||||
proc sqlite-add-feature-flag {args} {
|
||||
set shell ""
|
||||
if {"-shell" eq [lindex $args 0]} {
|
||||
set args [lassign $args shell]
|
||||
}
|
||||
if {"" ne $args} {
|
||||
if {"" ne $shell} {
|
||||
sqlite-add-shell-opt {*}$args
|
||||
}
|
||||
define-append OPT_FEATURE_FLAGS {*}$args
|
||||
}
|
||||
}
|
||||
# add-feature-flag -DSQLITE_JUST_TESTING=3
|
||||
|
||||
# Adds $args, if not empty, to OPT_SHELL.
|
||||
proc add-shell-opt {args} {
|
||||
# Appends $args, if not empty, to OPT_SHELL.
|
||||
proc sqlite-add-shell-opt {args} {
|
||||
if {"" ne $args} {
|
||||
define-append OPT_SHELL {*}$args
|
||||
}
|
||||
@ -328,11 +263,11 @@ hwaci-file-extensions
|
||||
if {".exe" eq [get-define TARGET_EXEEXT]} {
|
||||
define SQLITE_OS_UNIX 0
|
||||
define SQLITE_OS_WIN 1
|
||||
# todo? add -DSQLITE_OS_WIN=1 to CFLAGS?
|
||||
# todo? add -DSQLITE_OS_WIN=1 to CFLAGS or CFLAGS_sqlite3_os?
|
||||
} else {
|
||||
define SQLITE_OS_UNIX 1
|
||||
define SQLITE_OS_WIN 0
|
||||
# todo? add -DSQLITE_OS_UNIX=1 to CFLAGS?
|
||||
# todo? add -DSQLITE_OS_UNIX=1 to CFLAGS or CFLAGS_sqlite3_os
|
||||
}
|
||||
|
||||
#########
|
||||
@ -448,7 +383,7 @@ if {[cc-check-includes zlib.h] && [hwaci-check-function-in-lib deflate z]} {
|
||||
# Note that -DSQLITE_HAVE_ZLIB=1 is handled separately from the
|
||||
# other feature flags in the autotools build. Do we need to emulate
|
||||
# that?
|
||||
add-shell-opt -DSQLITE_HAVE_ZLIB=1
|
||||
sqlite-add-shell-opt -DSQLITE_HAVE_ZLIB=1
|
||||
} else {
|
||||
define HAVE_ZLIB 0
|
||||
define LDFLAGS_ZLIB ""
|
||||
@ -745,7 +680,7 @@ unset cgtcl
|
||||
msg-checking "Support threadsafe operation? "
|
||||
hwaci-if-opt-truthy threadsafe {
|
||||
msg-result yes
|
||||
add-feature-flag -DSQLITE_THREADSAFE=1
|
||||
sqlite-add-feature-flag -DSQLITE_THREADSAFE=1
|
||||
if {![hwaci-check-function-in-lib pthread_create pthread]
|
||||
|| ![hwaci-check-function-in-lib pthread_mutexattr_init pthread]} {
|
||||
user-error "Missing required pthread bits"
|
||||
@ -754,7 +689,7 @@ hwaci-if-opt-truthy threadsafe {
|
||||
undefine lib_pthread_create
|
||||
} {
|
||||
msg-result no
|
||||
add-feature-flag -DSQLITE_THREADSAFE=0
|
||||
sqlite-add-feature-flag -DSQLITE_THREADSAFE=0
|
||||
define LDFLAGS_PTHREAD ""
|
||||
}
|
||||
|
||||
@ -799,6 +734,7 @@ if {1} {
|
||||
# Returns a string describing which line-editing approach to use, or
|
||||
# "none" if no option is available.
|
||||
proc sqlite-check-line-editing {} {
|
||||
msg-result "Checking for line-editing capability..."
|
||||
define HAVE_READLINE 0
|
||||
define HAVE_LINENOISE 0
|
||||
define HAVE_EDITLINE 0
|
||||
@ -815,10 +751,10 @@ proc sqlite-check-line-editing {} {
|
||||
} elseif {![file exists $dirLn/linenoise.h] } {
|
||||
hwaci-fatal "Cannot find linenoise.h in $dirLn"
|
||||
}
|
||||
user-notice "Using linenoise from $dirLn"
|
||||
msg-result "Using linenoise from $dirLn"
|
||||
define CFLAGS_READLINE "-I$dirLn $dirLn/linenoise.c"
|
||||
define HAVE_LINENOISE 1
|
||||
add-shell-opt -DHAVE_LINENOISE=1
|
||||
sqlite-add-shell-opt -DHAVE_LINENOISE=1
|
||||
return "linenoise"
|
||||
} elseif {[opt-bool editline]} {
|
||||
# --enable-editline. The problem is finding a system which has it
|
||||
@ -848,7 +784,7 @@ proc sqlite-check-line-editing {} {
|
||||
}
|
||||
return "none"
|
||||
} elseif {![opt-bool readline]} {
|
||||
user-notice "Readline support explicitly disabled with --disable-readline"
|
||||
msg-result "Readline support explicitly disabled with --disable-readline"
|
||||
return "none"
|
||||
}
|
||||
|
||||
@ -920,8 +856,8 @@ proc sqlite-check-line-editing {} {
|
||||
define LDFLAGS_READLINE $rlLib
|
||||
define CFLAGS_READLINE $rlInc
|
||||
define HAVE_READLINE 1
|
||||
add-shell-opt -DHAVE_READLINE=1
|
||||
user-notice "Using readline flags: $rlInc $rlLib"
|
||||
sqlite-add-shell-opt -DHAVE_READLINE=1
|
||||
msg-result "Using readline flags: $rlInc $rlLib"
|
||||
|
||||
# Now check whether rl_completion_matches() has a signature we can use.
|
||||
# cctest is producing unexpected test output when using:
|
||||
@ -937,10 +873,10 @@ proc sqlite-check-line-editing {} {
|
||||
return 0;
|
||||
}
|
||||
}]} {
|
||||
user-notice "Readline completion enabled"
|
||||
msg-result "Readline completion enabled"
|
||||
} else {
|
||||
user-notice "WARNING: readline completion disabled due to rl_completion_matches() signature mismatch"
|
||||
add-shell-opt -DSQLITE_OMIT_READLINE_COMPLETION
|
||||
sqlite-add-shell-opt -DSQLITE_OMIT_READLINE_COMPLETION
|
||||
}
|
||||
return "readline"
|
||||
}
|
||||
@ -958,7 +894,7 @@ hwaci-if-opt-truthy load-extension {
|
||||
}
|
||||
} {
|
||||
define LDFLAGS_DLOPEN ""
|
||||
add-feature-flag {-DSQLITE_OMIT_LOAD_EXTENSION=1}
|
||||
sqlite-add-feature-flag {-DSQLITE_OMIT_LOAD_EXTENSION=1}
|
||||
msg-result "Disabling loadable extensions."
|
||||
}
|
||||
|
||||
@ -968,7 +904,7 @@ hwaci-if-opt-truthy math {
|
||||
}
|
||||
define LDFLAGS_MATH [get-define lib_ceil]
|
||||
undefine lib_ceil
|
||||
add-feature-flag {-DSQLITE_ENABLE_MATH_FUNCTIONS}
|
||||
sqlite-add-feature-flag {-DSQLITE_ENABLE_MATH_FUNCTIONS}
|
||||
msg-result "Enabling math SQL functions [get-define LDFLAGS_MATH]"
|
||||
} {
|
||||
define LDFLAGS_MATH ""
|
||||
@ -992,16 +928,18 @@ if {![get-define HAVE_WASI_SDK] && [hwaci-check-emsdk]} {
|
||||
unset emccsh
|
||||
|
||||
########################################################################
|
||||
# ICU
|
||||
# ICU - International Components for Unicode
|
||||
if {"" ne [define LDFLAGS_ICU [join [opt-val with-icu-ldflags ""]]]} {
|
||||
# Flags sets seen in the wild for ICU:
|
||||
# {-licui18n -licuuc -licudata} {-licui18n -licuuc}
|
||||
add-feature-flag -DSQLITE_ENABLE_ICU
|
||||
add-shell-opt -DSQLITE_ENABLE_ICU
|
||||
# - -licui18n -licuuc -licudata
|
||||
# - -licui18n -licuuc
|
||||
# - /usr/local/bin/icu-config --ldflags
|
||||
sqlite-add-feature-flag -shell -DSQLITE_ENABLE_ICU
|
||||
msg-result "Enabling ICU support with libs: [get-define LDFLAGS_ICU]"
|
||||
if {[opt-bool icu-collations]} {
|
||||
msg-result "Enabling ICU collations."
|
||||
add-feature-flag -DSQLITE_ENABLE_ICU_COLLATIONS
|
||||
sqlite-add-feature-flag -shell -DSQLITE_ENABLE_ICU_COLLATIONS
|
||||
# Recall that shell.c builds with sqlite3.c
|
||||
}
|
||||
} elseif {[opt-bool icu-collations]} {
|
||||
hwaci-warn "ignoring --enable-icu-collations because --with-icu-ldflags was not specified"
|
||||
@ -1014,7 +952,7 @@ if {"" ne [define LDFLAGS_ICU [join [opt-val with-icu-ldflags ""]]]} {
|
||||
# required linker flags (which may be empty even if the math APIs are
|
||||
# found, depending on the OS).
|
||||
proc affirm-have-math {why} {
|
||||
if {![hwaci-check-function-in-lib log m]} {
|
||||
if {![msg-quiet hwaci-check-function-in-lib log m]} {
|
||||
user-error "Missing math APIs for $why"
|
||||
}
|
||||
define LDFLAGS_MATH [get-define lib_log ""]
|
||||
@ -1023,6 +961,7 @@ proc affirm-have-math {why} {
|
||||
|
||||
########################################################################
|
||||
# Handle various SQLITE_ENABLE_... feature flags.
|
||||
msg-result "Feature flags..."
|
||||
foreach {boolFlag featureFlag ifSetEvalThis} {
|
||||
all {} {
|
||||
hwaci-opt-set fts4
|
||||
@ -1043,33 +982,33 @@ foreach {boolFlag featureFlag ifSetEvalThis} {
|
||||
hwaci-warn "not enabling memsys3 because memsys5 is enabled."
|
||||
expr 0
|
||||
} else {
|
||||
add-feature-flag -DSQLITE_ENABLE_MEMSYS3
|
||||
sqlite-add-feature-flag -DSQLITE_ENABLE_MEMSYS3
|
||||
}
|
||||
}
|
||||
} {
|
||||
hwaci-if-opt-truthy $boolFlag {
|
||||
add-feature-flag $featureFlag
|
||||
sqlite-add-feature-flag $featureFlag
|
||||
if {0 != [eval $ifSetEvalThis] && "all" ne $boolFlag} {
|
||||
msg-result "Enabling $boolFlag"
|
||||
msg-result " - Enabling $boolFlag"
|
||||
}
|
||||
} {
|
||||
msg-result "Not enabling $boolFlag"
|
||||
msg-result " - Not enabling $boolFlag"
|
||||
}
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# Invert the above loop's logic for some explicit SQLITE_OMIT_...
|
||||
# cases. If config option $boolFlag is set, [add-feature-flag
|
||||
# cases. If config option $boolFlag is set, [sqlite-add-feature-flag
|
||||
# $featureFlag], where $featureFlag is intended to be
|
||||
# -DSQLITE_OMIT_...
|
||||
foreach {boolFlag featureFlag} {
|
||||
json -DSQLITE_OMIT_JSON
|
||||
} {
|
||||
if {[hwaci-opt-truthy $boolFlag]} {
|
||||
msg-result "Enabling $boolFlag"
|
||||
msg-result " - Enabling $boolFlag"
|
||||
} else {
|
||||
add-feature-flag $featureFlag
|
||||
msg-result "Disabling $boolFlag"
|
||||
sqlite-add-feature-flag $featureFlag
|
||||
msg-result " - Disabling $boolFlag"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1155,9 +1094,8 @@ if {"" ne $DUMP_DEFINES_JSON} {
|
||||
########################################################################
|
||||
# Some build-dev/debug-only output
|
||||
hwaci-if-opt-truthy dump-defines {
|
||||
global DUMP_DEFINES_TXT
|
||||
msg-result "--dump-defines is creating $DUMP_DEFINES_TXT"
|
||||
make-config-header $DUMP_DEFINES_TXT \
|
||||
msg-result "--dump-defines is creating $::DUMP_DEFINES_TXT"
|
||||
make-config-header $::DUMP_DEFINES_TXT \
|
||||
-bare {SQLITE_OS* SQLITE_DEBUG USE_*} \
|
||||
-str {BIN_* CC LD AR LDFLAG* OPT_*} \
|
||||
-auto {*}
|
||||
@ -1170,4 +1108,4 @@ hwaci-if-opt-truthy dump-defines {
|
||||
}
|
||||
}
|
||||
|
||||
msg-result "Done! Now run make."
|
||||
msg-result [hwaci-bold "Source tree is configured! Run make to build it."]
|
||||
|
@ -12,25 +12,28 @@
|
||||
# Routines for Steve Bennett's autosetup which are common to trees
|
||||
# managed in and around the umbrella of the SQLite project.
|
||||
#
|
||||
# Routines with a suffix of _ are intended for internal use,
|
||||
# within this file, and are not part of the API which auto.def files
|
||||
# should rely on.
|
||||
#
|
||||
# This file was initially derived from one used in the libfossil
|
||||
# project, authored by the same person who ported it here, noted here
|
||||
# only as an indication that there are no licensing issue despite this
|
||||
# code having at least two near-twins running around in other trees.
|
||||
# project, authored by the same person who ported it here, and this is
|
||||
# noted here only as an indication that there are no licensing issues
|
||||
# despite this code having at least two near-twins running around a
|
||||
# handful of third-party source trees.
|
||||
#
|
||||
########################################################################
|
||||
#
|
||||
# Design notes: by and large, autosetup prefers to update global state
|
||||
# with the results of feature checks, e.g. whether the compiler
|
||||
# supports flag --X. In this developer's opinion that (A) causes more
|
||||
# confusion than it solves[^1] and (B) adds an unnecessary layer of
|
||||
# "voodoo" between the autosetup user and its internals. This module,
|
||||
# in contrast, instead injects the results of its own tests into
|
||||
# well-defined variables and leaves the integration of those values to
|
||||
# the caller's discretion.
|
||||
# Design notes:
|
||||
#
|
||||
# - Symbols with a suffix of _ are intended for internal use within
|
||||
# this file, and are not part of the API which auto.def files should
|
||||
# rely on.
|
||||
#
|
||||
# - By and large, autosetup prefers to update global state with the
|
||||
# results of feature checks, e.g. whether the compiler supports flag
|
||||
# --X. In this developer's opinion that (A) causes more confusion
|
||||
# than it solves[^1] and (B) adds an unnecessary layer of "voodoo"
|
||||
# between the autosetup user and its internals. This module, in
|
||||
# contrast, instead injects the results of its own tests into
|
||||
# well-defined variables and leaves the integration of those values
|
||||
# to the caller's discretion.
|
||||
#
|
||||
# [1]: As an example: testing for the -rpath flag, using
|
||||
# cc-check-flags, can break later checks which use
|
||||
@ -45,25 +48,37 @@
|
||||
# $hwaci_ is an internal-use-only array for storing whatever generic
|
||||
# internal stuff we need stored.
|
||||
array set hwaci_ {}
|
||||
set hwaci_(isatty) [isatty? stdout]
|
||||
|
||||
proc hwaci-warn {msg} {
|
||||
puts stderr "WARNING: $msg"
|
||||
}
|
||||
#proc hwaci-notice {msg} {
|
||||
# puts stderr "NOTICE: $msg"
|
||||
#}
|
||||
proc hwaci-fatal {msg} {
|
||||
user-error "ERROR: $msg"
|
||||
show-notices
|
||||
puts stderr "ERROR: $msg"
|
||||
exit 1
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# If this function believes that the current console might support
|
||||
# ANSI escape sequences then this returns $str wrapped in a sequence
|
||||
# to bold that text, else it returns $str as-is.
|
||||
proc hwaci-bold {str} {
|
||||
if {$::autosetup(iswin) || !$::hwaci_(isatty)} {
|
||||
return $str
|
||||
}
|
||||
return "\033\[1m${str}\033\[0m"
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# Takes a multi-line message and emits it with consistent indentation
|
||||
# using user-notice (which means its rendering will be delayed until
|
||||
# the next time autosetup goes to output a message).
|
||||
# using [user-notice] (which means its rendering will (A) go to stderr
|
||||
# and (B) be delayed until the next time autosetup goes to output a
|
||||
# message).
|
||||
proc hwaci-indented-notice {msg} {
|
||||
set lines [split $msg \n]
|
||||
foreach line $lines {
|
||||
user-notice " [string trim $line]"
|
||||
user-notice " [string trimleft $line]"
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,7 +113,7 @@ proc hwaci-lshift_ {listVar {count 1}} {
|
||||
# out any lines which begin with an number of whitespace followed by a
|
||||
# '#', and returns a value containing the [append]ed results of each
|
||||
# remaining line with a \n between each.
|
||||
proc hwaci-strip-comments {val} {
|
||||
proc hwaci-strip-hash-comments_ {val} {
|
||||
set x {}
|
||||
foreach line [split $val \n] {
|
||||
if {![string match "#*" [string trimleft $line]]} {
|
||||
@ -1020,7 +1035,7 @@ proc hwaci-dump-defs-json {file args} {
|
||||
# names, so that in the above example [opt-value canonical] will
|
||||
# return X if --alias=X is passed in.
|
||||
proc hwaci-xfer-options-aliases {mapping} {
|
||||
foreach {hidden => canonical} [hwaci-strip-comments $mapping] {
|
||||
foreach {hidden => canonical} [hwaci-strip-hash-comments_ $mapping] {
|
||||
set x [opt-val $hidden "~9~9~9~"]
|
||||
if {"~9~9~9~" ne $x} {
|
||||
if {"~0~0~0~" eq [opt-val $canonical "~0~0~0~"]} {
|
||||
@ -1031,3 +1046,28 @@ proc hwaci-xfer-options-aliases {mapping} {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# Arguable/debatable...
|
||||
#
|
||||
# When _not_ cross-compiling and CC_FOR_BUILD is _not_ explcitely
|
||||
# specified, force CC_FOR_BUILD to be the same as CC, so that:
|
||||
#
|
||||
# ./configure CC=clang
|
||||
#
|
||||
# will use CC_FOR_BUILD=clang, instead of cc, for building in-tree
|
||||
# tools. This is based off of an email discussion and is thought to
|
||||
# be likely to cause less confusion than seeing 'cc' invocations
|
||||
# will when the user passes CC=clang.
|
||||
#
|
||||
# Sidebar: if we do this before the cc package is installed, it gets
|
||||
# reverted by that package. Ergo, the cc package init will tell the
|
||||
# user "Build C compiler...cc" shortly before we tell them:
|
||||
proc hwaci-redefine-cc-for-build {} {
|
||||
if {![hwaci-is-cross-compiling]
|
||||
&& "nope" eq [get-env CC_FOR_BUILD "nope"]
|
||||
&& [get-define CC] ne [get-define CC_FOR_BUILD]} {
|
||||
user-notice "Re-defining CC_FOR_BUILD to CC=[get-define CC]. To avoid this, explicitly pass CC_FOR_BUILD=..."
|
||||
define CC_FOR_BUILD [get-define CC]
|
||||
}
|
||||
}
|
||||
|
9
main.mk
9
main.mk
@ -2075,6 +2075,15 @@ sqlite3.dll: $(LIBOBJ) sqlite3.def
|
||||
$(T.cc.sqlite) $(LDFLAGS.shobj) -o $@ sqlite3.def \
|
||||
-Wl,"--strip-all" $(LIBOBJ)
|
||||
|
||||
#
|
||||
# Emit a list of commonly-used targets
|
||||
help:
|
||||
@echo "Frequently-used high-level make targets:"; \
|
||||
echo " - all (default) = builds most components"; \
|
||||
echo " - clean = cleans up most build products"; \
|
||||
echo " - distclean = cleans up all build products"; \
|
||||
echo "...and many more"
|
||||
|
||||
|
||||
# Remove build products sufficient so that subsequent makes will recompile
|
||||
# everything from scratch. Do not remove:
|
||||
|
16
manifest
16
manifest
@ -1,5 +1,5 @@
|
||||
C Generic\scleanups\sin\sauto.def\sand\shwaci-common.tcl.
|
||||
D 2024-10-27T20:46:09.058
|
||||
C Re-order\sthe\sauto.def\sflags\slogical\sgroups.\sAdd\ssome\sdiscrete\sbold\sformatting\sto\sselect\sconfigure\soutput.\sRemove\ssome\sdead\scode.\sAccount\sfor\sbehavior\smisunderstanding\sof\suser-notice.\sAdd\sthe\sstart\sof\sa\s'make\shelp'\starget.\sGeneral\scosmetic\scleanups.
|
||||
D 2024-10-27T22:18:33.718
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2
|
||||
@ -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 dd9bda48dc2a4c515d1a518f342b992c1cdea46c0d4e20a25d515ab423de2d49
|
||||
F auto.def 10eac711b57bce9705555c052e8970e62aa6754b91e1ff37a51c50b040cc4897
|
||||
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
|
||||
F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347
|
||||
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
|
||||
@ -47,7 +47,7 @@ F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795f
|
||||
F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78
|
||||
F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bde14
|
||||
F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82
|
||||
F autosetup/hwaci-common.tcl c6a68fe4ad416db70260bc0f8a85ee9f52d6976ca796aaa8ae013a1bf632b49d
|
||||
F autosetup/hwaci-common.tcl bc48c6ddfcd33a0eaf17f1709cde60622ff29c479e0356e8c6bcabe5b58a4d51
|
||||
F autosetup/jimsh0.c 27ea5f221359ef6c58780fc6c185aadbf8d3bee9a021331a3e5de0eba0dc6de6
|
||||
F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
|
||||
F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb
|
||||
@ -707,7 +707,7 @@ F ext/wasm/wasmfs.make bc8bb227f35d5bd3863a7bd2233437c37472a0d81585979f058f9b9b5
|
||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
|
||||
F main.mk d943a2d0a0deb14daea10e036ef3a55e1b641cd57f5893a2fba29e65cc33acc0
|
||||
F main.mk 7533ef1b3a1338b96445a672ba6dbfa48279f05089a0555ff8822dcd1dcb000a
|
||||
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
|
||||
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
|
||||
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
|
||||
@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 37a1da038195365cd7eb866b3aa749ad8060a656ac38063520fdb70cf0a0e5f1
|
||||
R 4a5971ae5787ab5ca5bc6c1b2940924e
|
||||
P 428e542452bac99d48950f1f62b65b4e235636540b946151747e2d5b59dbfd99
|
||||
R c11fb367c51c71ad6dcdc1b5cebfcffd
|
||||
U stephan
|
||||
Z f7c559f6f234bc23301783ef1baa5b93
|
||||
Z 989475d21f0d39382974a32645a7533c
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
@ -1 +1 @@
|
||||
428e542452bac99d48950f1f62b65b4e235636540b946151747e2d5b59dbfd99
|
||||
ab95ee33dfe56bd3b223f978626e6014414881c30443a2b88c782de724c39ae1
|
||||
|
Loading…
Reference in New Issue
Block a user