如题,编译时碰到上述错误,google后一大堆,唯独没有OpenWRT的解决办法,找到这篇文章:
按照文章的方法,在glib目录下,手动执行:
./configure --enable-iconv=no --with-libiconv=gnu
貌似 --enable-iconv=no 没有被识别到(不加也可以)
然后再编译,就可以了!
总觉得此种解决方法不够完美,应该还有更好的方法,知道的童鞋,留个言 ^_^
---------------------------------------------------
感谢wumingxing0228(http://blog.youkuaiyun.com/wumingxing0228)给出了解决方法:
from :http://lists.en.qi-hardware.com/pipermail/discussion/2011-February/007092.html
The OpenWrt menuconfig gained a new boolean symbol called
"CONFIG_BUILD_NLS" which is disabled by default [2]. Turning it on will
enable the building of the full gettext (libintl) and libiconv packages.
The setting can be found in the "Global Build Settings" menu, called
"Compile with full language support".
Packages using either iconv or intl have been changed [3] to include the
new convenience file "include/nls.mk" which exports variables to use
within Makefiles to pull in the right iconv or intl implementation.
The exported variables are:
ICONV_FULL - set to 1 if the full iconv implementation is used,
else unset
ICONV_PREFIX - path to the location of the include/ and lib/ dirs
of the currently used iconv implementation
ICONV_DEPENDS - expands to a dependency specification that results
either in +libiconv-full or nothing, depending on the
CONFIG_BUILD_NLS symbol
ICONV_CFLAGS - contains the appropriate CFLAGS to make programs find
the iconv headers
ICONV_CPPFLAGS - alias to ICONV_CFLAGS
ICONV_LDFLAGS - contains the appropriate LDFLAGS to make programs link
to the iconv implementation
INTL_FULL - set to 1 if the full libintl implementation is used,
else unset
INTL_PREFIX - path to the location of the include/ and lib/ dirs
of the currently used libintl implementation
INTL_DEPENDS - expands to a dependency specification that results
either in +libintl-full or nothing, depending on the
CONFIG_BUILD_NLS symbol
INTL_CFLAGS - contains the appropriate CFLAGS to make programs find
the libintl headers
INTL_CPPFLAGS - alias to INTL_CFLAGS
INTL_LDFLAGS - contains the appropriate LDFLAGS to make programs link
to the libintl implementation
Additionally the include automatically extends the TARGET_CFLAGS,
TARGET_CPPFLAGS and TARGET_LDFLAGS variables so that most programs
should pick up the libs automatically in their configure/make process.
To adapt existing package Makefiles to the new mechanism, the following
changes must be made:
- Add "include $(INCLUDE_DIR)/nls.mk" below the existing "package.mk"
include
- Remove existing extensions to TARGET_CFLAGS/CPPFLAGS/LDFLAGS like
"TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/lib/libintl/include/" (if any)
- Replace existing extensions to other variables with $(ICONV_PREFIX),
$(INTL_PREFIX) where applicable (e.g.
"EXTRA_CPPFLAGS+=-I$(STAGING_DIR)/usr/lib/libiconv/include" to
"EXTRA_CPPFLAGS+=$(ICONV_CPPFLAGS)" or
"EXTRA_CPPFLAGS+=-I$(ICONV_PREFIX)/include")
- Replace dependency specifications like +libiconv, +libiconv-full,
+libintl or +libintl-full with $(ICONV_DEPENDS) or $(INTL_DEPENDS)
- Some packages have configure switches like "--with-libiconv=gnu",
those should be wrapped similar to this:
"$(if $(ICONV_FULL),--with-libiconv=gnu)"
- If a program is known to fail with the stub implementation, a
dependency like "DEPENDS:=@BUILD_NLS" can be specified to hide and
disable the package from menuconfig if CONFIG_BUILD_NLS is unset
Neither the stub nor the full packages install their (shared) objects
and headers into a "standard" location ($(STAGING_DIR)/usr/...) anymore
so programs that must use them have to use the nls.mk facility.
Programs with optional iconv/intl support will just skip over them as
they're not detectable without extra flags anymore.
As the current Backfire branch and Trunk share the same packages feed,
the BUILD_NLS support has been merged into the latest branch as well.
1) http://lists.en.qi-hardware.com/pipermail/discussion/2011-January/006770.html 2) https://dev.openwrt.org/changeset/25302 3) https://dev.openwrt.org/changeset/25319

本文介绍了如何解决OpenWRT编译时遇到的GNU Libiconv错误的问题。通过修改glib目录下的配置参数,可以避免使用Libiconv库导致的错误。同时,文中还提供了更完善的解决方法,包括使用新的`CONFIG_BUILD_NLS`选项来启用完整的gettext和libiconv包构建。此外,详细解释了如何调整现有包Makefile文件以适应新的构建机制。
4886

被折叠的 条评论
为什么被折叠?



