Maurice Lombardi a écrit:
In fact all errors but the mir029el.pas come from the compiler no more defining by default
-DMSDOS -DDJGPP=2 -DGO32 (and underscored versions)
All errors (except mir029el) disappear if I use EXTRA_TEST_PFLAGS="-gstabs -DMSDOS -DDJGPP=2 -DGO32"
When looking into the the specs files I find that in gcc-3.2.2 these where defined in the sections *cpp: (without underscore) *predefines: (with underscores)
and they have disappeared in gcc-3.3.1
This seems to be a problem of sync between gcc and gpc. These variables are defined elsewhere in gcc. Indeed if I write a small test program in C -------------------------------------------------------------- #include <stdio.h>
int main(void) { #ifdef DJGPP printf("DJGPP version %d.%d\n",DJGPP,DJGPP_MINOR); #else printf("DJGPP not defined ???\n"); #endif #ifdef MSDOS printf("MSDOS defined\n"); #endif #ifdef GO32 printf("GO32 defined\n"); #endif return 0; } --------------------------------------------------------------
I compile with C:\LOMBARDI\DJGPP\C>gcc -v test2.c -o test2.exe -------------------------------------------------------------- Reading specs from c:/djgpp/lib/gcc-lib/djgpp/3.31/specs Configured with: /devel/gnu/gcc/3.3/gnu/gcc-3.31/configure i586-pc-msdosdjgpp -- prefix=/dev/env/DJDIR --disable-nls Thread model: single gcc version 3.3.1 c:/djgpp/lib/gcc-lib/djgpp/3.31/cc1.exe -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__ =3 -D__GNUC_PATCHLEVEL__=1 -remap -imacros c:/djgpp/lib/gcc-lib/djgpp/3.31/djgpp .ver test2.c -quiet -dumpbase test2.c -auxbase test2 -version -o c:/djgpp/tmp/cc dIBHI3.s GNU C version 3.3.1 (djgpp) compiled by GNU C version 3.3.1. GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 ignoring nonexistent directory "c:/djgpp/djgpp/include" #include "..." search starts here: #include <...> search starts here: c:/djgpp/lib/gcc-lib/djgpp/3.31/include c:/djgpp/include End of search list. c:/djgpp/bin/as.exe --traditional-format -o c:/djgpp/tmp/cccaplI0.o c:/djgpp/tm p/ccdIBHI3.s c:/djgpp/lib/gcc-lib/djgpp/3.31/collect2.exe -o test2.exe c:/djgpp/lib/crt0.o - Lc:/djgpp/lib -Lc:/djgpp/lib/gcc-lib/djgpp/3.31 -Lc:/djgpp/bin -Lc:/djgpp/lib -L c:/djgpp/lib/gcc-lib/djgpp/3.31/../../.. c:/djgpp/tmp/cccaplI0.o -lgcc -lc -lgcc -Tdjgpp-x.djl c:/djgpp/bin/stubify.exe -v test2.exe stubify for djgpp V2.X executables, Copyright (C) 1995 DJ Delorie stubify: test2.exe -> test2.000 -> test2.exe ------------------------------------------------------------
I obtain the answer
DJGPP version 2.3 MSDOS defined GO32 defined
which shows that all variables are known. DJGPP and friends come from the file djgpp.ver which contains #include <sys/version.h> and this file defines the various DJGPP DJGPP_MINOR with and without underscores. MSDOS and GO32 I do not know.
I gave a look to where this could be defined. It seems to come from file gcc/config/i386/djgpp.h
in gcc-3.2.3 it contained (after application of the djgpp patches) among others: ------------------------------------------------------------------ #undef CPP_PREDEFINES #define CPP_PREDEFINES "-D__MSDOS__ -D__GO32__ -D__DJGPP__=2 -D__unix__ -Asystem=msdos -Asystem=unix"
/* Include <sys/version.h> so __DJGPP__ and __DJGPP_MINOR__ are defined. */ #undef CPP_SPEC #define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \ %{!ansi:%{!std=c*:%{!std=i*:-DMSDOS -DGO32 -DDJGPP=2 -Dunix}}} \ -remap %{!nostdinc:-imacros %sdjgpp.ver}" ------------------------------------------------------------------------------ the specs file comes from there.
in gcc-3.3.1 this has been replaced by ------------------------------------------------------------------------------ #define TARGET_OS_CPP_BUILTINS() \ do \ { \ if (!flag_iso) \ builtin_define_with_int_value ("DJGPP",2); \ builtin_define_with_int_value ("__DJGPP",2); \ builtin_define_with_int_value ("__DJGPP__",2); \ builtin_define_std ("MSDOS"); \ builtin_define_std ("GO32"); \ builtin_define_std ("unix"); \ builtin_assert ("system=msdos"); \ } \ while (0)
/* Include <sys/version.h> so __DJGPP__ and __DJGPP_MINOR__ are defined. */ #undef CPP_SPEC #define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \ %{!nostdinc:-imacros %sdjgpp.ver}" ------------------------------------------------------------------------------ This gives what we see in the specs file, but in addition there are all those builtins which probably do what we want.
Hope this helps.
Maurice