1 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 '''Template for libstdc++ compatibility for target binaries.'''
11 if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']:
12 USE_LIBS += ['stdc++compat']
17 '''Template for program executables.'''
24 def SimplePrograms(names, ext='.cpp'):
25 '''Template for simple program executables.
27 Those have a single source with the same base name as the executable.
29 SIMPLE_PROGRAMS += names
30 SOURCES += ['%s%s' % (name, ext) for name in names]
36 def CppUnitTests(names, ext='.cpp'):
37 '''Template for C++ unit tests.
39 Those have a single source with the same base name as the executable.
41 CPP_UNIT_TESTS += names
42 SOURCES += ['%s%s' % (name, ext) for name in names]
49 '''Template for libraries.'''
54 def SharedLibrary(name):
55 '''Template for shared libraries.'''
58 FORCE_SHARED_LIB = True
65 '''Template for OSX Frameworks.'''
72 def HostStdCppCompat():
73 '''Template for libstdc++ compatibility for host binaries.'''
75 if CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']:
76 HOST_USE_LIBS += ['host_stdc++compat']
80 def HostProgram(name):
81 '''Template for build tools executables.'''
88 def HostSimplePrograms(names, ext='.cpp'):
89 '''Template for simple build tools executables.
91 Those have a single source with the same base name as the executable.
93 HOST_SIMPLE_PROGRAMS += names
94 HOST_SOURCES += ['%s%s' % (name.replace('host_', ''), ext)
101 def HostLibrary(name):
102 '''Template for build tools libraries.'''
103 HOST_LIBRARY_NAME = name
108 '''Template for binaries using Gecko.
110 This template is meant to be used in other templates.
121 def XPCOMBinaryComponent(name):
122 '''Template defining an XPCOM binary component for Gecko.
124 name is the name of the component.