VirtualBox

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

Last change on this file since 63001 was 62765, checked in by vboxsync, 9 years ago

More makefile nits

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.8 KB
Line 
1# $Id: Makefile.kmk 62765 2016-07-31 14:49:45Z vboxsync $
2## @file
3# Sub-makefile for NAT Networking
4#
5
6#
7# Copyright (C) 2006-2016 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
21
22VBOX_PATH_NAT_SRC := $(PATH_SUB_CURRENT)
23
24 # XXX: do not depend on order
25 ifndef LWIP_SOURCES
26 include $(PATH_SUB_CURRENT)/../../Devices/Network/lwip-new/Makefile.kmk
27 endif
28
29
30 ifdef VBOX_WITH_HARDENING
31 #
32 # Hardened stub exe for VBoxNetLwipNAT.
33 #
34 PROGRAMS += VBoxNetLwipNATHardened
35 VBoxNetLwipNATHardened_TEMPLATE = VBOXR3HARDENEDEXE
36 VBoxNetLwipNATHardened_NAME = VBoxNetNAT
37 VBoxNetLwipNATHardened_DEFS = SERVICE_NAME=\"VBoxNetNAT\"
38 VBoxNetLwipNATHardened_SOURCES = VBoxNetNATHardened.cpp
39 VBoxNetLwipNATHardened_SOURCES.win = $(VBoxNetLwipNAT_0_OUTDIR)/VBoxNetLwipNAT-icon.rc
40 VBoxNetLwipNATHardened_LDFLAGS.win = /SUBSYSTEM:windows
41 endif
42
43
44 #
45 # VBoxNetLwipNAT.
46 #
47 ifdef VBOX_WITH_HARDENING
48 DLLS += VBoxNetLwipNAT
49 else
50 PROGRAMS += VBoxNetLwipNAT
51 endif
52 VBoxNetLwipNAT_TEMPLATE := VBOXMAIN$(if-expr defined(VBOX_WITH_HARDENING),DLL,CLIENTEXE)
53 VBoxNetLwipNAT_NAME = VBoxNetNAT
54 VBoxNetLwipNAT_DEFS += ${LWIP_DEFS} IPv6
55 # VBoxNetLwipNAT_DEFS.linux += WITH_VALGRIND # instrument lwip memp.c
56 VBoxNetLwipNAT_DEFS.win += VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x501 # Windows XP
57 VBoxNetLwipNAT_SOURCES += VBoxNetLwipNAT.cpp \
58 $(VBOX_PATH_NAT_SRC)/../NetLib/VBoxNetBaseService.cpp \
59 $(VBOX_PATH_NAT_SRC)/../NetLib/VBoxNetPortForwardString.cpp \
60 $(VBOX_PATH_NAT_SRC)/../NetLib/VBoxNetIntIf.cpp \
61 $(VBOX_PATH_NAT_SRC)/../NetLib/VBoxNetUDP.cpp \
62 $(VBOX_PATH_NAT_SRC)/../NetLib/VBoxNetARP.cpp \
63 $(VBOX_PATH_NAT_SRC)/../NetLib/ComHostUtils.cpp
64
65 VBoxNetLwipNAT_LIBS = \
66 $(LIB_RUNTIME)
67 VBoxNetLwipNAT_LIBS.solaris += socket nsl
68 VBoxNetLwipNAT_LDFLAGS.win = /SUBSYSTEM:windows
69
70 # Convince Solaris headers to expose socket stuff we need.
71 #
72 # Setting _XOPEN_SOURCE to either 500 or 600 would always work, but
73 # <sys/feature_tests.h> insists that 600 requires C99 and so it
74 # explodes for older g++. It also insists that 500 is NOT to be used
75 # with C99.
76 #
77 # Newer g++ in C++11 mode (formerly known as C++0x) needs 600, so it
78 # employs sleight of hand to pretend it's C99 to keep feature test
79 # happy.
80 #
81 # Compile the C code with settings that match g++. This probably
82 # should be centralized so that whole codebase uses consistent
83 # settings.
84 ifeq ($(KBUILD_TARGET),solaris)
85 ifneq ($(VBOX_GCC_VERSION_CXX),)
86 ifneq ($(int-ge $(VBOX_GCC_VERSION_CXX),40600),)
87 # we compile C++ code with -std=c++0x / -std=c++11
88 VBoxNetLwipNAT_CFLAGS.solaris += -std=c99
89 VBoxNetLwipNAT_DEFS.solaris += _XOPEN_SOURCE=600
90 else
91 VBoxNetLwipNAT_DEFS.solaris += _XOPEN_SOURCE=500
92 endif
93 endif
94 VBoxNetLwipNAT_DEFS.solaris += __EXTENSIONS__=1
95 endif
96
97 VBoxNetLwipNAT_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)
112 # unprivileged Icmp API
113 VBoxNetLwipNAT_SOURCES += pxping_win.c
114 else
115 # raw sockets
116 VBoxNetLwipNAT_SOURCES += pxping.c
117 endif
118
119 # ifeq ($(VBOX_WITH_HARDENING),)
120 # ifn1of ($(KBUILD_TARGET), darwin win)
121 # # helper for debugging unprivileged
122 # VBoxNetLwipNAT_DEFS += VBOX_RAWSOCK_DEBUG_HELPER
123 # VBoxNetLwipNAT_SOURCES += getrawsock.c
124 # endif
125 # endif
126
127 VBoxNetLwipNAT_SOURCES.darwin += rtmon_bsd.c
128 VBoxNetLwipNAT_SOURCES.freebsd += rtmon_bsd.c
129 VBoxNetLwipNAT_SOURCES.linux += rtmon_linux.c
130 VBoxNetLwipNAT_SOURCES.solaris += rtmon_bsd.c
131 VBoxNetLwipNAT_SOURCES.win += rtmon_win.c
132
133 VBoxNetLwipNAT_SOURCES.win += \
134 RTWinPoll.cpp \
135 RTWinSocketPair.cpp
136
137 VBoxNetLwipNAT_INCS += . # for lwipopts.h
138 $(eval $(call def_vbox_lwip_public, VBoxNetLwipNAT, $(PATH_SUB_CURRENT)/../../Devices/Network/lwip-new))
139
140 ifeq ($(KBUILD_TARGET),win)
141 # Icon include file.
142 VBoxNetLwipNAT_SOURCES += VBoxNetNAT.rc
143 VBoxNetNAT.rc_INCS = $(VBoxNetLwipNAT_0_OUTDIR)
144 VBoxNetNAT.rc_DEPS = $(VBoxNetLwipNAT_0_OUTDIR)/VBoxNetLwipNAT-icon.rc
145 VBoxNetNAT.rc_CLEAN = $(VBoxNetLwipNAT_0_OUTDIR)/VBoxNetLwipNAT-icon.rc
146 $$(VBoxNetLwipNAT_0_OUTDIR)/VBoxNetLwipNAT-icon.rc: $(VBOX_WINDOWS_ICON_FILE) $$(VBoxNetLwipNAT_DEFPATH)/Makefile.kmk | $$(dir $$@)
147 $(RM) -f $@
148 $(APPEND) $@ 'IDI_VIRTUALBOX ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
149 endif # win
150
151endif # VBOX_WITH_LWIP_NAT
152include $(FILE_KBUILD_SUB_FOOTER)
153
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