Commit graph

13 commits

Author SHA1 Message Date
Zapeth
b06f3c5013 Add quotes to paths in MinGW build scripts (for paths with spaces) 2018-11-24 22:10:13 +01:00
Iconoclast
fc808c42ea Control optimization level on a per-translation-unit basis. 2018-03-16 23:25:19 -04:00
Iconoclast
2b0585acfc Turn ECHO on for translation unit compiles only. 2018-03-16 22:07:40 -04:00
Iconoclast
7bb9ed7ea6 Use C standard calls even for the Windows build.
The original decision to use custom-tailored versions of the C standard
library functions for the Windows build came from a number of
issues--most of which turn out to be not applicable to a Windows DLL
module extension (in which no executable entry point is required).

Since most non-Visual-Studio build suites for Windows will use the
standard, universally available MSVCRT.DLL for linkage, no compatibility
issues can arise from switching the code back to use standard C calls
for _WIN32 builds (provided the calls and usages conform to ANSI C89 and
do not involve forwards-compatibility with other newer extensions to the
C language added in MSVCR80.DLL, MSVCR90.DLL and so forth).

Visual Studio itself, however, chooses to disallow targeting use of
MSVCRT.DLL because Microsoft changes the C language implementation
details of that file while promising the availability of certain
extensions and non-ANSI features available with fixed-version CRTS.
Therefore, if building with Visual Studio, this commit will cause a
dependency on some numbered version of Microsoft's CRT instead of the
standard MSVCRT.DLL.

Note that this issue is negligible due to the fact that MSVC cannot be
recommended for compiling an optimized interpreter code base (not
limited to the example of this plugin).

To test with MSVC anyway, either a) have the CRT framework package
installed to system upgrades (knowing end users the plugin is shared
with may not have this), b) use an older version of Visual Studio to
build, c) statically link the CRT dependency with /MT, d) use the
portable DDK suite containing MSVC outside of Visual Studio to continue
using MSVCRT.DLL, e) temporarily revert this commit to increase DLL file
size by using static linkage of the custom CRT functions removed by this
commit.

Another problem was the fact that MinGW GCC always links in CRT startup
code, even to DLLs for which no entry point needs to exist, and this
startup code depends on -lmingwex which adds a bit of custom message
crap to the binaries.  The obvious workaround for this (as obvious as
knowing to do it for DLLs) in the case of an EXE was obfuscated by the
fact that MinGW maintains an arbitrary design choice that calls __main
from inside main instead of in the startup code.  This side effect is
fixed by using preprocessor checks to wrap around a dummy __main symbol
in the entry point translation unit's source file.
2018-03-16 20:35:12 -04:00
Iconoclast
5db7b38052 fixed CHDIR failures when GCC is on another drive
If MinGW is installed to:
E:\MinGW\

...and the current directory is:
C:\Users\me\rsp\

Then `cd E:\MinGW\bin` is a null operation when the -D argument isn't
passed.
2018-03-16 15:51:33 -04:00
Iconoclast
81ac552540 Distinguish between Unix paths /lib/ and /lib64/. 2018-03-16 15:38:12 -04:00
Iconoclast
b29a6ae7dd cleaned up Windows command shell build scripts 2018-03-16 00:04:51 -04:00
Iconoclast
ddb779ce75 Avoid the %version% headache by targeting MSYS2. 2018-03-15 23:03:09 -04:00
Iconoclast
3ddfcf7eda -lkernel32 2018-03-15 22:19:05 -04:00
unknown
3d415f9711 minor typo in the case-insensitive Win32 build scripts 2015-08-16 17:51:59 -04:00
unknown
7d9e2fcdef Force invocation paths to bypass POSIX/Win32 shell install. 2015-08-15 21:30:13 -04:00
unknown
7310144f90 undefined reference to memcpy caused by compiling -O3 module.c 2015-07-16 19:19:33 -04:00
unknown
c615b81db1 added 64-bit build script for Windows, since MinGW is 32-bit only 2015-07-16 18:58:39 -04:00