Skip to content

Commit 19c29f9

Browse files
committed
New plperl Makefile.
1 parent 8daa31a commit 19c29f9

File tree

2 files changed

+21
-88
lines changed

2 files changed

+21
-88
lines changed

HISTORY

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ Allow pgsql to work on newer Cygwin snapshots(Dan)
313313
New catalog version number (Tom)
314314
Add Linux ARM.
315315
Rename heap_replace to heap_update
316-
Update for QNX (Kardos, Dr. Andrea)
316+
Update for QNX (Kardos, Dr. Andreas)
317317
New platform-specific regression handling (Tom)
318318
Rename oid8 -> oidvector and int28 -> int2vector (Bruce)
319319
Included all yacc and lex files into the distribution (Peter E.)

src/pl/plperl/Makefile.PL

Lines changed: 20 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1+
use ExtUtils::MakeMaker;
2+
use ExtUtils::Embed;
13
use DynaLoader;
24
use Config;
3-
use ExtUtils::Embed;
4-
5-
#
6-
# massage the ld options
7-
#
8-
my $ldopts = ldopts();
9-
chomp($ldopts);
105

116
#
127
# get the location of the Opcode module
@@ -30,91 +25,29 @@ my $opcode = '';
3025

3126
}
3227

33-
open(MAKEFILE, ">Makefile");
34-
35-
print MAKEFILE <<_STATIC_;
36-
#-------------------------------------------------------------------------
37-
#
38-
# Makefile
39-
# Makefile for the plperl shared object
40-
#
41-
# AUTOGENERATED Makefile.pl
42-
#
43-
44-
#
45-
# Tell make where the postgresql sources live
46-
#
47-
SRCDIR= ../../../src
48-
include \$(SRCDIR)/Makefile.global
49-
50-
EXTDIR= $Config{privlib}/ExtUtils
51-
52-
XSUBPP= \$(EXTDIR)/xsubpp
53-
54-
TYPEMAP= -typemap \$(EXTDIR)/typemap
55-
56-
# use the same compiler as perl did
57-
CC= $Config{cc}
58-
59-
# use the same compiler options as perl did, too
60-
CFLAGS= @{[ccopts()]}
61-
# including the ones for dynamic loading
62-
CFLAGS+= $Config{cccdlflags}
63-
64-
# now add the includes for postgreSQL
65-
CFLAGS+= -I\$(LIBPQDIR) -I\$(SRCDIR)/include -I\$(SRCDIR)/backend
28+
WriteMakefile( 'NAME' => 'plperl',
29+
dynamic_lib => { 'OTHERLDFLAGS' => "$opcode -L\$(LIBPQDIR) -lpq @{[ldopts()]}" } ,
30+
INC => '-I$(LIBPQDIR) -I$(SRCDIR)/include -I$(SRCDIR)/backend',
31+
XS => { 'SPI.xs' => 'SPI.c' },
32+
OBJECT => 'plperl.o eloglvl.o SPI.o',
33+
);
6634

67-
# add the postgreSQL libraries
68-
LDADD+= -L\$(LIBPQDIR) -lpq
35+
sub MY::post_initialize {
6936

70-
LDFLAGS+= $Config{lddlflags} \\
71-
$ldopts \\
72-
-lperl
37+
q[
38+
SRCDIR=../../../src
39+
include $(SRCDIR)/Makefile.global
40+
];
7341

74-
#
75-
# DLOBJS is the dynamically-loaded object file.
76-
#
77-
DLOBJS= plperl\$(DLSUFFIX)
78-
79-
INFILES= \$(DLOBJS)
80-
81-
SHLIB_EXTRA_LIBS+= $opcode
82-
83-
#
84-
# plus exports files
85-
#
86-
ifdef EXPSUFF
87-
INFILES+= \$(DLOBJS:.o=\$(EXPSUFF))
88-
endif
89-
90-
%.so: %.o
91-
\$(CC) -o \$@ \$< \$(LDFLAGS) \$(SHLIB_EXTRA_LIBS) \$(LDADD)
92-
93-
94-
#
95-
# Build the shared lib
96-
#
97-
all: plperl
98-
99-
plperl : plperl.o SPI.o
100-
\$(CC) -o plperl.so plperl.o SPI.o \$(SHLIB_EXTRA_LIBS) \$(LDADD) \$(LDFLAGS)
101-
102-
%.o : %.c
103-
\$(CC) -c \$(CFLAGS) \$<
42+
}
10443

105-
%.o : %.xs
106-
\$(XSUBPP) \$(TYPEMAP) \$< > xtmp.c
107-
\$(CC) -c \$(CFLAGS) -o \$@ xtmp.c
44+
sub MY::install {
10845

46+
q[
47+
install :: all
48+
cp $(INST_DYNAMIC) $(LIBDIR)
49+
];
10950

110-
#
111-
# Clean
112-
#
113-
clean:
114-
rm -f \$(INFILES) *.o xtmp.c
115-
rm -rf .libs
116-
rm -f Makefile
51+
}
11752

118-
dep depend:
11953

120-
_STATIC_

0 commit comments

Comments
 (0)