mongoose: provide libmongoose.a static library
authorDavide Viti <zinosat@tiscali.it>
Tue, 27 May 2014 09:31:43 +0000 (11:31 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Tue, 27 May 2014 12:38:10 +0000 (14:38 +0200)
The package provides a webserver and, eventually, a library: this is
what Centos, among other distros, is doing.

[Peter: correct install -D invocation]
Signed-off-by: Davide Viti <d.viti@infosolution.it>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/mongoose/Config.in
package/mongoose/mongoose.mk

index 2526112d300b2c872ecc5fbcd856256ab10f7d49..8060942aed1597a1c5e0f3e2573fdd3fe21d1292 100644 (file)
@@ -6,7 +6,7 @@ config BR2_PACKAGE_MONGOOSE
        help
          Mongoose is a small and easy to use web server
 
-         https://github.com/valenok/mongoose
+         https://github.com/cesanta/mongoose
 
 comment "mongoose needs a toolchain w/ threads, largefile"
        depends on BR2_USE_MMU
index 75a4d3f59f5ed37e1c0069f93b24eedab7240264..ee938463a198a4a43a4d2f1be314421d5ce723d9 100644 (file)
@@ -8,6 +8,7 @@ MONGOOSE_VERSION = 5.3
 MONGOOSE_SITE = $(call github,cesanta,mongoose,$(MONGOOSE_VERSION))
 MONGOOSE_LICENSE = GPLv2
 MONGOOSE_LICENSE_FILES = LICENSE
+MONGOOSE_INSTALL_STAGING = YES
 
 MONGOOSE_CFLAGS = $(TARGET_CFLAGS) $(TARGET_LDFLAGS)
 
@@ -20,12 +21,22 @@ endif
 define MONGOOSE_BUILD_CMDS
        $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D)/examples \
                CFLAGS_EXTRA="$(MONGOOSE_CFLAGS)" server
+       $(TARGET_CC) -c $(@D)/mongoose.c $(MONGOOSE_CFLAGS) -o $(@D)/mongoose.o
+       $(TARGET_AR) rcs $(@D)/libmongoose.a $(@D)/mongoose.o
 endef
 
 define MONGOOSE_INSTALL_TARGET_CMDS
-       $(INSTALL) -D -m 755 $(@D)/examples/server $(TARGET_DIR)/usr/sbin/mongoose
+       $(INSTALL) -D -m 755 $(@D)/examples/server \
+               $(TARGET_DIR)/usr/sbin/mongoose
        $(INSTALL) -D -m 755 package/mongoose/S85mongoose \
                $(TARGET_DIR)/etc/init.d/S85mongoose
 endef
 
+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
+
 $(eval $(generic-package))