use HOSTGCJ as GCJ_FOR_ECJX
[buildroot.git] / toolchain / dependencies / dependencies.mk
blob1bec1bcb9e3845b23cde437cfaa2b07f28c6c7b9
1 ######################################################################
3 # Check buildroot dependencies and bail out if the user's
4 # system is judged to be lacking....
6 ######################################################################
8 DEPENDENCIES_HOST_PREREQ:=
9 ifeq ($(BR2_STRIP_sstrip),y)
10 DEPENDENCIES_HOST_PREREQ+=sstrip_host
11 endif
12 ifneq ($(findstring y,$(BR2_KERNEL_HEADERS_LZMA)),)
13 DEPENDENCIES_HOST_PREREQ+=host-lzma
14 endif
16 # grub2 needs ruby to generate its Makefiles. brrr
17 ifeq ($(BR2_TARGET_GRUB2),y)
18 NEED_RUBY:=y
19 endif
20 ifeq ($(findstring y,$(BR2_TARGET_SYSLINUX)$(BR2_TARGET_PXELINUX)),y)
21 NEED_NASM:=y
22 DEPENDENCIES_HOST_PREREQ+=host-nasm
23 endif
24 ifeq ($(BR2_GCC_CROSS_GCJ),y)
25 NEED_GCJ_FOR_ECJX:=$(HOSTGCJ)
26 endif
27 ifndef GCJ_FOR_ECJX
28 GCJ_FOR_ECJX:=$(HOSTGCJ)
29 export GCJ_FOR_ECJX
30 endif
32 # We record the environ of the caller to see if we have to recheck
33 # via dependencies.sh.
34 dependencies:=.br.dependencies.host
36 ENV_DEP_HOST:=$(TOOL_BUILD_DIR)/bin/env.host
37 ENV_DEP_HOST_SOURCE:=$(TOPDIR)/toolchain/dependencies/env.c
38 $(ENV_DEP_HOST): $(ENV_DEP_HOST_SOURCE)
39 @$(INSTALL) -d $(@D)
40 @$(HOSTCC) $(HOST_CFLAGS) $(ENV_DEP_HOST_SOURCE) -o $@
42 $(dependencies): $(ENV_DEP_HOST) .config
43 @$(ENV_DEP_HOST) > $@.new
44 $(Q)if cmp $@ $@.new > /dev/null 2>&1; then \
45 rm -f $@.new; \
46 else \
47 [ "x$(V)" != "x" ] && diff -u $@ $@.new; \
48 mv $@.new $@; \
49 set -e; \
50 HOSTCC="$(firstword $(HOSTCC))" MAKE="$(MAKE)" \
51 HOST_SED_DIR="$(HOST_SED_DIR)" \
52 NEED_RUBY="$(NEED_RUBY)" \
53 NEED_NASM="$(NEED_NASM)" \
54 NEED_GCJ_FOR_ECJX="$(NEED_GCJ_FOR_ECJX)" \
55 $(TOPDIR)/toolchain/dependencies/dependencies.sh; \
56 $(MAKE1) host-sed $(DEPENDENCIES_HOST_PREREQ); \
57 touch -c $@; \
60 do-dependencies: $(dependencies)
61 @HOSTCC="$(firstword $(HOSTCC))" MAKE="$(MAKE)" \
62 HOST_SED_DIR="$(HOST_SED_DIR)" \
63 NEED_RUBY="$(NEED_RUBY)" \
64 NEED_NASM="$(NEED_NASM)" \
65 NEED_GCJ_FOR_ECJX="$(NEED_GCJ_FOR_ECJX)" \
66 $(TOPDIR)/toolchain/dependencies/dependencies.sh
67 $(MAKE1) host-sed $(DEPENDENCIES_HOST_PREREQ)
69 dependencies-source: $(ENV_DEP_HOST_SOURCE)
71 dependencies-clean: sstrip_target-clean sstrip_host-clean host-sed-clean \
72 host-nasm-clean
73 rm -f $(ENV_DEP_HOST) $(dependencies)
75 dependencies-dirclean:
76 @true
78 #############################################################
80 # Toplevel Makefile options
82 #############################################################