Skip to contentSkip to conversation

mongoose: bump to version 5.4

PATCH New Davide Viti 2 participants 3 messages Aug 5, 2014 – Aug 6, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 mongoose: bump to version 5.4

Avoid compilation of the server via the upstream Makefile which unconditionally uses -lssl

The -lssl flag is appended to MONGOOSE_CFLAGS whenever BR2_PACKAGE_OPENSSL=y gets set.

---
Changes v1 -> v2:
- Expand commit log

 package/mongoose/mongoose.mk |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
package/mongoose/mongoose.mk +3 -3
index ee93846..4182a30 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-MONGOOSE_VERSION = 5.3
+MONGOOSE_VERSION = 5.4
 MONGOOSE_SITE = $(call github,cesanta,mongoose,$(MONGOOSE_VERSION))
 MONGOOSE_LICENSE = GPLv2
 MONGOOSE_LICENSE_FILES = LICENSE
@@ -19,8 +19,8 @@ MONGOOSE_CFLAGS += -DNS_ENABLE_SSL -lssl -lcrypto -lz
 endif
 
 define MONGOOSE_BUILD_CMDS
-	$(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D)/examples \
-		CFLAGS_EXTRA="$(MONGOOSE_CFLAGS)" server
+	$(TARGET_CC) $(@D)/examples/server.c $(@D)/mongoose.c \
+		-o $(@D)/examples/server $(MONGOOSE_CFLAGS) -pthread -ldl
 	$(TARGET_CC) -c $(@D)/mongoose.c $(MONGOOSE_CFLAGS) -o $(@D)/mongoose.o
 	$(TARGET_AR) rcs $(@D)/libmongoose.a $(@D)/mongoose.o
 endef
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v2 2/2 mongoose: patch to avoid _LARGEFILE_SOURCE redefinition warning

---
Changes v1 -> v2:
- Rename patch following Buildroot convention (Thomas)
- Add "Signed-off-by" line (Thomas)

 ...ongoose-0001-largefile-conditional-define.patch |   22 ++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 package/mongoose/mongoose-0001-largefile-conditional-define.patch
package/mongoose/mongoose-0001-largefile-conditional-define.patch new file +22 -0
new file mode 100644
index 0000000..b1d759a
@@ -0,0 +1,22 @@
+Avoid the following warning, due to duplicate definition of
+"_LARGEFILE_SOURCE"
+
+mongoose.c:52:0: warning: "_LARGEFILE_SOURCE" redefined [enabled by default]
+ #define _LARGEFILE_SOURCE       // Enable fseeko() and ftello() functions
+ ^
+<command-line>:0:0: note: this is the location of the previous definition
+
+Signed-off-by: Davide Viti <[email protected]>
+
+--- mongoose-5.4/mongoose.c~	2014-07-28 13:19:00.000000000 +0200
++++ mongoose-5.4/mongoose.c	2014-08-04 23:10:59.164092500 +0200
+@@ -49,7 +49,9 @@
+ #define _XOPEN_SOURCE 600       // For flockfile() on Linux
+ #define __STDC_FORMAT_MACROS    // <inttypes.h> wants this for C++
+ #define __STDC_LIMIT_MACROS     // C++ wants that for INT64_MAX
++#ifndef _LARGEFILE_SOURCE
+ #define _LARGEFILE_SOURCE       // Enable fseeko() and ftello() functions
++#endif
+ #define _FILE_OFFSET_BITS 64    // Enable 64-bit file offsets
+ 
+ #ifdef _MSC_VER
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH v2 1/2 mongoose: bump to version 5.4

In reply to Davide Viti

Dear Davide Viti,

Quoted 11 lines · Davide Viti

Avoid compilation of the server via the upstream Makefile which unconditionally uses -lssl

The -lssl flag is appended to MONGOOSE_CFLAGS whenever BR2_PACKAGE_OPENSSL=y gets set.

---
Changes v1 -> v2:
- Expand commit log

Thanks, I've applied both patches. However, it would be good to work with upstream to get those issues solved in a nicer way, by improving upstream's Makefile and submitting your largefile related patch. Notice that there are also other warnings when building mongoose:

/home/thomas/projets/buildroot/output/build/mongoose-5.4/mongoose.c:2495:0: warning: "R0" redefined [enabled by default]
In file included from /home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/signal.h:375:0,
from /home/thomas/projets/buildroot/output/build/mongoose-5.4/mongoose.c:73:
/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/sys/ucontext.h:44:0: note: this is the location of the previous definition /home/thomas/projets/buildroot/output/build/mongoose-5.4/mongoose.c:2496:0: warning: "R1" redefined [enabled by default]
In file included from /home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/signal.h:375:0,
from /home/thomas/projets/buildroot/output/build/mongoose-5.4/mongoose.c:73:
[... and more ...]

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com