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
Commit
ddba8ea2432c734b0a2287caec4246c6423b1cdf71049b72bb4aea04e67de946
Parent
e6e6a32c2c3cdcf…
4 files changed
+1
-2
+1
-1
+1
-1
+1
-1
M
auto.def
+1
-2
| --- auto.def | ||
| +++ auto.def | ||
| @@ -248,12 +248,11 @@ | ||
| 248 | 248 | |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | proc is_mingw {} { |
| 252 | 252 | return [expr { |
| 253 | - [string match *mingw* [get-define host]] && | |
| 254 | - ![file exists "/dev/null"] | |
| 253 | + [string match *mingw* [get-define host]] | |
| 255 | 254 | }] |
| 256 | 255 | } |
| 257 | 256 | |
| 258 | 257 | if {[is_mingw]} { |
| 259 | 258 | define-append EXTRA_CFLAGS -DBROKEN_MINGW_CMDLINE |
| 260 | 259 |
| --- 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 @@ | ||
| 47 | 47 | ** |
| 48 | 48 | ** This command only works on unix-like platforms that support fork(). |
| 49 | 49 | ** It is non-functional on Windows. |
| 50 | 50 | */ |
| 51 | 51 | void shell_cmd(void){ |
| 52 | -#ifdef _WIN32 | |
| 52 | +#if defined(_WIN32) || defined(BROKEN_MINGW_CMDLINE) | |
| 53 | 53 | fossil_fatal("the 'shell' command is not supported on windows"); |
| 54 | 54 | #else |
| 55 | 55 | int nArg; |
| 56 | 56 | int mxArg = 0; |
| 57 | 57 | int n, i; |
| 58 | 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 | #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 @@ | ||
| 472 | 472 | } |
| 473 | 473 | db_open_config(1,0); |
| 474 | 474 | zConfigDb = fossil_strdup(g.zConfigDbName); |
| 475 | 475 | fossil_close(1, noRepository); |
| 476 | 476 | sqlite3_shutdown(); |
| 477 | -#ifndef _WIN32 | |
| 477 | +#if !defined(_WIN32) && !defined(BROKEN_MINGW_CMDLINE) | |
| 478 | 478 | linenoiseSetMultiLine(1); |
| 479 | 479 | #endif |
| 480 | 480 | atexit(sqlcmd_atexit); |
| 481 | 481 | g.zConfigDbName = zConfigDb; |
| 482 | 482 | g.argv[1] = "--noinit"; |
| 483 | 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 | #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 @@ | ||
| 166 | 166 | Even so, there is value to Linux/Unix natives in having this hybrid |
| 167 | 167 | while off in Windows-land. The simpler of the two paths is MSYS2, since |
| 168 | 168 | it lets you install the necessary prerequisites in a single command |
| 169 | 169 | after installing the base environment: |
| 170 | 170 | |
| 171 | -<pre>pacman -sS gcc make openssl-devel zlib-devel</pre> | |
| 171 | +<pre>pacman -S gcc make openssl-devel zlib-devel</pre> | |
| 172 | 172 | |
| 173 | 173 | The equivalent in Cygwin's <code>setup.exe</code> requires stepping |
| 174 | 174 | through the GUI package chooser, and then if you miss one of the |
| 175 | 175 | prereqs, going all the way back through it again until you get it right. |
| 176 | 176 | |
| 177 | 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 -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 |