VirtualBox

source: vbox/trunk/src/VBox/NetworkServices/NAT/Makefile.kmk@ 82746

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

VBoxNetNAT: No need for custom RC file, use template and get version info in the hardened .exe too. Cleaned up the makefile, renaming the target to match the output.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1# $Id: Makefile.kmk 82746 2020-01-14 20:46:09Z vboxsync $
2## @file
3# Sub-makefile for NAT Networking
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
20ifdef VBOX_WITH_LWIP_NAT # entire file
21
22 ifndef LWIP_SOURCES
23 include $(PATH_SUB_CURRENT)/../../Devices/Network/lwip-new/Config.kmk
24 endif
25
26#
27# Globals
28#
29VBOX_PATH_NAT_SRC := $(PATH_SUB_CURRENT)
30
31
32#
33# Hardened stub exe for VBoxNetNAT.
34#
35 ifdef VBOX_WITH_HARDENING
36PROGRAMS += VBoxNetNATHardened
37VBoxNetNATHardened_TEMPLATE = VBOXR3HARDENEDEXE
38VBoxNetNATHardened_NAME = VBoxNetNAT
39VBoxNetNATHardened_DEFS = SERVICE_NAME=\"VBoxNetNAT\"
40VBoxNetNATHardened_SOURCES = VBoxNetNATHardened.cpp
41VBoxNetNATHardened_LDFLAGS.win = /SUBSYSTEM:windows
42$(call VBOX_SET_VER_INFO_EXE,VBoxNetNATHardened,VirtualBox NAT Engine,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
43 endif
44
45
46#
47# VBoxNetNAT.
48#
49 ifdef VBOX_WITH_HARDENING
50DLLS += VBoxNetNAT
51 else
52PROGRAMS += VBoxNetNAT
53 endif
54VBoxNetNAT_TEMPLATE := $(if-expr defined(VBOX_WITH_HARDENING),VBOXMAINDLL,VBOXMAINCLIENTEXE)
55VBoxNetNAT_NAME := VBoxNetNAT
56VBoxNetNAT_DEFS = IPv6
57# VBoxNetNAT_DEFS.linux = WITH_VALGRIND # instrument lwip memp.c
58VBoxNetNAT_DEFS.win = VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x501 # Windows XP
59# Convince Solaris headers to expose socket stuff we need.
60#
61# Setting _XOPEN_SOURCE to either 500 or 600 would always work, but
62# <sys/feature_tests.h> insists that 600 requires C99 and so it
63# explodes for older g++. It also insists that 500 is NOT to be used
64# with C99.
65#
66# Newer g++ in C++11 mode (formerly known as C++0x) needs 600, so it
67# employs sleight of hand to pretend it's C99 to keep feature test
68# happy.
69#
70# Compile the C code with settings that match g++. This probably
71# should be centralized so that whole codebase uses consistent
72# settings.
73 ifeq ($(KBUILD_TARGET),solaris)
74 ifneq ($(VBOX_GCC_VERSION_CXX),)
75 ifneq ($(int-ge $(VBOX_GCC_VERSION_CXX),40600),)
76# we compile C++ code with -std=c++0x / -std=c++11
77VBoxNetNAT_CFLAGS.solaris += -std=c99
78VBoxNetNAT_DEFS.solaris += _XOPEN_SOURCE=600
79 else
80VBoxNetNAT_DEFS.solaris += _XOPEN_SOURCE=500
81 endif
82 endif
83VBoxNetNAT_DEFS.solaris += __EXTENSIONS__=1
84 endif
85
86# (current dir is for for lwipopts.h)
87VBoxNetNAT_INCS += . $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_INCS))
88
89VBoxNetNAT_SOURCES = \
90 VBoxNetLwipNAT.cpp \
91 ../NetLib/VBoxNetBaseService.cpp \
92 ../NetLib/VBoxNetPortForwardString.cpp \
93 ../NetLib/VBoxNetIntIf.cpp \
94 ../NetLib/VBoxNetUDP.cpp \
95 ../NetLib/VBoxNetARP.cpp \
96 ../NetLib/ComHostUtils.cpp \
97 $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_SOURCES)) \
98 proxy_pollmgr.c \
99 proxy_rtadvd.c \
100 proxy.c \
101 pxremap.c \
102 pxtcp.c \
103 pxudp.c \
104 pxdns.c \
105 fwtcp.c \
106 fwudp.c \
107 portfwd.c \
108 proxy_dhcp6ds.c \
109 proxy_tftpd.c
110
111 ifeq ($(KBUILD_TARGET),win)
112VBoxNetNAT_SOURCES += pxping_win.c # unprivileged Icmp API
113 else
114VBoxNetNAT_SOURCES += pxping.c # raw sockets
115VBoxNetNAT_CFLAGS.linux += -Wno-address-of-packed-member # Needed for GCC 9.
116 endif
117
118VBoxNetNAT_SOURCES.darwin += rtmon_bsd.c
119VBoxNetNAT_SOURCES.freebsd += rtmon_bsd.c
120VBoxNetNAT_SOURCES.linux += rtmon_linux.c
121VBoxNetNAT_SOURCES.solaris += rtmon_bsd.c
122VBoxNetNAT_SOURCES.win += \
123 rtmon_win.c \
124 RTWinPoll.cpp \
125 RTWinSocketPair.cpp
126
127VBoxNetNAT_LIBS = \
128 $(LIB_RUNTIME)
129VBoxNetNAT_LIBS.solaris += socket nsl
130
131VBoxNetNAT_LDFLAGS.win = /SUBSYSTEM:windows
132
133# ifeq ($(VBOX_WITH_HARDENING),)
134# ifn1of ($(KBUILD_TARGET), darwin win)
135# # helper for debugging unprivileged
136# VBoxNetNAT_DEFS += VBOX_RAWSOCK_DEBUG_HELPER
137# VBoxNetNAT_SOURCES += getrawsock.c
138# endif
139# endif
140
141
142 ifdef VBOX_WITH_HARDENING
143$(call VBOX_SET_VER_INFO_DLL,VBoxNetNAT,VirtualBox NAT Engine (dll),$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
144 else
145$(call VBOX_SET_VER_INFO_EXE,VBoxNetNAT,VirtualBox NAT Engine,$(VBOX_WINDOWS_ICON_FILE)) # Version info / description.
146 endif
147
148endif # VBOX_WITH_LWIP_NAT
149include $(FILE_KBUILD_SUB_FOOTER)
150
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette