New plperl Makefile.
This commit is contained in:
parent
8daa31a21e
commit
19c29f9236
2 changed files with 21 additions and 88 deletions
2
HISTORY
2
HISTORY
|
@ -313,7 +313,7 @@ Allow pgsql to work on newer Cygwin snapshots(Dan)
|
|||
New catalog version number (Tom)
|
||||
Add Linux ARM.
|
||||
Rename heap_replace to heap_update
|
||||
Update for QNX (Kardos, Dr. Andrea)
|
||||
Update for QNX (Kardos, Dr. Andreas)
|
||||
New platform-specific regression handling (Tom)
|
||||
Rename oid8 -> oidvector and int28 -> int2vector (Bruce)
|
||||
Included all yacc and lex files into the distribution (Peter E.)
|
||||
|
|
|
@ -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");
|
||||
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',
|
||||
);
|
||||
|
||||
print MAKEFILE <<_STATIC_;
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Makefile
|
||||
# Makefile for the plperl shared object
|
||||
#
|
||||
# AUTOGENERATED Makefile.pl
|
||||
#
|
||||
sub MY::post_initialize {
|
||||
|
||||
#
|
||||
# Tell make where the postgresql sources live
|
||||
#
|
||||
SRCDIR= ../../../src
|
||||
include \$(SRCDIR)/Makefile.global
|
||||
q[
|
||||
SRCDIR=../../../src
|
||||
include $(SRCDIR)/Makefile.global
|
||||
];
|
||||
|
||||
EXTDIR= $Config{privlib}/ExtUtils
|
||||
}
|
||||
|
||||
XSUBPP= \$(EXTDIR)/xsubpp
|
||||
sub MY::install {
|
||||
|
||||
TYPEMAP= -typemap \$(EXTDIR)/typemap
|
||||
q[
|
||||
install :: all
|
||||
cp $(INST_DYNAMIC) $(LIBDIR)
|
||||
];
|
||||
|
||||
# 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
|
||||
|
||||
# add the postgreSQL libraries
|
||||
LDADD+= -L\$(LIBPQDIR) -lpq
|
||||
|
||||
LDFLAGS+= $Config{lddlflags} \\
|
||||
$ldopts \\
|
||||
-lperl
|
||||
|
||||
#
|
||||
# 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
|
||||
|
||||
|
||||
#
|
||||
# Clean
|
||||
#
|
||||
clean:
|
||||
rm -f \$(INFILES) *.o xtmp.c
|
||||
rm -rf .libs
|
||||
rm -f Makefile
|
||||
|
||||
dep depend:
|
||||
|
||||
_STATIC_
|
||||
|
|
Loading…
Reference in a new issue