Permalink
Browse files

configure, install: add --mandir configure switch

  • Loading branch information...
1 parent 63abdfe commit e0bffc4ac3e53663937d56b5ab30df7c719f7315 @bnoordhuis committed Feb 4, 2013
Showing with 19 additions and 5 deletions.
  1. +9 −0 configure
  2. +10 −5 tools/install.py
View
@@ -29,6 +29,14 @@ parser.add_option("--libdir",
dest="libdir",
help="Where to install libraries (default: PREFIX/lib)")
+parser.add_option("--mandir",
+ action="store",
+ dest="mandir",
+ help="Where to install man pages (default: PREFIX/%s)" %
+ ('man' if 'freebsd' in sys.platform
+ or 'openbsd' in sys.platform
+ else 'share/man'))
+
parser.add_option("--without-npm",
action="store_true",
dest="without_npm",
@@ -360,6 +368,7 @@ def configure_node(o):
o['variables']['v8_no_strict_aliasing'] = 1 # work around compiler bugs
o['variables']['node_prefix'] = os.path.expanduser(options.prefix or '')
o['variables']['node_libdir'] = os.path.expanduser(options.libdir or '')
+ o['variables']['node_mandir'] = os.path.expanduser(options.mandir or '')
o['variables']['node_install_npm'] = b(not options.without_npm)
o['variables']['node_install_waf'] = b(not options.without_waf)
o['variables']['node_unsafe_optimizations'] = (
View
@@ -20,6 +20,7 @@
destdir = None
node_prefix = None
node_libdir = None
+node_mandir = None
target_defaults = None
variables = None
@@ -245,11 +246,7 @@ def files(action):
# work when cross-compiling and besides, there's at least one linux flavor
# with dtrace support now (oracle's "unbreakable" linux)
action(['src/node.d'], node_libdir, 'dtrace/')
-
- if 'freebsd' in sys.platform or 'openbsd' in sys.platform:
- action(['doc/node.1'], node_prefix, 'man/man1/')
- else:
- action(['doc/node.1'], node_prefix, 'share/man/man1/')
+ action(['doc/node.1'], node_mandir, 'man1/')
if 'true' == variables.get('node_install_waf'): waf_files(action)
if 'true' == variables.get('node_install_npm'): npm_files(action)
@@ -259,6 +256,7 @@ def run(args):
global destdir
global node_prefix
global node_libdir
+ global node_mandir
global target_defaults
global variables
@@ -271,6 +269,13 @@ def run(args):
node_prefix = variables.get('node_prefix') or '/usr/local'
node_libdir = variables.get('node_libdir') or os.path.join(node_prefix, 'lib')
+ node_mandir = variables.get('node_mandir')
+
+ if not node_mandir:
+ default = ('man' if 'freebsd' in sys.platform
+ or 'openbsd' in sys.platform
+ else 'share/man')
+ node_mandir = os.path.join(node_prefix, default)
# argv[2] is a custom install prefix for packagers (think DESTDIR)
destdir = os.path.abspath(args[2]) if args[2:3] and args[2] else ''

0 comments on commit e0bffc4

Please sign in to comment.