Changeset 2473 in vbox
- Timestamp:
- May 3, 2007 10:40:16 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r2472 r2473 805 805 # 806 806 # GCC stuff properties. 807 # 808 # These will be resolved on the first kmk invocation and passed on to recursive 809 # instances in the environment. 810 #q 811 # Note. If we add much more to here, we should seriously consider moving this to a 812 # gcc configure script which we invoke automatically. 807 # Most of this is resolved on first kmk invocation and cached in PATH_OUT. 808 # 809 # Note! That a harmless warning is printed if the file doesn't exist. 810 # Note! Changes in GCC are not detected automatically (yet). 813 811 # 814 812 include $(PATH_KBUILD)/tools/$(VBOX_GCC_TOOL).kmk 815 816 ifndef VBOX_GCC_LIBGCC 817 export VBOX_GCC_LIBGCC := $(shell $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-libgcc-file-name) 818 endif 819 820 # HC compiler switch detction. 813 ifneq ($(VBOX_GCC_TOOL),$(VBOX_GCC32_TOOL)) 814 include $(PATH_KBUILD)/tools/$(VBOX_GCC32_TOOL).kmk 815 endif 816 821 817 VBOX_GCC_CHECK_CC = $(shell \ 822 818 if $(TOOL_$(VBOX_GCC_TOOL)_CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \ 823 819 then echo "$(1)"; \ 824 820 else echo "$(2)"; fi; ) 821 825 822 VBOX_GCC_CHECK_CXX = $(shell \ 826 823 if $(TOOL_$(VBOX_GCC_TOOL)_CXX) $(1) -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1; \ 827 824 then echo "$(1)"; \ 828 825 else echo "$(2)"; fi; ) 829 ifeq ($(origin VBOX_GCC_Wno-pointer-sign),undefined) 830 export VBOX_GCC_Wno-pointer-sign := $(call VBOX_GCC_CHECK_CC,-Wno-pointer-sign,) 831 endif 832 ifeq ($(origin VBOX_GCC_Wno-variadic-macros),undefined) 833 export VBOX_GCC_Wno-variadic-macros := $(call VBOX_GCC_CHECK_CXX,-Wno-variadic-macros,) 834 endif 835 ifeq ($(origin VBOX_GCC_Wno-invalid-offsetof),undefined) 836 export VBOX_GCC_Wno-invalid-offsetof := $(call VBOX_GCC_CHECK_CXX,-Wno-invalid-offsetof,) 837 endif 838 ifeq ($(origin VBOX_GCC_Wno-extra),undefined) 839 export VBOX_GCC_Wno-extra := $(call VBOX_GCC_CHECK_CXX,-Wno-extra) 840 endif 841 ifeq ($(origin VBOX_GCC_fno-stack-protector),undefined) 842 export VBOX_GCC_fno-stack-protector := $(call VBOX_GCC_CHECK_CC,-fno-stack-protector,) 843 endif 844 # Set default attribute for ELF symbols to ``hidden'' to reduce the number 845 # of relocation entries and PLT indirections in shared libraries. 846 ifeq ($(origin VBOX_GCC_fvisibility-hidden),undefined) 847 export VBOX_GCC_fvisibility-hidden := $(call VBOX_GCC_CHECK_CC,-fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN,) 848 endif 849 # Set default attribute for inline functions to ``hidden'' to reduce the number 850 # of relocation entries and PLT indirections in shared libraries. 851 ifeq ($(origin VBOX_GCC_fvisibility-inlines-hidden),undefined) 852 export VBOX_GCC_fvisibility-inlines-hidden := $(call VBOX_GCC_CHECK_CXX,-fvisibility-inlines-hidden,) 853 endif 854 855 # 32-bit (GC) compiler switch detection. 826 856 827 VBOX_GCC32_CHECK_CXX = $(shell \ 857 828 if $(TOOL_$(VBOX_GCC32_TOOL)_CXX) $(1) -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1; \ 858 829 then echo "$(1)"; \ 859 830 else echo "$(2)"; fi; ) 860 ifneq ($(VBOX_GCC_TOOL),$(VBOX_GCC32_TOOL)) 861 include $(PATH_KBUILD)/tools/$(VBOX_GCC32_TOOL).kmk 862 ifeq ($(origin VBOX_GCC32_Wno-variadic-macros),undefined) 863 export VBOX_GCC32_Wno-variadic-macros := $(call VBOX_GCC32_CHECK_CXX,-Wno-variadic-macros,) 864 endif 865 ifndef VBOX_GCC32_LIBGCC 866 export VBOX_GCC32_LIBGCC := $(shell $(TOOL_$(VBOX_GCC32_TOOL)_CC) -print-libgcc-file-name) 867 endif 868 else 869 VBOX_GCC32_Wno-variadic-macros ?= $(VBOX_GCC_Wno-variadic-macros) 870 VBOX_GCC32_LIBGCC ?= $(VBOX_GCC_LIBGCC) 871 endif 872 873 # Find the compiler defines (for IPRT no-crt). 874 ifndef VBOX_PATH_GCC_INCS 875 export VBOX_PATH_GCC_INCS := $(abspath $(dir $(shell LC_ALL=C $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-libgcc-file-name)))/include 876 endif 877 878 # L4 831 832 # No $(QUIET) here as it's interesting to see what goes into the file. 833 $(PATH_OUT)/GCCConfig.kmk: $(PATH_ROOT)/Config.kmk $(LOCALCFG) $(AUTOCFG) 834 $(call MSG_GENERATE,,$@,) 835 $(QUIET)$(RM) -f "$@" 836 837 @# HC compiler switch detction. 838 $(APPEND) "$@" "VBOX_GCC_LIBGCC ?= $(shell $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-libgcc-file-name)" 839 $(APPEND) "$@" "VBOX_GCC_Wno-pointer-sign ?= $(call VBOX_GCC_CHECK_CC,-Wno-pointer-sign,)" 840 $(APPEND) "$@" "VBOX_GCC_Wno-variadic-macros ?= $(call VBOX_GCC_CHECK_CXX,-Wno-variadic-macros,)" 841 $(APPEND) "$@" "VBOX_GCC_Wno-invalid-offsetof ?= $(call VBOX_GCC_CHECK_CXX,-Wno-invalid-offsetof,)" 842 $(APPEND) "$@" "VBOX_GCC_Wno-extra ?= $(call VBOX_GCC_CHECK_CXX,-Wno-extra)" 843 $(APPEND) "$@" "VBOX_GCC_fno-stack-protector ?= $(call VBOX_GCC_CHECK_CC,-fno-stack-protector,)" 844 @# Set default attribute for ELF and MACH-O symbols to ``hidden'' to reduce the number 845 @# of relocation entries and PLT indirections in shared libraries. 846 $(APPEND) "$@" "VBOX_GCC_fvisibility-hidden ?= $(call VBOX_GCC_CHECK_CC,-fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN,)" 847 @# Set default attribute for inline functions to ``hidden'' to reduce the number 848 @# of relocation entries and PLT indirections in shared libraries. 849 $(APPEND) "$@" "VBOX_GCC_fvisibility-inlines-hidden ?= $(call VBOX_GCC_CHECK_CXX,-fvisibility-inlines-hidden,)" 850 @# Find the compiler includes for IPRT no-crt. 851 $(APPEND) "$@" "VBOX_PATH_GCC_INCS ?= $(abspath $(dir $(shell LC_ALL=C $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-libgcc-file-name)))/include" 852 853 @# 32-bit (GC) compiler switch detection. 854 $(APPEND) "$@" "VBOX_GCC32_LIBGCC ?= $(shell $(TOOL_$(VBOX_GCC32_TOOL)_CC) -print-libgcc-file-name)" 855 $(APPEND) "$@" "VBOX_GCC32_Wno-variadic-macros ?= $(call VBOX_GCC32_CHECK_CXX,-Wno-variadic-macros,)" 856 879 857 ifeq ($(BUILD_TARGET),l4) 880 ifndef VBOX_PATH_L4_GCC3_INSTALL 881 export VBOX_PATH_L4_GCC3_INSTALL := $(shell LANG=C $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-search-dirs|sed -ne 's+^install: \(.*[^/][^/]*\)/\?+\1+p') 882 endif 858 @# L4 859 $(APPEND) "$@" "VBOX_PATH_L4_GCC3_INSTALL ?= $(shell LANG=C $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-search-dirs|sed -ne 's+^install: \(.*[^/][^/]*\)/\?+\1+p')" 860 endif 861 862 include $(PATH_OUT)/GCCConfig.kmk 863 864 ifeq ($(BUILD_TARGET),l4) 883 865 VBOX_L4_GCC3_INCS := $(VBOX_PATH_L4_GCC3_INSTALL)/include 884 866 # L4_GPP3_INCS := \
Note:
See TracChangeset
for help on using the changeset viewer.