2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2012-12-12 13:03:16 +01:00
|
|
|
#
|
|
|
|
# mongoose
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2012-12-12 13:03:16 +01:00
|
|
|
|
2015-03-23 22:54:00 +01:00
|
|
|
MONGOOSE_VERSION = 5.6
|
2014-05-12 21:31:26 +02:00
|
|
|
MONGOOSE_SITE = $(call github,cesanta,mongoose,$(MONGOOSE_VERSION))
|
|
|
|
MONGOOSE_LICENSE = GPLv2
|
2013-05-03 12:35:18 +02:00
|
|
|
MONGOOSE_LICENSE_FILES = LICENSE
|
2014-05-27 11:31:43 +02:00
|
|
|
MONGOOSE_INSTALL_STAGING = YES
|
2012-12-12 13:03:16 +01:00
|
|
|
|
2015-05-15 00:47:23 +02:00
|
|
|
MONGOOSE_CFLAGS = $(TARGET_CFLAGS) $(TARGET_LDFLAGS) -DMONGOOSE_NO_DL
|
2013-05-02 22:59:23 +02:00
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_OPENSSL),y)
|
|
|
|
MONGOOSE_DEPENDENCIES += openssl
|
|
|
|
# directly linked
|
2014-05-12 21:31:26 +02:00
|
|
|
MONGOOSE_CFLAGS += -DNS_ENABLE_SSL -lssl -lcrypto -lz
|
2013-05-02 22:59:23 +02:00
|
|
|
endif
|
2012-12-12 13:03:16 +01:00
|
|
|
|
|
|
|
define MONGOOSE_BUILD_CMDS
|
2014-11-08 15:02:45 +01:00
|
|
|
$(TARGET_CC) $(@D)/examples/web_server/web_server.c $(@D)/mongoose.c \
|
|
|
|
-I$(@D) -o $(@D)/examples/web_server/web_server \
|
2015-05-15 00:47:23 +02:00
|
|
|
$(MONGOOSE_CFLAGS) -pthread
|
2014-05-27 11:31:43 +02:00
|
|
|
$(TARGET_CC) -c $(@D)/mongoose.c $(MONGOOSE_CFLAGS) -o $(@D)/mongoose.o
|
|
|
|
$(TARGET_AR) rcs $(@D)/libmongoose.a $(@D)/mongoose.o
|
2012-12-12 13:03:16 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
define MONGOOSE_INSTALL_TARGET_CMDS
|
2014-11-08 15:02:45 +01:00
|
|
|
$(INSTALL) -D -m 755 $(@D)/examples/web_server/web_server \
|
2014-05-27 11:31:43 +02:00
|
|
|
$(TARGET_DIR)/usr/sbin/mongoose
|
2014-11-30 15:18:06 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
define MONGOOSE_INSTALL_INIT_SYSV
|
2012-12-12 13:03:16 +01:00
|
|
|
$(INSTALL) -D -m 755 package/mongoose/S85mongoose \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S85mongoose
|
|
|
|
endef
|
|
|
|
|
2015-05-23 12:05:13 +02:00
|
|
|
define MONGOOSE_INSTALL_INIT_SYSTEMD
|
|
|
|
$(INSTALL) -D -m 644 package/mongoose/mongoose.service \
|
|
|
|
$(TARGET_DIR)/usr/lib/systemd/system/mongoose.service
|
|
|
|
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
|
|
|
|
ln -sf ../../../../usr/lib/systemd/system/mongoose.service \
|
|
|
|
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mongoose.service
|
|
|
|
endef
|
|
|
|
|
2014-05-27 11:31:43 +02:00
|
|
|
define MONGOOSE_INSTALL_STAGING_CMDS
|
|
|
|
$(INSTALL) -D -m 644 $(@D)/libmongoose.a \
|
|
|
|
$(STAGING_DIR)/usr/lib/libmongoose.a
|
|
|
|
$(INSTALL) -D -m 644 $(@D)/mongoose.h \
|
|
|
|
$(STAGING_DIR)/usr/include/mongoose.h
|
|
|
|
endef
|
|
|
|
|
2012-12-12 13:03:16 +01:00
|
|
|
$(eval $(generic-package))
|