Changeset 77404 in vbox
- Timestamp:
- Feb 20, 2019 7:57:07 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 128958
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/linux/Makefile
r77403 r77404 152 152 $(VBOXGUEST_DIR)r0drv/linux 153 153 154 ifeq ($(KERN_VERSION),24)155 VBOXMOD_CFLAGS =156 else 157 VBOXMOD_CFLAGS = -Wno-declaration-after-statement -include $(VBOXGUEST_DIR)include/VBox/VBoxGuestMangling.h -fno-pie154 VBOXMOD_CFLAGS := $(call VBOX_GCC_CHECK_CC,-Wno-declaration-after-statement,-Wno-declaration-after-statement,,) 155 VBOXMOD_CFLAGS += $(call VBOX_GCC_CHECK_CC,-fno-pie,-fno-pie,,) 156 ifneq ($(KERN_VERSION),24) 157 VBOXMOD_CFLAGS += -include $(VBOXGUEST_DIR)include/VBox/VBoxGuestMangling.h 158 158 endif 159 159 -
trunk/src/VBox/Additions/linux/sharedfolders/Makefile.module
r77403 r77404 66 66 VBOXMOD_DEFS += VBOX_WITH_64_BITS_GUESTS 67 67 endif 68 ifeq ($(KERN_VERSION),24) 69 VBOXMOD_CFLAGS = 70 else 71 VBOXMOD_CFLAGS = -Wno-declaration-after-statement -fshort-wchar -include $(VBOXSF_DIR)/include/VBox/VBoxGuestMangling.h -fno-pie 68 VBOXMOD_CFLAGS := $(call VBOX_GCC_CHECK_CC,-Wno-declaration-after-statement,-Wno-declaration-after-statement,,) 69 VBOXMOD_CFLAGS += $(call VBOX_GCC_CHECK_CC,-fno-pie,-fno-pie,,) 70 ifneq ($(KERN_VERSION),24) 71 VBOXMOD_CFLAGS += -include $(VBOXSF_DIR)/include/VBox/VBoxGuestMangling.h 72 ## @todo r-bird: What's with -fshort-wchar here?? We either need that or we dont, right? It should be 2.6+ only. 73 VBOXMOD_CFLAGS += -fshort-wchar 72 74 endif 73 75 ifdef VBOX_NO_OMIT_FRAME_POINTER -
trunk/src/VBox/Installer/linux/Makefile-footer.gmk
r77403 r77404 26 26 # Compiler options 27 27 # 28 VBOX_INCL := $(addprefix -I,$(KERN_INCL) $(VBOXMOD_INCL))29 30 28 VBOXMOD_0_KFLAGS := -D__KERNEL__ -DMODULE -DRT_WITHOUT_PRAGMA_ONCE $(addprefix -D,$(VBOXMOD_DEFS)) 31 29 ifeq ($(BUILD_TARGET_ARCH),amd64) … … 44 42 endif 45 43 46 ifeq ($( KERN_VERSION),24)44 ifeq ($(VBOX_KERN_GROKS_EXTMOD),) 47 45 # 48 # 2.446 # Pre 2.6.6 49 47 # 50 # Note: while 2.4 kernels could also do "proper" builds from kbuild, the make51 # script needed to support it was somewhat different from 2.6. Since this52 # script works and 2.4 is not a moving target we will not try do do things the53 # "proper" way.48 # Note: While pre 2.6.6 kernels could also do "proper" builds from kbuild, the 49 # make script needed to support it was somewhat different from 2.6. Since this 50 # script works and pre-2.6.6 is not a moving target we will not try do do things 51 # the "proper" way. 54 52 # 55 53 VBOXMOD_EXT := o 56 54 57 ifeq ($(BUILD_TARGET_ARCH),amd64) 58 VBOXMOD_0_KFLAGS += -mcmodel=kernel 59 endif 55 ifeq ($(BUILD_TARGET_ARCH),amd64) 56 VBOXMOD_0_KFLAGS += -mcmodel=kernel 57 endif 58 ifeq ($(KERN_VERSION),24) 59 $(error KERN_VERSION=$(KERN_VERSION)) 60 VBOXMOD_0_KFLAGS += -DVBOX_LINUX_2_4 61 endif 60 62 61 CFLAGS := -O2 -DVBOX_LINUX_2_4 $(VBOXMOD_CFLAGS) $(VBOX_INCL) $(VBOXMOD_0_KFLAGS) $(KDEBUG)63 CFLAGS := -O2 $(VBOXMOD_CFLAGS) $(addprefix -I,$(KERN_INCL) $(VBOXMOD_INCL)) $(VBOXMOD_0_KFLAGS) $(KDEBUG) 62 64 63 65 # 2.4 Module linking … … 65 67 $(LD) -o $@ -r $(VBOXMOD_OBJS) 66 68 67 .PHONY: $(VBOXMOD_0_TARGET)68 69 all: $(VBOXMOD_0_TARGET) 69 70 $(VBOXMOD_0_TARGET): $(VBOXMOD_0_TARGET).$(VBOXMOD_EXT) … … 78 79 rm -rf .$(VBOXMOD_NAME)* .tmp_ver* $(VBOXMOD_NAME).* Modules.symvers modules.order 79 80 80 else # ! $(KERN_VERSION), 24 81 .PHONY: all $(VBOXMOD_0_TARGET) install clean 82 83 else # VBOX_KERN_GROKS_EXTMOD 81 84 # 82 # 2.6 and later 83 # 84 ## @todo XXX does not work for 2.6.5 and earlier (see KBUILD_EXTMOD in header). 85 # 2.6.6 and later 85 86 # 86 87 VBOXMOD_EXT := ko 87 88 88 89 # build defs 89 EXTRA_CFLAGS += $(VBOXMOD_CFLAGS) $( VBOX_INCL) $(VBOXMOD_0_KFLAGS) $(KDEBUG)90 EXTRA_CFLAGS += $(VBOXMOD_CFLAGS) $(addprefix -I,$(KERN_INCL) $(VBOXMOD_INCL)) $(VBOXMOD_0_KFLAGS) $(KDEBUG) 90 91 $(VBOXMOD_0_TARGET)-y := $(VBOXMOD_OBJS) 91 92 obj-m += $(VBOXMOD_0_TARGET).o … … 93 94 # Trigger parallel make job. 94 95 JOBS := $(shell (getconf _NPROCESSORS_ONLN || grep -Ec '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null) 95 ifeq ($(JOBS),0)96 override JOBS := 197 endif96 ifeq ($(JOBS),0) 97 override JOBS := 1 98 endif 98 99 99 100 # rules: 100 .PHONY: $(VBOXMOD_0_TARGET)101 101 all: $(VBOXMOD_0_TARGET) 102 102 … … 114 114 115 115 .PHONY: all $(VBOXMOD_0_TARGET) install modules_install clean 116 endif 116 endif # VBOX_KERN_GROKS_EXTMOD 117 -
trunk/src/VBox/Installer/linux/Makefile-header.gmk
r77399 r77404 113 113 endif 114 114 115 # guess kernel major version (24 or later) 116 ifeq ($(shell if grep '"2\.4\.' /lib/modules/$(KERN_VER)/build/include/linux/version.h > /dev/null 2>&1; then echo yes; fi),yes) 115 ifeq ($(KERN_DIR),) 116 KERN_DIR := /lib/modules/$(KERN_VER)/build 117 endif 118 119 # Is this 2.4 or < 2.6.6? The UTS_RELEASE "2.x.y.z" define is present in the header until 2.6.1x something. 120 ifeq ($(shell if grep '"2\.4\.' $(KERN_DIR)/include/linux/version.h > /dev/null 2>&1; then echo yes; fi),yes) 117 121 KERN_VERSION := 24 122 VBOX_KERN_GROKS_EXTMOD := 118 123 else 119 124 KERN_VERSION := 26 125 VBOX_KERN_GROKS_EXTMOD := yes 126 ifeq ($(shell if grep '"2\.6\.[012345][."]' $(KERN_DIR)/include/linux/version.h > /dev/null 2>&1; then echo yes; fi),yes) 127 VBOX_KERN_GROKS_EXTMOD := 128 else 129 endif 120 130 endif 121 131 … … 127 137 128 138 # guess kernel version (24 or 26) 129 ifeq ($( shell if echo "$(VERSION).$(PATCHLEVEL)." | grep '2\.4\.' > /dev/null; then echo yes; fi),yes)139 ifeq ($(VERSION).$(PATCHLEVEL),2.4) 130 140 KERN_VERSION := 24 141 VBOX_KERN_GROKS_EXTMOD := 131 142 else 132 143 KERN_VERSION := 26 144 VBOX_KERN_GROKS_EXTMOD := yes 145 ifeq ($(VERSION).$(PATCHLEVEL),2.6) 146 ifeq ($(findstring @$(SUBLEVEL)@,@0@1@2@3@4@5@),@$(SUBLEVEL)@) 147 VBOX_KERN_GROKS_EXTMOD := 148 endif 149 endif 133 150 endif 134 151 135 152 KERN_VER := $(KERNELRELEASE) 136 153 154 ifeq ($(KERN_DIR),) 155 KERN_DIR := /lib/modules/$(KERN_VER)/build 156 endif 137 157 endif # neq($(KERNELRELEASE),) 138 158 139 159 # Kernel build folder 140 ifeq ($(KERN_DIR),)141 KERN_DIR := /lib/modules/$(KERN_VER)/build142 endif143 160 ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes) 144 161 $(error Error: unable to find the headers of the Linux kernel to build against. \ … … 163 180 KBUILD_EXTMOD := $(CURDIR) 164 181 endif 182 183 184 # For VBOX_GCC_CHECK_CC 185 VBOX_CLOSEPAR := ) 186 VBOX_DOLLAR := $$ 187 ## Modified VBOX_GCC_CHECK_EX_CC_CXX macro from /Config.kmk. 188 # @param 1 The option to test for. 189 # @param 2 The return value when supported. 190 # @param 3 The return value when NOT supported. 191 VBOX_GCC_CHECK_CC = $(shell \ 192 > /tmp/$(VBOX_DOLLAR)$(VBOX_DOLLAR).check.c; \ 193 if $(CC) $(subst -Wno-,-W,$(1)) -Werror -c -o /dev/null /tmp/$(VBOX_DOLLAR)$(VBOX_DOLLAR).check.c > /dev/null 2>&1; then \ 194 case "`LC_ALL=C $(CC) $(subst -Wno-,-W,$(1)) -Werror -c -o /dev/null /tmp/$(VBOX_DOLLAR)$(VBOX_DOLLAR).check.c 2>&1`" in \ 195 "error: unknown warning option"*$(VBOX_CLOSEPAR) echo "$(3)";; \ 196 *$(VBOX_CLOSEPAR) echo "$(2)";; \ 197 esac; \ 198 else echo "$(3)"; fi; \ 199 rm -f /tmp/$(VBOX_DOLLAR)$(VBOX_DOLLAR).check.c; ) 200 165 201 166 202 # debug - show guesses.
Note:
See TracChangeset
for help on using the changeset viewer.