From ea325c7cd3410b15376cab1c158cb37fe54adc21 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Sat, 19 Nov 2005 20:13:46 +0000 Subject: [PATCH] Add $PKGCHK and $PKGINFO variables for use on Solaris, and make the default $PKGCHECK = /usr/sbin/pkgcheck. git-svn-id: http://scons.tigris.org/svn/scons/trunk@1396 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 5 +++++ src/engine/MANIFEST-xml.in | 1 + src/engine/SCons/Platform/sunos.py | 2 ++ src/engine/SCons/Platform/sunos.xml | 30 +++++++++++++++++++++++++++++ src/engine/SCons/Tool/sunc++.py | 9 ++++++--- 5 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 src/engine/SCons/Platform/sunos.xml diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 7ae07255..eead5e92 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -395,6 +395,11 @@ RELEASE 0.97 - XXX - Add /usr/ccs/bin to the end of the the default external execution PATH on Solaris. + - Add $PKGCHK and $PKGINFO variables for use on Solaris when searching + for the SunPRO C++ compiler. Make the default value for $PKGCHK + be /usr/sbin/pgkchk (since /usr/sbin isn't usually on the external + execution $PATH). + From Chen Lee: - Handle Visual Studio project and solution files in Unicode. diff --git a/src/engine/MANIFEST-xml.in b/src/engine/MANIFEST-xml.in index d8082c70..e360a1af 100644 --- a/src/engine/MANIFEST-xml.in +++ b/src/engine/MANIFEST-xml.in @@ -3,6 +3,7 @@ SCons/Defaults.xml SCons/Environment.xml SCons/Platform/__init__.xml SCons/Platform/posix.xml +SCons/Platform/sunos.xml SCons/Platform/win32.xml SCons/Tool/386asm.xml SCons/Tool/aixcc.xml diff --git a/src/engine/SCons/Platform/sunos.py b/src/engine/SCons/Platform/sunos.py index 5f4f5ab0..ed9521e4 100644 --- a/src/engine/SCons/Platform/sunos.py +++ b/src/engine/SCons/Platform/sunos.py @@ -39,4 +39,6 @@ def generate(env): # Based on sunSparc 8:32bit # ARG_MAX=1048320 - 3000 for environment expansion env['MAXLINELENGTH'] = 1045320 + env['PKGINFO'] = 'pkginfo' + env['PKGCHK'] = '/usr/sbin/pkgchk' env['ENV']['PATH'] = env['ENV']['PATH'] + ':/usr/ccs/bin' diff --git a/src/engine/SCons/Platform/sunos.xml b/src/engine/SCons/Platform/sunos.xml new file mode 100644 index 00000000..d380d489 --- /dev/null +++ b/src/engine/SCons/Platform/sunos.xml @@ -0,0 +1,30 @@ + + + + +On Solaris systems, +the package-checking program that will +be used (along with &cv-PKGINFO;) +to look for installed versions of +the Sun PRO C++ compiler. +The default is +/usr/sbin/pgkchk. + + + + + +On Solaris systems, +the package information program that will +be used (along with &cv-PKGCHK;) +to look for installed versions of +the Sun PRO C++ compiler. +The default is +pkginfo. + + diff --git a/src/engine/SCons/Tool/sunc++.py b/src/engine/SCons/Tool/sunc++.py index 91c0f6cb..a6ac10ae 100644 --- a/src/engine/SCons/Tool/sunc++.py +++ b/src/engine/SCons/Tool/sunc++.py @@ -45,19 +45,22 @@ def get_cppc(env): cppcPath = env.get('CXX', None) cppcVersion = None + pkginfo = env.subst('$PKGINFO') + pkgchk = env.subst('$PKGCHK') + for package in ['SPROcpl']: - cmd = "pkginfo -l " + package + " 2>/dev/null | grep '^ *VERSION:'" + cmd = "%s -l %s 2>/dev/null | grep '^ *VERSION:'" % (pkginfo, package) line = os.popen(cmd).readline() if line: cppcVersion = line.split()[-1] - cmd = "pkgchk -l " + package + " | grep '^Pathname:.*/bin/CC$' | grep -v '/SC[0-9]*\.[0-9]*/'" + cmd = "%s -l %s | grep '^Pathname:.*/bin/CC$' | grep -v '/SC[0-9]*\.[0-9]*/'" % (pkgchk, package) line = os.popen(cmd).readline() cppcPath = os.path.dirname(line.split()[-1]) break return (cppcPath, 'CC', 'CC', cppcVersion) def generate(env): - """Add Builders and construction variables for SUN PRO C++ to an Environment.""" + """Add Builders and construction variables for SunPRO C++.""" path, cxx, shcxx, version = get_cppc(env) if path: cxx = os.path.join(path, cxx) -- 2.26.2