--- p/lang.c.orig Tue Aug 19 23:21:15 2003 +++ p/lang.c Tue Sep 23 20:25:21 2003 @@ -402,6 +402,26 @@ extern int debug_no_type_hash; +#ifdef GCC_3_3 +#define builtin_assert(s) +static void builtin_define PARAMS ((const char *)); +static void builtin_define_std PARAMS ((const char *)); + +static void +builtin_define (s) + const char *s; +{ + fprintf (stderr, "-D%s ", s); +} + +static void +builtin_define_std (s) + const char *s; +{ + fprintf (stderr, "-D%s -D__%s -D__%s__ ", s, s, s); +} +#endif + #ifdef EGCS97 const char * lang_init (filename) @@ -456,18 +476,27 @@ error ("`--big-endian' given, but target system is little endian"); exit (FATAL_EXIT_CODE); } - /* The following is no joke! The difference between what the - preprocessor and the compiler think of BYTES_BIG_ENDIAN is - exactly the problem we're dealing with here. */ if (co->print_needed_options) { +#ifdef GCC_3_3 + if (optimize_size) + builtin_define ("__OPTIMIZE_SIZE__"); + if (optimize) + builtin_define ("__OPTIMIZE__"); + TARGET_CPU_CPP_BUILTINS (); + TARGET_OS_CPP_BUILTINS (); +#endif + /* The following is no joke! The difference between what the + preprocessor and the compiler think of BYTES_BIG_ENDIAN is + exactly the problem we're dealing with here. */ #if BYTES_BIG_ENDIAN if (!BYTES_BIG_ENDIAN) - fputs ("--little-endian\n", stderr); + fputs ("--little-endian", stderr); #else if (BYTES_BIG_ENDIAN) - fputs ("--big-endian\n", stderr); + fputs ("--big-endian", stderr); #endif + fputs ("\n", stderr); while (fgetc (finput) != EOF) ; exit (1); } --- p/rts/Makefile.in.orig Thu Jul 24 18:19:36 2003 +++ p/rts/Makefile.in Tue Sep 23 20:22:50 2003 @@ -165,7 +165,7 @@ # `-x Preprocessed-Pascal /dev/null' works as well, except on mingw. needed-options: endian.pas $(PC) $(RTS_CFLAGS) $(PFLAGS) $(PFLAGS1) --print-needed-options "$<" 2> "$@" || true - if grep -v '^--' "$@" > /dev/null; then echo "needed-options: `cat "$@"`" >&2; rm -f "$@"; false; else true; fi + if grep -v '^-' "$@" > /dev/null; then echo "needed-options: `cat "$@"`" >&2; rm -f "$@"; false; else true; fi $(GPCLIB): $(OBJS) -rm -f $(GPCLIB) --- p/utils/Makefile.orig Sat Aug 30 10:53:44 2003 +++ p/utils/Makefile Tue Sep 23 20:23:01 2003 @@ -52,7 +52,7 @@ # `-x Preprocessed-Pascal /dev/null' works as well, except on mingw. needed-options: binobj.pas $(PC) $(UTILS_WARN) $(CFLAGS) $(PFLAGS) $(PFLAGS1) --print-needed-options "$<" 2> "$@" || true - if grep -v '^--' "$@" > /dev/null; then echo "needed-options: `cat "$@"`" >&2; rm -f "$@"; false; else true; fi + if grep -v '^-' "$@" > /dev/null; then echo "needed-options: `cat "$@"`" >&2; rm -f "$@"; false; else true; fi binobj$(exeext): binobj.pas needed-options $(PC_WITH_FLAGS) "$<" --- p/test/test_run.orig Sat Jun 21 00:10:05 2003 +++ p/test/test_run Tue Sep 23 20:23:21 2003 @@ -98,7 +98,7 @@ echo "program Dummy; begin WriteLn ('1723') end." > dummy.pas NEEDED_OPTIONS="`$PC $PFLAGS --print-needed-options dummy.pas 3>&2 2>&1 1>&3`" -if echon "$NEEDED_OPTIONS" | grep -v '^--' > /dev/null; then +if echon "$NEEDED_OPTIONS" | grep -v '^-' > /dev/null; then echo "$0: fatal: \`--print-needed-options' yields:" >&2 echo "$NEEDED_OPTIONS" >&2 exit 1