FDOS / kernel

FreeDOS kernel - implements the core MS-DOS/PC-DOS (R) compatible operating system. It is derived from Pat Villani's DOS-C kernel and released under the GPL v2 or later. Please see http://www.freedos.org/ for more details about the FreeDOS (TM) Project.
http://kernel.fdos.org/
GNU General Public License v2.0
793 stars 142 forks source link

ow-build: use wlink directly without utils/wlinker.bat and ms2wlink #181

Closed jmalak closed 2 months ago

jmalak commented 2 months ago

this construct is used to create kernel.exe only now LINK variable contains real linker name with basic options that can be used anywhere and XLINK and XLINKFILE contains transformed linker command spcific for kernel build only for Borland tools response file is created as before and for OW direct command line is used without useless double transformation

I think utils/wlinker.bat solution was introduced to fix problem with DOS long line and probably as result of port original Borland build response file to OW.

OW is capable to pass long command line to tools through environment variable. OW wmake includes feature on DOS to overcome this issue by passing command line through auxiliary environment variable. this feature is control in make files by start character (*) before tool name. Wmake create internaly auxiliary environment variable with original command line arguments and pass it as @ argument on tool command line, it is used only on DOS because for other OS is not command line limit for 127 characters this feature can be used generally for most of OW tools as compilers, linker, librarian etc. and it was already used for wcc in kernel make files

jmalak commented 2 months ago

It is similar fix as request "Build on FreeDOS and OpenWATCOM environment" #54 This simplifies a little bit the complicated build system where anything can be changed even if it doesn't make sense, mixing make tools usage etc. Probably the consequences of previous development history.

boeckmann commented 2 months ago

In FreeCOM passing around long command lines not fitting the PSP is standardized via the CMDLINE environment variable. In your example, are the angle brackets at @ a placeholder, or have they to be entered litarally? Because until now I did only know about the @abc being a response file, with abc being a file instead an environment variable. So I wonder how to differentiate between the two.

Does the initialization code of the OpenWatcom v2 CRT already support the standardized CMDLINE environment variable parsing, or is it restricted to PSP? If not would be great if this could be supported, so that programs support the long cmd line "by default" if compiled with new OpenWatcom. If you agree that this is a good idea I would open an issue for this at your OpenWatcom repo.

jmalak commented 2 months ago

Most of OW tools use @abc following way, first test it for abc environment variable and if not found that it is interpreted as filename (response file) if not found then failed. It is not specific for OW 2.0 this is common from WATCOM era. Only OW 2.0 introduce this functionality for more utilities (mainly for OW build system which must work on DOS). Compilers, librarian and linker should works this way for wery long time, because it is supported by wmake very long time, star before tool name in make files.

jmalak commented 2 months ago

I checked C and C++ compilers, librarian and linker and they realy support this feature from WATCOM era, before OW 1.0. This feature is extra code outside command line processing on caller and callee side, but you can use it on calle side command line. wmake use it automaticaly that you don't need think about command line length.

jmalak commented 2 months ago

Sorry, I forgot reply to your question about CMDLINE environment variable. Sure it is possible to extend OW CRTL for DOS to support it, that open issue on Github and specify behavior or you can do contribution to OW code if you are interested in.