Skip to content

Commit 5953d33

Browse files
committed
Updated makehelper.py with support for Windows using the file version of epics-modules#39.
1 parent a1ae41c commit 5953d33

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

makehelper.py

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,45 +26,34 @@
2626
pass
2727
out = open(sys.argv[1], 'w')
2828

29-
from sysconfig import get_config_var
30-
try:
31-
# NB, sysconfig.get_python_inc doesn't exist, but distutils.sysconfig.get_python_inc does for Python <= 3.11
32-
from distutils.sysconfig import get_python_inc
33-
except ImportError:
34-
def get_python_inc():
35-
return get_config_var('INCLUDEPY') or ''
29+
from sysconfig import get_config_var, get_path, get_python_version
3630

37-
incdirs = [get_python_inc()]
38-
libdirs = [
39-
# distutils.sysconfig.get_python_lib does not appear to work correctly on Ubuntu with Python versions < 3.10
40-
get_config_var('LIBDIR') or get_config_var('LIBDEST') or '',
41-
get_config_var('BINDIR') or '',
42-
]
31+
incdirs = [get_path("include")]
32+
libdir = get_config_var('LIBDIR') or get_config_var('LIBDEST') or ''
4333

4434
have_np='NO'
4535
try:
46-
from numpy.distutils.misc_util import get_numpy_include_dirs
47-
incdirs = get_numpy_include_dirs()+incdirs
36+
from numpy import get_include
37+
numpy_dir = [get_include()]
38+
incdirs = numpy_dir+incdirs
4839
have_np='YES'
4940
except ImportError:
5041
pass
5142

5243
print('TARGET_CFLAGS +=',get_config_var('BASECFLAGS') or '', file=out)
5344
print('TARGET_CXXFLAGS +=',get_config_var('BASECFLAGS') or '', file=out)
5445

55-
print('PY_VER :=',get_config_var('VERSION'), file=out)
46+
print('PY_VER :=',get_python_version(), file=out)
5647
ldver = get_config_var('LDVERSION')
5748
if ldver is None:
5849
ldver = get_config_var('VERSION')
5950
if get_config_var('Py_DEBUG'):
6051
ldver = ldver+'_d'
6152
print('PY_LD_VER :=',ldver, file=out)
6253
print('PY_INCDIRS :=',' '.join(incdirs), file=out)
63-
print('PY_LIBDIRS :=',' '.join(libdirs), file=out)
54+
print('PY_LIBDIRS :=',libdir, file=out)
6455
if sys.platform == 'win32':
6556
print('PY_LDLIBS :=', '/LIBPATH:' + os.path.join(sys.prefix, 'libs'), file=out)
66-
else:
67-
print('PY_LDLIBS :=', get_config_var('BLDLIBRARY') or '', file=out)
6857
print('HAVE_NUMPY :=',have_np, file=out)
6958

7059
try:

0 commit comments

Comments
 (0)