[OpenWrt-Devel] ICONV & ICONV_SET_TRANSLITERATE issue in trying to port suricata to openwrt

Derek Werthmuller thewerthfam at gmail.com
Mon Mar 2 07:52:56 EST 2015


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.
Those porting suricata to freebsd had the same problem and error.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196720  From their patch
it looks like they were able to invoke iconv with

iconv:translit vs its default method

Is there a similar configuration method for openwrt Makefiles?

THe following is the error message I get while compiling.

htp_transcoder.c: In function 'htp_transcode_params':
htp_transcoder.c:68:5: warning: implicit declaration of function 'iconvctl'
[-Wimplicit-function-declaration]
     iconvctl(cd, ICONV_SET_TRANSLITERATE, &iconv_param);
     ^
htp_transcoder.c:68:18: error: 'ICONV_SET_TRANSLITERATE' undeclared (first
use in this function)
     iconvctl(cd, ICONV_SET_TRANSLITERATE, &iconv_param);
                  ^
htp_transcoder.c:68:18: note: each undeclared identifier is reported only
once for each function it appears in
htp_transcoder.c:70:18: error: 'ICONV_SET_DISCARD_ILSEQ' undeclared (first
use in this function)
     iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, &iconv_param);
                  ^
make[7]: *** [htp_transcoder.lo] Error 1



Relevant section of my Makefile
#
# Copyright (C) 2007-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
# compiler need libyaml-dev

include $(TOPDIR)/rules.mk

PKG_NAME:=suricata
PKG_VERSION:=2.0.6
PKG_RELEASE:=1
PKG_MAINTAINER:=Derek W <thewerthfam at gmailcom>
PKG_LICENSE:=GPLv2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
# PKG_SOURCE:=
http://www.openinfosecfoundation.org/download/suricata-2.0.6.tar.gz
#PKG_SOURCE_URL:=http://www.openinfosecfoundation.org/download/
#PKG_MD5SUM:=14bfb3adc184d4da321c93ed9abae500
PKG_SOURCE_URL:=../suricata-2.0.6.tar.gz
PKG_MD5SUM:=fd0ade58b6f5d25c7446e1f1d07d1edf

PKG_INSTALL:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk

define Package/suricata
  SECTION:=net
  CATEGORY:=Network
  SUBMENU:=Web Servers/Proxies
  TITLE:=Suricata
  URL:=http://www.openinfosecfoundation.org
  DEPENDS:=+libpcre +pcre +libtool +libnetfilter-queue +libpcap +libnet
+libyaml +zlib +libcap +libnids +libnet0 +libopenssl +libnfnetlink
$(ICONV_DEPENDS) $(INTL_DEPENDS) +libintl-full +libmagic +libcap
  MENU:=1
endef

TARGET_CPPFLAGS += \
    -I$(STAGING_DIR)/usr/lib/ \
    -I$(STAGING_DIR)/usr/include \
    -I$(ICONV_PREFIX)/include \
    -I$(INTL_PREFIX)/include \
    -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \

#    -I$(ICONV_PREFIX)/include \
#    -I$(INTL_PREFIX)/include \


TARGET_LDFLAGS += \
    -L$(STAGING_DIR)/usr/lib/ \
    -L$(ICONV_PREFIX)/lib \
    -L$(INTL_PREFIX)/lib \


#    -L$(ICONV_PREFIX)/lib \
#    -L$(INTL_PREFIX)/lib \


#TARGET_CFLAGS += $(FPIC) "-D_DEFAULT_SOURCE"  \

TARGET_CFLAGS += $(FPIC) \

MAKE_FLAGS +=\
    CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
    LDFLAGS="$(TARGET_LDFLAGS)" \
    ICONV_LIBS="-liconv $(if $(INTL_FULL),-lintl)" \

#    ICONV_LIBS="-liconv" \

MAKE_VARS +=\
    PREFIX="$(STAGING_DIR)/usr" \
    ICONV_PREFIX="$(ICONV_PREFIX)" \
    INTL_PREFIX="$(INTL_PREFIX)" \

CONFIGURE_ARGS += \
    --enable-nfqueue \
    $(if $(ICONV_FULL),--with-libiconv=gnu) \

#        INTL_PREFIX="$(INTL_PREFIX)" \

#define Build/Configure
#    $(call Build/Configure/Default, \
#    --enable-nfqueue \
#    CPPFLAGS="$(TARGET_CPPFLAGS)" \
#    CXXFLAGS="$(TARGET_CFLAGS)" \
#    LDFLAGS="$(TARGET_LDFLAGS)" \
#    )
#endef

#define Build/Compile
#    $(MAKE) -C $(PKG_BUILD_DIR) \
#    LDFLAGS="$(TARGET_LDFLAGS)" \
#    all install
#endef

define Package/suricata/install
    $(INSTALL_DIR) $(1)/usr/sbin
endef

$(eval $(call BuildPackage,suricata))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150302/74e2cbfa/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list