Building new package lnav

I try to build lnav ( using the ImageBuilder.
It runs on a Ubuntu 20.04.2 LTS and works fine to build an OpenWRT image including my selected packages.
For lnav I created .../package/feeds/packages/lnav/Makefile

# Copyright (C) 2007-2016
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.

include $(TOPDIR)/




include $(INCLUDE_DIR)/

define Package/lnav
  TITLE:=An advanced log file viewer for the small-scale
  DEPENDS:=+libncurses +libpcre +libreadline +libbz2 +libcurl +libarchive +libsqlite3 +zlib

define Package/lnav/description
  An advanced log file viewer for the small-scale
  Watch and analyze your log files from a terminal.
  No server. No setup. Still featureful.

define Package/lnav/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/

$(eval $(call BuildPackage,lnav))

I select lnav in 'make menuconfig' and run 'make'.
This gives me the following error:

checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking size of off_t... (cached) 8
checking size of size_t... (cached) 4
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_zone... yes
checking for library containing openpty... none required
checking for library containing gzseek... no
configure: error: libz required to build
make[3]: *** [Makefile:54: /home/mbu/src/openwrt/build_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/lnav-0.9.0/.configured_68b329da9893e34099c7d8ad5cb9c940] Error 1
make[3]: Leaving directory '/home/mbu/src/openwrt/feeds/packages/utils/lnav'
time: package/feeds/packages/lnav/compile#2.84#1.35#3.90
    ERROR: package/feeds/packages/lnav failed to build.
make[2]: *** [package/Makefile:116: package/feeds/packages/lnav/compile] Error 1
make[2]: Leaving directory '/home/mbu/src/openwrt'
make[1]: *** [package/Makefile:110: /home/mbu/src/openwrt/staging_dir/target-arm_cortex-a9+vfpv3-d16_musl_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/mbu/src/openwrt'
make: *** [/home/mbu/src/openwrt/include/ world] Error 2

What's wrong?

sure it's the same lib ?

1 Like

I tried +zlib, +libz as well as only +z. Always the same error.

There's also libzlib...

No success. And +liblibz also does not work.
I guess I have to tell the build system somehow to tell the configure script where it will find the library. But how?

shot in the dark here, but have a look to see if the zlib-dev package is being built. I have a feeling it could be the one that providers zlib at build time.

make -j1 packages/lnav/{clean,compile} V=99

You'll be in verbose mode and may get more advice from the error...

I gave up.
After looking through the configure.log I found to problem and 'fixed' it with a manual call to
But later in the process another library, libgpm was missing. Unfortunately that library is not part of OpenWRT!