mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Native pg_conf failing on FreeBSD


From: Volker Grabsch
Subject: Re: [Mingw-cross-env-list] Native pg_conf failing on FreeBSD
Date: Tue, 16 Feb 2010 11:10:30 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Tony Theodore <address@hidden> schrieb:
> On 16 February 2010 02:13, Volker Grabsch <address@hidden> wrote:
> > Thanks for the work, but I'm afraid there is a misunderstanding.
> > These two sets of options are _not_ meant to be aligned.
[...]
> My only other thought is that maybe the original approach of making a
> native version from the cross-configured source will correctly report
> libs and flags. Just thinking out loud - I couldn't get this to work.

I tried that, too, and I know how we could achieve that, but
we'd have to modify pg_config's Makefile in the native build
and insert the values of some cross-build variables into that
Makefile.

However, it is really impossible to do that without hacking
that Makefile. If you look at src/bin/pg_config/Makefile, this
will quickly become clear:

    override CPPFLAGS += -DVAL_CONFIGURE="\"$(configure_args)\""
    override CPPFLAGS += -DVAL_CC="\"$(CC)\""
    override CPPFLAGS += -DVAL_CPPFLAGS="\"$(STD_CPPFLAGS)\""
    override CPPFLAGS += -DVAL_CFLAGS="\"$(CFLAGS)\""
    override CPPFLAGS += -DVAL_CFLAGS_SL="\"$(CFLAGS_SL)\""
    override CPPFLAGS += -DVAL_LDFLAGS="\"$(STD_LDFLAGS)\""
    override CPPFLAGS += -DVAL_LDFLAGS_SL="\"$(LDFLAGS_SL)\""
    override CPPFLAGS += -DVAL_LIBS="\"$(LIBS)\""

So this is really hardcoded and not overridable. For instance,
if you override $(CC) to point to the cross compiler, the Makefile
will also try to build pg_config with that cross compiler. It's
really tightly tangled. :-(

The current postgresql.mk in mingw-cross-env just replaces
these VAL_* symbols with _DISABLED_VAL_* symbols:

    $(SED) -i 's,-DVAL_,-D_DISABLED_VAL_,g' 
'$(1).native'/src/bin/pg_config/Makefile

so they aren't found and won't appear in pg_config. It's better
to provide no information than to provide wrong and misleading
information.

However, feel free to digg further into that, if you like.
All you need to do is to provide proper values for each
of these VAL_* symbols, preferably via some $(SED) action.

But providing other ./configure options won't help you,
and also might break the native build on systems where
some depedency dev libraries are not installed.


Greets,

    Volker

-- 
Volker Grabsch
---<<(())>>---
Administrator
NotJustHosting GbR




reply via email to

[Prev in Thread] Current Thread [Next in Thread]