VirtualBox

source: vbox/trunk/src/VBox/Frontends/VBoxSDL/Makefile.kmk@ 82781

Last change on this file since 82781 was 81537, checked in by vboxsync, 5 years ago

FE/VBoxSDL: Added first support for SDL2 (by setting VBOX_WITH_SDL2). Very rough / hacky by now and needs more testing first before enabling by default. Also fixed non-starting with SDL 1.2.x on Windows hosts.

Known limitations / todos when running with SDL 2 for now:

  • No alpha channel support for cursors.
  • No mouse wheel support.
  • Desktop geometry handling needs a revamp for multi monitor setups.
  • Check / revamp dirty rectangle blitting.
  • OpenGL renderer needs testing wrt texture blitting.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
1# $Id: Makefile.kmk 81537 2019-10-25 11:46:30Z vboxsync $
2## @file
3# Sub-Makefile for VBoxSDL (a simple frontend based on SDL).
4#
5
6#
7# Copyright (C) 2006-2019 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18SUB_DEPTH = ../../../..
19include $(KBUILD_PATH)/subheader.kmk
20if !defined(VBOX_WITH_HARDENING) || "$(KBUILD_TARGET)" != "darwin" # No hardened VBoxSDL on darwin.
21
22
23ifdef VBOX_WITH_HARDENING
24 #
25 # Hardened VBoxSDL
26 #
27 PROGRAMS += VBoxSDLHardened
28 VBoxSDLHardened_TEMPLATE = VBOXR3HARDENEDEXE
29 VBoxSDLHardened_SOURCES = VBoxSDLHardened.cpp
30 VBoxSDLHardened_NAME = VBoxSDL
31 $(call VBOX_SET_VER_INFO_EXE,VBoxSDLHardened,VirtualBox Pure SDL Frontend,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
32endif
33
34
35#
36# VBoxSDL
37#
38ifdef VBOX_WITH_HARDENING
39 DLLS += VBoxSDL
40else
41 PROGRAMS += VBoxSDL
42endif
43VBoxSDL_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBOXMAINCLIENTDLL,VBOXMAINCLIENTEXE)
44VBoxSDL_SDKS = LIBSDL
45VBoxSDL_SOURCES = \
46 VBoxSDL.cpp \
47 Framebuffer.cpp \
48 Helper.cpp \
49 ../Common/PasswordInput.cpp
50VBoxSDL_SOURCES.darwin = \
51 VBoxSDLMain-darwin.m \
52 Framebuffer-darwin.m
53
54VBoxSDL_DEFS =
55ifdef VBOX_WITH_SDL2
56 VBoxSDL_DEFS += VBOX_WITH_SDL2
57endif
58if !defined(VBOX_WITH_SDL2)
59 ifdef VBOX_WITH_SECURELABEL
60 VBoxSDL_DEFS += VBOX_SECURELABEL
61 endif
62endif
63VBoxSDL_DEFS.freebsd = VBOXSDL_WITH_X11
64VBoxSDL_DEFS.linux = _GNU_SOURCE VBOXSDL_WITH_X11
65VBoxSDL_DEFS.solaris = VBOXSDL_WITH_X11
66ifdef VBOX_OPENGL
67 #VBoxSDL_DEFS.linux += VBOX_OPENGL
68endif
69VBoxSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500
70VBoxSDL_DEFS.win.amd64 = _WIN32_WINNT=0x0510
71
72VBoxSDL_INCS = \
73 $(VBoxSDL_0_OUTDIR) \
74 $(VBOX_GRAPHICS_INCS) \
75 ../Common
76ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
77VBoxSDL_INCS += \
78 $(VBOX_XCURSOR_INCS)
79endif
80ifneq ($(filter-out win solaris,$(KBUILD_TARGET)),)
81
82VBoxSDL_LIBS = \
83 $(LIB_SDK_LIBSDL_SDLMAIN)
84endif
85ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
86VBoxSDL_LIBS += \
87 $(PATH_STAGE_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL) \
88 $(VBOX_XCURSOR_LIBS) \
89 X11
90VBoxSDL_LIBPATH = \
91 $(VBOX_LIBPATH_X11)
92endif
93ifdef VBOX_OPENGL
94 #VBoxSDL_LIBS.linux += GL
95endif
96
97VBoxSDL_LDFLAGS.darwin = \
98 -framework Foundation -framework AppKit
99
100VBoxSDL_CLEAN = $(VBoxSDL_0_OUTDIR)/Ico64x01.h
101VBoxSDL_INTERMEDIATES = $(VBoxSDL_0_OUTDIR)/Ico64x01.h
102
103
104# Convert the pnm-file to a byte array.
105$$(VBoxSDL_0_OUTDIR)/Ico64x01.h: $(PATH_ROOT)/src/VBox/Frontends/VBoxSDL/ico64x01.pnm $(VBOX_BIN2C) | $$(dir $$@)
106 $(call MSG_TOOL,bin2c,VBoxSDL,$<,$@)
107 $(QUIET)$(VBOX_BIN2C) Ico64x01 $< $@
108
109ifdef VBOX_WITH_HARDENING
110$(call VBOX_SET_VER_INFO_DLL,VBoxSDL,VirtualBox Pure SDL Frontend,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
111else
112$(call VBOX_SET_VER_INFO_EXE,VBoxSDL,VirtualBox Pure SDL Frontend,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
113endif
114
115
116#
117# tstSDL
118#
119PROGRAMS += tstSDL
120tstSDL_TEMPLATE = VBOXR3NPEXE
121tstSDL_SDKS = LIBSDL
122tstSDL_INST = $(INST_TESTCASE)
123tstSDL_SOURCES = \
124 VBoxSDLTest.cpp
125tstSDL_SOURCES.darwin = \
126 VBoxSDLMain-darwin.m
127tstSDL_DEFS = IN_RING3 IN_RT_R3 _GNU_SOURCE
128tstSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500
129ifdef VBOX_OPENGL
130tstSDL_DEFS.linux = VBOX_OPENGL
131endif
132
133tstSDL_LIBS = \
134 $(LIB_RUNTIME)
135ifneq ($(filter-out win solaris,$(KBUILD_TARGET)),)
136tstSDL_LIBS += \
137 $(LIB_SDK_LIBSDL_SDLMAIN)
138endif
139
140ifdef VBOX_OPENGL
141tstSDL_LIBS.linux += GL
142endif
143ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
144tstSDL_LIBPATH = \
145 $(VBOX_LIBPATH_X11)
146endif
147
148tstSDL_LDFLAGS.darwin = \
149 -framework Foundation -framework AppKit
150
151## @todo What was this stuff doing here? The exception config is saying two different things, and why just -O for release builds?
152#tstSDL_CXXFLAGS.win = \
153# -EHsc
154#tstSDL_CXXFLAGS.linux = \
155# -DNDEBUG -DTRIMMED -O -Wall -fno-rtti -fno-exceptions \
156# -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar -pthread -pipe
157# Is this what's intended? Why -fshort-wchar?
158tstSDL_DEFS.linux = NDEBUG TRIMMED
159tstSDL_CXXFLAGS.linux = -O -Wall -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar
160
161
162endif # !VBOX_WITH_HARDENING || "$(KBUILD_TARGET)" != "darwin"
163include $(FILE_KBUILD_SUB_FOOTER)
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use