Skip to contentSkip to conversation

cjson: link with libm, unavailable for static

PATCH New Gustavo Zacarias 2 participants 2 messages Oct 30, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cjson: link with libm, unavailable for static

Link with libm as stated in the README, fixes:
http://autobuild.buildroot.net/results/57f/57fc124e14263ee2447e20a5b910ed3ae0a5b7db/

Also disable the package for static builds since it doesn't work that way.

---
 package/cjson/Config.in | 2 ++
 package/cjson/cjson.mk  | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
package/cjson/Config.in +2 -0
index ff90074..fed61d7 100644
@@ -1,5 +1,7 @@
 config BR2_PACKAGE_CJSON
 	bool "cJSON"
+	# For static build with cJSON.c directly see README
+	depends on !BR2_PREFER_STATIC_LIB
 	help
 	  An ultra-lightweight, portable, single-file, simple-as-can-be ANSI-C
 	  compliant JSON parser, under MIT license.
package/cjson/cjson.mk +2 -1
index 7e1d72d..2093b02 100644
@@ -12,7 +12,8 @@ CJSON_LICENSE         = MIT
 CJSON_LICENSE_FILES   = LICENSE
 
 define CJSON_BUILD_CMDS
-	cd $(@D) && $(TARGET_CC) $(TARGET_CFLAGS) -shared -fPIC cJSON.c -o libcJSON.so
+	cd $(@D) && $(TARGET_CC) $(TARGET_CFLAGS) -shared -fPIC -lm \
+		cJSON.c -o libcJSON.so
 endef
 
 define CJSON_INSTALL_STAGING_CMDS
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH 1/1 cjson: link with libm, unavailable for static

Dear Gustavo Zacarias,

Quoted 7 lines · Gustavo Zacarias

Link with libm as stated in the README, fixes:
http://autobuild.buildroot.net/results/57f/57fc124e14263ee2447e20a5b910ed3ae0a5b7db/

Also disable the package for static builds since it doesn't work that way.

Applied to for-peter-2013.11, thanks!

Thomas

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