VirtualBox

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

Last change on this file since 51300 was 51156, checked in by vboxsync, 11 years ago

Convince Solaris headers to expose socket stuff we need in a way that
works for newer versions of g++ too. See the comment for gory details.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1# $Id: Makefile.kmk 51156 2014-04-28 16:09:33Z 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
38endif
39
40VBoxNetLwipNAT_TEMPLATE =
41VBoxNetLwipNAT_TEMPLATE := VBOXMAIN$(if-expr defined(VBOX_WITH_HARDENING),DLL,CLIENTEXE)
42VBoxNetLwipNAT_NAME = VBoxNetNAT
43VBoxNetLwipNAT_DEFS += ${LWIP_DEFS} IPv6
44# VBoxNetLwipNAT_DEFS.linux += WITH_VALGRIND # instrument lwip memp.c
45VBoxNetLwipNAT_DEFS.win += VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x501 # Windows XP
46VBoxNetLwipNAT_SOURCES += VBoxNetLwipNAT.cpp \
47 ../NetLib/VBoxNetBaseService.cpp \
48 ../NetLib/VBoxNetPortForwardString.cpp \
49 ../NetLib/VBoxNetIntIf.cpp \
50 ../NetLib/VBoxNetUDP.cpp \
51 ../NetLib/VBoxNetARP.cpp \
52 ../NetLib/ComHostUtils.cpp
53
54VBoxNetLwipNAT_LIBS = \
55 $(LIB_RUNTIME)
56VBoxNetLwipNAT_LIBS.solaris += socket nsl
57VBoxNetLwipNAT_LDFLAGS.win = /SUBSYSTEM:windows
58
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.
73ifeq ($(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
77 VBoxNetLwipNAT_CFLAGS.solaris += -std=c99
78 VBoxNetLwipNAT_DEFS.solaris += _XOPEN_SOURCE=600
79 else
80 VBoxNetLwipNAT_DEFS.solaris += _XOPEN_SOURCE=500
81 endif
82 endif
83 VBoxNetLwipNAT_DEFS.solaris += __EXTENSIONS__=1
84endif
85
86VBoxNetLwipNAT_SOURCES += \
87 proxy_pollmgr.c \
88 proxy_rtadvd.c \
89 proxy.c \
90 pxremap.c \
91 pxtcp.c \
92 pxudp.c \
93 pxdns.c \
94 fwtcp.c \
95 fwudp.c \
96 portfwd.c \
97 proxy_dhcp6ds.c \
98 proxy_tftpd.c
99
100ifeq ($(KBUILD_TARGET),win)
101 # unprivileged Icmp API
102 VBoxNetLwipNAT_SOURCES += pxping_win.c
103else
104 # raw sockets
105 VBoxNetLwipNAT_SOURCES += pxping.c
106endif
107
108# ifeq ($(VBOX_WITH_HARDENING),)
109# ifn1of ($(KBUILD_TARGET), darwin win)
110# # helper for debugging unprivileged
111# VBoxNetLwipNAT_DEFS += VBOX_RAWSOCK_DEBUG_HELPER
112# VBoxNetLwipNAT_SOURCES += getrawsock.c
113# endif
114# endif
115
116VBoxNetLwipNAT_SOURCES.darwin += rtmon_bsd.c
117VBoxNetLwipNAT_SOURCES.freebsd += rtmon_bsd.c
118VBoxNetLwipNAT_SOURCES.linux += rtmon_linux.c
119VBoxNetLwipNAT_SOURCES.solaris += rtmon_bsd.c
120VBoxNetLwipNAT_SOURCES.win += rtmon_win.c
121
122VBoxNetLwipNAT_SOURCES.win += \
123 RTWinPoll.cpp \
124 RTWinSocketPair.cpp
125
126VBoxNetLwipNAT_INCS += . # for lwipopts.h
127$(eval $(call def_vbox_lwip_public, \
128 VBoxNetLwipNAT, ../../Devices/Network/lwip-new))
129endif
130
131include $(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