* suppoprt/cpp2/Makefile.bcc: reenable Borland C compilation
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 10 Jan 2007 19:12:06 +0000 (19:12 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 10 Jan 2007 19:12:06 +0000 (19:12 +0000)
* suppoprt/cpp2/configure.in, suppoprt/cpp2/libcpp/lex.c,
  suppoprt/cpp2/Makefile.in, suppoprt/cpp2/sdcpp-opts,
  suppoprt/cpp2/sdcpp.[ch]: house cleaning

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4569 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
support/cpp2/Makefile.bcc
support/cpp2/Makefile.in
support/cpp2/configure.in
support/cpp2/libcpp/lex.c
support/cpp2/sdcpp-opts.c
support/cpp2/sdcpp.c
support/cpp2/sdcpp.h

index 7408fd8eba5a9f1681a2e6e0d97f0e57ebf0b99c..ce4d8b92370b355b768ce2d07085ed8c35ebb8b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
 
        * src/SDCC.lex, src/SDCCmain.c: fixed bug #1631895:
          codeseg/constseg #pragma fail
+       * suppoprt/cpp2/Makefile.bcc: reenable Borland C compilation
+       * suppoprt/cpp2/configure.in, suppoprt/cpp2/libcpp/lex.c,
+         suppoprt/cpp2/Makefile.in, suppoprt/cpp2/sdcpp-opts,
+         suppoprt/cpp2/sdcpp.[ch]: house cleaning
 
 2007-01-09 Borut Razem <borut.razem AT siol.net>
 
index d4a92111d5f40c651c5e739599863b97ea153e79..fcdd33a693bb5cba385cbad8ecb2b7b1eec4d7e2 100644 (file)
@@ -4,38 +4,82 @@ PRJDIR          = ../..
 
 !include $(PRJDIR)/Bcc.inc
 
-CFLAGS = $(CFLAGS) -I. -I./libiberty -DHAVE_CONFIG_H
+CFLAGS = $(CFLAGS) -I. -I./libiberty -I./libcpp -I./libcpp/include -DHAVE_CONFIG_H
+AWK = gawk
 
-OBJECTS         = sdcpp.obj cppinit.obj \
-                  cpplib.obj cpplex.obj cppmacro.obj cppexp.obj \
-                  cppfiles.obj cpphash.obj cpperror.obj cppdefault.obj \
-                  hashtable.obj mkdeps.obj prefix.obj version.obj \
-                  line-map.obj cpptrad.obj \
-                  sdcpp-opts.obj cppcharset.obj hashtab.obj c-incpath.obj c-ppoutput.obj opts.obj options.obj diagnostic.obj pretty-print.obj \
-                  safe-ctype.obj obstack.obj splay-tree.obj lbasename.obj \
-                  hex.obj concat.obj \
-                  xmalloc.obj xstrdup.obj xexit.obj xmemdup.obj xstrerror.obj getpwd.obj vasprintf.obj
+LIBCPP_OBJS =  charset.obj directives.obj errors.obj expr.obj files.obj identifiers.obj \
+               init.obj lex.obj line-map.obj macro.obj mkdeps.obj symtab.obj traditional.obj
 
-TARGET          = $(PRJDIR)/bin/sdcpp.exe
+LIBIBERTY_OBJS = concat.obj fopen_unlocked.obj getpwd.obj hashtab.obj hex.obj \
+                lbasename.obj md5.obj obstack.obj safe-ctype.obj splay-tree.obj \
+                vasprintf.obj xexit.obj xmalloc.obj xmemdup.obj xstrdup.obj \
+                xstrerror.obj
+
+SDCC_OBJS = sdcpp.obj sdcpp-opts.obj c-ppoutput.obj cppdefault.obj prefix.obj \
+           version.obj opts.obj options.obj c-incpath.obj
+
+OBJECTS = $(SDCC_OBJS) $(LIBCPP_OBJS) $(LIBIBERTY_OBJS)
+
+TARGET = $(PRJDIR)/bin/sdcpp.exe
 
 all: $(TARGET)
 
 auto-host.h: auto-host_vc_in.h
         copy auto-host_vc_in.h auto-host.h > nul
 
-$(TARGET): auto-host.h $(OBJECTS)
-        $(CC) $(CFLAGS) -e$(TARGET) $(OBJECTS)
+##########################
+# Libcpp
 
-safe-ctype.obj: libiberty\safe-ctype.c
+charset.obj: libcpp\charset.c
+directives.obj: libcpp\directives.c
+errors.obj: libcpp\errors.c
+expr.obj: libcpp\expr.c
+files.obj: libcpp\files.c
+identifiers.obj: libcpp\identifiers.c
+init.obj: libcpp\init.c
+lex.obj: libcpp\lex.c
+line-map.obj: libcpp\line-map.c
+macro.obj: libcpp\macro.c
+mkdeps.obj: libcpp\mkdeps.c
+symtab.obj: libcpp\symtab.c
+traditional.obj: libcpp\traditional.c
+
+##########################
+# Libiberty
+
+concat.obj: libiberty\concat.c
+fopen_unlocked.obj: libiberty\fopen_unlocked.c
+getpwd.obj: libiberty\getpwd.c
+hashtab.obj: libiberty\hashtab.c
+hex.obj: libiberty\hex.c
+lbasename.obj: libiberty\lbasename.c
+md5.obj: libiberty\md5.c
 obstack.obj: libiberty\obstack.c
+safe-ctype.obj: libiberty\safe-ctype.c
 splay-tree.obj: libiberty\splay-tree.c
-lbasename.obj: libiberty\lbasename.c
-hex.obj: libiberty\hex.c
-concat.obj: libiberty\concat.c
-xmalloc.obj: libiberty\xmalloc.c
-xstrdup.obj: libiberty\xstrdup.c
+vasprintf.obj: libiberty\vasprintf.c
 xexit.obj: libiberty\xexit.c
+xmalloc.obj: libiberty\xmalloc.c
 xmemdup.obj: libiberty\xmemdup.c
+xstrdup.obj: libiberty\xstrdup.c
 xstrerror.obj: libiberty\xstrerror.c
-getpwd.obj: libiberty\getpwd.c
-vasprintf.obj: libiberty\vasprintf.c
\ No newline at end of file
+
+##########################
+# Sdcpp
+
+$(TARGET): auto-host.h $(OBJECTS)
+        $(CC) $(CFLAGS) -e$(TARGET) $(OBJECTS)
+
+optionlist.tmp:
+       $(AWK) -f opt-gather.awk sdcpp.opt > optionlist.tmp
+
+options.c: optionlist.tmp
+       $(AWK) -f opt-functions.awk -f optc-gen.awk -v header_name="config.h system.h options.h" optionlist.tmp > options.c
+
+options.h: optionlist.tmp
+       $(AWK) -f opt-functions.awk -f opth-gen.awk optionlist.tmp > options.h 
+
+sdcpp.obj: sdcpp.c options.h
+sdcpp-opts.obj: sdcpp-opts.c options.h
+options.obj: options.c options.h
+opts.obj: opts.c options.h
index 2c72bfd8ca59a43d824d94b4d165701d14fa0899..e05013f2cf8c2110fc71a49c162cbb3da932a930 100644 (file)
@@ -36,7 +36,7 @@ srcdir = @srcdir@
 
 
 LIBS = @LIBS@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -Wall
 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) \
   $(CFLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@
 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
@@ -127,7 +127,7 @@ clean:
 
 distclean: clean
        -rm -f auto-host.h auto-build.h cstamp-h Makefile
-       -rm -f configargs.h config.status config.run config.cache config.bak config.log *~
+       config.status config.run config.cache config.bak config.log *~
 
 # This tells GNU Make version 3 not to put all variables in the environment.
 .NOEXPORT:
index 8f47d09dfd4136cf46b598d77e84b033e9a305c7..4532c6bd9d6dfc834050df63ad15cb2e02d1198b 100644 (file)
@@ -333,19 +333,6 @@ changequote(,)dnl
 gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
 
-# Compile in configure arguments.
-if test -f configargs.h ; then
-       # Being re-configured.
-       gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*"\([^"]*\)".*/\1/'`
-       gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
-else
-       gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
-fi
-cat > configargs.h <<EOF
-/* Generated automatically. */
-static const char configuration_arguments[] = "$gcc_config_arguments";
-static const char thread_model[] = "$thread_file";
-EOF
 changequote([,])dnl
 
 # Internationalization
index c4a56380ee8d20b51bbb7dc518ca5670a1cc051e..791bdfe91ea2cf302355d54dcda9cc3096e9ce26 100644 (file)
@@ -615,7 +615,6 @@ pedantic_lex_number (cpp_reader *pfile, cpp_string *number)
 
   uchar c = *(pfile->buffer->cur - 1);
   struct obstack *stack = &pfile->hash_table->stack;
-  cpp_buffer *buffer = pfile->buffer;
   int len = 0;
   int has_whole = 0;
   int has_fract = 0;
index 19bc2649bb463de9041ed7d25e9d46ae64a233e5..e4eea8c8a662dfe4404533b2bae4132bcfa306ec 100644 (file)
@@ -36,8 +36,6 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
 # define TARGET_SYSTEM_ROOT NULL
 #endif
 
-static int saved_lineno;
-
 /* CPP's options.  */
 static cpp_options *cpp_opts;
 
@@ -192,7 +190,6 @@ sdcpp_common_init_options (unsigned int argc, const char **argv ATTRIBUTE_UNUSED
 int
 sdcpp_common_handle_option (size_t scode, const char *arg, int value)
 {
-  const struct cl_option *option = &cl_options[scode];
   enum opt_code code = (enum opt_code) scode;
   int result = 1;
 
index b508ea64ccaebc0fcfd7f4b7182766c511638fd0..e45a02f0589e4498cfaed0189f12ec4eeaa90285 100644 (file)
@@ -436,7 +436,7 @@ do_compile (void)
    It is not safe to call this function more than once.  */
 
 int
-main (unsigned int argc, const char **argv)
+main (int argc, const char **argv)
 {
   /* Initialization of SDCPP's environment.  */
   general_init (argv[0]);
index fa6ae6790c2122741dcdaed05cfe68c47beb90c6..296db1bf0fae9d53479a6a7490cca06abf5fc74d 100644 (file)
@@ -2,6 +2,8 @@
 #define __SDCPP_H
 
 #ifdef _WIN32
+/* declaration of alloca */
+#include <malloc.h>
 #include <string.h>
 #ifdef __BORLANDC__
 #define strcasecmp  stricmp
 #endif
 #define BYTES_BIG_ENDIAN  0
 
-#if defined _MSC_VER || defined __MINGW32__ || defined __BORLANDC__
-/*
- * The following define causes the following warning:
- * warning: `I' flag used with `%x' printf format
- * when copiled with mingw or cygwin -mno-cygwin gcc.
- * This is correct, because the mingw compilation links against msvcrt.dll,
- * which uses "I46" for 64 bit integer (long long) printf lenght modifier,
- * instead of "ll" used by libc.
- */
-#define PRINTF_INT64_MODIFIER "I64"
-typedef __int64 long_long;
-#else
-#define PRINTF_INT64_MODIFIER "ll"
-typedef long long long_long;
-#endif
-
 /*
  * From defaults.h
  */
@@ -107,27 +93,14 @@ extern const struct lang_hooks lang_hooks;
 /*
  * From toplev.h
  */
-/* If we haven't already defined a frontend specific diagnostics
-   style, use the generic one.  */
-#ifndef GCC_DIAG_STYLE
-#define GCC_DIAG_STYLE __gcc_diag__
-#endif
-/* None of these functions are suitable for ATTRIBUTE_PRINTF, because
-   each language front end can extend them with its own set of format
-   specifiers.  We must use custom format checks.  */
-#if GCC_VERSION >= 4001
-#define ATTRIBUTE_GCC_DIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m)
-#else
-#define ATTRIBUTE_GCC_DIAG(m, n) ATTRIBUTE_NONNULL(m)
-#endif
-extern void internal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
+extern void internal_error (const char *, ...) ATTRIBUTE_PRINTF_1
      ATTRIBUTE_NORETURN;
 /* Pass one of the OPT_W* from options.h as the first parameter.  */
-extern void warning (int, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
-extern void error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
-extern void fatal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
+extern void warning (int, const char *, ...) ATTRIBUTE_PRINTF_2;
+extern void error (const char *, ...) ATTRIBUTE_PRINTF_1;
+extern void fatal_error (const char *, ...) ATTRIBUTE_PRINTF_1
      ATTRIBUTE_NORETURN;
-extern void inform (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
+extern void inform (const char *, ...) ATTRIBUTE_PRINTF_1;
 
 extern bool exit_after_options;