Re: cannot find PGXS file when installing an extension? - Mailing list pgsql-general

From Pavel Luzanov
Subject Re: cannot find PGXS file when installing an extension?
Date
Msg-id 1a22adbd-8aa4-6872-8976-d9711f0e61f1@postgrespro.ru
Whole thread Raw
In response to cannot find PGXS file when installing an extension?  (Luca Ferrari <fluca1978@gmail.com>)
Responses Re: cannot find PGXS file when installing an extension?
List pgsql-general
Luca,

'sudo make install' command works in the environment of the superuser and most likely does not see
pg_config utility .

Specify the location of pg_config explicitly:
sudo make install PG_CONFIG=/opt/pg11/bin/pg_config
-----
Pavel Luzanov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
On 02.11.2018 14:17, Luca Ferrari wrote:
I'm using 11.0 on FreeBSD:

testdb=> select version();                                                version
---------------------------------------------------------------------------------------------------------PostgreSQL 11.0 on x86_64-unknown-freebsd11.1, compiled by gcc
(FreeBSD Ports Collection) 6.4.0, 64-bit

I've a very basic extension made by my own:

cleopatra% ls
Makefile        fluca--1.0.sql  fluca.control

cleopatra% cat Makefile
EXTENSION = fluca
DATA = fluca--1.0.sql

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

but when I launch make I got an error about a "cannot find" on the
line of the include directive:

cleopatra% sudo make install
make: "/usr/home/luca/tmp/fluca/Makefile" line 6: Could not find
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/home/luca/tmp/fluca


but seems to me everything is in place:

cleopatra% pg_config --pgxs
/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk


I've then tried to force the inclusion of the file adding it to the Makefile:

cleopatra% cat Makefile
EXTENSION = fluca
DATA = fluca--1.0.sql

PG_CONFIG = pg_config
include /opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk


which produces a verbose error output:

cleopatra% sudo make install
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 63:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 64:
Need an operator
make: Unknown modifier ' '
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 65:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 66:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 67:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 70:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 44:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 49:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 51:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 52:
Missing dependency operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 55:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 58:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 59:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 60:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 65:
Missing dependency operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 68:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 72:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 73:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 93:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 105:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 106:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 108:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 109:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 112:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 113:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 115:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 116:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 121:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 122:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 124:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 125:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 130:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 131:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 133:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 134:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 139:
Need an operator


What am I missing here?

Thanks,
Luca


pgsql-general by date:

Previous
From: Luca Ferrari
Date:
Subject: cannot find PGXS file when installing an extension?
Next
From: "James A. Robinson"
Date:
Subject: Re: Working around, or with, bitmap heap scan?