<div dir="ltr"><div><div><div>I'm working on porting suricata to openwrt and have run into an issue with iconv.  It seems that there are different ways to invoke the ICONV libraries.  <br></div><div>Those porting suricata to freebsd had the same problem and error.  <a href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196720">https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196720</a>  From their patch it looks like they were able to invoke iconv with <br><pre class="">iconv:translit vs its default method</pre></div><div>Is there a similar configuration method for openwrt Makefiles?<br><br></div>THe following is the error message I get while compiling.  <br><br>htp_transcoder.c: In function 'htp_transcode_params':<br>htp_transcoder.c:68:5: warning: implicit declaration of function 'iconvctl' [-Wimplicit-function-declaration]<br>     iconvctl(cd, ICONV_SET_TRANSLITERATE, &iconv_param);<br>     ^<br>htp_transcoder.c:68:18: error: 'ICONV_SET_TRANSLITERATE' undeclared (first use in this function)<br>     iconvctl(cd, ICONV_SET_TRANSLITERATE, &iconv_param);<br>                  ^<br>htp_transcoder.c:68:18: note: each undeclared identifier is reported only once for each function it appears in<br>htp_transcoder.c:70:18: error: 'ICONV_SET_DISCARD_ILSEQ' undeclared (first use in this function)<br>     iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, &iconv_param);<br>                  ^<br>make[7]: *** [htp_transcoder.lo] Error 1<br><br><br></div><br></div>Relevant section of my Makefile<br>#<br># Copyright (C) 2007-2011 OpenWrt.org<br>#<br># This is free software, licensed under the GNU General Public License v2.<br># See /LICENSE for more information.<br># compiler need libyaml-dev<br> <br>include $(TOPDIR)/<a href="http://rules.mk">rules.mk</a><br> <br>PKG_NAME:=suricata<br>PKG_VERSION:=2.0.6<br>PKG_RELEASE:=1<br>PKG_MAINTAINER:=Derek W <thewerthfam@gmailcom><br>PKG_LICENSE:=GPLv2<br><br>PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz<br># PKG_SOURCE:=<a href="http://www.openinfosecfoundation.org/download/suricata-2.0.6.tar.gz">http://www.openinfosecfoundation.org/download/suricata-2.0.6.tar.gz</a><br>#PKG_SOURCE_URL:=<a href="http://www.openinfosecfoundation.org/download/">http://www.openinfosecfoundation.org/download/</a><br>#PKG_MD5SUM:=14bfb3adc184d4da321c93ed9abae500<br>PKG_SOURCE_URL:=../suricata-2.0.6.tar.gz<br>PKG_MD5SUM:=fd0ade58b6f5d25c7446e1f1d07d1edf<br><br>PKG_INSTALL:=1<br><br>PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)<br><br>include $(INCLUDE_DIR)/<a href="http://package.mk">package.mk</a><br>include $(INCLUDE_DIR)/<a href="http://nls.mk">nls.mk</a><br> <br>define Package/suricata<br>  SECTION:=net<br>  CATEGORY:=Network<br>  SUBMENU:=Web Servers/Proxies<br>  TITLE:=Suricata<br>  URL:=<a href="http://www.openinfosecfoundation.org">http://www.openinfosecfoundation.org</a><br>  DEPENDS:=+libpcre +pcre +libtool +libnetfilter-queue +libpcap +libnet +libyaml +zlib +libcap +libnids +libnet0 +libopenssl +libnfnetlink $(ICONV_DEPENDS) $(INTL_DEPENDS) +libintl-full +libmagic +libcap<br>  MENU:=1<br>endef<br><br>TARGET_CPPFLAGS += \<br>    -I$(STAGING_DIR)/usr/lib/ \<br>    -I$(STAGING_DIR)/usr/include \<br>    -I$(ICONV_PREFIX)/include \<br>    -I$(INTL_PREFIX)/include \<br>    -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \<br><br>#    -I$(ICONV_PREFIX)/include \<br>#    -I$(INTL_PREFIX)/include \<br><br><br>TARGET_LDFLAGS += \<br>    -L$(STAGING_DIR)/usr/lib/ \<br>    -L$(ICONV_PREFIX)/lib \<br>    -L$(INTL_PREFIX)/lib \<br><br><br>#    -L$(ICONV_PREFIX)/lib \<br>#    -L$(INTL_PREFIX)/lib \<br><br><br>#TARGET_CFLAGS += $(FPIC) "-D_DEFAULT_SOURCE"  \<br><br>TARGET_CFLAGS += $(FPIC) \<br><br>MAKE_FLAGS +=\<br>    CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \<br>    LDFLAGS="$(TARGET_LDFLAGS)" \<br>    ICONV_LIBS="-liconv $(if $(INTL_FULL),-lintl)" \<br><br>#    ICONV_LIBS="-liconv" \<br><br>MAKE_VARS +=\<br>    PREFIX="$(STAGING_DIR)/usr" \<br>    ICONV_PREFIX="$(ICONV_PREFIX)" \<br>    INTL_PREFIX="$(INTL_PREFIX)" \<br><br>CONFIGURE_ARGS += \<br>    --enable-nfqueue \<br>    $(if $(ICONV_FULL),--with-libiconv=gnu) \<br><br>#        INTL_PREFIX="$(INTL_PREFIX)" \<br><br>#define Build/Configure<br>#    $(call Build/Configure/Default, \<br>#    --enable-nfqueue \<br>#    CPPFLAGS="$(TARGET_CPPFLAGS)" \<br>#    CXXFLAGS="$(TARGET_CFLAGS)" \<br>#    LDFLAGS="$(TARGET_LDFLAGS)" \<br>#    )        <br>#endef<br><br>#define Build/Compile<br>#    $(MAKE) -C $(PKG_BUILD_DIR) \<br>#    LDFLAGS="$(TARGET_LDFLAGS)" \<br>#    all install<br>#endef<br><br>define Package/suricata/install<br>    $(INSTALL_DIR) $(1)/usr/sbin<br>endef<br> <br>$(eval $(call BuildPackage,suricata))<br><div><br><div><br></div></div></div>