Re: meson oddities - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: meson oddities
Date
Msg-id 95767d55-0dfe-3e73-0373-9d910c4322f2@enterprisedb.com
Whole thread Raw
In response to Re: meson oddities  (Andres Freund <andres@anarazel.de>)
List 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 $@$(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 $@$(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.




pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: Vacuumdb --force-index-cleanup option not available in postgres 12.9
Next
From: Andrew Dunstan
Date:
Subject: Re: Error-safe user functions