VirtualBox

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

Last change on this file since 51773 was 51770, checked in by vboxsync, 11 years ago

Merged in iprt++ dev branch.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.9 KB
Line 
1# $Id: Makefile.kmk 51770 2014-07-01 18:14:02Z vboxsync $
2## @file
3#
4
5#
6# Copyright (C) 2006-2012 Oracle Corporation
7#
8# This file is part of VirtualBox Open Source Edition (OSE), as
9# available from http://www.virtualbox.org. This file is free software;
10# you can redistribute it and/or modify it under the terms of the GNU
11# General Public License (GPL) as published by the Free Software
12# Foundation, in version 2 as it comes in the "COPYING" file of the
13# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15#
16
17SUB_DEPTH = ../../../..
18include $(KBUILD_PATH)/subheader.kmk
19
20ifdef VBOX_WITH_LWIP_NAT
21# XXX: do not depend on order
22ifndef LWIP_SOURCES
23 include ../../Devices/Network/lwip-new/Makefile.kmk
24endif
25
26ifdef VBOX_WITH_HARDENING
27 PROGRAMS += VBoxNetLwipNATHardened
28 DLLS += VBoxNetLwipNAT
29else
30 PROGRAMS += VBoxNetLwipNAT
31endif
32
33ifdef VBOX_WITH_HARDENING
34 VBoxNetLwipNATHardened_SOURCES += VBoxNetNATHardened.cpp
35 VBoxNetLwipNATHardened_DEFS += SERVICE_NAME=\"VBoxNetNAT\"
36 VBoxNetLwipNATHardened_TEMPLATE=VBOXR3HARDENEDEXE
37 VBoxNetLwipNATHardened_NAME = VBoxNetNAT
38 VBoxNetLwipNATHardened_LDFLAGS.win = /SUBSYSTEM:windows
39endif
40
41VBoxNetLwipNAT_TEMPLATE =
42VBoxNetLwipNAT_TEMPLATE := VBOXMAIN$(if-expr defined(VBOX_WITH_HARDENING),DLL,CLIENTEXE)
43VBoxNetLwipNAT_NAME = VBoxNetNAT
44VBoxNetLwipNAT_DEFS += ${LWIP_DEFS} IPv6
45# VBoxNetLwipNAT_DEFS.linux += WITH_VALGRIND # instrument lwip memp.c
46VBoxNetLwipNAT_DEFS.win += VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x501 # Windows XP
47VBoxNetLwipNAT_SOURCES += VBoxNetLwipNAT.cpp \
48 ../NetLib/VBoxNetBaseService.cpp \
49 ../NetLib/VBoxNetPortForwardString.cpp \
50 ../NetLib/VBoxNetIntIf.cpp \
51 ../NetLib/VBoxNetUDP.cpp \
52 ../NetLib/VBoxNetARP.cpp \
53 ../NetLib/ComHostUtils.cpp
54
55VBoxNetLwipNAT_LIBS = \
56 $(LIB_RUNTIME)
57VBoxNetLwipNAT_LIBS.solaris += socket nsl
58VBoxNetLwipNAT_LDFLAGS.win = /SUBSYSTEM:windows
59
60# Convince Solaris headers to expose socket stuff we need.
61#
62# Setting _XOPEN_SOURCE to either 500 or 600 would always work, but
63# <sys/feature_tests.h> insists that 600 requires C99 and so it
64# explodes for older g++. It also insists that 500 is NOT to be used
65# with C99.
66#
67# Newer g++ in C++11 mode (formerly known as C++0x) needs 600, so it
68# employs sleight of hand to pretend it's C99 to keep feature test
69# happy.
70#
71# Compile the C code with settings that match g++. This probably
72# should be centralized so that whole codebase uses consistent
73# settings.
74ifeq ($(KBUILD_TARGET),solaris)
75 ifneq ($(VBOX_GCC_VERSION_CXX),)
76 ifneq ($(int-ge $(VBOX_GCC_VERSION_CXX),40600),)
77 # we compile C++ code with -std=c++0x / -std=c++11
78 VBoxNetLwipNAT_CFLAGS.solaris += -std=c99
79 VBoxNetLwipNAT_DEFS.solaris += _XOPEN_SOURCE=600
80 else
81 VBoxNetLwipNAT_DEFS.solaris += _XOPEN_SOURCE=500
82 endif
83 endif
84 VBoxNetLwipNAT_DEFS.solaris += __EXTENSIONS__=1
85endif
86
87VBoxNetLwipNAT_SOURCES += \
88 proxy_pollmgr.c \
89 proxy_rtadvd.c \
90 proxy.c \
91 pxremap.c \
92 pxtcp.c \
93 pxudp.c \
94 pxdns.c \
95 fwtcp.c \
96 fwudp.c \
97 portfwd.c \
98 proxy_dhcp6ds.c \
99 proxy_tftpd.c
100
101ifeq ($(KBUILD_TARGET),win)
102 # unprivileged Icmp API
103 VBoxNetLwipNAT_SOURCES += pxping_win.c
104else
105 # raw sockets
106 VBoxNetLwipNAT_SOURCES += pxping.c
107endif
108
109# ifeq ($(VBOX_WITH_HARDENING),)
110# ifn1of ($(KBUILD_TARGET), darwin win)
111# # helper for debugging unprivileged
112# VBoxNetLwipNAT_DEFS += VBOX_RAWSOCK_DEBUG_HELPER
113# VBoxNetLwipNAT_SOURCES += getrawsock.c
114# endif
115# endif
116
117VBoxNetLwipNAT_SOURCES.darwin += rtmon_bsd.c
118VBoxNetLwipNAT_SOURCES.freebsd += rtmon_bsd.c
119VBoxNetLwipNAT_SOURCES.linux += rtmon_linux.c
120VBoxNetLwipNAT_SOURCES.solaris += rtmon_bsd.c
121VBoxNetLwipNAT_SOURCES.win += rtmon_win.c
122
123VBoxNetLwipNAT_SOURCES.win += \
124 RTWinPoll.cpp \
125 RTWinSocketPair.cpp
126
127VBoxNetLwipNAT_INCS += . # for lwipopts.h
128$(eval $(call def_vbox_lwip_public, \
129 VBoxNetLwipNAT, ../../Devices/Network/lwip-new))
130endif
131
132include $(FILE_KBUILD_SUB_FOOTER)
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