Commit 6bf7a9ed authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

De-boilerplate the "normal" vmods in the tree.

There are undoubtedly better ways, but I couldn't find them...
parent 7f7be284
......@@ -46,6 +46,49 @@ import random
rstfmt = False
strict_abi = True
AMBOILERPLATE='''
# Boilerplate generated by vmodtool.py - changes will be overwritten
AM_LDFLAGS = $(AM_LT_LDFLAGS)
AM_CPPFLAGS = \\
-I$(top_srcdir)/include \\
-I$(top_srcdir)/bin/varnishd \\
-I$(top_builddir)/include
vmoddir = $(pkglibdir)/vmods
vmodtool = $(top_srcdir)/lib/libvcc/vmodtool.py
vmodtoolargs = --strict --boilerplate
vmod_LTLIBRARIES = libvmod_XXX.la
libvmod_XXX_la_CFLAGS = \\
@SAN_CFLAGS@
libvmod_XXX_la_LDFLAGS = \\
$(AM_LDFLAGS) \\
$(VMOD_LDFLAGS) \\
@SAN_LDFLAGS@
nodist_libvmod_XXX_la_SOURCES = vcc_if.c vcc_if.h
# BUILT_SOURCES is only a hack
# and dependency tracking does not help for the first build
$(libvmod_XXX_la_OBJECTS): vcc_if.h
vcc_if.h vmod_XXX.rst vmod_XXX.man.rst: vcc_if.c
vcc_if.c: $(vmodtool) $(srcdir)/vmod.vcc
@PYTHON@ $(vmodtool) $(vmodtoolargs) $(srcdir)/vmod.vcc
EXTRA_DIST = vmod.vcc automake_boilerplate.am
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \\
$(builddir)/vmod_XXX.rst \\
$(builddir)/vmod_XXX.man.rst
'''
ctypes = {
'ACL': "VCL_ACL",
'BACKEND': "VCL_BACKEND",
......@@ -701,6 +744,13 @@ class vcc(object):
fo.close()
def amboilerplate(self):
fn = "automake_boilerplate.am"
self.commit_files.append(fn)
fo = open(fn + ".tmp", "w")
fo.write(AMBOILERPLATE.replace("XXX", self.modname))
fo.close()
def hfile(self):
fn = self.pfx + ".h"
self.commit_files.append(fn)
......@@ -831,6 +881,8 @@ def runmain(inputvcc, rstdir, outputprefix):
v.rstfile(man=True)
v.hfile()
v.cfile()
if opts.boilerplate:
v.amboilerplate()
v.commit()
......@@ -838,6 +890,9 @@ if __name__ == "__main__":
usagetext = "Usage: %prog [options] <vmod.vcc>"
oparser = optparse.OptionParser(usage=usagetext)
oparser.add_option('-b', '--boilerplate', action='store_true',
default=False,
help="Be strict when parsing the input file")
oparser.add_option('-N', '--strict', action='store_true', default=False,
help="Be strict when parsing the input file")
oparser.add_option('-o', '--output', metavar="prefix", default='vcc_if',
......
......@@ -16,48 +16,5 @@ libvmod_blob_la_SOURCES = \
base64.o: base64.c base64.h
# Boilerplate, do not change
AM_LDFLAGS = $(AM_LT_LDFLAGS)
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/bin/varnishd \
-I$(top_builddir)/include
vmoddir = $(pkglibdir)/vmods
vmod_srcdir = $(top_srcdir)/lib/libvmod_blob
vmodtool = $(top_srcdir)/lib/libvcc/vmodtool.py
vmodtoolargs = --strict
vmod_LTLIBRARIES = libvmod_blob.la
libvmod_blob_la_CFLAGS = \
@SAN_CFLAGS@
libvmod_blob_la_LDFLAGS = \
$(AM_LDFLAGS) \
-module \
-export-dynamic \
-avoid-version \
-shared \
-rpath /nowhere \
@SAN_LDFLAGS@
nodist_libvmod_blob_la_SOURCES = \
vcc_if.c \
vcc_if.h
# BUILT_SOURCES is only a hack and dependency tracking does not help for the first build
$(libvmod_blob_la_OBJECTS): vcc_if.h
vcc_if.h vmod_blob.rst vmod_blob.man.rst: vcc_if.c
vcc_if.c: $(vmodtool) $(vmod_srcdir)/vmod.vcc
@PYTHON@ $(vmodtool) $(vmodtoolargs) $(vmod_srcdir)/vmod.vcc
EXTRA_DIST = vmod.vcc
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_blob.rst \
$(builddir)/vmod_blob.man.rst
# Use vmodtool.py generated automake boilerplate
include $(srcdir)/automake_boilerplate.am
# Boilerplate generated by vmodtool.py - changes will be overwritten
AM_LDFLAGS = $(AM_LT_LDFLAGS)
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/bin/varnishd \
-I$(top_builddir)/include
vmoddir = $(pkglibdir)/vmods
vmodtool = $(top_srcdir)/lib/libvcc/vmodtool.py
vmodtoolargs = --strict --boilerplate
vmod_LTLIBRARIES = libvmod_blob.la
libvmod_blob_la_CFLAGS = \
@SAN_CFLAGS@
libvmod_blob_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(VMOD_LDFLAGS) \
@SAN_LDFLAGS@
nodist_libvmod_blob_la_SOURCES = vcc_if.c vcc_if.h
# BUILT_SOURCES is only a hack
# and dependency tracking does not help for the first build
$(libvmod_blob_la_OBJECTS): vcc_if.h
vcc_if.h vmod_blob.rst vmod_blob.man.rst: vcc_if.c
vcc_if.c: $(vmodtool) $(srcdir)/vmod.vcc
@PYTHON@ $(vmodtool) $(vmodtoolargs) $(srcdir)/vmod.vcc
EXTRA_DIST = vmod.vcc automake_boilerplate.am
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_blob.rst \
$(builddir)/vmod_blob.man.rst
......@@ -17,48 +17,5 @@ libvmod_directors_la_SOURCES = \
shard_parse_vcc_enums.h \
shard_parse_vcc_enums.c
# Boilerplate, do not change
AM_LDFLAGS = $(AM_LT_LDFLAGS)
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/bin/varnishd \
-I$(top_builddir)/include
vmoddir = $(pkglibdir)/vmods
vmod_srcdir = $(top_srcdir)/lib/libvmod_directors
vmodtool = $(top_srcdir)/lib/libvcc/vmodtool.py
vmodtoolargs = --strict
vmod_LTLIBRARIES = libvmod_directors.la
libvmod_directors_la_CFLAGS = \
@SAN_CFLAGS@
libvmod_directors_la_LDFLAGS = \
$(AM_LDFLAGS) \
-module \
-export-dynamic \
-avoid-version \
-shared \
-rpath /nowhere \
@SAN_LDFLAGS@
nodist_libvmod_directors_la_SOURCES = \
vcc_if.c \
vcc_if.h
# BUILT_SOURCES is only a hack and dependency tracking does not help for the first build
$(libvmod_directors_la_OBJECTS): vcc_if.h
vcc_if.h vmod_directors.rst vmod_directors.man.rst: vcc_if.c
vcc_if.c: $(vmodtool) $(vmod_srcdir)/vmod.vcc
@PYTHON@ $(vmodtool) $(vmodtoolargs) $(vmod_srcdir)/vmod.vcc
EXTRA_DIST = vmod.vcc
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_directors.rst \
$(builddir)/vmod_directors.man.rst
# Use vmodtool.py generated automake boilerplate
include $(srcdir)/automake_boilerplate.am
# Boilerplate generated by vmodtool.py - changes will be overwritten
AM_LDFLAGS = $(AM_LT_LDFLAGS)
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/bin/varnishd \
-I$(top_builddir)/include
vmoddir = $(pkglibdir)/vmods
vmodtool = $(top_srcdir)/lib/libvcc/vmodtool.py
vmodtoolargs = --strict --boilerplate
vmod_LTLIBRARIES = libvmod_directors.la
libvmod_directors_la_CFLAGS = \
@SAN_CFLAGS@
libvmod_directors_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(VMOD_LDFLAGS) \
@SAN_LDFLAGS@
nodist_libvmod_directors_la_SOURCES = vcc_if.c vcc_if.h
# BUILT_SOURCES is only a hack
# and dependency tracking does not help for the first build
$(libvmod_directors_la_OBJECTS): vcc_if.h
vcc_if.h vmod_directors.rst vmod_directors.man.rst: vcc_if.c
vcc_if.c: $(vmodtool) $(srcdir)/vmod.vcc
@PYTHON@ $(vmodtool) $(vmodtoolargs) $(srcdir)/vmod.vcc
EXTRA_DIST = vmod.vcc automake_boilerplate.am
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_directors.rst \
$(builddir)/vmod_directors.man.rst
......@@ -3,48 +3,5 @@
libvmod_purge_la_SOURCES = \
vmod_purge.c
# Boilerplate, do not change
AM_LDFLAGS = $(AM_LT_LDFLAGS)
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/bin/varnishd \
-I$(top_builddir)/include
vmoddir = $(pkglibdir)/vmods
vmod_srcdir = $(top_srcdir)/lib/libvmod_purge
vmodtool = $(top_srcdir)/lib/libvcc/vmodtool.py
vmodtoolargs = --strict
vmod_LTLIBRARIES = libvmod_purge.la
libvmod_purge_la_CFLAGS = \
@SAN_CFLAGS@
libvmod_purge_la_LDFLAGS = \
$(AM_LDFLAGS) \
-module \
-export-dynamic \
-avoid-version \
-shared \
-rpath /nowhere \
@SAN_LDFLAGS@
nodist_libvmod_purge_la_SOURCES = \
vcc_if.c \
vcc_if.h
# BUILT_SOURCES is only a hack and dependency tracking does not help for the first build
$(libvmod_purge_la_OBJECTS): vcc_if.h
vcc_if.h vmod_purge.rst vmod_purge.man.rst: vcc_if.c
vcc_if.c: $(vmodtool) $(vmod_srcdir)/vmod.vcc
@PYTHON@ $(vmodtool) $(vmodtoolargs) $(vmod_srcdir)/vmod.vcc
EXTRA_DIST = vmod.vcc
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_purge.rst \
$(builddir)/vmod_purge.man.rst
# Use vmodtool.py generated automake boilerplate
include $(srcdir)/automake_boilerplate.am
# Boilerplate generated by vmodtool.py - changes will be overwritten
AM_LDFLAGS = $(AM_LT_LDFLAGS)
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/bin/varnishd \
-I$(top_builddir)/include
vmoddir = $(pkglibdir)/vmods
vmodtool = $(top_srcdir)/lib/libvcc/vmodtool.py
vmodtoolargs = --strict --boilerplate
vmod_LTLIBRARIES = libvmod_purge.la
libvmod_purge_la_CFLAGS = \
@SAN_CFLAGS@
libvmod_purge_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(VMOD_LDFLAGS) \
@SAN_LDFLAGS@
nodist_libvmod_purge_la_SOURCES = vcc_if.c vcc_if.h
# BUILT_SOURCES is only a hack
# and dependency tracking does not help for the first build
$(libvmod_purge_la_OBJECTS): vcc_if.h
vcc_if.h vmod_purge.rst vmod_purge.man.rst: vcc_if.c
vcc_if.c: $(vmodtool) $(srcdir)/vmod.vcc
@PYTHON@ $(vmodtool) $(vmodtoolargs) $(srcdir)/vmod.vcc
EXTRA_DIST = vmod.vcc automake_boilerplate.am
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_purge.rst \
$(builddir)/vmod_purge.man.rst
......@@ -6,48 +6,5 @@ libvmod_std_la_SOURCES = \
vmod_std_fileread.c \
vmod_std_querysort.c
# Boilerplate, do not change
AM_LDFLAGS = $(AM_LT_LDFLAGS)
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/bin/varnishd \
-I$(top_builddir)/include
vmoddir = $(pkglibdir)/vmods
vmod_srcdir = $(top_srcdir)/lib/libvmod_std
vmodtool = $(top_srcdir)/lib/libvcc/vmodtool.py
vmodtoolargs = --strict
vmod_LTLIBRARIES = libvmod_std.la
libvmod_std_la_CFLAGS = \
@SAN_CFLAGS@
libvmod_std_la_LDFLAGS = \
$(AM_LDFLAGS) \
-module \
-export-dynamic \
-avoid-version \
-shared \
-rpath /nowhere \
@SAN_LDFLAGS@
nodist_libvmod_std_la_SOURCES = \
vcc_if.c \
vcc_if.h
# BUILT_SOURCES is only a hack and dependency tracking does not help for the first build
$(libvmod_std_la_OBJECTS): vcc_if.h
vcc_if.h vmod_std.rst vmod_std.man.rst: vcc_if.c
vcc_if.c: $(vmodtool) $(vmod_srcdir)/vmod.vcc
@PYTHON@ $(vmodtool) $(vmodtoolargs) $(vmod_srcdir)/vmod.vcc
EXTRA_DIST = vmod.vcc
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_std.rst \
$(builddir)/vmod_std.man.rst
# Use vmodtool.py generated automake boilerplate
include $(srcdir)/automake_boilerplate.am
# Boilerplate generated by vmodtool.py - changes will be overwritten
AM_LDFLAGS = $(AM_LT_LDFLAGS)
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/bin/varnishd \
-I$(top_builddir)/include
vmoddir = $(pkglibdir)/vmods
vmodtool = $(top_srcdir)/lib/libvcc/vmodtool.py
vmodtoolargs = --strict --boilerplate
vmod_LTLIBRARIES = libvmod_std.la
libvmod_std_la_CFLAGS = \
@SAN_CFLAGS@
libvmod_std_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(VMOD_LDFLAGS) \
@SAN_LDFLAGS@
nodist_libvmod_std_la_SOURCES = vcc_if.c vcc_if.h
# BUILT_SOURCES is only a hack
# and dependency tracking does not help for the first build
$(libvmod_std_la_OBJECTS): vcc_if.h
vcc_if.h vmod_std.rst vmod_std.man.rst: vcc_if.c
vcc_if.c: $(vmodtool) $(srcdir)/vmod.vcc
@PYTHON@ $(vmodtool) $(vmodtoolargs) $(srcdir)/vmod.vcc
EXTRA_DIST = vmod.vcc automake_boilerplate.am
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_std.rst \
$(builddir)/vmod_std.man.rst
......@@ -3,48 +3,5 @@
libvmod_vtc_la_SOURCES = \
vmod_vtc.c
# Boilerplate, do not change
AM_LDFLAGS = $(AM_LT_LDFLAGS)
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/bin/varnishd \
-I$(top_builddir)/include
vmoddir = $(pkglibdir)/vmods
vmod_srcdir = $(top_srcdir)/lib/libvmod_vtc
vmodtool = $(top_srcdir)/lib/libvcc/vmodtool.py
vmodtoolargs = --strict
vmod_LTLIBRARIES = libvmod_vtc.la
libvmod_vtc_la_CFLAGS = \
@SAN_CFLAGS@
libvmod_vtc_la_LDFLAGS = \
$(AM_LDFLAGS) \
-module \
-export-dynamic \
-avoid-version \
-shared \
-rpath /nowhere \
@SAN_LDFLAGS@
nodist_libvmod_vtc_la_SOURCES = \
vcc_if.c \
vcc_if.h
# BUILT_SOURCES is only a hack and dependency tracking does not help for the first build
$(libvmod_vtc_la_OBJECTS): vcc_if.h
vcc_if.h vmod_vtc.rst vmod_vtc.man.rst: vcc_if.c
vcc_if.c: $(vmodtool) $(vmod_srcdir)/vmod.vcc
@PYTHON@ $(vmodtool) $(vmodtoolargs) $(vmod_srcdir)/vmod.vcc
EXTRA_DIST = vmod.vcc
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_vtc.rst \
$(builddir)/vmod_vtc.man.rst
# Use vmodtool.py generated automake boilerplate
include $(srcdir)/automake_boilerplate.am
# Boilerplate generated by vmodtool.py - changes will be overwritten
AM_LDFLAGS = $(AM_LT_LDFLAGS)
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/bin/varnishd \
-I$(top_builddir)/include
vmoddir = $(pkglibdir)/vmods
vmodtool = $(top_srcdir)/lib/libvcc/vmodtool.py
vmodtoolargs = --strict --boilerplate
vmod_LTLIBRARIES = libvmod_vtc.la
libvmod_vtc_la_CFLAGS = \
@SAN_CFLAGS@
libvmod_vtc_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(VMOD_LDFLAGS) \
@SAN_LDFLAGS@
nodist_libvmod_vtc_la_SOURCES = vcc_if.c vcc_if.h
# BUILT_SOURCES is only a hack
# and dependency tracking does not help for the first build
$(libvmod_vtc_la_OBJECTS): vcc_if.h
vcc_if.h vmod_vtc.rst vmod_vtc.man.rst: vcc_if.c
vcc_if.c: $(vmodtool) $(srcdir)/vmod.vcc
@PYTHON@ $(vmodtool) $(vmodtoolargs) $(srcdir)/vmod.vcc
EXTRA_DIST = vmod.vcc automake_boilerplate.am
CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \
$(builddir)/vmod_vtc.rst \
$(builddir)/vmod_vtc.man.rst
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