Re: meson oddities

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: meson oddities
Date: 2022-11-15 16:07:05
Message-ID: 95767d55-0dfe-3e73-0373-9d910c4322f2@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15.11.22 00:48, Andres Freund wrote:
> We effectively do that with autoconf as well, except that we don't mention
> that in pg_config --ldflags. Our linking rules include CFLAGS, see e.g.:
>
> %: %.o
> $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $(at)$(X)
>
> postgres: $(OBJS)
> $(CC) $(CFLAGS) $(call expand_subsys,$^) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) $(LIBS) -o $@
>
> ifdef PROGRAM
> $(PROGRAM): $(OBJS)
> $(CC) $(CFLAGS) $(OBJS) $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $(at)$(X)
> endif
>
> # Rule for building a shared library from a single .o file
> %.so: %.o
> $(CC) $(CFLAGS) $< $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@
>
>
> Should we try that fact in pg_configin the meson build as well?

It's up to the consumer of pg_config to apply CFLAGS and LDFLAGS as they
need. But pg_config and pkg-config etc. should report them separately.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2022-11-15 16:35:55 Re: Error-safe user functions
Previous Message Justin Pryzby 2022-11-15 15:43:53 Re: Vacuumdb --force-index-cleanup option not available in postgres 12.9