54 lines
1.8 KiB
Diff
54 lines
1.8 KiB
Diff
Add DESTDIR support
|
|
|
|
From: David Rothenberger <daveroth@acm.org>
|
|
|
|
|
|
---
|
|
SConstruct | 12 ++++++++----
|
|
1 file changed, 8 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/SConstruct b/SConstruct
|
|
index dc54354..8703247 100644
|
|
--- a/SConstruct
|
|
+++ b/SConstruct
|
|
@@ -112,6 +112,9 @@ opts.AddVariables(
|
|
None),
|
|
RawListVariable('CPPFLAGS', "Extra flags for the C preprocessor "
|
|
"(space separated)", None),
|
|
+ PathVariable('DESTDIR', 'Directory to install under',
|
|
+ '',
|
|
+ PathVariable.PathAccept),
|
|
)
|
|
|
|
if sys.platform == 'win32':
|
|
@@ -184,6 +187,7 @@ apr = str(env['APR'])
|
|
apu = str(env['APU'])
|
|
zlib = str(env['ZLIB'])
|
|
gssapi = env.get('GSSAPI', None)
|
|
+destdir = str(env.get('DESTDIR', ''))
|
|
|
|
if gssapi and os.path.isdir(gssapi):
|
|
krb5_config = os.path.join(gssapi, 'bin', 'krb5-config')
|
|
@@ -397,8 +401,8 @@ if CALLOUT_OKAY:
|
|
|
|
# INSTALLATION STUFF
|
|
|
|
-install_static = env.Install(libdir, lib_static)
|
|
-install_shared = env.InstallVersionedLib(libdir, lib_shared)
|
|
+install_static = env.Install(destdir + libdir, lib_static)
|
|
+install_shared = env.InstallVersionedLib(destdir + libdir, lib_shared)
|
|
|
|
if sys.platform == 'darwin':
|
|
# If --install-sandbox=<path> is specified, install_shared_path will point
|
|
@@ -415,8 +419,8 @@ if sys.platform == 'darwin':
|
|
|
|
env.Alias('install-lib', [install_static, install_shared,
|
|
])
|
|
-env.Alias('install-inc', env.Install(incdir, HEADER_FILES))
|
|
-env.Alias('install-pc', env.Install(os.path.join(libdir, 'pkgconfig'),
|
|
+env.Alias('install-inc', env.Install(destdir + incdir, HEADER_FILES))
|
|
+env.Alias('install-pc', env.Install(os.path.join(destdir + libdir, 'pkgconfig'),
|
|
pkgconfig))
|
|
env.Alias('install', ['install-lib', 'install-inc', 'install-pc', ])
|
|
|