# $Id$
## @file
# Adds sources list and defines required to LWIP pre-1.5.0 compilation
#
#
# Copyright (C) 2006-2012 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
LWIP_INCS += \
vbox
LWIP_SOURCES += \
# LWIP_SOURCES += \
# LWIP_SOURCES += \
# LWIP_SOURCES += \
define _def_vbox_lwip_use # VAR_BaseName, path/to/lwip/dir
$(strip $1)_SOURCES += \
$(foreach file, $(LWIP_SOURCES), $(strip $2)/$(file))
# if individual lwip files need special settings, add them here:
# $(strip $2)/src/foo/bar.c_CFLAGS += -magic
endef
define def_vbox_lwip_flags # PROTO_BaseName, VAR_BaseName, path/to/lwip/dir
# add anything configured for the component via PROTO_BaseName
$(foreach suffix, INCS DEFS,
$(if $(value $(strip $1)_LWIP_$(suffix)),
$(eval #
$(strip $2)_$(suffix) += $(value $(strip $1)_LWIP_$(suffix))
)))
# add lwip's own includes
$(strip $2)_INCS += $(foreach incdir, $(LWIP_INCS), $(strip $3)/$(incdir))
# disable lwip assertions for some build types
$(strip $2)_DEFS.release += LWIP_NOASSERT
$(strip $2)_DEFS.profile += LWIP_NOASSERT
$(strip $2)_DEFS.kprofile += LWIP_NOASSERT
endef
###
### Call this if you want to expose lwip to your component as a whole.
### In this case individual lwip files (added to _SOURCES of your
### component) will pick up lwip includes etc from your component
### settings.
###
### This is, for example, how NetworkServices/NAT uses it.
###
define def_vbox_lwip_public # VAR_BaseName, path/to/lwip/dir
$(eval $(call _def_vbox_lwip_use, $1, $2))
$(eval $(call def_vbox_lwip_flags, $1, $1, $2))
endef
###
### Call this if you want to expose lwip only to a few selected files.
### In this case each lwip file is configured with lwip includes etc
### separately and you are supposed to call def_vbox_lwip_flags
### yourself for those of your files that use lwip.
###
### This is, for example, how Devices uses it.
###
define def_vbox_lwip_private # VAR_BaseName, path/to/lwip/dir
$(eval $(call _def_vbox_lwip_use, $1, $2))
$(foreach file, $(LWIP_SOURCES), \
$(eval $(call def_vbox_lwip_flags, $1, $(strip $2)/$(file), $2)))
endef
ifeq ($(USERNAME), vvl)
$(foreach lwip_file, $(LWIP_SOURCES), $(eval $(lwip_file)_DEFS=RTMEM_WRAP_TO_EF_APIS))
LWIPTEST_SOURCES= Network/lwip-new/test/unit/core/test_mem.c \
endif