Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from
Closed

Conversation

jmalak
Copy link
Contributor

@jmalak jmalak commented Jul 19, 2024

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 @<aux. name> 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

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 @<name> 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.
@jmalak
Copy link
Contributor Author

jmalak commented Jul 19, 2024

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
Copy link
Contributor

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
Copy link
Contributor Author

jmalak commented Jul 19, 2024

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
Copy link
Contributor Author

jmalak commented Jul 19, 2024

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
Copy link
Contributor Author

jmalak commented Jul 19, 2024

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.

@jmalak jmalak closed this by deleting the head repository Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants