Hi all,

I am building a package which depends on libevent2-core. When building this package zlib seems to be pulled in as a dependency for libevent2, but at that point fails in the configure step with the following error:

make[2]: Entering directory `/data/users/arjen/openwrt/package/libs/zlib'
(cd /data/users/arjen/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/zlib-1.2.8; AR=mips-openwrt-linux-uclibc-ar AS="mips-openwrt-linux-uclibc-gcc -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float" LD=mips-openwrt-linux-uclibc-ld NM=mips-openwrt-linux-uclibc-nm CC="mips-openwrt-linux-uclibc-gcc" GCC="mips-openwrt-linux-uclibc-gcc" CXX="mips-openwrt-linux-uclibc-g++" RANLIB=mips-openwrt-linux-uclibc-ranlib STRIP=mips-openwrt-linux-uclibc-strip OBJCOPY=mips-openwrt-linux-uclibc-objcopy OBJDUMP=mips-openwrt-linux-uclibc-objdump SIZE=mips-openwrt-linux-uclibc-size LDSHARED="mips-openwrt-linux-uclibc-gcc -shared -Wl,-soname,libz.so.1" CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -mips16 -minterlink-mips16 -fpic" ./configure --prefix=/usr --shared --uname=Linux );
configure: error: expected an absolute directory name for --sharedstatedir: --uname=Linux
make[2]: *** [/data/users/arjen/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/zlib-1.2.8/.configured_] Error 1
make[2]: Leaving directory `/data/users/arjen/openwrt/package/libs/zlib'
make[1]: *** [package/libs/zlib/compile] Error 2
make[1]: Leaving directory `/data/users/arjen/openwrt'
make: *** [package/tunneld/compile] Error 2

When this happens and I try to build zlib manually (make package/zlib/compile) it fails until I run the clean step and try again. At this point the package will compile/install just fine. Trying to build my own package afterwards will cause it to get stuck again, which makes me believe I am doing something wrong here.

A successful build of Zlib looks like this and where it errors out on me it seems to look for shared library support. Any pointers would be appreciated as I am running out of things to try. 

I am building for 14.07 and my package file is pretty straightforward:

include $(TOPDIR)/rules.mk

PKG_NAME:=tunneld
PKG_VERSION:=1
PKG_RELEASE:=1

PKG_FIX:=autoreconf
PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk

define Package/tunneld
  SECTION:=base
  CATEGORY:=Network
  TITLE:=A minimal VNet based L2 tunnel client
  DEPENDS:=+vnet +libevent2-core
endef

define Package/tunneld/description
 A minimal VNet based L2 tunnel client
 A minimal L2 tunnel client, built using VNet.
endef

define Package/tunneld/install
  $(INSTALL_DIR) $(1)/usr/bin
  $(CP) $(PKG_INSTALL_DIR)/usr/bin/tunneld $(1)/usr/bin/
endef

$(eval $(call BuildPackage,tunneld))