aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2000-03-01 19:13:08 +0000
committerBruce Momjian <bruce@momjian.us>2000-03-01 19:13:08 +0000
commit19c29f923678d90c7d77cc435597b47f5d600e94 (patch)
treeb20ab50a2749ceaf23509efd9ec4068c24630b42 /src
parent8daa31a21ef7ba692fc45493d98318bf80b047bc (diff)
downloadpostgresql-19c29f923678d90c7d77cc435597b47f5d600e94.tar.gz
postgresql-19c29f923678d90c7d77cc435597b47f5d600e94.zip
New plperl Makefile.
Diffstat (limited to 'src')
-rw-r--r--src/pl/plperl/Makefile.PL107
1 files changed, 20 insertions, 87 deletions
diff --git a/src/pl/plperl/Makefile.PL b/src/pl/plperl/Makefile.PL
index fae122b659d..fc8b25debd4 100644
--- a/src/pl/plperl/Makefile.PL
+++ b/src/pl/plperl/Makefile.PL
@@ -1,12 +1,7 @@
+use ExtUtils::MakeMaker;
+use ExtUtils::Embed;
use DynaLoader;
use Config;
-use ExtUtils::Embed;
-
-#
-# massage the ld options
-#
-my $ldopts = ldopts();
-chomp($ldopts);
#
# get the location of the Opcode module
@@ -30,91 +25,29 @@ my $opcode = '';
}
-open(MAKEFILE, ">Makefile");
-
-print MAKEFILE <<_STATIC_;
-#-------------------------------------------------------------------------
-#
-# Makefile
-# Makefile for the plperl shared object
-#
-# AUTOGENERATED Makefile.pl
-#
-
-#
-# Tell make where the postgresql sources live
-#
-SRCDIR= ../../../src
-include \$(SRCDIR)/Makefile.global
-
-EXTDIR= $Config{privlib}/ExtUtils
-
-XSUBPP= \$(EXTDIR)/xsubpp
-
-TYPEMAP= -typemap \$(EXTDIR)/typemap
-
-# use the same compiler as perl did
-CC= $Config{cc}
-
-# use the same compiler options as perl did, too
-CFLAGS= @{[ccopts()]}
-# including the ones for dynamic loading
-CFLAGS+= $Config{cccdlflags}
-
-# now add the includes for postgreSQL
-CFLAGS+= -I\$(LIBPQDIR) -I\$(SRCDIR)/include -I\$(SRCDIR)/backend
+WriteMakefile( 'NAME' => 'plperl',
+ dynamic_lib => { 'OTHERLDFLAGS' => "$opcode -L\$(LIBPQDIR) -lpq @{[ldopts()]}" } ,
+ INC => '-I$(LIBPQDIR) -I$(SRCDIR)/include -I$(SRCDIR)/backend',
+ XS => { 'SPI.xs' => 'SPI.c' },
+ OBJECT => 'plperl.o eloglvl.o SPI.o',
+ );
-# add the postgreSQL libraries
-LDADD+= -L\$(LIBPQDIR) -lpq
+sub MY::post_initialize {
-LDFLAGS+= $Config{lddlflags} \\
- $ldopts \\
- -lperl
+q[
+SRCDIR=../../../src
+include $(SRCDIR)/Makefile.global
+];
-#
-# DLOBJS is the dynamically-loaded object file.
-#
-DLOBJS= plperl\$(DLSUFFIX)
-
-INFILES= \$(DLOBJS)
-
-SHLIB_EXTRA_LIBS+= $opcode
-
-#
-# plus exports files
-#
-ifdef EXPSUFF
-INFILES+= \$(DLOBJS:.o=\$(EXPSUFF))
-endif
-
-%.so: %.o
- \$(CC) -o \$@ \$< \$(LDFLAGS) \$(SHLIB_EXTRA_LIBS) \$(LDADD)
-
-
-#
-# Build the shared lib
-#
-all: plperl
-
-plperl : plperl.o SPI.o
- \$(CC) -o plperl.so plperl.o SPI.o \$(SHLIB_EXTRA_LIBS) \$(LDADD) \$(LDFLAGS)
-
-%.o : %.c
- \$(CC) -c \$(CFLAGS) \$<
+}
-%.o : %.xs
- \$(XSUBPP) \$(TYPEMAP) \$< > xtmp.c
- \$(CC) -c \$(CFLAGS) -o \$@ xtmp.c
+sub MY::install {
+q[
+install :: all
+ cp $(INST_DYNAMIC) $(LIBDIR)
+];
-#
-# Clean
-#
-clean:
- rm -f \$(INFILES) *.o xtmp.c
- rm -rf .libs
- rm -f Makefile
+}
-dep depend:
-_STATIC_