Skip to content

Commit 86a39d5

Browse files
committed
Un-break plpython build for non-Windows platforms.
1 parent ea12f8e commit 86a39d5

File tree

3 files changed

+15
-30
lines changed

3 files changed

+15
-30
lines changed

config/python.m4

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Autoconf macros for configuring the build of Python extension modules
33
#
4-
# $PostgreSQL: pgsql/config/python.m4,v 1.9 2004/10/06 09:20:40 momjian Exp $
4+
# $PostgreSQL: pgsql/config/python.m4,v 1.10 2004/10/10 19:07:52 tgl Exp $
55
#
66

77
# PGAC_PATH_PYTHON
@@ -29,24 +29,16 @@ else
2929
AC_MSG_RESULT(no)
3030
AC_MSG_ERROR([distutils module not found])
3131
fi
32-
AC_MSG_CHECKING([Python installation directories])
32+
AC_MSG_CHECKING([Python configuration directory])
3333
python_version=`${PYTHON} -c "import sys; print sys.version[[:3]]"`
34-
python_prefix=`${PYTHON} -c "import sys; print sys.prefix"`
35-
python_execprefix=`${PYTHON} -c "import sys; print sys.exec_prefix"`
3634
python_configdir=`${PYTHON} -c "from distutils.sysconfig import get_python_lib as f; import os; print os.path.join(f(plat_specific=1,standard_lib=1),'config')"`
3735
python_includespec=`${PYTHON} -c "import distutils.sysconfig; print '-I'+distutils.sysconfig.get_python_inc()"`
3836
39-
AC_SUBST(python_prefix)[]dnl
40-
AC_SUBST(python_execprefix)[]dnl
37+
AC_SUBST(python_version)[]dnl
4138
AC_SUBST(python_configdir)[]dnl
4239
AC_SUBST(python_includespec)[]dnl
43-
AC_SUBST(python_version)[]dnl
4440
# This should be enough of a message.
45-
if test "$python_prefix" != "$python_execprefix"; then
46-
AC_MSG_RESULT([$python_prefix/lib/python${python_version} and $python_execprefix/lib/python${python_version}])
47-
else
48-
AC_MSG_RESULT([$python_prefix/lib/python${python_version}])
49-
fi
41+
AC_MSG_RESULT([$python_configdir])
5042
])# _PGAC_CHECK_PYTHON_DIRS
5143

5244

@@ -56,7 +48,7 @@ AC_DEFUN([PGAC_CHECK_PYTHON_EMBED_SETUP],
5648
[AC_REQUIRE([_PGAC_CHECK_PYTHON_DIRS])
5749
AC_MSG_CHECKING([how to link an embedded Python application])
5850
59-
python_libspec=`${PYTHON} -c "import distutils.sysconfig,string;print string.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','LOCALMODLIBS','BASEMODLIBS')))"`
51+
python_libspec=`${PYTHON} -c "import distutils.sysconfig,string; print '-lpython${python_version} '+string.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','LOCALMODLIBS','BASEMODLIBS')))"`
6052
6153
AC_MSG_RESULT([${python_libspec}])
6254

configure

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4235,28 +4235,21 @@ echo "${ECHO_T}no" >&6
42354235
echo "$as_me: error: distutils module not found" >&2;}
42364236
{ (exit 1); exit 1; }; }
42374237
fi
4238-
echo "$as_me:$LINENO: checking Python installation directories" >&5
4239-
echo $ECHO_N "checking Python installation directories... $ECHO_C" >&6
4238+
echo "$as_me:$LINENO: checking Python configuration directory" >&5
4239+
echo $ECHO_N "checking Python configuration directory... $ECHO_C" >&6
42404240
python_version=`${PYTHON} -c "import sys; print sys.version[:3]"`
4241-
python_prefix=`${PYTHON} -c "import sys; print sys.prefix"`
4242-
python_execprefix=`${PYTHON} -c "import sys; print sys.exec_prefix"`
42434241
python_configdir=`${PYTHON} -c "from distutils.sysconfig import get_python_lib as f; import os; print os.path.join(f(plat_specific=1,standard_lib=1),'config')"`
42444242
python_includespec=`${PYTHON} -c "import distutils.sysconfig; print '-I'+distutils.sysconfig.get_python_inc()"`
42454243

42464244
# This should be enough of a message.
4247-
if test "$python_prefix" != "$python_execprefix"; then
4248-
echo "$as_me:$LINENO: result: $python_prefix/lib/python${python_version} and $python_execprefix/lib/python${python_version}" >&5
4249-
echo "${ECHO_T}$python_prefix/lib/python${python_version} and $python_execprefix/lib/python${python_version}" >&6
4250-
else
4251-
echo "$as_me:$LINENO: result: $python_prefix/lib/python${python_version}" >&5
4252-
echo "${ECHO_T}$python_prefix/lib/python${python_version}" >&6
4253-
fi
4245+
echo "$as_me:$LINENO: result: $python_configdir" >&5
4246+
echo "${ECHO_T}$python_configdir" >&6
42544247

42554248

42564249
echo "$as_me:$LINENO: checking how to link an embedded Python application" >&5
42574250
echo $ECHO_N "checking how to link an embedded Python application... $ECHO_C" >&6
42584251

4259-
python_libspec=`${PYTHON} -c "import distutils.sysconfig,string;print string.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','LOCALMODLIBS','BASEMODLIBS')))"`
4252+
python_libspec=`${PYTHON} -c "import distutils.sysconfig,string; print '-lpython${python_version} '+string.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','LOCALMODLIBS','BASEMODLIBS')))"`
42604253

42614254
echo "$as_me:$LINENO: result: ${python_libspec}" >&5
42624255
echo "${ECHO_T}${python_libspec}" >&6
@@ -18897,11 +18890,9 @@ s,@perl_privlibexp@,$perl_privlibexp,;t t
1889718890
s,@perl_useshrplib@,$perl_useshrplib,;t t
1889818891
s,@perl_embed_ldflags@,$perl_embed_ldflags,;t t
1889918892
s,@PYTHON@,$PYTHON,;t t
18900-
s,@python_prefix@,$python_prefix,;t t
18901-
s,@python_execprefix@,$python_execprefix,;t t
18893+
s,@python_version@,$python_version,;t t
1890218894
s,@python_configdir@,$python_configdir,;t t
1890318895
s,@python_includespec@,$python_includespec,;t t
18904-
s,@python_version@,$python_version,;t t
1890518896
s,@python_libspec@,$python_libspec,;t t
1890618897
s,@LIBOBJS@,$LIBOBJS,;t t
1890718898
s,@HAVE_IPV6@,$HAVE_IPV6,;t t

src/pl/plpython/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.15 2004/10/06 09:20:41 momjian Exp $
1+
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.16 2004/10/10 19:07:55 tgl Exp $
22

33
subdir = src/pl/plpython
44
top_builddir = ../../..
@@ -12,10 +12,12 @@ ifneq (,$(wildcard $(python_configdir)/libpython*$(DLSUFFIX)*))
1212
shared_libpython = yes
1313
endif
1414

15-
# Convert backslashed paths to normal slashes
15+
# Windows needs to convert backslashed paths to normal slashes,
16+
# and we have to remove -lpython from libspec since we are building our own
1617
ifeq ($(PORTNAME), win32)
1718
shared_libpython = yes
1819
python_includespec := $(subst \,/,$(python_includespec))
20+
python_libspec := $(subst -lpython$(python_version),,$(python_libspec))
1921
endif
2022

2123
# Darwin (OS X) has its own ideas about how to do this.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy