OpenWrt Forum Archive

Topic: PKG_BUILD_DIR - how to define correctly?

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

I'm trying to make makefiles for devicemapper and LVM2, but the archives are giveing me a troublesome start.

the archive is called device-mapper.1.02.22, and contains a directory called the same, but the build system insists on trying to build the package in device-mapper-1.02.22 - which failes as its empty. (the difference is a dot and a dash between the name and the version).

After a bit of searching I found PKG_BUILD_DIR, and defined it in the same way as PKG_SOURCE;
PKG_BUILD_DIR:=$(PKG_NAME).$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz

bjorn@dellbear:~/openwrt/trunk$ make package/device-mapper-compile V=99
Collecting package info: done
Checking 'xgettext'... ok.
Checking 'pkg-config'... ok.
Checking 'automake-1.9'... ok.
make[1]: Entering directory `/home/bjorn/openwrt/trunk'
make[2]: Entering directory `/home/bjorn/openwrt/trunk/package/device-mapper'
gzip -dc /home/bjorn/openwrt/trunk/dl/device-mapper.1.02.22.tgz | /bin/tar -C device-mapper.1.02.22/.. -xf -
ls: ./patches: No such file or directory
touch device-mapper.1.02.22/.prepared_1923b09ee745d4b4d59011f36f118c42
(cd device-mapper.1.02.22/./; if [ -x ./configure ]; then cp -fpR /home/bjorn/openwrt/trunk/scripts/config.{guess,sub} device-mapper.1.02.22// && AR=i386-linux-uclibc-ar AS="ccache i386-linux-uclibc-gcc -c -Os -pipe -funit-at-a-time -fhonour-copts" LD=i386-linux-uclibc-ld NM=i386-linux-uclibc-nm CC="ccache i386-linux-uclibc-gcc" GCC="ccache i386-linux-uclibc-gcc" CXX=i386-linux-uclibc-g++ RANLIB=i386-linux-uclibc-ranlib STRIP=i386-linux-uclibc-strip OBJCOPY=i386-linux-uclibc-objcopy OBJDUMP=i386-linux-uclibc-objdump SIZE=i386-linux-uclibc-size CFLAGS="-Os -pipe -funit-at-a-time -fhonour-copts " CXXFLAGS="-Os -pipe -funit-at-a-time -fhonour-copts " CPPFLAGS="-I/home/bjorn/openwrt/trunk/staging_dir/i386/usr/include -I/home/bjorn/openwrt/trunk/staging_dir/i386/include " LDFLAGS="-L/home/bjorn/openwrt/trunk/staging_dir/i386/usr/lib -L/home/bjorn/openwrt/trunk/staging_dir/i386/lib " PKG_CONFIG_PATH="/home/bjorn/openwrt/trunk/staging_dir/i386/usr/lib/pkgconfig" PKG_CONFIG_LIBDIR="/home/bjorn/openwrt/trunk/staging_dir/i386/usr/lib/pkgconfig"  ./configure --target=i386-linux --host=i386-linux --build=i486-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; )
cp: target `device-mapper.1.02.22//' is not a directory: No such file or directory
make[2]: *** [device-mapper.1.02.22/.configured] Error 1
make[2]: Leaving directory `/home/bjorn/openwrt/trunk/package/device-mapper'
make[1]: *** [package/device-mapper/compile] Error 2
make[1]: Leaving directory `/home/bjorn/openwrt/trunk'
make: *** [package/device-mapper-compile] Error 2

Any ideas?

ah, eureka!

adding $(BUILD_DIR) to the definition helped:
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION)

.. works like a charm (i.e. it extracts at least!)

The discussion might have continued from here.