[master] c875e90 Generate builtin_vcl.c instead of builtin_vcl.h to avoid a not fully understood circular-ish make distcheck dependency problem.
Poul-Henning Kamp
phk at FreeBSD.org
Tue May 23 01:44:05 CEST 2017
commit c875e9089fa2f3ed19df4870ae0f5d3db516f217
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon May 22 23:42:39 2017 +0000
Generate builtin_vcl.c instead of builtin_vcl.h to avoid a not
fully understood circular-ish make distcheck dependency problem.
diff --git a/bin/varnishd/Makefile.am b/bin/varnishd/Makefile.am
index 844b158..f548ab6 100644
--- a/bin/varnishd/Makefile.am
+++ b/bin/varnishd/Makefile.am
@@ -109,8 +109,10 @@ varnishd_SOURCES = \
waiter/cache_waiter_poll.c \
waiter/cache_waiter_ports.c
+nodist_varnishd_SOURCES = \
+ builtin_vcl.c
+
noinst_HEADERS = \
- builtin_vcl.h \
cache/cache_ban.h \
cache/cache_esi.h \
cache/cache_obj.h \
@@ -187,17 +189,20 @@ TESTS = vhp_table_test vhp_decode_test
#
# Turn the builtin.vcl file into a C-string we can include in the program.
#
-builtin_vcl.h: builtin.vcl
+builtin_vcl.c: builtin.vcl
echo '/*' > $@
echo ' * NB: This file is machine generated, DO NOT EDIT!' >> $@
echo ' *' >> $@
echo ' * Edit builtin.vcl instead and run make' >> $@
echo ' *' >> $@
echo ' */' >> $@
+ echo '#include "mgt/mgt.h"' >> $@
echo '' >> $@
+ echo 'const char * const builtin_vcl =' >> $@
sed -e 's/"/\\"/g' \
-e 's/$$/\\n"/' \
-e 's/^/ "/' $(srcdir)/builtin.vcl >> $@
+ echo ';' >> $@
EXTRA_DIST = builtin.vcl
@@ -205,10 +210,8 @@ vhp_hufdec.h: vhp_gen_hufdec
$(AM_V_GEN) ./vhp_gen_hufdec > vhp_hufdec.h_
mv vhp_hufdec.h_ vhp_hufdec.h
-DISTCLEANFILES = builtin_vcl.h
+DISTCLEANFILES = builtin_vcl.c
BUILT_SOURCES = vhp_hufdec.h
DISTCLEANFILES += vhp_hufdec.h
-# Explicitly record dependency
-mgt/mgt_vcc.c: builtin_vcl.h
diff --git a/bin/varnishd/mgt/mgt.h b/bin/varnishd/mgt/mgt.h
index f38ddd6..3f8ff11 100644
--- a/bin/varnishd/mgt/mgt.h
+++ b/bin/varnishd/mgt/mgt.h
@@ -47,6 +47,10 @@ extern struct vev_base *mgt_evb;
extern unsigned d_flag;
extern int exit_status;
+/* builtin_vcl.c */
+
+extern const char * const builtin_vcl;
+
/* mgt_acceptor.c */
void MAC_Arg(const char *);
diff --git a/bin/varnishd/mgt/mgt_vcc.c b/bin/varnishd/mgt/mgt_vcc.c
index 00f1e6f..83887c2 100644
--- a/bin/varnishd/mgt/mgt_vcc.c
+++ b/bin/varnishd/mgt/mgt_vcc.c
@@ -71,10 +71,6 @@ unsigned mgt_vcc_unsafe_path;
/*--------------------------------------------------------------------*/
-static const char * const builtin_vcl =
-#include "builtin_vcl.h"
- "" ;
-
void
mgt_DumpBuiltin(void)
{
More information about the varnish-commit
mailing list