I'm now nearly sure, that Erling has patched the Lattice Compiler, so that it supports the TK2 default directories, at least for the source file name. Cause if I execute phase 1 directly with e.g.:
Code: Select all
ex'QLC_1';'=8192 %81920 >RAM1_QLC1_err_txt -b -ccu -dregister -dQDOS=1 -n scalc''
the compiler creates scalc_q (_q is the output of the first compiler phase). The original Lattice C compiler from MCDK doesn't know anything about TK2 default directories. At the time MCDK was released TK2 didn't even exist, just the Toolkit 1 existed. Albeit it already had default directories (PROG_USE and DATA_USE only), it wasn't very common AND could not be used on an unexpanded QL when compiling C programs, due to memory requirements of the Lattice Compiler, which even had to use part of the screen memory (part of screen was destroyed!) to be able to run.
Another problem. EJC.txt says the compiler
AND the program which shall be compiled must be in DATAD$ (1), which is uncomfortable. At the time EJC was developed, there was no PTH device (thank you Phil Borman!). So I tried to set DATAD§ to my C source directory and added the EJC directory to the Path (PTH_ADD 1,'WIN1_bin_ejc_':REMark because of a bug in PTH_ADD, 0 is not possible). When I now call my ecc (or the original cc) the error listing is not output (because the listing file is not written), albeit QLC_1 gets the same command line as as the above direct execution of QLC_1. Strange.
It must have something to do with the function pipeline(), which is used in EJC to start executable programs. BTW, my approach would not work, because the compiler doesn't find the standard header files. In original MCDK you could not use e.g. #include <stdio_h>, you
MUST use (e.g.) #include <FLP1_stdio_h>.
I think I must extend my ecc. I will have a look to the C68 sources how to access the environment variables (which also don't exist, when EJC was developed). Than I will change the compiler driver so that the (base) source directory may be specified via an environment variable.
BTW: Does anyone have the sources of the cc compiler driver of PDQC? Then I would try, if it's possible to use the newer Lattice Compiler (via the TOS emulator) with the EJC libs. But I don't know how to call the Lattice compiler phases of PDQD (phase 1 and 2 are no executable files). I assume they must be started via "pdqc", which I assume is the TOS emulator needed to run the Atari ST version of the Lattice compiler.
--
1) Albeit I have found it's possible to pass an absolute filename to cc/ecc (e.g. WIN1_home_hps_c_scalc).