* 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>
!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
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)
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:
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
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;
# define TARGET_SYSTEM_ROOT NULL
#endif
-static int saved_lineno;
-
/* CPP's options. */
static cpp_options *cpp_opts;
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;
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]);
#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
*/
/*
* 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;