[postgis-devel] sql.in.c do we like not like?

Sandro Santilli strk at keybit.net
Thu Mar 21 01:34:28 PDT 2013

On Thu, Mar 21, 2013 at 08:04:40AM +0000, Mark Cave-Ayland wrote:

> PostgreSQL's makefiles have their own rules for .in files causing
> much confusion, which is why I designed the preprocessor pipeline as
> described in the email above.

What I see in the PGXS makefile is this:

  ifneq (,$(MODULES)$(MODULE_big))
  %.sql: %.sql.in
          sed 's,MODULE_PATHNAME,$$libdir/$*,g' $< >$@

We're already overriding that rule in our Makefile:

  # Borrow the $libdir substitution from PGXS but customise by adding the version number
  %.sql: %.sql.in
    $(SQLPP) -I../libpgcommon $< | grep -v '^#' | \
    $(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/postgis- at POSTGIS_MAJOR_VERSION@. at POSTGIS_MINOR_VERSION@'g" > $@

The only problem I've seen so far with dropping the .c extension
is with some C preprocessors NOT behaving correctly. Possibly fixed
by adding a ``-x c'' switch to the invocation (can someone with that
problem check this ?)

> I would recommend reverting this commit.

I will if we don't figure out a workaround. I'm available to take
a look directly on the machines having the problem, please send me
account info for that.



More information about the postgis-devel mailing list