-
Notifications
You must be signed in to change notification settings - Fork 0
/
find_lcg.py
61 lines (45 loc) · 1.26 KB
/
find_lcg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# -*- python -*-
# stdlib imports ---
import os
import os.path as osp
# waf imports ---
import waflib.Utils
import waflib.Logs as msg
from waflib.Configure import conf
#
_heptooldir = osp.dirname(osp.abspath(__file__))
def options(ctx):
ctx.load('hwaf-base', tooldir=_heptooldir)
ctx.add_option(
'--with-lcg',
default=None,
help="Look for LCG-heptools at the given path")
ctx.add_option(
'--with-lcg-ext-root',
default=None,
help="Path to the LCG externals")
return
def configure(ctx):
ctx.load('hwaf-base', tooldir=_heptooldir)
return
@conf
def find_lcg(ctx, **kwargs):
ctx.load('hwaf-base', tooldir=_heptooldir)
if not ctx.env.HWAF_FOUND_C_COMPILER:
ctx.fatal('load a C compiler first')
pass
if not ctx.env.HWAF_FOUND_CXX_COMPILER:
ctx.fatal('load a C++ compiler first')
pass
lcg_root = ctx.options.with_lcg
if not osp.exists(lcg_root):
msg.fatal("LCG: no such path [%s]" % lcg_root)
return
ctx.start_msg("LCG-hep-tools")
ctx.end_msg(lcg_root)
lcg_ext_root = ctx.options.with_lcg_ext_root
ctx.start_msg("LCG-hep-tools externals")
ctx.end_msg(lcg_ext_root)
ctx.env.HWAF_FOUND_LCG = 1
return
## EOF ##