[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
flymake support in gnulib
From: |
Reuben Thomas |
Subject: |
flymake support in gnulib |
Date: |
Fri, 20 May 2011 22:32:29 +0100 |
I've just been playing with flymake. To make it work at all I copied
the following rule into my src/Makefile.am from the flymake manual:
check-syntax:
gcc -o nul -S ${CHK_SOURCES}
It would be nice to put this in maint.mk, but then it wouldn't be
picked up by make in src/, only at the top-level, which doesn't work
with flymake (by default). Suggestions?
The first error I noticed was that config.h was not found. There are
two obvious ways to fix this. The first is to implement a dumpvars
target, so that flymake-get-project-include-dirs-tmp works. This
appears to be undocumented in the flymake manual, but it just tries to
run:
make DUMPVARS=INCLUDE_DIRS dumpvars
dumpvars:
echo -e $(foreach var, ${DUMPVARS}, "\n$(var)=$($(var))")
seems to produce the required output, but, because it uses a GNU Make
feature, isn't accepted by automake, so has to be in cfg.mk/maint.mk,
and hence isn't available to flymake by default.
The other obvious way to fix this is to beef up check-syntax above to:
check-syntax:
$(COMPILE) -o nul -S ${CHK_SOURCES}
Although that rather relies on the compiler being gcc, perhaps that's
not too worrying for GNU projects.
Two further observations: first, the check-syntax name is both happy
(doesn't clash) and unfortunate (easily confusable with syntax-check).
It would be nice to get things to Just Work as far as possible, so
that an Emacs/flymake/gnulib user doesn't need to configure anything,
hence my search for judicious suggestions.
Secondly, the -o nul option to gcc seems to be an
undocumented-but-widely-used trick to get gcc not to output the
results of the compilation. Any observations on this before I write a
bug report suggesting it be documented? (Generally I find writing gcc
and glibc bug reports without help a waste of time (above my pay
grade, as it were).)
--
http://rrt.sc3d.org
- flymake support in gnulib,
Reuben Thomas <=