On Wed, Apr 10, 2024 at 10:20 AM Jim Hall <jh...@freedos.org> wrote:
> The DJGPP environment variable just needs to point to a file called
> DJGPP.ENV (or whatever) that contains a bunch of environment settings
> for programs that were compiled with DJGPP. For example, this file
> contains stanzas for GNU Emacs, GNU Bison, and other programs.
>
> But you can point to any file. [..] my DJGPP.ENV file is basically
> empty:
>
> C:\SRC>type DJGPP.ENV
> DJDIR=
>
>
> But I can compile just fine:
[..]


And a further demo:

When I installed FreeDOS T2404, I installed the I16GCC packages, but
obviously T2404 doesn't include the DJGPP stuff. So can you compile
programs using IA-16 GCC on T2404 without DJGPP? Yes! Just do what I
did. Here's my demo:


My C:\DEVEL directory contains just OpenWatcom C and IA-16 GCC. I
added the T.ENV file (because you can call the DJGPP env file
anything) and the ARGS.C file is just a dummy program I wrote as a
demo:

C:\DEVEL>dir /b
I16GNU
WATCOMC
ARGS.C
T.ENV

C:\DEVEL>type t.env
DJDIR=

C:\DEVEL>type args.c
#include <stdio.h>
int main(int argc, char **argv)
{
 int i;
 for (i = 0; i < argc; i++) {
  puts(argv[i]);
 }
 return 0;
}


And now compile it by setting the DJGPP variable to point to the
(empty) T.ENV file, then run IA-16 GCC as usual:

C:\DEVEL>set DJGPP=C:\DEVEL\T.ENV
C:\DEVEL>path C:\freedos\bin;C:\devel\i16gnu\bin
C:\DEVEL>i16gcc -Wall -o args.exe args.c
C:\DEVEL>args.exe this is a test 1 2 3 4 5
C:\DEVEL\ARGS.EXE
this
is
a
test
1
2
3
4
5


_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to