|
12 | 12 | except ImportError:
|
13 | 13 | import subprocess
|
14 | 14 | from os import environ
|
15 |
| -from os.path import dirname, join, exists |
| 15 | +from os.path import dirname, join, exists, isdir |
16 | 16 | import sys
|
17 | 17 | from platform import machine
|
18 | 18 | from setup_sdist import SETUP_KWARGS
|
@@ -119,6 +119,13 @@ def compile_native_invocation_handler(*possible_homes):
|
119 | 119 | )]
|
120 | 120 | else:
|
121 | 121 | LIB_LOCATION = 'jre/lib/server/libjvm.dylib'
|
| 122 | + FULL_LIB_LOCATION = join(JRE_HOME.decode(), LIB_LOCATION) |
| 123 | + |
| 124 | + if not exists(FULL_LIB_LOCATION): |
| 125 | + # In that case, the Java version is very likely >=9. |
| 126 | + # So we need to modify the `libjvm.so` path. |
| 127 | + LIB_LOCATION = 'lib/server/libjvm.dylib' |
| 128 | + |
122 | 129 | INCLUDE_DIRS = [
|
123 | 130 | '{0}/include'.format(FRAMEWORK),
|
124 | 131 | '{0}/include/darwin'.format(FRAMEWORK)
|
@@ -180,6 +187,12 @@ def compile_native_invocation_handler(*possible_homes):
|
180 | 187 | else:
|
181 | 188 | INCL_DIR = join(JDK_HOME, 'include', 'linux')
|
182 | 189 | LIB_LOCATION = 'jre/lib/{}/server/libjvm.so'.format(CPU)
|
| 190 | + FULL_LIB_LOCATION = join(JRE_HOME.decode(), LIB_LOCATION) |
| 191 | + |
| 192 | + if not exists(FULL_LIB_LOCATION): |
| 193 | + # In that case, the Java version is very likely >=9. |
| 194 | + # So we need to modify the `libjvm.so` path. |
| 195 | + LIB_LOCATION = 'lib/server/libjvm.so' |
183 | 196 |
|
184 | 197 | INCLUDE_DIRS = [
|
185 | 198 | join(JDK_HOME, 'include'),
|
|
0 commit comments