source: waflib/Tools/gnu_dirs.py @ 6d7acc8

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 6d7acc8 was 904702d, checked in by Paul Brossier <piem@piem.org>, 10 years ago

waf, waflib: update to 1.8.7

  • Property mode set to 100644
File size: 2.7 KB
RevLine 
[0fa325b]1#! /usr/bin/env python
2# encoding: utf-8
3# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
[904702d]5import os,re
[0fa325b]6from waflib import Utils,Options,Context
[904702d]7gnuopts='''
8bindir, user commands, ${EXEC_PREFIX}/bin
9sbindir, system binaries, ${EXEC_PREFIX}/sbin
10libexecdir, program-specific binaries, ${EXEC_PREFIX}/libexec
11sysconfdir, host-specific configuration, ${PREFIX}/etc
12sharedstatedir, architecture-independent variable data, ${PREFIX}/com
13localstatedir, variable data, ${PREFIX}/var
14libdir, object code libraries, ${EXEC_PREFIX}/lib%s
15includedir, header files, ${PREFIX}/include
16oldincludedir, header files for non-GCC compilers, /usr/include
17datarootdir, architecture-independent data root, ${PREFIX}/share
18datadir, architecture-independent data, ${DATAROOTDIR}
19infodir, GNU "info" documentation, ${DATAROOTDIR}/info
[0fa325b]20localedir, locale-dependent data, ${DATAROOTDIR}/locale
[904702d]21mandir, manual pages, ${DATAROOTDIR}/man
[0fa325b]22docdir, documentation root, ${DATAROOTDIR}/doc/${PACKAGE}
[904702d]23htmldir, HTML documentation, ${DOCDIR}
24dvidir, DVI documentation, ${DOCDIR}
25pdfdir, PDF documentation, ${DOCDIR}
26psdir, PostScript documentation, ${DOCDIR}
27'''%Utils.lib64()
28_options=[x.split(', ')for x in gnuopts.splitlines()if x]
[0fa325b]29def configure(conf):
30        def get_param(varname,default):
31                return getattr(Options.options,varname,'')or default
32        env=conf.env
33        env.LIBDIR=env.BINDIR=[]
34        env.EXEC_PREFIX=get_param('EXEC_PREFIX',env.PREFIX)
35        env.PACKAGE=getattr(Context.g_module,'APPNAME',None)or env.PACKAGE
36        complete=False
37        iter=0
38        while not complete and iter<len(_options)+1:
39                iter+=1
40                complete=True
41                for name,help,default in _options:
42                        name=name.upper()
43                        if not env[name]:
44                                try:
45                                        env[name]=Utils.subst_vars(get_param(name,default).replace('/',os.sep),env)
46                                except TypeError:
47                                        complete=False
48        if not complete:
[904702d]49                lst=[x for x,_,_ in _options if not env[x.upper()]]
[0fa325b]50                raise conf.errors.WafError('Variable substitution failure %r'%lst)
51def options(opt):
[904702d]52        inst_dir=opt.add_option_group('Installation prefix','By default, "waf install" will put the files in\
[0fa325b]53 "/usr/local/bin", "/usr/local/lib" etc. An installation prefix other\
54 than "/usr/local" can be given using "--prefix", for example "--prefix=$HOME"')
55        for k in('--prefix','--destdir'):
56                option=opt.parser.get_option(k)
57                if option:
58                        opt.parser.remove_option(k)
59                        inst_dir.add_option(option)
[904702d]60        inst_dir.add_option('--exec-prefix',help='installation prefix for binaries [PREFIX]',default='',dest='EXEC_PREFIX')
61        dirs_options=opt.add_option_group('Installation directories')
[0fa325b]62        for name,help,default in _options:
63                option_name='--'+name
64                str_default=default
[904702d]65                str_help='%s [%s]'%(help,re.sub(r'\$\{([^}]+)\}',r'\1',str_default))
[0fa325b]66                dirs_options.add_option(option_name,help=str_help,default='',dest=name.upper())
Note: See TracBrowser for help on using the repository browser.