summaryrefslogtreecommitdiff
path: root/scripts/TestUtil.py
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-06-15 18:06:00 +0200
committerJose <jose@zeroc.com>2016-06-15 18:06:00 +0200
commit99855eefd7419c24e9b204fb851ec95adc581b4e (patch)
tree0d79a68449d770c3c550b43121c0d6d43f602d14 /scripts/TestUtil.py
parentAllow java libraries to override pom scm data (diff)
parentStack trace test expec files for Linux (diff)
downloadice-99855eefd7419c24e9b204fb851ec95adc581b4e.tar.bz2
ice-99855eefd7419c24e9b204fb851ec95adc581b4e.tar.xz
ice-99855eefd7419c24e9b204fb851ec95adc581b4e.zip
Merge branch '3.6-stretch' into 3.6
Diffstat (limited to 'scripts/TestUtil.py')
-rwxr-xr-xscripts/TestUtil.py28
1 files changed, 18 insertions, 10 deletions
diff --git a/scripts/TestUtil.py b/scripts/TestUtil.py
index e766ca80622..b2a2524f77a 100755
--- a/scripts/TestUtil.py
+++ b/scripts/TestUtil.py
@@ -108,6 +108,16 @@ def isSparc():
else:
return False
+def dpkgHostMultiArch():
+ p = subprocess.Popen("dpkg-architecture -qDEB_HOST_MULTIARCH", stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
+ if not p or not p.stdout:
+ print("unable to get system information!")
+ sys.exit(1)
+ return p.stdout.readline().decode("utf-8").strip()
+
+def isI686():
+ return x86 or any(platform.machine() == p for p in ["i386", "i686"])
+
def isAIX():
return sys.platform.startswith("aix")
@@ -115,7 +125,7 @@ def isDarwin():
return sys.platform == "darwin"
def isLinux():
- return sys.platform.startswith("linux")
+ return sys.platform.startswith("linux") or sys.platform.startswith("gnukfreebsd")
def isUbuntu():
return isLinux() and linuxDistribution and linuxDistribution == "Ubuntu"
@@ -127,11 +137,14 @@ def isYocto():
return isLinux() and linuxDistribution and linuxDistribution == "Yocto"
def isDebian():
- return isLinux() and linuxDistribution and linuxDistribution == "Debian"
+ return (isLinux() and linuxDistribution and linuxDistribution == "Debian")
def isSles():
return isLinux() and linuxDistribution and linuxDistribution == "SUSE LINUX"
+def iceUseOpenSSL():
+ return any(sys.platform.startswith(p) for p in ["linux", "freebsd"])
+
def getCppCompiler():
compiler = ""
if os.environ.get("CPP_COMPILER", "") != "":
@@ -793,7 +806,7 @@ def getIceBox():
iceBox += "d"
iceBox += ".exe"
elif isLinux():
- if not x64 and not armv7l:
+ if isI686():
iceBox += "32"
if cpp11:
iceBox += "++11"
@@ -1776,12 +1789,7 @@ def getCppLibDir(lang = None):
else:
libDir = os.path.join(getIceDir("cpp"), "lib")
if isUbuntu() or isDebian():
- if armv7l:
- libDir = os.path.join(libDir, "arm-linux-gnueabihf")
- elif x64:
- libDir = os.path.join(libDir, "x86_64-linux-gnu")
- else:
- libDir = os.path.join(libDir, "i386-linux-gnu")
+ libDir = os.path.join(libDir, dpkgHostMultiArch())
elif x64:
if isSolaris():
if isSparc():
@@ -1811,7 +1819,7 @@ def getJavaLibraryPath():
libpath = os.environ["LD_LIBRARY_PATH"] + ":" + libpath
return "-Djava.library.path=%s " % libpath
elif isUbuntu() or isDebian():
- libpath = ("/usr/lib/x86_64-linux-gnu" if x64 else "/usr/lib/i386-linux-gnu")
+ libpath = "/usr/lib/" + dpkgHostMultiArch()
if "LD_LIBRARY_PATH" in os.environ:
libpath = os.environ["LD_LIBRARY_PATH"] + ":" + libpath
return "-Djava.library.path=%s " % libpath