This repository has been archived by the owner on Dec 6, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathconfig.w32
49 lines (41 loc) · 1.43 KB
/
config.w32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// $Id$
// vim:ft=javascript noet
ARG_WITH("python", "Embedded Python support", "no");
function get_python_version(PYTHON)
{
var ver = execute('cmd /c ""' + PYTHON + '" -V 2>&1"');
if (ver.match(/Python (\d+)\.(\d+)/)) {
return RegExp.$1 + RegExp.$2;
}
return 0;
}
function get_python_prefix(PYTHON)
{
var cmd = '-c "from distutils.sysconfig import *; print PREFIX,"'
var out = execute('cmd /c ""' + PYTHON + '" ' + cmd + ' 2>&1"');
return out.replace(new RegExp('\r\n'), '');
}
if (PHP_PYTHON != "no") {
PYTHON = PATH_PROG('python');
if (!PYTHON) {
WARNING('Python not enabled; python executable not found')
} else {
PYTHON_VERSION = get_python_version(PYTHON);
if (PYTHON_VERSION < 24) {
WARNING('Python' + PYTHON_VERSION +
' is not officially supported by the python extension');
}
PYTHON_PREFIX = get_python_prefix(PYTHON);
PYTHON_INCPATH = PYTHON_PREFIX + '\\include';
PYTHON_LIBPATH = PYTHON_PREFIX + '\\libs';
var libname = 'python' + PYTHON_VERSION;
libname += (PHP_DEBUG == 'yes') ? '_d.lib' : '.lib';
if (!CHECK_HEADER_ADD_INCLUDE("Python.h", "CFLAGS_PYTHON", PYTHON_INCPATH)
|| !CHECK_LIB(libname, "python", PYTHON_LIBPATH)) {
WARNING("Python not enabled; libraries and headers not found");
} else {
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");
AC_DEFINE("HAVE_PYTHON", 1);
}
}
}