# SPDX-FileCopyrightText: 2013 Stefano Babic <sbabic@denx.de>
#
# SPDX-License-Identifier: GPL-2.0-only

ifneq ($(CONFIG_WEBSERVER),)
ifneq ($(CONFIG_MONGOOSE),)
KBUILD_CFLAGS += -DMG_ENABLE_HTTP_STREAMING_MULTIPART=1
KBUILD_CFLAGS += -DMG_ENABLE_HTTP_WEBSOCKET=1 -DMG_ENABLE_THREADS=1
ifneq ($(CONFIG_MONGOOSEIPV6),)
KBUILD_CFLAGS += -DMG_ENABLE_IPV6=1
endif
ifneq ($(CONFIG_MONGOOSESSL),)
KBUILD_CFLAGS += -DMG_ENABLE_SSL=1
ifeq ($(CONFIG_SSL_IMPL_OPENSSL)$(CONFIG_SSL_IMPL_WOLFSSL),y)
KBUILD_CFLAGS += -DMG_SSL_IF=MG_SSL_IF_OPENSSL
endif
ifeq ($(CONFIG_SSL_IMPL_MBEDTLS),y)
KBUILD_CFLAGS += -DMG_SSL_IF=MG_SSL_IF_MBEDTLS
endif
endif
endif
endif

lib-$(CONFIG_MONGOOSE)	+= mongoose.o \
			   mongoose_interface.o
