mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-11 14:11:31 +00:00
enforce the "include <config.h> first" rule
* qemud/Makefile.am: Ensure that the generated remote_protocol.c includes <config.h> first. * Makefile.maint (sc_require_config_h_first): New rule, so that "make syntax-check" enforces this. * .x-sc_require_config_h_first: New file. * Makefile.am (.x-sc_require_config_h_first): Add it. * qemud/remote_protocol.x: Don't include <config.h> here. * qemud/remote_protocol.c: Regenerate.
This commit is contained in:
parent
e4c7e12300
commit
4cea12bb69
2
.x-sc_require_config_h_first
Normal file
2
.x-sc_require_config_h_first
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
^docs/examples/info1\.c$
|
||||||
|
^docs/examples/suspend\.c$
|
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
|||||||
|
Wed Dec 17 18:10:51 +0100 2008 Jim Meyering <meyering@redhat.com>
|
||||||
|
|
||||||
|
enforce the "include <config.h> first" rule
|
||||||
|
* qemud/Makefile.am: Ensure that the generated remote_protocol.c
|
||||||
|
includes <config.h> first.
|
||||||
|
* Makefile.maint (sc_require_config_h_first): New rule, so that
|
||||||
|
"make syntax-check" enforces this.
|
||||||
|
* .x-sc_require_config_h_first: New file.
|
||||||
|
* Makefile.am (.x-sc_require_config_h_first): Add it.
|
||||||
|
* qemud/remote_protocol.x: Don't include <config.h> here.
|
||||||
|
* qemud/remote_protocol.c: Regenerate.
|
||||||
|
|
||||||
Wed Dec 17 18:10:51 +0100 2008 Jim Meyering <meyering@redhat.com>
|
Wed Dec 17 18:10:51 +0100 2008 Jim Meyering <meyering@redhat.com>
|
||||||
|
|
||||||
let gcc's -Wformat do its job; avoid "make syntax-check" failure
|
let gcc's -Wformat do its job; avoid "make syntax-check" failure
|
||||||
|
@ -14,6 +14,7 @@ EXTRA_DIST = \
|
|||||||
libvirt.pc libvirt.pc.in \
|
libvirt.pc libvirt.pc.in \
|
||||||
$(man_MANS) autobuild.sh \
|
$(man_MANS) autobuild.sh \
|
||||||
.x-sc_avoid_if_before_free \
|
.x-sc_avoid_if_before_free \
|
||||||
|
.x-sc_require_config_h_first \
|
||||||
.x-sc_prohibit_strcmp \
|
.x-sc_prohibit_strcmp \
|
||||||
.x-sc_require_config_h \
|
.x-sc_require_config_h \
|
||||||
autogen.sh
|
autogen.sh
|
||||||
|
@ -135,6 +135,21 @@ sc_require_config_h:
|
|||||||
else :; \
|
else :; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# You must include <config.h> before including any other header file.
|
||||||
|
sc_require_config_h_first:
|
||||||
|
@if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||||
|
fail=0; \
|
||||||
|
for i in $$($(VC_LIST_EXCEPT) | grep '\.c$$'); do \
|
||||||
|
grep '^# *include\>' $$i | sed 1q \
|
||||||
|
| grep '^# *include <config\.h>' > /dev/null \
|
||||||
|
|| { echo $$i; fail=1; }; \
|
||||||
|
done; \
|
||||||
|
test $$fail = 1 && \
|
||||||
|
{ echo '$(ME): the above files include some other header' \
|
||||||
|
'before <config.h>' 1>&2; exit 1; } || :; \
|
||||||
|
else :; \
|
||||||
|
fi
|
||||||
|
|
||||||
# To use this "command" macro, you must first define two shell variables:
|
# To use this "command" macro, you must first define two shell variables:
|
||||||
# h: the header, enclosed in <> or ""
|
# h: the header, enclosed in <> or ""
|
||||||
# re: a regular expression that matches IFF something provided by $h is used.
|
# re: a regular expression that matches IFF something provided by $h is used.
|
||||||
|
@ -33,11 +33,15 @@ EXTRA_DIST = \
|
|||||||
|
|
||||||
if RPCGEN
|
if RPCGEN
|
||||||
SUFFIXES = .x
|
SUFFIXES = .x
|
||||||
|
# The subshell ensures that remote_protocol.c ends up
|
||||||
|
# including <config.h> before "remote_protocol.h".
|
||||||
.x.c:
|
.x.c:
|
||||||
rm -f $@ $@-t $@-t2
|
rm -f $@ $@-t $@-t1 $@-t2
|
||||||
rpcgen -c -o $@-t $<
|
rpcgen -c -o $@-t $<
|
||||||
|
(echo '#include <config.h>'; cat $@-t) > $@-t1
|
||||||
if GLIBC_RPCGEN
|
if GLIBC_RPCGEN
|
||||||
perl -w rpcgen_fix.pl $@-t > $@-t2
|
perl -w rpcgen_fix.pl $@-t1 > $@-t2
|
||||||
|
rm $@-t1
|
||||||
chmod 444 $@-t2
|
chmod 444 $@-t2
|
||||||
mv $@-t2 $@
|
mv $@-t2 $@
|
||||||
endif
|
endif
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
|
#include <config.h>
|
||||||
/*
|
/*
|
||||||
* Please do not edit this file.
|
* Please do not edit this file.
|
||||||
* It was generated using rpcgen.
|
* It was generated using rpcgen.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "remote_protocol.h"
|
#include "remote_protocol.h"
|
||||||
#include <config.h>
|
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#define REMOTE_MESSAGE_MAX 262144
|
#define REMOTE_MESSAGE_MAX 262144
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
* 'REMOTE_'. This makes names quite long.
|
* 'REMOTE_'. This makes names quite long.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
%#include <config.h>
|
|
||||||
%#include "internal.h"
|
%#include "internal.h"
|
||||||
%#include <arpa/inet.h>
|
%#include <arpa/inet.h>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user