Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5b4b3d5

Browse files
committed
From: Jun Kuwamura <juk@rccm.co.jp>
This patch fix the Makefiles in contrib/{pginterface, spi, miscutil, int8, ip_and_mac, sequence, soundex, string, userlock, array, datetime} to install their modules in one directory(lib/modules/).
1 parent 2201d48 commit 5b4b3d5

File tree

17 files changed

+75
-691
lines changed

17 files changed

+75
-691
lines changed

contrib/array/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ module: $(MODULE)
4040
sql: $(MODNAME).sql
4141

4242
install: $(MODULE)
43-
cp -p $(MODULE) $(LIBDIR)
44-
cd $(LIBDIR); strip $(MODULE)
43+
cp -p $(MODULE) $(LIBDIR)/modules
44+
cd $(LIBDIR)/modules; strip $(MODULE)
4545

4646
%.sql: %.sql.in
47-
sed "s|MODULE_PATHNAME|$(LIBDIR)/$(MODULE)|" < $< > $@
47+
sed "s|MODULE_PATHNAME|$(LIBDIR)/modules/$(MODULE)|" < $< > $@
4848

4949
.SUFFIXES: $(DLSUFFIX)
5050

5151
%$(DLSUFFIX): %.c
52-
cc $(CFLAGS) -shared -o $@ $<
52+
$(CC) $(CFLAGS) -shared -o $@ $<
5353

5454
depend dep:
5555
$(CC) -MM $(INCLUDE_OPT) *.c >depend

contrib/array/array_iterator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ array_iterator(Oid elemtype, Oid proc, int and, ArrayType *array, Datum value)
7171

7272
/* Lookup the function entry point */
7373
proc_fn = (func_ptr) NULL;
74-
fmgr_info(proc, &proc_fn, &pronargs);
74+
fmgr_info(proc, &pronargs); /* (proc, &proc_fn, &pronargs); */
7575
if ((proc_fn == NULL) || (pronargs != 2))
7676
{
7777
elog(ERROR, "array_iterator: fmgr_info lookup failed for oid %d", proc);

contrib/array/array_iterator.sql

Lines changed: 0 additions & 137 deletions
This file was deleted.

contrib/datetime/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ module: $(MODULE)
4040
sql: $(MODNAME).sql
4141

4242
install: $(MODULE)
43-
cp -p $(MODULE) $(LIBDIR)
44-
cd $(LIBDIR); strip $(MODULE)
43+
cp -p $(MODULE) $(LIBDIR)/modules
44+
cd $(LIBDIR)/modules; strip $(MODULE)
4545

4646
%.sql: %.sql.in
47-
sed "s|MODULE_PATHNAME|$(LIBDIR)/$(MODULE)|" < $< > $@
47+
sed "s|MODULE_PATHNAME|$(LIBDIR)/modules/$(MODULE)|" < $< > $@
4848

4949
.SUFFIXES: $(DLSUFFIX)
5050

5151
%$(DLSUFFIX): %.c
52-
cc $(CFLAGS) -shared -o $@ $<
52+
$(CC) $(CFLAGS) -shared -o $@ $<
5353

5454
depend dep:
5555
$(CC) -MM $(INCLUDE_OPT) *.c >depend

contrib/datetime/datetime_functions.sql

Lines changed: 0 additions & 75 deletions
This file was deleted.

contrib/int8/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#-------------------------------------------------------------------------
1818

1919
ifndef PGDIR
20-
PGDIR= /opt/postgres/current
20+
PGDIR= ../..
2121
endif
2222

2323
SRCDIR= $(PGDIR)/src
@@ -27,13 +27,13 @@ include $(SRCDIR)/Makefile.global
2727
# Comment out this re-declaration of LIBDIR
2828
# if you are installing as the postgres superuser
2929
# into a specific database or into template1.
30-
LIBDIR= /home/tgl/lib
30+
#LIBDIR= /home/tgl/lib
3131

3232
CFLAGS+= -I$(PGDIR)/include -I$(PGDIR)/src/include -I$(LIBPQDIR)
3333

3434
# This extra library is for the 64-bit division routine on my Linux box
3535
# and probably will need to be commented-out for most other platforms.
36-
CLIBS+= /usr/lib/gcc-lib/i486-linux/2.7.2/libgcc.a
36+
#CLIBS+= /usr/lib/gcc-lib/i486-linux/2.7.2/libgcc.a
3737

3838
TARGETS= int8.sql int8$(DLSUFFIX)
3939

@@ -44,7 +44,7 @@ int8$(DLSUFFIX): int8.o
4444

4545
install:
4646
$(MAKE) all
47-
cp -p int8$(DLSUFFIX) $(LIBDIR)
47+
cp -p int8$(DLSUFFIX) $(LIBDIR)/modules
4848

4949
%.sql: %.source
5050
if [ -z "$$USER" ]; then USER=$$LOGNAME; fi; \
@@ -53,7 +53,7 @@ install:
5353
rm -f $@; \
5454
C=`pwd`; \
5555
O=$C; \
56-
if [ -d ${LIBDIR} ]; then O=${LIBDIR}; fi; \
56+
if [ -d ${LIBDIR}/contrib ]; then O=${LIBDIR}/contrib; fi; \
5757
sed -e "s:_CWD_:$$C:g" \
5858
-e "s:_OBJWD_:$$O:g" \
5959
-e "s:_DLSUFFIX_:$(DLSUFFIX):g" \

contrib/ip_and_mac/Makefile

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
11
#
22
# PostgreSQL types for IP and MAC addresses
33
#
4-
# $Id: Makefile,v 1.2 1998/02/14 17:58:02 scrappy Exp $
4+
# $Id: Makefile,v 1.3 1998/04/22 04:14:11 scrappy Exp $
55

6-
all: ip.so mac.so
6+
SRCDIR= ../../src
77

8-
ip.so: ip.o
9-
ld -Bshareable -o ip.so ip.o
8+
include $(SRCDIR)/Makefile.global
109

11-
ip.o: ip.c
12-
cc -g -O -fPIC -I/usr/local/pgsql/include -c ip.c
10+
CONTRIBDIR=$(LIBDIR)/modules
1311

14-
mac.so: mac.o
15-
ld -Bshareable -o mac.so mac.o
12+
CFLAGS+= $(CFLAGS_SL) -I$(SRCDIR)/include
1613

17-
mac.o: mac.c mac.h
18-
cc -g -O -fPIC -I/usr/local/pgsql/include -c mac.c
14+
ifdef REFINT_VERBOSE
15+
CFLAGS+= -DREFINT_VERBOSE
16+
endif
1917

20-
install: ip.so mac.so
21-
install -c ip.so mac.so /usr/local/pgsql/modules
18+
TARGETS= ip$(DLSUFFIX) ip.sql mac$(DLSUFFIX) mac.sql
2219

23-
#
24-
# eof
25-
#
20+
CLEANFILES+= $(TARGETS)
21+
22+
all:: $(TARGETS)
23+
24+
install:: all $(CONTRIBDIR)
25+
for f in *$(DLSUFFIX); do $(INSTALL) -c $$f $(CONTRIBDIR)/$$f; done
26+
27+
$(CONTRIBDIR):
28+
mkdir -p $(CONTRIBDIR)
29+
30+
%.sql: %.sql.in
31+
rm -f $@; \
32+
C=`pwd`; \
33+
sed -e "s:_OBJWD_:$(CONTRIBDIR):g" \
34+
-e "s:_DLSUFFIX_:$(DLSUFFIX):g" < $< > $@
35+
36+
clean:
37+
rm -f $(TARGETS) *.o

0 commit comments

Comments
 (0)