From d3c5104ddaa07381355deddb2a6a7f95b0accd22 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 6 May 2011 13:54:32 -0600 Subject: [PATCH] build: rename generated files to .h, for automake's sake In preparation for removing generated files, it is necessary to tell automake that the generated files must be distributed but not directly compiled (since they are included into the body of a larger .c file that is compiled). Hence, even though these files are code and not headers in the strict sense of the word, it is easier to rename them to .h for automake's sake. * daemon/remote_client_bodies.c: Rename to .h. * daemon/qemu_client_bodies.c: Likewise. * src/remote/remote_client_bodies.c: Likewise. * src/remote/qemu_client_bodies.c: Likewise. * daemon/Makefile.am (remote_dispatch_bodies.c) (qemu_dispatch_bodies.c): Rename to .h. (remote.c, EXTRA_DIST): Reflect rename. * daemon/remote.c: Likewise. * daemon/remote_generator.pl: Likewise. * src/Makefile.am (remote/remote_driver.c): Likewise. * src/remote/remote_driver.c: Likewise. * po/POTFILES.in: Likewise. * cfg.mk (exclude_file_name_regexp--sc_require_config_h) (exclude_file_name_regexp--sc_require_config_h_first) (exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF): Likewise. --- cfg.mk | 8 +++----- daemon/Makefile.am | 12 ++++++------ ...qemu_dispatch_bodies.c => qemu_dispatch_bodies.h} | 0 daemon/remote.c | 4 ++-- ...te_dispatch_bodies.c => remote_dispatch_bodies.h} | 0 daemon/remote_generator.pl | 4 ++-- po/POTFILES.in | 4 ++-- src/Makefile.am | 8 ++++---- .../{qemu_client_bodies.c => qemu_client_bodies.h} | 0 ...remote_client_bodies.c => remote_client_bodies.h} | 0 src/remote/remote_driver.c | 4 ++-- 11 files changed, 21 insertions(+), 23 deletions(-) rename daemon/{qemu_dispatch_bodies.c => qemu_dispatch_bodies.h} (100%) rename daemon/{remote_dispatch_bodies.c => remote_dispatch_bodies.h} (100%) rename src/remote/{qemu_client_bodies.c => qemu_client_bodies.h} (100%) rename src/remote/{remote_client_bodies.c => remote_client_bodies.h} (100%) diff --git a/cfg.mk b/cfg.mk index d80f3d50fc..27ed9290ca 100644 --- a/cfg.mk +++ b/cfg.mk @@ -614,7 +614,7 @@ exclude_file_name_regexp--sc_prohibit_close = \ exclude_file_name_regexp--sc_prohibit_doubled_word = ^po/ exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = \ - (^docs/api_extension/|^tests/qemuhelpdata/|\.(gif|ico|png)$$|^daemon/.*_dispatch_bodies\.c$$|^src/remote/.*_client_bodies\.c$$) + (^docs/api_extension/|^tests/qemuhelpdata/|\.(gif|ico|png)$$|^daemon/.*_dispatch_bodies\.h$$|^src/remote/.*_client_bodies\.h$$) _src2=src/(util/util|libvirt|lxc/lxc_controller) exclude_file_name_regexp--sc_prohibit_fork_wrappers = \ @@ -639,11 +639,9 @@ exclude_file_name_regexp--sc_prohibit_strncpy = \ exclude_file_name_regexp--sc_prohibit_xmlGetProp = ^src/util/xml\.c$$ -exclude_file_name_regexp--sc_require_config_h = \ - ^(examples/|daemon/.*_dispatch_bodies\.c$$|src/remote/.*_client_bodies\.c$$) +exclude_file_name_regexp--sc_require_config_h = ^examples/ -exclude_file_name_regexp--sc_require_config_h_first = \ - ^(examples/|daemon/.*_dispatch_bodies\.c$$|src/remote/.*_client_bodies\.c$$) +exclude_file_name_regexp--sc_require_config_h_first = ^examples/ exclude_file_name_regexp--sc_trailing_blank = (^docs/|\.(fig|gif|ico|png)$$) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 3dec183660..c6f4d29096 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -24,8 +24,8 @@ AVAHI_SOURCES = \ DISTCLEANFILES = EXTRA_DIST = \ remote_generator.pl \ - remote_dispatch_bodies.c \ - qemu_dispatch_bodies.c \ + remote_dispatch_bodies.h \ + qemu_dispatch_bodies.h \ libvirtd.conf \ libvirtd.init.in \ libvirtd.upstart \ @@ -206,10 +206,10 @@ endif remote.c: \ remote_dispatch_prototypes.h \ remote_dispatch_table.h \ - remote_dispatch_bodies.c \ + remote_dispatch_bodies.h \ qemu_dispatch_prototypes.h \ qemu_dispatch_table.h \ - qemu_dispatch_bodies.c + qemu_dispatch_bodies.h remote.h: \ remote_dispatch_args.h \ @@ -232,7 +232,7 @@ remote_dispatch_args.h: $(srcdir)/remote_generator.pl $(REMOTE_PROTOCOL) remote_dispatch_ret.h: $(srcdir)/remote_generator.pl $(REMOTE_PROTOCOL) $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -c -r remote $(REMOTE_PROTOCOL) > $@ -remote_dispatch_bodies.c: $(srcdir)/remote_generator.pl $(REMOTE_PROTOCOL) +remote_dispatch_bodies.h: $(srcdir)/remote_generator.pl $(REMOTE_PROTOCOL) $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -c -b remote $(REMOTE_PROTOCOL) > $@ qemu_dispatch_prototypes.h: $(srcdir)/remote_generator.pl $(QEMU_PROTOCOL) @@ -247,7 +247,7 @@ qemu_dispatch_args.h: $(srcdir)/remote_generator.pl $(QEMU_PROTOCOL) qemu_dispatch_ret.h: $(srcdir)/remote_generator.pl $(QEMU_PROTOCOL) $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -r qemu $(QEMU_PROTOCOL) > $@ -qemu_dispatch_bodies.c: $(srcdir)/remote_generator.pl $(QEMU_PROTOCOL) +qemu_dispatch_bodies.h: $(srcdir)/remote_generator.pl $(QEMU_PROTOCOL) $(AM_V_GEN)perl -w $(srcdir)/remote_generator.pl -b qemu $(QEMU_PROTOCOL) > $@ LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \ diff --git a/daemon/qemu_dispatch_bodies.c b/daemon/qemu_dispatch_bodies.h similarity index 100% rename from daemon/qemu_dispatch_bodies.c rename to daemon/qemu_dispatch_bodies.h diff --git a/daemon/remote.c b/daemon/remote.c index 883f18188a..2220655cb0 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -2985,8 +2985,8 @@ cleanup: return rv; } -#include "remote_dispatch_bodies.c" -#include "qemu_dispatch_bodies.c" +#include "remote_dispatch_bodies.h" +#include "qemu_dispatch_bodies.h" /*----- Helpers. -----*/ diff --git a/daemon/remote_dispatch_bodies.c b/daemon/remote_dispatch_bodies.h similarity index 100% rename from daemon/remote_dispatch_bodies.c rename to daemon/remote_dispatch_bodies.h diff --git a/daemon/remote_generator.pl b/daemon/remote_generator.pl index bb1978f44f..062ccc15ce 100755 --- a/daemon/remote_generator.pl +++ b/daemon/remote_generator.pl @@ -236,7 +236,7 @@ elsif ($opt_t) { } } -# Bodies for dispatch functions ("remote_dispatch_bodies.c"). +# Bodies for dispatch functions ("remote_dispatch_bodies.h"). elsif ($opt_b) { # list of functions that currently are not generatable my @ungeneratable; @@ -726,7 +726,7 @@ elsif ($opt_b) { } } -# Bodies for client functions ("remote_client_bodies.c"). +# Bodies for client functions ("remote_client_bodies.h"). elsif ($opt_k) { # list of functions that currently are not generatable my @ungeneratable; diff --git a/po/POTFILES.in b/po/POTFILES.in index 8ecb6a0bed..7f5156c0ca 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -2,7 +2,7 @@ daemon/dispatch.c daemon/libvirtd.c daemon/remote.c daemon/stream.c -daemon/remote_dispatch_bodies.c +daemon/remote_dispatch_bodies.h src/conf/cpu_conf.c src/conf/domain_conf.c src/conf/domain_event.c @@ -64,7 +64,7 @@ src/qemu/qemu_monitor.c src/qemu/qemu_monitor_json.c src/qemu/qemu_monitor_text.c src/qemu/qemu_process.c -src/remote/remote_client_bodies.c +src/remote/remote_client_bodies.h src/remote/remote_driver.c src/secret/secret_driver.c src/security/security_apparmor.c diff --git a/src/Makefile.am b/src/Makefile.am index 8ba176d320..962c6f9349 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -162,19 +162,19 @@ REMOTE_DRIVER_SOURCES = \ remote/qemu_protocol.c \ remote/qemu_protocol.h -remote/remote_driver.c: remote/remote_client_bodies.c remote/qemu_client_bodies.c +remote/remote_driver.c: remote/remote_client_bodies.h remote/qemu_client_bodies.h REMOTE_PROTOCOL = $(top_srcdir)/src/remote/remote_protocol.x QEMU_PROTOCOL = $(top_srcdir)/src/remote/qemu_protocol.x -remote/remote_client_bodies.c: $(top_srcdir)/daemon/remote_generator.pl $(REMOTE_PROTOCOL) +remote/remote_client_bodies.h: $(top_srcdir)/daemon/remote_generator.pl $(REMOTE_PROTOCOL) $(AM_V_GEN)perl -w $(top_srcdir)/daemon/remote_generator.pl -c -k remote $(REMOTE_PROTOCOL) > $@ -remote/qemu_client_bodies.c: $(top_srcdir)/daemon/remote_generator.pl $(QEMU_PROTOCOL) +remote/qemu_client_bodies.h: $(top_srcdir)/daemon/remote_generator.pl $(QEMU_PROTOCOL) $(AM_V_GEN)perl -w $(top_srcdir)/daemon/remote_generator.pl -k remote $(QEMU_PROTOCOL) > $@ EXTRA_DIST += remote/remote_protocol.x remote/qemu_protocol.x \ - remote/rpcgen_fix.pl remote/remote_client_bodies.c remote/qemu_client_bodies.c + remote/rpcgen_fix.pl remote/remote_client_bodies.h remote/qemu_client_bodies.h # Ensure that we don't change the struct or member names or member ordering # in remote_protocol.x The embedded perl below needs a few comments, and diff --git a/src/remote/qemu_client_bodies.c b/src/remote/qemu_client_bodies.h similarity index 100% rename from src/remote/qemu_client_bodies.c rename to src/remote/qemu_client_bodies.h diff --git a/src/remote/remote_client_bodies.c b/src/remote/remote_client_bodies.h similarity index 100% rename from src/remote/remote_client_bodies.c rename to src/remote/remote_client_bodies.h diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 4dfeab6d1d..d076a90087 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -4962,8 +4962,8 @@ done: return rv; } -#include "remote_client_bodies.c" -#include "qemu_client_bodies.c" +#include "remote_client_bodies.h" +#include "qemu_client_bodies.h" /*----------------------------------------------------------------------*/ -- 2.39.5