From 5d135738cc039a3f37150feff580a3890de66132 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 15 Dec 2011 00:04:12 +0000 Subject: [PATCH] Fixed sometimes requiring root permissions to build When building with an install target in a system directory, root permissions are now only required to run "scons install". --- SConstruct | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 389bdb7f6..20c220460 100644 --- a/SConstruct +++ b/SConstruct @@ -84,12 +84,19 @@ else: # *** Read user-configurable options *** # ************************************** +# This check prevents requiring root permissions to build when the +# installation directory is not writable by the current user. +if 'install' in COMMAND_LINE_TARGETS: + installPathTest = PathVariable.PathIsDirCreate +else: + installPathTest = PathVariable.PathAccept + opts = Variables('cantera.conf') opts.AddVariables( PathVariable( 'prefix', 'Set this to the directory where Cantera should be installed.', - defaults.prefix, PathVariable.PathIsDirCreate), + defaults.prefix, installPathTest), EnumVariable( 'python_package', """If you plan to work in Python, or you want to use the