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

Commit7662419

Browse files
committed
Change PL/Perl and Pg interface build to use configured compiler and
Makefile.shlib system, not MakeMaker.
1 parentde1f586 commit7662419

File tree

7 files changed

+165
-195
lines changed

7 files changed

+165
-195
lines changed

‎config/perl.m4

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Header: /cvsroot/pgsql/config/perl.m4,v 1.1 2001/08/26 22:28:04 petere Exp $
1+
# $Header: /cvsroot/pgsql/config/perl.m4,v 1.2 2002/05/28 16:57:53 petere Exp $
22

33

44
# PGAC_PATH_PERL
@@ -7,21 +7,29 @@ AC_DEFUN([PGAC_PATH_PERL],
77
[AC_PATH_PROG(PERL,perl)])
88

99

10-
# PGAC_CHECK_PERL_DIRS
11-
# ---------------------
12-
AC_DEFUN([PGAC_CHECK_PERL_DIRS],
13-
[
14-
AC_REQUIRE([PGAC_PATH_PERL])
15-
AC_MSG_CHECKING([Perl installation directories])
10+
# PGAC_CHECK_PERL_CONFIG(NAME)
11+
# ----------------------------
12+
AC_DEFUN([PGAC_CHECK_PERL_CONFIG],
13+
[AC_REQUIRE([PGAC_PATH_PERL])
14+
AC_MSG_CHECKING([for Perl$1])
15+
perl_$1=`$PERL -MConfig -e 'print $Config{$1}'`
16+
AC_SUBST(perl_$1)dnl
17+
AC_MSG_RESULT([$perl_$1])])
1618

17-
# These are the ones we currently need. Others can be added easily.
18-
perl_installsitearch=`$PERL -MConfig -e 'print $Config{installsitearch}'`
19-
perl_installsitelib=`$PERL -MConfig -e 'print $Config{installsitelib}'`
20-
perl_installman3dir=`$PERL -MConfig -e 'print $Config{installman3dir}'`
2119

22-
AC_SUBST(perl_installsitearch)[]dnl
23-
AC_SUBST(perl_installsitelib)[]dnl
24-
AC_SUBST(perl_installman3dir)[]dnl
20+
# PGAC_CHECK_PERL_CONFIGS(NAMES)
21+
# ------------------------------
22+
AC_DEFUN([PGAC_CHECK_PERL_CONFIGS],
23+
[m4_foreach([pgac_item],[$1],[PGAC_CHECK_PERL_CONFIG(pgac_item)])])
2524

26-
AC_MSG_RESULT(done)
27-
])
25+
26+
# PGAC_CHECK_PERL_EMBED_LDFLAGS
27+
# -----------------------------
28+
AC_DEFUN([PGAC_CHECK_PERL_EMBED_LDFLAGS],
29+
[AC_REQUIRE([PGAC_PATH_PERL])
30+
AC_MSG_CHECKING(forflagstolinkembeddedPerl)
31+
pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
32+
pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
33+
perl_embed_ldflags=`echo X"$pgac_tmp1" | sed "s/^X//;s%$pgac_tmp2%%"`
34+
AC_SUBST(perl_embed_ldflags)dnl
35+
AC_MSG_RESULT([$perl_embed_ldflags])])

‎configure

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4956,19 +4956,44 @@ fi
49564956
49574957
iftest"$with_perl" = yes;then
49584958
4959-
4960-
echo"$as_me:$LINENO: checking Perl installation directories">&5
4961-
echo$ECHO_N"checking Perl installation directories...$ECHO_C">&6
4962-
4963-
# These are the ones we currently need. Others can be added easily.
4959+
echo"$as_me:$LINENO: checking for Perl installsitearch">&5
4960+
echo$ECHO_N"checking for Perl installsitearch...$ECHO_C">&6
49644961
perl_installsitearch=`$PERL -MConfig -e'print $Config{installsitearch}'`
4965-
perl_installsitelib=`$PERL -MConfig -e'print $Config{installsitelib}'`
4962+
echo"$as_me:$LINENO: result:$perl_installsitearch">&5
4963+
echo"${ECHO_T}$perl_installsitearch">&6
4964+
echo"$as_me:$LINENO: checking for Perl installman3dir">&5
4965+
echo$ECHO_N"checking for Perl installman3dir...$ECHO_C">&6
49664966
perl_installman3dir=`$PERL -MConfig -e'print $Config{installman3dir}'`
4967-
4968-
4969-
echo"$as_me:$LINENO: result: done">&5
4970-
echo"${ECHO_T}done">&6
4971-
4967+
echo"$as_me:$LINENO: result:$perl_installman3dir">&5
4968+
echo"${ECHO_T}$perl_installman3dir">&6
4969+
echo"$as_me:$LINENO: checking for Perl archlibexp">&5
4970+
echo$ECHO_N"checking for Perl archlibexp...$ECHO_C">&6
4971+
perl_archlibexp=`$PERL -MConfig -e'print $Config{archlibexp}'`
4972+
echo"$as_me:$LINENO: result:$perl_archlibexp">&5
4973+
echo"${ECHO_T}$perl_archlibexp">&6
4974+
echo"$as_me:$LINENO: checking for Perl privlibexp">&5
4975+
echo$ECHO_N"checking for Perl privlibexp...$ECHO_C">&6
4976+
perl_privlibexp=`$PERL -MConfig -e'print $Config{privlibexp}'`
4977+
echo"$as_me:$LINENO: result:$perl_privlibexp">&5
4978+
echo"${ECHO_T}$perl_privlibexp">&6
4979+
echo"$as_me:$LINENO: checking for Perl useshrplib">&5
4980+
echo$ECHO_N"checking for Perl useshrplib...$ECHO_C">&6
4981+
perl_useshrplib=`$PERL -MConfig -e'print $Config{useshrplib}'`
4982+
echo"$as_me:$LINENO: result:$perl_useshrplib">&5
4983+
echo"${ECHO_T}$perl_useshrplib">&6
4984+
echo"$as_me:$LINENO: checking for Perl man3ext">&5
4985+
echo$ECHO_N"checking for Perl man3ext...$ECHO_C">&6
4986+
perl_man3ext=`$PERL -MConfig -e'print $Config{man3ext}'`
4987+
echo"$as_me:$LINENO: result:$perl_man3ext">&5
4988+
echo"${ECHO_T}$perl_man3ext">&6
4989+
4990+
echo"$as_me:$LINENO: checking for flags to link embedded Perl">&5
4991+
echo$ECHO_N"checking for flags to link embedded Perl...$ECHO_C">&6
4992+
pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
4993+
pgac_tmp2=`$PERL -MConfig -e'print $Config{ccdlflags}'`
4994+
perl_embed_ldflags=`echo X"$pgac_tmp1"| sed"s/^X//;s%$pgac_tmp2%%"`
4995+
echo"$as_me:$LINENO: result:$perl_embed_ldflags">&5
4996+
echo"${ECHO_T}$perl_embed_ldflags">&6
49724997
fi
49734998
49744999
iftest"$with_python" = yes;then
@@ -17414,8 +17439,12 @@ s,@YFLAGS@,$YFLAGS,;t t
1741417439
s,@WISH@,$WISH,;t t
1741517440
s,@PERL@,$PERL,;t t
1741617441
s,@perl_installsitearch@,$perl_installsitearch,;t t
17417-
s,@perl_installsitelib@,$perl_installsitelib,;t t
1741817442
s,@perl_installman3dir@,$perl_installman3dir,;t t
17443+
s,@perl_archlibexp@,$perl_archlibexp,;t t
17444+
s,@perl_privlibexp@,$perl_privlibexp,;t t
17445+
s,@perl_useshrplib@,$perl_useshrplib,;t t
17446+
s,@perl_man3ext@,$perl_man3ext,;t t
17447+
s,@perl_embed_ldflags@,$perl_embed_ldflags,;t t
1741917448
s,@PYTHON@,$PYTHON,;t t
1742017449
s,@python_version@,$python_version,;t t
1742117450
s,@python_prefix@,$python_prefix,;t t

‎configure.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $Header: /cvsroot/pgsql/configure.in,v 1.185 2002/05/24 18:10:17 petere Exp $
2+
dnl $Header: /cvsroot/pgsql/configure.in,v 1.186 2002/05/28 16:57:53 petere Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -661,7 +661,9 @@ fi
661661

662662
PGAC_PATH_PERL
663663
if test "$with_perl" = yes; then
664-
PGAC_CHECK_PERL_DIRS
664+
PGAC_CHECK_PERL_CONFIGS([installsitearch,installman3dir,
665+
archlibexp,privlibexp,useshrplib,man3ext])
666+
PGAC_CHECK_PERL_EMBED_LDFLAGS
665667
fi
666668

667669
if test "$with_python" = yes; then

‎src/Makefile.global.in

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*-makefile-*-
2-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.147 2002/05/24 18:10:17 petere Exp $
2+
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.148 2002/05/28 16:57:53 petere Exp $
33

44
#------------------------------------------------------------------------------
55
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -214,8 +214,12 @@ X = @EXEEXT@
214214

215215
PERL= @PERL@
216216
perl_installsitearch= @perl_installsitearch@
217-
perl_installsitelib= @perl_installsitelib@
218217
perl_installman3dir= @perl_installman3dir@
218+
perl_archlibexp= @perl_archlibexp@
219+
perl_privlibexp= @perl_privlibexp@
220+
perl_useshrplib= @perl_useshrplib@
221+
perl_embed_ldflags= @perl_embed_ldflags@
222+
perl_man3ext= @perl_man3ext@
219223

220224
# Miscellaneous
221225

‎src/interfaces/perl5/GNUmakefile

Lines changed: 48 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
1-
# This file is an interface from the Autoconf world to Perl's
2-
# MakeMaker world, so that the latter behaves (kind of) like the
3-
# former would prefer. Internally, we call Perl to create another
4-
# Makefile according to its own ideas and then invoke the rules from
5-
# that file.
6-
#
7-
# $Header: /cvsroot/pgsql/src/interfaces/perl5/Attic/GNUmakefile,v 1.6 2001/08/26 22:28:04 petere Exp $
1+
# $Header: /cvsroot/pgsql/src/interfaces/perl5/Attic/GNUmakefile,v 1.7 2002/05/28 16:57:53 petere Exp $
82

93
subdir = src/interfaces/perl5
104
top_builddir = ../../..
115
include$(top_builddir)/src/Makefile.global
126

13-
.NOTPARALLEL:
14-
157
# This would allow a non-root install of the Perl module, but it's not
168
# quite implemented yet.
179
ifeq ($(mysterious_feature),yes)
@@ -20,31 +12,49 @@ perl_installsitelib= $(pkglibdir)
2012
perl_installman3dir=$(mandir)/man3
2113
endif
2214

15+
overrideCPPFLAGS := -I$(libpq_srcdir) -I$(top_srcdir)/src/include$(CPPFLAGS) -I$(perl_archlibexp)/CORE
16+
overrideCFLAGS +=$(CFLAGS_SL)
17+
overrideCPPFLAGS+=-DXS_VERSION=\"$(shell sed -n "s/\$$.*::VERSION.*=.*'\(.*\)';/\1/p"$(srcdir)/Pg.pm)\"
18+
19+
# The code isn't clean with regard to these warnings.
20+
ifeq ($(GCC),yes)
21+
overrideCFLAGS :=$(filter-out -Wall -Wmissing-declarations -Wmissing-prototypes,$(CFLAGS))
22+
endif
23+
24+
POD2MAN = pod2man
25+
26+
27+
NAME = Pg
28+
OBJS = Pg.o
29+
SO_MAJOR_VERSION = 0
30+
SO_MINOR_VERSION = 0
31+
SHLIB_LINK = -L$(libpq_builddir) -lpq
32+
33+
include$(top_srcdir)/src/Makefile.shlib
34+
2335

24-
all: Makefile libpq-all
25-
$(MAKE) -f$< all VPATH=$(VPATH)
26-
27-
# We need to run Makefile.PL in the source directory because it scans
28-
# the directory for files to build with. If we ran it in the build
29-
# dir it would miss all the files and not build half the stuff!
30-
Makefile: Makefile.PL Pg.pm
31-
abs_builddir=`pwd`;\
32-
abs_libpq_builddir=`cd$(libpq_builddir)&& pwd`;\
33-
cd$(srcdir)&&\
34-
SRCDIR=$(srcdir)\
35-
PGLIBDIR=$(libdir)\
36-
$(PERL)$<\
37-
INC='-I$(srcdir) -I$(libpq_srcdir) $(filter -I%, $(CPPFLAGS))'\
38-
LIBS="-L$$abs_libpq_builddir -lpq"\
39-
INSTALLSITEARCH='$$(DESTDIR)$(perl_installsitearch)'\
40-
INSTALLSITELIB='$$(DESTDIR)$(perl_installsitelib)'\
41-
INSTALLMAN3DIR='$$(DESTDIR)$(perl_installman3dir)'\
42-
MAKEFILE="$$abs_builddir/Makefile"
36+
all: all-lib Pg.pm Pg.bs auto/Pg/autosplit.ix Pg.$(perl_man3ext)
37+
38+
all-lib: libpq-all
4339

4440
.PHONY: libpq-all
4541
libpq-all:
4642
$(MAKE) -C$(libpq_builddir) all
4743

44+
Pg.c: Pg.xs typemap
45+
$(PERL)$(perl_privlibexp)/ExtUtils/xsubpp -typemap$(perl_privlibexp)/ExtUtils/typemap -typemap$(srcdir)/typemap$(srcdir)/Pg.xs>$@
46+
47+
auto/Pg/autosplit.ix: Pg.pm
48+
@$(mkinstalldirs) auto
49+
$(PERL) -MAutoSplit -e'autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1);'$< auto
50+
51+
Pg.bs:
52+
$(PERL) -MExtUtils::Mkbootstrap -e"Mkbootstrap('Pg', '');"
53+
touch$@
54+
55+
Pg.$(perl_man3ext): Pg.pm
56+
$(POD2MAN)$<$@
57+
4858

4959
# During install, we must guard against the likelihood that we don't
5060
# have permissions to install into the Perl module library. It's not
@@ -58,38 +68,24 @@ echo "*** `pwd`,"; \
5868
echo "*** become the appropriate user, and enter '$(MAKE) install'.";\
5969
echo ""; }
6070

61-
# We need to massage the packlist after installation to get the
62-
# DESTDIR out of there.
6371
install: all installdirs
6472
@iftest -w$(DESTDIR)$(perl_installsitearch);then\
65-
$(MAKE) -f Makefile pure_install DESTDIR=$(DESTDIR)&&\
66-
mv$(DESTDIR)$(perl_installsitearch)/auto/Pg/.packlist fake-packlist&&\
67-
sed's,^$(DESTDIR),,' fake-packlist>$(DESTDIR)$(perl_installsitearch)/auto/Pg/.packlist&&\
68-
rm fake-packlist;\
73+
$(INSTALL_DATA) Pg.pm$(DESTDIR)$(perl_installsitearch);\
74+
$(INSTALL_DATA) Pg.bs$(DESTDIR)$(perl_installsitearch)/auto/Pg;\
75+
$(INSTALL_SHLIB)$(shlib)$(DESTDIR)$(perl_installsitearch)/auto/Pg/Pg$(DLSUFFIX);\
76+
$(INSTALL_DATA) auto/Pg/autosplit.ix$(DESTDIR)$(perl_installsitearch)/auto/Pg;\
77+
$(INSTALL_DATA)$(srcdir)/Pg.$(perl_man3ext)$(DESTDIR)$(perl_installman3dir);\
6978
else\
7079
$(install-warning-msg);\
7180
fi
7281

73-
# Try to make the directories ourselves, otherwise the writability
74-
# test above may fail because of mere non-existence.
7582
installdirs:
76-
-$(mkinstalldirs)$(DESTDIR)$(perl_installsitearch)/auto/Pg\
77-
$(DESTDIR)$(perl_installsitelib)\
78-
$(DESTDIR)$(perl_installman3dir)
83+
-$(mkinstalldirs)$(DESTDIR)$(perl_installsitearch)/auto/Pg$(DESTDIR)$(perl_installman3dir)
7984

8085
uninstall:
81-
forfilein`cat$(DESTDIR)$(perl_installsitearch)/auto/Pg/.packlist`;do \
82-
rm -f$(DESTDIR)$$file||exit;\
83-
done
84-
rm -f$(DESTDIR)$(perl_installsitearch)/auto/Pg/.packlist
85-
-rmdir$(DESTDIR)$(perl_installsitearch)/auto/Pg
86-
87-
88-
cleandistcleanmaintainer-clean:
89-
-[-f Makefile ]&&$(MAKE) -f Makefile clean
90-
rm -f Makefile Makefile.old
91-
@rm -f fake-packlist
86+
rm -f$(addprefix$(DESTDIR)$(perl_installsitearch)/, Pg.pm auto/Pg/Pg.bs auto/Pg/Pg$(DLSUFFIX) auto/Pg/autosplit.ix)$(DESTDIR)$(perl_installman3dir)/Pg.$(perl_man3ext)
9287

9388

94-
installchecktest: Makefile
95-
$(MAKE) -f$<test
89+
cleandistcleanmaintainer-clean: clean-lib
90+
rm -f$(OBJS) Pg.c Pg.bs Pg.$(perl_man3ext)
91+
rm -rf auto

‎src/pl/plperl/GNUmakefile

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,60 @@
1-
# $Header: /cvsroot/pgsql/src/pl/plperl/GNUmakefile,v 1.9 2002/02/23 21:49:10 momjian Exp $
1+
# Makefile for PL/Perl
2+
# $Header: /cvsroot/pgsql/src/pl/plperl/GNUmakefile,v 1.10 2002/05/28 16:57:53 petere Exp $
23

34
subdir = src/pl/plperl
45
top_builddir = ../../..
56
include$(top_builddir)/src/Makefile.global
67

7-
ifeq ($(allow_nonpic_in_shlib),yes)
8-
makefile_pl_flags =--force
8+
ifeq ($(perl_useshrplib),true)
9+
shared_libperl =yes
910
endif
1011

12+
# If we don't have a shared library and the platform doesn't allow it
13+
# to work without, we have to skip it.
14+
ifneq (,$(findstring yes,$(shared_libperl)$(allow_nonpic_in_shlib)))
1115

12-
all: Makefile
13-
$(MAKE) -f$< all VPATH=$(VPATH)
16+
# The code isn't clean with regard to these warnings.
17+
ifeq ($(GCC),yes)
18+
overrideCFLAGS :=$(filter-out -Wall -Wmissing-declarations -Wmissing-prototypes,$(CFLAGS))
19+
endif
20+
21+
overrideCPPFLAGS := -I$(srcdir) -I$(perl_archlibexp)/CORE$(CPPFLAGS)
22+
23+
24+
NAME = plperl
25+
SO_MAJOR_VERSION = 0
26+
SO_MINOR_VERSION = 0
27+
28+
OBJS = plperl.o eloglvl.o SPI.o
29+
SHLIB_LINK =$(perl_embed_ldflags)$(BE_DLLLIBS)
30+
31+
include$(top_srcdir)/src/Makefile.shlib
1432

15-
Makefile: Makefile.PL
16-
plperl_installdir='$$(DESTDIR)$(pkglibdir)'\
17-
$(PERL)$<$(makefile_pl_flags) LIBS='$(BE_DLLLIBS)'\
18-
INC='-I$(srcdir) $(filter -I%, $(CPPFLAGS))'
33+
34+
all: all-lib
35+
36+
SPI.c: SPI.xs
37+
$(PERL)$(perl_privlibexp)/ExtUtils/xsubpp -typemap$(perl_privlibexp)/ExtUtils/typemap$<>$@
1938

2039
install: all installdirs
21-
$(MAKE) -f Makefile install DESTDIR='$(DESTDIR)'
40+
$(INSTALL_SHLIB)$(shlib)$(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)
2241

2342
installdirs:
2443
$(mkinstalldirs)$(DESTDIR)$(pkglibdir)
2544

2645
uninstall:
2746
rm -f$(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)
2847

29-
cleandistcleanmaintainer-clean:
30-
-[-f Makefile ]&&$(MAKE) -f Makefile clean
31-
rm -f Makefile Makefile.old
48+
cleandistcleanmaintainer-clean: clean-lib
49+
rm -f SPI.c$(OBJS)
50+
51+
else # can't build
52+
53+
all:
54+
@echo"";\
55+
echo"*** Cannot build PL/Perl because libperl is not a shared library.";\
56+
echo"*** You might have to rebuild your Perl installation. Refer to";\
57+
echo"*** the documentation for details.";\
58+
echo""
59+
60+
endif# can't build

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp