Fossil SCM

Build tweaks based on [forum:ab38ad08882f123e|forum post ab38ad088] to enable downstream packagers to strip out most of ./autosetup/ and use a system-installed copy. Also ensure that the emcc-related checks are only applied for in-tree builds and that they are cleaned up properly. No code changes.

stephan 2026-04-20 09:00 UTC trunk
Commit f99e07d194bff94d114816fd6a2a28e6456646ae05697892f23ea6baab5138bd
3 files changed +1 +12 -9 +5 -1
--- Makefile.in
+++ Makefile.in
@@ -99,10 +99,11 @@
9999
# ^^^ must come after main.mk is included
100100
101101
distclean: clean
102102
-rm -f autoconfig.h config.log Makefile
103103
-rm -f cscope.out tags
104
+ -rm -f $(EMCC_WRAPPER)
104105
105106
reconfig:
106107
@AUTOREMAKE@
107108
108109
tags:
109110
--- Makefile.in
+++ Makefile.in
@@ -99,10 +99,11 @@
99 # ^^^ must come after main.mk is included
100
101 distclean: clean
102 -rm -f autoconfig.h config.log Makefile
103 -rm -f cscope.out tags
 
104
105 reconfig:
106 @AUTOREMAKE@
107
108 tags:
109
--- Makefile.in
+++ Makefile.in
@@ -99,10 +99,11 @@
99 # ^^^ must come after main.mk is included
100
101 distclean: clean
102 -rm -f autoconfig.h config.log Makefile
103 -rm -f cscope.out tags
104 -rm -f $(EMCC_WRAPPER)
105
106 reconfig:
107 @AUTOREMAKE@
108
109 tags:
110
+12 -9
--- auto.def
+++ auto.def
@@ -1,10 +1,10 @@
11
# System autoconfiguration. Try: ./configure --help
22
33
# This must be above "options" below because it implicitly brings in the
44
# default Autosetup options, things like --prefix.
5
-use cc cc-lib
5
+use cc cc-lib local
66
77
options {
88
with-openssl:path|auto|tree|none
99
=> {Look for OpenSSL in the given path, automatically, in the source tree, or none}
1010
with-zlib:path|auto|tree
@@ -50,11 +50,12 @@
5050
# Space characters have never been allowed in either the source
5151
# tree nor the build directory. But the resulting error messages
5252
# could be confusing. The following checks make the reason for the
5353
# failure clear.
5454
#
55
-if {[string first " " $autosetup(srcdir)] != -1} {
55
+set ::dirSrc $::autosetup(srcdir)
56
+if {[string first " " $$::dirSrc] != -1} {
5657
user-error "The pathname of the source tree\
5758
may not contain space characters"
5859
}
5960
if {[string first " " $autosetup(builddir)] != -1} {
6061
user-error "The pathname of the build directory\
@@ -75,11 +76,11 @@
7576
# Use pread/pwrite system calls in place of seek + read/write if possible
7677
define USE_PREAD [cc-check-functions pread]
7778
7879
# If we have cscope here, we'll use it in the "tags" target
7980
if {[cc-check-progs cscope]} {
80
- define COLLECT_CSCOPE_DATA "cscope -bR $::autosetup(srcdir)/src/*.\[ch\]"
81
+ define COLLECT_CSCOPE_DATA "cscope -bR $$::dirSrc/src/*.\[ch\]"
8182
} else {
8283
define COLLECT_CSCOPE_DATA ""
8384
}
8485
8586
# Find tclsh for the test suite.
@@ -212,11 +213,12 @@
212213
# sqlcompttest.c
213214
#
214215
set cmdline {}
215216
lappend cmdline {*}[get-define CCACHE]
216217
lappend cmdline {*}[get-define CC] {*}[get-define CFLAGS]
217
- lappend cmdline $::autosetup(dir)/../tools/sqlcompattest.c -o conftest__
218
+ lappend cmdline $::dirSrc/tools/sqlcompattest.c
219
+ lappend cmdline -o conftest__
218220
lappend cmdline {*}[get-define LDFLAGS]
219221
lappend cmdline {*}[get-define LIBS]
220222
set sqlite-version [string cat "-D MINIMUM_SQLITE_VERSION=" [get-define MINIMUM_SQLITE_VERSION]]
221223
lappend cmdline {*}[set sqlite-version]
222224
set ok 1
@@ -940,19 +942,20 @@
940942
}
941943
define HAVE_EMSDK $rc
942944
return $rc
943945
}
944946
945
-if {[proj-check-emsdk]} {
946
- define EMCC_WRAPPER $::autosetup(dir)/../tools/emcc.sh
947
+if {!$outOfTreeBuild && [proj-check-emsdk]} {
948
+ # Maintenance note: the WASM-related pieces are only for in-tree
949
+ # maintenance, not out-of-tree builds.
950
+ define EMCC_WRAPPER $::dirSrc/tools/emcc.sh
947951
define EMCC_OPT [get-env EMCC_OPT "-Oz"]; # optional flags to pass to emcc
948952
make-template tools/emcc.sh.in
949
- catch {exec chmod u+x tools/emcc.sh}
953
+ catch {exec chmod u+x [get-define EMCC_WRAPPER]}
950954
} else {
951955
define EMCC_WRAPPER ""
952956
define EMCC_OPT ""
953
- catch {exec rm -f tools/emcc.sh}
954957
}
955958
956959
handle-with-openssl
957960
958961
# Finally, append libraries that must be last. This matters more on some
@@ -993,10 +996,10 @@
993996
# of Fossil each one contains. This not only allows multiple images
994997
# to coexist and multiple containers to be created unamgiguosly from
995998
# them, it also changes the URL we fetch the source tarball from, so
996999
# repeated builds of a given version generate and fetch the source
9971000
# tarball once only, keeping it in the local Docker/Podman cache.
998
-set ci [readfile "$::autosetup(srcdir)/manifest.uuid"]
1001
+set ci [readfile "$$::dirSrc/manifest.uuid"]
9991002
define FOSSIL_CI_PFX [string range $ci 0 11]
10001003
10011004
make-template Makefile.in
10021005
make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
10031006
--- auto.def
+++ auto.def
@@ -1,10 +1,10 @@
1 # System autoconfiguration. Try: ./configure --help
2
3 # This must be above "options" below because it implicitly brings in the
4 # default Autosetup options, things like --prefix.
5 use cc cc-lib
6
7 options {
8 with-openssl:path|auto|tree|none
9 => {Look for OpenSSL in the given path, automatically, in the source tree, or none}
10 with-zlib:path|auto|tree
@@ -50,11 +50,12 @@
50 # Space characters have never been allowed in either the source
51 # tree nor the build directory. But the resulting error messages
52 # could be confusing. The following checks make the reason for the
53 # failure clear.
54 #
55 if {[string first " " $autosetup(srcdir)] != -1} {
 
56 user-error "The pathname of the source tree\
57 may not contain space characters"
58 }
59 if {[string first " " $autosetup(builddir)] != -1} {
60 user-error "The pathname of the build directory\
@@ -75,11 +76,11 @@
75 # Use pread/pwrite system calls in place of seek + read/write if possible
76 define USE_PREAD [cc-check-functions pread]
77
78 # If we have cscope here, we'll use it in the "tags" target
79 if {[cc-check-progs cscope]} {
80 define COLLECT_CSCOPE_DATA "cscope -bR $::autosetup(srcdir)/src/*.\[ch\]"
81 } else {
82 define COLLECT_CSCOPE_DATA ""
83 }
84
85 # Find tclsh for the test suite.
@@ -212,11 +213,12 @@
212 # sqlcompttest.c
213 #
214 set cmdline {}
215 lappend cmdline {*}[get-define CCACHE]
216 lappend cmdline {*}[get-define CC] {*}[get-define CFLAGS]
217 lappend cmdline $::autosetup(dir)/../tools/sqlcompattest.c -o conftest__
 
218 lappend cmdline {*}[get-define LDFLAGS]
219 lappend cmdline {*}[get-define LIBS]
220 set sqlite-version [string cat "-D MINIMUM_SQLITE_VERSION=" [get-define MINIMUM_SQLITE_VERSION]]
221 lappend cmdline {*}[set sqlite-version]
222 set ok 1
@@ -940,19 +942,20 @@
940 }
941 define HAVE_EMSDK $rc
942 return $rc
943 }
944
945 if {[proj-check-emsdk]} {
946 define EMCC_WRAPPER $::autosetup(dir)/../tools/emcc.sh
 
 
947 define EMCC_OPT [get-env EMCC_OPT "-Oz"]; # optional flags to pass to emcc
948 make-template tools/emcc.sh.in
949 catch {exec chmod u+x tools/emcc.sh}
950 } else {
951 define EMCC_WRAPPER ""
952 define EMCC_OPT ""
953 catch {exec rm -f tools/emcc.sh}
954 }
955
956 handle-with-openssl
957
958 # Finally, append libraries that must be last. This matters more on some
@@ -993,10 +996,10 @@
993 # of Fossil each one contains. This not only allows multiple images
994 # to coexist and multiple containers to be created unamgiguosly from
995 # them, it also changes the URL we fetch the source tarball from, so
996 # repeated builds of a given version generate and fetch the source
997 # tarball once only, keeping it in the local Docker/Podman cache.
998 set ci [readfile "$::autosetup(srcdir)/manifest.uuid"]
999 define FOSSIL_CI_PFX [string range $ci 0 11]
1000
1001 make-template Makefile.in
1002 make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
1003
--- auto.def
+++ auto.def
@@ -1,10 +1,10 @@
1 # System autoconfiguration. Try: ./configure --help
2
3 # This must be above "options" below because it implicitly brings in the
4 # default Autosetup options, things like --prefix.
5 use cc cc-lib local
6
7 options {
8 with-openssl:path|auto|tree|none
9 => {Look for OpenSSL in the given path, automatically, in the source tree, or none}
10 with-zlib:path|auto|tree
@@ -50,11 +50,12 @@
50 # Space characters have never been allowed in either the source
51 # tree nor the build directory. But the resulting error messages
52 # could be confusing. The following checks make the reason for the
53 # failure clear.
54 #
55 set ::dirSrc $::autosetup(srcdir)
56 if {[string first " " $$::dirSrc] != -1} {
57 user-error "The pathname of the source tree\
58 may not contain space characters"
59 }
60 if {[string first " " $autosetup(builddir)] != -1} {
61 user-error "The pathname of the build directory\
@@ -75,11 +76,11 @@
76 # Use pread/pwrite system calls in place of seek + read/write if possible
77 define USE_PREAD [cc-check-functions pread]
78
79 # If we have cscope here, we'll use it in the "tags" target
80 if {[cc-check-progs cscope]} {
81 define COLLECT_CSCOPE_DATA "cscope -bR $$::dirSrc/src/*.\[ch\]"
82 } else {
83 define COLLECT_CSCOPE_DATA ""
84 }
85
86 # Find tclsh for the test suite.
@@ -212,11 +213,12 @@
213 # sqlcompttest.c
214 #
215 set cmdline {}
216 lappend cmdline {*}[get-define CCACHE]
217 lappend cmdline {*}[get-define CC] {*}[get-define CFLAGS]
218 lappend cmdline $::dirSrc/tools/sqlcompattest.c
219 lappend cmdline -o conftest__
220 lappend cmdline {*}[get-define LDFLAGS]
221 lappend cmdline {*}[get-define LIBS]
222 set sqlite-version [string cat "-D MINIMUM_SQLITE_VERSION=" [get-define MINIMUM_SQLITE_VERSION]]
223 lappend cmdline {*}[set sqlite-version]
224 set ok 1
@@ -940,19 +942,20 @@
942 }
943 define HAVE_EMSDK $rc
944 return $rc
945 }
946
947 if {!$outOfTreeBuild && [proj-check-emsdk]} {
948 # Maintenance note: the WASM-related pieces are only for in-tree
949 # maintenance, not out-of-tree builds.
950 define EMCC_WRAPPER $::dirSrc/tools/emcc.sh
951 define EMCC_OPT [get-env EMCC_OPT "-Oz"]; # optional flags to pass to emcc
952 make-template tools/emcc.sh.in
953 catch {exec chmod u+x [get-define EMCC_WRAPPER]}
954 } else {
955 define EMCC_WRAPPER ""
956 define EMCC_OPT ""
 
957 }
958
959 handle-with-openssl
960
961 # Finally, append libraries that must be last. This matters more on some
@@ -993,10 +996,10 @@
996 # of Fossil each one contains. This not only allows multiple images
997 # to coexist and multiple containers to be created unamgiguosly from
998 # them, it also changes the URL we fetch the source tarball from, so
999 # repeated builds of a given version generate and fetch the source
1000 # tarball once only, keeping it in the local Docker/Podman cache.
1001 set ci [readfile "$$::dirSrc/manifest.uuid"]
1002 define FOSSIL_CI_PFX [string range $ci 0 11]
1003
1004 make-template Makefile.in
1005 make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
1006
+5 -1
--- configure
+++ configure
@@ -1,4 +1,8 @@
11
#!/bin/sh
22
dir="`dirname "$0"`/autosetup"
33
#@@INITCHECK@@#
4
-WRAPPER="$0"; export WRAPPER; exec "`"$dir/autosetup-find-tclsh"`" "$dir/autosetup" "$@"
4
+WRAPPER="$0"; export WRAPPER
5
+if test -f "$dir/autosetup"
6
+then exec "`"$dir/autosetup-find-tclsh"`" "$dir/autosetup" "$@"
7
+else exec autosetup "$@"
8
+fi
59
--- configure
+++ configure
@@ -1,4 +1,8 @@
1 #!/bin/sh
2 dir="`dirname "$0"`/autosetup"
3 #@@INITCHECK@@#
4 WRAPPER="$0"; export WRAPPER; exec "`"$dir/autosetup-find-tclsh"`" "$dir/autosetup" "$@"
 
 
 
 
5
--- configure
+++ configure
@@ -1,4 +1,8 @@
1 #!/bin/sh
2 dir="`dirname "$0"`/autosetup"
3 #@@INITCHECK@@#
4 WRAPPER="$0"; export WRAPPER
5 if test -f "$dir/autosetup"
6 then exec "`"$dir/autosetup-find-tclsh"`" "$dir/autosetup" "$@"
7 else exec autosetup "$@"
8 fi
9

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button