"Daniel P. Berrange" <berrange(a)redhat.com> wrote:
...
> diff --git a/qemud/Makefile.am b/qemud/Makefile.am
> index b8dae88..28fd84a 100644
> --- a/qemud/Makefile.am
> +++ b/qemud/Makefile.am
> @@ -33,11 +33,16 @@ EXTRA_DIST = \
>
> if RPCGEN
> SUFFIXES = .x
> +# The perl -ne subshell ensures that remote_protocol.c ends up
> +# including <config.h> before "remote_protocol.h".
> .x.c:
> - rm -f $@ $@-t $@-t2
> + rm -f $@ $@-t $@-t1 $@-t2
> rpcgen -c -o $@-t $<
> + (echo '#include <config.h>'; \
> + perl -ne '/^#include <config.h>/ or print' $@-t) > $@-t1
> if GLIBC_RPCGEN
> - perl -w rpcgen_fix.pl $@-t > $@-t2
> + perl -w rpcgen_fix.pl $@-t1 > $@-t2
> + rm $@-t1
> chmod 444 $@-t2
> mv $@-t2 $@
> endif
...
Rather than filtering out the bogus 'config.h' from
remote_protocol.c
in the Makefile.am rule, just kill this line from the original protocol
definition:
%#include <config.h>
Then the bogus placed include wouldn't be added in the first place.
Good idea.
Committed with that change, which induced the removal of
#include <config.h> from remote_protocol.h, too.
But that's fine, because that .h file never needed it in the first place.