Skip to content

Commit

Permalink
Bug 933120 - Move HOST_PROGRAM and HOST_SIMPLE_PROGRAMS to moz.build.…
Browse files Browse the repository at this point in the history
… r=gps
  • Loading branch information
glandium committed Nov 1, 2013
1 parent 3da504d commit 00a70f6
Show file tree
Hide file tree
Showing 30 changed files with 81 additions and 30 deletions.
1 change: 0 additions & 1 deletion build/unix/elfhack/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

INTERNAL_TOOLS = 1

HOST_PROGRAM = elfhack
NO_PROFILE_GUIDED_OPTIMIZE = 1

VPATH += $(topsrcdir)/build
Expand Down
2 changes: 2 additions & 0 deletions build/unix/elfhack/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ HOST_SOURCES += [
'elf.cpp',
'elfhack.cpp',
]

HOST_PROGRAM = 'elfhack'
4 changes: 0 additions & 4 deletions config/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
# libstdc++-compat is not built yet.
MOZ_LIBSTDCXX_HOST_VERSION =

ifneq (WINNT,$(HOST_OS_ARCH))
HOST_PROGRAM = nsinstall_real$(HOST_BIN_SUFFIX)
endif

ifndef CROSS_COMPILE
ifdef USE_ELF_DYNSTR_GC
export:: elf-dynstr-gc
Expand Down
3 changes: 3 additions & 0 deletions config/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ _MOZBUILD_EXTERNAL_VARIABLES := \
HOST_CSRCS \
HOST_CMMSRCS \
HOST_LIBRARY_NAME \
HOST_PROGRAM \
HOST_SIMPLE_PROGRAMS \
IS_COMPONENT \
JAVA_JAR_TARGETS \
JS_MODULES_PATH \
Expand All @@ -58,6 +60,7 @@ _MOZBUILD_EXTERNAL_VARIABLES := \
MSVC_ENABLE_PGO \
NO_DIST_INSTALL \
PARALLEL_DIRS \
PROGRAM \
SDK_HEADERS \
SIMPLE_PROGRAMS \
TEST_DIRS \
Expand Down
1 change: 1 addition & 0 deletions config/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ if CONFIG['HOST_OS_ARCH'] != 'WINNT':
'nsinstall.c',
'pathsub.c',
]
HOST_PROGRAM = 'nsinstall_real'
2 changes: 0 additions & 2 deletions js/src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,8 @@ EXTRA_DSO_LDOPTS += $(NSPR_LIBS)

# Define keyword generator before rules.mk, see bug 323979 comment 50

HOST_SIMPLE_PROGRAMS += host_jskwgen$(HOST_BIN_SUFFIX)
GARBAGE += jsautokw.h host_jskwgen$(HOST_BIN_SUFFIX)

HOST_SIMPLE_PROGRAMS += host_jsoplengen$(HOST_BIN_SUFFIX)
GARBAGE += jsautooplen.h host_jsoplengen$(HOST_BIN_SUFFIX)

GARBAGE += selfhosted.out.h
Expand Down
4 changes: 0 additions & 4 deletions js/src/config/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

ifneq (WINNT,$(HOST_OS_ARCH))
HOST_PROGRAM = nsinstall_real$(HOST_BIN_SUFFIX)
endif

# IMPORTANT: Disable NSBUILDROOT for this directory only, otherwise we have
# a recursive rule for finding nsinstall and the Perl scripts.
ifdef NSBUILDROOT
Expand Down
3 changes: 3 additions & 0 deletions js/src/config/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ _MOZBUILD_EXTERNAL_VARIABLES := \
HOST_CSRCS \
HOST_CMMSRCS \
HOST_LIBRARY_NAME \
HOST_PROGRAM \
HOST_SIMPLE_PROGRAMS \
IS_COMPONENT \
JAVA_JAR_TARGETS \
JS_MODULES_PATH \
Expand All @@ -58,6 +60,7 @@ _MOZBUILD_EXTERNAL_VARIABLES := \
MSVC_ENABLE_PGO \
NO_DIST_INSTALL \
PARALLEL_DIRS \
PROGRAM \
SDK_HEADERS \
SIMPLE_PROGRAMS \
TEST_DIRS \
Expand Down
1 change: 1 addition & 0 deletions js/src/config/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ if CONFIG['HOST_OS_ARCH'] != 'WINNT':
'nsinstall.c',
'pathsub.c',
]
HOST_PROGRAM = 'nsinstall_real'
4 changes: 4 additions & 0 deletions js/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -369,4 +369,8 @@ HOST_SOURCES += [
'jsoplengen.cpp',
]

HOST_SIMPLE_PROGRAMS += [
'host_%s' % f.replace('.cpp', '') for f in HOST_SOURCES
]

FORCE_STATIC_LIB = True
7 changes: 0 additions & 7 deletions layout/style/test/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# Preserve until HOST_SIMPLE_PROGRAMS has been converted.
host_cppsrcs = \
ListCSSProperties.cpp \
$(NULL)

HOST_SIMPLE_PROGRAMS = $(addprefix host_, $(host_cppsrcs:.cpp=$(HOST_BIN_SUFFIX)))

# ParseCSS.cpp used to be built as a test program, but it was not
# being used for anything, and recent changes to the CSS loader have
# made it fail to link. Further changes are planned which should make
Expand Down
4 changes: 4 additions & 0 deletions layout/style/test/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ HOST_SOURCES += [
'ListCSSProperties.cpp',
]

HOST_SIMPLE_PROGRAMS += [
'host_%s' % f.replace('.cpp', '') for f in HOST_SOURCES
]

BROWSER_CHROME_MANIFESTS += ['browser.ini']

2 changes: 0 additions & 2 deletions media/libvpx/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,6 @@ else
VPX_OIE_FORMAT := gas
endif

HOST_PROGRAM = host_obj_int_extract$(HOST_BIN_SUFFIX)

CSRCS += asm_com_offsets.c

GARBAGE += asm_com_offsets.$(OBJ_SUFFIX) asm_com_offsets.asm
Expand Down
2 changes: 2 additions & 0 deletions media/libvpx/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ if CONFIG['VPX_NEED_OBJ_INT_EXTRACT']:
'build/make/obj_int_extract.c',
]

HOST_PROGRAM = 'host_obj_int_extract'

LIBRARY_NAME = 'vpx'

SOURCES += [
Expand Down
1 change: 0 additions & 1 deletion modules/libmar/tool/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ endif
# The mar executable is output into dist/host/bin since it is something that
# would only be used by our build system and should not itself be included in a
# Mozilla distribution.
HOST_PROGRAM = mar$(HOST_BIN_SUFFIX)

# Don't link the against libmozglue because we don't need it.
MOZ_GLUE_LDFLAGS =
Expand Down
2 changes: 2 additions & 0 deletions modules/libmar/tool/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ SOURCES = [
'mar.c',
]
HOST_SOURCES += SOURCES

HOST_PROGRAM = 'mar'
2 changes: 0 additions & 2 deletions mozglue/linker/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

STL_FLAGS =

HOST_PROGRAM = szip

HOST_LIBS = -lz

DEFINES += -DIMPL_MFBT
Expand Down
2 changes: 2 additions & 0 deletions mozglue/linker/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ HOST_SOURCES += [
'szip.cpp',
]

HOST_PROGRAM = 'szip'

FORCE_STATIC_LIB = True
1 change: 0 additions & 1 deletion other-licenses/bsdiff/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

# This program is output to dist/host/bin because it is only needed by the
# build system and is not intended to be included in Mozilla distributions.
HOST_PROGRAM = mbsdiff$(BIN_SUFFIX)

ifdef MOZ_NATIVE_BZ2
HOST_LIBS += $(MOZ_BZ2_LIBS)
Expand Down
2 changes: 2 additions & 0 deletions other-licenses/bsdiff/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
HOST_SOURCES += [
'bsdiff.c',
]

HOST_PROGRAM = 'mbsdiff'
14 changes: 14 additions & 0 deletions python/mozbuild/mozbuild/backend/recursivemake.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
GeneratedInclude,
GeneratedWebIDLFile,
HeaderFileSubstitution,
HostProgram,
HostSimpleProgram,
InstallationTarget,
IPDLFile,
JavaJarData,
Expand Down Expand Up @@ -414,9 +416,15 @@ def consume_object(self, obj):
elif isinstance(obj, Program):
self._process_program(obj.program, backend_file)

elif isinstance(obj, HostProgram):
self._process_host_program(obj.program, backend_file)

elif isinstance(obj, SimpleProgram):
self._process_simple_program(obj.program, backend_file)

elif isinstance(obj, HostSimpleProgram):
self._process_host_simple_program(obj.program, backend_file)

elif isinstance(obj, TestManifest):
self._process_test_manifest(obj, backend_file)

Expand Down Expand Up @@ -972,9 +980,15 @@ def _handle_idl_manager(self, manager):
def _process_program(self, program, backend_file):
backend_file.write('PROGRAM = %s\n' % program)

def _process_host_program(self, program, backend_file):
backend_file.write('HOST_PROGRAM = %s\n' % program)

def _process_simple_program(self, program, backend_file):
backend_file.write('SIMPLE_PROGRAMS += %s\n' % program)

def _process_host_simple_program(self, program, backend_file):
backend_file.write('HOST_SIMPLE_PROGRAMS += %s\n' % program)

def _process_webidl_basename(self, basename):
header = 'mozilla/dom/%sBinding.h' % os.path.splitext(basename)[0]
self._install_manifests['dist_include'].add_optional_exists(header)
Expand Down
8 changes: 8 additions & 0 deletions python/mozbuild/mozbuild/frontend/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,18 @@ class Program(BaseProgram):
"""Sandbox container object for PROGRAM"""


class HostProgram(BaseProgram):
"""Sandbox container object for HOST_PROGRAM"""


class SimpleProgram(BaseProgram):
"""Sandbox container object for each program in SIMPLE_PROGRAMS"""


class HostSimpleProgram(BaseProgram):
"""Sandbox container object for each program in HOST_SIMPLE_PROGRAMS"""


class TestManifest(SandboxDerived):
"""Represents a manifest file containing information about tests."""

Expand Down
9 changes: 9 additions & 0 deletions python/mozbuild/mozbuild/frontend/emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
GeneratedInclude,
GeneratedWebIDLFile,
HeaderFileSubstitution,
HostProgram,
HostSimpleProgram,
InstallationTarget,
IPDLFile,
LocalInclude,
Expand Down Expand Up @@ -232,9 +234,16 @@ def emit_from_sandbox(self, sandbox):
if program:
yield Program(sandbox, program, sandbox['CONFIG']['BIN_SUFFIX'])

program = sandbox.get('HOST_PROGRAM')
if program:
yield HostProgram(sandbox, program, sandbox['CONFIG']['HOST_BIN_SUFFIX'])

for program in sandbox['SIMPLE_PROGRAMS']:
yield SimpleProgram(sandbox, program, sandbox['CONFIG']['BIN_SUFFIX'])

for program in sandbox['HOST_SIMPLE_PROGRAMS']:
yield HostSimpleProgram(sandbox, program, sandbox['CONFIG']['HOST_BIN_SUFFIX'])

simple_lists = [
('GENERATED_EVENTS_WEBIDL_FILES', GeneratedEventWebIDLFile),
('GENERATED_WEBIDL_FILES', GeneratedWebIDLFile),
Expand Down
19 changes: 19 additions & 0 deletions python/mozbuild/mozbuild/frontend/sandbox_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,17 @@ def compute_final_target(variables):
``BIN_SUFFIX``, the name will remain unchanged.
""", 'binaries'),

'HOST_SIMPLE_PROGRAMS': (StrictOrderingOnAppendList, list, [],
"""Compile a list of host executable names.
Each name in this variable corresponds to a hosst executable built
from the corresponding source file with the same base name.
If the configuration token ``HOST_BIN_SUFFIX`` is set, its value will
be automatically appended to each name. If a name already ends with
``HOST_BIN_SUFFIX``, the name will remain unchanged.
""", 'binaries'),

'TOOL_DIRS': (list, list, [],
"""Like DIRS but for tools.
Expand Down Expand Up @@ -418,6 +429,14 @@ def compute_final_target(variables):
``BIN_SUFFIX``, ``PROGRAM`` will remain unchanged.
""", 'binaries'),

'HOST_PROGRAM' : (unicode, unicode, "",
"""Compiled host executable name.
If the configuration token ``HOST_BIN_SUFFIX`` is set, its value will be
automatically appended to ``HOST_PROGRAM``. If ``HOST_PROGRAM`` already
ends with ``HOST_BIN_SUFFIX``, ``HOST_PROGRAM`` will remain unchanged.
""", 'binaries'),

'NO_DIST_INSTALL': (bool, bool, False,
"""Disable installing certain files into the distribution directory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

HOST_PROGRAM = dump_syms

LOCAL_INCLUDES = \
-I$(srcdir)/../../.. \
-I$(srcdir)/../../../common/linux \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ HOST_SOURCES += [
'dump_syms.cc',
]

HOST_PROGRAM = 'dump_syms'
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

HOST_PROGRAM = dump_syms

LOCAL_INCLUDES = \
-I$(srcdir)/../../.. \
-I$(srcdir)/../../../common/mac \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
HOST_SOURCES += [
'dump_syms_tool.mm',
]

HOST_PROGRAM = 'dump_syms'

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

HOST_PROGRAM = dump_syms

LOCAL_INCLUDES = \
-I$(srcdir)/../../.. \
-I$(srcdir)/../../../common/solaris \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ HOST_SOURCES += [
'dump_syms.cc',
]

HOST_PROGRAM = 'dump_syms'

0 comments on commit 00a70f6

Please sign in to comment.