Fossil SCM

Allow building on Windows under the MINGW64 shell. Multiple changes needed: * pacman command in the build doc was performing a search, not a "sync", what other package systems call install; thus, no-op * configure was presuming presence of /dev/null meant "not MinGW"; doubtless there are MinGW setups where this is the case, but the modern MinGW64 terminal is not one of these * the guards against trying to use linenoise on Windows weren't triggered for this type of build, causing link failures

wyoung 2026-10-05 23:01 UTC trunk
Commit ddba8ea2432c734b0a2287caec4246c6423b1cdf71049b72bb4aea04e67de946
+1 -2
--- auto.def
+++ auto.def
@@ -248,12 +248,11 @@
248248
249249
}
250250
251251
proc is_mingw {} {
252252
return [expr {
253
- [string match *mingw* [get-define host]] &&
254
- ![file exists "/dev/null"]
253
+ [string match *mingw* [get-define host]]
255254
}]
256255
}
257256
258257
if {[is_mingw]} {
259258
define-append EXTRA_CFLAGS -DBROKEN_MINGW_CMDLINE
260259
--- auto.def
+++ auto.def
@@ -248,12 +248,11 @@
248
249 }
250
251 proc is_mingw {} {
252 return [expr {
253 [string match *mingw* [get-define host]] &&
254 ![file exists "/dev/null"]
255 }]
256 }
257
258 if {[is_mingw]} {
259 define-append EXTRA_CFLAGS -DBROKEN_MINGW_CMDLINE
260
--- auto.def
+++ auto.def
@@ -248,12 +248,11 @@
248
249 }
250
251 proc is_mingw {} {
252 return [expr {
253 [string match *mingw* [get-define host]]
 
254 }]
255 }
256
257 if {[is_mingw]} {
258 define-append EXTRA_CFLAGS -DBROKEN_MINGW_CMDLINE
259
+1 -1
--- src/fshell.c
+++ src/fshell.c
@@ -47,11 +47,11 @@
4747
**
4848
** This command only works on unix-like platforms that support fork().
4949
** It is non-functional on Windows.
5050
*/
5151
void shell_cmd(void){
52
-#ifdef _WIN32
52
+#if defined(_WIN32) || defined(BROKEN_MINGW_CMDLINE)
5353
fossil_fatal("the 'shell' command is not supported on windows");
5454
#else
5555
int nArg;
5656
int mxArg = 0;
5757
int n, i;
5858
--- src/fshell.c
+++ src/fshell.c
@@ -47,11 +47,11 @@
47 **
48 ** This command only works on unix-like platforms that support fork().
49 ** It is non-functional on Windows.
50 */
51 void shell_cmd(void){
52 #ifdef _WIN32
53 fossil_fatal("the 'shell' command is not supported on windows");
54 #else
55 int nArg;
56 int mxArg = 0;
57 int n, i;
58
--- src/fshell.c
+++ src/fshell.c
@@ -47,11 +47,11 @@
47 **
48 ** This command only works on unix-like platforms that support fork().
49 ** It is non-functional on Windows.
50 */
51 void shell_cmd(void){
52 #if defined(_WIN32) || defined(BROKEN_MINGW_CMDLINE)
53 fossil_fatal("the 'shell' command is not supported on windows");
54 #else
55 int nArg;
56 int mxArg = 0;
57 int n, i;
58
+1 -1
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -472,11 +472,11 @@
472472
}
473473
db_open_config(1,0);
474474
zConfigDb = fossil_strdup(g.zConfigDbName);
475475
fossil_close(1, noRepository);
476476
sqlite3_shutdown();
477
-#ifndef _WIN32
477
+#if !defined(_WIN32) && !defined(BROKEN_MINGW_CMDLINE)
478478
linenoiseSetMultiLine(1);
479479
#endif
480480
atexit(sqlcmd_atexit);
481481
g.zConfigDbName = zConfigDb;
482482
g.argv[1] = "--noinit";
483483
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -472,11 +472,11 @@
472 }
473 db_open_config(1,0);
474 zConfigDb = fossil_strdup(g.zConfigDbName);
475 fossil_close(1, noRepository);
476 sqlite3_shutdown();
477 #ifndef _WIN32
478 linenoiseSetMultiLine(1);
479 #endif
480 atexit(sqlcmd_atexit);
481 g.zConfigDbName = zConfigDb;
482 g.argv[1] = "--noinit";
483
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -472,11 +472,11 @@
472 }
473 db_open_config(1,0);
474 zConfigDb = fossil_strdup(g.zConfigDbName);
475 fossil_close(1, noRepository);
476 sqlite3_shutdown();
477 #if !defined(_WIN32) && !defined(BROKEN_MINGW_CMDLINE)
478 linenoiseSetMultiLine(1);
479 #endif
480 atexit(sqlcmd_atexit);
481 g.zConfigDbName = zConfigDb;
482 g.argv[1] = "--noinit";
483
+1 -1
--- www/build.wiki
+++ www/build.wiki
@@ -166,11 +166,11 @@
166166
Even so, there is value to Linux/Unix natives in having this hybrid
167167
while off in Windows-land. The simpler of the two paths is MSYS2, since
168168
it lets you install the necessary prerequisites in a single command
169169
after installing the base environment:
170170
171
-<pre>pacman -sS gcc make openssl-devel zlib-devel</pre>
171
+<pre>pacman -S gcc make openssl-devel zlib-devel</pre>
172172
173173
The equivalent in Cygwin's <code>setup.exe</code> requires stepping
174174
through the GUI package chooser, and then if you miss one of the
175175
prereqs, going all the way back through it again until you get it right.
176176
177177
--- www/build.wiki
+++ www/build.wiki
@@ -166,11 +166,11 @@
166 Even so, there is value to Linux/Unix natives in having this hybrid
167 while off in Windows-land. The simpler of the two paths is MSYS2, since
168 it lets you install the necessary prerequisites in a single command
169 after installing the base environment:
170
171 <pre>pacman -sS gcc make openssl-devel zlib-devel</pre>
172
173 The equivalent in Cygwin's <code>setup.exe</code> requires stepping
174 through the GUI package chooser, and then if you miss one of the
175 prereqs, going all the way back through it again until you get it right.
176
177
--- www/build.wiki
+++ www/build.wiki
@@ -166,11 +166,11 @@
166 Even so, there is value to Linux/Unix natives in having this hybrid
167 while off in Windows-land. The simpler of the two paths is MSYS2, since
168 it lets you install the necessary prerequisites in a single command
169 after installing the base environment:
170
171 <pre>pacman -S gcc make openssl-devel zlib-devel</pre>
172
173 The equivalent in Cygwin's <code>setup.exe</code> requires stepping
174 through the GUI package chooser, and then if you miss one of the
175 prereqs, going all the way back through it again until you get it right.
176
177

Keyboard Shortcuts

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