diff options
author | Rob Clark <rob@ti.com> | 2010-11-01 10:36:32 -0500 |
---|---|---|
committer | Rob Clark <rob@ti.com> | 2010-11-30 09:46:40 -0600 |
commit | eb160d68b186b15c76069c8e15394569ef6891be (patch) | |
tree | c6516b89684920f694133b64f67d22f00ac89725 | |
parent | ad7f2c98e0dad1487eb5e06c22cbe73a797cd26d (diff) |
Some changes to gstomx.conf handling
A few tweaks to the sed rules to make more friendly for using macros (for
example, "foo" "bar" becomes "foobar", which is normally done by the C
compiler and not the pre-processor). Also, the result of the preprocessor,
before generating gstomx_conf.c, is now also a generated file, to ease
debugging and to use as a starting point for a customized config file.
Signed-off-by: Rob Clark <rob@ti.com>
-rw-r--r-- | omx/Makefile.am | 13 | ||||
-rw-r--r-- | omx/gstomx.conf.in (renamed from omx/gstomx.conf) | 0 |
2 files changed, 11 insertions, 2 deletions
diff --git a/omx/Makefile.am b/omx/Makefile.am index 915b562..e8804ee 100644 --- a/omx/Makefile.am +++ b/omx/Makefile.am @@ -48,9 +48,18 @@ libgstomx_la_CFLAGS = -I$(srcdir)/headers $(GST_CFLAGS) $(GST_BASE_CFLAGS) -I$(t libgstomx_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) $(top_builddir)/util/libutil.la libgstomx_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -EXTRA_DIST = headers gstomx.conf +EXTRA_DIST = headers gstomx.conf gstomx_conf.c +# Run the C-preprocessor plus some sed voodoo to clean up adjacent strings +# (ie. "foo" "bar" becomes "foobar") so they are handled similar to what the +# C compiler does itself +gstomx.conf: gstomx.conf.in + cat $^ | $(CPP) $(CFLAGS) $(libgstomx_la_CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) - | grep -v "^#" | sed 's/\"\ *\"//g' >> $@ + +# more sed magic to convert the pre-processed config file into a C file +# containing one big string. This is linked in and used as the default +# config gstomx_conf.c: gstomx.conf echo "const char *default_config =" > $@ - cat $^ | $(CPP) $(CFLAGS) $(libgstomx_la_CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) - | grep -v "^#" | sed 's/^.*/\"&\\\n"/' >> $@ + cat $^ | sed 's/\"/\\\"/g' | sed 's/^.*/\"&\\\n"/' >> $@ echo ";" >> $@ diff --git a/omx/gstomx.conf b/omx/gstomx.conf.in index c22c6d6..c22c6d6 100644 --- a/omx/gstomx.conf +++ b/omx/gstomx.conf.in |