OpenWrt Forum Archive

Topic: Package libwlocate is missing dependencies for the following libraries

The content of this topic has been archived on 18 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I´m trying to create my first OpenWrt package for the libwlocate library but I´m stuck at this point:

find /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/ipkg-ar71xx/libwlocate -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm -rf
Package libwlocate is missing dependencies for the following libraries:
libc.so.6
libiw.so.29
libm.so.6
make[2]: *** [/home/floh1111/openwrt-sdk-x86_64/build/fonera/bin/ar71xx/packages/libwlocate_1.1-1_ar71xx.ipk] Error 1

My makefile created based on the howto from the wiki looks like this:

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

include $(TOPDIR)/rules.mk

PKG_NAME:=libwlocate
PKG_VERSION:=1.1
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://dev.freifunk-ol.de/packages
PKG_MD5SUM:=739b43ac6845efa6edf5d8aae0676169

include $(INCLUDE_DIR)/package.mk

define Package/libwlocate
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=Shared library that can be used for location-based services
  URL:=http://sourceforge.net/projects/libwlocate/
  DEPENDS:=+wireless-tools
endef

define Package/libwlocate/description
    libwlocate is a shared library that can be used for location-based services.
    It checks for WLAN-networks that are available near to a user and retrieves the
    current geographic position out of them.
    Thus no GPS is needed for positioning. This WLAN-based geolocation happens
    without using any of the commercial services that do the same but track the users
    position and data. libwlocate instead bases on the free OpenWLANMap project.
endef

define Build/InstallDev
    $(INSTALL_DIR) $(1)/usr/include
    $(CP) $(PKG_BUILD_DIR)/libwlocate.h $(1)/usr/include/
    
    $(INSTALL_DIR) $(1)/usr/lib
    $(CP) $(PKG_BUILD_DIR)/libwlocate.so $(1)/usr/lib/
endef

define Package/libwlocate/install
    $(INSTALL_DIR) $(1)/usr/lib
    $(CP) $(PKG_BUILD_DIR)/libwlocate.so $(1)/usr/lib/
endef

$(eval $(call BuildPackage,libwlocate))

I think to get libiw.so.29 I have to make the package depend on wireless-tools right? But what´s up with the other depencies the compiler complains about?

I´m some kind of new to building packages for OpenWrt. I already tried to build this library some months ago and failed but now I need it again to test some stuff so I would be happy if anyone can help me.

Kind regards
Floh1111

Judging from the library names it was not cross compiled at all but built for your host system, probably due to a bad upstream Makefile.

Just took a look at the tarball, the Makefile is indeed unsuitable for cross compilation. It hardcodes "gcc" while it should use the abstract "$(CC)".

Okay so I replaced gcc with $(CC) but the error still exists. The makefile in the tarball now looks like this:

CCOMPILER=$(CC) -Wall -fPIC -shared -Wno-unused -O2 -g0 -DNDEBUG -D_REENTRANT -DENV_LINUX -I. -I..

SYSLIBRARIES= -lm

LIBS = $(SYSLIBRARIES) -liw

EXECUTABLE=libwlocate.so

LINK=$(CC) -shared -Wl,--no-as-needed

OBJECTS = connect.o wlan.o libwlocate.o iwlist.o

default: $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS)
    $(LINK) $(SYSLDFLAGS) $(LDFLAGS) -o $(EXECUTABLE) $(OBJECTS) $(LIBS) 

%.o: %.c
    $(CCOMPILER) -c $< -o $@

clean:
    rm -f $(OBJECTS) $(EXECUTABLE)
find /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/ipkg-ar71xx/libwlocate -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm -rf
Package libwlocate is missing dependencies for the following libraries:
libc.so.6
libiw.so.29
libm.so.6
make[2]: *** [/home/floh1111/openwrt-sdk-x86_64/build/fonera/bin/ar71xx/packages/libwlocate_1.1-1_ar71xx.ipk] Error 1

The tarball can be downloaded here. Is there more code that should dynamic?

Regards
Floh1111

Post the entire output of "make package/libwlocate/{clean,compile} V=99"

[floh1111@flohlap fonera]$ make package/libwlocate/{clean,compile} V=99
make[1]: Entering directory `/home/floh1111/openwrt-sdk-x86_64/build/fonera'
make[2]: Entering directory `/home/floh1111/openwrt-sdk-x86_64/build/fonera/package/libwlocate'
rm -f /home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/target-mips_r2_uClibc-0.9.33.2/stamp/.libwlocate_installed
rm -f /home/floh1111/openwrt-sdk-x86_64/build/fonera/bin/ar71xx/packages/libwlocate_*
rm -f /home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/target-mips_r2_uClibc-0.9.33.2/packages/libwlocate.list /home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/host/packages/libwlocate.list
rm -rf /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1
make[2]: Leaving directory `/home/floh1111/openwrt-sdk-x86_64/build/fonera/package/libwlocate'
make[1]: Leaving directory `/home/floh1111/openwrt-sdk-x86_64/build/fonera'
make[1]: Entering directory `/home/floh1111/openwrt-sdk-x86_64/build/fonera'
make[2]: Entering directory `/home/floh1111/openwrt-sdk-x86_64/build/fonera/package/toolchain'
WARNING: skipping libssp -- package not selected
WARNING: skipping libstdcpp -- package not selected
WARNING: skipping librt -- package not selected
WARNING: skipping libgfortran -- package not selected
WARNING: skipping ldd -- package not selected
WARNING: skipping ldconfig -- package not selected
make[2]: Leaving directory `/home/floh1111/openwrt-sdk-x86_64/build/fonera/package/toolchain'
make[2]: Entering directory `/home/floh1111/openwrt-sdk-x86_64/build/fonera/package/wireless-tools'
WARNING: skipping libiw -- package not selected
make[2]: Leaving directory `/home/floh1111/openwrt-sdk-x86_64/build/fonera/package/wireless-tools'
make[2]: Entering directory `/home/floh1111/openwrt-sdk-x86_64/build/fonera/package/libwlocate'
mkdir -p /home/floh1111/openwrt-sdk-x86_64/build/fonera/dl
/home/floh1111/openwrt-sdk-x86_64/build/fonera/scripts/download.pl "/home/floh1111/openwrt-sdk-x86_64/build/fonera/dl" "libwlocate-1.1.tar.gz" "9a972ea583476df4003f9ac2b69f998e" "http://dev.freifunk-ol.de/packages"
--2013-03-12 14:08:38--  http://dev.freifunk-ol.de/packages/libwlocate-1.1.tar.gz
Resolving dev.freifunk-ol.de (dev.freifunk-ol.de)... 37.221.194.18, 2a03:4000:2:1a5::1
Connecting to dev.freifunk-ol.de (dev.freifunk-ol.de)|37.221.194.18|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 34220 (33K) [application/x-gzip]
Saving to: 'STDOUT'

100%[======================================================================================================================================================>] 34,220      --.-K/s   in 0.09s   

2013-03-12 14:08:39 (379 KB/s) - written to stdout [34220/34220]

. /home/floh1111/openwrt-sdk-x86_64/build/fonera/include/shell.sh; gzip -dc /home/floh1111/openwrt-sdk-x86_64/build/fonera/dl/libwlocate-1.1.tar.gz | /bin/tar -C /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/.. -xf - 
touch /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/.prepared_6a862e084432e3298d2ee04631760151
(cd /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/./; if [ -x ./configure ]; then /usr/bin/find /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/ -name config.guess | xargs -r chmod u+w; /usr/bin/find /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/ -name config.guess | xargs -r -n1 cp /home/floh1111/openwrt-sdk-x86_64/build/fonera/scripts/config.guess; /usr/bin/find /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/ -name config.sub | xargs -r chmod u+w; /usr/bin/find /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/ -name config.sub | xargs -r -n1 cp /home/floh1111/openwrt-sdk-x86_64/build/fonera/scripts/config.sub; AR=mips-openwrt-linux-uclibc-ar AS="mips-openwrt-linux-uclibc-gcc -c -Os -pipe -mips32r2 -mtune=mips32r2 -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 CFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float " CXXFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float " CPPFLAGS="-I/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include -I/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/target-mips_r2_uClibc-0.9.33.2/include -I/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/include -I/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/include " LDFLAGS="-L/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib -L/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/target-mips_r2_uClibc-0.9.33.2/lib -L/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/lib -L/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib "   ./configure --target=mips-openwrt-linux --host=mips-openwrt-linux --build=x86_64-unknown-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls   ; fi; )
rm -f /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/.configured_*
touch /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/.configured_
CFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float  -I/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include -I/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/target-mips_r2_uClibc-0.9.33.2/include -I/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/include -I/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/include " CXXFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float  -I/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/include -I/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/target-mips_r2_uClibc-0.9.33.2/include -I/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/include -I/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/include " LDFLAGS="-L/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib -L/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/target-mips_r2_uClibc-0.9.33.2/lib -L/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/usr/lib -L/home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib " make -j1 -C /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/. AR=mips-openwrt-linux-uclibc-ar AS="mips-openwrt-linux-uclibc-gcc -c -Os -pipe -mips32r2 -mtune=mips32r2 -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 CROSS="mips-openwrt-linux-uclibc-" ARCH="mips" ;
make[3]: Entering directory `/home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1'
make[3]: Nothing to be done for `default'.
make[3]: Leaving directory `/home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1'
touch /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/.built
mkdir -p /home/floh1111/openwrt-sdk-x86_64/build/fonera/bin/ar71xx/packages /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/ipkg-ar71xx/libwlocate/CONTROL /home/floh1111/openwrt-sdk-x86_64/build/fonera/staging_dir/target-mips_r2_uClibc-0.9.33.2/pkginfo
install -d -m0755 /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/ipkg-ar71xx/libwlocate/usr/lib
cp -fpR /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/libwlocate.so /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/ipkg-ar71xx/libwlocate/usr/lib/
find /home/floh1111/openwrt-sdk-x86_64/build/fonera/build_dir/target-mips_r2_uClibc-0.9.33.2/libwlocate-1.1/ipkg-ar71xx/libwlocate -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm -rf
Package libwlocate is missing dependencies for the following libraries:
libc.so.6
libiw.so.29
libm.so.6
make[2]: *** [/home/floh1111/openwrt-sdk-x86_64/build/fonera/bin/ar71xx/packages/libwlocate_1.1-1_ar71xx.ipk] Error 1
make[2]: Leaving directory `/home/floh1111/openwrt-sdk-x86_64/build/fonera/package/libwlocate'
make[1]: *** [package/libwlocate/compile] Error 2
make[1]: Leaving directory `/home/floh1111/openwrt-sdk-x86_64/build/fonera'
make: *** [package/libwlocate/compile] Fehler 2

(Last edited by Floh1111 on 12 Mar 2013, 14:10)

The tarball currently on the download server already contains a precompiled libwlocate.so built for x86_64, hence the "make[3]: Nothing to be done for `default'." and subsequent dependency errors.

OMG I´m sorry. Replacing gcc with $(CC) in the Makefile of the source tarball and removing the compiled library from the tarbal works. Thank you!

libiw can be found in the libiw package (not in wireless-tools). Now everything works and I´m gonna try to install the package on the router.

Regards and thanks again
Floh1111

The discussion might have continued from here.