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

build: modify echolib.bat to minimize environment use and args check #117

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

jmalak
Copy link
Contributor

@jmalak jmalak commented Dec 23, 2024

  • change to be similar as echoto.bat nethod
  • no more then 10 parameters are used
  • add arguments overflow check to echolib.bat
  • add arguments overflow check to echoto.bat

- change to be similar as echoto.bat nethod
- no more then 10 parameters are used
- add arguments overflow check to echolib.bat
- add arguments overflow check to echoto.bat
@andrewbird
Copy link
Contributor

Hi @jmalak I'm currently trying to get TurboC 2.01 compiling again and have hit the max args with echoto.bat. Is it possible to save the 1st arg to a variable and shift, so getting to use one more arg? It seemed to work for me, but I'm not really understanding the environment space issue with dos and wouldn't like to recreate the original problem.

ajb@calypso:/clients/common/fdos/freecom.git$ git show 770f500cdbd83d94223c48c5fdbbb19fd5d36c79
commit 770f500cdbd83d94223c48c5fdbbb19fd5d36c79
Author: Andrew Bird <ajb@spheresystems.co.uk>
Date:   Sun Dec 22 00:54:09 2024 +0000

    Build: Turbo C needs another arg from echoto

diff --git a/scripts/echoto.bat b/scripts/echoto.bat
index d792a4c..ddcae9a 100644
--- a/scripts/echoto.bat
+++ b/scripts/echoto.bat
@@ -1,4 +1,6 @@
 @echo off
-if "%2%3%4%5%6%7%8%9" == "" goto nothing
-echo %2 %3 %4 %5 %6 %7 %8 %9 >>%1
+set FILE=%1
+shift
+if "%1%2%3%4%5%6%7%8%9" == "" goto nothing
+echo %1 %2 %3 %4 %5 %6 %7 %8 %9 >> %FILE%
 :nothing

@jmalak
Copy link
Contributor Author

jmalak commented Dec 23, 2024

I am also not remembering on original problem now.
It was related to compilation with Turbo C on pure DOS and with limited size of environment space that only solution was to remove any writing to environment variables.
Under another condition it doesn't happen.
I think that replace it by two calls to echoto.bat is more reliable under any conditions.
Another possibility is to concatenate some strings for call echoto.bat
On DOS it is safer if you don't use any environment variables and write it directly to response file.
I am thinking about "&" character escaping in echolib to remove environment variable.

@andrewbird
Copy link
Contributor

I think that replace it by two calls to echoto.bat is more reliable under any conditions.

Okay, I've changed things here to use two CFLAGS variables, and updated the ${COMPILER}.mak files (there are others apart from tc2)

@jmalak
Copy link
Contributor Author

jmalak commented Dec 23, 2024

If I remember properly then TC is combination of turboc.cfg file and command line.
that common setup can be modified in turboc.cfg and rest in response file.

@andrewbird andrewbird merged commit 8ce6c95 into FDOS:master Dec 23, 2024
1 check passed
@jmalak jmalak deleted the fix-1 branch December 23, 2024 23:28
@andrewbird
Copy link
Contributor

I'm seeing a slight problem with this and Turbo C 2.01. The old script produced this

+addu.obj +byte2par.obj +cntry.obj +dfndeli2.obj +dfndelim.obj +dfnexpan.obj +dfnfnam.obj &
+dfnfullp.obj +dfnmerge.obj +dfnpath.obj +dfnsplit.obj +dfnsquee.obj +dfnstat.obj &
+dfntruen.obj +dmemcmpf.obj +dosalloc.obj +dosfree.obj +dossize.obj +dstrchar.obj &

whereas the new produces

addu.obj byte2par.obj cntry.obj dfndeli2.obj dfndelim.obj dfnexpan.obj dfnfnam.obj  &
dfnfullp.obj dfnmerge.obj dfnpath.obj dfnsplit.obj dfnsquee.obj dfnstat.obj   & 
dfntruen.obj dmemcmpf.obj dosalloc.obj dosfree.obj dossize.obj dstrchar.obj   & 

TLINK then complains about unexpected character 'a'

jmalak added a commit to jmalak/freecom that referenced this pull request Dec 24, 2024
add missing (+) character for module files
@jmalak
Copy link
Contributor Author

jmalak commented Dec 25, 2024

for now it will be best to return echolib.bat to original version.
the issue is that only Turbo C require (+) character before object module file which I omitted.

andrewbird added a commit to andrewbird/freecom that referenced this pull request Dec 26, 2024
…s check (FDOS#117)"

This reverts commit 8ce6c95.

Breaks build Turbo C as it wants '+' to preceed each file.
andrewbird added a commit to andrewbird/freecom that referenced this pull request Dec 26, 2024
…s check (FDOS#117)"

This reverts commit 8ce6c95.

Breaks build Turbo C as it wants '+' to preceed each file.
@andrewbird andrewbird mentioned this pull request Dec 26, 2024
PerditionC pushed a commit that referenced this pull request Dec 27, 2024
…s check (#117)"

This reverts commit 8ce6c95.

Breaks build Turbo C as it wants '+' to preceed each file.
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