[m-rev.] for review: user-defined events
Julien Fischer
juliensf at csse.unimelb.edu.au
Mon Nov 20 17:03:36 AEDT 2006
On Mon, 20 Nov 2006, Zoltan Somogyi wrote:
> Index: trace/Mmakefile
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/trace/Mmakefile,v
> retrieving revision 1.46
> diff -u -b -r1.46 Mmakefile
> --- trace/Mmakefile 15 Nov 2006 08:24:43 -0000 1.46
> +++ trace/Mmakefile 19 Nov 2006 02:22:20 -0000
> @@ -9,8 +9,9 @@
>
> #-----------------------------------------------------------------------------#
>
> -# keep this list in alphabetical order, please
> -HDRS = \
> +# The list of human-written C header files of the trace library.
> +# Keep this list in alphabetical order, please.
> +HAND_TRACE_HDRS = \
> mercury_trace_alias.h \
> mercury_trace_browse.h \
> mercury_trace_cmd_backward.h \
> @@ -39,8 +40,9 @@
> mercury_trace_util.h \
> mercury_trace_vars.h
>
> -# keep this list in alphabetical order, please
> -CFILES = \
> +# The list of human-written C source files of the trace library.
> +# Keep this list in alphabetical order, please.
> +HAND_TRACE_SRCS = \
> mercury_trace_alias.c \
> mercury_trace_browse.c \
> mercury_trace.c \
> @@ -69,6 +71,39 @@
> mercury_trace_util.c \
> mercury_trace_vars.c
>
> +# The list of human-written C header files of the eventspec library.
> +# Keep this list in alphabetical order, please.
> +HAND_EVENTSPEC_HDRS = \
> + mercury_event_spec.h
> +
> +# The list of human-written C source files of the eventspec library.
> +# Keep this list in alphabetical order, please.
> +HAND_EVENTSPEC_SRCS = \
> + mercury_event_spec.c
> +
> +# The list of automatically created C header files.
> +# Keep this list in alphabetical order, please.
> +GEN_EVENTSPEC_HDRS = \
> + mercury_event_parser.h
> +
> +# The list of automatically created C source files.
> +# Keep this list in alphabetical order, please.
> +GEN_EVENTSPEC_SRCS = \
> + mercury_event_parser.c \
> + mercury_event_scanner.c
> +
> +TRACE_HDRS = $(HAND_TRACE_HDRS)
> +TRACE_SRCS = $(HAND_TRACE_SRCS)
> +
> +EVENTSPEC_HDRS = $(HAND_EVENTSPEC_HDRS) $(GEN_EVENTSPEC_HDRS)
> +EVENTSPEC_SRCS = $(HAND_EVENTSPEC_SRCS) $(GEN_EVENTSPEC_SRCS)
> +
> +HAND_HDRS = $(HAND_TRACE_HDRS) $(HAND_EVENTSPEC_HDRS)
> +HAND_SRCS = $(HAND_TRACE_SRCS) $(HAND_EVENTSPEC_SRCS)
> +
> +HDRS = $(TRACE_HDRS) $(EVENTSPEC_HDRS)
> +SRCS = $(TRACE_SRCS) $(EVENTSPEC_SRCS)
> +
> # The object files in this directory depend on many of the header files
> # in the runtime. However, changes to many of these header files require
> # a global make clean. Here we list only the header files from the runtime
> @@ -77,14 +112,22 @@
> RUNTIME_HDRS = \
> $(RUNTIME_DIR)/mercury_stack_layout.h
>
> -OBJS = $(CFILES:.c=.$O)
> -PIC_OBJS = $(CFILES:.c=.$(EXT_FOR_PIC_OBJECTS))
> +TRACE_OBJS = $(TRACE_SRCS:.c=.$O)
> +EVENTSPEC_OBJS = $(EVENTSPEC_SRCS:.c=.$O)
> +OBJS = $(SRCS:.c=.$O)
> +TRACE_PIC_OBJS = $(TRACE_SRCS:.c=.$(EXT_FOR_PIC_OBJECTS))
> +EVENTSPEC_PIC_OBJS = $(EVENTSPEC_SRCS:.c=.$(EXT_FOR_PIC_OBJECTS))
> +PIC_OBJS = $(SRCS:.c=.$(EXT_FOR_PIC_OBJECTS))
>
> -LDFLAGS = -L$(BROWSER_DIR) -L$(MDBCOMP_DIR) -L$(LIBRARY_DIR) \
> +EVENTSPEC_LDFLAGS = -L$(BROWSER_DIR) -L$(MDBCOMP_DIR) -L$(LIBRARY_DIR) \
> -L$(RUNTIME_DIR) -L$(BOEHM_GC_DIR) -L/usr/local/lib
> -LDLIBS = -l$(BROWSER_LIB_NAME) -l$(MDBCOMP_LIB_NAME) \
> +EVENTSPEC_LDLIBS= -l$(BROWSER_LIB_NAME) -l$(MDBCOMP_LIB_NAME) \
> $(MLLIBS) $(SOCKET_LIBRARY) \
> $(NSL_LIBRARY) $(DL_LIBRARY) $(READLINE_LIBRARIES)
> +
> +TRACE_LDFLAGS = -L$(TRACE_DIR) $(EVENTSPEC_LDFLAGS)
> +TRACE_LDLIBS = -l$(EVENTSPEC_LIB_NAME) $(EVENTSPEC_LDLIBS)
> +
> THREADLIBS = \
> ` case "$(GRADE)" in \
> *.par*) echo "-lpthread" ;; \
> @@ -94,14 +137,23 @@
>
> # Specify which files to check for namespace cleanliness, and which name
> # prefixes are allowed.
> +#
> +# The header files generated by flex and bison cannot pass any kind of
> +# namespace cleanliness test, and we don't have enough control over them
> +# to make them pass those tests.
>
> -CHECK_HDRS = $(HDRS)
> +CHECK_HDRS = $(HAND_HDRS)
> CHECK_MHDRS =
> CHECK_OBJS = $(OBJS)
> ALLOW_LIB_PREFIX=no
> ALLOW_BROWSER_PREFIX=no
> ALLOW_MDBCOMP_PREFIX=no
>
> +BISON = bison
> +BISON_OPTS = -v
> +FLEX = flex
> +FLEX_OPTS = --8bit
Rather than just assuming the existence of bison and yacc the configure
script should be modified to check, e.g. using the AC_PROG_LEX and
AC_PROG_YACC macros. It should also print out an error message if
it cannot find them since it will be possible to get a good way through
the installation process before noticing that they are not installed.
Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list