Skip to content

Commit

Permalink
configure, install: add --mandir configure switch
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Feb 4, 2013
1 parent 63abdfe commit e0bffc4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
9 changes: 9 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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'] = (
Expand Down
15 changes: 10 additions & 5 deletions tools/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
destdir = None
node_prefix = None
node_libdir = None
node_mandir = None
target_defaults = None
variables = None

Expand Down Expand Up @@ -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)
Expand All @@ -259,6 +256,7 @@ def run(args):
global destdir
global node_prefix
global node_libdir
global node_mandir
global target_defaults
global variables

Expand All @@ -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 ''
Expand Down

0 comments on commit e0bffc4

Please sign in to comment.