File: bcc.py

package info (click to toggle)
aap 1.072-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,980 kB
  • ctags: 2,160
  • sloc: python: 15,113; makefile: 61; sh: 31
file content (64 lines) | stat: -rw-r--r-- 1,895 bytes parent folder | download | duplicates (2)
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
62
63
64
# Part of the A-A-P recipe executive: Setup using BCC

# Copyright (c) 2002-2003 stichting NLnet Labs
# Permission to copy and use this file is specified in the file COPYING.
# If this file is missing you can find it here: http://www.a-a-p.org/COPYING

#
# This module sets up variables and actions for using the Borland C++
# compiler tools.
#

from RecPython import *
import Global
from Action import action_add
from Dictlist import str2dictlist
from RecPos import RecPos


def exists():
    """
    Return TRUE when the BCC toolchain can be found.
    """
    return program_path("bcc32")


def define_actions():
    """
    Define the actions that BCC can accomplish.
    """
    rd = Global.globals

    # TODO: use DEBUG and OPTIMIZE
    rpstack = [ RecPos  ("compile_bcc action") ]
    action_add(rpstack, rd, str2dictlist(rpstack, "compile_bcc object c"),
            "defi = $?DEFINE\n"
            "incl = $?INCLUDE\n"
            ":sys $BCC $CPPFLAGS $defi $incl $CFLAGS -c -WE -o$target $source")
    if not rd.get("BCC"):
        rd["BCC"] = "bcc32"

    rpstack = [ RecPos("build_bcc action") ]
    action_add(rpstack, rd, str2dictlist(rpstack, "build_bcc object"),
            ":sys $BCCLINK $LINKFLAGS $source c0x32.obj, $target, , import32.lib cw32.lib")
    if not rd.get("BCCLINK"):
        rd["BCCLINK"] = "ilink32"
    if not rd.get("LINKFLAGS"):
        rd["LINKFLAGS"] = "-q"


def use_actions(scope):
    """
    Setup variables so that the default actions use the BCC actions.
    """
    scope["C_COMPILE_ACTION"] = "compile_bcc"
    scope["CXX_COMPILE_ACTION"] = "compile_bcc"
    scope["C_BUILD_ACTION"] = "build_bcc"
    scope["CXX_BUILD_ACTION"] = "build_bcc"

    # Avoid using gcc for dependency checks.  It may exist but won't work with
    # the BCC compiler flags.
    scope["HASGCC"] = "no"
    scope["HASGCCXX"] = "no"

# vim: set sw=4 et sts=4 tw=79 fo+=l: