-
Notifications
You must be signed in to change notification settings - Fork 0
/
find_gdb.py
43 lines (33 loc) · 909 Bytes
/
find_gdb.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
# -*- 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)
return
def configure(ctx):
ctx.load('hwaf-base', tooldir=_heptooldir)
return
@conf
def find_gdb(ctx, **kwargs):
ctx.load('hwaf-base', tooldir=_heptooldir)
# find gdb executable
gdb = "gdb"
if getattr(ctx.options, 'with_gdb', None):
topdir = ctx.options.with_gdb
topdir = ctx.hwaf_subst_vars(topdir)
gdb = osp.abspath(osp.join(topdir, "bin", "gdb")
)
pass
ctx.find_program(gdb, var='GDB',**kwargs)
if not ctx.env.GDB_HOME:
ctx.env.GDB_HOME = osp.dirname(osp.dirname(gdb))
ctx.env.HWAF_FOUND_GDB = 1
return
## EOF ##