Enable 2-3-compatible PYMODULE for proper work with PY23_NATIVE_LIBRARY
+ Use these in yt/19_4/yt/python
@@ -1308,19 +1308,29 @@ module DLL_UNIT: LINK_UNIT {
}
### @usage: PYMODULE(name, major_ver [minor_ver] [EXPORTS symlist_file] [PREFIX prefix])
-### Definition of the project is a Python module.
+### Definition of the project is a Python module for Python2 and any system Python
### 1. major_ver and minor_ver must be integers.
### 2. The resulting .so will have the prefix "lib".
### 3. Processing EXPORTS and PREFIX is the same as for DLL module
###
+### Note: this module will always PEERDIR Python2 version of PY23_NATIVE_LIBRARY
### Module declaration must be finished with the macro END().
-module PYMODULE: DLL_UNIT {
- when ($MSVC != "yes" && $DARWIN != "yes") {
- LDFLAGS+= -Wl,-Bsymbolic
+module PYMODULE: PY_ANY_MODULE {
+ PYTHON2_MODULE()
+ .RESTRICTED=PYTHON3_MODULE PYTHON3_ADDINCL
}
- when ($USE_ARCADIA_PYTHON == "yes" && $MSVC == "yes" || $IS_CROSS_TOOLS == "yes") {
- PEERDIR+=contrib/tools/python/lib
+### @usage: PY_ANY_MODULE(name, major_ver [minor_ver] [EXPORTS symlist_file] [PREFIX prefix])
+### Definition of the project is a Python module for any arcadia and system Python
+### 1. major_ver and minor_ver must be integers.
+### 2. The resulting .so will have the prefix "lib".
+### 3. Processing EXPORTS and PREFIX is the same as for DLL module
+###
+### Note: Use PYTHON2_MODULE()/PYTHON3_MODULE in order to PEERDIR proper version of PY23_NATIVE_LIBRARY
+### Module declaration must be finished with the macro END().
+module PY_ANY_MODULE: DLL_UNIT {
+ when ($MSVC != "yes" && $DARWIN != "yes") {
+ LDFLAGS+= -Wl,-Bsymbolic
}
when ($USE_ARCADIA_PYTHON == "no") {
@@ -1338,7 +1348,6 @@ module PYMODULE: DLL_UNIT {
when ($DARWIN == "yes") {
LDFLAGS+=-flat_namespace
}
- PYTHON_ADDINCL()
when ($MSVC == "yes" || $CYGWIN == "yes") {
MODULE_PREFIX=
@@ -1348,7 +1357,23 @@ module PYMODULE: DLL_UNIT {
MODULE_PREFIX=
MODULE_SUFFIX=.so$MODULE_VERSION
}
- .RESTRICTED=PYTHON3_ADDINCL USE_PYTHON USE_PYTHON3 PY_SRCS PY_MAIN
+ .RESTRICTED=USE_PYTHON USE_PYTHON3 PY_SRCS PY_MAIN
+}
+
+macro PYTHON2_MODULE() {
+ when ($USE_ARCADIA_PYTHON == "yes" && $MSVC == "yes" || $IS_CROSS_TOOLS == "yes") {
+ PEERDIR+=contrib/tools/python/lib
+ }
+
+ PYTHON_ADDINCL()
+}
+
+macro PYTHON3_MODULE() {
+ when ($USE_ARCADIA_PYTHON == "yes" && $MSVC == "yes" || $IS_CROSS_TOOLS == "yes") {
+ PEERDIR+=contrib/tools/python3/lib
+ }
+
+ PYTHON3_ADDINCL()
}
module R_MODULE: DLL_UNIT {
