Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 42ae4f2

Browse files
committed
Turn on plpython build by default if we have something that looks like a
shared library, or we can do without one.
1 parent af70014 commit 42ae4f2

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

src/Makefile.global.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*-makefile-*-
2-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.133 2001/08/26 22:28:04 petere Exp $
2+
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.134 2001/08/27 00:29:49 petere Exp $
33

44
#------------------------------------------------------------------------------
55
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -128,6 +128,7 @@ python_includespec = @python_includespec@
128128
python_moduledir = @python_moduledir@
129129
python_moduleexecdir = @python_moduleexecdir@
130130
python_libspec = @python_libspec@
131+
python_configdir = @python_configdir@
131132

132133
krb_srvtab = @krb_srvtab@
133134

src/pl/Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/pl/Makefile,v 1.20 2001/05/12 01:30:30 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/pl/Makefile,v 1.21 2001/08/27 00:29:49 petere Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -22,10 +22,9 @@ ifeq ($(with_perl), yes)
2222
DIRS += plperl
2323
endif
2424

25-
# Doesn't build portably yet.
26-
#ifeq ($(with_python), yes)
27-
#DIRS += plpython
28-
#endif
25+
ifeq ($(with_python), yes)
26+
DIRS += plpython
27+
endif
2928

3029
all install installdirs uninstall depend distprep:
3130
@for dir in $(DIRS); do $(MAKE) -C $$dir $@ || exit; done

src/pl/plpython/Makefile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1-
# $Header: /cvsroot/pgsql/src/pl/plpython/Makefile,v 1.8 2001/07/10 16:33:02 petere Exp $
1+
# $Header: /cvsroot/pgsql/src/pl/plpython/Makefile,v 1.9 2001/08/27 00:29:49 petere Exp $
22

33
subdir = src/pl/plpython
44
top_builddir = ../../..
55
include $(top_builddir)/src/Makefile.global
66

77

8+
# On some platforms we can only build PL/Python if libpython is a
9+
# shared library. Since there is no official way to determine this,
10+
# we see if there is a file that is named like a shared library.
11+
ifneq (,$(wildcard $(python_configdir)/libpython*$(DLSUFFIX)*))
12+
shared_libpython = yes
13+
endif
14+
15+
# If we don't have a shared library and the platform doesn't allow it
16+
# to work without, we have to skip it.
17+
ifneq (,$(findstring yes, $(shared_libpython)$(allow_nonpic_in_shlib)))
18+
819
override CPPFLAGS := -I$(srcdir) $(python_includespec) $(CPPFLAGS)
920

1021
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
@@ -36,3 +47,14 @@ clean distclean maintainer-clean: clean-lib
3647

3748
installcheck:
3849
PATH=$(bindir):$$PATH $(SHELL) $(srcdir)/test.sh
50+
51+
else # can't build
52+
53+
all:
54+
@echo ""; \
55+
echo "*** Cannot build PL/Python because libpython is not a shared library." ; \
56+
echo "*** You might have to rebuild your Python installation. Refer to"; \
57+
echo "*** the documentation for details."; \
58+
echo ""
59+
60+
endif # can't build

0 commit comments

Comments
 (0)