Permalink
Browse files

build: platform linux2 -> linux

see "sys.platform"
https://docs.python.org/2/library/sys.html

"Changed in version 2.7.3: Since lots of code check for
sys.platform == 'linux2', and there is no essential change
between Linux 2.x and 3.x, sys.platform is always set to
'linux2', even on Linux 3.x. In Python 3.3 and later, the
value will always be set to 'linux', so it is recommended
to always use the startswith idiom presented above."

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
  • Loading branch information...
rudimeier committed Mar 7, 2017
1 parent c43a462 commit 2ccf7e4b828c678577fc0ace24bdb4680ede207a
Showing with 23 additions and 21 deletions.
  1. +1 −1 jcc/python.py
  2. +22 −20 setup.py
View
@@ -1807,7 +1807,7 @@ def copytree(src, dst):
args['extra_link_args'] += ['-Wl,-rpath', shlibdir]
args['library_dirs'] = [shlibdir]
args['libraries'] = ['jcc']
elif sys.platform == 'linux2': # distutils no good with -R
elif sys.platform.startswith('linux'): # distutils no good with -R
args['extra_link_args'] += ['-Wl,-rpath', shlibdir]
args['library_dirs'] = [shlibdir]
args['libraries'] = ['jcc']
View
@@ -20,6 +20,8 @@
platform = 'ipod'
elif sys.platform == "win32" and "--compiler=mingw32" in sys.argv:
platform = 'mingw32'
elif sys.platform.startswith('linux'):
platform = 'linux'
else:
platform = sys.platform
@@ -55,7 +57,7 @@
JDK = {
'darwin': JAVAHOME or JAVAFRAMEWORKS,
'ipod': '/usr/include/gcc',
'linux2': '/usr/lib/jvm/java-8-oracle',
'linux': '/usr/lib/jvm/java-8-oracle',
'sunos5': '/usr/jdk/instances/jdk1.6.0',
'win32': JAVAHOME,
'mingw32': JAVAHOME,
@@ -89,8 +91,8 @@
'darwin/home': ['%(darwin)s/include' %(JDK),
'%(darwin)s/include/darwin' %(JDK)],
'ipod': ['%(ipod)s/darwin/default' %(JDK)],
'linux2': ['%(linux2)s/include' %(JDK),
'%(linux2)s/include/linux' %(JDK)],
'linux': ['%(linux)s/include' %(JDK),
'%(linux)s/include/linux' %(JDK)],
'sunos5': ['%(sunos5)s/include' %(JDK),
'%(sunos5)s/include/solaris' %(JDK)],
'win32': ['%(win32)s/include' %(JDK),
@@ -105,7 +107,7 @@
'darwin': ['-fno-strict-aliasing', '-Wno-write-strings',
'-mmacosx-version-min=10.5'],
'ipod': ['-Wno-write-strings'],
'linux2': ['-fno-strict-aliasing', '-Wno-write-strings'],
'linux': ['-fno-strict-aliasing', '-Wno-write-strings'],
'sunos5': ['-features=iddollar',
'-erroff=badargtypel2w,wbadinitl,wvarhidemem'],
'win32': ["/EHsc", "/D_CRT_SECURE_NO_WARNINGS"], # MSVC 9 (2008)
@@ -117,7 +119,7 @@
DEBUG_CFLAGS = {
'darwin': ['-O0', '-g', '-DDEBUG'],
'ipod': ['-O0', '-g', '-DDEBUG'],
'linux2': ['-O0', '-g', '-DDEBUG'],
'linux': ['-O0', '-g', '-DDEBUG'],
'sunos5': ['-DDEBUG'],
'win32': ['/Od', '/DDEBUG'],
'mingw32': ['-O0', '-g', '-DDEBUG'],
@@ -133,15 +135,15 @@
'-mmacosx-version-min=10.5'],
'ipod': ['-ljvm', '-lpython%s.%s' %(sys.version_info[0:2]),
'-L/usr/lib/gcc/arm-apple-darwin9/4.0.1'],
'linux2/i386': ['-L%(linux2)s/jre/lib/i386' %(JDK), '-ljava',
'-L%(linux2)s/jre/lib/i386/client' %(JDK), '-ljvm',
'-Wl,-rpath=%(linux2)s/jre/lib/i386:%(linux2)s/jre/lib/i386/client' %(JDK)],
'linux2/i686': ['-L%(linux2)s/jre/lib/i386' %(JDK), '-ljava',
'-L%(linux2)s/jre/lib/i386/client' %(JDK), '-ljvm',
'-Wl,-rpath=%(linux2)s/jre/lib/i386:%(linux2)s/jre/lib/i386/client' %(JDK)],
'linux2/x86_64': ['-L%(linux2)s/jre/lib/amd64' %(JDK), '-ljava',
'-L%(linux2)s/jre/lib/amd64/server' %(JDK), '-ljvm',
'-Wl,-rpath=%(linux2)s/jre/lib/amd64:%(linux2)s/jre/lib/amd64/server' %(JDK)],
'linux/i386': ['-L%(linux)s/jre/lib/i386' %(JDK), '-ljava',
'-L%(linux)s/jre/lib/i386/client' %(JDK), '-ljvm',
'-Wl,-rpath=%(linux)s/jre/lib/i386:%(linux)s/jre/lib/i386/client' %(JDK)],
'linux/i686': ['-L%(linux)s/jre/lib/i386' %(JDK), '-ljava',
'-L%(linux)s/jre/lib/i386/client' %(JDK), '-ljvm',
'-Wl,-rpath=%(linux)s/jre/lib/i386:%(linux)s/jre/lib/i386/client' %(JDK)],
'linux/x86_64': ['-L%(linux)s/jre/lib/amd64' %(JDK), '-ljava',
'-L%(linux)s/jre/lib/amd64/server' %(JDK), '-ljvm',
'-Wl,-rpath=%(linux)s/jre/lib/amd64:%(linux)s/jre/lib/amd64/server' %(JDK)],
'sunos5': ['-L%(sunos5)s/jre/lib/i386' %(JDK), '-ljava',
'-L%(sunos5)s/jre/lib/i386/client' %(JDK), '-ljvm',
'-R%(sunos5)s/jre/lib/i386:%(sunos5)s/jre/lib/i386/client' %(JDK)],
@@ -157,8 +159,8 @@
'mingw32': ["-Wl,--out-implib,%s"]
}
if platform == 'linux2':
LFLAGS['linux2'] = LFLAGS['linux2/%s' %(machine)]
if platform == 'linux':
LFLAGS['linux'] = LFLAGS['linux/%s' %(machine)]
elif platform == 'darwin':
if JAVAHOME is not None:
INCLUDES['darwin'] = INCLUDES['darwin/home']
@@ -170,7 +172,7 @@
JAVAC = {
'darwin': ['javac', '-source', '1.5', '-target', '1.5'],
'ipod': ['jikes', '-cp', '/usr/share/classpath/glibj.zip'],
'linux2': ['javac'],
'linux': ['javac'],
'sunos5': ['javac'],
'win32': ['%(win32)s/bin/javac.exe' %(JDK)],
'mingw32': ['%(mingw32)s/bin/javac.exe' %(JDK)],
@@ -180,7 +182,7 @@
JAVADOC = {
'darwin': ['javadoc'],
'ipod': [],
'linux2': ['javadoc'],
'linux': ['javadoc'],
'sunos5': ['javadoc'],
'win32': ['%(win32)s/bin/javadoc.exe' %(JDK)],
'mingw32': ['%(mingw32)s/bin/javadoc.exe' %(JDK)],
@@ -209,7 +211,7 @@
elif platform == 'darwin':
enable_shared = True
elif platform == 'linux2':
elif platform == 'linux':
from helpers.linux import patch_setuptools
enable_shared = patch_setuptools(with_setuptools)
@@ -328,7 +330,7 @@ def main(debug):
lflags + ['-install_name', '@rpath/libjcc.dylib',
'-current_version', jcc_ver,
'-compatibility_version', jcc_ver]
elif platform == 'linux2':
elif platform == 'linux':
kwds["extra_link_args"] = \
lflags + ['-lpython%s.%s' %(sys.version_info[0:2])]
kwds["force_shared"] = True # requires jcc/patches/patch.43

0 comments on commit 2ccf7e4

Please sign in to comment.