Bug 784450, get rid of now deprecated csourcetostring.py

We already weren't using the verbatim sources, with what seems like newer
pythons there is build failures, cleaning it fully out.
parent 3a8120d7
......@@ -31,6 +31,3 @@ AM_CFLAGS = $(DEP_CFLAGS) $(BABL_CFLAGS)
AM_LDFLAGS = -avoid-version -export-dynamic -module $(no_undefined)
ext_dir = $(libdir)/gegl-@GEGL_API_VERSION@
%.c.h: %.c $(top_srcdir)/tools/csourcetostring.py
$(AM_V_GEN) $(PYTHON) $(top_srcdir)/tools/csourcetostring.py $<
......@@ -4,8 +4,6 @@ include $(top_srcdir)/operations/Makefile-common.am
EXTRA_DIST = $(wildcard $(srcdir)/*.h)
BUILT_SOURCES = $(subst .c,.c.h,$(wildcard $(srcdir)/*.c))
AM_CPPFLAGS += -I$(srcdir)
AM_CFLAGS += -DGEGL_OP_BUNDLE
LIBS = $(op_libs)
......
include $(top_srcdir)/operations/Makefile-common.am
EXTRA_DIST = $(wildcard $(srcdir)/*.h)
BUILT_SOURCES = $(subst .c,.c.h,$(wildcard $(srcdir)/*.c))
AM_CPPFLAGS += -I$(srcdir)
AM_CFLAGS += -DGEGL_OP_BUNDLE
......
......@@ -182,8 +182,5 @@ npd_la_CFLAGS = $(AM_CFLAGS) $(NPD_CFLAGS) $(CAIRO_CFLAGS)
npd_la_LIBADD = $(op_libs) $(NPD_LIBS) $(CAIRO_LIBS)
endif
BUILT_SOURCES = $(subst .c,.c.h,$(wildcard $(srcdir)/*.c))
EXTRA_DIST += $(BUILT_SOURCES)
opdir = $(libdir)/gegl-@GEGL_API_VERSION@
op_LTLIBRARIES = $(ops)
......@@ -4,8 +4,6 @@ include $(top_srcdir)/operations/Makefile-common.am
EXTRA_DIST = $(wildcard $(srcdir)/*.h)
BUILT_SOURCES = $(subst .c,.c.h,$(wildcard $(srcdir)/*.c))
AM_CPPFLAGS += -I$(srcdir)
LIBS = $(op_libs)
......
......@@ -33,7 +33,6 @@ v4l2_la_CFLAGS = $(AM_CFLAGS) $(V4L2_CFLAGS)
endif
EXTRA_DIST = $(wildcard $(srcdir)/*.h)
BUILT_SOURCES = $(subst .c,.c.h,$(wildcard $(srcdir)/*.c))
opdir = $(libdir)/gegl-@GEGL_API_VERSION@
op_LTLIBRARIES = $(ops)
......@@ -3,7 +3,6 @@
EXTRA_DIST = \
xml_insert.sh \
gen-loader.sh \
csourcetostring.py \
gobj2dot.rb
AM_CPPFLAGS = \
......
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
if len(sys.argv) != 2:
print("Usage: %s file.c" % sys.argv[0])
sys.exit(1)
# From http://stackoverflow.com/questions/14945095/how-to-escape-string-for-generated-c
def escape_string(s):
return s.replace('\\', r'\\').replace('"', r'\"')
if "module.c" in sys.argv[1]:
exit()
infile = open(sys.argv[1], "r")
outfile = open(sys.argv[1] + ".h", "w")
cl_source = infile.read()
infile.close()
string_var_name = os.path.basename(sys.argv[1]).replace("-", "_").replace(":", "_")
if string_var_name.endswith(".c"):
string_var_name = string_var_name.rstrip(".c")
outfile.write("static const char* %s_c_source =\n" % "op")
for line in cl_source.rstrip().split("\n"):
line = line.rstrip()
line = escape_string(line)
line = '"%-78s\\n"\n' % line
outfile.write(line)
outfile.write(";\n")
outfile.close()
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