File: maintainer.py

package info (click to toggle)
fsplib 0.14-5.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 236 kB
  • sloc: ansic: 1,581; python: 117; makefile: 11; sh: 8
file content (29 lines) | stat: -rw-r--r-- 911 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
#
# SCons check for maintainer mode
#
# Version 1.4
# 15-Aug-2019
#

from SCons.Script import ARGUMENTS

def checkForMaintainerMode(conf,force=False):
    """Check if user wants to enable maintainer compilation mode.
       
       If force is true than maintainer mode is forced"""
    conf.Message("Checking whether to enable maintainer mode... ")
    maint=ARGUMENTS.get('maintainer-mode', 0) or \
          ARGUMENTS.get('enable-maintainer-mode', 0)
    try:
         maint2=int(maint)
    except ValueError:
         maint2=None
    if force: maint2 = 1
    if maint2 > 0 or str(maint).lower() == 'yes':
                          conf.Result(1)
                          conf.env.Append(CCFLAGS = '-O0')
                          conf.env.Append(CPPFLAGS = '-DMAINTAINER_MODE')
                          return True
    else:
                          conf.Result(0)
                          return False