Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 50 lines (41 sloc) 1.465 kb
fa0373e @jparise Adding support for the new Win32 build system. This should work for bot...
authored
1 // $Id$
53639fc @jparise We now use both PYTHONHOME and the python executable to make the Windows...
authored
2 // vim:ft=javascript noet
fa0373e @jparise Adding support for the new Win32 build system. This should work for bot...
authored
3
4 ARG_WITH("python", "Embedded Python support", "no");
5
53639fc @jparise We now use both PYTHONHOME and the python executable to make the Windows...
authored
6 function get_python_version(PYTHON)
7 {
8 var ver = execute('cmd /c ""' + PYTHON + '" -V 2>&1"');
9 if (ver.match(/Python (\d+)\.(\d+)/)) {
10 return RegExp.$1 + RegExp.$2;
11 }
12 return 0;
13 }
14
c16730e @jparise When building under Windows, we now query the base Python installation
authored
15 function get_python_prefix(PYTHON)
16 {
17 var cmd = '-c "from distutils.sysconfig import *; print PREFIX,"'
18 var out = execute('cmd /c ""' + PYTHON + '" ' + cmd + ' 2>&1"');
19 return out.replace(new RegExp('\r\n'), '');
20 }
fa0373e @jparise Adding support for the new Win32 build system. This should work for bot...
authored
21
c16730e @jparise When building under Windows, we now query the base Python installation
authored
22 if (PHP_PYTHON != "no") {
53639fc @jparise We now use both PYTHONHOME and the python executable to make the Windows...
authored
23 PYTHON = PATH_PROG('python');
24 if (!PYTHON) {
d8d7ba5 @jparise We no longer throw a fatal error if the configuration process fails to f...
authored
25 WARNING('Python not enabled; python executable not found')
26 } else {
27 PYTHON_VERSION = get_python_version(PYTHON);
28 if (PYTHON_VERSION < 24) {
29 WARNING('Python' + PYTHON_VERSION +
30 ' is not officially supported by the python extension');
31 }
32
33 PYTHON_PREFIX = get_python_prefix(PYTHON);
34 PYTHON_INCPATH = PYTHON_PREFIX + '\\include';
35 PYTHON_LIBPATH = PYTHON_PREFIX + '\\libs';
36
37 var libname = 'python' + PYTHON_VERSION;
38 libname += (PHP_DEBUG == 'yes') ? '_d.lib' : '.lib';
39
40 if (!CHECK_HEADER_ADD_INCLUDE("Python.h", "CFLAGS_PYTHON", PYTHON_INCPATH)
41 || !CHECK_LIB(libname, "python", PYTHON_LIBPATH)) {
42 WARNING("Python not enabled; libraries and headers not found");
43 } else {
b52563e @jparise Implementing initial support for intercepting Python streams. By defaul...
authored
44 EXTENSION("python", "python.c python_convert.c python_handlers.c python_object.c python_php.c python_streams.c", PHP_PYTHON_SHARED, "/D PYTHON_EXPORTS");
d8d7ba5 @jparise We no longer throw a fatal error if the configuration process fails to f...
authored
45 AC_DEFINE("HAVE_PYTHON", 1);
46 }
53639fc @jparise We now use both PYTHONHOME and the python executable to make the Windows...
authored
47 }
fa0373e @jparise Adding support for the new Win32 build system. This should work for bot...
authored
48 }
49
Something went wrong with that request. Please try again.