Akagi201
7/24/2014 - 9:08 AM

openwrt-iconv.md

irc

15:20 Akagi201: I compile a package written by myself, when build, got like this
15:20 Akagi201: Package json-c-api is missing dependencies for the following libraries:
15:20 Akagi201: libc.so.6
15:20 Akagi201: I have added +libc to DEPENDS
15:47 Akagi201: openwrt doesn't c99?
15:47 Akagi201: or maybe I should ask libuc doesn't c99?
16:16 jow_laptop: Akagi201: the missing depends on libc.so.6 sounds liek an unclean tree. If there already is a precompiled .so or something the makesystem will not rebuild the source
16:16 Akagi201: jow_laptop: I fixed the bug
16:16 Akagi201: I change the makefile from gcc to CC
16:17 Akagi201: and it works
16:17 jow_laptop: ah
16:17 jow_laptop: makes sense, yes
16:17 Akagi201: JW_string.c:2:19: fatal error: iconv.h: No such file or directory
16:17 Akagi201: #include <iconv.h>
16:17 Akagi201: now is another error
16:18 jow_laptop: include $(INCLUDE_DIR)/nls.mk after package.mk
16:19 Akagi201: include $(INCLUDE_DIR)/package.mk
16:19 Akagi201: define Package/json-c-api
16:19 Akagi201: SECTION:=utils
16:19 Akagi201: CATEGORY:=Utilities
16:19 Akagi201: TITLE:=Akagi201-json-c-api
16:19 Akagi201: DEPENDS:=+libstdcpp +libc +libpthread +libjson-c +libiconv
16:19 Akagi201: endef
16:19 Akagi201: after this ?
16:21 Akagi201: jow_laptop: what does nls.mk means?
16:22 jow_laptop: nls = native language support
16:22 jow_laptop: openwrt provides two iconv implementations
16:22 jow_laptop: a full one through libintl and a stubbed one that just supports a subset of conversions
16:23 jow_laptop: the implementations can be toggled in menuconfig
16:23 jow_laptop: nls.mk takes care of setting the -I and -L flags for the proper one
16:23 Akagi201: thanks
16:23 Akagi201: should I make menuconfig and mark the libintl
16:24 jow_laptop: it will also export a variable $(ICONV_DEPENDS)
16:24 Akagi201: I still get the error
16:24 jow_laptop: which you should add to your $(DEPENDS) line
16:24 Akagi201: JW_string.c:2:19: fatal error: iconv.h: No such file or directory
16:24 Akagi201: #include <iconv.h>
16:24 jow_laptop: pastebin your full makefile
16:25 Akagi201: https://gist.github.com/anonymous/11b52af1ca85c2f7d69d
16:26 jow_laptop: line 24 is wrong
16:26 jow_laptop: it should be Build/compile
16:26 jow_laptop: without Package/json-c-api
16:27 Akagi201: I just compile a hello world
16:27 Akagi201: it works
16:27 Akagi201: I give a try
16:28 jow_laptop: is the makefile in json-c-api.tar.gz using $(CFLAGS) and $(LDFLAGS) properly?
16:29 Akagi201: the makefile is a little ugly.
16:30 Akagi201: https://gist.github.com/anonymous/29dc28a05e331b260ed9
16:32 Akagi201: ok I found that I don't use -liconv
16:32 Akagi201: it compile success on my x86 linux