- Timestamp:
- Mar 13, 2017 8:01:22 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r66064 r66070 3742 3742 3743 3743 # 3744 # The linux kernel headers(/sources).3745 #3746 if1of ($(KBUILD_TARGET), linux)3747 ifeq ($(origin VBOX_LINUX_SRC),undefined)3748 ifneq ($(wildcard /lib/modules/$(shell uname -r)/build/include/linux/autoconf.h /lib/modules/$(shell uname -r)/build/include/generated/autoconf.h),)3749 export VBOX_LINUX_SRC := /lib/modules/$(shell uname -r)/build3750 else3751 export VBOX_LINUX_SRC := /usr/src/linux3752 endif3753 endif3754 ifneq ($(VBOX_LINUX_SRC),)3755 ifeq ($(origin VBOX_LINUX_INCS),undefined)3756 export VBOX_LINUX_INCS := $(VBOX_LINUX_SRC)/include3757 # XXX hack alert! Support split Linux kernels (make O=<build directory>). kernelpath points to3758 # the obj directory while VBOX_LINUX_SRC points to the virgin source directory.3759 # XXX put this crap elsewhere3760 kernelpath := $(shell $(SED_EXT) -ne 's+^KERNELSRC.*= *\(.*\)+\1+p' $(VBOX_LINUX_SRC)/Makefile)3761 ifeq ($(kernelpath),)3762 # Linux >= 2.6.253763 kernelpath := $(shell $(SED_EXT) -ne 's+^MAKEARGS *:= *-C *\(\S*\).*+\1+p' $(VBOX_LINUX_SRC)/Makefile)3764 endif3765 ifneq ($(kernelpath),)3766 # absolute path?3767 ifneq ($(patsubst /%,,$(kernelpath)),)3768 # no, relative path3769 kernelpath := $(realpath $(VBOX_LINUX_SRC)/$(kernelpath))3770 endif3771 endif3772 ifneq ($(kernelpath),)3773 VBOX_LINUX_INCS += $(VBOX_LINUX_SRC)/include2 $(kernelpath)/include3774 else3775 kernelpath := $(VBOX_LINUX_SRC)3776 endif3777 #3778 VBOX_LINUX_INCS += $(kernelpath)/include/asm-i386/mach-default \3779 $(kernelpath)/include/asm-x86/mach-default \3780 $(kernelpath)/include/drm \3781 $(kernelpath)/arch/x86/include \3782 $(kernelpath)/arch/x86/include/asm/mach-default \3783 $(kernelpath)/arch/x86/include/uapi \3784 $(VBOX_LINUX_SRC)/arch/x86/include/generated \3785 $(VBOX_LINUX_SRC)/arch/x86/include/generated/uapi \3786 $(kernelpath)/include/uapi \3787 $(VBOX_LINUX_SRC)/include/generated/uapi \3788 $(kernelpath)/include3789 endif3790 endif3791 # Since Linux 2.6.15, <linux/autoconf.h> is included like this. It cannot hurt to do the3792 # same for older Linux kernels3793 ifneq ($(wildcard $(kernelpath)/include/linux/kconfig.h),)3794 # Linux >= 3.13795 export VBOX_LINUX_INCLUDE := -include $(kernelpath)/include/linux/kconfig.h3796 else ifneq ($(wildcard $(VBOX_LINUX_SRC)/include/generated/autoconf.h),)3797 # Linux >= 2.6.333798 export VBOX_LINUX_INCLUDE := -include $(VBOX_LINUX_SRC)/include/generated/autoconf.h3799 else ifneq ($(wildcard $(VBOX_LINUX_SRC)/include/linux/autoconf.h),)3800 # Linux < 2.6.333801 export VBOX_LINUX_INCLUDE := -include $(VBOX_LINUX_SRC)/include/linux/autoconf.h3802 endif3803 endif3804 3805 #3806 3744 # Determine Solaris version. 3807 3745 # … … 4181 4119 4182 4120 ifeq ($(KBUILD_TARGET),linux) 4183 TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL) 4184 TEMPLATE_VBOXR0DRV_INSTTYPE.linux = none 4185 TEMPLATE_VBOXR0DRV_DEFS += __KERNEL__ MODULE 4186 TEMPLATE_VBOXR0DRV_INCS = $(VBOX_LINUX_INCS) 4187 TEMPLATE_VBOXR0DRV_CFLAGS = -fno-pie -nostdinc -iwithprefix include $(VBOX_LINUX_INCLUDE) \ 4188 $(VBOX_GCC_WARN) -Wstrict-prototypes $(VBOX_GCC_Wno-pointer-sign) -Wno-sign-compare $(VBOX_GCC_fdiagnostics-show-option) \ 4189 $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ 4190 -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration 4191 TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -mpreferred-stack-boundary=2 -msoft-float 4192 TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \ 4193 -fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time -Wno-sign-compare 4194 TEMPLATE_VBOXR0DRV_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign -ffreestanding -Werror-implicit-function-declaration,$(TEMPLATE_VBOXR0DRV_CFLAGS) $(TEMPLATE_VBOXR0DRV_CFLAGS.$(KBUILD_TARGET_ARCH))) -fno-exceptions -fno-rtti 4195 ifndef VBOX_LINUX_VERSION_2_4 4196 # 2.6 4197 TEMPLATE_VBOXR0DRV_SYSSUFF = .ko 4198 TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386 -r 4199 TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64 -r 4200 else 4201 # 2.4 4202 TEMPLATE_VBOXR0DRV_SYSSUFF = .o 4203 TEMPLATE_VBOXR0DRV_LDFLAGS = -r -s 4204 endif 4121 TEMPLATE_VBOXR0DRV_TOOL = $(NO_SUCH_VARIABLE) 4205 4122 endif 4206 4123
Note:
See TracChangeset
for help on using the changeset viewer.