Re: pg_config --pgxs

Lists: pgsql-hackerspgsql-novice
From: George Weaver <gweaver(at)shaw(dot)ca>
To: pgsql-novice(at)postgresql(dot)org
Subject: pg_config --pgxs
Date: 2006-03-02 15:12:26
Message-ID: 003a01c63e0b$b9b46ed0$6400a8c0@Dell4500
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-novice

Hi,

I am trying to create a makefile for installing some C functions.

When I include the following in the makefile:

PGXS := $(shell pg_config --pgxs)
include $(PGXS)

I get the following error:

$ make
pg_config: invalid argument: --pgxs
Try 'pg_config --help' for more information.
Makefile:10: no file name for `include'
make: *** No targets. Stop.

When I run pg_config -- help, I don't see any options for the --pgxs
argument.

I am using MinGW under XP.

What am I missing??

Thanks,
George


From: Michael Fuhr <mike(at)fuhr(dot)org>
To: George Weaver <gweaver(at)shaw(dot)ca>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: pg_config --pgxs
Date: 2006-03-02 16:04:38
Message-ID: 20060302160438.GA7152@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-novice

On Thu, Mar 02, 2006 at 09:12:26AM -0600, George Weaver wrote:
> $ make
> pg_config: invalid argument: --pgxs
> Try 'pg_config --help' for more information.

What does "pg_config --version" show? PGXS is available in 8.0 and
later.

--
Michael Fuhr


From: George Weaver <gweaver(at)shaw(dot)ca>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: pg_config --pgxs
Date: 2006-03-02 16:31:27
Message-ID: 005a01c63e16$c42109e0$6400a8c0@Dell4500
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-novice


Michael Fuhr wrote:

> What does "pg_config --version" show? PGXS is available in 8.0 and
> later.

Interesting...

$ pg_config --version
PostgreSQL 7.3.2

$ pg_config --configure
'--enable-multibyte' '--with-python' '--with-perl' '--with-java'
'--with-CXX' '--prefix=/usr' '--sysconfdir=/etc'
'--docdir=/usr/doc/postgresql-7.3.2'

I am running 8.1 and ran configure under MSys to build the 8.1 source tree
for installing the XML2 contrib module!

I do have a cygwin version of 7.3.2 installed on my system as well - I'll
have to figure out where the conflict is arising.

Thanks, Michael, for pointing me in the right direction.

Regards,
George


From: George Weaver <gweaver(at)shaw(dot)ca>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: pg_config --pgxs
Date: 2006-03-02 23:32:31
Message-ID: 000701c63e51$95f51da0$6400a8c0@Dell4500
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-novice


Michael Fuhr wrote:

> What does "pg_config --version" show? PGXS is available in 8.0 and
> later.

Hi Michael;

pg_config --version now shows:

$ pg_config --version
PostgreSQL 8.1.0

However, when I try pg_config --pgxs it returns nothing:

$ pg_config --pgxs

$

The following are all undefined:

--includedir
--pkgincludedir
--includedir-server
--localedir
--mandir
--sysconfdir
--pgxs
--cflags_sl
--ldflags_sl

Is there a way to configure these?

Thanks,
George


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: George Weaver <gweaver(at)shaw(dot)ca>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, pgsql-novice(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [NOVICE] pg_config --pgxs
Date: 2006-03-03 00:23:01
Message-ID: 16188.1141345381@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-novice

George Weaver <gweaver(at)shaw(dot)ca> writes:
> pg_config --version now shows:

> $ pg_config --version
> PostgreSQL 8.1.0

> However, when I try pg_config --pgxs it returns nothing:

> $ pg_config --pgxs

> $

If you're on Windows this probably means that GetShortPathName() is
failing. I'm not sure what conditions cause that, exactly. It might be
a good idea if we fixed pg_config to print out the error code rather
than just silently failing.

regards, tom lane


From: George Weaver <gweaver(at)shaw(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, pgsql-novice(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [NOVICE] pg_config --pgxs
Date: 2006-03-03 13:31:59
Message-ID: 002601c63ec6$dd3e4450$6400a8c0@Dell4500
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-novice


On March 2 Tom Lane wrote:

> If you're on Windows this probably means that GetShortPathName() is
> failing. I'm not sure what conditions cause that, exactly. It might be
> a good idea if we fixed pg_config to print out the error code rather
> than just silently failing.

Hi Tom,

I am using Windows (XP).

Regards,
George


From: Thomas Hallgren <thomas(at)tada(dot)se>
To: George Weaver <gweaver(at)shaw(dot)ca>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, pgsql-novice(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [NOVICE] pg_config --pgxs
Date: 2006-03-03 14:17:54
Message-ID: 44085012.3060509@tada.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-novice

George Weaver wrote:
>
> On March 2 Tom Lane wrote:
>
>> If you're on Windows this probably means that GetShortPathName() is
>> failing. I'm not sure what conditions cause that, exactly. It might be
>> a good idea if we fixed pg_config to print out the error code rather
>> than just silently failing.
>
> Hi Tom,
>
> I am using Windows (XP).
>
GetShortPathName() seems to work well on my XP machine:

C:\>pg_config --version
PostgreSQL 8.1.1

C:\>pg_config --pgxs
C:/PROGRA~1/POSTGR~1/8.1/lib/pgxs/src/MAKEFI~1/pgxs.mk

Regards,
Thomas Hallgren


From: George Weaver <gweaver(at)shaw(dot)ca>
To: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org
Subject: Re: [NOVICE] pg_config --pgxs
Date: 2006-03-03 22:18:31
Message-ID: 00a301c63f10$6a4018d0$6400a8c0@Dell4500
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-novice


----- Original Message -----
From: "Tom Lane"

> If you're on Windows this probably means that GetShortPathName() is
> failing. I'm not sure what conditions cause that, exactly. It might be
> a good idea if we fixed pg_config to print out the error code rather
> than just silently failing.

I think I have figured out what the problem is.

I installed the binary version of 8.1 via the msi-installer which creates
the PostgreSQL bin directory as "C:\Program Files\PostgreSQL\8.1\bin".

I then downloaded and installed the source code in order to compile and
install the xml2 contrib module. When I extracted
"postgresql-8.1.0.tar.bz2" to the "C:\Program Files\PostgreSQL" directory,
it creates the directory "C:\Program Files\PostgreSQL\postgresql-8.1.0". I
did not need to make and install the entire package from source in order to
build and install the xml2 module, so the directories remain as above.

When pg_config is run, it's assuming that bindir is "C:/Program
Files/PostgreSQL/8.1/bin" and starts all its path searches basis this
directory.

For pgxs, it concatentates the libdir with "/pgxs/src/makefiles/pgxs.mk" so
its looking for "C:/Program
Files/PostgreSQL/8.1/lib/pgxs/src/makefiles/pgxs.mk" which doesn't exist.
In fact under the source tree for 8.1.0 there is no directory "pgxs". If I
create a directory "/pgxs/src/makefiles" under "C:/Program
Files/PostgreSQL/8.1/lib/" and copy pgxs.mk to this directory, pg_config
finds it correctly:

C:\>pg_config --pgxs
C:/PROGRA~1/POSTGR~1/8.1/lib/pgxs/src/MAKEFI~1/pgxs.mk

If I made the entire package from source and installed it, would it have
created the directory "/pgxs/src/makefiles" under "C:/Program
Files/PostgreSQL/8.1/lib/"?

Regards,
George


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: George Weaver <gweaver(at)shaw(dot)ca>
Cc: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>, pgsql-hackers(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org
Subject: Re: [NOVICE] pg_config --pgxs
Date: 2006-03-03 23:29:38
Message-ID: 8276.1141428578@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-novice

George Weaver <gweaver(at)shaw(dot)ca> writes:
> For pgxs, it concatentates the libdir with "/pgxs/src/makefiles/pgxs.mk" so
> its looking for "C:/Program
> Files/PostgreSQL/8.1/lib/pgxs/src/makefiles/pgxs.mk" which doesn't exist.
> ...
> If I made the entire package from source and installed it, would it have
> created the directory "/pgxs/src/makefiles" under "C:/Program
> Files/PostgreSQL/8.1/lib/"?

Yes, it should have. I think the issue here is that GetShortPathName
insists on the target path actually existing, whereas the Unix
environment imposes no such requirement.

Not sure if we should try to do anything about this --- if the file is
not there, it isn't going to help a lot for pg_config to print out where
it should have been, so really there's not much functionality loss
involved here.

regards, tom lane


From: Thomas Hallgren <thomas(at)tada(dot)se>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>, pgsql-hackers(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org
Subject: Re: pg_config --pgxs
Date: 2006-03-04 09:11:11
Message-ID: 440959AF.5060703@tada.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-novice

Tom Lane wrote:
> Not sure if we should try to do anything about this --- if the file is
> not there, it isn't going to help a lot for pg_config to print out where
> it should have been, so really there's not much functionality loss
> involved here.
>
A check if the GetShortPathName produces an empty filename (or whatever it is that's causing
that output) resulting in a 'file not found' or something that makes more sense than mere
silence seems appropriate. It would prevent this topic from popping up again.

Regards,
Thomas Hallgren