Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit94728d1

Browse files
committed
Add code to test for non-shared libperl and fail gracefully.
Not a big step forward, but it's something...
1 parent3d62fbc commit94728d1

File tree

1 file changed

+48
-4
lines changed

1 file changed

+48
-4
lines changed

‎src/pl/plperl/Makefile.PL

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@ use ExtUtils::Embed;
33
use DynaLoader;
44
use Config;
55

6+
#
7+
# Can't build a shared plperl unless libperl is shared too.
8+
# (Actually, it would be enough if code in libperl.a is compiled
9+
# to be position-independent, but that is hard to check for and
10+
# seems pretty unlikely anyway.)
11+
#
12+
if ($Config{'useshrplib'}ne'true') {
13+
open(OUT,">Makefile")ordie"Can't write Makefile:$!\n";
14+
print OUT<<'EndOfMakefile';
15+
# Dummy Makefile for use when we can't build plperl
16+
17+
all install:
18+
@echo "Cannot build plperl because libperl is not a shared library; skipping it."
19+
20+
clean distclean:
21+
rm -f Makefile
22+
23+
.DEFAULT dep depend:
24+
25+
EndOfMakefile
26+
close(OUT);
27+
exit(0);
28+
}
29+
30+
631
#
732
# get the location of the Opcode module
833
#
@@ -25,9 +50,12 @@ my $opcode = '';
2550

2651
}
2752

53+
my$perllib ="-L$Config{archlibexp}/CORE -lperl";
54+
my$dynalib ="$Config{archlibexp}/auto/DynaLoader/DynaLoader.a";
55+
2856
WriteMakefile('NAME'=>'plperl',
29-
dynamic_lib=> {'OTHERLDFLAGS'=>"$opcode-L\$(LIBPQDIR) -lpq @{[ldopts()]}" } ,
30-
INC=>'-I$(LIBPQDIR) -I$(SRCDIR)/include -I$(SRCDIR)/backend',
57+
dynamic_lib=> {'OTHERLDFLAGS'=>"$opcode$perllib$dynalib" } ,
58+
INC=>'-I$(SRCDIR)/include -I$(SRCDIR)/backend',
3159
XS=> {'SPI.xs'=>'SPI.c' },
3260
OBJECT=>'plperl.o eloglvl.o SPI.o',
3361
);
@@ -41,6 +69,24 @@ include $(SRCDIR)/Makefile.global
4169

4270
}
4371

72+
subMY::cflags {
73+
packageMY;# so that "SUPER" works right
74+
my$inherited =shift->SUPER::cflags(@_);
75+
76+
#
77+
# Hack for building on HPUX (probably should have a general mechanism
78+
# for system-specific hints, but for now ...)
79+
# The default compiler and flags on this platform is cc -Aa, which
80+
# will reject 'long long' declarations that appear in Postgres headers.
81+
# Need to select -Ae instead.
82+
#
83+
if ($Config::Config{'osname'}eq'hpux') {
84+
$inherited =~s/-Aa/-Ae/;
85+
}
86+
87+
$inherited;
88+
}
89+
4490
subMY::install {
4591

4692
q[
@@ -49,5 +95,3 @@ install :: all
4995
];
5096

5197
}
52-
53-

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp