Commit c875e908 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Generate builtin_vcl.c instead of builtin_vcl.h to avoid a not

fully understood circular-ish make distcheck dependency problem.
parent 3a504de0
...@@ -109,8 +109,10 @@ varnishd_SOURCES = \ ...@@ -109,8 +109,10 @@ varnishd_SOURCES = \
waiter/cache_waiter_poll.c \ waiter/cache_waiter_poll.c \
waiter/cache_waiter_ports.c waiter/cache_waiter_ports.c
nodist_varnishd_SOURCES = \
builtin_vcl.c
noinst_HEADERS = \ noinst_HEADERS = \
builtin_vcl.h \
cache/cache_ban.h \ cache/cache_ban.h \
cache/cache_esi.h \ cache/cache_esi.h \
cache/cache_obj.h \ cache/cache_obj.h \
...@@ -187,17 +189,20 @@ TESTS = vhp_table_test vhp_decode_test ...@@ -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. # 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 '/*' > $@
echo ' * NB: This file is machine generated, DO NOT EDIT!' >> $@ echo ' * NB: This file is machine generated, DO NOT EDIT!' >> $@
echo ' *' >> $@ echo ' *' >> $@
echo ' * Edit builtin.vcl instead and run make' >> $@ echo ' * Edit builtin.vcl instead and run make' >> $@
echo ' *' >> $@ echo ' *' >> $@
echo ' */' >> $@ echo ' */' >> $@
echo '#include "mgt/mgt.h"' >> $@
echo '' >> $@ echo '' >> $@
echo 'const char * const builtin_vcl =' >> $@
sed -e 's/"/\\"/g' \ sed -e 's/"/\\"/g' \
-e 's/$$/\\n"/' \ -e 's/$$/\\n"/' \
-e 's/^/ "/' $(srcdir)/builtin.vcl >> $@ -e 's/^/ "/' $(srcdir)/builtin.vcl >> $@
echo ';' >> $@
EXTRA_DIST = builtin.vcl EXTRA_DIST = builtin.vcl
...@@ -205,10 +210,8 @@ vhp_hufdec.h: vhp_gen_hufdec ...@@ -205,10 +210,8 @@ vhp_hufdec.h: vhp_gen_hufdec
$(AM_V_GEN) ./vhp_gen_hufdec > vhp_hufdec.h_ $(AM_V_GEN) ./vhp_gen_hufdec > vhp_hufdec.h_
mv vhp_hufdec.h_ vhp_hufdec.h mv vhp_hufdec.h_ vhp_hufdec.h
DISTCLEANFILES = builtin_vcl.h DISTCLEANFILES = builtin_vcl.c
BUILT_SOURCES = vhp_hufdec.h BUILT_SOURCES = vhp_hufdec.h
DISTCLEANFILES += vhp_hufdec.h DISTCLEANFILES += vhp_hufdec.h
# Explicitly record dependency
mgt/mgt_vcc.c: builtin_vcl.h
...@@ -47,6 +47,10 @@ extern struct vev_base *mgt_evb; ...@@ -47,6 +47,10 @@ extern struct vev_base *mgt_evb;
extern unsigned d_flag; extern unsigned d_flag;
extern int exit_status; extern int exit_status;
/* builtin_vcl.c */
extern const char * const builtin_vcl;
/* mgt_acceptor.c */ /* mgt_acceptor.c */
void MAC_Arg(const char *); void MAC_Arg(const char *);
......
...@@ -71,10 +71,6 @@ unsigned mgt_vcc_unsafe_path; ...@@ -71,10 +71,6 @@ unsigned mgt_vcc_unsafe_path;
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
static const char * const builtin_vcl =
#include "builtin_vcl.h"
"" ;
void void
mgt_DumpBuiltin(void) mgt_DumpBuiltin(void)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment