Skip to content

Commit

Permalink
Bug 862770 - Fix --disable-compile-environment a little. r=gps
Browse files Browse the repository at this point in the history
--HG--
rename : config/makefiles/target_libs.mk => config/makefiles/target_binaries.mk
rename : js/src/config/makefiles/target_libs.mk => js/src/config/makefiles/target_binaries.mk
  • Loading branch information
glandium committed Nov 7, 2013
1 parent 50e2fd0 commit f932a1f
Show file tree
Hide file tree
Showing 20 changed files with 107 additions and 31 deletions.
23 changes: 13 additions & 10 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ export TOPLEVEL_BUILD := 1

default::

ifdef COMPILE_ENVIRONMENT
include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
endif


include $(topsrcdir)/config/config.mk

ifndef LIBXUL_SDK
ifdef COMPILE_ENVIRONMENT
BUILD_JS = 1
endif
endif

GARBAGE_DIRS += dist _javagen _profile staticlib
DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
config/autoconf.mk \
Expand All @@ -35,7 +38,7 @@ ifndef MOZ_PROFILE_USE
# We need to explicitly put backend.RecursiveMakeBackend here
# otherwise the rule in rules.mk doesn't run early enough.
libs binaries export tools:: CLOBBER $(topsrcdir)/configure config.status backend.RecursiveMakeBackend
ifndef LIBXUL_SDK
ifdef BUILD_JS
libs binaries export tools:: js-config-status
endif
endif
Expand Down Expand Up @@ -78,7 +81,7 @@ include backend.RecursiveMakeBackend.pp

default:: backend.RecursiveMakeBackend

ifndef LIBXUL_SDK
ifdef BUILD_JS
.PHONY: js-config-status
js-config-status:
$(call SUBMAKE,backend.RecursiveMakeBackend,js/src,1)
Expand All @@ -92,7 +95,7 @@ install_manifest_depends = \
backend.RecursiveMakeBackend \
$(NULL)

ifndef LIBXUL_SDK
ifdef BUILD_JS
install_manifest_depends += js-config-status
endif

Expand All @@ -101,12 +104,12 @@ install-manifests: $(addprefix install-dist-,$(install_manifests))

.PHONY: $(addprefix install-dist-,$(install_manifests))
$(addprefix install-dist-,$(install_manifests)): install-dist-%: $(install_manifest_depends)
$(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove )$(DIST)/$* _build_manifests/install/dist_$* $(if $(LIBXUL_SDK),,js/src/_build_manifests/install/dist_$*))
$(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove )$(DIST)/$* _build_manifests/install/dist_$* $(if $(BUILD_JS),js/src/_build_manifests/install/dist_$*))

.PHONY: install-tests
install-manifests: install-tests
install-tests: $(install_manifest_depends)
$(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove )_tests _build_manifests/install/tests $(if $(LIBXUL_SDK),,js/src/_build_manifests/install/tests))
$(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove )_tests _build_manifests/install/tests $(if $(BUILD_JS),js/src/_build_manifests/install/tests))


# _tests should be purged during cleaning. However, we don't want it purged
Expand Down Expand Up @@ -142,7 +145,7 @@ include $(topsrcdir)/testing/testsuite-targets.mk
endif

default all::
$(call BUILDSTATUS,TIERS export $(if $(MOZ_PSEUDO_DERECURSE),compile )libs tools)
$(call BUILDSTATUS,TIERS export $(if $(COMPILE_ENVIRONMENT),$(if $(MOZ_PSEUDO_DERECURSE),compile ))libs tools)

include $(topsrcdir)/config/rules.mk

Expand Down Expand Up @@ -247,7 +250,7 @@ scheck::
@relcount=`find $(DIST)/bin -name "*.so" | xargs objdump -R | grep R_386_PC32 | wc -l` && if test $$relcount -gt 0; then echo "FAILED: R_386_PC32 relocations detected in a shared library. Did you use a system header without adding it to config/system-headers?"; exit 1; else echo "PASSED"; fi
endif

ifndef LIBXUL_SDK
ifdef BUILD_JS
js/src/Makefile: subsrcdir := js/src

ifdef ENABLE_TESTS
Expand Down
2 changes: 2 additions & 0 deletions browser/app/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ endif #}

ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))

ifdef COMPILE_ENVIRONMENT
libs::
cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
endif

GARBAGE += $(addprefix $(FINAL_TARGET)/defaults/pref/, firefox.js)

Expand Down
4 changes: 3 additions & 1 deletion build/unix/elfhack/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ test-ctors$(DLL_SUFFIX): DT_TYPE=INIT

GARBAGE += test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX) test-array$(DLL_SUFFIX).bak test-ctors$(DLL_SUFFIX).bak

ifndef CROSS_COMPILE
ifdef COMPILE_ENVIRONMENT
libs:: test-array$(DLL_SUFFIX) test-ctors$(DLL_SUFFIX)

ifndef CROSS_COMPILE
dummy: dummy.$(OBJ_SUFFIX)
$(CC) -o $@ $^ $(LDFLAGS)

Expand All @@ -53,5 +54,6 @@ libs:: dummy

GARBAGE += dummy
endif
endif

test.$(OBJ_SUFFIX): CFLAGS := -O0
4 changes: 4 additions & 0 deletions config/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
MOZ_LIBSTDCXX_HOST_VERSION =

ifndef CROSS_COMPILE
ifdef COMPILE_ENVIRONMENT
ifdef USE_ELF_DYNSTR_GC
export:: elf-dynstr-gc
endif
endif
endif

# IMPORTANT: Disable NSBUILDROOT for this directory only, otherwise we have
# a recursive rule for finding nsinstall and the Perl scripts.
Expand All @@ -27,6 +29,7 @@ endif
include $(topsrcdir)/config/config.mk

ifneq (WINNT,$(HOST_OS_ARCH))
ifdef COMPILE_ENVIRONMENT
# Ensure nsinstall is atomically created
nsinstall$(HOST_BIN_SUFFIX): $(HOST_PROGRAM)
cp $^ $@.tmp
Expand All @@ -37,6 +40,7 @@ NSINSTALL_DEST := $(DIST)/bin
NSINSTALL_TARGET := export
INSTALL_TARGETS += NSINSTALL
endif
endif

HEADERS_FILES = \
$(DEPTH)/mozilla-config.h \
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions config/recurse.mk
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ ifeq ($(CURRENT_TIER),export)
$(addsuffix /$(CURRENT_TIER),$(filter-out config,$(CURRENT_DIRS))): config/$(CURRENT_TIER)
endif

ifdef COMPILE_ENVIRONMENT
ifneq (,$(filter libs binaries,$(CURRENT_TIER)))
# When doing a "libs" build, target_libs.mk ensures the interesting dependency data
# is available in the "binaries" stamp. Once recursion is done, aggregate all that
Expand Down Expand Up @@ -139,6 +140,8 @@ endif

DIST_GARBAGE += binaries-deps.mk binaries-deps

endif

else

# Don't recurse if MAKELEVEL is NO_RECURSE_MAKELEVEL as defined above, but
Expand Down Expand Up @@ -209,6 +212,8 @@ endif
endif
endif

ifdef COMPILE_ENVIRONMENT

# Aggregate all dependency files relevant to a binaries build except in
# the mozilla top-level directory.
ifneq (_.,$(recurse_targets)_$(DEPTH))
Expand All @@ -227,4 +232,6 @@ ifneq (_.,$(recurse_targets)_$(DEPTH))
@$(if $(or $(recurse_targets),$^),$(call py_action,link_deps,-o binaries --group-all $(if $(want_abspaths),--abspaths )--topsrcdir $(topsrcdir) --topobjdir $(DEPTH) --dist $(DIST) $(ALL_DEP_FILES)))
endif

endif

endif # ifdef MOZ_PSEUDO_DERECURSE
22 changes: 21 additions & 1 deletion config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ endif
endif

ifdef CPP_UNIT_TESTS
ifdef COMPILE_ENVIRONMENT

# Compile the tests to $(DIST)/bin. Make lots of niceties available by default
# through TestHarness.h, by modifying the list of includes and the libs against
Expand Down Expand Up @@ -153,6 +154,7 @@ cppunittests-remote:
echo "please prepare your host with environment variables for TEST_DEVICE"; \
fi

endif # COMPILE_ENVIRONMENT
endif # CPP_UNIT_TESTS

.PHONY: check
Expand Down Expand Up @@ -303,6 +305,7 @@ EXCLUDED_OBJS := $(SIMPLE_PROGRAMS:$(BIN_SUFFIX)=.$(OBJ_SUFFIX))
SIMPLE_PROGRAMS :=
endif

ifdef COMPILE_ENVIRONMENT
ifndef TARGETS
TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS)
endif
Expand All @@ -328,6 +331,19 @@ ifndef HOST_OBJS
_HOST_OBJS = $(HOST_COBJS) $(HOST_CPPOBJS) $(HOST_CMOBJS) $(HOST_CMMOBJS)
HOST_OBJS = $(strip $(_HOST_OBJS))
endif
else
LIBRARY :=
SHARED_LIBRARY :=
IMPORT_LIBRARY :=
REAL_LIBRARY :=
PROGRAM :=
SIMPLE_PROGRAMS :=
HOST_LIBRARY :=
HOST_PROGRAM :=
HOST_SIMPLE_PROGRAMS :=
SDK_BINARY := $(filter %.py,$(SDK_BINARY))
SDK_LIBRARY :=
endif

ALL_TRASH = \
$(GARBAGE) $(TARGETS) $(OBJS) $(PROGOBJS) LOGS TAGS a.out \
Expand Down Expand Up @@ -613,7 +629,9 @@ ifndef SUPPRESS_DEFAULT_RULES
default all::
$(MAKE) export
ifdef MOZ_PSEUDO_DERECURSE
ifdef COMPILE_ENVIRONMENT
$(MAKE) compile
endif
endif
$(MAKE) libs
$(MAKE) tools
Expand Down Expand Up @@ -642,11 +660,13 @@ HOST_LIBS_DEPS = $(filter %.$(LIB_SUFFIX),$(HOST_LIBS))
GLOBAL_DEPS += Makefile $(DEPTH)/config/autoconf.mk $(topsrcdir)/config/config.mk

##############################################
ifdef COMPILE_ENVIRONMENT
OBJ_TARGETS = $(OBJS) $(PROGOBJS) $(HOST_OBJS) $(HOST_PROGOBJS)

compile:: $(OBJ_TARGETS)

include $(topsrcdir)/config/makefiles/target_libs.mk
include $(topsrcdir)/config/makefiles/target_binaries.mk
endif

ifdef IS_TOOL_DIR
# One would think "tools:: libs" would work, but it turns out that combined with
Expand Down
11 changes: 7 additions & 4 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -2498,9 +2498,10 @@ esac
if test -z "$COMPILE_ENVIRONMENT"; then
SKIP_COMPILER_CHECKS=1
SKIP_LIBRARY_CHECKS=1
else
MOZ_COMPILER_OPTS
fi

MOZ_COMPILER_OPTS
if test -z "$SKIP_COMPILER_CHECKS"; then
dnl Checks for typedefs, structures, and compiler characteristics.
dnl ========================================================
Expand Down Expand Up @@ -7179,7 +7180,7 @@ if test "$USE_ELF_HACK" = 1; then
esac
fi

if test -n "$USE_ELF_HACK"; then
if test -n "$COMPILE_ENVIRONMENT" -a -n "$USE_ELF_HACK"; then
dnl PT_GNU_RELRO segment makes the dynamic linker set a read-only flag on
dnl memory addresses it maps to. The result is that by the time elfhack
dnl kicks in, it is not possible to apply relocations because of that,
Expand Down Expand Up @@ -7874,7 +7875,9 @@ AC_SUBST(MOZ_PIXMAN_CFLAGS)
AC_SUBST(MOZ_PIXMAN_LIBS)

# Check for headers defining standard int types.
MOZ_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
if test -n "$COMPILE_ENVIRONMENT"; then
MOZ_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
fi

if test "$MOZ_TREE_CAIRO"; then
MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
Expand Down Expand Up @@ -8661,6 +8664,7 @@ AC_SUBST(MOZ_FOLD_LIBS)
AC_SUBST(MOZ_ENABLE_SZIP)
AC_SUBST(MOZ_SZIP_FLAGS)

if test -n "$COMPILE_ENVIRONMENT"; then
AC_MSG_CHECKING([for posix_fallocate])
AC_TRY_LINK([#define _XOPEN_SOURCE 600
#include <fcntl.h>],
Expand All @@ -8676,7 +8680,6 @@ else
fi

dnl Check for missing components
if test "$COMPILE_ENVIRONMENT"; then
if test "$MOZ_X11"; then
if test "$WITHOUT_X11"; then
AC_MSG_ERROR([--without-x specified and MOZ_X11 still defined])
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions js/src/config/recurse.mk
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ ifeq ($(CURRENT_TIER),export)
$(addsuffix /$(CURRENT_TIER),$(filter-out config,$(CURRENT_DIRS))): config/$(CURRENT_TIER)
endif

ifdef COMPILE_ENVIRONMENT
ifneq (,$(filter libs binaries,$(CURRENT_TIER)))
# When doing a "libs" build, target_libs.mk ensures the interesting dependency data
# is available in the "binaries" stamp. Once recursion is done, aggregate all that
Expand Down Expand Up @@ -139,6 +140,8 @@ endif

DIST_GARBAGE += binaries-deps.mk binaries-deps

endif

else

# Don't recurse if MAKELEVEL is NO_RECURSE_MAKELEVEL as defined above, but
Expand Down Expand Up @@ -209,6 +212,8 @@ endif
endif
endif

ifdef COMPILE_ENVIRONMENT

# Aggregate all dependency files relevant to a binaries build except in
# the mozilla top-level directory.
ifneq (_.,$(recurse_targets)_$(DEPTH))
Expand All @@ -227,4 +232,6 @@ ifneq (_.,$(recurse_targets)_$(DEPTH))
@$(if $(or $(recurse_targets),$^),$(call py_action,link_deps,-o binaries --group-all $(if $(want_abspaths),--abspaths )--topsrcdir $(topsrcdir) --topobjdir $(DEPTH) --dist $(DIST) $(ALL_DEP_FILES)))
endif

endif

endif # ifdef MOZ_PSEUDO_DERECURSE
22 changes: 21 additions & 1 deletion js/src/config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ endif
endif

ifdef CPP_UNIT_TESTS
ifdef COMPILE_ENVIRONMENT

# Compile the tests to $(DIST)/bin. Make lots of niceties available by default
# through TestHarness.h, by modifying the list of includes and the libs against
Expand Down Expand Up @@ -153,6 +154,7 @@ cppunittests-remote:
echo "please prepare your host with environment variables for TEST_DEVICE"; \
fi

endif # COMPILE_ENVIRONMENT
endif # CPP_UNIT_TESTS

.PHONY: check
Expand Down Expand Up @@ -303,6 +305,7 @@ EXCLUDED_OBJS := $(SIMPLE_PROGRAMS:$(BIN_SUFFIX)=.$(OBJ_SUFFIX))
SIMPLE_PROGRAMS :=
endif

ifdef COMPILE_ENVIRONMENT
ifndef TARGETS
TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS)
endif
Expand All @@ -328,6 +331,19 @@ ifndef HOST_OBJS
_HOST_OBJS = $(HOST_COBJS) $(HOST_CPPOBJS) $(HOST_CMOBJS) $(HOST_CMMOBJS)
HOST_OBJS = $(strip $(_HOST_OBJS))
endif
else
LIBRARY :=
SHARED_LIBRARY :=
IMPORT_LIBRARY :=
REAL_LIBRARY :=
PROGRAM :=
SIMPLE_PROGRAMS :=
HOST_LIBRARY :=
HOST_PROGRAM :=
HOST_SIMPLE_PROGRAMS :=
SDK_BINARY := $(filter %.py,$(SDK_BINARY))
SDK_LIBRARY :=
endif

ALL_TRASH = \
$(GARBAGE) $(TARGETS) $(OBJS) $(PROGOBJS) LOGS TAGS a.out \
Expand Down Expand Up @@ -613,7 +629,9 @@ ifndef SUPPRESS_DEFAULT_RULES
default all::
$(MAKE) export
ifdef MOZ_PSEUDO_DERECURSE
ifdef COMPILE_ENVIRONMENT
$(MAKE) compile
endif
endif
$(MAKE) libs
$(MAKE) tools
Expand Down Expand Up @@ -642,11 +660,13 @@ HOST_LIBS_DEPS = $(filter %.$(LIB_SUFFIX),$(HOST_LIBS))
GLOBAL_DEPS += Makefile $(DEPTH)/config/autoconf.mk $(topsrcdir)/config/config.mk

##############################################
ifdef COMPILE_ENVIRONMENT
OBJ_TARGETS = $(OBJS) $(PROGOBJS) $(HOST_OBJS) $(HOST_PROGOBJS)

compile:: $(OBJ_TARGETS)

include $(topsrcdir)/config/makefiles/target_libs.mk
include $(topsrcdir)/config/makefiles/target_binaries.mk
endif

ifdef IS_TOOL_DIR
# One would think "tools:: libs" would work, but it turns out that combined with
Expand Down
Loading

0 comments on commit f932a1f

Please sign in to comment.