Forum > Other OS

Conflict with CFGFILE environment variable when building compiler on FreeDOS


This is a very minor issue, that may not be worth any engineering/development time, but i wanted to report it.

The FreeDOS package for Free Pascal Compiler installs FPC which depends on Go32v2.

I wanted to build a 16-bit FPC compiler on FreeDOS (i.e. a compiler that did not depend on Go32v2).

Using the directions on, I downloaded the FPC source files and unzipped them on FreeDOS. There were some errors unzipping (I think due to total path name length, or long file name issues), but that is not the issue and the unzipping errors may not be fixable. I then attempted to build a cross compiler with the command:

make clean all OS_TARGET=msdos CPU_TARGET=i8086 OPT="-CX -XXs" CROSSOPT=-WmSmall BINUTILSPREFIX= PP=C:\my\path\to\ppc386.exe

The build did not succeed. The issue I ran into and the issue I am reporting is that ppc386.exe uses the CFGFILE environment variable to point to its configuration file. This is all well and good, however, FreeDOS *also* uses the CFGFILE environment variable to point to the location of FDCONFIG.SYS. So, on FreeDOS, when ppc386.exe reads the config file specified by CFGFILE, it loads FreeDOS's FDCONFIG.SYS file. This results is strange errors when building (e.g. 'Illegal parameter: 345?SHELL=C:\FreeDOS\BIN\COMMAND.COM ...', which is a line that appears in FreeDOS's FDCONFIG.SYS).

As I said, this is a very minor issue and may not be worth the time to fix. It's easy enough to just 'set CFGFILE=', which clears the environment variable before building.

I eventually used the pre-built cross compiler on Linux. Thank you to whoever supplied them.

Note that there is no native 16-bit compiler. (that is 16-bit and compiles for 16-bit). Only a 32-bit compiler that can generate 16-bit code.

Also release building has to be done on a LFN platform like .e.g Win9x

Thanks for that clarification. That was helpful to me.

LFN support can be enabled on FreeDOS, but given the issues I've run into, it seems that LFN support on FreeDOS is not as robust/capable/complete as LFN support on (e.g.) W95.

I think I've learned that building FPC on FreeDOS is not possible (and that it was probably silly of me to attempt it), so I consider this issue closed.

Thanks for the quick response.



[0] Message Index

Go to full version