patch: Add PGXS support to hstore's Makefile (trivial)

Started by Joseph Adamsalmost 15 years ago3 messages
#1Joseph Adams
joeyadams3.14159@gmail.com
1 attachment(s)

I discovered today that hstore's Makefile currently does not support
PGXS; namely, the ability to install it like so:

USE_PGXS=1 make
sudo USE_PGXS=1 make install

Moreover, hstore is the *only* contrib module whose Makefile does not
contain "PGXS".

The attached patch changes hstore's Makefile so it is like the others.
I have tested the above commands on a copy of the hstore directory
located outside of the PostgreSQL source tree, and it appears to work
just fine. I also tested conventional make and make install, and it
still appears to work as well.

Joey Adams

Attachments:

hstore-makefile-pgxs.difftext/x-patch; charset=US-ASCII; name=hstore-makefile-pgxs.diffDownload
commit a7384288531ba9a235292836d6ee1e17a65a3997
Author: Joey Adams <joeyadams3.14159@gmail.com>
Date:   Sun Jan 23 21:05:03 2011 -0500

    Added PGXS support to contrib/hstore/Makefile

diff --git a/contrib/hstore/Makefile b/contrib/hstore/Makefile
index e466b6f..1d533fd 100644
--- a/contrib/hstore/Makefile
+++ b/contrib/hstore/Makefile
@@ -1,9 +1,5 @@
 # contrib/hstore/Makefile
 
-subdir = contrib/hstore
-top_builddir = ../..
-include $(top_builddir)/src/Makefile.global
-
 MODULE_big = hstore
 OBJS = hstore_io.o hstore_op.o hstore_gist.o hstore_gin.o hstore_compat.o \
 	crc32.o
@@ -12,4 +8,13 @@ DATA_built = hstore.sql
 DATA = uninstall_hstore.sql
 REGRESS = hstore
 
+ifdef USE_PGXS
+PG_CONFIG = pg_config
+PGXS := $(shell $(PG_CONFIG) --pgxs)
+include $(PGXS)
+else
+subdir = contrib/hstore
+top_builddir = ../..
+include $(top_builddir)/src/Makefile.global
 include $(top_srcdir)/contrib/contrib-global.mk
+endif
#2Robert Haas
robertmhaas@gmail.com
In reply to: Joseph Adams (#1)
Re: patch: Add PGXS support to hstore's Makefile (trivial)

On Sun, Jan 23, 2011 at 9:20 PM, Joseph Adams
<joeyadams3.14159@gmail.com> wrote:

The attached patch changes hstore's Makefile so it is like the others.

Thanks, committed.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#3Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Robert Haas (#2)
Re: patch: Add PGXS support to hstore's Makefile (trivial)

Robert Haas <robertmhaas@gmail.com> writes:

On Sun, Jan 23, 2011 at 9:20 PM, Joseph Adams
<joeyadams3.14159@gmail.com> wrote:

The attached patch changes hstore's Makefile so it is like the others.

Thanks, committed.

For the record, I smell bitrot here:

http://archives.postgresql.org/message-id/m21v7jpqe6.fsf@2ndQuadrant.fr

I had included this patch into my extension branch and patch, so this is
a good excuse for me to produce a v27. Will do in a separate thread.

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support