Skip to contentSkip to conversation

Eliminate $(HOST_DIR)/usr

PATCH New Arnout Vandecappelle (Essensium/Mind) 3 participants 58 messages Apr 12, 2017 – Jul 2, 2017

Subsystems (11)
lore
Share & tools
lore
#0 lore raw

cover Eliminate $(HOST_DIR)/usr

We currently use $(HOST_DIR)/usr as the prefix for host packages. That has a few disadvantages:

- There are some things installed in $(HOST_DIR)/etc and $(HOST_DIR)/sbin, which is inconsistent.

- To pack a buildroot-built toolchain into a tarball for use as an external toolchain, you have to pack output/host/usr instead of the more obvious output/host.

- Because of the above, the internal toolchain wrapper breaks which forces us to work around it (call the actual toolchain executable directly). This is OK for us, but when used in another build system, that's a problem.

- Paths are four characters longer.

This series replaces all occurences of 'host/usr' (in its various forms) with 'host', and updates relative paths accordingly.

To allow for a gradual change, host/usr is replaced with a symlink, so that everything keeps working. Except that it turns out that not everything keeps working when we do that: quite a few things need to be fixed. Therefore that patch is split up into three steps:

- First $(HOST_DIR)/usr/$(GNU_TARGET_NAME) is moved one level up. This can be done safely (tested with both internal and external toolchain and building a few packages). The usr bit is removed from STAGING_DIR in the same patch, though it could have been split off.

- Next, $(HOST_DIR)/usr/lib is moved one level up. This can only be done after the first step, otherwise the internal toolchain fails to find ar, ld, etc. Also, when we do this, check-host-rpath has to be adapted to take into account the new location of the shared libs. The check-host-rpath change could have been partly split off in a separate patch, but then we'd have to check for either lib or usr/lib, and afterwards check only for lib again.

- Then we can move the entire host/usr one level up. At the same time, the ../.. in the external toolchain and toolchain wrapper has to be changed. Doing /bin and /sbin in a separate step still turns out not to be possible, again because of the internal toolchain that doesn't find cc1 etc. And it anyway wouldn't help much, because the ../.. change has to be done in the same patch as moving the bin directory.

I've tested both internal and external toolchains, and a large number of host packages after these changes. That turned up one problem:
libsepol, which creates a symlink that is no longer valid after the move. Fortunately that could be fixed in an independent patch.

Next comes a long series of patches that clean things up. They are all mostly independent from each other, although sometimes there will be merge conflicts of course.

- The first three are things that were also covered by the automatic replacements, but required some additional fixups. So these are split up into patches that stand on their own. They are anyway also infrastructure changes so nicer to have in separate patches.

- Next we have two patches that fix the use of $(HOST_DIR)/usr/$(GNU_TARGET_NAME) in gcc and gdb. These could in fact come immediately after the move of that directory, but I thought it was nicer to keep all the cleanups together.

- Next come six patches that clean up the various infras.

- Next are seven patches that clean up things globally using various regexes. I actually created those patches over a year ago already and just refreshed them by re-applying the regex.

- Next come two patches that fix up things not caught by the regex.

- Then come thirteen patches that fix up things in various scripts and readmes and that weren't caught by the automatic replacement (mostly because those are using $HOST_DIR and not $(HOST_DIR) ).

- Then we get the libffi patch, which fixes a use of $(HOST_DIR)/usr that I accidentally stumbled upon while testing.

- Finally we get 14 patches that fix the use of $(HOST_DIR) as prefix instead of DESTDIR. In autotools and CMake host packages, we don't use DESTDIR but we set --prefix to the host directory. Indeed, DESTDIR is meant for situations where we build in a build-root, i.e. where the installation directory is not the same absolute path where things will be executed. For host packages, however, the installation directory *is* where it will be executed.

So for autotools and CMake host packages this works well, but quite a few generic packages turn out to use something like DESTDIR incorrectly. I found these by grepping for DESTDIR.*HOST_DIR and checking if it was correct (in very few cases it was indeed correct). See the individual patches for details.

  In this part, the SELinux packages turn out to be a bit problematic.
  Most of them have a PREFIX that defaults to $(DESTDIR)/usr, but then
  some installation commands don't use PREFIX and instead directlly
  refer to $(DESTDIR)/etc or $(DESTDIR)/usr/share/man. Also, sometimes
  policycoreutils uses $(DESTDIR)/usr/include/glib-2.0 to find glib
  includes.

I also noticed a small issue in pkg-rebar, so I added an additional patch in the very beginning of the series that fixes it. It's totally independent of the rest, however.

After the entire series, I have removed the usr symlink and I've build-tested all the host packages, as well as grub2, gummiboot and syslinux. Quite a few of these just failed to build on my machine, but that didn't seem to be related to the host/usr move.

There are still problematic packages:

- As mentioned before, policycoreutils hardcodes the /usr part to find glib-2.0 and dbus-1.0 headers and libraries.

- policycoreutils and the other SELinux packages install stuff in $(HOST_DIR)/usr, but it's harmless stuff (man pages, bash completion, etc.).

All the rest looks fine!

For policycoreutils, I guess the next step is to make upstreamable patches to convert to pkg-config. But that was a bit too much for this series :-). For the installation of man pages and stuff in $(HOST_DIR)/usr, I don't care much.

----------------------------------------------------------------
The following changes since commit efd6d5fd24706d825abae5f2bb39771fce586f09:

package/tvheadend: reduce target binary size by using pngquant (2017-04-09 16:05:49 +0200)

are available in the git repository at:

https://gitlab.com/arnout/buildroot host-usr-3

for you to fetch changes up to e36dbdddc6593685b2557c53b1d1541d3c375ef1:

policycoreutils: rework host installation (2017-04-12 11:29:54 +0200)

----------------------------------------------------------------
Arnout Vandecappelle (53):

      pkg-rebar: remove redundant / in front of $($(PKG)_ERLANG_LIBDIR)
      libsepol: rework host installation
      Move $(HOST_DIR)/usr/$(GNU_TARGET_NAME) one level up.
      Move $(HOST_DIR)/usr/lib to $(HOST_DIR)/lib
      Eliminate $(HOST_DIR)/usr
      check-host-rpath: no longer check $(HOST_DIR)/usr/{bin,sbin}
      Makefile: remove $(HOST_DIR)/usr from BR_PATH
      package/Makefile.in: remove $(HOST_DIR)/usr part from HOST_LDFLAGS
      gdb: Remove /usr part from installation path of gdbserver
      gcc-final: things are no longer installed in $(HOST_DIR)/usr
      pkg-autotools: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
      pkg-cmake: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
      pkg-cmake: move configuration files out of $(HOST_DIR)/usr
      pkg-cmake: programs are now installed in $(HOST_DIR)/bin
      pkg-python: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
      pkg-rebar: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
      generic packages: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
      Globally replace $(HOST_DIR)/usr/bin with $(HOST_DIR)/bin
      Globally replace $(HOST_DIR)/usr/sbin with $(HOST_DIR)/sbin
      Globally replace $(HOST_DIR)/usr/lib with $(HOST_DIR)/lib
      Globally replace $(HOST_DIR)/usr/include with $(HOST_DIR)/include
      Globally replace $(HOST_DIR)/usr/share with $(HOST_DIR)/share
      Globally replace $(HOST_DIR)/usr with $(HOST_DIR)
      luarocks: things are no longer installed in $(HOST_DIR)/usr
      qt: things are no longer installed in $(HOST_DIR)/usr
      boards: replace $HOST_DIR/usr/ with $HOST_DIR/ in scripts
      chromebook snow: remove $(HOST_DIR)/usr reference from README
      warpboard: remove $(HOST_DIR)/usr reference from README
      stm32f429-disco: replace $HOST_DIR/usr with $HOST_DIR in flash script
      stm32f469-disco: replace $HOST_DIR/usr with $HOST_DIR in flash script
      eclipse-register-toolchain: toolchain is no longer installed in $(HOST_DIR)/usr
      manual: remove references to host/usr paths
      grub2: remove host/usr reference from help text
      lttng-tools: remove host/usr reference from help text
      mfgtools: remove host/usr reference from readme.txt
      lesstif: remove host/usr reference from .mk comment
      board/gdb/bfin-bf512: remove host/usr reference from readme.txt
      board/csky: remove host/usr reference from readme.txt
      libffi: avoid $(HOST_DIR)/usr while moving headers
      genromfs: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix
      libcap: use $(HOST_DIR) as prefix instead of DESTDIR
      lzip: use $(HOST_DIR) as prefix instead of DESTDIR
      opkg-utils: use $(HOST_DIR) as PREFIX instead of DESTDIR
      raspberrypi-usbboot: remove /usr from DESTDIR-based install commands
      dos2unix: use prefix instead of DESTDIR for host installation
      imx-uxb-loader: use prefix instead of DESTDIR for host installation
      mtd: use PREFIX instead of DESTDIR for host installation
      grub2: install in $(HOST_DIR) instead of $(HOST_DIR)/usr
      sepolgen: strip /usr/ part from HOST_DIR
      libsemanage: rework host installation
      libselinux: rework host installation
      checkpolicy: rework host installation
      policycoreutils: rework host installation
 Makefile                                           | 15 ++++++++----
 board/boundarydevices/common/post-build.sh         |  4 ++--
 board/chromebook/snow/mksd.sh                      |  4 ++--
 board/chromebook/snow/readme.txt                   |  2 +-
 board/chromebook/snow/sign.sh                      |  6 ++---
 board/csky/readme.txt                              |  2 +-
 board/cubietech/cubieboard2/post-build.sh          |  2 +-
 board/firefly/firefly-rk3288/post-image.sh         |  2 +-
 board/freescale/warpboard/README                   |  4 ++--
 board/gdb/bfin-bf512/readme.txt                    |  4 ++--
 board/lemaker/bananapro/post-build.sh              |  2 +-
 board/linksprite/pcduino/post-build.sh             |  2 +-
 board/nanopi-neo/post-build.sh                     |  2 +-
 board/nexbox/a95x/post-build.sh                    |  2 +-
 board/olimex/a20_olinuxino/post-build.sh           |  2 +-
 board/orangepi/post-build.sh                       |  2 +-
 board/pc/post-image.sh                             |  2 +-
 board/solidrun/mx6cubox/post-build.sh              |  2 +-
 board/stmicroelectronics/stm32f429-disco/flash.sh  |  2 +-
 board/stmicroelectronics/stm32f469-disco/flash.sh  |  2 +-
 board/technologic/ts4800/post-image.sh             |  2 +-
 board/technologic/ts4900/post-image.sh             |  2 +-
 board/udoo/neo/post-build.sh                       |  2 +-
 board/wandboard/post-build.sh                      |  2 +-
 boot/grub2/Config.in                               |  4 ++--
 boot/grub2/grub2.mk                                |  8 ++++---
 boot/mxs-bootlets/mxs-bootlets.mk                  |  2 +-
 boot/syslinux/syslinux.mk                          |  6 ++---
 boot/uboot/uboot.mk                                | 10 ++++----
 docs/manual/faq-troubleshooting.txt                |  2 +-
 docs/manual/using-buildroot-debugger.txt           |  2 +-
 docs/manual/using-buildroot-toolchain.txt          |  2 +-
 fs/axfs/axfs.mk                                    |  2 +-
 fs/cloop/cloop.mk                                  |  4 ++--
 fs/common.mk                                       |  4 ++--
 fs/cramfs/cramfs.mk                                |  2 +-
 fs/iso9660/iso9660.mk                              |  6 ++---
 fs/romfs/romfs.mk                                  |  2 +-
 fs/squashfs/squashfs.mk                            |  2 +-
 fs/ubifs/ubi.mk                                    |  2 +-
 fs/ubifs/ubifs.mk                                  |  2 +-
 fs/yaffs2/yaffs.mk                                 |  2 +-
 linux/linux.mk                                     |  6 ++---
 package/4th/4th.mk                                 | 10 ++++----
 package/Makefile.in                                | 20 ++++++++--------
 package/acl/acl.mk                                 |  6 ++---
 package/am335x-pru-package/am335x-pru-package.mk   |  2 +-
 package/android-tools/android-tools.mk             |  2 +-
 package/attr/attr.mk                               |  4 ++--
 package/autoconf-archive/autoconf-archive.mk       |  2 +-
 package/autoconf/autoconf.mk                       |  8 +++----
 package/automake/automake.mk                       |  6 ++---
 package/axfsutils/axfsutils.mk                     |  2 +-
 package/b43-firmware/b43-firmware.mk               |  2 +-
 package/b43-fwcutter/b43-fwcutter.mk               |  2 +-
 package/boost/boost.mk                             |  8 +++----
 package/bzip2/bzip2.mk                             |  4 ++--
 package/ca-certificates/ca-certificates.mk         |  2 +-
 package/canfestival/canfestival.mk                 |  6 ++---
 package/checkpolicy/checkpolicy.mk                 | 18 +++++++-------
 package/cloop/cloop.mk                             |  6 ++---
 package/cmake/cmake.mk                             |  4 ++--
 package/cppcms/cppcms.mk                           |  2 +-
 package/cramfs/cramfs.mk                           |  4 ++--
 package/cryptopp/cryptopp.mk                       |  2 +-
 package/cups/cups.mk                               |  2 +-
 package/dbus-glib/dbus-glib.mk                     |  2 +-
 package/dbus-python/dbus-python.mk                 |  4 ++--
 package/dbus/dbus.mk                               |  2 +-
 package/directfb/directfb.mk                       |  4 ++--
 package/docker-containerd/docker-containerd.mk     |  2 +-
 package/docker-engine/docker-engine.mk             |  2 +-
 package/dos2unix/dos2unix.mk                       |  2 +-
 package/doxygen/doxygen.mk                         |  2 +-
 package/dtc/dtc.mk                                 |  4 ++--
 package/efl/efl.mk                                 | 18 +++++++-------
 package/ejabberd/ejabberd.mk                       |  2 +-
 package/elftosb/elftosb.mk                         |  6 ++---
 package/enlightenment/enlightenment.mk             |  6 ++---
 package/erlang-rebar/erlang-rebar.mk               |  2 +-
 package/erlang/erlang.mk                           |  2 +-
 package/execline/execline.mk                       |  8 +++----
 package/fakedate/fakedate.mk                       |  4 ++--
 package/faketime/faketime.mk                       |  4 ++--
 package/flannel/flannel.mk                         |  2 +-
 package/freescale-imx/imx-uuc/imx-uuc.mk           |  2 +-
 package/gcc/gcc-final/gcc-final.mk                 | 16 ++++++-------
 package/gcc/gcc.mk                                 | 12 +++++-----
 package/gdb/gdb.mk                                 |  6 ++---
 package/gdk-pixbuf/gdk-pixbuf.mk                   |  6 ++---
 package/genromfs/genromfs.mk                       |  4 +++-
 package/gettext/gettext.mk                         |  6 ++---
 package/go-bootstrap/go-bootstrap.mk               |  2 +-
 package/go/go.mk                                   |  6 ++---
 package/gob2/gob2.mk                               |  2 +-
 package/google-breakpad/google-breakpad.mk         |  2 +-
 package/gptfdisk/gptfdisk.mk                       |  2 +-
 package/gtest/gtest.mk                             |  4 ++--
 package/guile/guile.mk                             |  2 +-
 package/gutenprint/gutenprint.mk                   |  6 ++---
 package/gvfs/gvfs.mk                               |  2 +-
 package/heimdal/heimdal.mk                         |  8 +++----
 package/i2c-tools/i2c-tools.mk                     |  4 ++--
 package/imx-usb-loader/imx-usb-loader.mk           |  3 +--
 package/iw/iw.mk                                   |  2 +-
 package/jsmin/jsmin.mk                             |  2 +-
 package/kodi/kodi.mk                               |  4 ++--
 package/leafnode2/leafnode2.mk                     |  4 ++--
 package/lesstif/lesstif.mk                         |  2 +-
 package/libcap/libcap.mk                           |  4 ++--
 package/libffi/libffi.mk                           |  8 +++----
 package/libglib2/libglib2.mk                       |  6 ++---
 package/libgtk2/libgtk2.mk                         |  6 ++---
 package/libgtk3/libgtk3.mk                         | 18 +++++++-------
 package/libiio/libiio.mk                           |  4 ++--
 package/libselinux/libselinux.mk                   | 27 ++++++++++-----------
 package/libsemanage/libsemanage.mk                 | 27 +++++++++++----------
 package/libsepol/libsepol.mk                       | 13 ++++++----
 package/libsigrok/libsigrok.mk                     |  2 +-
 package/libsvgtiny/libsvgtiny.mk                   |  2 +-
 package/libtool/libtool.mk                         |  4 ++--
 package/libv4l/libv4l.mk                           |  6 ++---
 package/libxml-parser-perl/libxml-parser-perl.mk   | 10 ++++----
 package/libxml2/libxml2.mk                         |  2 +-
 package/libxmlrpc/libxmlrpc.mk                     |  2 +-
 .../linux-syscall-support/linux-syscall-support.mk |  2 +-
 package/localedef/localedef.mk                     |  2 +-
 package/lpc3250loader/lpc3250loader.mk             |  2 +-
 package/lttng-tools/Config.in                      |  2 +-
 package/lua/lua.mk                                 |  4 ++--
 package/luainterpreter/luainterpreter.mk           |  2 +-
 package/luajit/luajit.mk                           |  4 ++--
 package/luarocks/luarocks.mk                       | 12 +++++-----
 package/luvi/luvi.mk                               |  2 +-
 package/lz4/lz4.mk                                 |  2 +-
 package/lzip/lzip.mk                               |  4 ++--
 package/lzma/lzma.mk                               |  2 +-
 package/lzop/lzop.mk                               |  2 +-
 package/makedevs/makedevs.mk                       |  2 +-
 package/mfgtools/mfgtools.mk                       |  6 ++---
 package/mfgtools/readme.txt                        |  2 +-
 package/mke2img/mke2img.mk                         |  2 +-
 package/mkpasswd/mkpasswd.mk                       |  4 ++--
 package/mkpimage/mkpimage.mk                       |  2 +-
 package/moarvm/moarvm.mk                           |  2 +-
 package/mono-gtksharp3/mono-gtksharp3.mk           |  2 +-
 package/mono/mono.mk                               |  4 ++--
 package/monolite/monolite.mk                       |  4 ++--
 package/mplayer/mplayer.mk                         |  2 +-
 package/mtd/mtd.mk                                 |  6 ++---
 package/mxsldr/mxsldr.mk                           |  2 +-
 package/ncftp/ncftp.mk                             |  2 +-
 package/netsurf-buildsystem/netsurf-buildsystem.mk |  2 +-
 package/ninja/ninja.mk                             |  2 +-
 package/nodejs/nodejs.mk                           | 28 +++++++++++-----------
 package/ola/ola.mk                                 |  4 ++--
 package/omap-u-boot-utils/omap-u-boot-utils.mk     |  2 +-
 package/omniorb/omniorb.mk                         |  6 ++---
 package/omxplayer/omxplayer.mk                     |  2 +-
 package/opencv3/opencv3.mk                         |  4 ++--
 package/openocd/openocd.mk                         |  4 ++--
 package/openssl/openssl.mk                         |  2 +-
 package/opkg-utils/opkg-utils.mk                   |  2 +-
 package/oracle-mysql/oracle-mysql.mk               |  2 +-
 package/owfs/owfs.mk                               |  2 +-
 package/perl/perl.mk                               |  2 +-
 package/php-amqp/php-amqp.mk                       |  4 ++--
 package/php-geoip/php-geoip.mk                     |  4 ++--
 package/php-gnupg/php-gnupg.mk                     |  4 ++--
 package/php-imagick/php-imagick.mk                 |  4 ++--
 package/php-memcached/php-memcached.mk             |  4 ++--
 package/php-ssh2/php-ssh2.mk                       |  4 ++--
 package/php-yaml/php-yaml.mk                       |  4 ++--
 package/php-zmq/php-zmq.mk                         |  4 ++--
 package/pinentry/pinentry.mk                       |  2 +-
 package/pkg-autotools.mk                           |  2 +-
 package/pkg-cmake.mk                               | 14 +++++------
 package/pkg-perl.mk                                |  2 +-
 package/pkg-python.mk                              | 10 ++++----
 package/pkg-rebar.mk                               | 18 +++++++-------
 package/pkg-waf.mk                                 | 10 ++++----
 package/pkgconf/pkgconf.mk                         | 10 ++++----
 package/pngquant/pngquant.mk                       |  2 +-
 package/policycoreutils/policycoreutils.mk         | 23 +++++++++---------
 package/protobuf/protobuf.mk                       |  2 +-
 package/pseudo/pseudo.mk                           |  6 ++---
 package/pulseaudio/pulseaudio.mk                   |  2 +-
 package/python-cffi/python-cffi.mk                 |  2 +-
 package/python-gobject/python-gobject.mk           |  4 ++--
 package/python-lxml/python-lxml.mk                 |  4 ++--
 package/python-pypcap/python-pypcap.mk             |  4 ++--
 package/python-pyqt/python-pyqt.mk                 |  4 ++--
 package/python-pyqt5/python-pyqt5.mk               |  4 ++--
 package/python-sip/python-sip.mk                   |  6 ++---
 package/python-web2py/python-web2py.mk             |  2 +-
 package/python/python.mk                           |  6 ++---
 package/python3/python3.mk                         | 16 ++++++-------
 package/qemu/qemu.mk                               | 10 ++++----
 package/qpid-proton/qpid-proton.mk                 |  2 +-
 package/qt/qt.mk                                   | 20 ++++++++--------
 package/qt5/qt5.mk                                 |  2 +-
 package/qt5/qt53d/qt53d.mk                         |  2 +-
 package/qt5/qt5base/qt5base.mk                     |  2 +-
 package/qt5/qt5canvas3d/qt5canvas3d.mk             |  2 +-
 package/qt5/qt5connectivity/qt5connectivity.mk     |  2 +-
 package/qt5/qt5declarative/qt5declarative.mk       |  2 +-
 package/qt5/qt5enginio/qt5enginio.mk               |  2 +-
 .../qt5/qt5graphicaleffects/qt5graphicaleffects.mk |  2 +-
 package/qt5/qt5imageformats/qt5imageformats.mk     |  2 +-
 package/qt5/qt5location/qt5location.mk             |  2 +-
 package/qt5/qt5multimedia/qt5multimedia.mk         |  2 +-
 package/qt5/qt5quickcontrols/qt5quickcontrols.mk   |  2 +-
 package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk |  2 +-
 package/qt5/qt5script/qt5script.mk                 |  2 +-
 package/qt5/qt5sensors/qt5sensors.mk               |  2 +-
 package/qt5/qt5serialbus/qt5serialbus.mk           |  2 +-
 package/qt5/qt5serialport/qt5serialport.mk         |  2 +-
 package/qt5/qt5svg/qt5svg.mk                       |  2 +-
 package/qt5/qt5tools/qt5tools.mk                   |  2 +-
 package/qt5/qt5webchannel/qt5webchannel.mk         |  2 +-
 package/qt5/qt5webkit/qt5webkit.mk                 |  4 ++--
 package/qt5/qt5websockets/qt5websockets.mk         |  2 +-
 package/qt5/qt5x11extras/qt5x11extras.mk           |  2 +-
 package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk       |  2 +-
 package/qt5cinex/qt5cinex.mk                       |  2 +-
 .../0002-Makefile-add-DESTDIR-support.patch        | 22 +++++++++--------
 package/runc/runc.mk                               |  2 +-
 package/s6-rc/s6-rc.mk                             | 10 ++++----
 package/s6/s6.mk                                   |  8 +++----
 package/sam-ba/sam-ba.mk                           |  4 ++--
 package/scons/scons.mk                             |  4 ++--
 package/sdl_image/sdl_image.mk                     |  4 ++--
 package/sepolgen/sepolgen.mk                       |  4 ++--
 package/setools/setools.mk                         | 12 +++++-----
 package/shared-mime-info/shared-mime-info.mk       |  4 ++--
 package/skalibs/skalibs.mk                         |  2 +-
 package/socat/socat.mk                             |  2 +-
 package/softether/softether.mk                     |  2 +-
 package/sqlcipher/sqlcipher.mk                     |  2 +-
 package/squashfs/squashfs.mk                       |  2 +-
 package/sunxi-tools/sunxi-tools.mk                 |  6 ++---
 package/swig/swig.mk                               |  8 +++----
 package/systemd/systemd.mk                         |  2 +-
 package/tcllib/tcllib.mk                           |  2 +-
 package/terminology/terminology.mk                 |  2 +-
 package/thrift/thrift.mk                           |  6 ++---
 package/ti-cgt-pru/ti-cgt-pru.mk                   |  4 ++--
 package/tvheadend/tvheadend.mk                     |  4 ++--
 package/tz/tz.mk                                   |  6 ++---
 package/tzdata/tzdata.mk                           |  6 ++---
 package/tzdump/tzdump.mk                           |  4 ++--
 package/uboot-tools/uboot-tools.mk                 |  8 +++----
 package/uclibc/uclibc.mk                           |  8 +++----
 package/upx/upx.mk                                 |  4 ++--
 package/vala/vala.mk                               |  8 +++----
 package/vboot-utils/vboot-utils.mk                 |  2 +-
 package/vlc/vlc.mk                                 |  6 ++---
 package/waf/waf.mk                                 |  2 +-
 package/wireshark/wireshark.mk                     |  6 ++---
 package/x11r7/libxcb/libxcb.mk                     |  4 ++--
 .../xfont_font-adobe-100dpi.mk                     |  4 ++--
 .../xfont_font-adobe-75dpi.mk                      |  4 ++--
 .../xfont_font-adobe-utopia-100dpi.mk              |  4 ++--
 .../xfont_font-adobe-utopia-75dpi.mk               |  4 ++--
 .../xfont_font-adobe-utopia-type1.mk               |  4 ++--
 package/x11r7/xfont_font-alias/xfont_font-alias.mk |  4 ++--
 .../xfont_font-arabic-misc.mk                      |  4 ++--
 .../xfont_font-bh-100dpi/xfont_font-bh-100dpi.mk   |  4 ++--
 .../xfont_font-bh-75dpi/xfont_font-bh-75dpi.mk     |  4 ++--
 .../xfont_font-bh-lucidatypewriter-100dpi.mk       |  4 ++--
 .../xfont_font-bh-lucidatypewriter-75dpi.mk        |  4 ++--
 .../x11r7/xfont_font-bh-ttf/xfont_font-bh-ttf.mk   |  4 ++--
 .../xfont_font-bh-type1/xfont_font-bh-type1.mk     |  4 ++--
 .../xfont_font-bitstream-100dpi.mk                 |  4 ++--
 .../xfont_font-bitstream-75dpi.mk                  |  4 ++--
 .../xfont_font-bitstream-type1.mk                  |  4 ++--
 .../xfont_font-cronyx-cyrillic.mk                  |  4 ++--
 .../xfont_font-cursor-misc.mk                      |  4 ++--
 .../xfont_font-daewoo-misc.mk                      |  4 ++--
 .../xfont_font-dec-misc/xfont_font-dec-misc.mk     |  4 ++--
 .../xfont_font-ibm-type1/xfont_font-ibm-type1.mk   |  4 ++--
 .../xfont_font-isas-misc/xfont_font-isas-misc.mk   |  4 ++--
 .../xfont_font-jis-misc/xfont_font-jis-misc.mk     |  4 ++--
 .../xfont_font-micro-misc/xfont_font-micro-misc.mk |  4 ++--
 .../xfont_font-misc-cyrillic.mk                    |  4 ++--
 .../xfont_font-misc-ethiopic.mk                    |  4 ++--
 .../xfont_font-misc-meltho.mk                      |  4 ++--
 .../xfont_font-misc-misc/xfont_font-misc-misc.mk   |  4 ++--
 .../xfont_font-mutt-misc/xfont_font-mutt-misc.mk   |  4 ++--
 .../xfont_font-schumacher-misc.mk                  |  4 ++--
 .../xfont_font-screen-cyrillic.mk                  |  4 ++--
 .../xfont_font-sony-misc/xfont_font-sony-misc.mk   |  4 ++--
 .../xfont_font-sun-misc/xfont_font-sun-misc.mk     |  4 ++--
 .../xfont_font-winitzki-cyrillic.mk                |  4 ++--
 .../xfont_font-xfree86-type1.mk                    |  4 ++--
 package/x11r7/xlib_libX11/xlib_libX11.mk           |  2 +-
 package/x264/x264.mk                               |  2 +-
 package/xen/xen.mk                                 |  2 +-
 package/yaffs2utils/yaffs2utils.mk                 |  2 +-
 package/zic/zic.mk                                 |  6 ++---
 package/zip/zip.mk                                 |  2 +-
 package/zlib/zlib.mk                               |  2 +-
 package/zynq-boot-bin/zynq-boot-bin.mk             |  2 +-
 support/dependencies/check-host-cmake.mk           |  2 +-
 support/dependencies/check-host-lzip.mk            |  2 +-
 support/dependencies/check-host-tar.mk             |  2 +-
 support/dependencies/check-host-xzcat.mk           |  2 +-
 support/misc/toolchainfile.cmake.in                |  6 ++---
 support/scripts/check-host-rpath                   |  7 +++---
 support/scripts/eclipse-register-toolchain         |  2 +-
 .../toolchain-external/pkg-toolchain-external.mk   | 14 +++++------
 toolchain/toolchain-wrapper.c                      |  6 ++---
 toolchain/toolchain-wrapper.mk                     |  2 +-
 toolchain/toolchain/toolchain.mk                   |  4 ++--
 314 files changed, 712 insertions(+), 693 deletions(-)
#1 lore raw

PATCH 1/53 pkg-rebar: remove redundant / in front of $($(PKG)_ERLANG_LIBDIR)

Sometimes $(1)/$($(PKG)_ERLANG_LIBDIR) is used, sometimes $(1)$($(PKG)_ERLANG_LIBDIR). Make this consistent, without /, because $($(PKG)_ERLANG_LIBDIR) already starts with a /.

---
 package/pkg-rebar.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/pkg-rebar.mk +2 -2
index 7605a64ade..ab41d3bb34 100644
@@ -56,7 +56,7 @@ REBAR_TARGET_DEPS_ENV = \
 # expands package-related variables.
 #
 define install-erlang-directories
-	$(INSTALL) -d $(1)/$($(PKG)_ERLANG_LIBDIR)
+	$(INSTALL) -d $(1)$($(PKG)_ERLANG_LIBDIR)
 	for dir in bin ebin priv $(2); do                               \
 		if test -d $(@D)/$$dir; then                            \
 			cp -r $(@D)/$$dir $(1)$($(PKG)_ERLANG_LIBDIR);  \
@@ -90,7 +90,7 @@ endef
 #
 define install-rebar-deps
 	$(INSTALL) -d $(REBAR_$(2)_DEPS_DIR)
-	ln -f -s $(1)/$($(PKG)_ERLANG_LIBDIR) \
+	ln -f -s $(1)$($(PKG)_ERLANG_LIBDIR) \
 		$(REBAR_$(2)_DEPS_DIR)/$($(PKG)_ERLANG_APP)
 endef
 
Signature · 1 line
2.11.0
#2 lore raw

PATCH 1/53 pkg-rebar: remove redundant / in front of $($(PKG)_ERLANG_LIBDIR)

Hello,

package/pkg-rebar.mk REBAR_TARGET_DEPS_ENV = \ · line 59

Quoted 3 lines · Arnout Vandecappelle (Essensium/Mind)

define install-erlang-directories

package/pkg-rebar.mk +1 -1
-	$(INSTALL) -d $(1)/$($(PKG)_ERLANG_LIBDIR)
+	$(INSTALL) -d $(1)$($(PKG)_ERLANG_LIBDIR)

This looks a bit weird to me. Wouldn't it make more sense to have ERLANG_LIBDIR not start with a / ?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#3 lore raw

PATCH 1/53 pkg-rebar: remove redundant / in front of $($(PKG)_ERLANG_LIBDIR)

Quoted 11 lines · Thomas Petazzoni

Hello,

package/pkg-rebar.mk REBAR_TARGET_DEPS_ENV = \ · line 59

Quoted 3 lines · Arnout Vandecappelle (Essensium/Mind)

define install-erlang-directories

package/pkg-rebar.mk +1 -1
-	$(INSTALL) -d $(1)/$($(PKG)_ERLANG_LIBDIR)
+	$(INSTALL) -d $(1)$($(PKG)_ERLANG_LIBDIR)

This looks a bit weird to me. Wouldn't it make more sense to have ERLANG_LIBDIR not start with a / ?

Well...

1. it doesn't look weird to me;

2. in one place, it was already like that;

3. if we change it, we should also change all instances of _ERLANG_LIBDIR in all packages, including external trees.

The last point isn't that important though since it still works even if the /
is there. And we don't have any in-tree package that sets _ERLANG_LIBDIR.

Anyway, the patch is independent of the rest of the series (I should have left
it out, probably). So don't let it stop you :-)

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#4 lore raw

PATCH 2/53 libsepol: rework host installation

In reply to Arnout Vandecappelle (Essensium/Mind)

libsepol has a pretty peculiar interpretation of DESTDIR and PREFIX. PREFIX is not consistently used: some installation paths are forced to $(DESTDIR)/usr/... . Also, the shared lib symlink is forced to ../../lib (i.e. assumes it's installed under /usr). For these reasons, the host build and install commands are a bit unusual: they use DESTDIR instead of PREFIX, DESTDIR points to $(HOST_DIR) without /usr, and some additional fixup is needed to correct the installation directory of libsepol.so.1 and the symlink to it.

This can be simplified quite a lot by passing both DESTDIR and PREFIX, and including the /usr part in both. The symlink still has to be fixed, but that's much simpler.

Note that a side effect is that the man pages are now installed under $(HOST_DIR)/usr/usr/man. While not very nice, we don't really care about man pages. In addition, this will resolve itself when we later move $(HOST_DIR)/usr to $(HOST_DIR).

---
It's a bit counter-intuitive to have a patch that adds /usr in a series that is meant to remove it, but this is the simplest way to have a bisectable series...

---
 package/libsepol/libsepol.mk | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
package/libsepol/libsepol.mk +8 -5
index 9bdac1e0da..d360bfbcb1 100644
@@ -33,15 +33,18 @@ define LIBSEPOL_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install $(LIBSEPOL_MAKE_FLAGS) DESTDIR=$(TARGET_DIR)
 endef
 
+HOST_LIBSEPOL_MAKE_ENV = \
+	$(HOST_MAKE_ENV) \
+	DESTDIR=$(HOST_DIR)/usr \
+	PREFIX=$(HOST_DIR)/usr
+
 define HOST_LIBSEPOL_BUILD_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_CONFIGURE_OPTS) DESTDIR=$(HOST_DIR)
+	$(HOST_LIBSEPOL_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_CONFIGURE_OPTS)
 endef
 
 define HOST_LIBSEPOL_INSTALL_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) install $(HOST_CONFIGURE_OPTS) DESTDIR=$(HOST_DIR)
-	mv $(HOST_DIR)/lib/libsepol.so.1 $(HOST_DIR)/usr/lib
-	(cd $(HOST_DIR)/usr/lib; rm -f libsepol.so; ln -s libsepol.so.1 libsepol.so)
-	-rmdir $(HOST_DIR)/lib
+	$(HOST_LIBSEPOL_MAKE_ENV) $(MAKE) -C $(@D) install $(HOST_CONFIGURE_OPTS)
+	ln -sf libsepol.so.1 $(HOST_DIR)/usr/lib/libsepol.so
 endef
 
 $(eval $(generic-package))
Signature · 1 line
2.11.0
#5 lore raw

PATCH 3/53 Move $(HOST_DIR)/usr/$(GNU_TARGET_NAME) one level up.

In reply to Arnout Vandecappelle (Essensium/Mind)

This is a step towards eliminating $(HOST_DIR)/usr. It allows us to convert all packages installing things into $(HOST_DIR)/usr/$(GNU_TARGET_NAME) (i.e., binutils and gcc) without affecting the rest.

To allow compatibility with packages that still use $(HOST_DIR)/usr as the prefix, create a symlink from usr/$(GNU_TARGET_NAME) to ../$(GNU_TARGET_NAME).

Note that the symlink creation will break when $(HOST_DIR)/usr/lib already exists as a directory, i.e. when rebuilding in an existing output directory. This is necessary: if we don't break it now, the following commits (which remove the usr part from various variables) _will_ break it.

Effectively, the usr/ part is removed from $(STAGING_SUBDIR) (and therefore from $(STAGING_DIR)), so update the definition of that variable right away.

---
 Makefile            | 2 ++
 package/Makefile.in | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
Makefile +2 -0
index 941bf789c8..f19e81f5c6 100644
@@ -556,6 +556,8 @@ world: target-post-image
 $(STAGING_DIR):
 	@mkdir -p $(STAGING_DIR)
 	@ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
+	@mkdir -p $(HOST_DIR)/usr
+	@ln -snf ../$(GNU_TARGET_NAME) $(HOST_DIR)/usr/$(GNU_TARGET_NAME)
 
 RSYNC_VCS_EXCLUSIONS = \
 	--exclude .svn --exclude .git --exclude .hg --exclude .bzr \
package/Makefile.in +1 -1
index 4a3eb26963..8a6934a429 100644
@@ -107,7 +107,7 @@ ifeq ($(BR2_arc)$(BR2_ARC_ATOMIC_EXT),yy)
 TARGET_ABI += -matomic
 endif
 
-STAGING_SUBDIR = usr/$(GNU_TARGET_NAME)/sysroot
+STAGING_SUBDIR = $(GNU_TARGET_NAME)/sysroot
 STAGING_DIR    = $(HOST_DIR)/$(STAGING_SUBDIR)
 
 ifeq ($(BR2_OPTIMIZE_0),y)
Signature · 1 line
2.11.0
#6 lore raw

PATCH 4/53 Move $(HOST_DIR)/usr/lib to $(HOST_DIR)/lib

In reply to Arnout Vandecappelle (Essensium/Mind)

This is a step towards eliminating $(HOST_DIR)/usr. It allows us to convert all packages installing things into $(HOST_DIR)/usr/lib without affecting the rest.

To allow compatibility with packages that still use $(HOST_DIR)/usr as the prefix, create a symlink from usr/lib to ../lib.

Note that the symlink creation will break when $(HOST_DIR)/usr/lib already exists as a directory, i.e. when rebuilding in an existing output directory. This is necessary: if we don't break it now, the following commits (which remove the usr part from various variables) _will_ break it.

At the same time as creating this symlink, we also have to update the check-host-rpath to accept both $(HOST_DIR)/usr/lib and $(HOST_DIR)/lib, because depending on how the package derives the path, it may be different.

Since there are some dependency chains that involve $(STAGING_DIR), $(STAGING_DIR) may in fact be created before $(HOST_DIR). Since $(STAGING_DIR) is a subdirectory of $(HOST_DIR), it is possible that the newly added rule for $(HOST_DIR) never triggers. To make sure that the rule does trigger, add an order-only dependency from $(STAGING_DIR) to $(HOST_DIR).

---
 Makefile                         | 10 +++++++---
 support/scripts/check-host-rpath |  7 ++++---
 2 files changed, 11 insertions(+), 6 deletions(-)
Makefile +7 -3
index f19e81f5c6..1cfc5695e3 100644
@@ -236,7 +236,7 @@ LEGAL_REPORT = $(LEGAL_INFO_DIR)/README
 # dependencies anywhere else
 #
 ################################################################################
-$(BUILD_DIR) $(TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
+$(BUILD_DIR) $(TARGET_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
 	@mkdir -p $@
 
 BR2_CONFIG = $(CONFIG_DIR)/.config
@@ -552,11 +552,15 @@ world: target-post-image
 	legal-info legal-info-prepare legal-info-clean printvars help \
 	list-defconfigs target-finalize target-post-image source-check
 
+# When creating HOST_DIR, also symlink usr/lib -> ../lib
+$(HOST_DIR):
+	@mkdir -p $@/usr $@/lib
+	@ln -snf ../lib $@/usr/lib
+
 # Populating the staging with the base directories is handled by the skeleton package
-$(STAGING_DIR):
+$(STAGING_DIR): | $(HOST_DIR)
 	@mkdir -p $(STAGING_DIR)
 	@ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
-	@mkdir -p $(HOST_DIR)/usr
 	@ln -snf ../$(GNU_TARGET_NAME) $(HOST_DIR)/usr/$(GNU_TARGET_NAME)
 
 RSYNC_VCS_EXCLUSIONS = \
support/scripts/check-host-rpath +4 -3
index 6ce547cb04..29bec012fc 100755
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 
-# This script scans $(HOST_DIR)/{bin,sbin} for all ELF files, and checks
-# they have an RPATH to $(HOST_DIR)/usr/lib if they need libraries from
+# This script scans $(HOST_DIR)/{,usr/}{bin,sbin} for all ELF files, and checks
+# they have an RPATH to $(HOST_DIR)/{,usr/}lib if they need libraries from
 # there.
 
 # Override the user's locale so we are sure we can parse the output of
@@ -40,7 +40,7 @@ elf_needs_rpath() {
     local lib
 
     while read lib; do
-        [ -e "${hostdir}/usr/lib/${lib}" ] && return 0
+        [ -e "${hostdir}/lib/${lib}" ] && return 0
     done < <( readelf -d "${file}"                                         \
               |sed -r -e '/^.* \(NEEDED\) .*Shared library: \[(.+)\]$/!d;' \
                      -e 's//\1/;'                                          \
@@ -58,6 +58,7 @@ check_elf_has_rpath() {
         for dir in ${rpath//:/ }; do
             # Remove duplicate and trailing '/' for proper match
             dir="$( sed -r -e 's:/+:/:g; s:/$::;' <<<"${dir}" )"
+            [ "${dir}" = "${hostdir}/lib" ] && return 0
             [ "${dir}" = "${hostdir}/usr/lib" ] && return 0
         done
     done < <( readelf -d "${file}"                                              \
Signature · 1 line
2.11.0
#7 lore raw

PATCH 5/53 Eliminate $(HOST_DIR)/usr

In reply to Arnout Vandecappelle (Essensium/Mind)

We currently use $(HOST_DIR)/usr as the prefix for host packages. That has a few disadvantages:

- There are some things installed in $(HOST_DIR)/etc and $(HOST_DIR)/sbin, which is inconsistent.

- To pack a buildroot-built toolchain into a tarball for use as an external toolchain, you have to pack output/host/usr instead of the more obvious output/host.

- Because of the above, the internal toolchain wrapper breaks which forces us to work around it (call the actual toolchain executable directly). This is OK for us, but when used in another build system, that's a problem.

- Paths are four characters longer.

To allow us to gradually eliminate $(HOST_DIR)/usr while building packages, replace it with a symlink to .

The symlinks from $(HOST_DIR)/usr/$(GNU_TARGET_NAME) and $(HOST_DIR)/usr/lib that were added previously are removed again.

Note that the symlink creation will break when $(HOST_DIR)/usr already exists as a directory, i.e. when rebuilding in an existing output directory. This is necessary: if we don't break it now, the following commits (which remove the usr part from various variables) _will_ break it.

At the same time as creating this symlink, we have to update the external toolchain wrapper and the external toolchain symlinks to go one directory less up. Indeed, $(HOST_DIR) is one level less up than it was before.

---
I intended to also move $(HOST_DIR)/usr/bin in a separate patch, but that turns out to break the internal toolchain: host-gcc-initial uses relative paths to find cc1 etc. and these will be broken.

---
 Makefile                                               | 7 +++----
 toolchain/toolchain-external/pkg-toolchain-external.mk | 6 +++---
 toolchain/toolchain-wrapper.c                          | 2 +-
 3 files changed, 7 insertions(+), 8 deletions(-)
Makefile +3 -4
index 1cfc5695e3..d78985464b 100644
@@ -552,16 +552,15 @@ world: target-post-image
 	legal-info legal-info-prepare legal-info-clean printvars help \
 	list-defconfigs target-finalize target-post-image source-check
 
-# When creating HOST_DIR, also symlink usr/lib -> ../lib
+# When creating HOST_DIR, also symlink usr -> .
 $(HOST_DIR):
-	@mkdir -p $@/usr $@/lib
-	@ln -snf ../lib $@/usr/lib
+	@mkdir -p $@
+	@ln -snf . $@/usr
 
 # Populating the staging with the base directories is handled by the skeleton package
 $(STAGING_DIR): | $(HOST_DIR)
 	@mkdir -p $(STAGING_DIR)
 	@ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
-	@ln -snf ../$(GNU_TARGET_NAME) $(HOST_DIR)/usr/$(GNU_TARGET_NAME)
 
 RSYNC_VCS_EXCLUSIONS = \
 	--exclude .svn --exclude .git --exclude .hg --exclude .bzr \
toolchain/toolchain-external/pkg-toolchain-external.mk +3 -3
index 9670350dc0..9dc6e31df3 100644
@@ -251,18 +251,18 @@ define TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER
 		base=$${i##*/}; \
 		case "$$base" in \
 		*-ar|*-ranlib|*-nm) \
-			ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
+			ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \
 			;; \
 		*cc|*cc-*|*++|*++-*|*cpp|*-gfortran) \
 			ln -sf toolchain-wrapper $$base; \
 			;; \
 		*gdb|*gdbtui) \
 			if test "$(BR2_PACKAGE_HOST_GDB)" != "y"; then \
-				ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
+				ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \
 			fi \
 			;; \
 		*) \
-			ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \
+			ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \
 			;; \
 		esac; \
 	done
toolchain/toolchain-wrapper.c +1 -1
index 100aa181c6..3a4455ff82 100644
@@ -178,7 +178,7 @@ int main(int argc, char **argv)
 			perror(__FILE__ ": malloc");
 			return 2;
 		}
-		sprintf(relbasedir, "%s/../..", argv[0]);
+		sprintf(relbasedir, "%s/..", argv[0]);
 		absbasedir = realpath(relbasedir, NULL);
 	} else {
 		basename = progpath;
Signature · 1 line
2.11.0
#8 lore raw

PATCH 6/53 check-host-rpath: no longer check $(HOST_DIR)/usr/{bin, sbin}

In reply to Arnout Vandecappelle (Essensium/Mind)

Since $(HOST_DIR)/usr/{bin,sbin} are now symlinks to $(HOST_DIR)/{bin,sbin}, it makes no sense to check them - they are already covered.

---
 support/scripts/check-host-rpath | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
support/scripts/check-host-rpath +2 -2
index 29bec012fc..e2b7c8cf8c 100755
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 
-# This script scans $(HOST_DIR)/{,usr/}{bin,sbin} for all ELF files, and checks
+# This script scans $(HOST_DIR)/{bin,sbin} for all ELF files, and checks
 # they have an RPATH to $(HOST_DIR)/{,usr/}lib if they need libraries from
 # there.
 
@@ -26,7 +26,7 @@ main() {
             printf "*** ERROR: package %s installs executables without proper RPATH:\n" "${pkg}"
         fi
         printf "***   %s\n" "${file}"
-    done < <( find "${hostdir}"/{,usr/}{bin,sbin} -type f -exec file {} + 2>/dev/null \
+    done < <( find "${hostdir}"/{bin,sbin} -type f -exec file {} + 2>/dev/null \
               |sed -r -e '/^([^:]+):.*\<ELF\>.*\<executable\>.*/!d'                \
                       -e 's//\1/'                                                  \
             )
Signature · 1 line
2.11.0
#9 lore raw

PATCH 7/53 Makefile: remove $(HOST_DIR)/usr from BR_PATH

In reply to Arnout Vandecappelle (Essensium/Mind)

Now $(HOST_DIR)/usr is a symlink to $(HOST_DIR), it makes no sense to still have it in BR_PATH.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index d78985464b..565385ec48 100644
@@ -439,7 +439,7 @@ TAR_OPTIONS = $(call qstrip,$(BR2_TAR_OPTIONS)) -xf
 HOST_DIR := $(call qstrip,$(BR2_HOST_DIR))
 
 # Quotes are needed for spaces and all in the original PATH content.
-BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin:$(PATH)"
+BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(PATH)"
 
 # Location of a file giving a big fat warning that output/target
 # should not be used as the root filesystem.
Signature · 1 line
2.11.0
#10 lore raw

PATCH 8/53 package/Makefile.in: remove $(HOST_DIR)/usr part from HOST_LDFLAGS

In reply to Arnout Vandecappelle (Essensium/Mind)

Now $(HOST_DIR)/lib and $(HOST_DIR)/usr/lib are the same directory, it doesn't make sense to pass both to LDFLAGS.

Also use $(HOST_DIR)/lib instead of $(HOST_DIR)/usr/lib for the RPATH.

---
 package/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/Makefile.in +1 -1
index 8a6934a429..579e40b1ba 100644
@@ -221,7 +221,7 @@ HOST_CPPFLAGS  = -I$(HOST_DIR)/usr/include
 HOST_CFLAGS   ?= -O2
 HOST_CFLAGS   += $(HOST_CPPFLAGS)
 HOST_CXXFLAGS += $(HOST_CFLAGS)
-HOST_LDFLAGS  += -L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib -Wl,-rpath,$(HOST_DIR)/usr/lib
+HOST_LDFLAGS  += -L$(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib
 
 # host-intltool should be executed with the system perl, so we save
 # the path to the system perl, before a host-perl built by Buildroot
Signature · 1 line
2.11.0
#11 lore raw

PATCH 9/53 gdb: Remove /usr part from installation path of gdbserver

In reply to Arnout Vandecappelle (Essensium/Mind)
---
 package/gdb/gdb.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/gdb/gdb.mk +1 -1
index 7036b4cb0f..9a97cb77a7 100644
@@ -181,7 +181,7 @@ GDB_POST_INSTALL_TARGET_HOOKS += GDB_REMOVE_UNNEEDED_FILES
 # does.
 define GDB_SDK_INSTALL_GDBSERVER
 	$(INSTALL) -D -m 0755 $(TARGET_DIR)/usr/bin/gdbserver \
-		$(HOST_DIR)/usr/$(GNU_TARGET_NAME)/debug-root/usr/bin/gdbserver
+		$(HOST_DIR)/$(GNU_TARGET_NAME)/debug-root/usr/bin/gdbserver
 endef
 
 ifeq ($(BR2_PACKAGE_GDB_SERVER),y)
Signature · 1 line
2.11.0
#12 lore raw

PATCH 10/53 gcc-final: things are no longer installed in $(HOST_DIR)/usr

In reply to Arnout Vandecappelle (Essensium/Mind)

Since things are no longer installed in $(HOST_DIR)/usr, the callers should also not refer to it.

---
 package/gcc/gcc-final/gcc-final.mk | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
package/gcc/gcc-final/gcc-final.mk +7 -7
index e8d2e18fe5..12f08c81a8 100644
@@ -59,18 +59,18 @@ GCC_FINAL_CROSS_LANGUAGES = $(subst $(space),$(comma),$(GCC_FINAL_CROSS_LANGUAGE
 HOST_GCC_FINAL_CONF_OPTS = \
 	$(HOST_GCC_COMMON_CONF_OPTS) \
 	--enable-languages=$(GCC_FINAL_CROSS_LANGUAGES) \
-	--with-build-time-tools=$(HOST_DIR)/usr/$(GNU_TARGET_NAME)/bin
+	--with-build-time-tools=$(HOST_DIR)/$(GNU_TARGET_NAME)/bin
 
-HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*
+HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib*
 # The kernel wants to use the -m4-nofpu option to make sure that it
 # doesn't use floating point operations.
 ifeq ($(BR2_sh4)$(BR2_sh4eb),y)
 HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4,m4-nofpu"
-HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib/!m4*
+HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib/!m4*
 endif
 ifeq ($(BR2_sh4a)$(BR2_sh4aeb),y)
 HOST_GCC_FINAL_CONF_OPTS += "--with-multilib-list=m4a,m4a-nofpu"
-HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib/!m4*
+HOST_GCC_FINAL_GCC_LIB_DIR = $(HOST_DIR)/$(GNU_TARGET_NAME)/lib/!m4*
 endif
 
 ifeq ($(BR2_bfin),y)
@@ -103,9 +103,9 @@ HOST_GCC_FINAL_MAKE_OPTS += $(HOST_GCC_COMMON_MAKE_OPTS)
 
 # Make sure we have 'cc'
 define HOST_GCC_FINAL_CREATE_CC_SYMLINKS
-	if [ ! -e $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc ]; then \
-		ln -f $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-gcc \
-			$(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-cc; \
+	if [ ! -e $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-cc ]; then \
+		ln -f $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-gcc \
+			$(HOST_DIR)/bin/$(GNU_TARGET_NAME)-cc; \
 	fi
 endef
 
Signature · 1 line
2.11.0
#13 lore raw

PATCH 11/53 pkg-autotools: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix

In reply to Arnout Vandecappelle (Essensium/Mind)

Remove the redundant usr/ component of the HOST_DIR paths. Since a previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR), everything keeps on working.

Build-tested with a bunch of autotools packages.

---
 package/pkg-autotools.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-autotools.mk +1 -1
index e215382d06..03e25b3694 100644
@@ -220,7 +220,7 @@ define $(2)_CONFIGURE_CMDS
 	$$($$(PKG)_CONF_ENV) \
 	CONFIG_SITE=/dev/null \
 	./configure \
-		--prefix="$$(HOST_DIR)/usr" \
+		--prefix="$$(HOST_DIR)" \
 		--sysconfdir="$$(HOST_DIR)/etc" \
 		--localstatedir="$$(HOST_DIR)/var" \
 		--enable-shared --disable-static \
Signature · 1 line
2.11.0
#14 lore raw

PATCH 12/53 pkg-cmake: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix

In reply to Arnout Vandecappelle (Essensium/Mind)

Remove the redundant usr/ component of the HOST_DIR paths. Since a previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR), everything keeps on working.

Build-tested with a bunch of cmake packages.

---
 package/pkg-cmake.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-cmake.mk +1 -1
index 0897430f70..0606d26ad7 100644
@@ -115,7 +115,7 @@ define $(2)_CONFIGURE_CMDS
 		-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="BOTH" \
 		-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY="BOTH" \
 		-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE="BOTH" \
-		-DCMAKE_INSTALL_PREFIX="$$(HOST_DIR)/usr" \
+		-DCMAKE_INSTALL_PREFIX="$$(HOST_DIR)" \
 		-DCMAKE_C_FLAGS="$$(HOST_CFLAGS)" \
 		-DCMAKE_CXX_FLAGS="$$(HOST_CXXFLAGS)" \
 		-DCMAKE_EXE_LINKER_FLAGS="$$(HOST_LDFLAGS)" \
Signature · 1 line
2.11.0
#15 lore raw

PATCH 13/53 pkg-cmake: move configuration files out of $(HOST_DIR)/usr

In reply to Arnout Vandecappelle (Essensium/Mind)

Move toolchainfile.cmake and Buildroot.cmake from $(HOST_DIR)/usr/share/buildroot to $(HOST_DIR)/share/buildroot.

Build-tested with a bunch of cmake packages.

---
 package/pkg-cmake.mk                | 8 ++++----
 support/misc/toolchainfile.cmake.in | 4 ++--
 toolchain/toolchain/toolchain.mk    | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)
package/pkg-cmake.mk +4 -4
index 0606d26ad7..1bb3652a13 100644
@@ -86,7 +86,7 @@ define $(2)_CONFIGURE_CMDS
 	rm -f CMakeCache.txt && \
 	PATH=$$(BR_PATH) \
 	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
-		-DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
+		-DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/share/buildroot/toolchainfile.cmake" \
 		-DCMAKE_INSTALL_PREFIX="/usr" \
 		-DCMAKE_COLOR_MAKEFILE=OFF \
 		-DBUILD_DOC=OFF \
@@ -234,10 +234,10 @@ CMAKE_SYSTEM_PROCESSOR = $(BR2_ARCH)
 endif
 
 # In order to allow the toolchain to be relocated, we calculate the HOST_DIR
-# based on the toolchainfile.cmake file's location: $(HOST_DIR)/usr/share/buildroot
+# based on the toolchainfile.cmake file's location: $(HOST_DIR)/share/buildroot
 # In all the other variables, HOST_DIR will be replaced by RELOCATED_HOST_DIR,
 # so we have to strip "$(HOST_DIR)/" from the paths that contain it.
-$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
+$(HOST_DIR)/share/buildroot/toolchainfile.cmake:
 	@mkdir -p $(@D)
 	sed \
 		-e 's#@@STAGING_SUBDIR@@#$(call qstrip,$(STAGING_SUBDIR))#' \
@@ -254,5 +254,5 @@ $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
 		$(TOPDIR)/support/misc/toolchainfile.cmake.in \
 		> $@
 
-$(HOST_DIR)/usr/share/buildroot/Platform/Buildroot.cmake:
+$(HOST_DIR)/share/buildroot/Platform/Buildroot.cmake:
 	$(Q)$(INSTALL) -D -m 0644 support/misc/Buildroot.cmake $(@)
support/misc/toolchainfile.cmake.in +2 -2
index c38800e598..c8c710bddd 100644
@@ -4,11 +4,11 @@
 #
 
 # In order to allow the toolchain to be relocated, we calculate the
-# HOST_DIR based on this file's location: $(HOST_DIR)/usr/share/buildroot
+# HOST_DIR based on this file's location: $(HOST_DIR)/share/buildroot
 # and store it in RELOCATED_HOST_DIR.
 # All the other variables that need to refer to HOST_DIR will use the
 # RELOCATED_HOST_DIR variable.
-string(REPLACE "/usr/share/buildroot" "" RELOCATED_HOST_DIR ${CMAKE_CURRENT_LIST_DIR})
+string(REPLACE "/share/buildroot" "" RELOCATED_HOST_DIR ${CMAKE_CURRENT_LIST_DIR})
 
 # Point cmake to the location where we have our custom modules,
 # so that it can find our custom platform description.
toolchain/toolchain/toolchain.mk +2 -2
index e29837357a..400cfe116b 100644
@@ -37,5 +37,5 @@ endif
 
 $(eval $(virtual-package))
 
-toolchain: $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake
-toolchain: $(HOST_DIR)/usr/share/buildroot/Platform/Buildroot.cmake
+toolchain: $(HOST_DIR)/share/buildroot/toolchainfile.cmake
+toolchain: $(HOST_DIR)/share/buildroot/Platform/Buildroot.cmake
Signature · 1 line
2.11.0
#16 lore raw

PATCH 14/53 pkg-cmake: programs are now installed in $(HOST_DIR)/bin

In reply to Arnout Vandecappelle (Essensium/Mind)

Remove the redundant usr/ component of the HOST_DIR paths. Since a previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR), everything keeps on working.

---
 support/misc/toolchainfile.cmake.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
support/misc/toolchainfile.cmake.in +1 -1
index c8c710bddd..1f5d2371ed 100644
@@ -48,7 +48,7 @@ set(CMAKE_EXE_LINKER_FLAGS "@@TARGET_LDFLAGS@@" CACHE STRING "Buildroot LDFLAGS
 
 set(CMAKE_INSTALL_SO_NO_EXE 0)
 
-set(CMAKE_PROGRAM_PATH "${RELOCATED_HOST_DIR}/usr/bin")
+set(CMAKE_PROGRAM_PATH "${RELOCATED_HOST_DIR}/bin")
 set(CMAKE_SYSROOT "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
 set(CMAKE_FIND_ROOT_PATH "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
Signature · 1 line
2.11.0
#17 lore raw

PATCH 15/53 pkg-python: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix

In reply to Arnout Vandecappelle (Essensium/Mind)

Remove the redundant usr/ component of the HOST_DIR paths. Since a previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR), everything keeps on working.

Build-tested with a bunch of python packages.

---
 package/pkg-python.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/pkg-python.mk +2 -2
index 2418f5dfa4..6e411ab5c5 100644
@@ -53,7 +53,7 @@ HOST_PKG_PYTHON_DISTUTILS_ENV = \
 	PYTHONNOUSERSITE=1
 
 HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS = \
-	--prefix=$(HOST_DIR)/usr
+	--prefix=$(HOST_DIR)
 
 # Target setuptools-based packages
 PKG_PYTHON_SETUPTOOLS_ENV = \
@@ -83,7 +83,7 @@ HOST_PKG_PYTHON_SETUPTOOLS_ENV = \
 	PYTHONNOUSERSITE=1
 
 HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \
-	--prefix=$(HOST_DIR)/usr
+	--prefix=$(HOST_DIR)
 
 ################################################################################
 # inner-python-package -- defines how the configuration, compilation
Signature · 1 line
2.11.0
#18 lore raw

PATCH 16/53 pkg-rebar: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix

In reply to Arnout Vandecappelle (Essensium/Mind)

Remove the redundant usr/ component of the HOST_DIR paths. Since a previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR), everything keeps on working.

$(PKG)_ERLANG_LIBDIR is problematic because it is used both for host and staging/target. Therefore, the usr/ part is removed from it, and added the the callers instead.

---
 package/pkg-rebar.mk | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
package/pkg-rebar.mk +7 -7
index ab41d3bb34..e196ba5b26 100644
@@ -25,14 +25,14 @@
 # infrastructure tells rebar to NOT download dependencies during
 # the build stage.
 #
-REBAR_HOST_DEPS_DIR = $(HOST_DIR)/usr/share/rebar/deps
+REBAR_HOST_DEPS_DIR = $(HOST_DIR)/share/rebar/deps
 REBAR_TARGET_DEPS_DIR = $(STAGING_DIR)/usr/share/rebar/deps
 
 # Tell rebar where to find the dependencies
 #
 REBAR_HOST_DEPS_ENV = \
 	ERL_COMPILER_OPTIONS='{i, "$(REBAR_HOST_DEPS_DIR)"}' \
-	ERL_EI_LIBDIR=$(HOST_DIR)/usr/lib/erlang/lib/erl_interface-$(ERLANG_EI_VSN)/lib
+	ERL_EI_LIBDIR=$(HOST_DIR)/lib/erlang/lib/erl_interface-$(ERLANG_EI_VSN)/lib
 REBAR_TARGET_DEPS_ENV = \
 	ERL_COMPILER_OPTIONS='{i, "$(REBAR_TARGET_DEPS_DIR)"}' \
 	ERL_EI_LIBDIR=$(STAGING_DIR)/usr/lib/erlang/lib/erl_interface-$(ERLANG_EI_VSN)/lib
@@ -119,10 +119,10 @@ define inner-rebar-package
 $(2)_ERLANG_APP = $(subst -,_,$(patsubst erlang-%,%,$(patsubst host-%,%,$(1))))
 
 # Path where to store the package's libs, relative to either $(HOST_DIR)
-# for host packages, or $(STAGING_DIR) for target packages.
+# for host packages, or $(STAGING_DIR)/usr for target packages.
 #
 $(2)_ERLANG_LIBDIR = \
-	/usr/lib/erlang/lib/$$($$(PKG)_ERLANG_APP)-$$($$(PKG)_VERSION)
+	/lib/erlang/lib/$$($$(PKG)_ERLANG_APP)-$$($$(PKG)_VERSION)
 
 # If a host package, inherit <pkg>_USE_BUNDLED_REBAR from the target
 # package, if not explicitly defined. Otherwise, default to NO.
@@ -173,8 +173,8 @@ endif
 # package-related variables
 ifndef $(2)_INSTALL_STAGING_CMDS
 define $(2)_INSTALL_STAGING_CMDS
-	$$(call install-erlang-directories,$$(STAGING_DIR),include)
-	$$(call install-rebar-deps,$$(STAGING_DIR),TARGET)
+	$$(call install-erlang-directories,$$(STAGING_DIR)/usr,include)
+	$$(call install-rebar-deps,$$(STAGING_DIR)/usr,TARGET)
 endef
 endif
 
@@ -182,7 +182,7 @@ endif
 # package-related variables
 ifndef $(2)_INSTALL_TARGET_CMDS
 define $(2)_INSTALL_TARGET_CMDS
-	$$(call install-erlang-directories,$$(TARGET_DIR))
+	$$(call install-erlang-directories,$$(TARGET_DIR)/usr)
 endef
 endif
 
Signature · 1 line
2.11.0
#19 lore raw

PATCH 17/53 generic packages: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix

In reply to Arnout Vandecappelle (Essensium/Mind)

Remove the redundant usr/ component of the HOST_DIR paths. Since a previous commit added a symlink from $(HOST_DIR)/usr to $(HOST_DIR), everything keeps on working.

This is a mechanical change with
git grep -l '\$(HOST_DIR)/usr' | xargs sed -i 's%\(prefix\|PREFIX\)=\("\?\)\$(HOST_DIR)/usr%\1=\2$(HOST_DIR)%g'

---
 package/acl/acl.mk                               | 4 ++--
 package/attr/attr.mk                             | 4 ++--
 package/boost/boost.mk                           | 4 ++--
 package/bzip2/bzip2.mk                           | 4 ++--
 package/cmake/cmake.mk                           | 2 +-
 package/cryptopp/cryptopp.mk                     | 2 +-
 package/doxygen/doxygen.mk                       | 2 +-
 package/dtc/dtc.mk                               | 4 ++--
 package/execline/execline.mk                     | 2 +-
 package/faketime/faketime.mk                     | 4 ++--
 package/gcc/gcc-final/gcc-final.mk               | 2 +-
 package/libsepol/libsepol.mk                     | 2 +-
 package/libxml-parser-perl/libxml-parser-perl.mk | 2 +-
 package/luajit/luajit.mk                         | 4 ++--
 package/luarocks/luarocks.mk                     | 4 ++--
 package/lz4/lz4.mk                               | 2 +-
 package/nodejs/nodejs.mk                         | 2 +-
 package/openssl/openssl.mk                       | 2 +-
 package/perl/perl.mk                             | 2 +-
 package/pngquant/pngquant.mk                     | 2 +-
 package/qemu/qemu.mk                             | 2 +-
 package/s6-rc/s6-rc.mk                           | 2 +-
 package/s6/s6.mk                                 | 2 +-
 package/sdl_image/sdl_image.mk                   | 4 ++--
 package/skalibs/skalibs.mk                       | 2 +-
 package/sunxi-tools/sunxi-tools.mk               | 4 ++--
 package/zip/zip.mk                               | 2 +-
 package/zlib/zlib.mk                             | 2 +-
 28 files changed, 38 insertions(+), 38 deletions(-)
package/acl/acl.mk +2 -2
index edcf4fd8ed..9e57d09131 100644
@@ -47,8 +47,8 @@ HOST_ACL_DEPENDENCIES = host-attr
 HOST_ACL_CONF_OPTS = --enable-gettext=no
 HOST_ACL_MAKE_ENV = CFLAGS="$(HOST_CFLAGS)"
 HOST_ACL_INSTALL_OPTS = \
-	prefix=$(HOST_DIR)/usr \
-	exec_prefix=$(HOST_DIR)/usr \
+	prefix=$(HOST_DIR) \
+	exec_prefix=$(HOST_DIR) \
 	PKG_DEVLIB_DIR=$(HOST_DIR)/usr/lib \
 	install-dev install-lib
 # For the host, libacl.la is correct, no fixup needed.
package/attr/attr.mk +2 -2
index 0c85701e07..8d250608b7 100644
@@ -28,8 +28,8 @@ ATTR_INSTALL_TARGET_OPTS = \
 	install install-lib
 
 HOST_ATTR_INSTALL_OPTS = \
-	prefix=$(HOST_DIR)/usr \
-	exec_prefix=$(HOST_DIR)/usr \
+	prefix=$(HOST_DIR) \
+	exec_prefix=$(HOST_DIR) \
 	install-dev install-lib
 
 # The libdir variable in libattr.la is empty, so let's fix it. This is
package/boost/boost.mk +2 -2
index 874c03fcb6..3600cdea84 100644
@@ -167,14 +167,14 @@ define HOST_BOOST_BUILD_CMDS
 	--user-config=$(@D)/user-config.jam \
 	$(HOST_BOOST_OPTS) \
 	--ignore-site-config \
-	--prefix=$(HOST_DIR)/usr )
+	--prefix=$(HOST_DIR) )
 endef
 
 define HOST_BOOST_INSTALL_CMDS
 	(cd $(@D) && ./b2 -j$(PARALLEL_JOBS) -q \
 	--user-config=$(@D)/user-config.jam \
 	$(HOST_BOOST_OPTS) \
-	--prefix=$(HOST_DIR)/usr \
+	--prefix=$(HOST_DIR) \
 	--ignore-site-config \
 	--layout=$(BOOST_LAYOUT) install )
 endef
package/bzip2/bzip2.mk +2 -2
index 0597ab97d6..62571ed5a3 100644
@@ -60,9 +60,9 @@ endef
 
 define HOST_BZIP2_INSTALL_CMDS
 	$(HOST_MAKE_ENV) \
-		$(MAKE) PREFIX=$(HOST_DIR)/usr -C $(@D) install
+		$(MAKE) PREFIX=$(HOST_DIR) -C $(@D) install
 	$(HOST_MAKE_ENV) \
-		$(MAKE) -f Makefile-libbz2_so PREFIX=$(HOST_DIR)/usr -C $(@D) install
+		$(MAKE) -f Makefile-libbz2_so PREFIX=$(HOST_DIR) -C $(@D) install
 endef
 
 $(eval $(generic-package))
package/cmake/cmake.mk +1 -1
index d9eea32857..47b4a325db 100644
@@ -41,7 +41,7 @@ define HOST_CMAKE_CONFIGURE_CMDS
 	(cd $(@D); \
 		$(HOST_CONFIGURE_OPTS) \
 		CFLAGS="$(HOST_CMAKE_CFLAGS)" \
-		./bootstrap --prefix=$(HOST_DIR)/usr \
+		./bootstrap --prefix=$(HOST_DIR) \
 			--parallel=$(PARALLEL_JOBS) -- \
 			-DCMAKE_C_FLAGS="$(HOST_CMAKE_CFLAGS)" \
 			-DCMAKE_CXX_FLAGS="$(HOST_CMAKE_CXXFLAGS)" \
package/cryptopp/cryptopp.mk +1 -1
index 5c5def5bc5..4b121aef2d 100644
@@ -24,7 +24,7 @@ define HOST_CRYPTOPP_BUILD_CMDS
 endef
 
 define HOST_CRYPTOPP_INSTALL_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR)/usr install
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR) install
 endef
 
 $(eval $(host-generic-package))
package/doxygen/doxygen.mk +1 -1
index 428747b117..89a4748400 100644
@@ -12,7 +12,7 @@ DOXYGEN_LICENSE_FILES = LICENSE
 HOST_DOXYGEN_DEPENDENCIES = host-flex host-bison
 
 define HOST_DOXYGEN_CONFIGURE_CMDS
-	(cd $(@D); $(HOST_MAKE_ENV) ./configure --shared --prefix=$(HOST_DIR)/usr)
+	(cd $(@D); $(HOST_MAKE_ENV) ./configure --shared --prefix=$(HOST_DIR))
 endef
 
 define HOST_DOXYGEN_BUILD_CMDS
package/dtc/dtc.mk +2 -2
index 5bb2ca26a3..262f8bf56a 100644
@@ -47,11 +47,11 @@ endef
 
 # host build
 define HOST_DTC_BUILD_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR)/usr
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR)
 endef
 
 define HOST_DTC_INSTALL_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR)/usr install-bin
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR) install-bin
 endef
 
 $(eval $(generic-package))
package/execline/execline.mk +1 -1
index ca7c73e775..6cd9dc1736 100644
@@ -45,7 +45,7 @@ endef
 HOST_EXECLINE_DEPENDENCIES = host-skalibs
 
 HOST_EXECLINE_CONF_OPTS = \
-	--prefix=$(HOST_DIR)/usr \
+	--prefix=$(HOST_DIR) \
 	--shebangdir=/usr/bin \
 	--with-sysdeps=$(HOST_DIR)/usr/lib/skalibs/sysdeps \
 	--with-include=$(HOST_DIR)/usr/include \
package/faketime/faketime.mk +2 -2
index 03879ea65c..6c88a71aa3 100644
@@ -10,11 +10,11 @@ FAKETIME_LICENSE = GPL-2.0
 FAKETIME_LICENSE_FILES = COPYING
 
 define HOST_FAKETIME_BUILD_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR)/usr
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR)
 endef
 
 define HOST_FAKETIME_INSTALL_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR)/usr install
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR) install
 endef
 
 $(eval $(host-generic-package))
package/gcc/gcc-final/gcc-final.mk +1 -1
index 12f08c81a8..78466fa4da 100644
@@ -43,7 +43,7 @@ define  HOST_GCC_FINAL_CONFIGURE_CMDS
 		LDFLAGS="$(HOST_LDFLAGS)" \
 		$(HOST_GCC_FINAL_CONF_ENV) \
 		./configure \
-		--prefix="$(HOST_DIR)/usr" \
+		--prefix="$(HOST_DIR)" \
 		--sysconfdir="$(HOST_DIR)/etc" \
 		--enable-static \
 		$(QUIET) $(HOST_GCC_FINAL_CONF_OPTS) \
package/libsepol/libsepol.mk +1 -1
index d360bfbcb1..233334eea2 100644
@@ -36,7 +36,7 @@ endef
 HOST_LIBSEPOL_MAKE_ENV = \
 	$(HOST_MAKE_ENV) \
 	DESTDIR=$(HOST_DIR)/usr \
-	PREFIX=$(HOST_DIR)/usr
+	PREFIX=$(HOST_DIR)
 
 define HOST_LIBSEPOL_BUILD_CMDS
 	$(HOST_LIBSEPOL_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_CONFIGURE_OPTS)
package/libxml-parser-perl/libxml-parser-perl.mk +1 -1
index 401470d907..bca1c34a8f 100644
@@ -14,7 +14,7 @@ LIBXML_PARSER_PERL_RUN_PERL = `which perl`
 define HOST_LIBXML_PARSER_PERL_CONFIGURE_CMDS
 	(cd $(@D) ; \
 		$(HOST_CONFIGURE_OPTS) $(LIBXML_PARSER_PERL_RUN_PERL) Makefile.PL \
-			PREFIX=$(HOST_DIR)/usr \
+			PREFIX=$(HOST_DIR) \
 			EXPATLIBPATH=$(HOST_DIR)/usr/lib \
 			EXPATINCPATH=$(HOST_DIR)/usr/include \
 			INSTALLDIRS=site \
package/luajit/luajit.mk +2 -2
index d3ef3b7599..f20ba51482 100644
@@ -66,13 +66,13 @@ LUAJIT_POST_INSTALL_TARGET_HOOKS += LUAJIT_INSTALL_SYMLINK
 
 # host-efl package needs host-luajit to be linked dynamically.
 define HOST_LUAJIT_BUILD_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) PREFIX="$(HOST_DIR)/usr" BUILDMODE=dynamic \
+	$(HOST_MAKE_ENV) $(MAKE) PREFIX="$(HOST_DIR)" BUILDMODE=dynamic \
 		TARGET_LDFLAGS="$(HOST_LDFLAGS)" \
 		-C $(@D) amalg
 endef
 
 define HOST_LUAJIT_INSTALL_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) PREFIX="$(HOST_DIR)/usr" LDCONFIG=true -C $(@D) install
+	$(HOST_MAKE_ENV) $(MAKE) PREFIX="$(HOST_DIR)" LDCONFIG=true -C $(@D) install
 endef
 
 $(eval $(generic-package))
package/luarocks/luarocks.mk +2 -2
index d18056a527..646e43b668 100644
@@ -19,7 +19,7 @@ LUAROCKS_CFLAGS += -DLUA_COMPAT_5_2
 endif
 
 HOST_LUAROCKS_CONF_OPTS = \
-	--prefix=$(HOST_DIR)/usr \
+	--prefix=$(HOST_DIR) \
 	--sysconfdir=$(LUAROCKS_CONFIG_DIR) \
 	--with-lua=$(HOST_DIR)/usr
 
@@ -34,7 +34,7 @@ endef
 define HOST_LUAROCKS_INSTALL_CMDS
 	rm -f $(LUAROCKS_CONFIG_FILE)
 	$(MAKE1) -C $(@D) install \
-		PREFIX=$(HOST_DIR)/usr
+		PREFIX=$(HOST_DIR)
 	echo "-- BR cross-compilation"                          >> $(LUAROCKS_CONFIG_FILE)
 	echo "variables = {"                                    >> $(LUAROCKS_CONFIG_FILE)
 	echo "   LUA_INCDIR = [[$(STAGING_DIR)/usr/include]],"  >> $(LUAROCKS_CONFIG_FILE)
package/lz4/lz4.mk +1 -1
index d350d4c099..91ff43b052 100644
@@ -22,7 +22,7 @@ define HOST_LZ4_BUILD_CMDS
 endef
 
 define HOST_LZ4_INSTALL_CMDS
-	$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) PREFIX=$(HOST_DIR)/usr \
+	$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) PREFIX=$(HOST_DIR) \
 		install -C $(@D)
 endef
 
package/nodejs/nodejs.mk +1 -1
index ad0b26df45..a9c96cad91 100644
@@ -55,7 +55,7 @@ define HOST_NODEJS_CONFIGURE_CMDS
 		PATH=$(@D)/bin:$(BR_PATH) \
 		PYTHON=$(HOST_DIR)/usr/bin/python2 \
 		$(HOST_DIR)/usr/bin/python2 ./configure \
-		--prefix=$(HOST_DIR)/usr \
+		--prefix=$(HOST_DIR) \
 		--without-snapshot \
 		--without-dtrace \
 		--without-etw \
package/openssl/openssl.mk +1 -1
index 1536982f8b..ebced44ea4 100644
@@ -61,7 +61,7 @@ define HOST_OPENSSL_CONFIGURE_CMDS
 	(cd $(@D); \
 		$(HOST_CONFIGURE_OPTS) \
 		./config \
-		--prefix=$(HOST_DIR)/usr \
+		--prefix=$(HOST_DIR) \
 		--openssldir=$(HOST_DIR)/etc/ssl \
 		--libdir=/lib \
 		shared \
package/perl/perl.mk +1 -1
index 130441f703..a4679ebe26 100644
@@ -91,7 +91,7 @@ endef
 
 HOST_PERL_CONF_OPTS = \
 	-des \
-	-Dprefix="$(HOST_DIR)/usr" \
+	-Dprefix="$(HOST_DIR)" \
 	-Dcc="$(HOSTCC)"
 
 define HOST_PERL_CONFIGURE_CMDS
package/pngquant/pngquant.mk +1 -1
index 4a6f32fdca..744d9f4090 100644
@@ -36,7 +36,7 @@ endef
 define HOST_PNGQUANT_CONFIGURE_CMDS
 	(cd $(@D) && \
 		$(HOST_CONFIGURE_OPTS) \
-		./configure --prefix=$(HOST_DIR)/usr \
+		./configure --prefix=$(HOST_DIR) \
 		--without-lcms2 \
 	)
 endef
package/qemu/qemu.mk +1 -1
index 2b6aafbae8..6df3b3db8b 100644
@@ -126,7 +126,7 @@ define HOST_QEMU_CONFIGURE_CMDS
 	cd $(@D); $(HOST_CONFIGURE_OPTS) CPP="$(HOSTCC) -E" \
 		./configure \
 		--target-list="$(HOST_QEMU_TARGETS)" \
-		--prefix="$(HOST_DIR)/usr" \
+		--prefix="$(HOST_DIR)" \
 		--interp-prefix=$(STAGING_DIR) \
 		--cc="$(HOSTCC)" \
 		--host-cc="$(HOSTCC)" \
package/s6-rc/s6-rc.mk +1 -1
index 1c28dcb88a..39c18852f1 100644
@@ -47,7 +47,7 @@ endef
 HOST_S6_RC_DEPENDENCIES = host-s6
 
 HOST_S6_RC_CONF_OPTS = \
-	--prefix=$(HOST_DIR)/usr \
+	--prefix=$(HOST_DIR) \
 	--libexecdir=/usr/libexec \
 	--with-sysdeps=$(HOST_DIR)/usr/lib/skalibs/sysdeps \
 	--with-include=$(HOST_DIR)/usr/include \
package/s6/s6.mk +1 -1
index de08f67848..4632f5829c 100644
@@ -46,7 +46,7 @@ endef
 HOST_S6_DEPENDENCIES = host-execline
 
 HOST_S6_CONF_OPTS = \
-	--prefix=$(HOST_DIR)/usr \
+	--prefix=$(HOST_DIR) \
 	--with-sysdeps=$(HOST_DIR)/usr/lib/skalibs/sysdeps \
 	--with-include=$(HOST_DIR)/usr/include \
 	--with-dynlib=$(HOST_DIR)/usr/lib \
package/sdl_image/sdl_image.mk +2 -2
index 6ea657bcff..ee0712cc27 100644
@@ -37,8 +37,8 @@ SDL_IMAGE_DEPENDENCIES = sdl \
 	$(if $(BR2_PACKAGE_SDL_IMAGE_WEBP),webp)
 
 HOST_SDL_IMAGE_CONF_OPTS = \
-	--with-sdl-prefix=$(HOST_DIR)/usr \
-	--with-sdl-exec-prefix=$(HOST_DIR)/usr \
+	--with-sdl-prefix=$(HOST_DIR) \
+	--with-sdl-exec-prefix=$(HOST_DIR) \
 	--disable-sdltest \
 	--disable-static \
 	--disable-jpg-shared \
package/skalibs/skalibs.mk +1 -1
index 55b8a293a7..de2ead704a 100644
@@ -33,7 +33,7 @@ define SKALIBS_INSTALL_STAGING_CMDS
 endef
 
 HOST_SKALIBS_CONF_OPTS = \
-	--prefix=$(HOST_DIR)/usr \
+	--prefix=$(HOST_DIR) \
 	--disable-static \
 	--enable-shared \
 	--disable-allstatic
package/sunxi-tools/sunxi-tools.mk +2 -2
index 9bb0b9eff9..c193769c10 100644
@@ -12,13 +12,13 @@ HOST_SUNXI_TOOLS_DEPENDENCIES = host-libusb host-pkgconf
 FEX2BIN = $(HOST_DIR)/usr/bin/fex2bin
 
 define HOST_SUNXI_TOOLS_BUILD_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) CC="$(HOSTCC)" PREFIX=$(HOST_DIR)/usr \
+	$(HOST_MAKE_ENV) $(MAKE) CC="$(HOSTCC)" PREFIX=$(HOST_DIR) \
 		EXTRA_CFLAGS="$(HOST_CFLAGS)" LDFLAGS="$(HOST_LDFLAGS)" \
 		-C $(@D) tools
 endef
 
 define HOST_SUNXI_TOOLS_INSTALL_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) PREFIX=$(HOST_DIR)/usr \
+	$(HOST_MAKE_ENV) $(MAKE) PREFIX=$(HOST_DIR) \
 		-C $(@D) install-tools
 endef
 
package/zip/zip.mk +1 -1
index 66d94b3c68..0bd3d3c11f 100644
@@ -47,7 +47,7 @@ endef
 
 define HOST_ZIP_INSTALL_CMDS
 	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) -f unix/Makefile install \
-		prefix=$(HOST_DIR)/usr
+		prefix=$(HOST_DIR)
 endef
 
 $(eval $(generic-package))
package/zlib/zlib.mk +1 -1
index 23c6e95cfa..9b5f52e807 100644
@@ -38,7 +38,7 @@ define HOST_ZLIB_CONFIGURE_CMDS
 		$(HOST_CONFIGURE_ARGS) \
 		$(HOST_CONFIGURE_OPTS) \
 		./configure \
-		--prefix="$(HOST_DIR)/usr" \
+		--prefix="$(HOST_DIR)" \
 		--sysconfdir="$(HOST_DIR)/etc" \
 	)
 endef
Signature · 1 line
2.11.0
#20 lore raw

PATCH 18/53 Globally replace $(HOST_DIR)/usr/bin with $(HOST_DIR)/bin

In reply to Arnout Vandecappelle (Essensium/Mind)

Since things are no longer installed in $(HOST_DIR)/usr, the callers should also not refer to it.

This is a mechanical change with
git grep -l '$(HOST_DIR)/usr/bin' | xargs sed -i 's%$(HOST_DIR)/usr/bin%$(HOST_DIR)/bin%g'

---
 Makefile                                           |  4 ++--
 boot/grub2/grub2.mk                                |  2 +-
 boot/mxs-bootlets/mxs-bootlets.mk                  |  2 +-
 boot/syslinux/syslinux.mk                          |  4 ++--
 boot/uboot/uboot.mk                                | 10 ++++-----
 fs/axfs/axfs.mk                                    |  2 +-
 fs/cloop/cloop.mk                                  |  4 ++--
 fs/common.mk                                       |  4 ++--
 fs/cramfs/cramfs.mk                                |  2 +-
 fs/iso9660/iso9660.mk                              |  4 ++--
 fs/romfs/romfs.mk                                  |  2 +-
 fs/squashfs/squashfs.mk                            |  2 +-
 fs/yaffs2/yaffs.mk                                 |  2 +-
 linux/linux.mk                                     |  6 ++---
 package/4th/4th.mk                                 |  6 ++---
 package/Makefile.in                                |  8 +++----
 package/am335x-pru-package/am335x-pru-package.mk   |  2 +-
 package/android-tools/android-tools.mk             |  2 +-
 package/autoconf/autoconf.mk                       |  8 +++----
 package/automake/automake.mk                       |  4 ++--
 package/axfsutils/axfsutils.mk                     |  2 +-
 package/b43-firmware/b43-firmware.mk               |  2 +-
 package/b43-fwcutter/b43-fwcutter.mk               |  2 +-
 package/boost/boost.mk                             |  4 ++--
 package/ca-certificates/ca-certificates.mk         |  2 +-
 package/canfestival/canfestival.mk                 |  6 ++---
 package/checkpolicy/checkpolicy.mk                 |  8 +++----
 package/cloop/cloop.mk                             |  6 ++---
 package/cppcms/cppcms.mk                           |  2 +-
 package/cramfs/cramfs.mk                           |  4 ++--
 package/cups/cups.mk                               |  2 +-
 package/dbus-glib/dbus-glib.mk                     |  2 +-
 package/dbus-python/dbus-python.mk                 |  4 ++--
 package/dbus/dbus.mk                               |  2 +-
 package/directfb/directfb.mk                       |  4 ++--
 package/docker-containerd/docker-containerd.mk     |  2 +-
 package/docker-engine/docker-engine.mk             |  2 +-
 package/efl/efl.mk                                 | 16 ++++++-------
 package/elftosb/elftosb.mk                         |  6 ++---
 package/enlightenment/enlightenment.mk             |  6 ++---
 package/erlang-rebar/erlang-rebar.mk               |  2 +-
 package/fakedate/fakedate.mk                       |  4 ++--
 package/flannel/flannel.mk                         |  2 +-
 package/gcc/gcc.mk                                 |  2 +-
 package/gdb/gdb.mk                                 |  4 ++--
 package/gdk-pixbuf/gdk-pixbuf.mk                   |  2 +-
 package/gettext/gettext.mk                         |  4 ++--
 package/go/go.mk                                   |  4 ++--
 package/gob2/gob2.mk                               |  2 +-
 package/gtest/gtest.mk                             |  2 +-
 package/guile/guile.mk                             |  2 +-
 package/gvfs/gvfs.mk                               |  2 +-
 package/heimdal/heimdal.mk                         |  4 ++--
 package/i2c-tools/i2c-tools.mk                     |  4 ++--
 package/iw/iw.mk                                   |  2 +-
 package/jsmin/jsmin.mk                             |  2 +-
 package/libglib2/libglib2.mk                       |  6 ++---
 package/libgtk2/libgtk2.mk                         |  6 ++---
 package/libgtk3/libgtk3.mk                         | 18 +++++++--------
 package/libiio/libiio.mk                           |  4 ++--
 package/libtool/libtool.mk                         |  4 ++--
 package/libv4l/libv4l.mk                           |  6 ++---
 package/libxml2/libxml2.mk                         |  2 +-
 package/libxmlrpc/libxmlrpc.mk                     |  2 +-
 package/localedef/localedef.mk                     |  2 +-
 package/lpc3250loader/lpc3250loader.mk             |  2 +-
 package/luainterpreter/luainterpreter.mk           |  2 +-
 package/luarocks/luarocks.mk                       |  2 +-
 package/lzma/lzma.mk                               |  2 +-
 package/lzop/lzop.mk                               |  2 +-
 package/makedevs/makedevs.mk                       |  2 +-
 package/mfgtools/mfgtools.mk                       |  2 +-
 package/mke2img/mke2img.mk                         |  2 +-
 package/mkpasswd/mkpasswd.mk                       |  4 ++--
 package/mkpimage/mkpimage.mk                       |  2 +-
 package/moarvm/moarvm.mk                           |  2 +-
 package/mono-gtksharp3/mono-gtksharp3.mk           |  2 +-
 package/mplayer/mplayer.mk                         |  2 +-
 package/mxsldr/mxsldr.mk                           |  2 +-
 package/ncftp/ncftp.mk                             |  2 +-
 package/ninja/ninja.mk                             |  2 +-
 package/nodejs/nodejs.mk                           | 26 +++++++++++-----------
 package/ola/ola.mk                                 |  4 ++--
 package/omap-u-boot-utils/omap-u-boot-utils.mk     |  2 +-
 package/omniorb/omniorb.mk                         |  6 ++---
 package/opencv3/opencv3.mk                         |  4 ++--
 package/oracle-mysql/oracle-mysql.mk               |  2 +-
 package/php-amqp/php-amqp.mk                       |  4 ++--
 package/php-geoip/php-geoip.mk                     |  4 ++--
 package/php-gnupg/php-gnupg.mk                     |  4 ++--
 package/php-imagick/php-imagick.mk                 |  4 ++--
 package/php-memcached/php-memcached.mk             |  4 ++--
 package/php-ssh2/php-ssh2.mk                       |  4 ++--
 package/php-yaml/php-yaml.mk                       |  4 ++--
 package/php-zmq/php-zmq.mk                         |  4 ++--
 package/pinentry/pinentry.mk                       |  2 +-
 package/pkg-cmake.mk                               |  4 ++--
 package/pkg-perl.mk                                |  2 +-
 package/pkg-python.mk                              |  6 ++---
 package/pkg-waf.mk                                 | 10 ++++-----
 package/pkgconf/pkgconf.mk                         | 10 ++++-----
 package/policycoreutils/policycoreutils.mk         |  8 +++----
 package/protobuf/protobuf.mk                       |  2 +-
 package/pulseaudio/pulseaudio.mk                   |  2 +-
 package/python-gobject/python-gobject.mk           |  4 ++--
 package/python-lxml/python-lxml.mk                 |  4 ++--
 package/python-pypcap/python-pypcap.mk             |  4 ++--
 package/python-pyqt/python-pyqt.mk                 |  4 ++--
 package/python-pyqt5/python-pyqt5.mk               |  4 ++--
 package/python-sip/python-sip.mk                   |  6 ++---
 package/python-web2py/python-web2py.mk             |  2 +-
 package/python/python.mk                           |  6 ++---
 package/python3/python3.mk                         | 16 ++++++-------
 package/qemu/qemu.mk                               |  8 +++----
 package/qpid-proton/qpid-proton.mk                 |  2 +-
 package/qt/qt.mk                                   | 14 ++++++------
 package/qt5/qt5.mk                                 |  2 +-
 package/qt5/qt53d/qt53d.mk                         |  2 +-
 package/qt5/qt5canvas3d/qt5canvas3d.mk             |  2 +-
 package/qt5/qt5connectivity/qt5connectivity.mk     |  2 +-
 package/qt5/qt5declarative/qt5declarative.mk       |  2 +-
 package/qt5/qt5enginio/qt5enginio.mk               |  2 +-
 .../qt5/qt5graphicaleffects/qt5graphicaleffects.mk |  2 +-
 package/qt5/qt5imageformats/qt5imageformats.mk     |  2 +-
 package/qt5/qt5location/qt5location.mk             |  2 +-
 package/qt5/qt5multimedia/qt5multimedia.mk         |  2 +-
 package/qt5/qt5quickcontrols/qt5quickcontrols.mk   |  2 +-
 package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk |  2 +-
 package/qt5/qt5script/qt5script.mk                 |  2 +-
 package/qt5/qt5sensors/qt5sensors.mk               |  2 +-
 package/qt5/qt5serialbus/qt5serialbus.mk           |  2 +-
 package/qt5/qt5serialport/qt5serialport.mk         |  2 +-
 package/qt5/qt5svg/qt5svg.mk                       |  2 +-
 package/qt5/qt5tools/qt5tools.mk                   |  2 +-
 package/qt5/qt5webchannel/qt5webchannel.mk         |  2 +-
 package/qt5/qt5webkit/qt5webkit.mk                 |  4 ++--
 package/qt5/qt5websockets/qt5websockets.mk         |  2 +-
 package/qt5/qt5x11extras/qt5x11extras.mk           |  2 +-
 package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk       |  2 +-
 package/qt5cinex/qt5cinex.mk                       |  2 +-
 package/runc/runc.mk                               |  2 +-
 package/s6-rc/s6-rc.mk                             |  2 +-
 package/sam-ba/sam-ba.mk                           |  4 ++--
 package/scons/scons.mk                             |  2 +-
 package/setools/setools.mk                         |  2 +-
 package/shared-mime-info/shared-mime-info.mk       |  4 ++--
 package/socat/socat.mk                             |  2 +-
 package/softether/softether.mk                     |  2 +-
 package/sqlcipher/sqlcipher.mk                     |  2 +-
 package/squashfs/squashfs.mk                       |  2 +-
 package/sunxi-tools/sunxi-tools.mk                 |  2 +-
 package/swig/swig.mk                               |  8 +++----
 package/systemd/systemd.mk                         |  2 +-
 package/tcllib/tcllib.mk                           |  2 +-
 package/terminology/terminology.mk                 |  2 +-
 package/thrift/thrift.mk                           |  4 ++--
 package/tvheadend/tvheadend.mk                     |  4 ++--
 package/uboot-tools/uboot-tools.mk                 |  8 +++----
 package/uclibc/uclibc.mk                           |  8 +++----
 package/upx/upx.mk                                 |  2 +-
 package/vala/vala.mk                               |  8 +++----
 package/vlc/vlc.mk                                 |  6 ++---
 package/waf/waf.mk                                 |  2 +-
 package/wireshark/wireshark.mk                     |  6 ++---
 package/x11r7/libxcb/libxcb.mk                     |  4 ++--
 .../xfont_font-adobe-100dpi.mk                     |  4 ++--
 .../xfont_font-adobe-75dpi.mk                      |  4 ++--
 .../xfont_font-adobe-utopia-100dpi.mk              |  4 ++--
 .../xfont_font-adobe-utopia-75dpi.mk               |  4 ++--
 .../xfont_font-adobe-utopia-type1.mk               |  4 ++--
 package/x11r7/xfont_font-alias/xfont_font-alias.mk |  4 ++--
 .../xfont_font-arabic-misc.mk                      |  4 ++--
 .../xfont_font-bh-100dpi/xfont_font-bh-100dpi.mk   |  4 ++--
 .../xfont_font-bh-75dpi/xfont_font-bh-75dpi.mk     |  4 ++--
 .../xfont_font-bh-lucidatypewriter-100dpi.mk       |  4 ++--
 .../xfont_font-bh-lucidatypewriter-75dpi.mk        |  4 ++--
 .../x11r7/xfont_font-bh-ttf/xfont_font-bh-ttf.mk   |  4 ++--
 .../xfont_font-bh-type1/xfont_font-bh-type1.mk     |  4 ++--
 .../xfont_font-bitstream-100dpi.mk                 |  4 ++--
 .../xfont_font-bitstream-75dpi.mk                  |  4 ++--
 .../xfont_font-bitstream-type1.mk                  |  4 ++--
 .../xfont_font-cronyx-cyrillic.mk                  |  4 ++--
 .../xfont_font-cursor-misc.mk                      |  4 ++--
 .../xfont_font-daewoo-misc.mk                      |  4 ++--
 .../xfont_font-dec-misc/xfont_font-dec-misc.mk     |  4 ++--
 .../xfont_font-ibm-type1/xfont_font-ibm-type1.mk   |  4 ++--
 .../xfont_font-isas-misc/xfont_font-isas-misc.mk   |  4 ++--
 .../xfont_font-jis-misc/xfont_font-jis-misc.mk     |  4 ++--
 .../xfont_font-micro-misc/xfont_font-micro-misc.mk |  4 ++--
 .../xfont_font-misc-cyrillic.mk                    |  4 ++--
 .../xfont_font-misc-ethiopic.mk                    |  4 ++--
 .../xfont_font-misc-meltho.mk                      |  4 ++--
 .../xfont_font-misc-misc/xfont_font-misc-misc.mk   |  4 ++--
 .../xfont_font-mutt-misc/xfont_font-mutt-misc.mk   |  4 ++--
 .../xfont_font-schumacher-misc.mk                  |  4 ++--
 .../xfont_font-screen-cyrillic.mk                  |  4 ++--
 .../xfont_font-sony-misc/xfont_font-sony-misc.mk   |  4 ++--
 .../xfont_font-sun-misc/xfont_font-sun-misc.mk     |  4 ++--
 .../xfont_font-winitzki-cyrillic.mk                |  4 ++--
 .../xfont_font-xfree86-type1.mk                    |  4 ++--
 package/x264/x264.mk                               |  2 +-
 package/xen/xen.mk                                 |  2 +-
 package/yaffs2utils/yaffs2utils.mk                 |  2 +-
 package/zynq-boot-bin/zynq-boot-bin.mk             |  2 +-
 support/dependencies/check-host-cmake.mk           |  2 +-
 support/dependencies/check-host-lzip.mk            |  2 +-
 support/dependencies/check-host-tar.mk             |  2 +-
 support/dependencies/check-host-xzcat.mk           |  2 +-
 .../toolchain-external/pkg-toolchain-external.mk   |  8 +++----
 toolchain/toolchain-wrapper.c                      |  4 ++--
 toolchain/toolchain-wrapper.mk                     |  2 +-
 211 files changed, 400 insertions(+), 400 deletions(-)
Makefile +2 -2
index 565385ec48..fb1883f604 100644
@@ -446,7 +446,7 @@ BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(PATH)"
 TARGET_DIR_WARNING_FILE = $(TARGET_DIR)/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
 
 ifeq ($(BR2_CCACHE),y)
-CCACHE := $(HOST_DIR)/usr/bin/ccache
+CCACHE := $(HOST_DIR)/bin/ccache
 BR_CACHE_DIR ?= $(call qstrip,$(BR2_CCACHE_DIR))
 export BR_CACHE_DIR
 HOSTCC := $(CCACHE) $(HOSTCC)
@@ -609,7 +609,7 @@ define GENERATE_GLIBC_LOCALES
 		fi ; \
 		echo "Generating locale $${inputfile}.$${charmap}" ; \
 		I18NPATH=$(STAGING_DIR)/usr/share/i18n:/usr/share/i18n \
-		$(HOST_DIR)/usr/bin/localedef \
+		$(HOST_DIR)/bin/localedef \
 			--prefix=$(TARGET_DIR) \
 			--$(call LOWERCASE,$(BR2_ENDIAN))-endian \
 			-i $${inputfile} -f $${charmap} \
boot/grub2/grub2.mk +1 -1
index dc019835ab..698cb19980 100644
@@ -86,7 +86,7 @@ endif
 
 define GRUB2_IMAGE_INSTALLATION
 	mkdir -p $(dir $(GRUB2_IMAGE))
-	$(HOST_DIR)/usr/bin/grub-mkimage \
+	$(HOST_DIR)/bin/grub-mkimage \
 		-d $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE) \
 		-O $(GRUB2_TUPLE) \
 		-o $(GRUB2_IMAGE) \
boot/mxs-bootlets/mxs-bootlets.mk +1 -1
index 1955a37cdf..b7f3c44c98 100644
@@ -93,7 +93,7 @@ define MXS_BOOTLETS_BUILD_CMDS
 	$(MXS_BOOTLETS_SED_BAREBOX)
 	$(MXS_BOOTLETS_SED_LINUX)
 	$(MXS_BOOTLETS_SED_UBOOT)
-	$(HOST_DIR)/usr/bin/elftosb $(MXS_BOOTLETS_ELFTOSB_OPTIONS) \
+	$(HOST_DIR)/bin/elftosb $(MXS_BOOTLETS_ELFTOSB_OPTIONS) \
 		-z -c $(@D)/$(MXS_BOOTLETS_BOOTDESC) \
 		-o $(@D)/$(MXS_BOOTLETS_BOOTSTREAM)
 endef
boot/syslinux/syslinux.mk +2 -2
index 2b3b9a75f4..9feb48a666 100644
@@ -54,7 +54,7 @@ define SYSLINUX_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE1) \
 		CC="$(TARGET_CC)" \
 		LD="$(TARGET_LD)" \
-		NASM="$(HOST_DIR)/usr/bin/nasm" \
+		NASM="$(HOST_DIR)/bin/nasm" \
 		CC_FOR_BUILD="$(HOSTCC)" \
 		CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
 		LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
@@ -77,7 +77,7 @@ endef
 # However, buildroot makes no usage of it, so better delete it than have it
 # installed at the wrong place
 define SYSLINUX_POST_INSTALL_CLEANUP
-	rm -rf $(HOST_DIR)/usr/bin/syslinux
+	rm -rf $(HOST_DIR)/bin/syslinux
 endef
 SYSLINUX_POST_INSTALL_TARGET_HOOKS += SYSLINUX_POST_INSTALL_CLEANUP
 
boot/uboot/uboot.mk +5 -5
index 91f8ec4e72..2f4f89868d 100644
@@ -214,7 +214,7 @@ define UBOOT_BUILD_CMDS
 endef
 
 define UBOOT_BUILD_OMAP_IFT
-	$(HOST_DIR)/usr/bin/gpsign -f $(@D)/u-boot.bin \
+	$(HOST_DIR)/bin/gpsign -f $(@D)/u-boot.bin \
 		-c $(call qstrip,$(BR2_TARGET_UBOOT_OMAP_IFT_CONFIG))
 endef
 
@@ -231,7 +231,7 @@ define UBOOT_INSTALL_IMAGES_CMDS
 	)
 	$(if $(BR2_TARGET_UBOOT_ENVIMAGE),
 		cat $(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)) | \
-			$(HOST_DIR)/usr/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \
+			$(HOST_DIR)/bin/mkenvimage -s $(BR2_TARGET_UBOOT_ENVIMAGE_SIZE) \
 			$(if $(BR2_TARGET_UBOOT_ENVIMAGE_REDUNDANT),-r) \
 			$(if $(filter BIG,$(BR2_ENDIAN)),-b) \
 			-o $(BINARIES_DIR)/uboot-env.bin -)
@@ -257,8 +257,8 @@ endif
 
 ifeq ($(BR2_TARGET_UBOOT_ZYNQ_IMAGE),y)
 define UBOOT_GENERATE_ZYNQ_IMAGE
-	$(HOST_DIR)/usr/bin/python2 \
-		$(HOST_DIR)/usr/bin/zynq-boot-bin.py \
+	$(HOST_DIR)/bin/python2 \
+		$(HOST_DIR)/bin/zynq-boot-bin.py \
 		-u $(@D)/$(firstword $(call qstrip,$(BR2_TARGET_UBOOT_SPL_NAME))) \
 		-o $(BINARIES_DIR)/BOOT.BIN
 endef
@@ -276,7 +276,7 @@ UBOOT_CRC_ALTERA_SOCFPGA_HEADER_VERSION = 1
 endif
 define UBOOT_CRC_ALTERA_SOCFPGA_IMAGE
 	$(foreach f,$(UBOOT_CRC_ALTERA_SOCFPGA_INPUT_IMAGES), \
-		$(HOST_DIR)/usr/bin/mkpimage \
+		$(HOST_DIR)/bin/mkpimage \
 			-v $(UBOOT_CRC_ALTERA_SOCFPGA_HEADER_VERSION) \
 			-o $(BINARIES_DIR)/$(notdir $(call qstrip,$(f))).crc \
 			$(@D)/$(call qstrip,$(f))
fs/axfs/axfs.mk +1 -1
index 05d6e5d395..6c795d7062 100644
@@ -7,7 +7,7 @@
 ROOTFS_AXFS_DEPENDENCIES = host-axfsutils
 
 define ROOTFS_AXFS_CMD
-	$(HOST_DIR)/usr/bin/mkfs.axfs -s -a $(TARGET_DIR) $@
+	$(HOST_DIR)/bin/mkfs.axfs -s -a $(TARGET_DIR) $@
 endef
 
 $(eval $(call ROOTFS_TARGET,axfs))
fs/cloop/cloop.mk +2 -2
index 9e42a3a27f..cbfc79b0d1 100644
@@ -7,8 +7,8 @@
 ROOTFS_CLOOP_DEPENDENCIES = host-cloop host-cdrkit
 
 define ROOTFS_CLOOP_CMD
-	$(HOST_DIR)/usr/bin/genisoimage -r $(TARGET_DIR) | \
-		$(HOST_DIR)/usr/bin/create_compressed_fs - 65536 > $@
+	$(HOST_DIR)/bin/genisoimage -r $(TARGET_DIR) | \
+		$(HOST_DIR)/bin/create_compressed_fs - 65536 > $@
 endef
 
 $(eval $(call ROOTFS_TARGET,cloop))
fs/common.mk +2 -2
index 396b1c2bdf..14e0a6b868 100644
@@ -91,7 +91,7 @@ ifeq ($$(BR2_ROOTFS_DEVICE_CREATION_STATIC),y)
 endif
 endif
 	$$(call PRINTF,$$(PACKAGES_PERMISSIONS_TABLE)) >> $$(FULL_DEVICE_TABLE)
-	echo "$$(HOST_DIR)/usr/bin/makedevs -d $$(FULL_DEVICE_TABLE) $$(TARGET_DIR)" >> $$(FAKEROOT_SCRIPT)
+	echo "$$(HOST_DIR)/bin/makedevs -d $$(FULL_DEVICE_TABLE) $$(TARGET_DIR)" >> $$(FAKEROOT_SCRIPT)
 	$$(foreach s,$$(call qstrip,$$(BR2_ROOTFS_POST_FAKEROOT_SCRIPT)),\
 		echo "echo '$$(TERM_BOLD)>>>   Executing fakeroot script $$(s)$$(TERM_RESET)'" >> $$(FAKEROOT_SCRIPT); \
 		echo $$(s) $$(TARGET_DIR) $$(BR2_ROOTFS_POST_SCRIPT_ARGS) >> $$(FAKEROOT_SCRIPT)$$(sep))
@@ -100,7 +100,7 @@ ifeq ($$(BR2_REPRODUCIBLE),y)
 endif
 	$$(call PRINTF,$$(ROOTFS_$(2)_CMD)) >> $$(FAKEROOT_SCRIPT)
 	chmod a+x $$(FAKEROOT_SCRIPT)
-	PATH=$$(BR_PATH) $$(HOST_DIR)/usr/bin/fakeroot -- $$(FAKEROOT_SCRIPT)
+	PATH=$$(BR_PATH) $$(HOST_DIR)/bin/fakeroot -- $$(FAKEROOT_SCRIPT)
 	$$(INSTALL) -m 0644 support/misc/target-dir-warning.txt $$(TARGET_DIR_WARNING_FILE)
 	- at rm -f $$(FAKEROOT_SCRIPT) $$(FULL_DEVICE_TABLE)
 ifneq ($$(ROOTFS_$(2)_COMPRESS_CMD),)
fs/cramfs/cramfs.mk +1 -1
index 747237290f..85b98b8ccd 100644
@@ -11,7 +11,7 @@ CRAMFS_OPTS = -l
 endif
 
 define ROOTFS_CRAMFS_CMD
-	$(HOST_DIR)/usr/bin/mkcramfs $(CRAMFS_OPTS) $(TARGET_DIR) $@
+	$(HOST_DIR)/bin/mkcramfs $(CRAMFS_OPTS) $(TARGET_DIR) $@
 endef
 
 ROOTFS_CRAMFS_DEPENDENCIES = host-cramfs
fs/iso9660/iso9660.mk +2 -2
index d1d9cbf1a4..fec6fe17c2 100644
@@ -144,14 +144,14 @@ endif # ROOTFS_ISO9660_USE_INITRD
 
 
 define ROOTFS_ISO9660_CMD
-	$(HOST_DIR)/usr/bin/genisoimage -J -R -b $(ROOTFS_ISO9660_BOOT_IMAGE) \
+	$(HOST_DIR)/bin/genisoimage -J -R -b $(ROOTFS_ISO9660_BOOT_IMAGE) \
 		-no-emul-boot -boot-load-size 4 -boot-info-table \
 		-o $@ $(ROOTFS_ISO9660_TARGET_DIR)
 endef
 
 ifeq ($(BR2_TARGET_ROOTFS_ISO9660_HYBRID),y)
 define ROOTFS_ISO9660_GEN_HYBRID
-	$(HOST_DIR)/usr/bin/isohybrid -t 0x96 $@
+	$(HOST_DIR)/bin/isohybrid -t 0x96 $@
 endef
 
 ROOTFS_ISO9660_POST_GEN_HOOKS += ROOTFS_ISO9660_GEN_HYBRID
fs/romfs/romfs.mk +1 -1
index 2738b6b292..eded91df0a 100644
@@ -7,7 +7,7 @@
 ROOTFS_ROMFS_DEPENDENCIES = host-genromfs
 
 define ROOTFS_ROMFS_CMD
-	$(HOST_DIR)/usr/bin/genromfs -d $(TARGET_DIR) -f $@
+	$(HOST_DIR)/bin/genromfs -d $(TARGET_DIR) -f $@
 endef
 
 $(eval $(call ROOTFS_TARGET,romfs))
fs/squashfs/squashfs.mk +1 -1
index c4d9ca50b3..68a57b074a 100644
@@ -25,7 +25,7 @@ endif
 endif
 
 define ROOTFS_SQUASHFS_CMD
-	$(HOST_DIR)/usr/bin/mksquashfs $(TARGET_DIR) $@ -noappend \
+	$(HOST_DIR)/bin/mksquashfs $(TARGET_DIR) $@ -noappend \
 		$(ROOTFS_SQUASHFS_ARGS)
 endef
 
fs/yaffs2/yaffs.mk +1 -1
index 19bdbe842e..30570735fa 100644
@@ -7,7 +7,7 @@
 ROOTFS_YAFFS2_DEPENDENCIES = host-yaffs2utils
 
 define ROOTFS_YAFFS2_CMD
-	$(HOST_DIR)/usr/bin/mkyaffs2 --all-root $(TARGET_DIR) $@
+	$(HOST_DIR)/bin/mkyaffs2 --all-root $(TARGET_DIR) $@
 endef
 
 $(eval $(call ROOTFS_TARGET,yaffs2))
linux/linux.mk +3 -3
index 7973677d05..f4a77a8a9f 100644
@@ -381,9 +381,9 @@ endif
 define LINUX_INSTALL_HOST_TOOLS
 	# Installing dtc (device tree compiler) as host tool, if selected
 	if grep -q "CONFIG_DTC=y" $(@D)/.config; then	\
-		$(INSTALL) -D -m 0755 $(@D)/scripts/dtc/dtc $(HOST_DIR)/usr/bin/linux-dtc ;	\
-		if [ ! -e $(HOST_DIR)/usr/bin/dtc ]; then	\
-			ln -sf linux-dtc $(HOST_DIR)/usr/bin/dtc ;	\
+		$(INSTALL) -D -m 0755 $(@D)/scripts/dtc/dtc $(HOST_DIR)/bin/linux-dtc ;	\
+		if [ ! -e $(HOST_DIR)/bin/dtc ]; then	\
+			ln -sf linux-dtc $(HOST_DIR)/bin/dtc ;	\
 		fi	\
 	fi
 endef
package/4th/4th.mk +3 -3
index d7daeb3b32..7076519d16 100644
@@ -27,7 +27,7 @@ define 4TH_BUILD_CMDS
 	$(4TH_MAKE_ENV) $(MAKE) -C $(@D)/sources all \
 		CROSS="$(TARGET_CROSS)" \
 		CFLAGS="$(4TH_CFLAGS)" \
-		FOURTH=$(HOST_DIR)/usr/bin/4th
+		FOURTH=$(HOST_DIR)/bin/4th
 endef
 
 define 4TH_INSTALL_STAGING_CMDS
@@ -59,10 +59,10 @@ define HOST_4TH_BUILD_CMDS
 endef
 
 define HOST_4TH_INSTALL_CMDS
-	mkdir -p $(HOST_DIR)/usr/bin
+	mkdir -p $(HOST_DIR)/bin
 	mkdir -p $(HOST_DIR)/usr/lib
 	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/sources mostlyinstall \
-		BINARIES=$(HOST_DIR)/usr/bin \
+		BINARIES=$(HOST_DIR)/bin \
 		LIBRARIES=$(HOST_DIR)/usr/lib
 endef
 
package/Makefile.in +4 -4
index 579e40b1ba..e287af03df 100644
@@ -182,9 +182,9 @@ TARGET_FCFLAGS += -fstack-protector-all
 endif
 
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
-TARGET_CROSS = $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-
+TARGET_CROSS = $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-
 else
-TARGET_CROSS = $(HOST_DIR)/usr/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)-
+TARGET_CROSS = $(HOST_DIR)/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)-
 endif
 
 # Define TARGET_xx variables for all common binutils/gcc
@@ -215,7 +215,7 @@ FLEX := $(shell which flex || type -p flex)
 BISON := $(shell which bison || type -p bison)
 UNZIP := $(shell which unzip || type -p unzip) -q
 
-APPLY_PATCHES = PATH=$(HOST_DIR)/usr/bin:$$PATH support/scripts/apply-patches.sh $(if $(QUIET),-s)
+APPLY_PATCHES = PATH=$(HOST_DIR)/bin:$$PATH support/scripts/apply-patches.sh $(if $(QUIET),-s)
 
 HOST_CPPFLAGS  = -I$(HOST_DIR)/usr/include
 HOST_CFLAGS   ?= -O2
@@ -225,7 +225,7 @@ HOST_LDFLAGS  += -L$(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib
 
 # host-intltool should be executed with the system perl, so we save
 # the path to the system perl, before a host-perl built by Buildroot
-# might get installed into $(HOST_DIR)/usr/bin and therefore appears
+# might get installed into $(HOST_DIR)/bin and therefore appears
 # in our PATH. This system perl will be used as INTLTOOL_PERL.
 export PERL=$(shell which perl)
 
package/am335x-pru-package/am335x-pru-package.mk +1 -1
index a2465b1155..b2e89d3710 100644
@@ -67,7 +67,7 @@ define HOST_AM335X_PRU_PACKAGE_BUILD_CMDS
 endef
 
 define HOST_AM335X_PRU_PACKAGE_INSTALL_CMDS
-	$(INSTALL) -m 0755 -D $(@D)/pru_sw/utils/pasm $(HOST_DIR)/usr/bin/pasm
+	$(INSTALL) -m 0755 -D $(@D)/pru_sw/utils/pasm $(HOST_DIR)/bin/pasm
 endef
 
 $(eval $(generic-package))
package/android-tools/android-tools.mk +1 -1
index 45103923eb..f6c6913a68 100644
@@ -73,7 +73,7 @@ endef
 
 define HOST_ANDROID_TOOLS_INSTALL_CMDS
 	$(foreach t,$(HOST_ANDROID_TOOLS_TARGETS),\
-		$(INSTALL) -D -m 0755 $(@D)/build-$(t)/$(t) $(HOST_DIR)/usr/bin/$(t)$(sep))
+		$(INSTALL) -D -m 0755 $(@D)/build-$(t)/$(t) $(HOST_DIR)/bin/$(t)$(sep))
 endef
 
 define ANDROID_TOOLS_INSTALL_TARGET_CMDS
package/autoconf/autoconf.mk +4 -4
index 904fadab74..e5f474c72d 100644
@@ -13,7 +13,7 @@ AUTOCONF_LICENSE_FILES = COPYINGv3 COPYING.EXCEPTION
 
 HOST_AUTOCONF_CONF_ENV = \
 	EMACS="no" \
-	ac_cv_path_M4=$(HOST_DIR)/usr/bin/m4 \
+	ac_cv_path_M4=$(HOST_DIR)/bin/m4 \
 	ac_cv_prog_gnu_m4_gnu=no
 
 HOST_AUTOCONF_DEPENDENCIES = host-m4 host-libtool
@@ -21,6 +21,6 @@ HOST_AUTOCONF_DEPENDENCIES = host-m4 host-libtool
 $(eval $(host-autotools-package))
 
 # variables used by other packages
-AUTOCONF = $(HOST_DIR)/usr/bin/autoconf
-AUTOHEADER = $(HOST_DIR)/usr/bin/autoheader
-AUTORECONF = $(HOST_CONFIGURE_OPTS) ACLOCAL="$(ACLOCAL)" AUTOCONF="$(AUTOCONF)" AUTOHEADER="$(AUTOHEADER)" AUTOMAKE="$(AUTOMAKE)" AUTOPOINT=/bin/true $(HOST_DIR)/usr/bin/autoreconf -f -i -I "$(ACLOCAL_DIR)" -I "$(ACLOCAL_HOST_DIR)"
+AUTOCONF = $(HOST_DIR)/bin/autoconf
+AUTOHEADER = $(HOST_DIR)/bin/autoheader
+AUTORECONF = $(HOST_CONFIGURE_OPTS) ACLOCAL="$(ACLOCAL)" AUTOCONF="$(AUTOCONF)" AUTOHEADER="$(AUTOHEADER)" AUTOMAKE="$(AUTOMAKE)" AUTOPOINT=/bin/true $(HOST_DIR)/bin/autoreconf -f -i -I "$(ACLOCAL_DIR)" -I "$(ACLOCAL_HOST_DIR)"
package/automake/automake.mk +2 -2
index e62038cfc2..13041213bb 100644
@@ -30,6 +30,6 @@ HOST_AUTOMAKE_POST_INSTALL_HOOKS += HOST_AUTOMAKE_MAKE_ACLOCAL
 $(eval $(host-autotools-package))
 
 # variables used by other packages
-AUTOMAKE = $(HOST_DIR)/usr/bin/automake
+AUTOMAKE = $(HOST_DIR)/bin/automake
 ACLOCAL_DIR = $(STAGING_DIR)/usr/share/aclocal
-ACLOCAL = $(HOST_DIR)/usr/bin/aclocal -I $(ACLOCAL_DIR)
+ACLOCAL = $(HOST_DIR)/bin/aclocal -I $(ACLOCAL_DIR)
package/axfsutils/axfsutils.mk +1 -1
index e1f7427206..00d3a3a8b0 100644
@@ -18,7 +18,7 @@ endef
 
 define HOST_AXFSUTILS_INSTALL_CMDS
 	$(INSTALL) -D -m 0755 $(@D)/mkfs.axfs-legacy/mkfs.axfs \
-		$(HOST_DIR)/usr/bin/mkfs.axfs
+		$(HOST_DIR)/bin/mkfs.axfs
 endef
 
 $(eval $(host-generic-package))
package/b43-firmware/b43-firmware.mk +1 -1
index 601ab6661c..8e9e877692 100644
@@ -23,7 +23,7 @@ B43_FIRMWARE_DEPENDENCIES = host-b43-fwcutter
 
 define B43_FIRMWARE_INSTALL_TARGET_CMDS
 	$(INSTALL) -d -m 0755 $(TARGET_DIR)/lib/firmware/
-	$(HOST_DIR)/usr/bin/b43-fwcutter -w $(TARGET_DIR)/lib/firmware/ $(@D)/$(B43_FIRMWARE_DRIVER_FILE)
+	$(HOST_DIR)/bin/b43-fwcutter -w $(TARGET_DIR)/lib/firmware/ $(@D)/$(B43_FIRMWARE_DRIVER_FILE)
 endef
 
 $(eval $(generic-package))
package/b43-fwcutter/b43-fwcutter.mk +1 -1
index 2d024f6384..91ba3dc758 100644
@@ -15,7 +15,7 @@ define HOST_B43_FWCUTTER_BUILD_CMDS
 endef
 
 define HOST_B43_FWCUTTER_INSTALL_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/b43-fwcutter $(HOST_DIR)/usr/bin/b43-fwcutter
+	$(INSTALL) -D -m 0755 $(@D)/b43-fwcutter $(HOST_DIR)/bin/b43-fwcutter
 endef
 
 $(eval $(host-generic-package))
package/boost/boost.mk +2 -2
index 3600cdea84..035fa029b6 100644
@@ -65,11 +65,11 @@ endif
 ifeq ($(BR2_PACKAGE_BOOST_PYTHON),y)
 BOOST_FLAGS += --with-python-root=$(HOST_DIR)
 ifeq ($(BR2_PACKAGE_PYTHON3),y)
-BOOST_FLAGS += --with-python=$(HOST_DIR)/usr/bin/python$(PYTHON3_VERSION_MAJOR)
+BOOST_FLAGS += --with-python=$(HOST_DIR)/bin/python$(PYTHON3_VERSION_MAJOR)
 BOOST_TARGET_CXXFLAGS += -I$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)m
 BOOST_DEPENDENCIES += python3
 else
-BOOST_FLAGS += --with-python=$(HOST_DIR)/usr/bin/python$(PYTHON_VERSION_MAJOR)
+BOOST_FLAGS += --with-python=$(HOST_DIR)/bin/python$(PYTHON_VERSION_MAJOR)
 BOOST_TARGET_CXXFLAGS += -I$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)
 BOOST_DEPENDENCIES += python
 endif
package/ca-certificates/ca-certificates.mk +1 -1
index 199c6b684e..f712e7988e 100644
@@ -37,7 +37,7 @@ define CA_CERTIFICATES_INSTALL_TARGET_CMDS
 	done
 
 	# Create symlinks to the certificates by their hash values
-	$(HOST_DIR)/usr/bin/c_rehash $(TARGET_DIR)/etc/ssl/certs
+	$(HOST_DIR)/bin/c_rehash $(TARGET_DIR)/etc/ssl/certs
 endef
 
 $(eval $(generic-package))
package/canfestival/canfestival.mk +3 -3
index 4a44470b73..760f14aecd 100644
@@ -37,13 +37,13 @@ endef
 
 define CANFESTIVAL_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) all \
-		PYTHON=$(HOST_DIR)/usr/bin/python2
+		PYTHON=$(HOST_DIR)/bin/python2
 endef
 
 define CANFESTIVAL_INSTALL_TARGET_CMDS
 	for d in $(CANFESTIVAL_INSTALLED-y) ; do \
 		$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D)/$$d install \
-			PYTHON=$(HOST_DIR)/usr/bin/python2 \
+			PYTHON=$(HOST_DIR)/bin/python2 \
 			DESTDIR=$(TARGET_DIR) || exit 1 ; \
 	done
 endef
@@ -51,7 +51,7 @@ endef
 define CANFESTIVAL_INSTALL_STAGING_CMDS
 	for d in $(CANFESTIVAL_INSTALLED-y) ; do \
 		$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D)/$$d install \
-			PYTHON=$(HOST_DIR)/usr/bin/python2 \
+			PYTHON=$(HOST_DIR)/bin/python2 \
 			DESTDIR=$(STAGING_DIR) || exit 1 ; \
 	done
 endef
package/checkpolicy/checkpolicy.mk +4 -4
index 7b98b743b1..d80bb792b4 100644
@@ -12,8 +12,8 @@ CHECKPOLICY_LICENSE_FILES = COPYING
 CHECKPOLICY_DEPENDENCIES = libselinux flex host-flex host-bison
 
 TARGET_CHECKPOLICY_MAKE_OPTS = $(TARGET_CONFIGURE_OPTS) \
-	LEX="$(HOST_DIR)/usr/bin/flex" \
-	YACC="$(HOST_DIR)/usr/bin/bison -y"
+	LEX="$(HOST_DIR)/bin/flex" \
+	YACC="$(HOST_DIR)/bin/bison -y"
 
 # DESTDIR is used at build time to find libselinux
 define CHECKPOLICY_BUILD_CMDS
@@ -32,8 +32,8 @@ endef
 HOST_CHECKPOLICY_DEPENDENCIES = host-libselinux host-flex host-bison
 
 HOST_CHECKPOLICY_MAKE_OPTS = $(HOST_CONFIGURE_OPTS) \
-	LEX="$(HOST_DIR)/usr/bin/flex" \
-	YACC="$(HOST_DIR)/usr/bin/bison -y"
+	LEX="$(HOST_DIR)/bin/flex" \
+	YACC="$(HOST_DIR)/bin/bison -y"
 
 # DESTDIR is used at build time to find host-libselinux
 define HOST_CHECKPOLICY_BUILD_CMDS
package/cloop/cloop.mk +3 -3
index 6a6e790b22..ad50d0a94a 100644
@@ -17,9 +17,9 @@ define HOST_CLOOP_BUILD_CMDS
 endef
 
 define HOST_CLOOP_INSTALL_CMDS
-	$(INSTALL) -m 0755 -d $(HOST_DIR)/usr/bin
-	$(INSTALL) -m 755 $(@D)/create_compressed_fs $(HOST_DIR)/usr/bin
-	$(INSTALL) -m 755 $(@D)/extract_compressed_fs $(HOST_DIR)/usr/bin
+	$(INSTALL) -m 0755 -d $(HOST_DIR)/bin
+	$(INSTALL) -m 755 $(@D)/create_compressed_fs $(HOST_DIR)/bin
+	$(INSTALL) -m 755 $(@D)/extract_compressed_fs $(HOST_DIR)/bin
 endef
 
 $(eval $(host-generic-package))
package/cppcms/cppcms.mk +1 -1
index 1f6c09dfa9..2632345aaf 100644
@@ -27,7 +27,7 @@ endif
 # needed for compiling packages using cppcms. And it is not worth
 # creating a host package just for a python script.
 define CPPCMS_INSTALL_HOST_TOOLS
-	cp $(STAGING_DIR)/usr/bin/cppcms_tmpl_cc $(HOST_DIR)/usr/bin/cppcms_tmpl_cc
+	cp $(STAGING_DIR)/usr/bin/cppcms_tmpl_cc $(HOST_DIR)/bin/cppcms_tmpl_cc
 endef
 CPPCMS_POST_INSTALL_STAGING_HOOKS += CPPCMS_INSTALL_HOST_TOOLS
 
package/cramfs/cramfs.mk +2 -2
index 2391b24a12..70010e8e2f 100644
@@ -26,8 +26,8 @@ define HOST_CRAMFS_BUILD_CMDS
 endef
 
 define HOST_CRAMFS_INSTALL_CMDS
-	$(INSTALL) -D -m 755 $(@D)/mkcramfs $(HOST_DIR)/usr/bin/mkcramfs
-	$(INSTALL) -D -m 755 $(@D)/cramfsck $(HOST_DIR)/usr/bin/cramfsck
+	$(INSTALL) -D -m 755 $(@D)/mkcramfs $(HOST_DIR)/bin/mkcramfs
+	$(INSTALL) -D -m 755 $(@D)/cramfsck $(HOST_DIR)/bin/cramfsck
 endef
 
 $(eval $(generic-package))
package/cups/cups.mk +1 -1
index 292d87e11d..6e95a436b0 100644
@@ -15,7 +15,7 @@ CUPS_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) DSTROOT=$(TARGET_DIR) install
 
 # Using autoconf, not autoheader, so we cannot use AUTORECONF = YES.
 define CUPS_RUN_AUTOCONF
-	cd $(@D); $(HOST_DIR)/usr/bin/autoconf -f
+	cd $(@D); $(HOST_DIR)/bin/autoconf -f
 endef
 CUPS_PRE_CONFIGURE_HOOKS += CUPS_RUN_AUTOCONF
 
package/dbus-glib/dbus-glib.mk +1 -1
index 22dcdb15fe..2257c8e4f9 100644
@@ -39,4 +39,4 @@ $(eval $(autotools-package))
 $(eval $(host-autotools-package))
 
 # dbus-glib for the host
-DBUS_GLIB_HOST_BINARY = $(HOST_DIR)/usr/bin/dbus-binding-tool
+DBUS_GLIB_HOST_BINARY = $(HOST_DIR)/bin/dbus-binding-tool
package/dbus-python/dbus-python.mk +2 -2
index 599d019857..da04b7404f 100644
@@ -16,14 +16,14 @@ ifeq ($(BR2_PACKAGE_PYTHON),y)
 DBUS_PYTHON_DEPENDENCIES += python host-python
 
 DBUS_PYTHON_CONF_ENV += \
-	PYTHON=$(HOST_DIR)/usr/bin/python2 \
+	PYTHON=$(HOST_DIR)/bin/python2 \
 	PYTHON_INCLUDES="`$(STAGING_DIR)/usr/bin/python2-config --includes`" \
 	PYTHON_LIBS="`$(STAGING_DIR)/usr/bin/python2-config --ldflags`"
 else
 DBUS_PYTHON_DEPENDENCIES += python3 host-python3
 
 DBUS_PYTHON_CONF_ENV += \
-	PYTHON=$(HOST_DIR)/usr/bin/python3 \
+	PYTHON=$(HOST_DIR)/bin/python3 \
 	PYTHON_INCLUDES="`$(STAGING_DIR)/usr/bin/python3-config --includes`" \
 	PYTHON_LIBS="`$(STAGING_DIR)/usr/bin/python3-config --ldflags`"
 endif
package/dbus/dbus.mk +1 -1
index 52c1912e07..b5a2f466c4 100644
@@ -121,7 +121,7 @@ HOST_DBUS_CONF_OPTS = \
 DBUS_HOST_INTROSPECT = $(HOST_DBUS_DIR)/introspect.xml
 
 HOST_DBUS_GEN_INTROSPECT = \
-	$(HOST_DIR)/usr/bin/dbus-daemon --introspect > $(DBUS_HOST_INTROSPECT)
+	$(HOST_DIR)/bin/dbus-daemon --introspect > $(DBUS_HOST_INTROSPECT)
 
 HOST_DBUS_POST_INSTALL_HOOKS += HOST_DBUS_GEN_INTROSPECT
 
package/directfb/directfb.mk +2 -2
index a27d6a736b..5723151b14 100644
@@ -164,10 +164,10 @@ HOST_DIRECTFB_BUILD_CMDS = \
 	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/tools directfb-csource
 
 HOST_DIRECTFB_INSTALL_CMDS = \
-	$(INSTALL) -m 0755 $(@D)/tools/directfb-csource $(HOST_DIR)/usr/bin
+	$(INSTALL) -m 0755 $(@D)/tools/directfb-csource $(HOST_DIR)/bin
 
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
 
 # directfb-csource for the host
-DIRECTFB_HOST_BINARY = $(HOST_DIR)/usr/bin/directfb-csource
+DIRECTFB_HOST_BINARY = $(HOST_DIR)/bin/directfb-csource
package/docker-containerd/docker-containerd.mk +1 -1
index c0b0012854..e89d9fede4 100644
@@ -33,7 +33,7 @@ endef
 
 define DOCKER_CONTAINERD_BUILD_CMDS
 	$(foreach d,ctr containerd containerd-shim,\
-		cd $(@D); $(DOCKER_CONTAINERD_MAKE_ENV) $(HOST_DIR)/usr/bin/go build \
+		cd $(@D); $(DOCKER_CONTAINERD_MAKE_ENV) $(HOST_DIR)/bin/go build \
 			-v -o $(@D)/bin/$(d) -ldflags "$(DOCKER_CONTAINERD_GLDFLAGS)" ./$(d)$(sep))
 endef
 
package/docker-engine/docker-engine.mk +1 -1
index 5101702045..49970120a4 100644
@@ -101,7 +101,7 @@ endif
 define DOCKER_ENGINE_BUILD_CMDS
 	$(foreach target,$(DOCKER_ENGINE_BUILD_TARGETS), \
 		cd $(@D); $(DOCKER_ENGINE_MAKE_ENV) \
-		$(HOST_DIR)/usr/bin/go build -v \
+		$(HOST_DIR)/bin/go build -v \
 			-o $(@D)/bin/$(target) \
 			-tags "$(DOCKER_ENGINE_BUILD_TAGS)" \
 			-ldflags "$(DOCKER_ENGINE_GLDFLAGS) $(DOCKER_ENGINE_GLDFLAGS_$(call UPPERCASE,$(target)))" \
package/efl/efl.mk +8 -8
index 364400035b..466ea3d9f1 100644
@@ -31,13 +31,13 @@ EFL_DEPENDENCIES = host-pkgconf host-efl host-luajit dbus freetype \
 # --enable-liblz4: use liblz4 from lz4 package.
 # --with-doxygen: disable doxygen documentation
 EFL_CONF_OPTS = \
-	--with-edje-cc=$(HOST_DIR)/usr/bin/edje_cc \
-	--with-eet-eet=$(HOST_DIR)/usr/bin/eet \
-	--with-eldbus_codegen=$(HOST_DIR)/usr/bin/eldbus-codegen \
-	--with-elementary-codegen=$(HOST_DIR)/usr/bin/elementary_codegen \
-	--with-elm-prefs-cc=$(HOST_DIR)/usr/bin/elm_prefs_cc \
-	--with-elua=$(HOST_DIR)/usr/bin/elua \
-	--with-eolian-gen=$(HOST_DIR)/usr/bin/eolian_gen \
+	--with-edje-cc=$(HOST_DIR)/bin/edje_cc \
+	--with-eet-eet=$(HOST_DIR)/bin/eet \
+	--with-eldbus_codegen=$(HOST_DIR)/bin/eldbus-codegen \
+	--with-elementary-codegen=$(HOST_DIR)/bin/elementary_codegen \
+	--with-elm-prefs-cc=$(HOST_DIR)/bin/elm_prefs_cc \
+	--with-elua=$(HOST_DIR)/bin/elua \
+	--with-eolian-gen=$(HOST_DIR)/bin/eolian_gen \
 	--disable-image-loader-jp2k \
 	--disable-lua-old \
 	--disable-poppler \
@@ -55,7 +55,7 @@ endif
 
 ifeq ($(BR2_PACKAGE_EFL_EOLIAN_CPP),y)
 EFL_CONF_OPTS += --enable-cxx-bindings \
-	--with-eolian-cxx=$(HOST_DIR)/usr/bin/eolian_cxx
+	--with-eolian-cxx=$(HOST_DIR)/bin/eolian_cxx
 else
 EFL_CONF_OPTS += --disable-cxx-bindings
 endif
package/elftosb/elftosb.mk +3 -3
index a24e5159fd..44eb98c8ad 100644
@@ -14,9 +14,9 @@ define HOST_ELFTOSB_BUILD_CMDS
 endef
 
 define HOST_ELFTOSB_INSTALL_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/bld/linux/elftosb $(HOST_DIR)/usr/bin/elftosb
-	$(INSTALL) -D -m 0755 $(@D)/bld/linux/keygen $(HOST_DIR)/usr/bin/keygen
-	$(INSTALL) -D -m 0755 $(@D)/bld/linux/sbtool $(HOST_DIR)/usr/bin/sbtool
+	$(INSTALL) -D -m 0755 $(@D)/bld/linux/elftosb $(HOST_DIR)/bin/elftosb
+	$(INSTALL) -D -m 0755 $(@D)/bld/linux/keygen $(HOST_DIR)/bin/keygen
+	$(INSTALL) -D -m 0755 $(@D)/bld/linux/sbtool $(HOST_DIR)/bin/sbtool
 endef
 
 $(eval $(host-generic-package))
package/enlightenment/enlightenment.mk +3 -3
index 7bfc25b3a2..6a08ca4097 100644
@@ -17,9 +17,9 @@ ENLIGHTENMENT_DEPENDENCIES = \
 	xcb-util-keysyms
 
 ENLIGHTENMENT_CONF_OPTS = \
-	--with-edje-cc=$(HOST_DIR)/usr/bin/edje_cc \
-	--with-eet-eet=$(HOST_DIR)/usr/bin/eet \
-	--with-eldbus_codegen=$(HOST_DIR)/usr/bin/eldbus-codegen \
+	--with-edje-cc=$(HOST_DIR)/bin/edje_cc \
+	--with-eet-eet=$(HOST_DIR)/bin/eet \
+	--with-eldbus_codegen=$(HOST_DIR)/bin/eldbus-codegen \
 	--disable-pam \
 	--disable-rpath
 
package/erlang-rebar/erlang-rebar.mk +1 -1
index 031ff47460..ce082dc639 100644
@@ -25,7 +25,7 @@ define HOST_ERLANG_REBAR_BUILD_CMDS
 endef
 
 define HOST_ERLANG_REBAR_INSTALL_CMDS
-	$(INSTALL) -m 0755 -D $(@D)/rebar $(HOST_DIR)/usr/bin/rebar
+	$(INSTALL) -m 0755 -D $(@D)/rebar $(HOST_DIR)/bin/rebar
 endef
 
 $(eval $(host-generic-package))
package/fakedate/fakedate.mk +2 -2
index f47a5ee38c..bba81f928b 100644
@@ -8,8 +8,8 @@
 HOST_FAKEDATE_LICENSE = GPL-2.0+
 
 define HOST_FAKEDATE_INSTALL_CMDS
-	$(INSTALL) -D -m 755 package/fakedate/fakedate $(HOST_DIR)/usr/bin/fakedate
-	ln -sfn fakedate $(HOST_DIR)/usr/bin/date
+	$(INSTALL) -D -m 755 package/fakedate/fakedate $(HOST_DIR)/bin/fakedate
+	ln -sfn fakedate $(HOST_DIR)/bin/date
 endef
 
 $(eval $(host-generic-package))
package/flannel/flannel.mk +1 -1
index 8393c5992a..bbb2c72a72 100644
@@ -33,7 +33,7 @@ define FLANNEL_CONFIGURE_CMDS
 endef
 
 define FLANNEL_BUILD_CMDS
-	cd $(@D) && $(FLANNEL_MAKE_ENV) $(HOST_DIR)/usr/bin/go \
+	cd $(@D) && $(FLANNEL_MAKE_ENV) $(HOST_DIR)/bin/go \
 		build -v -o $(@D)/bin/flanneld -ldflags "$(FLANNEL_GLDFLAGS)" .
 endef
 
package/gcc/gcc.mk +1 -1
index b52f9456b3..bdeb956972 100644
@@ -333,7 +333,7 @@ endif # BR2_CCACHE
 # Avoid that a .br_real is symlinked a second time.
 # Also create <arch>-linux-<tool> symlinks.
 define HOST_GCC_INSTALL_WRAPPER_AND_SIMPLE_SYMLINKS
-	$(Q)cd $(HOST_DIR)/usr/bin; \
+	$(Q)cd $(HOST_DIR)/bin; \
 	for i in $(GNU_TARGET_NAME)-*; do \
 		case "$$i" in \
 		*.br_real) \
package/gdb/gdb.mk +2 -2
index 9a97cb77a7..9b4d50e9d8 100644
@@ -210,7 +210,7 @@ HOST_GDB_CONF_OPTS += --disable-tui
 endif
 
 ifeq ($(BR2_PACKAGE_HOST_GDB_PYTHON),y)
-HOST_GDB_CONF_OPTS += --with-python=$(HOST_DIR)/usr/bin/python2
+HOST_GDB_CONF_OPTS += --with-python=$(HOST_DIR)/bin/python2
 HOST_GDB_DEPENDENCIES += host-python
 else
 HOST_GDB_CONF_OPTS += --without-python
@@ -232,7 +232,7 @@ endif
 
 # legacy $arch-linux-gdb symlink
 define HOST_GDB_ADD_SYMLINK
-	cd $(HOST_DIR)/usr/bin && \
+	cd $(HOST_DIR)/bin && \
 		ln -snf $(GNU_TARGET_NAME)-gdb $(ARCH)-linux-gdb
 endef
 
package/gdk-pixbuf/gdk-pixbuf.mk +1 -1
index a060f82222..688688316b 100644
@@ -59,7 +59,7 @@ endif
 ifeq ($(BR2_STATIC_LIBS),)
 define GDK_PIXBUF_UPDATE_CACHE
 	GDK_PIXBUF_MODULEDIR=$(HOST_DIR)/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders \
-		$(HOST_DIR)/usr/bin/gdk-pixbuf-query-loaders \
+		$(HOST_DIR)/bin/gdk-pixbuf-query-loaders \
 		> $(TARGET_DIR)/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
 	$(SED) "s,$(HOST_DIR),,g" \
 		$(TARGET_DIR)/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
package/gettext/gettext.mk +2 -2
index b6663a6f21..c2971a70d9 100644
@@ -71,7 +71,7 @@ endif
 
 # Disable interactive confirmation in host gettextize for package fixups
 define HOST_GETTEXT_GETTEXTIZE_CONFIRMATION
-	$(SED) '/read dummy/d' $(HOST_DIR)/usr/bin/gettextize
+	$(SED) '/read dummy/d' $(HOST_DIR)/bin/gettextize
 endef
 HOST_GETTEXT_POST_INSTALL_HOOKS += HOST_GETTEXT_GETTEXTIZE_CONFIRMATION
 
@@ -85,7 +85,7 @@ endef
 
 HOST_GETTEXT_POST_INSTALL_HOOKS += HOST_GETTEXT_ADD_ABOUT_NLS
 
-GETTEXTIZE = $(HOST_CONFIGURE_OPTS) AUTOM4TE=$(HOST_DIR)/usr/bin/autom4te $(HOST_DIR)/usr/bin/gettextize -f
+GETTEXTIZE = $(HOST_CONFIGURE_OPTS) AUTOM4TE=$(HOST_DIR)/bin/autom4te $(HOST_DIR)/bin/gettextize -f
 
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
package/go/go.mk +2 -2
index a461342581..0bbf9430b0 100644
@@ -99,8 +99,8 @@ define HOST_GO_INSTALL_CMDS
 	$(INSTALL) -D -m 0755 $(HOST_GO_TMP)/bin/go $(HOST_GO_ROOT)/bin/go
 	$(INSTALL) -D -m 0755 $(HOST_GO_TMP)/bin/gofmt $(HOST_GO_ROOT)/bin/gofmt
 
-	ln -sf ../lib/go/bin/go $(HOST_DIR)/usr/bin/
-	ln -sf ../lib/go/bin/gofmt $(HOST_DIR)/usr/bin/
+	ln -sf ../lib/go/bin/go $(HOST_DIR)/bin/
+	ln -sf ../lib/go/bin/gofmt $(HOST_DIR)/bin/
 
 	cp -a $(@D)/lib $(HOST_GO_ROOT)/
 
package/gob2/gob2.mk +1 -1
index 04d02e115c..fe60673821 100644
@@ -12,4 +12,4 @@ HOST_GOB2_DEPENDENCIES = host-bison host-flex host-libglib2
 $(eval $(host-autotools-package))
 
 # gob2 for the host
-GOB2_HOST_BINARY = $(HOST_DIR)/usr/bin/gob2
+GOB2_HOST_BINARY = $(HOST_DIR)/bin/gob2
package/gtest/gtest.mk +1 -1
index 9e6914109a..c82287e501 100644
@@ -77,7 +77,7 @@ endif
 
 define HOST_GTEST_INSTALL_CMDS
 	$(INSTALL) -D -m 0755 $(@D)/googlemock/scripts/generator/gmock_gen.py \
-		$(HOST_DIR)/usr/bin/gmock_gen
+		$(HOST_DIR)/bin/gmock_gen
 	cp -rp $(@D)/googlemock/scripts/generator/cpp \
 		$(HOST_GTEST_GMOCK_PYTHONPATH)
 endef
package/guile/guile.mk +1 -1
index 2ccd8e63b5..dfecb10c39 100644
@@ -47,7 +47,7 @@ else
 GUILE_CONF_OPTS += --without-libreadline-prefix
 endif
 
-GUILE_CONF_ENV += GUILE_FOR_BUILD=$(HOST_DIR)/usr/bin/guile \
+GUILE_CONF_ENV += GUILE_FOR_BUILD=$(HOST_DIR)/bin/guile \
 	CFLAGS="$(TARGET_CFLAGS) $(GUILE_CFLAGS)"
 
 GUILE_CONF_OPTS += \
package/gvfs/gvfs.mk +1 -1
index d6211fdc6d..4be655429b 100644
@@ -128,7 +128,7 @@ define GVFS_REMOVE_TARGET_SCHEMAS
 endef
 
 define GVFS_COMPILE_SCHEMAS
-	$(HOST_DIR)/usr/bin/glib-compile-schemas --targetdir=$(TARGET_DIR)/usr/share/glib-2.0/schemas $(STAGING_DIR)/usr/share/glib-2.0/schemas
+	$(HOST_DIR)/bin/glib-compile-schemas --targetdir=$(TARGET_DIR)/usr/share/glib-2.0/schemas $(STAGING_DIR)/usr/share/glib-2.0/schemas
 endef
 
 GVFS_POST_INSTALL_TARGET_HOOKS += \
package/heimdal/heimdal.mk +2 -2
index d81973195a..1658740839 100644
@@ -31,8 +31,8 @@ HEIMDAL_LICENSE_FILES = LICENSE
 # We need asn1_compile in the PATH for samba4
 define HOST_HEIMDAL_MAKE_SYMLINK
 	ln -sf $(HOST_DIR)/usr/libexec/heimdal/asn1_compile \
-		$(HOST_DIR)/usr/bin/asn1_compile
-	ln -sf $(HOST_DIR)/usr/bin/compile_et \
+		$(HOST_DIR)/bin/asn1_compile
+	ln -sf $(HOST_DIR)/bin/compile_et \
 		$(HOST_DIR)/usr/libexec/heimdal/compile_et
 endef
 
package/i2c-tools/i2c-tools.mk +2 -2
index 1995ca22cb..134f51ddf6 100644
@@ -32,14 +32,14 @@ I2C_TOOLS_PYTHON_BASE_ENV = \
 define I2C_TOOLS_BUILD_PYSMBUS
 	(cd $(@D)/py-smbus;  \
 	$(I2C_TOOLS_PYTHON_BASE_ENV) \
-		$(HOST_DIR)/usr/bin/python setup.py build \
+		$(HOST_DIR)/bin/python setup.py build \
 		$(PKG_PYTHON_DISTUTILS_BUILD_OPTS))
 endef
 
 define I2C_TOOLS_INSTALL_PYSMBUS
 	(cd $(@D)/py-smbus; \
 	$(I2C_TOOLS_PYTHON_BASE_ENV) \
-		$(HOST_DIR)/usr/bin/python setup.py install \
+		$(HOST_DIR)/bin/python setup.py install \
 		$(PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS))
 endef
 
package/iw/iw.mk +1 -1
index faff5fc717..aa85cbb5b9 100644
@@ -13,7 +13,7 @@ IW_DEPENDENCIES = host-pkgconf libnl
 IW_MAKE_OPTS = CC="$(TARGET_CC)" LD="$(TARGET_LD)" LDFLAGS="$(TARGET_LDFLAGS)"
 IW_MAKE_ENV = \
 	$(TARGET_MAKE_ENV) \
-	PKG_CONFIG="$(HOST_DIR)/usr/bin/pkg-config" \
+	PKG_CONFIG="$(HOST_DIR)/bin/pkg-config" \
 	GIT_DIR=$(IW_DIR)
 
 define IW_BUILD_CMDS
package/jsmin/jsmin.mk +1 -1
index a66ba71582..84c39a7b42 100644
@@ -22,7 +22,7 @@ define HOST_JSMIN_BUILD_CMDS
 endef
 
 define HOST_JSMIN_INSTALL_CMDS
-	$(INSTALL) -m 0755 -D $(@D)/jsmin $(HOST_DIR)/usr/bin/jsmin
+	$(INSTALL) -m 0755 -D $(@D)/jsmin $(HOST_DIR)/bin/jsmin
 endef
 
 $(eval $(generic-package))
package/libglib2/libglib2.mk +3 -3
index 47d9f6313e..25132ff6ba 100644
@@ -65,7 +65,7 @@ LIBGLIB2_CONF_ENV = \
 	jm_cv_func_working_re_compile_pattern=yes \
 	ac_use_included_regex=no \
 	gl_cv_c_restrict=no \
-	ac_cv_path_GLIB_GENMARSHAL=$(HOST_DIR)/usr/bin/glib-genmarshal \
+	ac_cv_path_GLIB_GENMARSHAL=$(HOST_DIR)/bin/glib-genmarshal \
 	ac_cv_prog_F77=no \
 	ac_cv_func_posix_getgrgid_r=no \
 	glib_cv_long_long_format=ll \
@@ -160,7 +160,7 @@ endef
 # them as well, and better do it in a central place.
 # It's used at run time so it doesn't matter defering it.
 define LIBGLIB2_COMPILE_SCHEMAS
-	$(HOST_DIR)/usr/bin/glib-compile-schemas \
+	$(HOST_DIR)/bin/glib-compile-schemas \
 		$(STAGING_DIR)/usr/share/glib-2.0/schemas \
 		--targetdir=$(TARGET_DIR)/usr/share/glib-2.0/schemas
 endef
@@ -171,4 +171,4 @@ LIBGLIB2_TARGET_FINALIZE_HOOKS += LIBGLIB2_COMPILE_SCHEMAS
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
 
-LIBGLIB2_HOST_BINARY = $(HOST_DIR)/usr/bin/glib-genmarshal
+LIBGLIB2_HOST_BINARY = $(HOST_DIR)/bin/glib-genmarshal
package/libgtk2/libgtk2.mk +3 -3
index 83f69ac3e8..0b26d7205b 100644
@@ -15,8 +15,8 @@ LIBGTK2_LICENSE_FILES = COPYING
 LIBGTK2_AUTORECONF = YES
 
 LIBGTK2_CONF_ENV = \
-	ac_cv_path_GTK_UPDATE_ICON_CACHE=$(HOST_DIR)/usr/bin/gtk-update-icon-cache \
-	ac_cv_path_GDK_PIXBUF_CSOURCE=$(HOST_DIR)/usr/bin/gdk-pixbuf-csource \
+	ac_cv_path_GTK_UPDATE_ICON_CACHE=$(HOST_DIR)/bin/gtk-update-icon-cache \
+	ac_cv_path_GDK_PIXBUF_CSOURCE=$(HOST_DIR)/bin/gdk-pixbuf-csource \
 	DB2HTML=false
 
 LIBGTK2_CONF_OPTS = --disable-glibtest --enable-explicit-deps=no
@@ -120,7 +120,7 @@ define HOST_LIBGTK2_BUILD_CMDS
 endef
 
 define HOST_LIBGTK2_INSTALL_CMDS
-	cp $(@D)/gtk/gtk-update-icon-cache $(HOST_DIR)/usr/bin
+	cp $(@D)/gtk/gtk-update-icon-cache $(HOST_DIR)/bin
 endef
 
 $(eval $(autotools-package))
package/libgtk3/libgtk3.mk +9 -9
index ed843fc29a..1f3c0a4d7c 100644
@@ -14,9 +14,9 @@ LIBGTK3_INSTALL_STAGING = YES
 LIBGTK3_AUTORECONF = YES
 
 LIBGTK3_CONF_ENV = \
-	ac_cv_path_GTK_UPDATE_ICON_CACHE=$(HOST_DIR)/usr/bin/gtk-update-icon-cache \
-	ac_cv_path_GDK_PIXBUF_CSOURCE=$(HOST_DIR)/usr/bin/gdk-pixbuf-csource \
-	PKG_CONFIG_FOR_BUILD=$(HOST_DIR)/usr/bin/pkgconf
+	ac_cv_path_GTK_UPDATE_ICON_CACHE=$(HOST_DIR)/bin/gtk-update-icon-cache \
+	ac_cv_path_GDK_PIXBUF_CSOURCE=$(HOST_DIR)/bin/gdk-pixbuf-csource \
+	PKG_CONFIG_FOR_BUILD=$(HOST_DIR)/bin/pkgconf
 
 LIBGTK3_CONF_OPTS = \
 	--disable-glibtest \
@@ -123,7 +123,7 @@ LIBGTK3_CONF_OPTS += --disable-installed-tests
 endif
 
 define LIBGTK3_COMPILE_GLIB_SCHEMAS
-	$(HOST_DIR)/usr/bin/glib-compile-schemas \
+	$(HOST_DIR)/bin/glib-compile-schemas \
 		$(TARGET_DIR)/usr/share/glib-2.0/schemas
 endef
 
@@ -151,8 +151,8 @@ HOST_LIBGTK3_DEPENDENCIES = \
 	host-librsvg
 
 HOST_LIBGTK3_CFLAGS = \
-	`$(HOST_DIR)/usr/bin/pkgconf --cflags --libs gdk-pixbuf-2.0` \
-	`$(HOST_DIR)/usr/bin/pkgconf --cflags --libs gio-2.0`
+	`$(HOST_DIR)/bin/pkgconf --cflags --libs gdk-pixbuf-2.0` \
+	`$(HOST_DIR)/bin/pkgconf --cflags --libs gio-2.0`
 
 define HOST_LIBGTK3_CONFIGURE_CMDS
 	echo "#define GETTEXT_PACKAGE \"gtk30\"" >> $(@D)/gtk/config.h
@@ -173,16 +173,16 @@ endef
 
 define HOST_LIBGTK3_INSTALL_CMDS
 	$(INSTALL) -D -m 0755 $(@D)/gtk/gtk-update-icon-cache \
-		$(HOST_DIR)/usr/bin/gtk-update-icon-cache
+		$(HOST_DIR)/bin/gtk-update-icon-cache
 	$(INSTALL) -D -m 0755 $(@D)/gtk/gtk-encode-symbolic-svg \
-		$(HOST_DIR)/usr/bin/gtk-encode-symbolic-svg
+		$(HOST_DIR)/bin/gtk-encode-symbolic-svg
 endef
 
 # Create icon-theme.cache for each of the icon directories/themes
 # It's not strictly necessary but speeds up lookups
 define LIBGTK3_UPDATE_ICON_CACHE
 	find $(TARGET_DIR)/usr/share/icons -maxdepth 1 -mindepth 1 -type d \
-		-exec $(HOST_DIR)/usr/bin/gtk-update-icon-cache {} \;
+		-exec $(HOST_DIR)/bin/gtk-update-icon-cache {} \;
 endef
 LIBGTK3_TARGET_FINALIZE_HOOKS += LIBGTK3_UPDATE_ICON_CACHE
 
package/libiio/libiio.mk +2 -2
index 35eb23d00f..194880d8cd 100644
@@ -69,11 +69,11 @@ endif
 ifeq ($(BR2_PACKAGE_LIBIIO_BINDINGS_CSHARP),y)
 define LIBIIO_INSTALL_CSHARP_BINDINGS_TO_TARGET
 	rm $(TARGET_DIR)/usr/lib/cli/libiio-sharp-$(LIBIIO_VERSION)/libiio-sharp.dll.mdb
-	$(HOST_DIR)/usr/bin/gacutil -root $(TARGET_DIR)/usr/lib -i \
+	$(HOST_DIR)/bin/gacutil -root $(TARGET_DIR)/usr/lib -i \
 		$(TARGET_DIR)/usr/lib/cli/libiio-sharp-$(LIBIIO_VERSION)/libiio-sharp.dll
 endef
 define LIBIIO_INSTALL_CSHARP_BINDINGS_TO_STAGING
-	$(HOST_DIR)/usr/bin/gacutil -root $(STAGING_DIR)/usr/lib -i \
+	$(HOST_DIR)/bin/gacutil -root $(STAGING_DIR)/usr/lib -i \
 		$(STAGING_DIR)/usr/lib/cli/libiio-sharp-$(LIBIIO_VERSION)/libiio-sharp.dll
 endef
 LIBIIO_POST_INSTALL_TARGET_HOOKS += LIBIIO_INSTALL_CSHARP_BINDINGS_TO_TARGET
package/libtool/libtool.mk +2 -2
index b1a4f48d1d..bf97ee12b5 100644
@@ -41,5 +41,5 @@ $(eval $(autotools-package))
 $(eval $(host-autotools-package))
 
 # variables used by other packages
-LIBTOOL = $(HOST_DIR)/usr/bin/libtool
-LIBTOOLIZE = $(HOST_DIR)/usr/bin/libtoolize
+LIBTOOL = $(HOST_DIR)/bin/libtool
+LIBTOOLIZE = $(HOST_DIR)/bin/libtoolize
package/libv4l/libv4l.mk +3 -3
index 465f6ccb6c..b8e291a623 100644
@@ -61,9 +61,9 @@ LIBV4L_CONF_OPTS += --enable-qv4l2
 LIBV4L_DEPENDENCIES += qt5base
 # protect against host version detection of moc-qt5/rcc-qt5/uic-qt5
 LIBV4L_CONF_ENV += \
-	ac_cv_prog_MOC=$(HOST_DIR)/usr/bin/moc \
-	ac_cv_prog_RCC=$(HOST_DIR)/usr/bin/rcc \
-	ac_cv_prog_UIC=$(HOST_DIR)/usr/bin/uic
+	ac_cv_prog_MOC=$(HOST_DIR)/bin/moc \
+	ac_cv_prog_RCC=$(HOST_DIR)/bin/rcc \
+	ac_cv_prog_UIC=$(HOST_DIR)/bin/uic
 # qt5 needs c++11 (since qt-5.7)
 ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
 LIBV4L_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11"
package/libxml2/libxml2.mk +1 -1
index 2a7153ad17..7073169fde 100644
@@ -49,4 +49,4 @@ $(eval $(autotools-package))
 $(eval $(host-autotools-package))
 
 # libxml2 for the host
-LIBXML2_HOST_BINARY = $(HOST_DIR)/usr/bin/xmllint
+LIBXML2_HOST_BINARY = $(HOST_DIR)/bin/xmllint
package/libxmlrpc/libxmlrpc.mk +1 -1
index 135c5f64f1..80acfb8eaa 100644
@@ -16,7 +16,7 @@ LIBXMLRPC_MAKE = $(MAKE1)
 
 # Using autoconf, not automake, so we cannot use AUTORECONF = YES.
 define LIBXMLRPC_RUN_AUTOCONF
-	cd $(@D); $(HOST_DIR)/usr/bin/autoconf
+	cd $(@D); $(HOST_DIR)/bin/autoconf
 endef
 
 LIBXMLRPC_PRE_CONFIGURE_HOOKS += LIBXMLRPC_RUN_AUTOCONF
package/localedef/localedef.mk +1 -1
index 1fe431aac0..11d9ba3848 100644
@@ -16,7 +16,7 @@ HOST_LOCALEDEF_CONF_ENV = CFLAGS="$(HOST_CFLAGS) -fgnu89-inline"
 
 # The makefile does not implement an install target
 define HOST_LOCALEDEF_INSTALL_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/localedef $(HOST_DIR)/usr/bin/localedef
+	$(INSTALL) -D -m 0755 $(@D)/localedef $(HOST_DIR)/bin/localedef
 endef
 
 $(eval $(host-autotools-package))
package/lpc3250loader/lpc3250loader.mk +1 -1
index 1a02235e3c..ee153fefd9 100644
@@ -11,7 +11,7 @@ LPC3250LOADER_LICENSE_FILES = LPC3250loader.py
 
 define HOST_LPC3250LOADER_INSTALL_CMDS
 	$(INSTALL) -m 0755 -D $(@D)/LPC3250loader.py \
-		$(HOST_DIR)/usr/bin/LPC3250loader.py
+		$(HOST_DIR)/bin/LPC3250loader.py
 endef
 
 $(eval $(host-generic-package))
package/luainterpreter/luainterpreter.mk +1 -1
index 90382fa78f..cb1d5dde18 100644
@@ -20,4 +20,4 @@ endif
 $(eval $(virtual-package))
 $(eval $(host-virtual-package))
 
-LUA_RUN = $(HOST_DIR)/usr/bin/$(call qstrip,$(BR2_PACKAGE_PROVIDES_LUAINTERPRETER))
+LUA_RUN = $(HOST_DIR)/bin/$(call qstrip,$(BR2_PACKAGE_PROVIDES_LUAINTERPRETER))
package/luarocks/luarocks.mk +1 -1
index 646e43b668..cf449ac52c 100644
@@ -54,7 +54,7 @@ endef
 $(eval $(host-generic-package))
 
 LUAROCKS_RUN_ENV = LUA_PATH="$(HOST_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/?.lua"
-LUAROCKS_RUN_CMD = $(LUA_RUN) $(HOST_DIR)/usr/bin/luarocks
+LUAROCKS_RUN_CMD = $(LUA_RUN) $(HOST_DIR)/bin/luarocks
 
 define LUAROCKS_FINALIZE_TARGET
 	rm -rf $(TARGET_DIR)/usr/lib/luarocks
package/lzma/lzma.mk +1 -1
index 90f0771780..1b4d7febb1 100644
@@ -10,4 +10,4 @@ LZMA_SITE = http://tukaani.org/lzma
 
 $(eval $(host-autotools-package))
 
-LZMA = $(HOST_DIR)/usr/bin/lzma
+LZMA = $(HOST_DIR)/bin/lzma
package/lzop/lzop.mk +1 -1
index 14d417f604..55157c4d48 100644
@@ -14,4 +14,4 @@ HOST_LZOP_DEPENDENCIES = host-lzo
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
 
-LZOP = $(HOST_DIR)/usr/bin/lzop
+LZOP = $(HOST_DIR)/bin/lzop
package/makedevs/makedevs.mk +1 -1
index 3e78892163..36837a191e 100644
@@ -21,7 +21,7 @@ define HOST_MAKEDEVS_BUILD_CMDS
 endef
 
 define HOST_MAKEDEVS_INSTALL_CMDS
-	$(INSTALL) -D -m 755 $(@D)/makedevs $(HOST_DIR)/usr/bin/makedevs
+	$(INSTALL) -D -m 755 $(@D)/makedevs $(HOST_DIR)/bin/makedevs
 endef
 
 $(eval $(host-generic-package))
package/mfgtools/mfgtools.mk +1 -1
index a1a1fb3ef8..e37c4dc719 100644
@@ -28,7 +28,7 @@ define HOST_MFGTOOLS_INSTALL_CMDS
 	$(INSTALL) -D -m 755 $(@D)/MfgToolLib/libMfgToolLib.so \
 		$(HOST_DIR)/usr/lib/libMfgToolLib.so
 	$(INSTALL) -D -m 755 $(@D)/TestPrgm/mfgtoolcli \
-		$(HOST_DIR)/usr/bin/mfgtoolcli
+		$(HOST_DIR)/bin/mfgtoolcli
 endef
 
 $(eval $(host-cmake-package))
package/mke2img/mke2img.mk +1 -1
index 9de387a3a3..f09b0106c5 100644
@@ -7,7 +7,7 @@
 HOST_MKE2IMG_DEPENDENCIES = host-genext2fs host-e2fsprogs
 
 define HOST_MKE2IMG_INSTALL_CMDS
-	$(INSTALL) -D -m 0755 package/mke2img/mke2img $(HOST_DIR)/usr/bin/mke2img
+	$(INSTALL) -D -m 0755 package/mke2img/mke2img $(HOST_DIR)/bin/mke2img
 endef
 
 $(eval $(host-generic-package))
package/mkpasswd/mkpasswd.mk +2 -2
index ba4bd29c38..b013390572 100644
@@ -16,9 +16,9 @@ define HOST_MKPASSWD_BUILD_CMDS
 endef
 
 define HOST_MKPASSWD_INSTALL_CMDS
-	$(INSTALL) -D -m 755 $(@D)/mkpasswd $(HOST_DIR)/usr/bin/mkpasswd
+	$(INSTALL) -D -m 755 $(@D)/mkpasswd $(HOST_DIR)/bin/mkpasswd
 endef
 
 $(eval $(host-generic-package))
 
-MKPASSWD = $(HOST_DIR)/usr/bin/mkpasswd
+MKPASSWD = $(HOST_DIR)/bin/mkpasswd
package/mkpimage/mkpimage.mk +1 -1
index bba2eb4077..8e08013f91 100644
@@ -15,7 +15,7 @@ define HOST_MKPIMAGE_BUILD_CMDS
 endef
 
 define HOST_MKPIMAGE_INSTALL_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/mkpimage $(HOST_DIR)/usr/bin/mkpimage
+	$(INSTALL) -D -m 0755 $(@D)/mkpimage $(HOST_DIR)/bin/mkpimage
 endef
 
 $(eval $(host-generic-package))
package/moarvm/moarvm.mk +1 -1
index f88c6f9c0b..82467ab403 100644
@@ -20,7 +20,7 @@ MOARVM_CONF_OPTS = \
 	--ld="$(TARGET_CC)" \
 	--prefix="/usr" \
 	--pkgconfig=$(PKG_CONFIG_HOST_BINARY) \
-	--lua=$(HOST_DIR)/usr/bin/luajit \
+	--lua=$(HOST_DIR)/bin/luajit \
 	--has-libuv \
 	--has-libtommath \
 	--has-libatomic
package/mono-gtksharp3/mono-gtksharp3.mk +1 -1
index 9ddf932631..126aabeda2 100644
@@ -12,6 +12,6 @@ MONO_GTKSHARP3_LICENSE = LGPL-2.0, MIT (cairo)
 MONO_GTKSHARP3_LICENSE_FILES = COPYING
 MONO_GTKSHARP3_INSTALL_STAGING = YES
 MONO_GTKSHARP3_DEPENDENCIES = mono libgtk3
-MONO_GTKSHARP3_CONF_OPTS += CSC=$(HOST_DIR)/usr/bin/mcs
+MONO_GTKSHARP3_CONF_OPTS += CSC=$(HOST_DIR)/bin/mcs
 
 $(eval $(autotools-package))
package/mplayer/mplayer.mk +1 -1
index 14ab8aceed..c0b3227a12 100644
@@ -297,7 +297,7 @@ endif
 ifeq ($(BR2_X86_CPU_HAS_MMX),y)
 MPLAYER_CONF_OPTS += \
 	--enable-mmx \
-	--yasm=$(HOST_DIR)/usr/bin/yasm
+	--yasm=$(HOST_DIR)/bin/yasm
 MPLAYER_DEPENDENCIES += host-yasm
 else
 MPLAYER_CONF_OPTS += \
package/mxsldr/mxsldr.mk +1 -1
index 07ef8da49b..239b40ad29 100644
@@ -15,7 +15,7 @@ define HOST_MXSLDR_BUILD_CMDS
 endef
 
 define HOST_MXSLDR_INSTALL_CMDS
-	$(INSTALL) -m 0755 -D $(@D)/mxsldr $(HOST_DIR)/usr/bin/mxsldr
+	$(INSTALL) -m 0755 -D $(@D)/mxsldr $(HOST_DIR)/bin/mxsldr
 endef
 
 $(eval $(host-generic-package))
package/ncftp/ncftp.mk +1 -1
index 11bfccaa25..7de1198589 100644
@@ -19,7 +19,7 @@ NCFTP_CONF_OPTS = --disable-ccdv
 # We need to pass -I because of the non-standard m4 directory name, and
 # none of the other autotools are used, so the below is the easiest.
 define NCFTP_RUN_AUTOCONF
-	(cd $(@D); $(HOST_DIR)/usr/bin/autoconf -I$(@D)/autoconf_local/)
+	(cd $(@D); $(HOST_DIR)/bin/autoconf -I$(@D)/autoconf_local/)
 endef
 NCFTP_PRE_CONFIGURE_HOOKS += NCFTP_RUN_AUTOCONF
 
package/ninja/ninja.mk +1 -1
index 3cfe4faf2b..b0655766ab 100644
@@ -16,7 +16,7 @@ define HOST_NINJA_BUILD_CMDS
 endef
 
 define HOST_NINJA_INSTALL_CMDS
-	$(INSTALL) -m 0755 -D $(@D)/ninja $(HOST_DIR)/usr/bin/ninja
+	$(INSTALL) -m 0755 -D $(@D)/ninja $(HOST_DIR)/bin/ninja
 endef
 
 $(eval $(host-generic-package))
package/nodejs/nodejs.mk +13 -13
index a9c96cad91..1472d5d220 100644
@@ -44,7 +44,7 @@ define HOST_NODEJS_CONFIGURE_CMDS
 	# The build system directly calls python. Work around this by forcing python2
 	# into PATH. See https://github.com/nodejs/node/issues/2735
 	mkdir -p $(@D)/bin
-	ln -sf $(HOST_DIR)/usr/bin/python2 $(@D)/bin/python
+	ln -sf $(HOST_DIR)/bin/python2 $(@D)/bin/python
 
 	# Build with the static, built-in OpenSSL which is supplied as part of
 	# the nodejs source distribution.  This is needed on the host because
@@ -53,8 +53,8 @@ define HOST_NODEJS_CONFIGURE_CMDS
 	(cd $(@D); \
 		$(HOST_CONFIGURE_OPTS) \
 		PATH=$(@D)/bin:$(BR_PATH) \
-		PYTHON=$(HOST_DIR)/usr/bin/python2 \
-		$(HOST_DIR)/usr/bin/python2 ./configure \
+		PYTHON=$(HOST_DIR)/bin/python2 \
+		$(HOST_DIR)/bin/python2 ./configure \
 		--prefix=$(HOST_DIR) \
 		--without-snapshot \
 		--without-dtrace \
@@ -65,19 +65,19 @@ define HOST_NODEJS_CONFIGURE_CMDS
 endef
 
 define HOST_NODEJS_BUILD_CMDS
-	$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/usr/bin/python2 \
+	$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python2 \
 		$(MAKE) -C $(@D) \
 		$(HOST_CONFIGURE_OPTS) \
 		PATH=$(@D)/bin:$(BR_PATH)
 endef
 
 define HOST_NODEJS_INSTALL_CMDS
-	$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/usr/bin/python2 \
+	$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python2 \
 		$(MAKE) -C $(@D) install \
 		$(HOST_CONFIGURE_OPTS) \
 		PATH=$(@D)/bin:$(BR_PATH)
 
-	$(INSTALL) -m755 -D $(@D)/out/Release/mkpeephole $(HOST_DIR)/usr/bin/mkpeephole
+	$(INSTALL) -m755 -D $(@D)/out/Release/mkpeephole $(HOST_DIR)/bin/mkpeephole
 endef
 
 ifeq ($(BR2_i386),y)
@@ -110,14 +110,14 @@ endif
 
 define NODEJS_CONFIGURE_CMDS
 	mkdir -p $(@D)/bin
-	ln -sf $(HOST_DIR)/usr/bin/python2 $(@D)/bin/python
+	ln -sf $(HOST_DIR)/bin/python2 $(@D)/bin/python
 
 	(cd $(@D); \
 		$(TARGET_CONFIGURE_OPTS) \
 		PATH=$(@D)/bin:$(BR_PATH) \
 		LD="$(TARGET_CXX)" \
-		PYTHON=$(HOST_DIR)/usr/bin/python2 \
-		$(HOST_DIR)/usr/bin/python2 ./configure \
+		PYTHON=$(HOST_DIR)/bin/python2 \
+		$(HOST_DIR)/bin/python2 ./configure \
 		--prefix=/usr \
 		--dest-cpu=$(NODEJS_CPU) \
 		$(if $(NODEJS_ARM_FP),--with-arm-float-abi=$(NODEJS_ARM_FP)) \
@@ -127,11 +127,11 @@ define NODEJS_CONFIGURE_CMDS
 	)
 
 	# use host version of mkpeephole
-	sed "s#<(mkpeephole_exec)#$(HOST_DIR)/usr/bin/mkpeephole#g" -i $(@D)/deps/v8/src/v8.gyp
+	sed "s#<(mkpeephole_exec)#$(HOST_DIR)/bin/mkpeephole#g" -i $(@D)/deps/v8/src/v8.gyp
 endef
 
 define NODEJS_BUILD_CMDS
-	$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/usr/bin/python2 \
+	$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python2 \
 		$(MAKE) -C $(@D) \
 		$(TARGET_CONFIGURE_OPTS) \
 		PATH=$(@D)/bin:$(BR_PATH) \
@@ -155,7 +155,7 @@ NPM = $(TARGET_CONFIGURE_OPTS) \
 	npm_config_build_from_source=true \
 	npm_config_nodedir=$(BUILD_DIR)/nodejs-$(NODEJS_VERSION) \
 	npm_config_prefix=$(TARGET_DIR)/usr \
-	$(HOST_DIR)/usr/bin/npm
+	$(HOST_DIR)/bin/npm
 
 #
 # We can only call NPM if there's something to install.
@@ -170,7 +170,7 @@ endef
 endif
 
 define NODEJS_INSTALL_TARGET_CMDS
-	$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/usr/bin/python2 \
+	$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python2 \
 		$(MAKE) -C $(@D) install \
 		DESTDIR=$(TARGET_DIR) \
 		$(TARGET_CONFIGURE_OPTS) \
package/ola/ola.mk +2 -2
index 251dda331e..be0700dbe4 100644
@@ -22,7 +22,7 @@ OLA_CONF_OPTS = \
 	--disable-root-check \
 	--disable-java-libs \
 	--disable-fatal-warnings \
-	--with-ola-protoc-plugin=$(HOST_DIR)/usr/bin/ola_protoc_plugin
+	--with-ola-protoc-plugin=$(HOST_DIR)/bin/ola_protoc_plugin
 
 HOST_OLA_DEPENDENCIES = host-util-linux host-protobuf
 
@@ -46,7 +46,7 @@ HOST_OLA_CONF_OPTS = \
 # only.
 HOST_OLA_MAKE_OPTS = protoc/ola_protoc_plugin
 define HOST_OLA_INSTALL_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/protoc/ola_protoc_plugin $(HOST_DIR)/usr/bin/ola_protoc_plugin
+	$(INSTALL) -D -m 0755 $(@D)/protoc/ola_protoc_plugin $(HOST_DIR)/bin/ola_protoc_plugin
 endef
 
 # sets where to find python libs built for target and required by ola
package/omap-u-boot-utils/omap-u-boot-utils.mk +1 -1
index e2aeefa9f2..d68b1300bf 100644
@@ -15,7 +15,7 @@ endef
 
 define HOST_OMAP_U_BOOT_UTILS_INSTALL_CMDS
 	for f in gpsign pserial tagger ucmd ukermit ; do \
-		$(INSTALL) -D -m 755 $(@D)/$$f $(HOST_DIR)/usr/bin/$$f ; \
+		$(INSTALL) -D -m 755 $(@D)/$$f $(HOST_DIR)/bin/$$f ; \
 	done
 endef
 
package/omniorb/omniorb.mk +3 -3
index 103930f264..557e5d1613 100644
@@ -14,8 +14,8 @@ OMNIORB_DEPENDENCIES = host-omniorb
 HOST_OMNIORB_DEPENDENCIES = host-python
 
 # omniorb is not python3 friendly, so force the python interpreter
-OMNIORB_CONF_OPTS = ac_cv_path_PYTHON=$(HOST_DIR)/usr/bin/python2
-HOST_OMNIORB_CONF_OPTS = ac_cv_path_PYTHON=$(HOST_DIR)/usr/bin/python2
+OMNIORB_CONF_OPTS = ac_cv_path_PYTHON=$(HOST_DIR)/bin/python2
+HOST_OMNIORB_CONF_OPTS = ac_cv_path_PYTHON=$(HOST_DIR)/bin/python2
 
 # Defaulting long double support to a safe option for the
 # mix of embedded targets, this could later be automated
@@ -65,7 +65,7 @@ endif
 # cross compiled target OMNIORB application.
 define OMNIORB_ADJUST_TOOLDIR
 	# Point to the host folder to get HOST_OMNIORB tools
-	$(SED) 's:TOOLBINDIR = $$(TOP)/$$(BINDIR):TOOLBINDIR = $(HOST_DIR)/usr/bin:g' $(@D)/mk/beforeauto.mk
+	$(SED) 's:TOOLBINDIR = $$(TOP)/$$(BINDIR):TOOLBINDIR = $(HOST_DIR)/bin:g' $(@D)/mk/beforeauto.mk
 	# Disables OMNIORB app/service/tool building
 	echo "EmbeddedSystem=1" >> $(@D)/mk/beforeauto.mk
 endef
package/opencv3/opencv3.mk +2 -2
index 10e0dfef80..b8a0c78781 100644
@@ -321,7 +321,7 @@ ifeq ($(BR2_PACKAGE_PYTHON),y)
 OPENCV3_CONF_OPTS += \
 	-DBUILD_opencv_python2=ON \
 	-DBUILD_opencv_python3=OFF \
-	-DPYTHON2_EXECUTABLE=$(HOST_DIR)/usr/bin/python2 \
+	-DPYTHON2_EXECUTABLE=$(HOST_DIR)/bin/python2 \
 	-DPYTHON2_INCLUDE_PATH=$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR) \
 	-DPYTHON2_LIBRARIES=$(STAGING_DIR)/usr/lib/libpython$(PYTHON_VERSION_MAJOR).so \
 	-DPYTHON2_NUMPY_INCLUDE_DIRS=$(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/numpy/core/include \
@@ -332,7 +332,7 @@ else
 OPENCV3_CONF_OPTS += \
 	-DBUILD_opencv_python2=OFF \
 	-DBUILD_opencv_python3=ON \
-	-DPYTHON3_EXECUTABLE=$(HOST_DIR)/usr/bin/python3 \
+	-DPYTHON3_EXECUTABLE=$(HOST_DIR)/bin/python3 \
 	-DPYTHON3_INCLUDE_PATH=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)m \
 	-DPYTHON3_LIBRARIES=$(STAGING_DIR)/usr/lib/libpython$(PYTHON3_VERSION_MAJOR)m.so \
 	-DPYTHON3_NUMPY_INCLUDE_DIRS=$(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/numpy/core/include \
package/oracle-mysql/oracle-mysql.mk +1 -1
index 4307008d47..7da5c547d9 100644
@@ -58,7 +58,7 @@ define HOST_ORACLE_MYSQL_BUILD_CMDS
 endef
 
 define HOST_ORACLE_MYSQL_INSTALL_CMDS
-	$(INSTALL) -m 0755  $(@D)/sql/gen_lex_hash $(HOST_DIR)/usr/bin/
+	$(INSTALL) -m 0755  $(@D)/sql/gen_lex_hash $(HOST_DIR)/bin/
 endef
 
 ifeq ($(BR2_PACKAGE_OPENSSL),y)
package/php-amqp/php-amqp.mk +2 -2
index fe49f4ba09..6d04889ca7 100644
@@ -16,8 +16,8 @@ PHP_AMQP_LICENSE_FILES = LICENSE
 
 define PHP_AMQP_PHPIZE
 	(cd $(@D); \
-		PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \
-		PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \
+		PHP_AUTOCONF=$(HOST_DIR)/bin/autoconf \
+		PHP_AUTOHEADER=$(HOST_DIR)/bin/autoheader \
 		$(STAGING_DIR)/usr/bin/phpize)
 endef
 
package/php-geoip/php-geoip.mk +2 -2
index 8f4e3bf6d8..374df64120 100644
@@ -15,8 +15,8 @@ PHP_GEOIP_LICENSE_FILES = geoip.c
 
 define PHP_GEOIP_PHPIZE
 	(cd $(@D); \
-		PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \
-		PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \
+		PHP_AUTOCONF=$(HOST_DIR)/bin/autoconf \
+		PHP_AUTOHEADER=$(HOST_DIR)/bin/autoheader \
 		$(STAGING_DIR)/usr/bin/phpize)
 endef
 
package/php-gnupg/php-gnupg.mk +2 -2
index e595cd3fe5..84e6955071 100644
@@ -15,8 +15,8 @@ PHP_GNUPG_LICENSE_FILES = LICENSE
 
 define PHP_GNUPG_PHPIZE
 	(cd $(@D); \
-		PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \
-		PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \
+		PHP_AUTOCONF=$(HOST_DIR)/bin/autoconf \
+		PHP_AUTOHEADER=$(HOST_DIR)/bin/autoheader \
 		$(STAGING_DIR)/usr/bin/phpize)
 endef
 
package/php-imagick/php-imagick.mk +2 -2
index c8c2b85afe..5b99de0023 100644
@@ -16,8 +16,8 @@ PHP_IMAGICK_LICENSE_FILES = LICENSE
 
 define PHP_IMAGICK_PHPIZE
 	(cd $(@D); \
-		PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \
-		PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \
+		PHP_AUTOCONF=$(HOST_DIR)/bin/autoconf \
+		PHP_AUTOHEADER=$(HOST_DIR)/bin/autoheader \
 		$(STAGING_DIR)/usr/bin/phpize)
 endef
 
package/php-memcached/php-memcached.mk +2 -2
index c4b76365ed..9cd03ec03e 100644
@@ -17,8 +17,8 @@ PHP_MEMCACHED_LICENSE_FILES = LICENSE fastlz/LICENSE g_fmt.h
 
 define PHP_MEMCACHED_PHPIZE
 	(cd $(@D); \
-		PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \
-		PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \
+		PHP_AUTOCONF=$(HOST_DIR)/bin/autoconf \
+		PHP_AUTOHEADER=$(HOST_DIR)/bin/autoheader \
 		$(STAGING_DIR)/usr/bin/phpize)
 endef
 
package/php-ssh2/php-ssh2.mk +2 -2
index 931cde91c8..faf354a84c 100644
@@ -15,8 +15,8 @@ PHP_SSH2_LICENSE_FILES = LICENSE
 
 define PHP_SSH2_PHPIZE
 	(cd $(@D); \
-		PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \
-		PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \
+		PHP_AUTOCONF=$(HOST_DIR)/bin/autoconf \
+		PHP_AUTOHEADER=$(HOST_DIR)/bin/autoheader \
 		$(STAGING_DIR)/usr/bin/phpize)
 endef
 
package/php-yaml/php-yaml.mk +2 -2
index 27118906d4..84da60709e 100644
@@ -16,8 +16,8 @@ PHP_YAML_LICENSE_FILES = LICENSE
 
 define PHP_YAML_PHPIZE
 	(cd $(@D); \
-		PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \
-		PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \
+		PHP_AUTOCONF=$(HOST_DIR)/bin/autoconf \
+		PHP_AUTOHEADER=$(HOST_DIR)/bin/autoheader \
 		$(STAGING_DIR)/usr/bin/phpize)
 endef
 
package/php-zmq/php-zmq.mk +2 -2
index ba141139fb..fed71955b6 100644
@@ -15,8 +15,8 @@ PHP_ZMQ_LICENSE_FILES = LICENSE
 
 define PHP_ZMQ_PHPIZE
 	(cd $(@D); \
-		PHP_AUTOCONF=$(HOST_DIR)/usr/bin/autoconf \
-		PHP_AUTOHEADER=$(HOST_DIR)/usr/bin/autoheader \
+		PHP_AUTOCONF=$(HOST_DIR)/bin/autoconf \
+		PHP_AUTOHEADER=$(HOST_DIR)/bin/autoheader \
 		$(STAGING_DIR)/usr/bin/phpize)
 endef
 
package/pinentry/pinentry.mk +1 -1
index e4f68b5217..7e6878db4d 100644
@@ -55,7 +55,7 @@ endif
 ifeq ($(BR2_PACKAGE_PINENTRY_QT4),y)
 # -pthread needs to be passed for certain toolchains
 # http://autobuild.buildroot.net/results/6be/6be109ccedec603a67cebdb31b55865dcce0e128/
-PINENTRY_CONF_OPTS += LIBS=-pthread MOC=$(HOST_DIR)/usr/bin/moc
+PINENTRY_CONF_OPTS += LIBS=-pthread MOC=$(HOST_DIR)/bin/moc
 PINENTRY_CONF_OPTS += --enable-pinentry-qt4
 PINENTRY_DEPENDENCIES += qt
 else
package/pkg-cmake.mk +2 -2
index 1bb3652a13..401084fb12 100644
@@ -22,8 +22,8 @@
 
 # Set compiler variables.
 ifeq ($(BR2_CCACHE),y)
-CMAKE_HOST_C_COMPILER = $(HOST_DIR)/usr/bin/ccache
-CMAKE_HOST_CXX_COMPILER = $(HOST_DIR)/usr/bin/ccache
+CMAKE_HOST_C_COMPILER = $(HOST_DIR)/bin/ccache
+CMAKE_HOST_CXX_COMPILER = $(HOST_DIR)/bin/ccache
 CMAKE_HOST_C_COMPILER_ARG1 = $(HOSTCC_NOCCACHE)
 CMAKE_HOST_CXX_COMPILER_ARG1 = $(HOSTCXX_NOCCACHE)
 else
package/pkg-perl.mk +1 -1
index cc94cd9f8b..b0d5789ac5 100644
@@ -20,7 +20,7 @@
 ################################################################################
 
 PERL_ARCHNAME = $(ARCH)-linux
-PERL_RUN = PERL5LIB= PERL_USE_UNSAFE_INC=1 $(HOST_DIR)/usr/bin/perl
+PERL_RUN = PERL5LIB= PERL_USE_UNSAFE_INC=1 $(HOST_DIR)/bin/perl
 
 ################################################################################
 # inner-perl-package -- defines how the configuration, compilation and
package/pkg-python.mk +3 -3
index 6e411ab5c5..f57e486dad 100644
@@ -204,12 +204,12 @@ endif
 #   - otherwise, we use the one requested by *_NEEDS_HOST_PYTHON.
 #
 ifeq ($(4),target)
-$(2)_PYTHON_INTERPRETER = $$(HOST_DIR)/usr/bin/python
+$(2)_PYTHON_INTERPRETER = $$(HOST_DIR)/bin/python
 else
 ifeq ($$($(2)_NEEDS_HOST_PYTHON),)
-$(2)_PYTHON_INTERPRETER = $$(HOST_DIR)/usr/bin/python
+$(2)_PYTHON_INTERPRETER = $$(HOST_DIR)/bin/python
 else
-$(2)_PYTHON_INTERPRETER = $$(HOST_DIR)/usr/bin/$$($(2)_NEEDS_HOST_PYTHON)
+$(2)_PYTHON_INTERPRETER = $$(HOST_DIR)/bin/$$($(2)_NEEDS_HOST_PYTHON)
 endif
 endif
 
package/pkg-waf.mk +5 -5
index 45b9c4136f..e5b606f063 100644
@@ -44,7 +44,7 @@ $(2)_NEEDS_EXTERNAL_WAF ?= NO
 # If the package does not have its own waf, use our own.
 ifeq ($$($(2)_NEEDS_EXTERNAL_WAF),YES)
 $(2)_DEPENDENCIES += host-waf
-$(2)_WAF = $(HOST_DIR)/usr/bin/waf
+$(2)_WAF = $(HOST_DIR)/bin/waf
 else
 $(2)_WAF = ./waf
 endif
@@ -63,7 +63,7 @@ define $(2)_CONFIGURE_CMDS
 	cd $$(@D) && \
 	$$(TARGET_CONFIGURE_OPTS) \
 	$$($(2)_CONF_ENV) \
-	$$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) configure \
+	$$(HOST_DIR)/bin/python2 $$($(2)_WAF) configure \
 		--prefix=/usr \
 		--libdir=/usr/lib \
 		$$($(2)_CONF_OPTS) \
@@ -78,7 +78,7 @@ endif
 ifndef $(2)_BUILD_CMDS
 define $(2)_BUILD_CMDS
 	cd $$(@D) && \
-	$$(TARGET_MAKE_ENV) $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) \
+	$$(TARGET_MAKE_ENV) $$(HOST_DIR)/bin/python2 $$($(2)_WAF) \
 		build -j $$(PARALLEL_JOBS) $$($(2)_BUILD_OPTS) \
 		$$($(2)_WAF_OPTS)
 endef
@@ -91,7 +91,7 @@ endif
 ifndef $(2)_INSTALL_STAGING_CMDS
 define $(2)_INSTALL_STAGING_CMDS
 	cd $$(@D) && \
-	$$(TARGET_MAKE_ENV) $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) \
+	$$(TARGET_MAKE_ENV) $$(HOST_DIR)/bin/python2 $$($(2)_WAF) \
 		install --destdir=$$(STAGING_DIR) \
 		$$($(2)_INSTALL_STAGING_OPTS) \
 		$$($(2)_WAF_OPTS)
@@ -105,7 +105,7 @@ endif
 ifndef $(2)_INSTALL_TARGET_CMDS
 define $(2)_INSTALL_TARGET_CMDS
 	cd $$(@D) && \
-	$$(TARGET_MAKE_ENV) $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) \
+	$$(TARGET_MAKE_ENV) $$(HOST_DIR)/bin/python2 $$($(2)_WAF) \
 		install --destdir=$$(TARGET_DIR) \
 		$$($(2)_INSTALL_TARGET_OPTS) \
 		$$($(2)_WAF_OPTS)
package/pkgconf/pkgconf.mk +5 -5
index c8b0cbaf51..cc190d26da 100644
@@ -10,7 +10,7 @@ PKGCONF_SOURCE = pkgconf-$(PKGCONF_VERSION).tar.bz2
 PKGCONF_LICENSE = pkgconf license
 PKGCONF_LICENSE_FILES = COPYING
 
-PKG_CONFIG_HOST_BINARY = $(HOST_DIR)/usr/bin/pkg-config
+PKG_CONFIG_HOST_BINARY = $(HOST_DIR)/bin/pkg-config
 
 define PKGCONF_LINK_PKGCONFIG
 	ln -sf pkgconf $(TARGET_DIR)/usr/bin/pkg-config
@@ -18,18 +18,18 @@ endef
 
 define HOST_PKGCONF_INSTALL_WRAPPER
 	$(INSTALL) -m 0755 -D package/pkgconf/pkg-config.in \
-		$(HOST_DIR)/usr/bin/pkg-config
+		$(HOST_DIR)/bin/pkg-config
 	$(SED) 's, at PKG_CONFIG_LIBDIR@,$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/usr/share/pkgconfig,' \
 		-e 's, at STAGING_DIR@,$(STAGING_DIR),' \
-		$(HOST_DIR)/usr/bin/pkg-config
+		$(HOST_DIR)/bin/pkg-config
 endef
 
 define HOST_PKGCONF_STATIC
-	$(SED) 's, at STATIC@,--static,' $(HOST_DIR)/usr/bin/pkg-config
+	$(SED) 's, at STATIC@,--static,' $(HOST_DIR)/bin/pkg-config
 endef
 
 define HOST_PKGCONF_SHARED
-	$(SED) 's, at STATIC@,,' $(HOST_DIR)/usr/bin/pkg-config
+	$(SED) 's, at STATIC@,,' $(HOST_DIR)/bin/pkg-config
 endef
 
 PKGCONF_POST_INSTALL_TARGET_HOOKS += PKGCONF_LINK_PKGCONFIG
package/policycoreutils/policycoreutils.mk +4 -4
index c9dca4ca9b..480fd6e09d 100644
@@ -91,7 +91,7 @@ HOST_POLICYCOREUTILS_MAKE_OPTS = \
 	$(HOST_CONFIGURE_OPTS) \
 	CFLAGS="$(HOST_CFLAGS) -U_FILE_OFFSET_BITS" \
 	CPPFLAGS="$(HOST_CPPFLAGS) -U_FILE_OFFSET_BITS" \
-	PYTHON="$(HOST_DIR)/usr/bin/python" \
+	PYTHON="$(HOST_DIR)/bin/python" \
 	PYTHON_INSTALL_ARGS="$(HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS)" \
 	ARCH="$(HOSTARCH)"
 
@@ -127,9 +127,9 @@ define HOST_POLICYCOREUTILS_INSTALL_CMDS
 			DESTDIR=$(HOST_DIR) install
 	)
 	# Fix python paths
-	$(SED) 's%/usr/bin/%$(HOST_DIR)/usr/bin/%g' $(HOST_DIR)/usr/bin/audit2allow
-	$(SED) 's%/usr/bin/%$(HOST_DIR)/usr/bin/%g' $(HOST_DIR)/usr/bin/sepolgen-ifgen
-	$(SED) 's%/usr/bin/%$(HOST_DIR)/usr/bin/%g' $(HOST_DIR)/usr/bin/sepolicy
+	$(SED) 's%/usr/bin/%$(HOST_DIR)/bin/%g' $(HOST_DIR)/bin/audit2allow
+	$(SED) 's%/usr/bin/%$(HOST_DIR)/bin/%g' $(HOST_DIR)/bin/sepolgen-ifgen
+	$(SED) 's%/usr/bin/%$(HOST_DIR)/bin/%g' $(HOST_DIR)/bin/sepolicy
 endef
 
 $(eval $(generic-package))
package/protobuf/protobuf.mk +1 -1
index 72930c1fef..72890e6617 100644
@@ -16,7 +16,7 @@ PROTOBUF_AUTORECONF = YES
 
 # N.B. Need to use host protoc during cross compilation.
 PROTOBUF_DEPENDENCIES = host-protobuf
-PROTOBUF_CONF_OPTS = --with-protoc=$(HOST_DIR)/usr/bin/protoc
+PROTOBUF_CONF_OPTS = --with-protoc=$(HOST_DIR)/bin/protoc
 
 PROTOBUF_INSTALL_STAGING = YES
 
package/pulseaudio/pulseaudio.mk +1 -1
index 0c409a74fe..cc1b12d802 100644
@@ -52,7 +52,7 @@ endif
 
 ifeq ($(BR2_PACKAGE_ORC),y)
 PULSEAUDIO_DEPENDENCIES += orc
-PULSEAUDIO_CONF_ENV += ORCC=$(HOST_DIR)/usr/bin/orcc
+PULSEAUDIO_CONF_ENV += ORCC=$(HOST_DIR)/bin/orcc
 PULSEAUDIO_CONF_OPTS += --enable-orc
 else
 PULSEAUDIO_CONF_OPTS += --disable-orc
package/python-gobject/python-gobject.mk +2 -2
index a52eebfc1a..cf5c874151 100644
@@ -19,13 +19,13 @@ ifeq ($(BR2_PACKAGE_PYTHON),y)
 PYTHON_GOBJECT_DEPENDENCIES += python host-python
 
 PYTHON_GOBJECT_CONF_ENV = \
-	PYTHON=$(HOST_DIR)/usr/bin/python2 \
+	PYTHON=$(HOST_DIR)/bin/python2 \
 	PYTHON_INCLUDES="`$(STAGING_DIR)/usr/bin/python2-config --includes`"
 else
 PYTHON_GOBJECT_DEPENDENCIES += python3 host-python3
 
 PYTHON_GOBJECT_CONF_ENV = \
-	PYTHON=$(HOST_DIR)/usr/bin/python3 \
+	PYTHON=$(HOST_DIR)/bin/python3 \
 	PYTHON_INCLUDES="`$(STAGING_DIR)/usr/bin/python3-config --includes`"
 endif
 
package/python-lxml/python-lxml.mk +2 -2
index 40fb77351e..db6591fc1e 100644
@@ -29,8 +29,8 @@ PYTHON_LXML_BUILD_OPTS = \
 	--with-xslt-config=$(STAGING_DIR)/usr/bin/xslt-config \
 	--with-xml2-config=$(STAGING_DIR)/usr/bin/xml2-config
 HOST_PYTHON_LXML_BUILD_OPTS = \
-	--with-xslt-config=$(HOST_DIR)/usr/bin/xslt-config \
-	--with-xml2-config=$(HOST_DIR)/usr/bin/xml2-config
+	--with-xslt-config=$(HOST_DIR)/bin/xslt-config \
+	--with-xml2-config=$(HOST_DIR)/bin/xml2-config
 
 $(eval $(python-package))
 $(eval $(host-python-package))
package/python-pypcap/python-pypcap.mk +2 -2
index 185ab1d3dc..fc6fc6ed92 100644
@@ -12,9 +12,9 @@ PYTHON_PYPCAP_SETUP_TYPE = distutils
 PYTHON_PYPCAP_DEPENDENCIES = host-python-pyrex libpcap
 
 define PYTHON_PYPCAP_CONFIGURE_CMDS
-	$(HOST_DIR)/usr/bin/python2 $(HOST_DIR)/usr/bin/pyrexc $(@D)/pcap.pyx
+	$(HOST_DIR)/bin/python2 $(HOST_DIR)/bin/pyrexc $(@D)/pcap.pyx
 	(cd $(@D); \
-		$(HOST_DIR)/usr/bin/python setup.py \
+		$(HOST_DIR)/bin/python setup.py \
 		config --with-pcap=$(STAGING_DIR)/usr)
 endef
 
package/python-pyqt/python-pyqt.mk +2 -2
index ab658e90b7..57f18b533d 100644
@@ -72,7 +72,7 @@ endef
 PYTHON_PYQT_CONF_OPTS = \
 	--bindir $(TARGET_DIR)/usr/bin \
 	--destdir $(TARGET_DIR)/usr/lib/$(PYTHON_PYQT_PYTHON_DIR)/site-packages \
-	--qmake $(HOST_DIR)/usr/bin/qmake \
+	--qmake $(HOST_DIR)/bin/qmake \
 	--sysroot $(STAGING_DIR)/usr \
 	-w --confirm-license \
 	--no-designer-plugin \
@@ -93,7 +93,7 @@ define PYTHON_PYQT_CONFIGURE_CMDS
 	(cd $(@D); \
 		$(TARGET_MAKE_ENV) \
 		$(TARGET_CONFIGURE_OPTS) \
-		$(HOST_DIR)/usr/bin/python configure-ng.py \
+		$(HOST_DIR)/bin/python configure-ng.py \
 			$(PYTHON_PYQT_CONF_OPTS) \
 	)
 endef
package/python-pyqt5/python-pyqt5.mk +2 -2
index 965c2d8536..cde026ef63 100644
@@ -47,7 +47,7 @@ endef
 PYTHON_PYQT5_CONF_OPTS = \
 	--bindir $(TARGET_DIR)/usr/bin \
 	--destdir $(TARGET_DIR)/usr/lib/$(PYTHON_PYQT5_PYTHON_DIR)/site-packages \
-	--qmake $(HOST_DIR)/usr/bin/qmake \
+	--qmake $(HOST_DIR)/bin/qmake \
 	--sysroot $(STAGING_DIR)/usr \
 	-w --confirm-license \
 	--no-designer-plugin \
@@ -59,7 +59,7 @@ define PYTHON_PYQT5_CONFIGURE_CMDS
 	(cd $(@D); \
 		$(TARGET_MAKE_ENV) \
 		$(TARGET_CONFIGURE_OPTS) \
-		$(HOST_DIR)/usr/bin/python configure.py \
+		$(HOST_DIR)/bin/python configure.py \
 			$(PYTHON_PYQT5_CONF_OPTS) \
 	)
 endef
package/python-sip/python-sip.mk +3 -3
index 1d84e83517..54406b841b 100644
@@ -30,7 +30,7 @@ endif
 
 define HOST_PYTHON_SIP_CONFIGURE_CMDS
 	(cd $(@D); \
-		$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(HOST_DIR)/usr/bin/python configure.py)
+		$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(HOST_DIR)/bin/python configure.py)
 endef
 
 define HOST_PYTHON_SIP_BUILD_CMDS
@@ -43,14 +43,14 @@ endef
 
 define PYTHON_SIP_CONFIGURE_CMDS
 	(cd $(@D); \
-		$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(HOST_DIR)/usr/bin/python configure.py \
+		$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(HOST_DIR)/bin/python configure.py \
 			--bindir $(TARGET_DIR)/usr/bin \
 			--destdir $(TARGET_DIR)/$(PYTHON_SIP_LIB_DIR) \
 			--incdir $(STAGING_DIR)/$(PYTHON_SIP_INCLUDE_DIR)  \
 			--sipdir $(TARGET_DIR)/usr/share/sip \
 			--sysroot $(STAGING_DIR)/usr \
 			--use-qmake && \
-		$(HOST_DIR)/usr/bin/qmake)
+		$(HOST_DIR)/bin/qmake)
 endef
 
 define PYTHON_SIP_BUILD_CMDS
package/python-web2py/python-web2py.mk +1 -1
index 7fe9f82f8b..a30632c24e 100644
@@ -11,7 +11,7 @@ PYTHON_WEB2PY_LICENSE_FILES = LICENSE
 PYTHON_WEB2PY_DEPENDENCIES = python python-pydal host-python-pydal
 
 define PYTHON_WEB2PY_INSTALL_TARGET_CMDS
-	$(HOST_DIR)/usr/bin/python2 -c 'import os; \
+	$(HOST_DIR)/bin/python2 -c 'import os; \
 		os.chdir("$(@D)"); \
 		from gluon.main import save_password; \
 		save_password($(BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD),8000)'
package/python/python.mk +3 -3
index 7ba5e37754..d1c01674b3 100644
@@ -231,8 +231,8 @@ PYTHON_AUTORECONF = YES
 # for the target, otherwise the default python program may be missing.
 ifneq ($(BR2_PACKAGE_PYTHON3),y)
 define HOST_PYTHON_INSTALL_PYTHON_SYMLINK
-	ln -sf python2 $(HOST_DIR)/usr/bin/python
-	ln -sf python2-config $(HOST_DIR)/usr/bin/python-config
+	ln -sf python2 $(HOST_DIR)/bin/python
+	ln -sf python2-config $(HOST_DIR)/bin/python-config
 endef
 
 HOST_PYTHON_POST_INSTALL_HOOKS += HOST_PYTHON_INSTALL_PYTHON_SYMLINK
@@ -254,7 +254,7 @@ endif
 define PYTHON_CREATE_PYC_FILES
 	$(PYTHON_FIX_TIME)
 	PYTHONPATH="$(PYTHON_PATH)" \
-	cd $(TARGET_DIR) && $(HOST_DIR)/usr/bin/python$(PYTHON_VERSION_MAJOR) \
+	cd $(TARGET_DIR) && $(HOST_DIR)/bin/python$(PYTHON_VERSION_MAJOR) \
 		$(TOPDIR)/support/scripts/pycompile.py \
 		$(if $(BR2_REPRODUCIBLE),--force) \
 		usr/lib/python$(PYTHON_VERSION_MAJOR)
package/python3/python3.mk +8 -8
index 2532dee489..c674278dc3 100644
@@ -166,17 +166,17 @@ PYTHON3_CONF_OPTS += \
 # '_freeze_importlib'. Unfortunately, for the target Python, they are
 # built for the target, while we need to run them at build time. So
 # when installing host-python, we copy them to
-# $(HOST_DIR)/usr/bin. And then, when building the target python
+# $(HOST_DIR)/bin. And then, when building the target python
 # package, we tell the configure script where they are located.
 define HOST_PYTHON3_INSTALL_TOOLS
-	cp $(@D)/Parser/pgen $(HOST_DIR)/usr/bin/python-pgen
-	cp $(@D)/Programs/_freeze_importlib $(HOST_DIR)/usr/bin/python-freeze-importlib
+	cp $(@D)/Parser/pgen $(HOST_DIR)/bin/python-pgen
+	cp $(@D)/Programs/_freeze_importlib $(HOST_DIR)/bin/python-freeze-importlib
 endef
 HOST_PYTHON3_POST_INSTALL_HOOKS += HOST_PYTHON3_INSTALL_TOOLS
 
 PYTHON3_CONF_ENV += \
-	PGEN_FOR_BUILD=$(HOST_DIR)/usr/bin/python-pgen \
-	FREEZE_IMPORTLIB_FOR_BUILD=$(HOST_DIR)/usr/bin/python-freeze-importlib
+	PGEN_FOR_BUILD=$(HOST_DIR)/bin/python-pgen \
+	FREEZE_IMPORTLIB_FOR_BUILD=$(HOST_DIR)/bin/python-freeze-importlib
 
 #
 # Remove useless files. In the config/ directory, only the Makefile
@@ -224,8 +224,8 @@ endif
 # for the target.
 ifeq ($(BR2_PACKAGE_PYTHON3),y)
 define HOST_PYTHON3_INSTALL_SYMLINK
-	ln -fs python3 $(HOST_DIR)/usr/bin/python
-	ln -fs python3-config $(HOST_DIR)/usr/bin/python-config
+	ln -fs python3 $(HOST_DIR)/bin/python
+	ln -fs python3-config $(HOST_DIR)/bin/python-config
 endef
 
 HOST_PYTHON3_POST_INSTALL_HOOKS += HOST_PYTHON3_INSTALL_SYMLINK
@@ -247,7 +247,7 @@ endif
 define PYTHON3_CREATE_PYC_FILES
 	$(PYTHON3_FIX_TIME)
 	PYTHONPATH="$(PYTHON3_PATH)" \
-	cd $(TARGET_DIR) && $(HOST_DIR)/usr/bin/python$(PYTHON3_VERSION_MAJOR) \
+	cd $(TARGET_DIR) && $(HOST_DIR)/bin/python$(PYTHON3_VERSION_MAJOR) \
 		$(TOPDIR)/support/scripts/pycompile.py \
 		$(if $(BR2_REPRODUCIBLE),--force) \
 		usr/lib/python$(PYTHON3_VERSION_MAJOR)
package/qemu/qemu.mk +4 -4
index 6df3b3db8b..3868c252d8 100644
@@ -130,7 +130,7 @@ define HOST_QEMU_CONFIGURE_CMDS
 		--interp-prefix=$(STAGING_DIR) \
 		--cc="$(HOSTCC)" \
 		--host-cc="$(HOSTCC)" \
-		--python=$(HOST_DIR)/usr/bin/python2 \
+		--python=$(HOST_DIR)/bin/python2 \
 		--extra-cflags="$(HOST_CFLAGS)" \
 		--extra-ldflags="$(HOST_LDFLAGS)" \
 		$(HOST_QEMU_OPTS)
@@ -147,7 +147,7 @@ endef
 $(eval $(host-generic-package))
 
 # variable used by other packages
-QEMU_USER = $(HOST_DIR)/usr/bin/qemu-$(HOST_QEMU_ARCH)
+QEMU_USER = $(HOST_DIR)/bin/qemu-$(HOST_QEMU_ARCH)
 
 #-------------------------------------------------------------
 # Target-qemu
@@ -161,8 +161,8 @@ QEMU_LIBS = -lrt -lm
 QEMU_OPTS =
 
 QEMU_VARS = \
-	LIBTOOL=$(HOST_DIR)/usr/bin/libtool \
-	PYTHON=$(HOST_DIR)/usr/bin/python2 \
+	LIBTOOL=$(HOST_DIR)/bin/libtool \
+	PYTHON=$(HOST_DIR)/bin/python2 \
 	PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
 
 # If we want to specify only a subset of targets, we must still enable all
package/qpid-proton/qpid-proton.mk +1 -1
index 2e8c1d0e92..c501e48c86 100644
@@ -26,7 +26,7 @@ QPID_PROTON_CONF_OPTS = \
 	-DBUILD_RUBY=OFF \
 	-DENABLE_VALGRIND=OFF \
 	-DENABLE_WARNING_ERROR=OFF \
-	-DPYTHON_EXECUTABLE=$(HOST_DIR)/usr/bin/python2
+	-DPYTHON_EXECUTABLE=$(HOST_DIR)/bin/python2
 
 define QPID_PROTON_REMOVE_USELESS_FILES
 	rm -fr $(TARGET_DIR)/usr/share/proton-*/
package/qt/qt.mk +7 -7
index 2580ee7c0b..e941f89624 100644
@@ -475,7 +475,7 @@ endif
 # End of workaround.
 
 # Variable for other Qt applications to use
-QT_QMAKE = $(HOST_DIR)/usr/bin/qmake -spec qws/linux-$(QT_EMB_PLATFORM)-g++
+QT_QMAKE = $(HOST_DIR)/bin/qmake -spec qws/linux-$(QT_EMB_PLATFORM)-g++
 
 ################################################################################
 # QT_QMAKE_SET -- helper macro to set <variable> = <value> in
@@ -516,7 +516,7 @@ define QT_CONFIGURE_CMDS
 	$(call QT_QMAKE_SET,QMAKE_CFLAGS,$(QT_CFLAGS),$(@D))
 	$(call QT_QMAKE_SET,QMAKE_CXXFLAGS,$(QT_CXXFLAGS),$(@D))
 	$(call QT_QMAKE_SET,QMAKE_LFLAGS,$(QT_LDFLAGS),$(@D))
-	$(call QT_QMAKE_SET,PKG_CONFIG,$(HOST_DIR)/usr/bin/pkg-config,$(@D))
+	$(call QT_QMAKE_SET,PKG_CONFIG,$(HOST_DIR)/bin/pkg-config,$(@D))
 # Don't use TARGET_CONFIGURE_OPTS here, qmake would be compiled for the target
 # instead of the host then. So set PKG_CONFIG* manually.
 	(cd $(@D); \
@@ -604,7 +604,7 @@ ifeq ($(BR2_PACKAGE_QT_TEST),y)
 QT_INSTALL_LIBS += QtTest
 endif
 
-QT_CONF_FILE = $(HOST_DIR)/usr/bin/qt.conf
+QT_CONF_FILE = $(HOST_DIR)/bin/qt.conf
 
 # Since host programs and spec files have been moved to $(HOST_DIR),
 # we need to tell qmake the new location of the various elements,
@@ -616,7 +616,7 @@ define QT_INSTALL_QT_CONF
 	echo "Headers=$(STAGING_DIR)/usr/include" >> $(QT_CONF_FILE)
 	echo "Libraries=$(STAGING_DIR)/usr/lib"   >> $(QT_CONF_FILE)
 	echo "Data=$(HOST_DIR)/usr"               >> $(QT_CONF_FILE)
-	echo "Binaries=$(HOST_DIR)/usr/bin"       >> $(QT_CONF_FILE)
+	echo "Binaries=$(HOST_DIR)/bin"       >> $(QT_CONF_FILE)
 endef
 
 # After running Qt normal installation process (which installs
@@ -628,12 +628,12 @@ endef
 # automatically.
 define QT_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
-	mkdir -p $(HOST_DIR)/usr/bin
-	mv $(addprefix $(STAGING_DIR)/usr/bin/,$(QT_HOST_PROGRAMS)) $(HOST_DIR)/usr/bin
+	mkdir -p $(HOST_DIR)/bin
+	mv $(addprefix $(STAGING_DIR)/usr/bin/,$(QT_HOST_PROGRAMS)) $(HOST_DIR)/bin
 	ln -sf $(STAGING_DIR)/usr/mkspecs $(HOST_DIR)/usr/mkspecs
 	$(QT_INSTALL_QT_CONF)
 	for i in moc uic rcc lupdate lrelease ; do \
-		$(SED) "s,^$${i}_location=.*,$${i}_location=$(HOST_DIR)/usr/bin/$${i}," \
+		$(SED) "s,^$${i}_location=.*,$${i}_location=$(HOST_DIR)/bin/$${i}," \
 			$(STAGING_DIR)/usr/lib/pkgconfig/Qt*.pc ; \
 	done
 	$(SED) "s,$(STAGING_DIR)/,,g" $(STAGING_DIR)/usr/lib/pkgconfig/Qt*.pc
package/qt5/qt5.mk +1 -1
index 9e77ce351c..d390c04fe8 100644
@@ -28,4 +28,4 @@ define QT5_LA_PRL_FILES_FIXUP
 endef
 
 # Variable for other Qt applications to use
-QT5_QMAKE = $(HOST_DIR)/usr/bin/qmake -spec devices/linux-buildroot-g++
+QT5_QMAKE = $(HOST_DIR)/bin/qmake -spec devices/linux-buildroot-g++
package/qt5/qt53d/qt53d.mk +1 -1
index 9d890204ca..c41f2451f1 100644
@@ -23,7 +23,7 @@ QT53D_REDISTRIBUTE = NO
 endif
 
 define QT53D_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT53D_BUILD_CMDS
package/qt5/qt5canvas3d/qt5canvas3d.mk +1 -1
index f49113b538..8dfbc5157c 100644
@@ -19,7 +19,7 @@ QT5CANVAS3D_REDISTRIBUTE = NO
 endif
 
 define QT5CANVAS3D_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5CANVAS3D_BUILD_CMDS
package/qt5/qt5connectivity/qt5connectivity.mk +1 -1
index a9518cb4cb..e18baa06f5 100644
@@ -32,7 +32,7 @@ QT5CONNECTIVITY_DEPENDENCIES += $(if $(BR2_PACKAGE_BLUEZ5_UTILS),bluez5_utils)
 QT5CONNECTIVITY_DEPENDENCIES += $(if $(BR2_PACKAGE_NEARD),neard)
 
 define QT5CONNECTIVITY_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5CONNECTIVITY_BUILD_CMDS
package/qt5/qt5declarative/qt5declarative.mk +1 -1
index c4b3f07402..7c3e53a52c 100644
@@ -24,7 +24,7 @@ QT5DECLARATIVE_REDISTRIBUTE = NO
 endif
 
 define QT5DECLARATIVE_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5DECLARATIVE_BUILD_CMDS
package/qt5/qt5enginio/qt5enginio.mk +1 -1
index e550fccfdc..62d519a0c2 100644
@@ -28,7 +28,7 @@ QT5ENGINIO_DEPENDENCIES += qt5declarative
 endif
 
 define QT5ENGINIO_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5ENGINIO_BUILD_CMDS
package/qt5/qt5graphicaleffects/qt5graphicaleffects.mk +1 -1
index 9354a4d250..839cd8a8a6 100644
@@ -24,7 +24,7 @@ QT5GRAPHICALEFFECTS_REDISTRIBUTE = NO
 endif
 
 define QT5GRAPHICALEFFECTS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5GRAPHICALEFFECTS_BUILD_CMDS
package/qt5/qt5imageformats/qt5imageformats.mk +1 -1
index 5d31e14a2f..7333ff2ffd 100644
@@ -24,7 +24,7 @@ QT5IMAGEFORMATS_REDISTRIBUTE = NO
 endif
 
 define QT5IMAGEFORMATS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5IMAGEFORMATS_BUILD_CMDS
package/qt5/qt5location/qt5location.mk +1 -1
index 96263e89b9..29bd4ae4eb 100644
@@ -28,7 +28,7 @@ QT5LOCATION_DEPENDENCIES += qt5declarative
 endif
 
 define QT5LOCATION_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5LOCATION_BUILD_CMDS
package/qt5/qt5multimedia/qt5multimedia.mk +1 -1
index e66ce40851..2f7397c6f7 100644
@@ -32,7 +32,7 @@ QT5MULTIMEDIA_DEPENDENCIES += qt5declarative
 endif
 
 define QT5MULTIMEDIA_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5MULTIMEDIA_BUILD_CMDS
package/qt5/qt5quickcontrols/qt5quickcontrols.mk +1 -1
index d28993244e..fa5b39ef63 100644
@@ -19,7 +19,7 @@ QT5QUICKCONTROLS_REDISTRIBUTE = NO
 endif
 
 define QT5QUICKCONTROLS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5QUICKCONTROLS_BUILD_CMDS
package/qt5/qt5quickcontrols2/qt5quickcontrols2.mk +1 -1
index d6c3ee3e48..83d3911863 100644
@@ -19,7 +19,7 @@ QT5QUICKCONTROLS2_REDISTRIBUTE = NO
 endif
 
 define QT5QUICKCONTROLS2_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5QUICKCONTROLS2_BUILD_CMDS
package/qt5/qt5script/qt5script.mk +1 -1
index c24ef3336e..e58edc3d95 100644
@@ -19,7 +19,7 @@ QT5SCRIPT_REDISTRIBUTE = NO
 endif
 
 define QT5SCRIPT_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5SCRIPT_BUILD_CMDS
package/qt5/qt5sensors/qt5sensors.mk +1 -1
index f73ae5b8d0..c0ef5c4263 100644
@@ -28,7 +28,7 @@ QT5SENSORS_DEPENDENCIES += qt5declarative
 endif
 
 define QT5SENSORS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5SENSORS_BUILD_CMDS
package/qt5/qt5serialbus/qt5serialbus.mk +1 -1
index 05ca181eae..7c8cea5106 100644
@@ -19,7 +19,7 @@ QT5SERIALBUS_REDISTRIBUTE = NO
 endif
 
 define QT5SERIALBUS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5SERIALBUS_BUILD_CMDS
package/qt5/qt5serialport/qt5serialport.mk +1 -1
index 1a137fde11..eca544b5a6 100644
@@ -24,7 +24,7 @@ QT5SERIALPORT_REDISTRIBUTE = NO
 endif
 
 define QT5SERIALPORT_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5SERIALPORT_BUILD_CMDS
package/qt5/qt5svg/qt5svg.mk +1 -1
index 8986332b43..e408d9104f 100644
@@ -24,7 +24,7 @@ QT5SVG_REDISTRIBUTE = NO
 endif
 
 define QT5SVG_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5SVG_BUILD_CMDS
package/qt5/qt5tools/qt5tools.mk +1 -1
index c7d2e8f88c..03f5a650fa 100644
@@ -54,7 +54,7 @@ QT5TOOLS_BUILD_DIRS_$(BR2_PACKAGE_QT5TOOLS_QTPLUGININFO) += qtplugininfo
 QT5TOOLS_INSTALL_TARGET_$(BR2_PACKAGE_QT5TOOLS_QTPLUGININFO) += qtplugininfo
 
 define QT5TOOLS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5TOOLS_BUILD_CMDS
package/qt5/qt5webchannel/qt5webchannel.mk +1 -1
index e12e945703..5ff477b6ec 100644
@@ -31,7 +31,7 @@ QT5WEBCHANNEL_DEPENDENCIES += qt5declarative
 endif
 
 define QT5WEBCHANNEL_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5WEBCHANNEL_BUILD_CMDS
package/qt5/qt5webkit/qt5webkit.mk +2 -2
index 295d24d16f..5fc6196d4a 100644
@@ -38,12 +38,12 @@ endif
 QT5WEBKIT_ENV = PATH=$(@D)/host-bin:$(BR_PATH)
 define QT5WEBKIT_PYTHON2_SYMLINK
 	mkdir -p $(@D)/host-bin
-	ln -sf $(HOST_DIR)/usr/bin/python2 $(@D)/host-bin/python
+	ln -sf $(HOST_DIR)/bin/python2 $(@D)/host-bin/python
 endef
 QT5WEBKIT_PRE_CONFIGURE_HOOKS += QT5WEBKIT_PYTHON2_SYMLINK
 
 define QT5WEBKIT_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5WEBKIT_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5WEBKIT_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5WEBKIT_BUILD_CMDS
package/qt5/qt5websockets/qt5websockets.mk +1 -1
index bcbc56f1c7..dfe7ca83ef 100644
@@ -31,7 +31,7 @@ QT5WEBSOCKETS_DEPENDENCIES += qt5declarative
 endif
 
 define QT5WEBSOCKETS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5WEBSOCKETS_BUILD_CMDS
package/qt5/qt5x11extras/qt5x11extras.mk +1 -1
index 7dc371cbac..dc8defb63d 100644
@@ -24,7 +24,7 @@ QT5X11EXTRAS_REDISTRIBUTE = NO
 endif
 
 define QT5X11EXTRAS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5X11EXTRAS_BUILD_CMDS
package/qt5/qt5xmlpatterns/qt5xmlpatterns.mk +1 -1
index 123e1abf1a..81833459a1 100644
@@ -27,7 +27,7 @@ QT5XMLPATTERNS_REDISTRIBUTE = NO
 endif
 
 define QT5XMLPATTERNS_CONFIGURE_CMDS
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake)
 endef
 
 define QT5XMLPATTERNS_BUILD_CMDS
package/qt5cinex/qt5cinex.mk +1 -1
index bfe14ce74e..d9254f53c5 100644
@@ -18,7 +18,7 @@ QT5CINEX_LICENSE = CC-BY-3.0
 QT5CINEX_LICENSE_FILES = README
 
 define QT5CINEX_CONFIGURE_CMDS
-	cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake
+	cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/bin/qmake
 endef
 
 define QT5CINEX_BUILD_CMDS
package/runc/runc.mk +1 -1
index 88bc03fcb1..fb3fec20f5 100644
@@ -38,7 +38,7 @@ define RUNC_CONFIGURE_CMDS
 endef
 
 define RUNC_BUILD_CMDS
-	cd $(@D) && $(RUNC_MAKE_ENV) $(HOST_DIR)/usr/bin/go \
+	cd $(@D) && $(RUNC_MAKE_ENV) $(HOST_DIR)/bin/go \
 		build -v -o $(@D)/bin/runc \
 		-tags "$(RUNC_GOTAGS)" -ldflags "$(RUNC_GLDFLAGS)" .
 endef
package/s6-rc/s6-rc.mk +1 -1
index 39c18852f1..23c3c091ca 100644
@@ -66,7 +66,7 @@ endef
 
 define HOST_S6_RC_INSTALL_CMDS
 	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) install-dynlib install-bin
-	rm -f $(HOST_DIR)/usr/bin/s6-rc-dryrun
+	rm -f $(HOST_DIR)/bin/s6-rc-dryrun
 endef
 
 $(eval $(generic-package))
package/sam-ba/sam-ba.mk +2 -2
index 7fc65c01a9..c695f75979 100644
@@ -20,13 +20,13 @@ endef
 
 # Since it's a prebuilt application and it does not conform to the
 # usual Unix hierarchy, we install it in $(HOST_DIR)/opt/sam-ba and
-# then create a symbolic link from $(HOST_DIR)/usr/bin to the
+# then create a symbolic link from $(HOST_DIR)/bin to the
 # application binary, for easier usage.
 
 define HOST_SAM_BA_INSTALL_CMDS
 	mkdir -p $(HOST_DIR)/opt/sam-ba/
 	cp -a $(@D)/* $(HOST_DIR)/opt/sam-ba/
-	ln -sf ../../opt/sam-ba/sam-ba $(HOST_DIR)/usr/bin/sam-ba
+	ln -sf ../../opt/sam-ba/sam-ba $(HOST_DIR)/bin/sam-ba
 endef
 
 $(eval $(host-generic-package))
package/scons/scons.mk +1 -1
index 39fb258d0d..8e1e8a99f2 100644
@@ -18,4 +18,4 @@ HOST_SCONS_INSTALL_OPTS = \
 $(eval $(host-python-package))
 
 # variables used by other packages
-SCONS = $(HOST_DIR)/usr/bin/python2 $(HOST_DIR)/usr/bin/scons $(if $(QUIET),-s)
+SCONS = $(HOST_DIR)/bin/python2 $(HOST_DIR)/bin/scons $(if $(QUIET),-s)
package/setools/setools.mk +1 -1
index 532e3d036a..9aa74d5e65 100644
@@ -73,7 +73,7 @@ HOST_SETOOLS_CONF_OPTS = \
 
 HOST_SETOOLS_CONF_ENV += \
 	am_cv_pathless_PYTHON=python \
-	ac_cv_path_PYTHON=$(HOST_DIR)/usr/bin/python \
+	ac_cv_path_PYTHON=$(HOST_DIR)/bin/python \
 	am_cv_python_platform=linux2 \
 	am_cv_python_version=$(HOST_SETOOLS_PYTHON_VERSION) \
 	am_cv_python_pythondir=$(HOST_SETOOLS_PYTHON_SITE_PACKAGES) \
package/shared-mime-info/shared-mime-info.mk +2 -2
index 300c3e06a9..b31f0aaedc 100644
@@ -8,7 +8,7 @@ SHARED_MIME_INFO_VERSION = 1.8
 SHARED_MIME_INFO_SOURCE = shared-mime-info-$(SHARED_MIME_INFO_VERSION).tar.xz
 SHARED_MIME_INFO_SITE = https://people.freedesktop.org/~hadess
 SHARED_MIME_INFO_INSTALL_STAGING = YES
-SHARED_MIME_INFO_CONF_ENV = XMLLINT=$(HOST_DIR)/usr/bin/xmllint
+SHARED_MIME_INFO_CONF_ENV = XMLLINT=$(HOST_DIR)/bin/xmllint
 SHARED_MIME_INFO_DEPENDENCIES = host-shared-mime-info libxml2 libglib2
 SHARED_MIME_INFO_CONF_OPTS = \
 	--disable-update-mimedb \
@@ -31,4 +31,4 @@ $(eval $(autotools-package))
 $(eval $(host-autotools-package))
 
 # shared-mime-info for the host
-SHARED_MIME_INFO_HOST_BINARY = $(HOST_DIR)/usr/bin/update-mime-database
+SHARED_MIME_INFO_HOST_BINARY = $(HOST_DIR)/bin/update-mime-database
package/socat/socat.mk +1 -1
index ba46263f84..a4cc6bd77c 100644
@@ -35,7 +35,7 @@ SOCAT_CONF_OPTS += --disable-readline
 endif
 
 define SOCAT_RUN_AUTOCONF
-	(cd $(@D); $(HOST_DIR)/usr/bin/autoconf)
+	(cd $(@D); $(HOST_DIR)/bin/autoconf)
 endef
 
 SOCAT_PRE_CONFIGURE_HOOKS += SOCAT_RUN_AUTOCONF
package/softether/softether.mk +1 -1
index 02226296fd..79949da4a1 100644
@@ -40,7 +40,7 @@ define HOST_SOFTETHER_BUILD_CMDS
 endef
 
 define HOST_SOFTETHER_INSTALL_CMDS
-	$(INSTALL) -m 0755 $(@D)/src/hamcorebuilder/hamcorebuilder $(HOST_DIR)/usr/bin/hamcorebuilder
+	$(INSTALL) -m 0755 $(@D)/src/hamcorebuilder/hamcorebuilder $(HOST_DIR)/bin/hamcorebuilder
 endef
 
 $(eval $(autotools-package))
package/sqlcipher/sqlcipher.mk +1 -1
index 196f16275b..db94d06c54 100644
@@ -11,7 +11,7 @@ SQLCIPHER_INSTALL_STAGING = YES
 
 SQLCIPHER_CONF_ENV = \
 	CFLAGS="$(TARGET_CFLAGS) $(SQLCIPHER_CFLAGS)" \
-	TCLSH_CMD=$(HOST_DIR)/usr/bin/tclsh$(TCL_VERSION_MAJOR)
+	TCLSH_CMD=$(HOST_DIR)/bin/tclsh$(TCL_VERSION_MAJOR)
 
 SQLCIPHER_CONF_OPTS = \
 	--enable-threadsafe \
package/squashfs/squashfs.mk +1 -1
index 65c39c1f0f..7fef338583 100644
@@ -81,7 +81,7 @@ endef
 
 define HOST_SQUASHFS_INSTALL_CMDS
 	$(HOST_MAKE_ENV) $(MAKE) $(HOST_SQUASHFS_MAKE_ARGS) \
-		-C $(@D)/squashfs-tools/ INSTALL_DIR=$(HOST_DIR)/usr/bin install
+		-C $(@D)/squashfs-tools/ INSTALL_DIR=$(HOST_DIR)/bin install
 endef
 
 $(eval $(generic-package))
package/sunxi-tools/sunxi-tools.mk +1 -1
index c193769c10..3a44cf6fdd 100644
@@ -9,7 +9,7 @@ SUNXI_TOOLS_SITE = $(call github,linux-sunxi,sunxi-tools,$(SUNXI_TOOLS_VERSION))
 SUNXI_TOOLS_LICENSE = GPL-2.0+
 SUNXI_TOOLS_LICENSE_FILES = LICENSE.md
 HOST_SUNXI_TOOLS_DEPENDENCIES = host-libusb host-pkgconf
-FEX2BIN = $(HOST_DIR)/usr/bin/fex2bin
+FEX2BIN = $(HOST_DIR)/bin/fex2bin
 
 define HOST_SUNXI_TOOLS_BUILD_CMDS
 	$(HOST_MAKE_ENV) $(MAKE) CC="$(HOSTCC)" PREFIX=$(HOST_DIR) \
package/swig/swig.mk +4 -4
index 740b597c60..329455e618 100644
@@ -18,19 +18,19 @@ SWIG_LICENSE_FILES = LICENSE LICENSE-GPL LICENSE-UNIVERSITIES
 # CMake looks first at swig3.0, then swig2.0 and then swig. However,
 # when doing the search, it will look into the PATH for swig2.0 first,
 # and then for swig.
-# While the PATH contains first our $(HOST_DIR)/usr/bin, it also contains
+# While the PATH contains first our $(HOST_DIR)/bin, it also contains
 # /usr/bin and other system directories. Therefore, if there is an
 # installed swig3.0 on the system, it will get the preference over the
-# swig installed in $(HOST_DIR)/usr/bin, which isn't nice. To prevent
+# swig installed in $(HOST_DIR)/bin, which isn't nice. To prevent
 # this from happening we create a symbolic link swig3.0 -> swig, so that
 # our swig always gets used.
 
 define HOST_SWIG_INSTALL_SYMLINK
-	ln -fs swig $(HOST_DIR)/usr/bin/swig$(SWIG_VERSION_MAJOR)
+	ln -fs swig $(HOST_DIR)/bin/swig$(SWIG_VERSION_MAJOR)
 endef
 
 HOST_SWIG_POST_INSTALL_HOOKS += HOST_SWIG_INSTALL_SYMLINK
 
 $(eval $(host-autotools-package))
 
-SWIG = $(HOST_DIR)/usr/bin/swig$(SWIG_VERSION_MAJOR)
+SWIG = $(HOST_DIR)/bin/swig$(SWIG_VERSION_MAJOR)
package/systemd/systemd.mk +1 -1
index d8872c46d7..00fdd921d2 100644
@@ -48,7 +48,7 @@ SYSTEMD_CONF_ENV = \
 	ac_cv_path_KMOD=/usr/bin/kmod
 
 define SYSTEMD_RUN_INTLTOOLIZE
-	cd $(@D) && $(HOST_DIR)/usr/bin/intltoolize --force --automake
+	cd $(@D) && $(HOST_DIR)/bin/intltoolize --force --automake
 endef
 SYSTEMD_PRE_CONFIGURE_HOOKS += SYSTEMD_RUN_INTLTOOLIZE
 
package/tcllib/tcllib.mk +1 -1
index 9eb3b7dbe9..bd98dd641e 100644
@@ -10,6 +10,6 @@ TCLLIB_SITE = http://downloads.sourceforge.net/project/tcllib/tcllib/$(TCLLIB_VE
 TCLLIB_LICENSE = tcl license
 TCLLIB_LICENSE_FILES = license.terms
 TCLLIB_DEPENDENCIES = host-tcl
-TCLLIB_CONF_ENV = ac_cv_path_tclsh="$(HOST_DIR)/usr/bin/tclsh$(TCL_VERSION_MAJOR)"
+TCLLIB_CONF_ENV = ac_cv_path_tclsh="$(HOST_DIR)/bin/tclsh$(TCL_VERSION_MAJOR)"
 
 $(eval $(autotools-package))
package/terminology/terminology.mk +1 -1
index a62a8e8a0d..dbfec2ed36 100644
@@ -11,6 +11,6 @@ TERMINOLOGY_LICENSE = BSD-2-Clause
 TERMINOLOGY_LICENSE_FILES = COPYING
 
 TERMINOLOGY_DEPENDENCIES = efl host-pkgconf
-TERMINOLOGY_CONF_OPTS = --with-edje-cc=$(HOST_DIR)/usr/bin/edje_cc
+TERMINOLOGY_CONF_OPTS = --with-edje-cc=$(HOST_DIR)/bin/edje_cc
 
 $(eval $(autotools-package))
package/thrift/thrift.mk +2 -2
index 185e1ec1c3..cbd5401dce 100644
@@ -63,7 +63,7 @@ endef
 THRIFT_POST_PATCH_HOOKS += THRIFT_TOOL_NO_HARDCODE
 
 define THRIFT_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) THRIFT=$(HOST_DIR)/usr/bin/thrift -C $(@D)
+	$(TARGET_MAKE_ENV) $(MAKE) THRIFT=$(HOST_DIR)/bin/thrift -C $(@D)
 endef
 
 # Install runtime only
@@ -75,4 +75,4 @@ $(eval $(autotools-package))
 $(eval $(host-autotools-package))
 
 # to be used by other packages
-THRIFT = $(HOST_DIR)/usr/bin/thrift
+THRIFT = $(HOST_DIR)/bin/thrift
package/tvheadend/tvheadend.mk +2 -2
index 0336019bc0..86b1d964b2 100644
@@ -79,7 +79,7 @@ define TVHEADEND_CONFIGURE_CMDS
 			--arch="$(ARCH)"			\
 			--cpu="$(BR2_GCC_TARGET_CPU)"		\
 			--nowerror				\
-			--python="$(HOST_DIR)/usr/bin/python"	\
+			--python="$(HOST_DIR)/bin/python"	\
 			--enable-dvbscan			\
 			--enable-bundle				\
 			--enable-pngquant			\
@@ -90,7 +90,7 @@ define TVHEADEND_CONFIGURE_CMDS
 endef
 
 define TVHEADEND_FIX_PNGQUANT_PATH
-	$(SED) "s%^pngquant_bin =.*%pngquant_bin = '$(HOST_DIR)/usr/bin/pngquant'%" \
+	$(SED) "s%^pngquant_bin =.*%pngquant_bin = '$(HOST_DIR)/bin/pngquant'%" \
 		$(@D)/support/mkbundle
 endef
 TVHEADEND_POST_CONFIGURE_HOOKS += TVHEADEND_FIX_PNGQUANT_PATH
package/uboot-tools/uboot-tools.mk +4 -4
index 2585c7b60a..7f808f6917 100644
@@ -102,9 +102,9 @@ define HOST_UBOOT_TOOLS_BUILD_CMDS
 endef
 
 define HOST_UBOOT_TOOLS_INSTALL_CMDS
-	$(INSTALL) -m 0755 -D $(@D)/tools/mkimage $(HOST_DIR)/usr/bin/mkimage
-	$(INSTALL) -m 0755 -D $(@D)/tools/mkenvimage $(HOST_DIR)/usr/bin/mkenvimage
-	$(INSTALL) -m 0755 -D $(@D)/tools/dumpimage $(HOST_DIR)/usr/bin/dumpimage
+	$(INSTALL) -m 0755 -D $(@D)/tools/mkimage $(HOST_DIR)/bin/mkimage
+	$(INSTALL) -m 0755 -D $(@D)/tools/mkenvimage $(HOST_DIR)/bin/mkenvimage
+	$(INSTALL) -m 0755 -D $(@D)/tools/dumpimage $(HOST_DIR)/bin/dumpimage
 endef
 
 $(eval $(generic-package))
@@ -112,7 +112,7 @@ $(eval $(host-generic-package))
 
 # Convenience variables for other mk files that make use of mkimage
 
-MKIMAGE = $(HOST_DIR)/usr/bin/mkimage
+MKIMAGE = $(HOST_DIR)/bin/mkimage
 
 # mkimage supports arm blackfin m68k microblaze mips mips64 nios2 powerpc ppc sh sparc sparc64 x86
 # KERNEL_ARCH can be arm64 arc arm blackfin m68k microblaze mips nios2 powerpc sh sparc i386 x86_64 xtensa
package/uclibc/uclibc.mk +4 -4
index 45bb6dede8..0dcc8ff8c5 100644
@@ -450,10 +450,10 @@ endef
 # STATIC has no ld* tools, only getconf
 ifeq ($(BR2_STATIC_LIBS),)
 define UCLIBC_INSTALL_UTILS_STAGING
-	$(INSTALL) -D -m 0755 $(@D)/utils/ldd.host $(HOST_DIR)/usr/bin/ldd
-	ln -sf ldd $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-ldd
-	$(INSTALL) -D -m 0755 $(@D)/utils/ldconfig.host $(HOST_DIR)/usr/bin/ldconfig
-	ln -sf ldconfig $(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-ldconfig
+	$(INSTALL) -D -m 0755 $(@D)/utils/ldd.host $(HOST_DIR)/bin/ldd
+	ln -sf ldd $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-ldd
+	$(INSTALL) -D -m 0755 $(@D)/utils/ldconfig.host $(HOST_DIR)/bin/ldconfig
+	ln -sf ldconfig $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-ldconfig
 endef
 endif
 
package/upx/upx.mk +1 -1
index 5ed86b3d92..eec88c743a 100644
@@ -23,7 +23,7 @@ endef
 
 # UPX has no install procedure, so install it manually.
 define HOST_UPX_INSTALL_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/src/upx.out $(HOST_DIR)/usr/bin/upx
+	$(INSTALL) -D -m 0755 $(@D)/src/upx.out $(HOST_DIR)/bin/upx
 endef
 
 $(eval $(host-generic-package))
package/vala/vala.mk +4 -4
index 0ef3000d76..ad0a5650f7 100644
@@ -20,12 +20,12 @@ HOST_VALA_CONF_ENV = ac_cv_path_XSLTPROC=:
 # Otherwise we'll get host directory data which isn't enough
 define HOST_VALA_INSTALL_WRAPPER
 	$(INSTALL) -D -m 0755 package/vala/vala-wrapper \
-		$(HOST_DIR)/usr/bin/vala
+		$(HOST_DIR)/bin/vala
 	$(INSTALL) -D -m 0755 package/vala/vala-wrapper \
-		$(HOST_DIR)/usr/bin/valac
+		$(HOST_DIR)/bin/valac
 	$(SED) 's, at VALA_VERSION@,$(VALA_VERSION_MAJOR),' \
-		$(HOST_DIR)/usr/bin/vala \
-		$(HOST_DIR)/usr/bin/valac
+		$(HOST_DIR)/bin/vala \
+		$(HOST_DIR)/bin/valac
 endef
 HOST_VALA_POST_INSTALL_HOOKS += HOST_VALA_INSTALL_WRAPPER
 
package/vlc/vlc.mk +3 -3
index 36b5fd3ea8..d6f843e66a 100644
@@ -359,9 +359,9 @@ endif
 ifeq ($(BR2_PACKAGE_QT_GUI_MODULE),y)
 VLC_CONF_OPTS += --enable-qt
 VLC_CONF_ENV += \
-	ac_cv_path_MOC=$(HOST_DIR)/usr/bin/moc \
-	ac_cv_path_RCC=$(HOST_DIR)/usr/bin/rcc \
-	ac_cv_path_UIC=$(HOST_DIR)/usr/bin/uic
+	ac_cv_path_MOC=$(HOST_DIR)/bin/moc \
+	ac_cv_path_RCC=$(HOST_DIR)/bin/rcc \
+	ac_cv_path_UIC=$(HOST_DIR)/bin/uic
 VLC_DEPENDENCIES += qt
 else
 VLC_CONF_OPTS += --disable-qt
package/waf/waf.mk +1 -1
index 3d61f267e6..e7ac891b39 100644
@@ -13,7 +13,7 @@ define HOST_WAF_EXTRACT_CMDS
 endef
 
 define HOST_WAF_INSTALL_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/waf $(HOST_DIR)/usr/bin/waf
+	$(INSTALL) -D -m 0755 $(@D)/waf $(HOST_DIR)/bin/waf
 endef
 
 $(eval $(host-generic-package))
package/wireshark/wireshark.mk +3 -3
index 14c29431fc..20371e3798 100644
@@ -44,9 +44,9 @@ WIRESHARK_DEPENDENCIES += qt5base qt5tools
 WIRESHARK_CONF_ENV += ac_cv_path_QTCHOOSER=""
 # Seems it expects wrappers and passes a -qt=X parameter for version
 WIRESHARK_MAKE_OPTS += \
-	MOC="$(HOST_DIR)/usr/bin/moc" \
-	RCC="$(HOST_DIR)/usr/bin/rcc" \
-	UIC="$(HOST_DIR)/usr/bin/uic"
+	MOC="$(HOST_DIR)/bin/moc" \
+	RCC="$(HOST_DIR)/bin/rcc" \
+	UIC="$(HOST_DIR)/bin/uic"
 else
 WIRESHARK_CONF_OPTS += --with-qt=no
 endif
package/x11r7/libxcb/libxcb.mk +2 -2
index ba42418633..32edbb9e90 100644
@@ -23,8 +23,8 @@ LIBXCB_CONF_OPTS = --with-doxygen=no
 HOST_LIBXCB_CONF_OPTS = --with-doxygen=no
 
 # libxcb is not python3 friendly, so force the python interpreter
-HOST_LIBXCB_CONF_OPTS += ac_cv_path_PYTHON=$(HOST_DIR)/usr/bin/python2
-LIBXCB_CONF_OPTS += ac_cv_path_PYTHON=$(HOST_DIR)/usr/bin/python2
+HOST_LIBXCB_CONF_OPTS += ac_cv_path_PYTHON=$(HOST_DIR)/bin/python2
+LIBXCB_CONF_OPTS += ac_cv_path_PYTHON=$(HOST_DIR)/bin/python2
 
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
package/x11r7/xfont_font-adobe-100dpi/xfont_font-adobe-100dpi.mk +2 -2
index 85a6884aee..9f01838688 100644
@@ -10,8 +10,8 @@ XFONT_FONT_ADOBE_100DPI_SITE = http://xorg.freedesktop.org/releases/individual/f
 XFONT_FONT_ADOBE_100DPI_LICENSE = MIT
 XFONT_FONT_ADOBE_100DPI_LICENSE_FILES = COPYING
 
-XFONT_FONT_ADOBE_100DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_ADOBE_100DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_ADOBE_100DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_ADOBE_100DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_ADOBE_100DPI_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-adobe-75dpi/xfont_font-adobe-75dpi.mk +2 -2
index bb0a184322..1a8af2bd59 100644
@@ -10,8 +10,8 @@ XFONT_FONT_ADOBE_75DPI_SITE = http://xorg.freedesktop.org/releases/individual/fo
 XFONT_FONT_ADOBE_75DPI_LICENSE = MIT
 XFONT_FONT_ADOBE_75DPI_LICENSE_FILES = COPYING
 
-XFONT_FONT_ADOBE_75DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_ADOBE_75DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_ADOBE_75DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_ADOBE_75DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_ADOBE_75DPI_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-adobe-utopia-100dpi/xfont_font-adobe-utopia-100dpi.mk +2 -2
index 390ca6784a..4ff89f6b1a 100644
@@ -10,8 +10,8 @@ XFONT_FONT_ADOBE_UTOPIA_100DPI_SITE = http://xorg.freedesktop.org/releases/indiv
 XFONT_FONT_ADOBE_UTOPIA_100DPI_LICENSE = Adobe License (no modification allowed)
 XFONT_FONT_ADOBE_UTOPIA_100DPI_LICENSE_FILES = COPYING
 
-XFONT_FONT_ADOBE_UTOPIA_100DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_ADOBE_UTOPIA_100DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_ADOBE_UTOPIA_100DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_ADOBE_UTOPIA_100DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_ADOBE_UTOPIA_100DPI_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-adobe-utopia-75dpi/xfont_font-adobe-utopia-75dpi.mk +2 -2
index 7ecd46ef11..61005f79bd 100644
@@ -10,8 +10,8 @@ XFONT_FONT_ADOBE_UTOPIA_75DPI_SITE = http://xorg.freedesktop.org/releases/indivi
 XFONT_FONT_ADOBE_UTOPIA_75DPI_LICENSE = Adobe License (no modification allowed)
 XFONT_FONT_ADOBE_UTOPIA_75DPI_LICENSE_FILES = COPYING
 
-XFONT_FONT_ADOBE_UTOPIA_75DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_ADOBE_UTOPIA_75DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_ADOBE_UTOPIA_75DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_ADOBE_UTOPIA_75DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_ADOBE_UTOPIA_75DPI_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-adobe-utopia-type1/xfont_font-adobe-utopia-type1.mk +2 -2
index 6c780e20dc..9264eaf436 100644
@@ -10,8 +10,8 @@ XFONT_FONT_ADOBE_UTOPIA_TYPE1_SITE = http://xorg.freedesktop.org/releases/indivi
 XFONT_FONT_ADOBE_UTOPIA_TYPE1_LICENSE = Adobe License (no modification allowed)
 XFONT_FONT_ADOBE_UTOPIA_TYPE1_LICENSE_FILES = COPYING
 
-XFONT_FONT_ADOBE_UTOPIA_TYPE1_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_ADOBE_UTOPIA_TYPE1_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_ADOBE_UTOPIA_TYPE1_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_ADOBE_UTOPIA_TYPE1_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_ADOBE_UTOPIA_TYPE1_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-alias/xfont_font-alias.mk +2 -2
index e2ac2363df..f6b3008aa0 100644
@@ -10,8 +10,8 @@ XFONT_FONT_ALIAS_SITE = http://xorg.freedesktop.org/releases/individual/font
 XFONT_FONT_ALIAS_LICENSE = MIT
 XFONT_FONT_ALIAS_LICENSE_FILES = COPYING
 
-XFONT_FONT_ALIAS_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_ALIAS_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_ALIAS_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_ALIAS_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_ALIAS_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-arabic-misc/xfont_font-arabic-misc.mk +2 -2
index fa1269b41d..0043a00c48 100644
@@ -10,8 +10,8 @@ XFONT_FONT_ARABIC_MISC_SITE = http://xorg.freedesktop.org/releases/individual/fo
 XFONT_FONT_ARABIC_MISC_LICENSE = MIT
 XFONT_FONT_ARABIC_MISC_LICENSE_FILES = COPYING
 
-XFONT_FONT_ARABIC_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_ARABIC_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_ARABIC_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_ARABIC_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_ARABIC_MISC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-bh-100dpi/xfont_font-bh-100dpi.mk +2 -2
index fb1665898f..9197272785 100644
@@ -10,8 +10,8 @@ XFONT_FONT_BH_100DPI_SITE = http://xorg.freedesktop.org/releases/individual/font
 XFONT_FONT_BH_100DPI_LICENSE = Bigelow & Holmes License (no modification)
 XFONT_FONT_BH_100DPI_LICENSE_FILES = COPYING
 
-XFONT_FONT_BH_100DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_BH_100DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_BH_100DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_BH_100DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_BH_100DPI_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-bh-75dpi/xfont_font-bh-75dpi.mk +2 -2
index c8ade590b8..62bee4202c 100644
@@ -10,8 +10,8 @@ XFONT_FONT_BH_75DPI_SITE = http://xorg.freedesktop.org/releases/individual/font
 XFONT_FONT_BH_75DPI_LICENSE = Bigelow & Holmes License (no modification)
 XFONT_FONT_BH_75DPI_LICENSE_FILES = COPYING
 
-XFONT_FONT_BH_75DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_BH_75DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_BH_75DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_BH_75DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_BH_75DPI_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-bh-lucidatypewriter-100dpi/xfont_font-bh-lucidatypewriter-100dpi.mk +2 -2
index a1b61db4c8..0f039a1d48 100644
@@ -10,8 +10,8 @@ XFONT_FONT_BH_LUCIDATYPEWRITER_100DPI_SITE = http://xorg.freedesktop.org/release
 XFONT_FONT_BH_LUCIDATYPEWRITER_100DPI_LICENSE = Bigelow & Holmes License (no modification)
 XFONT_FONT_BH_LUCIDATYPEWRITER_100DPI_LICENSE_FILES = COPYING
 
-XFONT_FONT_BH_LUCIDATYPEWRITER_100DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_BH_LUCIDATYPEWRITER_100DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_BH_LUCIDATYPEWRITER_100DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_BH_LUCIDATYPEWRITER_100DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_BH_LUCIDATYPEWRITER_100DPI_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-bh-lucidatypewriter-75dpi/xfont_font-bh-lucidatypewriter-75dpi.mk +2 -2
index 00a6bd6dc7..892f9eeab5 100644
@@ -10,8 +10,8 @@ XFONT_FONT_BH_LUCIDATYPEWRITER_75DPI_SITE = http://xorg.freedesktop.org/releases
 XFONT_FONT_BH_LUCIDATYPEWRITER_75DPI_LICENSE = Bigelow & Holmes License (no modification)
 XFONT_FONT_BH_LUCIDATYPEWRITER_75DPI_LICENSE_FILES = COPYING
 
-XFONT_FONT_BH_LUCIDATYPEWRITER_75DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_BH_LUCIDATYPEWRITER_75DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_BH_LUCIDATYPEWRITER_75DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_BH_LUCIDATYPEWRITER_75DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_BH_LUCIDATYPEWRITER_75DPI_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-bh-ttf/xfont_font-bh-ttf.mk +2 -2
index f393dd3244..f4fcde9c2a 100644
@@ -10,8 +10,8 @@ XFONT_FONT_BH_TTF_SITE = http://xorg.freedesktop.org/releases/individual/font
 XFONT_FONT_BH_TTF_LICENSE = Bigelow & Holmes License (no modification)
 XFONT_FONT_BH_TTF_LICENSE_FILES = COPYING
 
-XFONT_FONT_BH_TTF_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_BH_TTF_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_BH_TTF_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_BH_TTF_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_BH_TTF_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-bh-type1/xfont_font-bh-type1.mk +2 -2
index bf418d52cb..f5e6e89242 100644
@@ -10,8 +10,8 @@ XFONT_FONT_BH_TYPE1_SITE = http://xorg.freedesktop.org/releases/individual/font
 XFONT_FONT_BH_TYPE1_LICENSE = Bigelow & Holmes License (no modification)
 XFONT_FONT_BH_TYPE1_LICENSE_FILES = COPYING
 
-XFONT_FONT_BH_TYPE1_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_BH_TYPE1_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_BH_TYPE1_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_BH_TYPE1_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_BH_TYPE1_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-bitstream-100dpi/xfont_font-bitstream-100dpi.mk +2 -2
index 5ddca73e7c..931058f77c 100644
@@ -10,8 +10,8 @@ XFONT_FONT_BITSTREAM_100DPI_SITE = http://xorg.freedesktop.org/releases/individu
 XFONT_FONT_BITSTREAM_100DPI_LICENSE = MIT
 XFONT_FONT_BITSTREAM_100DPI_LICENSE_FILES = COPYING
 
-XFONT_FONT_BITSTREAM_100DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_BITSTREAM_100DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_BITSTREAM_100DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_BITSTREAM_100DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_BITSTREAM_100DPI_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-bitstream-75dpi/xfont_font-bitstream-75dpi.mk +2 -2
index d7fea275bc..9e77524343 100644
@@ -10,8 +10,8 @@ XFONT_FONT_BITSTREAM_75DPI_SITE = http://xorg.freedesktop.org/releases/individua
 XFONT_FONT_BITSTREAM_75DPI_LICENSE = MIT
 XFONT_FONT_BITSTREAM_75DPI_LICENSE_FILES = COPYING
 
-XFONT_FONT_BITSTREAM_75DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_BITSTREAM_75DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_BITSTREAM_75DPI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_BITSTREAM_75DPI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_BITSTREAM_75DPI_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-bitstream-type1/xfont_font-bitstream-type1.mk +2 -2
index 813e3cb5a8..a4d4f73ccd 100644
@@ -10,8 +10,8 @@ XFONT_FONT_BITSTREAM_TYPE1_SITE = http://xorg.freedesktop.org/releases/individua
 XFONT_FONT_BITSTREAM_TYPE1_LICENSE = MIT
 XFONT_FONT_BITSTREAM_TYPE1_LICENSE_FILES = COPYING
 
-XFONT_FONT_BITSTREAM_TYPE1_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_BITSTREAM_TYPE1_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_BITSTREAM_TYPE1_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_BITSTREAM_TYPE1_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_BITSTREAM_TYPE1_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-cronyx-cyrillic/xfont_font-cronyx-cyrillic.mk +2 -2
index 6dc9015236..83ded01ef4 100644
@@ -10,8 +10,8 @@ XFONT_FONT_CRONYX_CYRILLIC_SITE = http://xorg.freedesktop.org/releases/individua
 XFONT_FONT_CRONYX_CYRILLIC_LICENSE = MIT
 XFONT_FONT_CRONYX_CYRILLIC_LICENSE_FILES = COPYING
 
-XFONT_FONT_CRONYX_CYRILLIC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_CRONYX_CYRILLIC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_CRONYX_CYRILLIC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_CRONYX_CYRILLIC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_CRONYX_CYRILLIC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-cursor-misc/xfont_font-cursor-misc.mk +2 -2
index 59d6a84003..00867a6f26 100644
@@ -10,8 +10,8 @@ XFONT_FONT_CURSOR_MISC_SITE = http://xorg.freedesktop.org/releases/individual/fo
 XFONT_FONT_CURSOR_MISC_LICENSE = unencumbered
 XFONT_FONT_CURSOR_MISC_LICENSE_FILES = COPYING
 
-XFONT_FONT_CURSOR_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_CURSOR_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_CURSOR_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_CURSOR_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_CURSOR_MISC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-daewoo-misc/xfont_font-daewoo-misc.mk +2 -2
index 59a84c701c..f33088eb50 100644
@@ -9,8 +9,8 @@ XFONT_FONT_DAEWOO_MISC_SOURCE = font-daewoo-misc-$(XFONT_FONT_DAEWOO_MISC_VERSIO
 XFONT_FONT_DAEWOO_MISC_SITE = http://xorg.freedesktop.org/releases/individual/font
 XFONT_FONT_DAEWOO_MISC_LICENSE_FILES = COPYING
 
-XFONT_FONT_DAEWOO_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_DAEWOO_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_DAEWOO_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_DAEWOO_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_DAEWOO_MISC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-dec-misc/xfont_font-dec-misc.mk +2 -2
index b26296d2d0..fd7e286561 100644
@@ -10,8 +10,8 @@ XFONT_FONT_DEC_MISC_SITE = http://xorg.freedesktop.org/releases/individual/font
 XFONT_FONT_DEC_MISC_LICENSE = MIT
 XFONT_FONT_DEC_MISC_LICENSE_FILES = COPYING
 
-XFONT_FONT_DEC_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_DEC_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_DEC_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_DEC_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_DEC_MISC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-ibm-type1/xfont_font-ibm-type1.mk +2 -2
index 6cec198686..045a6bfe2a 100644
@@ -10,8 +10,8 @@ XFONT_FONT_IBM_TYPE1_SITE = http://xorg.freedesktop.org/releases/individual/font
 XFONT_FONT_IBM_TYPE1_LICENSE = IBM/MIT X Consortium Courier Typefont agreement (no modification)
 XFONT_FONT_IBM_TYPE1_LICENSE_FILES = COPYING
 
-XFONT_FONT_IBM_TYPE1_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_IBM_TYPE1_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_IBM_TYPE1_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_IBM_TYPE1_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_IBM_TYPE1_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-isas-misc/xfont_font-isas-misc.mk +2 -2
index 4ac4b9b14d..7ca1388e1f 100644
@@ -10,8 +10,8 @@ XFONT_FONT_ISAS_MISC_SITE = http://xorg.freedesktop.org/releases/individual/font
 XFONT_FONT_ISAS_MISC_LICENSE = MIT
 XFONT_FONT_ISAS_MISC_LICENSE_FILES = COPYING
 
-XFONT_FONT_ISAS_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_ISAS_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_ISAS_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_ISAS_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_ISAS_MISC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-jis-misc/xfont_font-jis-misc.mk +2 -2
index 5f8b00161a..12cf8c863c 100644
@@ -9,8 +9,8 @@ XFONT_FONT_JIS_MISC_SOURCE = font-jis-misc-$(XFONT_FONT_JIS_MISC_VERSION).tar.bz
 XFONT_FONT_JIS_MISC_SITE = http://xorg.freedesktop.org/releases/individual/font
 XFONT_FONT_JIS_MISC_LICENSE_FILES = COPYING
 
-XFONT_FONT_JIS_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_JIS_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_JIS_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_JIS_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_JIS_MISC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-micro-misc/xfont_font-micro-misc.mk +2 -2
index 11b4199e4b..ea119b63bc 100644
@@ -10,8 +10,8 @@ XFONT_FONT_MICRO_MISC_SITE = http://xorg.freedesktop.org/releases/individual/fon
 XFONT_FONT_MICRO_MISC_LICENSE = Public Domain
 XFONT_FONT_MICRO_MISC_LICENSE_FILES = COPYING
 
-XFONT_FONT_MICRO_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_MICRO_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_MICRO_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_MICRO_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_MICRO_MISC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-misc-cyrillic/xfont_font-misc-cyrillic.mk +2 -2
index 16fd46b09d..d72f988589 100644
@@ -10,8 +10,8 @@ XFONT_FONT_MISC_CYRILLIC_SITE = http://xorg.freedesktop.org/releases/individual/
 XFONT_FONT_MISC_CYRILLIC_LICENSE = MIT / Public Domain
 XFONT_FONT_MISC_CYRILLIC_LICENSE_FILES = COPYING
 
-XFONT_FONT_MISC_CYRILLIC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_MISC_CYRILLIC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_MISC_CYRILLIC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_MISC_CYRILLIC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_MISC_CYRILLIC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-misc-ethiopic/xfont_font-misc-ethiopic.mk +2 -2
index 7d0825ee5c..8214040f9f 100644
@@ -10,8 +10,8 @@ XFONT_FONT_MISC_ETHIOPIC_SITE = http://xorg.freedesktop.org/releases/individual/
 XFONT_FONT_MISC_ETHIOPIC_LICENSE = MIT
 XFONT_FONT_MISC_ETHIOPIC_LICENSE_FILES = COPYING
 
-XFONT_FONT_MISC_ETHIOPIC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_MISC_ETHIOPIC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_MISC_ETHIOPIC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_MISC_ETHIOPIC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_MISC_ETHIOPIC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-misc-meltho/xfont_font-misc-meltho.mk +2 -2
index 5667869951..1b801df60c 100644
@@ -10,8 +10,8 @@ XFONT_FONT_MISC_MELTHO_SITE = http://xorg.freedesktop.org/releases/individual/fo
 XFONT_FONT_MISC_MELTHO_LICENSE = Meltho License
 XFONT_FONT_MISC_MELTHO_LICENSE_FILES = COPYING
 
-XFONT_FONT_MISC_MELTHO_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_MISC_MELTHO_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_MISC_MELTHO_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_MISC_MELTHO_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_MISC_MELTHO_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-misc-misc/xfont_font-misc-misc.mk +2 -2
index 700837c1ed..f9e1ba6481 100644
@@ -10,8 +10,8 @@ XFONT_FONT_MISC_MISC_SITE = http://xorg.freedesktop.org/releases/individual/font
 XFONT_FONT_MISC_MISC_LICENSE = Public Domain
 XFONT_FONT_MISC_MISC_LICENSE_FILES = COPYING
 
-XFONT_FONT_MISC_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_MISC_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_MISC_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_MISC_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_MISC_MISC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-mutt-misc/xfont_font-mutt-misc.mk +2 -2
index 53fc192a9a..1312e379c5 100644
@@ -10,8 +10,8 @@ XFONT_FONT_MUTT_MISC_SITE = http://xorg.freedesktop.org/releases/individual/font
 XFONT_FONT_MUTT_MISC_LICENSE = MIT
 XFONT_FONT_MUTT_MISC_LICENSE_FILES = COPYING
 
-XFONT_FONT_MUTT_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_MUTT_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_MUTT_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_MUTT_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_MUTT_MISC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-schumacher-misc/xfont_font-schumacher-misc.mk +2 -2
index 0fa4d39616..65256ad977 100644
@@ -10,8 +10,8 @@ XFONT_FONT_SCHUMACHER_MISC_SITE = http://xorg.freedesktop.org/releases/individua
 XFONT_FONT_SCHUMACHER_MISC_LICENSE = MIT
 XFONT_FONT_SCHUMACHER_MISC_LICENSE_FILES = COPYING
 
-XFONT_FONT_SCHUMACHER_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_SCHUMACHER_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_SCHUMACHER_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_SCHUMACHER_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_SCHUMACHER_MISC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-screen-cyrillic/xfont_font-screen-cyrillic.mk +2 -2
index 8158ce5614..5687fd66cf 100644
@@ -10,8 +10,8 @@ XFONT_FONT_SCREEN_CYRILLIC_SITE = http://xorg.freedesktop.org/releases/individua
 XFONT_FONT_SCREEN_CYRILLIC_LICENSE = MIT
 XFONT_FONT_SCREEN_CYRILLIC_LICENSE_FILES = COPYING
 
-XFONT_FONT_SCREEN_CYRILLIC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_SCREEN_CYRILLIC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_SCREEN_CYRILLIC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_SCREEN_CYRILLIC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_SCREEN_CYRILLIC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-sony-misc/xfont_font-sony-misc.mk +2 -2
index 035255f77a..f13fca5da3 100644
@@ -10,8 +10,8 @@ XFONT_FONT_SONY_MISC_SITE = http://xorg.freedesktop.org/releases/individual/font
 XFONT_FONT_SONY_MISC_LICENSE = MIT
 XFONT_FONT_SONY_MISC_LICENSE_FILES = COPYING
 
-XFONT_FONT_SONY_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_SONY_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_SONY_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_SONY_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_SONY_MISC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-sun-misc/xfont_font-sun-misc.mk +2 -2
index 395cb87e76..4b1a06c0a8 100644
@@ -10,8 +10,8 @@ XFONT_FONT_SUN_MISC_SITE = http://xorg.freedesktop.org/releases/individual/font
 XFONT_FONT_SUN_MISC_LICENSE = MIT
 XFONT_FONT_SUN_MISC_LICENSE_FILES = COPYING
 
-XFONT_FONT_SUN_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_SUN_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_SUN_MISC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_SUN_MISC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_SUN_MISC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-winitzki-cyrillic/xfont_font-winitzki-cyrillic.mk +2 -2
index 665fb90896..f8945227ef 100644
@@ -10,8 +10,8 @@ XFONT_FONT_WINITZKI_CYRILLIC_SITE = http://xorg.freedesktop.org/releases/individ
 XFONT_FONT_WINITZKI_CYRILLIC_LICENSE = Public Domain
 XFONT_FONT_WINITZKI_CYRILLIC_LICENSE_FILES = COPYING
 
-XFONT_FONT_WINITZKI_CYRILLIC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_WINITZKI_CYRILLIC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_WINITZKI_CYRILLIC_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_WINITZKI_CYRILLIC_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_WINITZKI_CYRILLIC_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x11r7/xfont_font-xfree86-type1/xfont_font-xfree86-type1.mk +2 -2
index e1a2ef6067..5aced63097 100644
@@ -10,8 +10,8 @@ XFONT_FONT_XFREE86_TYPE1_SITE = http://xorg.freedesktop.org/releases/individual/
 XFONT_FONT_XFREE86_TYPE1_LICENSE = MIT
 XFONT_FONT_XFREE86_TYPE1_LICENSE_FILES = COPYING
 
-XFONT_FONT_XFREE86_TYPE1_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install
-XFONT_FONT_XFREE86_TYPE1_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/usr/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/usr/bin/mkfontdir install-data
+XFONT_FONT_XFREE86_TYPE1_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install
+XFONT_FONT_XFREE86_TYPE1_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) MKFONTSCALE=$(HOST_DIR)/bin/mkfontscale MKFONTDIR=$(HOST_DIR)/bin/mkfontdir install-data
 XFONT_FONT_XFREE86_TYPE1_DEPENDENCIES = xfont_font-util host-xfont_font-util host-xapp_mkfontscale host-xapp_mkfontdir host-xapp_bdftopcf
 
 $(eval $(autotools-package))
package/x264/x264.mk +1 -1
index 7214c967f1..8a90add79e 100644
@@ -15,7 +15,7 @@ X264_CONF_OPTS = --disable-avs
 ifeq ($(BR2_i386)$(BR2_x86_64),y)
 # yasm needed for assembly files
 X264_DEPENDENCIES += host-yasm
-X264_CONF_ENV += AS="$(HOST_DIR)/usr/bin/yasm"
+X264_CONF_ENV += AS="$(HOST_DIR)/bin/yasm"
 else ifeq ($(BR2_ARM_CPU_ARMV7A)$(BR2_aarch64),y)
 # We need to pass gcc as AS, because the ARM assembly files have to be
 # preprocessed
package/xen/xen.mk +1 -1
index 2e388fc3c1..b3d4b8e972 100644
@@ -19,7 +19,7 @@ endif
 
 XEN_CONF_OPTS = --disable-ocamltools
 
-XEN_CONF_ENV = PYTHON=$(HOST_DIR)/usr/bin/python2
+XEN_CONF_ENV = PYTHON=$(HOST_DIR)/bin/python2
 XEN_MAKE_ENV = \
 	XEN_TARGET_ARCH=$(XEN_ARCH) \
 	CROSS_COMPILE=$(TARGET_CROSS) \
package/yaffs2utils/yaffs2utils.mk +1 -1
index 927ffd6a11..c2a87eac7b 100644
@@ -15,7 +15,7 @@ define HOST_YAFFS2UTILS_BUILD_CMDS
 endef
 
 define HOST_YAFFS2UTILS_INSTALL_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) INSTALLDIR=$(HOST_DIR)/usr/bin install
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) INSTALLDIR=$(HOST_DIR)/bin install
 endef
 
 $(eval $(host-generic-package))
package/zynq-boot-bin/zynq-boot-bin.mk +1 -1
index f5f2f10d1d..3648c63654 100644
@@ -16,7 +16,7 @@ define HOST_ZYNQ_BOOT_BIN_EXTRACT_CMDS
 endef
 
 define HOST_ZYNQ_BOOT_BIN_INSTALL_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/$(ZYNQ_BOOT_BIN_SOURCE) $(HOST_DIR)/usr/bin/$(ZYNQ_BOOT_BIN_SOURCE)
+	$(INSTALL) -D -m 0755 $(@D)/$(ZYNQ_BOOT_BIN_SOURCE) $(HOST_DIR)/bin/$(ZYNQ_BOOT_BIN_SOURCE)
 endef
 
 $(eval $(host-generic-package))
support/dependencies/check-host-cmake.mk +1 -1
index 8002278a3b..39341f9573 100644
@@ -13,6 +13,6 @@ BR2_CMAKE_VERSION_MIN = 3.1
 BR2_CMAKE ?= cmake
 ifeq ($(call suitable-host-package,cmake,\
 	$(BR2_CMAKE) $(BR2_CMAKE_VERSION_MIN)),)
-BR2_CMAKE = $(HOST_DIR)/usr/bin/cmake
+BR2_CMAKE = $(HOST_DIR)/bin/cmake
 BR2_CMAKE_HOST_DEPENDENCY = host-cmake
 endif
support/dependencies/check-host-lzip.mk +1 -1
index 6acfdc6dfa..00cdd0a236 100644
@@ -1,5 +1,5 @@
 ifeq (,$(call suitable-host-package,lzip,$(LZCAT)))
 DEPENDENCIES_HOST_PREREQ += host-lzip
 EXTRACTOR_DEPENDENCY_PRECHECKED_EXTENSIONS += .lz
-LZCAT = $(HOST_DIR)/usr/bin/lzip -d -c
+LZCAT = $(HOST_DIR)/bin/lzip -d -c
 endif
support/dependencies/check-host-tar.mk +1 -1
index 9840a55e28..ad0b32e277 100644
@@ -2,5 +2,5 @@ TAR ?= tar
 
 ifeq (,$(call suitable-host-package,tar,$(TAR)))
 DEPENDENCIES_HOST_PREREQ += host-tar
-TAR = $(HOST_DIR)/usr/bin/tar
+TAR = $(HOST_DIR)/bin/tar
 endif
support/dependencies/check-host-xzcat.mk +1 -1
index c6d9eebe4d..9be75c7311 100644
@@ -4,5 +4,5 @@
 ifeq (,$(call suitable-host-package,xzcat,$(XZCAT)))
 DEPENDENCIES_HOST_PREREQ += host-xz
 EXTRACTOR_DEPENDENCY_PRECHECKED_EXTENSIONS += .xz .lzma
-XZCAT = $(HOST_DIR)/usr/bin/xzcat
+XZCAT = $(HOST_DIR)/bin/xzcat
 endif
toolchain/toolchain-external/pkg-toolchain-external.mk +4 -4
index 9dc6e31df3..364173bd5a 100644
@@ -55,7 +55,7 @@
 #  so we're sure the correct configuration is always used and the
 #  toolchain behaves similar to an internal toolchain.
 #  This toolchain wrapper and symlinks are installed into
-#  $(HOST_DIR)/usr/bin like for the internal toolchains, and the rest
+#  $(HOST_DIR)/bin like for the internal toolchains, and the rest
 #  of Buildroot is handled identical for the 2 toolchain types.
 ################################################################################
 
@@ -231,13 +231,13 @@ endif
 
 #
 # The following functions creates the symbolic links needed to get the
-# cross-compilation tools visible in $(HOST_DIR)/usr/bin. Some of
+# cross-compilation tools visible in $(HOST_DIR)/bin. Some of
 # links are done directly to the corresponding tool in the external
 # toolchain installation directory, while some other links are done to
 # the toolchain wrapper (preprocessor, C, C++ and Fortran compiler)
 #
 # We skip gdb symlink when we are building our own gdb to prevent two
-# gdb's in $(HOST_DIR)/usr/bin.
+# gdb's in $(HOST_DIR)/bin.
 #
 # The LTO support in gcc creates wrappers for ar, ranlib and nm which load
 # the lto plugin. These wrappers are called *-gcc-ar, *-gcc-ranlib, and
@@ -246,7 +246,7 @@ endif
 # match the *cc-* pattern. Therefore, an additional case is added for *-ar,
 # *-ranlib and *-nm.
 define TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER
-	$(Q)cd $(HOST_DIR)/usr/bin; \
+	$(Q)cd $(HOST_DIR)/bin; \
 	for i in $(TOOLCHAIN_EXTERNAL_CROSS)*; do \
 		base=$${i##*/}; \
 		case "$$base" in \
toolchain/toolchain-wrapper.c +2 -2
index 3a4455ff82..9778d0b0a4 100644
@@ -208,14 +208,14 @@ int main(int argc, char **argv)
 #elif defined(BR_CROSS_PATH_ABS)
 	ret = snprintf(path, sizeof(path), BR_CROSS_PATH_ABS "/%s" BR_CROSS_PATH_SUFFIX, basename);
 #else
-	ret = snprintf(path, sizeof(path), "%s/usr/bin/%s" BR_CROSS_PATH_SUFFIX, absbasedir, basename);
+	ret = snprintf(path, sizeof(path), "%s/bin/%s" BR_CROSS_PATH_SUFFIX, absbasedir, basename);
 #endif
 	if (ret >= sizeof(path)) {
 		perror(__FILE__ ": overflow");
 		return 3;
 	}
 #ifdef BR_CCACHE
-	ret = snprintf(ccache_path, sizeof(ccache_path), "%s/usr/bin/ccache", absbasedir);
+	ret = snprintf(ccache_path, sizeof(ccache_path), "%s/bin/ccache", absbasedir);
 	if (ret >= sizeof(ccache_path)) {
 		perror(__FILE__ ": overflow");
 		return 3;
toolchain/toolchain-wrapper.mk +1 -1
index c7b50195d3..7f72a0cade 100644
@@ -44,5 +44,5 @@ endef
 
 define TOOLCHAIN_WRAPPER_INSTALL
 	$(INSTALL) -D -m 0755 $(@D)/toolchain-wrapper \
-		$(HOST_DIR)/usr/bin/toolchain-wrapper
+		$(HOST_DIR)/bin/toolchain-wrapper
 endef
Signature · 1 line
2.11.0
#21 lore raw

PATCH 19/53 Globally replace $(HOST_DIR)/usr/sbin with $(HOST_DIR)/sbin

In reply to Arnout Vandecappelle (Essensium/Mind)

Since things are no longer installed in $(HOST_DIR)/usr, the callers should also not refer to it.

This is a mechanical change with
git grep -l '$(HOST_DIR)/usr/sbin' | xargs sed -i 's%$(HOST_DIR)/usr/sbin%$(HOST_DIR)/sbin%g'

---
 fs/ubifs/ubi.mk                          | 2 +-
 fs/ubifs/ubifs.mk                        | 2 +-
 package/freescale-imx/imx-uuc/imx-uuc.mk | 2 +-
 package/gptfdisk/gptfdisk.mk             | 2 +-
 package/libselinux/libselinux.mk         | 2 +-
 package/mtd/mtd.mk                       | 4 ++--
 package/tzdump/tzdump.mk                 | 4 ++--
 package/zic/zic.mk                       | 4 ++--
 8 files changed, 11 insertions(+), 11 deletions(-)
fs/ubifs/ubi.mk +1 -1
index e488cb5f8a..2baece5fb0 100644
@@ -25,7 +25,7 @@ endif
 define ROOTFS_UBI_CMD
 	sed 's;BR2_ROOTFS_UBIFS_PATH;$@fs;' \
 		$(UBINIZE_CONFIG_FILE_PATH) > $(BUILD_DIR)/ubinize.cfg
-	$(HOST_DIR)/usr/sbin/ubinize -o $@ $(UBI_UBINIZE_OPTS) $(BUILD_DIR)/ubinize.cfg
+	$(HOST_DIR)/sbin/ubinize -o $@ $(UBI_UBINIZE_OPTS) $(BUILD_DIR)/ubinize.cfg
 	rm $(BUILD_DIR)/ubinize.cfg
 endef
 
fs/ubifs/ubifs.mk +1 -1
index f1e4126e86..7b2b0fb2cc 100644
@@ -21,7 +21,7 @@ UBIFS_OPTS += $(call qstrip,$(BR2_TARGET_ROOTFS_UBIFS_OPTS))
 ROOTFS_UBIFS_DEPENDENCIES = host-mtd
 
 define ROOTFS_UBIFS_CMD
-	$(HOST_DIR)/usr/sbin/mkfs.ubifs -d $(TARGET_DIR) $(UBIFS_OPTS) -o $@
+	$(HOST_DIR)/sbin/mkfs.ubifs -d $(TARGET_DIR) $(UBIFS_OPTS) -o $@
 endef
 
 $(eval $(call ROOTFS_TARGET,ubifs))
package/freescale-imx/imx-uuc/imx-uuc.mk +1 -1
index c05cee31db..f24216da26 100644
@@ -21,7 +21,7 @@ define IMX_UUC_INSTALL_TARGET_CMDS
 	$(INSTALL) -D -m 755 $(@D)/uuc $(TARGET_DIR)/usr/bin/uuc
 	$(INSTALL) -D -m 755 $(@D)/sdimage $(TARGET_DIR)/usr/bin/sdimage
 	dd if=/dev/zero of=$(TARGET_DIR)/fat bs=1M count=1
-	$(HOST_DIR)/usr/sbin/mkfs.vfat $(TARGET_DIR)/fat
+	$(HOST_DIR)/sbin/mkfs.vfat $(TARGET_DIR)/fat
 endef
 
 define IMX_UUC_INSTALL_INIT_SYSV
package/gptfdisk/gptfdisk.mk +1 -1
index 56be76543c..2efa47cceb 100644
@@ -53,7 +53,7 @@ define HOST_GPTFDISK_BUILD_CMDS
 endef
 
 define HOST_GPTFDISK_INSTALL_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/sgdisk $(HOST_DIR)/usr/sbin/sgdisk
+	$(INSTALL) -D -m 0755 $(@D)/sgdisk $(HOST_DIR)/sbin/sgdisk
 endef
 
 $(eval $(generic-package))
package/libselinux/libselinux.mk +1 -1
index ca7836f162..75cf8e30e3 100644
@@ -100,7 +100,7 @@ endef
 define HOST_LIBSELINUX_INSTALL_CMDS
 	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) \
 		$(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) \
-		SHLIBDIR=$(HOST_DIR)/usr/lib SBINDIR=$(HOST_DIR)/usr/sbin install
+		SHLIBDIR=$(HOST_DIR)/usr/lib SBINDIR=$(HOST_DIR)/sbin install
 	(cd $(HOST_DIR)/usr/lib; $(HOSTLN) -sf libselinux.so.1 libselinux.so)
 	# Install python interface wrapper
 	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) \
package/mtd/mtd.mk +2 -2
index d6f0be2773..218265af9f 100644
@@ -49,8 +49,8 @@ define HOST_MTD_INSTALL_CMDS
 	$(MAKE1) BUILDDIR=$(@D) DESTDIR=$(HOST_DIR) -C $(@D) install
 endef
 
-MKFS_JFFS2 = $(HOST_DIR)/usr/sbin/mkfs.jffs2
-SUMTOOL = $(HOST_DIR)/usr/sbin/sumtool
+MKFS_JFFS2 = $(HOST_DIR)/sbin/mkfs.jffs2
+SUMTOOL = $(HOST_DIR)/sbin/sumtool
 
 MTD_STAGING_y = lib/libmtd.a ubi-utils/libubi.a
 MTD_TARGETS_$(BR2_PACKAGE_MTD_DOCFDISK)		+= docfdisk
package/tzdump/tzdump.mk +2 -2
index 3f035a56cb..baad978c4f 100644
@@ -13,9 +13,9 @@ define HOST_TZDUMP_BUILD_CMDS
 endef
 
 define HOST_TZDUMP_INSTALL_CMDS
-	$(INSTALL) -m 0755 -D $(@D)/tzdump $(HOST_DIR)/usr/sbin/tzdump
+	$(INSTALL) -m 0755 -D $(@D)/tzdump $(HOST_DIR)/sbin/tzdump
 endef
 
 $(eval $(host-generic-package))
 
-TZDUMP = $(HOST_DIR)/usr/sbin/tzdump
+TZDUMP = $(HOST_DIR)/sbin/tzdump
package/zic/zic.mk +2 -2
index 2419c0c20f..ad2acdff20 100644
@@ -15,10 +15,10 @@ define HOST_ZIC_BUILD_CMDS
 endef
 
 define HOST_ZIC_INSTALL_CMDS
-	$(INSTALL) -D -m 755 $(@D)/zic $(HOST_DIR)/usr/sbin/zic
+	$(INSTALL) -D -m 755 $(@D)/zic $(HOST_DIR)/sbin/zic
 	$(INSTALL) -D -m 644 $(@D)/tzfile.h $(HOST_DIR)/usr/include/tzfile.h
 endef
 
 $(eval $(host-generic-package))
 
-ZIC = $(HOST_DIR)/usr/sbin/zic
+ZIC = $(HOST_DIR)/sbin/zic
Signature · 1 line
2.11.0
#22 lore raw

PATCH 20/53 Globally replace $(HOST_DIR)/usr/lib with $(HOST_DIR)/lib

In reply to Arnout Vandecappelle (Essensium/Mind)

Since things are no longer installed in $(HOST_DIR)/usr, the callers should also not refer to it.

This is a mechanical change with
git grep -l '$(HOST_DIR)/usr/lib' | xargs sed -i 's%$(HOST_DIR)/usr/lib%$(HOST_DIR)/lib%g'

---
 boot/grub2/grub2.mk                              | 4 ++--
 package/4th/4th.mk                               | 4 ++--
 package/Makefile.in                              | 6 +++---
 package/acl/acl.mk                               | 2 +-
 package/efl/efl.mk                               | 2 +-
 package/ejabberd/ejabberd.mk                     | 2 +-
 package/execline/execline.mk                     | 4 ++--
 package/gdk-pixbuf/gdk-pixbuf.mk                 | 4 ++--
 package/go-bootstrap/go-bootstrap.mk             | 2 +-
 package/go/go.mk                                 | 2 +-
 package/gtest/gtest.mk                           | 2 +-
 package/heimdal/heimdal.mk                       | 4 ++--
 package/leafnode2/leafnode2.mk                   | 2 +-
 package/libselinux/libselinux.mk                 | 8 ++++----
 package/libsemanage/libsemanage.mk               | 4 ++--
 package/libsepol/libsepol.mk                     | 2 +-
 package/libxml-parser-perl/libxml-parser-perl.mk | 6 +++---
 package/lua/lua.mk                               | 2 +-
 package/mfgtools/mfgtools.mk                     | 2 +-
 package/mono/mono.mk                             | 4 ++--
 package/monolite/monolite.mk                     | 4 ++--
 package/owfs/owfs.mk                             | 2 +-
 package/pseudo/pseudo.mk                         | 4 ++--
 package/python-cffi/python-cffi.mk               | 2 +-
 package/s6-rc/s6-rc.mk                           | 4 ++--
 package/s6/s6.mk                                 | 4 ++--
 package/scons/scons.mk                           | 2 +-
 package/setools/setools.mk                       | 4 ++--
 28 files changed, 47 insertions(+), 47 deletions(-)
boot/grub2/grub2.mk +2 -2
index 698cb19980..80f06c7f02 100644
@@ -79,7 +79,7 @@ GRUB2_INSTALL_TARGET_OPTS = DESTDIR=$(HOST_DIR) install
 
 ifeq ($(BR2_TARGET_GRUB2_I386_PC),y)
 define GRUB2_IMAGE_INSTALL_ELTORITO
-	cat $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE)/cdboot.img $(GRUB2_IMAGE) > \
+	cat $(HOST_DIR)/lib/grub/$(GRUB2_TUPLE)/cdboot.img $(GRUB2_IMAGE) > \
 		$(BINARIES_DIR)/grub-eltorito.img
 endef
 endif
@@ -87,7 +87,7 @@ endif
 define GRUB2_IMAGE_INSTALLATION
 	mkdir -p $(dir $(GRUB2_IMAGE))
 	$(HOST_DIR)/bin/grub-mkimage \
-		-d $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE) \
+		-d $(HOST_DIR)/lib/grub/$(GRUB2_TUPLE) \
 		-O $(GRUB2_TUPLE) \
 		-o $(GRUB2_IMAGE) \
 		-p "$(GRUB2_PREFIX)" \
package/4th/4th.mk +2 -2
index 7076519d16..c10b1db15c 100644
@@ -60,10 +60,10 @@ endef
 
 define HOST_4TH_INSTALL_CMDS
 	mkdir -p $(HOST_DIR)/bin
-	mkdir -p $(HOST_DIR)/usr/lib
+	mkdir -p $(HOST_DIR)/lib
 	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/sources mostlyinstall \
 		BINARIES=$(HOST_DIR)/bin \
-		LIBRARIES=$(HOST_DIR)/usr/lib
+		LIBRARIES=$(HOST_DIR)/lib
 endef
 
 $(eval $(generic-package))
package/Makefile.in +3 -3
index e287af03df..75200a832e 100644
@@ -230,9 +230,9 @@ HOST_LDFLAGS  += -L$(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib
 export PERL=$(shell which perl)
 
 # host-intltool needs libxml-parser-perl, which Buildroot installs in
-# $(HOST_DIR)/usr/lib/perl, so we must make sure that the system perl
+# $(HOST_DIR)/lib/perl, so we must make sure that the system perl
 # finds this perl module by exporting the proper value for PERL5LIB.
-export PERL5LIB=$(HOST_DIR)/usr/lib/perl
+export PERL5LIB=$(HOST_DIR)/lib/perl
 
 TARGET_MAKE_ENV = PATH=$(BR_PATH)
 
@@ -283,7 +283,7 @@ HOST_MAKE_ENV = \
 	PKG_CONFIG_SYSROOT_DIR="/" \
 	PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \
 	PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
-	PKG_CONFIG_LIBDIR="$(HOST_DIR)/usr/lib/pkgconfig:$(HOST_DIR)/usr/share/pkgconfig"
+	PKG_CONFIG_LIBDIR="$(HOST_DIR)/lib/pkgconfig:$(HOST_DIR)/usr/share/pkgconfig"
 
 HOST_CONFIGURE_OPTS = \
 	$(HOST_MAKE_ENV) \
package/acl/acl.mk +1 -1
index 9e57d09131..4d30059390 100644
@@ -49,7 +49,7 @@ HOST_ACL_MAKE_ENV = CFLAGS="$(HOST_CFLAGS)"
 HOST_ACL_INSTALL_OPTS = \
 	prefix=$(HOST_DIR) \
 	exec_prefix=$(HOST_DIR) \
-	PKG_DEVLIB_DIR=$(HOST_DIR)/usr/lib \
+	PKG_DEVLIB_DIR=$(HOST_DIR)/lib \
 	install-dev install-lib
 # For the host, libacl.la is correct, no fixup needed.
 
package/efl/efl.mk +1 -1
index 466ea3d9f1..403950e9a2 100644
@@ -370,7 +370,7 @@ endif
 # system bus which is non-existent and does not contain
 # any upower service in it.
 define HOST_EFL_HOOK_REMOVE_UPOWER
-	rm -fr $(HOST_DIR)/usr/lib/ecore/system/upower
+	rm -fr $(HOST_DIR)/lib/ecore/system/upower
 endef
 HOST_EFL_POST_INSTALL_HOOKS = HOST_EFL_HOOK_REMOVE_UPOWER
 
package/ejabberd/ejabberd.mk +1 -1
index 66686616ce..483f8faf05 100644
@@ -26,7 +26,7 @@ EJABBERD_ERLANG_LIBS = sasl crypto public_key ssl mnesia inets compiler
 # Guess answers for these tests, configure will bail out otherwise
 # saying error: cannot run test program while cross compiling.
 EJABBERD_CONF_ENV = \
-	ac_cv_erlang_root_dir="$(HOST_DIR)/usr/lib/erlang" \
+	ac_cv_erlang_root_dir="$(HOST_DIR)/lib/erlang" \
 	$(foreach lib,$(EJABBERD_ERLANG_LIBS), \
 		ac_cv_erlang_lib_dir_$(lib)="`package/ejabberd/check-erlang-lib $(lib)`")
 
package/execline/execline.mk +2 -2
index 6cd9dc1736..7e1797e72d 100644
@@ -47,9 +47,9 @@ HOST_EXECLINE_DEPENDENCIES = host-skalibs
 HOST_EXECLINE_CONF_OPTS = \
 	--prefix=$(HOST_DIR) \
 	--shebangdir=/usr/bin \
-	--with-sysdeps=$(HOST_DIR)/usr/lib/skalibs/sysdeps \
+	--with-sysdeps=$(HOST_DIR)/lib/skalibs/sysdeps \
 	--with-include=$(HOST_DIR)/usr/include \
-	--with-dynlib=$(HOST_DIR)/usr/lib \
+	--with-dynlib=$(HOST_DIR)/lib \
 	--disable-static \
 	--enable-shared \
 	--disable-allstatic
package/gdk-pixbuf/gdk-pixbuf.mk +2 -2
index 688688316b..ac92e23c18 100644
@@ -58,7 +58,7 @@ endif
 # need to sanitize (strip) them.
 ifeq ($(BR2_STATIC_LIBS),)
 define GDK_PIXBUF_UPDATE_CACHE
-	GDK_PIXBUF_MODULEDIR=$(HOST_DIR)/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders \
+	GDK_PIXBUF_MODULEDIR=$(HOST_DIR)/lib/gdk-pixbuf-2.0/2.10.0/loaders \
 		$(HOST_DIR)/bin/gdk-pixbuf-query-loaders \
 		> $(TARGET_DIR)/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
 	$(SED) "s,$(HOST_DIR),,g" \
@@ -77,7 +77,7 @@ GDK_PIXBUF_POST_PATCH_HOOKS += GDK_PIXBUF_DISABLE_TESTS
 # thumbnailer. Use the host-built since it matches the target options
 # regarding mime types (which is the used information).
 define GDK_PIXBUF_COPY_LOADERS_CACHE
-	cp -f $(HOST_DIR)/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache \
+	cp -f $(HOST_DIR)/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache \
 		$(@D)/gdk-pixbuf
 endef
 GDK_PIXBUF_PRE_BUILD_HOOKS += GDK_PIXBUF_COPY_LOADERS_CACHE
package/go-bootstrap/go-bootstrap.mk +1 -1
index 28a113ec89..6710e31561 100644
@@ -17,7 +17,7 @@ GO_BOOTSTRAP_LICENSE_FILES = LICENSE
 # host-go-bootstrap.
 HOST_GO_BOOTSTRAP_DEPENDENCIES = toolchain
 
-HOST_GO_BOOTSTRAP_ROOT = $(HOST_DIR)/usr/lib/go-$(GO_BOOTSTRAP_VERSION)
+HOST_GO_BOOTSTRAP_ROOT = $(HOST_DIR)/lib/go-$(GO_BOOTSTRAP_VERSION)
 
 # The go build system is not compatable with ccache, so use HOSTCC_NOCCACHE
 # here.  See https://github.com/golang/go/issues/11685.
package/go/go.mk +1 -1
index 0bbf9430b0..77cfc17c53 100644
@@ -37,7 +37,7 @@ GO_GOARCH = mips64le
 endif
 
 HOST_GO_DEPENDENCIES = host-go-bootstrap
-HOST_GO_ROOT = $(HOST_DIR)/usr/lib/go
+HOST_GO_ROOT = $(HOST_DIR)/lib/go
 
 # For the convienience of target packages.
 HOST_GO_TOOLDIR = $(HOST_GO_ROOT)/pkg/tool/linux_$(GO_GOARCH)
package/gtest/gtest.mk +1 -1
index c82287e501..d7b47e93aa 100644
@@ -26,7 +26,7 @@ HOST_GTEST_DEPENDENCIES += host-python
 endif
 
 HOST_GTEST_GMOCK_PYTHONPATH = \
-	$(HOST_DIR)/usr/lib/python$(HOST_GTEST_PYTHON_VERSION)/site-packages
+	$(HOST_DIR)/lib/python$(HOST_GTEST_PYTHON_VERSION)/site-packages
 
 # While it is possible to build gtest as shared library, using this gtest shared
 # library requires to set some special configure option in the project using
package/heimdal/heimdal.mk +2 -2
index 1658740839..5af7926854 100644
@@ -30,10 +30,10 @@ HEIMDAL_LICENSE_FILES = LICENSE
 
 # We need asn1_compile in the PATH for samba4
 define HOST_HEIMDAL_MAKE_SYMLINK
-	ln -sf $(HOST_DIR)/usr/libexec/heimdal/asn1_compile \
+	ln -sf $(HOST_DIR)/libexec/heimdal/asn1_compile \
 		$(HOST_DIR)/bin/asn1_compile
 	ln -sf $(HOST_DIR)/bin/compile_et \
-		$(HOST_DIR)/usr/libexec/heimdal/compile_et
+		$(HOST_DIR)/libexec/heimdal/compile_et
 endef
 
 HOST_HEIMDAL_POST_INSTALL_HOOKS += HOST_HEIMDAL_MAKE_SYMLINK
package/leafnode2/leafnode2.mk +1 -1
index 4a920ccf92..7efe9445ad 100644
@@ -31,7 +31,7 @@ define LEAFNODE2_BUILD_SORTNL_TOOL
 	$(HOSTCC) $(HOST_CFLAGS) -o b_sortnl_host \
 		arc4random.c mergesort.c b_sortnl.c critmem_malloc.c \
 		critmem_realloc.c -DHAVE_CONFIG_H -I$(HOST_DIR)/usr/include \
-		-L $(HOST_DIR)/usr/lib -Wl,-rpath,$(HOST_DIR)/usr/lib -lpcre
+		-L $(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib -lpcre
 endef
 
 LEAFNODE2_PRE_BUILD_HOOKS += LEAFNODE2_BUILD_SORTNL_TOOL
package/libselinux/libselinux.mk +4 -4
index 75cf8e30e3..9c76d1ed2c 100644
@@ -83,7 +83,7 @@ HOST_LIBSELINUX_MAKE_OPTS = \
 	$(HOST_CONFIGURE_OPTS) \
 	LDFLAGS="$(HOST_LDFLAGS) -lpcre -lpthread" \
 	PYINC="$(HOST_LIBSELINUX_PYINC)" \
-	PYSITEDIR="$(HOST_DIR)/usr/lib/$(HOST_LIBSELINUX_PYLIBVER)/site-packages" \
+	PYSITEDIR="$(HOST_DIR)/lib/$(HOST_LIBSELINUX_PYLIBVER)/site-packages" \
 	SWIG_LIB="$(HOST_DIR)/usr/share/swig/$(SWIG_VERSION)/"
 
 define HOST_LIBSELINUX_BUILD_CMDS
@@ -91,7 +91,7 @@ define HOST_LIBSELINUX_BUILD_CMDS
 	# header paths.
 	$(HOST_MAKE_ENV) $(MAKE1) -C $(@D) \
 		$(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) \
-		SHLIBDIR=$(HOST_DIR)/usr/lib all
+		SHLIBDIR=$(HOST_DIR)/lib all
 	# Generate python interface wrapper
 	$(HOST_MAKE_ENV) $(MAKE1) -C $(@D) \
 		$(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) swigify pywrap
@@ -100,8 +100,8 @@ endef
 define HOST_LIBSELINUX_INSTALL_CMDS
 	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) \
 		$(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) \
-		SHLIBDIR=$(HOST_DIR)/usr/lib SBINDIR=$(HOST_DIR)/sbin install
-	(cd $(HOST_DIR)/usr/lib; $(HOSTLN) -sf libselinux.so.1 libselinux.so)
+		SHLIBDIR=$(HOST_DIR)/lib SBINDIR=$(HOST_DIR)/sbin install
+	(cd $(HOST_DIR)/lib; $(HOSTLN) -sf libselinux.so.1 libselinux.so)
 	# Install python interface wrapper
 	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) \
 		$(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) install-pywrap
package/libsemanage/libsemanage.mk +2 -2
index c9f0f57f6f..15bc664bd3 100644
@@ -36,13 +36,13 @@ ifeq ($(BR2_PACKAGE_PYTHON3),y)
 HOST_LIBSEMANAGE_DEPENDENCIES += host-python3
 HOST_LIBSEMANAGE_MAKE_OPTS += \
 	PYINC="-I$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)m/" \
-	PYTHONLIBDIR="-L$(HOST_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/" \
+	PYTHONLIBDIR="-L$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/" \
 	PYLIBVER="python$(PYTHON3_VERSION_MAJOR)"
 else
 HOST_LIBSEMANAGE_DEPENDENCIES += host-python
 HOST_LIBSEMANAGE_MAKE_OPTS += \
 	PYINC="-I$(HOST_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)/" \
-	PYTHONLIBDIR="-L$(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/" \
+	PYTHONLIBDIR="-L$(HOST_DIR)/lib/python$(PYTHON_VERSION_MAJOR)/" \
 	PYLIBVER="python$(PYTHON_VERSION_MAJOR)"
 endif
 
package/libsepol/libsepol.mk +1 -1
index 233334eea2..710ab25112 100644
@@ -44,7 +44,7 @@ endef
 
 define HOST_LIBSEPOL_INSTALL_CMDS
 	$(HOST_LIBSEPOL_MAKE_ENV) $(MAKE) -C $(@D) install $(HOST_CONFIGURE_OPTS)
-	ln -sf libsepol.so.1 $(HOST_DIR)/usr/lib/libsepol.so
+	ln -sf libsepol.so.1 $(HOST_DIR)/lib/libsepol.so
 endef
 
 $(eval $(generic-package))
package/libxml-parser-perl/libxml-parser-perl.mk +3 -3
index bca1c34a8f..08bc8bb59f 100644
@@ -15,11 +15,11 @@ define HOST_LIBXML_PARSER_PERL_CONFIGURE_CMDS
 	(cd $(@D) ; \
 		$(HOST_CONFIGURE_OPTS) $(LIBXML_PARSER_PERL_RUN_PERL) Makefile.PL \
 			PREFIX=$(HOST_DIR) \
-			EXPATLIBPATH=$(HOST_DIR)/usr/lib \
+			EXPATLIBPATH=$(HOST_DIR)/lib \
 			EXPATINCPATH=$(HOST_DIR)/usr/include \
 			INSTALLDIRS=site \
-			INSTALLSITELIB=$(HOST_DIR)/usr/lib/perl \
-			INSTALLSITEARCH=$(HOST_DIR)/usr/lib/perl \
+			INSTALLSITELIB=$(HOST_DIR)/lib/perl \
+			INSTALLSITEARCH=$(HOST_DIR)/lib/perl \
 	)
 endef
 
package/lua/lua.mk +1 -1
index 5ef61e039e..871d4f29ff 100644
@@ -96,7 +96,7 @@ endef
 define HOST_LUA_INSTALL_CMDS
 	$(HOST_MAKE_ENV) $(MAKE) INSTALL_TOP="$(HOST_DIR)/usr" -C $(@D) install
 	$(INSTALL) -m 0644 -D $(@D)/etc/lua.pc \
-		$(HOST_DIR)/usr/lib/pkgconfig/lua.pc
+		$(HOST_DIR)/lib/pkgconfig/lua.pc
 endef
 
 $(eval $(generic-package))
package/mfgtools/mfgtools.mk +1 -1
index e37c4dc719..1afd47b13f 100644
@@ -26,7 +26,7 @@ HOST_MFGTOOLS_POST_BUILD_HOOKS += HOST_MFGTOOLS_CLI_BUILD
 
 define HOST_MFGTOOLS_INSTALL_CMDS
 	$(INSTALL) -D -m 755 $(@D)/MfgToolLib/libMfgToolLib.so \
-		$(HOST_DIR)/usr/lib/libMfgToolLib.so
+		$(HOST_DIR)/lib/libMfgToolLib.so
 	$(INSTALL) -D -m 755 $(@D)/TestPrgm/mfgtoolcli \
 		$(HOST_DIR)/bin/mfgtoolcli
 endef
package/mono/mono.mk +2 -2
index 58dfab70b4..07116a2a32 100644
@@ -28,7 +28,7 @@ MONO_CONF_OPTS = --with-mcs-docs=no \
 # architecture-independent, we simply copy them to the target.
 define MONO_INSTALL_LIBS
 	rsync -av --exclude=*.so --exclude=*.mdb \
-		$(HOST_DIR)/usr/lib/mono $(TARGET_DIR)/usr/lib/
+		$(HOST_DIR)/lib/mono $(TARGET_DIR)/usr/lib/
 	rsync -av $(HOST_DIR)/etc/mono $(TARGET_DIR)/etc
 endef
 
@@ -55,7 +55,7 @@ HOST_MONO_DEPENDENCIES = host-monolite host-gettext
 
 define HOST_MONO_SETUP_MONOLITE
 	rm -rf $(@D)/mcs/class/lib/monolite
-	(cd $(@D)/mcs/class/lib; ln -s $(HOST_DIR)/usr/lib/monolite monolite)
+	(cd $(@D)/mcs/class/lib; ln -s $(HOST_DIR)/lib/monolite monolite)
 endef
 
 HOST_MONO_POST_CONFIGURE_HOOKS += HOST_MONO_SETUP_MONOLITE
package/monolite/monolite.mk +2 -2
index 6b982b3441..9b7794a000 100644
@@ -10,8 +10,8 @@ MONOLITE_SOURCE = monolite-$(MONOLITE_VERSION)-latest.tar.gz
 MONOLITE_LICENSE = LGPL-2.0 or commercial
 
 define HOST_MONOLITE_INSTALL_CMDS
-	mkdir -p $(HOST_DIR)/usr/lib/monolite
-	cp $(@D)/* $(HOST_DIR)/usr/lib/monolite
+	mkdir -p $(HOST_DIR)/lib/monolite
+	cp $(@D)/* $(HOST_DIR)/lib/monolite
 endef
 
 $(eval $(host-generic-package))
package/owfs/owfs.mk +1 -1
index ee37a30558..dceb6b6b5c 100644
@@ -68,7 +68,7 @@ OWFS_MAKE_ENV += \
 OWFS_DEPENDENCIES += python host-swig
 # The configure scripts finds PYSITEDIR as the python_lib directory of
 # host-python, and then prepends DESTDIR in front of it. So we end up
-# installing things in $(TARGET_DIR)/$(HOST_DIR)/usr/lib/python which is
+# installing things in $(TARGET_DIR)/$(HOST_DIR)/lib/python which is
 # clearly wrong.
 # Patching owfs to do the right thing is not trivial, it's much easier to
 # override the PYSITEDIR variable in make.
package/pseudo/pseudo.mk +2 -2
index 7a48cec7da..d78fc7aa8a 100644
@@ -21,9 +21,9 @@ HOST_PSEUDO_DEPENDENCIES = host-attr host-sqlite
 # a warning at configure time.
 HOST_PSEUDO_CONF_OPTS = \
 	--cflags="$(HOSTCFLAGS)" \
-	--with-rpath=$(HOST_DIR)/usr/lib \
+	--with-rpath=$(HOST_DIR)/lib \
 	--bits=$(if $(filter %64,$(HOSTARCH)),64,32) \
-	--libdir=$(HOST_DIR)/usr/lib \
+	--libdir=$(HOST_DIR)/lib \
 	--with-sqlite=$(HOST_DIR)/usr
 
 $(eval $(host-autotools-package))
package/python-cffi/python-cffi.mk +1 -1
index 8683665496..5e6bd6eefe 100644
@@ -20,7 +20,7 @@ HOST_PYTHON_CFFI_ENV = \
 	PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
 	PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
 	PKG_CONFIG_SYSROOT_DIR="/" \
-	PKG_CONFIG_LIBDIR="$(HOST_DIR)/usr/lib/pkgconfig:$(HOST_DIR)/usr/share/pkgconfig"
+	PKG_CONFIG_LIBDIR="$(HOST_DIR)/lib/pkgconfig:$(HOST_DIR)/usr/share/pkgconfig"
 HOST_PYTHON_CFFI_DEPENDENCIES = host-pkgconf host-python-pycparser host-libffi
 
 $(eval $(python-package))
package/s6-rc/s6-rc.mk +2 -2
index 23c3c091ca..c3f6aaab74 100644
@@ -49,9 +49,9 @@ HOST_S6_RC_DEPENDENCIES = host-s6
 HOST_S6_RC_CONF_OPTS = \
 	--prefix=$(HOST_DIR) \
 	--libexecdir=/usr/libexec \
-	--with-sysdeps=$(HOST_DIR)/usr/lib/skalibs/sysdeps \
+	--with-sysdeps=$(HOST_DIR)/lib/skalibs/sysdeps \
 	--with-include=$(HOST_DIR)/usr/include \
-	--with-dynlib=$(HOST_DIR)/usr/lib \
+	--with-dynlib=$(HOST_DIR)/lib \
 	--disable-static \
 	--enable-shared \
 	--disable-allstatic
package/s6/s6.mk +2 -2
index 4632f5829c..7ed9ef4e36 100644
@@ -47,9 +47,9 @@ HOST_S6_DEPENDENCIES = host-execline
 
 HOST_S6_CONF_OPTS = \
 	--prefix=$(HOST_DIR) \
-	--with-sysdeps=$(HOST_DIR)/usr/lib/skalibs/sysdeps \
+	--with-sysdeps=$(HOST_DIR)/lib/skalibs/sysdeps \
 	--with-include=$(HOST_DIR)/usr/include \
-	--with-dynlib=$(HOST_DIR)/usr/lib \
+	--with-dynlib=$(HOST_DIR)/lib \
 	--disable-static \
 	--enable-shared \
 	--disable-allstatic
package/scons/scons.mk +1 -1
index 8e1e8a99f2..c56526c83c 100644
@@ -13,7 +13,7 @@ SCONS_SETUP_TYPE = distutils
 HOST_SCONS_NEEDS_HOST_PYTHON = python2
 
 HOST_SCONS_INSTALL_OPTS = \
-	--install-lib=$(HOST_DIR)/usr/lib/scons-$(SCONS_VERSION)
+	--install-lib=$(HOST_DIR)/lib/scons-$(SCONS_VERSION)
 
 $(eval $(host-python-package))
 
package/setools/setools.mk +2 -2
index 9aa74d5e65..960e5be921 100644
@@ -48,7 +48,7 @@ HOST_SETOOLS_DEPENDENCIES += host-python
 HOST_SETOOLS_CONF_ENV += am_cv_python_version=$(PYTHON_VERSION)
 endif
 
-HOST_SETOOLS_PYTHON_SITE_PACKAGES = $(HOST_DIR)/usr/lib/python$(HOST_SETOOLS_PYTHON_VERSION)/site-packages
+HOST_SETOOLS_PYTHON_SITE_PACKAGES = $(HOST_DIR)/lib/python$(HOST_SETOOLS_PYTHON_VERSION)/site-packages
 HOST_SETOOLS_PYTHON_INCLUDES = $(HOST_DIR)/usr/include/python$(HOST_SETOOLS_PYTHON_VERSION)
 HOST_SETOOLS_PYTHON_LIB = -lpython$(HOST_SETOOLS_PYTHON_VERSION)
 
@@ -66,7 +66,7 @@ HOST_SETOOLS_CONF_OPTS = \
 	--disable-swig-tcl \
 	--with-sepol-devel="$(HOST_DIR)/usr" \
 	--with-selinux-devel="$(HOST_DIR)/usr" \
-	PYTHON_LDFLAGS="-L$(HOST_DIR)/usr/lib/" \
+	PYTHON_LDFLAGS="-L$(HOST_DIR)/lib/" \
 	PYTHON_CPPFLAGS="-I$(HOST_SETOOLS_PYTHON_INCLUDES)" \
 	PYTHON_SITE_PKG="$(HOST_SETOOLS_PYTHON_SITE_PACKAGES)" \
 	PYTHON_EXTRA_LIBS="-lpthread -ldl -lutil $(HOST_SETOOLS_PYTHON_LIB)"
Signature · 1 line
2.11.0
#23 lore raw

PATCH 21/53 Globally replace $(HOST_DIR)/usr/include with $(HOST_DIR)/include

In reply to Arnout Vandecappelle (Essensium/Mind)

Since things are no longer installed in $(HOST_DIR)/usr, the callers should also not refer to it.

This is a mechanical change with
git grep -l '$(HOST_DIR)/usr/include' | xargs sed -i 's%$(HOST_DIR)/usr/include%$(HOST_DIR)/include%g'

---
 package/Makefile.in                                    | 2 +-
 package/cmake/cmake.mk                                 | 2 +-
 package/execline/execline.mk                           | 2 +-
 package/google-breakpad/google-breakpad.mk             | 2 +-
 package/gutenprint/gutenprint.mk                       | 4 ++--
 package/leafnode2/leafnode2.mk                         | 2 +-
 package/libselinux/libselinux.mk                       | 4 ++--
 package/libsemanage/libsemanage.mk                     | 4 ++--
 package/libxml-parser-perl/libxml-parser-perl.mk       | 2 +-
 package/linux-syscall-support/linux-syscall-support.mk | 2 +-
 package/mfgtools/mfgtools.mk                           | 2 +-
 package/openocd/openocd.mk                             | 4 ++--
 package/s6-rc/s6-rc.mk                                 | 2 +-
 package/s6/s6.mk                                       | 2 +-
 package/setools/setools.mk                             | 2 +-
 package/x11r7/xlib_libX11/xlib_libX11.mk               | 2 +-
 package/zic/zic.mk                                     | 2 +-
 17 files changed, 21 insertions(+), 21 deletions(-)
package/Makefile.in +1 -1
index 75200a832e..3ec4a43e04 100644
@@ -217,7 +217,7 @@ UNZIP := $(shell which unzip || type -p unzip) -q
 
 APPLY_PATCHES = PATH=$(HOST_DIR)/bin:$$PATH support/scripts/apply-patches.sh $(if $(QUIET),-s)
 
-HOST_CPPFLAGS  = -I$(HOST_DIR)/usr/include
+HOST_CPPFLAGS  = -I$(HOST_DIR)/include
 HOST_CFLAGS   ?= -O2
 HOST_CFLAGS   += $(HOST_CPPFLAGS)
 HOST_CXXFLAGS += $(HOST_CFLAGS)
package/cmake/cmake.mk +1 -1
index 47b4a325db..7076668850 100644
@@ -32,7 +32,7 @@ CMAKE_CONF_OPTS = \
 	-DBUILD_CursesDialog=OFF
 
 # Get rid of -I* options from $(HOST_CPPFLAGS) to prevent that a
-# header available in $(HOST_DIR)/usr/include is used instead of a
+# header available in $(HOST_DIR)/include is used instead of a
 # CMake internal header, e.g. lzma* headers of the xz package
 HOST_CMAKE_CFLAGS = $(shell echo $(HOST_CFLAGS) | sed -r "s%$(HOST_CPPFLAGS)%%")
 HOST_CMAKE_CXXFLAGS = $(shell echo $(HOST_CXXFLAGS) | sed -r "s%$(HOST_CPPFLAGS)%%")
package/execline/execline.mk +1 -1
index 7e1797e72d..2aeba2cc83 100644
@@ -48,7 +48,7 @@ HOST_EXECLINE_CONF_OPTS = \
 	--prefix=$(HOST_DIR) \
 	--shebangdir=/usr/bin \
 	--with-sysdeps=$(HOST_DIR)/lib/skalibs/sysdeps \
-	--with-include=$(HOST_DIR)/usr/include \
+	--with-include=$(HOST_DIR)/include \
 	--with-dynlib=$(HOST_DIR)/lib \
 	--disable-static \
 	--enable-shared \
package/google-breakpad/google-breakpad.mk +1 -1
index 191ee5bec2..c09f9987b7 100644
@@ -20,7 +20,7 @@ HOST_GOOGLE_BREAKPAD_DEPENDENCIES = host-linux-syscall-support
 # Avoid using depot-tools to download this file.
 define HOST_GOOGLE_BREAKPAD_LSS
 	$(INSTALL) -D -m 0644 \
-		$(HOST_DIR)/usr/include/linux_syscall_support.h \
+		$(HOST_DIR)/include/linux_syscall_support.h \
 		$(@D)/src/third_party/lss/linux_syscall_support.h
 endef
 HOST_GOOGLE_BREAKPAD_POST_EXTRACT_HOOKS += HOST_GOOGLE_BREAKPAD_LSS
package/gutenprint/gutenprint.mk +2 -2
index 99d1f4324c..2e0ff3d906 100644
@@ -43,7 +43,7 @@ GUTENPRINT_CONF_OPTS = \
 	--disable-cups-ppds
 
 # USE_PREGEN_XMLI18N_TMP_H is added by our patch
-GUTENPRINT_MAKE_ENV = BR2_USE_PREGEN_XMLI18N_TMP_H=$(HOST_DIR)/usr/include/xmli18n-tmp.h
+GUTENPRINT_MAKE_ENV = BR2_USE_PREGEN_XMLI18N_TMP_H=$(HOST_DIR)/include/xmli18n-tmp.h
 
 HOST_GUTENPRINT_DEPENDENCIES = host-pkgconf
 # The host-gutenprint shall create the required header
@@ -78,7 +78,7 @@ GUTENPRINT_POST_PATCH_HOOKS += GUTENPRINT_CREATE_M4_DIR
 HOST_GUTENPRINT_POST_PATCH_HOOKS += GUTENPRINT_CREATE_M4_DIR
 
 define HOST_GUTENPRINT_POST_BUILD_INSTAL_TMP_HEADER
-	cp $(@D)/src/xml/xmli18n-tmp.h $(HOST_DIR)/usr/include
+	cp $(@D)/src/xml/xmli18n-tmp.h $(HOST_DIR)/include
 endef
 HOST_GUTENPRINT_POST_BUILD_HOOKS += HOST_GUTENPRINT_POST_BUILD_INSTAL_TMP_HEADER
 
package/leafnode2/leafnode2.mk +1 -1
index 7efe9445ad..a02aad4302 100644
@@ -30,7 +30,7 @@ define LEAFNODE2_BUILD_SORTNL_TOOL
 	cd $(@D); \
 	$(HOSTCC) $(HOST_CFLAGS) -o b_sortnl_host \
 		arc4random.c mergesort.c b_sortnl.c critmem_malloc.c \
-		critmem_realloc.c -DHAVE_CONFIG_H -I$(HOST_DIR)/usr/include \
+		critmem_realloc.c -DHAVE_CONFIG_H -I$(HOST_DIR)/include \
 		-L $(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib -lpcre
 endef
 
package/libselinux/libselinux.mk +2 -2
index 9c76d1ed2c..81c2d225d1 100644
@@ -71,11 +71,11 @@ HOST_LIBSELINUX_DEPENDENCIES = \
 
 ifeq ($(BR2_PACKAGE_PYTHON3),y)
 HOST_LIBSELINUX_DEPENDENCIES += host-python3
-HOST_LIBSELINUX_PYINC = -I$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)m/
+HOST_LIBSELINUX_PYINC = -I$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR)m/
 HOST_LIBSELINUX_PYLIBVER = python$(PYTHON3_VERSION_MAJOR)
 else
 HOST_LIBSELINUX_DEPENDENCIES += host-python
-HOST_LIBSELINUX_PYINC = -I$(HOST_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)/
+HOST_LIBSELINUX_PYINC = -I$(HOST_DIR)/include/python$(PYTHON_VERSION_MAJOR)/
 HOST_LIBSELINUX_PYLIBVER = python$(PYTHON_VERSION_MAJOR)
 endif
 
package/libsemanage/libsemanage.mk +2 -2
index 15bc664bd3..efeb1fcd20 100644
@@ -35,13 +35,13 @@ HOST_LIBSEMANAGE_MAKE_OPTS += $(HOST_CONFIGURE_OPTS) \
 ifeq ($(BR2_PACKAGE_PYTHON3),y)
 HOST_LIBSEMANAGE_DEPENDENCIES += host-python3
 HOST_LIBSEMANAGE_MAKE_OPTS += \
-	PYINC="-I$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)m/" \
+	PYINC="-I$(HOST_DIR)/include/python$(PYTHON3_VERSION_MAJOR)m/" \
 	PYTHONLIBDIR="-L$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/" \
 	PYLIBVER="python$(PYTHON3_VERSION_MAJOR)"
 else
 HOST_LIBSEMANAGE_DEPENDENCIES += host-python
 HOST_LIBSEMANAGE_MAKE_OPTS += \
-	PYINC="-I$(HOST_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)/" \
+	PYINC="-I$(HOST_DIR)/include/python$(PYTHON_VERSION_MAJOR)/" \
 	PYTHONLIBDIR="-L$(HOST_DIR)/lib/python$(PYTHON_VERSION_MAJOR)/" \
 	PYLIBVER="python$(PYTHON_VERSION_MAJOR)"
 endif
package/libxml-parser-perl/libxml-parser-perl.mk +1 -1
index 08bc8bb59f..4a3b196448 100644
@@ -16,7 +16,7 @@ define HOST_LIBXML_PARSER_PERL_CONFIGURE_CMDS
 		$(HOST_CONFIGURE_OPTS) $(LIBXML_PARSER_PERL_RUN_PERL) Makefile.PL \
 			PREFIX=$(HOST_DIR) \
 			EXPATLIBPATH=$(HOST_DIR)/lib \
-			EXPATINCPATH=$(HOST_DIR)/usr/include \
+			EXPATINCPATH=$(HOST_DIR)/include \
 			INSTALLDIRS=site \
 			INSTALLSITELIB=$(HOST_DIR)/lib/perl \
 			INSTALLSITEARCH=$(HOST_DIR)/lib/perl \
package/linux-syscall-support/linux-syscall-support.mk +1 -1
index c02610d80d..b8145de496 100644
@@ -22,7 +22,7 @@ endef
 
 define HOST_LINUX_SYSCALL_SUPPORT_INSTALL_CMDS
 	$(INSTALL) -D -m 0644 $(@D)/linux_syscall_support.h \
-		$(HOST_DIR)/usr/include/linux_syscall_support.h
+		$(HOST_DIR)/include/linux_syscall_support.h
 endef
 
 $(eval $(host-generic-package))
package/mfgtools/mfgtools.mk +1 -1
index 1afd47b13f..00a011af85 100644
@@ -14,7 +14,7 @@ HOST_MFGTOOLS_DEPENDENCIES = host-libusb
 HOST_MFGTOOLS_CFLAGS = \
 	$(HOST_CFLAGS) $(HOST_LDFLAGS) -std=c++11 -lpthread \
 	-L$(@D)/MfgToolLib -lMfgToolLib -I$(@D)/MfgToolLib \
-	-lusb-1.0 -I$(HOST_DIR)/usr/include/libusb-1.0 \
+	-lusb-1.0 -I$(HOST_DIR)/include/libusb-1.0 \
 	-fpermissive -Wno-write-strings
 
 define HOST_MFGTOOLS_CLI_BUILD
package/openocd/openocd.mk +2 -2
index 911d31168d..b435dc604f 100644
@@ -89,8 +89,8 @@ HOST_OPENOCD_CONF_OPTS = \
 	--enable-openjtag_ftdi \
 	--enable-buspirate \
 	--enable-sysfsgpio \
-	--oldincludedir=$(HOST_DIR)/usr/include \
-	--includedir=$(HOST_DIR)/usr/include \
+	--oldincludedir=$(HOST_DIR)/include \
+	--includedir=$(HOST_DIR)/include \
 	--disable-doxygen-html \
 	--with-jim-shared=no \
 	--disable-shared \
package/s6-rc/s6-rc.mk +1 -1
index c3f6aaab74..ce128b0106 100644
@@ -50,7 +50,7 @@ HOST_S6_RC_CONF_OPTS = \
 	--prefix=$(HOST_DIR) \
 	--libexecdir=/usr/libexec \
 	--with-sysdeps=$(HOST_DIR)/lib/skalibs/sysdeps \
-	--with-include=$(HOST_DIR)/usr/include \
+	--with-include=$(HOST_DIR)/include \
 	--with-dynlib=$(HOST_DIR)/lib \
 	--disable-static \
 	--enable-shared \
package/s6/s6.mk +1 -1
index 7ed9ef4e36..33e5c00f5e 100644
@@ -48,7 +48,7 @@ HOST_S6_DEPENDENCIES = host-execline
 HOST_S6_CONF_OPTS = \
 	--prefix=$(HOST_DIR) \
 	--with-sysdeps=$(HOST_DIR)/lib/skalibs/sysdeps \
-	--with-include=$(HOST_DIR)/usr/include \
+	--with-include=$(HOST_DIR)/include \
 	--with-dynlib=$(HOST_DIR)/lib \
 	--disable-static \
 	--enable-shared \
package/setools/setools.mk +1 -1
index 960e5be921..5e101b1d86 100644
@@ -49,7 +49,7 @@ HOST_SETOOLS_CONF_ENV += am_cv_python_version=$(PYTHON_VERSION)
 endif
 
 HOST_SETOOLS_PYTHON_SITE_PACKAGES = $(HOST_DIR)/lib/python$(HOST_SETOOLS_PYTHON_VERSION)/site-packages
-HOST_SETOOLS_PYTHON_INCLUDES = $(HOST_DIR)/usr/include/python$(HOST_SETOOLS_PYTHON_VERSION)
+HOST_SETOOLS_PYTHON_INCLUDES = $(HOST_DIR)/include/python$(HOST_SETOOLS_PYTHON_VERSION)
 HOST_SETOOLS_PYTHON_LIB = -lpython$(HOST_SETOOLS_PYTHON_VERSION)
 
 # Notes: Need "disable-selinux-check" so the configure does not check to see
package/x11r7/xlib_libX11/xlib_libX11.mk +1 -1
index fe1a7c3bc5..64344da737 100644
@@ -48,7 +48,7 @@ HOST_XLIB_LIBX11_CONF_OPTS = \
 # src/util/makekeys is executed at build time to generate ks_tables.h, so
 # it should get compiled for the host. The libX11 makefile unfortunately
 # doesn't have X11_CFLAGS_FOR_BUILD so this doesn't work.  For buildroot,
-# we know the X11 includes are in $(HOST_DIR)/usr/include, which are already
+# we know the X11 includes are in $(HOST_DIR)/include, which are already
 # in the CFLAGS_FOR_BUILD, so we can just remove the X11_CFLAGS
 define XLIB_LIBX11_DISABLE_MAKEKEYS_X11_CFLAGS
 	$(SED) '/X11_CFLAGS/d' $(@D)/src/util/Makefile*
package/zic/zic.mk +1 -1
index ad2acdff20..f179f9ce8f 100644
@@ -16,7 +16,7 @@ endef
 
 define HOST_ZIC_INSTALL_CMDS
 	$(INSTALL) -D -m 755 $(@D)/zic $(HOST_DIR)/sbin/zic
-	$(INSTALL) -D -m 644 $(@D)/tzfile.h $(HOST_DIR)/usr/include/tzfile.h
+	$(INSTALL) -D -m 644 $(@D)/tzfile.h $(HOST_DIR)/include/tzfile.h
 endef
 
 $(eval $(host-generic-package))
Signature · 1 line
2.11.0
#24 lore raw

PATCH 22/53 Globally replace $(HOST_DIR)/usr/share with $(HOST_DIR)/share

In reply to Arnout Vandecappelle (Essensium/Mind)

Since things are no longer installed in $(HOST_DIR)/usr, the callers should also not refer to it.

This is a mechanical change with
git grep -l '$(HOST_DIR)/usr/share' | xargs sed -i 's%$(HOST_DIR)/usr/share%$(HOST_DIR)/share%g'

---
 boot/syslinux/syslinux.mk                          | 2 +-
 fs/iso9660/iso9660.mk                              | 2 +-
 package/Makefile.in                                | 2 +-
 package/autoconf-archive/autoconf-archive.mk       | 2 +-
 package/automake/automake.mk                       | 2 +-
 package/gettext/gettext.mk                         | 2 +-
 package/gutenprint/gutenprint.mk                   | 2 +-
 package/libselinux/libselinux.mk                   | 4 ++--
 package/libsemanage/libsemanage.mk                 | 2 +-
 package/libsigrok/libsigrok.mk                     | 2 +-
 package/libsvgtiny/libsvgtiny.mk                   | 2 +-
 package/luarocks/luarocks.mk                       | 2 +-
 package/luvi/luvi.mk                               | 2 +-
 package/netsurf-buildsystem/netsurf-buildsystem.mk | 2 +-
 package/python-cffi/python-cffi.mk                 | 2 +-
 package/thrift/thrift.mk                           | 2 +-
 package/ti-cgt-pru/ti-cgt-pru.mk                   | 4 ++--
 package/tz/tz.mk                                   | 6 +++---
 package/tzdata/tzdata.mk                           | 6 +++---
 19 files changed, 25 insertions(+), 25 deletions(-)
boot/syslinux/syslinux.mk +1 -1
index 9feb48a666..f900567d4d 100644
@@ -96,7 +96,7 @@ define SYSLINUX_INSTALL_IMAGES_CMDS
 		$(INSTALL) -D -m 0755 $(@D)/$$i $(BINARIES_DIR)/syslinux/$${i##*/}; \
 	done
 	for i in $(SYSLINUX_C32); do \
-		$(INSTALL) -D -m 0755 $(HOST_DIR)/usr/share/syslinux/$${i} \
+		$(INSTALL) -D -m 0755 $(HOST_DIR)/share/syslinux/$${i} \
 			$(BINARIES_DIR)/syslinux/$${i}; \
 	done
 endef
fs/iso9660/iso9660.mk +1 -1
index fec6fe17c2..fafe5b0e84 100644
@@ -70,7 +70,7 @@ ROOTFS_ISO9660_BOOT_IMAGE = isolinux/isolinux.bin
 define ROOTFS_ISO9660_INSTALL_BOOTLOADER
 	$(INSTALL) -D -m 0644 $(BINARIES_DIR)/syslinux/* \
 		$(ROOTFS_ISO9660_TARGET_DIR)/isolinux/
-	$(INSTALL) -D -m 0644 $(HOST_DIR)/usr/share/syslinux/ldlinux.c32 \
+	$(INSTALL) -D -m 0644 $(HOST_DIR)/share/syslinux/ldlinux.c32 \
 		$(ROOTFS_ISO9660_TARGET_DIR)/isolinux/ldlinux.c32
 endef
 endif
package/Makefile.in +1 -1
index 3ec4a43e04..6a91d2abe5 100644
@@ -283,7 +283,7 @@ HOST_MAKE_ENV = \
 	PKG_CONFIG_SYSROOT_DIR="/" \
 	PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \
 	PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
-	PKG_CONFIG_LIBDIR="$(HOST_DIR)/lib/pkgconfig:$(HOST_DIR)/usr/share/pkgconfig"
+	PKG_CONFIG_LIBDIR="$(HOST_DIR)/lib/pkgconfig:$(HOST_DIR)/share/pkgconfig"
 
 HOST_CONFIGURE_OPTS = \
 	$(HOST_MAKE_ENV) \
package/autoconf-archive/autoconf-archive.mk +1 -1
index 053ea33fa9..5c04937c74 100644
@@ -9,6 +9,6 @@ AUTOCONF_ARCHIVE_SOURCE = autoconf-archive-$(AUTOCONF_ARCHIVE_VERSION).tar.xz
 AUTOCONF_ARCHIVE_SITE = $(BR2_GNU_MIRROR)/autoconf-archive
 AUTOCONF_ARCHIVE_LICENSE = GPL-3.0+ with exception
 AUTOCONF_ARCHIVE_LICENSE_FILES = COPYING COPYING.EXCEPTION
-HOST_AUTOCONF_ARCHIVE_INSTALL_OPTS = aclocaldir=$(HOST_DIR)/usr/share/autoconf-archive install
+HOST_AUTOCONF_ARCHIVE_INSTALL_OPTS = aclocaldir=$(HOST_DIR)/share/autoconf-archive install
 
 $(eval $(host-autotools-package))
package/automake/automake.mk +1 -1
index 13041213bb..88c4fb3ee9 100644
@@ -12,7 +12,7 @@ AUTOMAKE_LICENSE_FILES = COPYING
 
 HOST_AUTOMAKE_DEPENDENCIES = host-autoconf
 
-ACLOCAL_HOST_DIR = $(HOST_DIR)/usr/share/aclocal
+ACLOCAL_HOST_DIR = $(HOST_DIR)/share/aclocal
 
 define GTK_DOC_M4_INSTALL
 	$(INSTALL) -D -m 0644 package/automake/gtk-doc.m4 \
package/gettext/gettext.mk +1 -1
index c2971a70d9..cc2c8ccec3 100644
@@ -80,7 +80,7 @@ HOST_GETTEXT_POST_INSTALL_HOOKS += HOST_GETTEXT_GETTEXTIZE_CONFIRMATION
 # host, so do it manually
 define HOST_GETTEXT_ADD_ABOUT_NLS
 	$(INSTALL) -m 0644 $(@D)/$(HOST_GETTEXT_SUBDIR)/ABOUT-NLS \
-		$(HOST_DIR)/usr/share/gettext/ABOUT-NLS
+		$(HOST_DIR)/share/gettext/ABOUT-NLS
 endef
 
 HOST_GETTEXT_POST_INSTALL_HOOKS += HOST_GETTEXT_ADD_ABOUT_NLS
package/gutenprint/gutenprint.mk +1 -1
index 2e0ff3d906..65b8d31091 100644
@@ -84,7 +84,7 @@ HOST_GUTENPRINT_POST_BUILD_HOOKS += HOST_GUTENPRINT_POST_BUILD_INSTAL_TMP_HEADER
 
 define GUTENPRINT_POST_INSTALL_TARGET_FIXUP
 	mkdir -p $(TARGET_DIR)/usr/share/gutenprint/5.2
-	cp -rf $(HOST_DIR)/usr/share/gutenprint/5.2/xml $(TARGET_DIR)/usr/share/gutenprint/5.2
+	cp -rf $(HOST_DIR)/share/gutenprint/5.2/xml $(TARGET_DIR)/usr/share/gutenprint/5.2
 endef
 GUTENPRINT_POST_INSTALL_TARGET_HOOKS += GUTENPRINT_POST_INSTALL_TARGET_FIXUP
 
package/libselinux/libselinux.mk +2 -2
index 81c2d225d1..0d97c17e3a 100644
@@ -37,7 +37,7 @@ endif
 LIBSELINUX_MAKE_OPTS += \
 	PYINC="$(LIBSELINUX_PYINC)" \
 	PYSITEDIR=$(TARGET_DIR)/usr/lib/$(LIBSELINUX_PYLIBVER)/site-packages \
-	SWIG_LIB="$(HOST_DIR)/usr/share/swig/$(SWIG_VERSION)/"
+	SWIG_LIB="$(HOST_DIR)/share/swig/$(SWIG_VERSION)/"
 
 LIBSELINUX_MAKE_TARGETS += swigify pywrap
 LIBSELINUX_MAKE_INSTALL_TARGETS += install-pywrap
@@ -84,7 +84,7 @@ HOST_LIBSELINUX_MAKE_OPTS = \
 	LDFLAGS="$(HOST_LDFLAGS) -lpcre -lpthread" \
 	PYINC="$(HOST_LIBSELINUX_PYINC)" \
 	PYSITEDIR="$(HOST_DIR)/lib/$(HOST_LIBSELINUX_PYLIBVER)/site-packages" \
-	SWIG_LIB="$(HOST_DIR)/usr/share/swig/$(SWIG_VERSION)/"
+	SWIG_LIB="$(HOST_DIR)/share/swig/$(SWIG_VERSION)/"
 
 define HOST_LIBSELINUX_BUILD_CMDS
 	# DESTDIR is needed during the compile to compute library and
package/libsemanage/libsemanage.mk +1 -1
index efeb1fcd20..5ef2d57e35 100644
@@ -30,7 +30,7 @@ endef
 HOST_LIBSEMANAGE_DEPENDENCIES = host-bison host-audit host-libsepol host-libselinux \
 				host-ustr host-bzip2 host-swig
 HOST_LIBSEMANAGE_MAKE_OPTS += $(HOST_CONFIGURE_OPTS) \
-	SWIG_LIB="$(HOST_DIR)/usr/share/swig/$(SWIG_VERSION)/"
+	SWIG_LIB="$(HOST_DIR)/share/swig/$(SWIG_VERSION)/"
 
 ifeq ($(BR2_PACKAGE_PYTHON3),y)
 HOST_LIBSEMANAGE_DEPENDENCIES += host-python3
package/libsigrok/libsigrok.mk +1 -1
index 9137165029..82c2c08e2e 100644
@@ -39,7 +39,7 @@ endif
 
 ifeq ($(BR2_PACKAGE_LIBSIGROKCXX),y)
 LIBSIGROK_CONF_OPTS += --enable-cxx
-LIBSIGROK_AUTORECONF_OPTS += -I $(HOST_DIR)/usr/share/autoconf-archive
+LIBSIGROK_AUTORECONF_OPTS += -I $(HOST_DIR)/share/autoconf-archive
 LIBSIGROK_DEPENDENCIES += \
 	host-autoconf-archive \
 	glibmm \
package/libsvgtiny/libsvgtiny.mk +1 -1
index acd08d72d5..febd3fcec8 100644
@@ -23,7 +23,7 @@ LIBSVGTINY_COMPONENT_TYPE = lib-static
 endif
 
 define LIBSVGTINY_CONFIGURE_CMDS
-	ln -sf $(HOST_DIR)/usr/share/netsurf-buildsystem $(@D)/build
+	ln -sf $(HOST_DIR)/share/netsurf-buildsystem $(@D)/build
 endef
 
 define LIBSVGTINY_BUILD_CMDS
package/luarocks/luarocks.mk +1 -1
index cf449ac52c..e965ab2288 100644
@@ -53,7 +53,7 @@ endef
 
 $(eval $(host-generic-package))
 
-LUAROCKS_RUN_ENV = LUA_PATH="$(HOST_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)/?.lua"
+LUAROCKS_RUN_ENV = LUA_PATH="$(HOST_DIR)/share/lua/$(LUAINTERPRETER_ABIVER)/?.lua"
 LUAROCKS_RUN_CMD = $(LUA_RUN) $(HOST_DIR)/bin/luarocks
 
 define LUAROCKS_FINALIZE_TARGET
package/luvi/luvi.mk +1 -1
index ade63f5fba..8c4cbbe0d7 100644
@@ -33,7 +33,7 @@ LUVI_CONF_OPTS = \
 	-DBUILD_SHARED_LIBS=OFF \
 	-DWithSharedLibluv=ON \
 	-DTARGET_ARCH=$(LUVI_TARGET_ARCH) \
-	-DLUA_PATH=$(HOST_DIR)/usr/share/luajit-2.0.4/?.lua
+	-DLUA_PATH=$(HOST_DIR)/share/luajit-2.0.4/?.lua
 
 # Add "rex" module (PCRE via bundled lrexlib)
 ifeq ($(BR2_PACKAGE_PCRE),y)
package/netsurf-buildsystem/netsurf-buildsystem.mk +1 -1
index f316eb126b..d4efec0e1d 100644
@@ -10,7 +10,7 @@ NETSURF_BUILDSYSTEM_SITE_METHOD = git
 NETSURF_BUILDSYSTEM_LICENSE = MIT, BSD-3-Clause (for llvm/* files)
 NETSURF_BUILDSYSTEM_LICENSE_FILES = llvm/LICENSE.TXT
 
-NETSURF_BUILDSYSTEM_INSTALL_DIR = $(HOST_DIR)/usr/share/netsurf-buildsystem
+NETSURF_BUILDSYSTEM_INSTALL_DIR = $(HOST_DIR)/share/netsurf-buildsystem
 
 define HOST_NETSURF_BUILDSYSTEM_INSTALL_CMDS
 	mkdir -p $(NETSURF_BUILDSYSTEM_INSTALL_DIR)
package/python-cffi/python-cffi.mk +1 -1
index 5e6bd6eefe..e5132d559b 100644
@@ -20,7 +20,7 @@ HOST_PYTHON_CFFI_ENV = \
 	PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
 	PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
 	PKG_CONFIG_SYSROOT_DIR="/" \
-	PKG_CONFIG_LIBDIR="$(HOST_DIR)/lib/pkgconfig:$(HOST_DIR)/usr/share/pkgconfig"
+	PKG_CONFIG_LIBDIR="$(HOST_DIR)/lib/pkgconfig:$(HOST_DIR)/share/pkgconfig"
 HOST_PYTHON_CFFI_DEPENDENCIES = host-pkgconf host-python-pycparser host-libffi
 
 $(eval $(python-package))
package/thrift/thrift.mk +1 -1
index cbd5401dce..741d33f571 100644
@@ -21,7 +21,7 @@ HOST_THRIFT_CONF_OPTS = --with-sysroot=$(HOST_DIR) \
 	--disable-tests \
 	--disable-tutorial
 THRIFT_AUTORECONF = YES
-THRIFT_AUTORECONF_OPTS = -I $(HOST_DIR)/usr/share/autoconf-archive
+THRIFT_AUTORECONF_OPTS = -I $(HOST_DIR)/share/autoconf-archive
 THRIFT_LICENSE = Apache-2.0
 THRIFT_LICENSE_FILES = LICENSE
 
package/ti-cgt-pru/ti-cgt-pru.mk +2 -2
index d6de05e5da..361a64a34b 100644
@@ -21,10 +21,10 @@ define HOST_TI_CGT_PRU_EXTRACT_CMDS
 endef
 
 # Since this is largely prebuilt toolchain and likes to live in its
-# own directory, put it in $(HOST_DIR)/usr/share/ti-cgt-pru/.
+# own directory, put it in $(HOST_DIR)/share/ti-cgt-pru/.
 # Packages wanting to use this toolchain need to use this path as TI's
 # standard PRU_CGT path e.g. make PRU_CGT=$(TI_CGT_PRU_INSTALLDIR)...
-TI_CGT_PRU_INSTALLDIR = $(HOST_DIR)/usr/share/ti-cgt-pru
+TI_CGT_PRU_INSTALLDIR = $(HOST_DIR)/share/ti-cgt-pru
 
 define HOST_TI_CGT_PRU_INSTALL_CMDS
 	mkdir -p $(TI_CGT_PRU_INSTALLDIR)
package/tz/tz.mk +3 -3
index f0daf4658f..5bcc3faa5b 100644
@@ -10,7 +10,7 @@ TZ_LICENSE = Public domain
 TZ_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME))
 
 define TZ_BUILD_CMDS
-	(cd $(HOST_DIR)/usr/share/zoneinfo/posix/;                 \
+	(cd $(HOST_DIR)/share/zoneinfo/posix/;                 \
 		for i in $$(find . -type f); do                    \
 			mkdir -p $(@D)/output/$$(dirname $$i);         \
 			$(TZDUMP) -p . -q $${i#./} | sed '1d' > $(@D)/output/$$i; \
@@ -19,9 +19,9 @@ define TZ_BUILD_CMDS
 endef
 
 define TZ_INSTALL_TARGET_CMDS
-	$(INSTALL) -D -m 0644 $(HOST_DIR)/usr/share/zoneinfo/zone.tab \
+	$(INSTALL) -D -m 0644 $(HOST_DIR)/share/zoneinfo/zone.tab \
 		$(TARGET_DIR)/usr/share/zoneinfo/zone.tab
-	$(INSTALL) -D -m 0644 $(HOST_DIR)/usr/share/zoneinfo/iso3166.tab \
+	$(INSTALL) -D -m 0644 $(HOST_DIR)/share/zoneinfo/iso3166.tab \
 		$(TARGET_DIR)/usr/share/zoneinfo/iso3166.tab
 	mkdir -p $(TARGET_DIR)/usr/share/zoneinfo/uclibc
 	cp -a $(@D)/output/* $(TARGET_DIR)/usr/share/zoneinfo/uclibc
package/tzdata/tzdata.mk +3 -3
index 7e63bace5b..9400beeef7 100644
@@ -31,7 +31,7 @@ TZDATA_EXTRACT_CMDS =
 
 define TZDATA_INSTALL_TARGET_CMDS
 	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/share/zoneinfo
-	cp -a $(HOST_DIR)/usr/share/zoneinfo/* $(TARGET_DIR)/usr/share/zoneinfo
+	cp -a $(HOST_DIR)/share/zoneinfo/* $(TARGET_DIR)/usr/share/zoneinfo
 	cd $(TARGET_DIR)/usr/share/zoneinfo;    \
 	for zone in posix/*; do                 \
 	    ln -sfn "$${zone}" "$${zone##*/}";  \
@@ -58,8 +58,8 @@ define HOST_TZDATA_BUILD_CMDS
 endef
 
 define HOST_TZDATA_INSTALL_CMDS
-	$(INSTALL) -d -m 0755 $(HOST_DIR)/usr/share/zoneinfo
-	cp -a $(@D)/_output/* $(@D)/*.tab $(HOST_DIR)/usr/share/zoneinfo
+	$(INSTALL) -d -m 0755 $(HOST_DIR)/share/zoneinfo
+	cp -a $(@D)/_output/* $(@D)/*.tab $(HOST_DIR)/share/zoneinfo
 endef
 
 $(eval $(generic-package))
Signature · 1 line
2.11.0
#25 lore raw

PATCH 23/53 Globally replace $(HOST_DIR)/usr with $(HOST_DIR)

In reply to Arnout Vandecappelle (Essensium/Mind)

Since things are no longer installed in $(HOST_DIR), the callers should also not refer to it.

This is a mechanical change with
git grep -l '$(HOST_DIR)/usr\>\([^/]\|$\)' | xargs sed -i 's%\$(HOST_DIR)/usr\>\([^/]\|$\)%$(HOST_DIR)\1%g'

---
 package/erlang/erlang.mk           |  2 +-
 package/gcc/gcc.mk                 | 10 +++++-----
 package/kodi/kodi.mk               |  4 ++--
 package/libsepol/libsepol.mk       |  2 +-
 package/lua/lua.mk                 |  2 +-
 package/luarocks/luarocks.mk       |  2 +-
 package/omxplayer/omxplayer.mk     |  2 +-
 package/pseudo/pseudo.mk           |  2 +-
 package/qt/qt.mk                   |  4 ++--
 package/qt5/qt5base/qt5base.mk     |  2 +-
 package/setools/setools.mk         |  4 ++--
 package/upx/upx.mk                 |  2 +-
 package/vboot-utils/vboot-utils.mk |  2 +-
 13 files changed, 20 insertions(+), 20 deletions(-)
package/erlang/erlang.mk +1 -1
index 364085c4dd..325a052e86 100644
@@ -39,7 +39,7 @@ HOST_ERLANG_CONF_ENV += ERL_TOP=$(@D)
 # erlang uses openssl for all things crypto. Since the host tools (such as
 # rebar) uses crypto, we need to build host-erlang with support for openssl.
 HOST_ERLANG_DEPENDENCIES = host-openssl
-HOST_ERLANG_CONF_OPTS = --without-javac --with-ssl=$(HOST_DIR)/usr
+HOST_ERLANG_CONF_OPTS = --without-javac --with-ssl=$(HOST_DIR)
 
 HOST_ERLANG_CONF_OPTS += --without-termcap
 
package/gcc/gcc.mk +5 -5
index bdeb956972..ff69209f84 100644
@@ -92,9 +92,9 @@ HOST_GCC_COMMON_CONF_OPTS = \
 	--with-gnu-ld \
 	--disable-libssp \
 	--disable-multilib \
-	--with-gmp=$(HOST_DIR)/usr \
-	--with-mpc=$(HOST_DIR)/usr \
-	--with-mpfr=$(HOST_DIR)/usr \
+	--with-gmp=$(HOST_DIR) \
+	--with-mpc=$(HOST_DIR) \
+	--with-mpfr=$(HOST_DIR) \
 	--with-pkgversion="Buildroot $(BR2_VERSION_FULL)" \
 	--with-bugurl="http://bugs.buildroot.net/"
 
@@ -169,12 +169,12 @@ endif
 
 ifeq ($(BR2_GCC_ENABLE_GRAPHITE),y)
 HOST_GCC_COMMON_DEPENDENCIES += host-isl
-HOST_GCC_COMMON_CONF_OPTS += --with-isl=$(HOST_DIR)/usr
+HOST_GCC_COMMON_CONF_OPTS += --with-isl=$(HOST_DIR)
 # gcc 5 doesn't need cloog any more, see
 # https://gcc.gnu.org/gcc-5/changes.html
 ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_5),)
 HOST_GCC_COMMON_DEPENDENCIES += host-cloog
-HOST_GCC_COMMON_CONF_OPTS += --with-cloog=$(HOST_DIR)/usr
+HOST_GCC_COMMON_CONF_OPTS += --with-cloog=$(HOST_DIR)
 endif
 else
 HOST_GCC_COMMON_CONF_OPTS += --without-isl --without-cloog
package/kodi/kodi.mk +2 -2
index ebce84dade..ed9ec78b11 100644
@@ -66,8 +66,8 @@ KODI_CONF_ENV = \
 	PYTHON_SITE_PKG="$(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
 	PYTHON_NOVERSIONCHECK="no-check" \
 	use_texturepacker_native=yes \
-	USE_TEXTUREPACKER_NATIVE_ROOT="$(HOST_DIR)/usr" \
-	TEXTUREPACKER_NATIVE_ROOT="$(HOST_DIR)/usr"
+	USE_TEXTUREPACKER_NATIVE_ROOT="$(HOST_DIR)" \
+	TEXTUREPACKER_NATIVE_ROOT="$(HOST_DIR)"
 
 KODI_CONF_OPTS +=  \
 	--with-ffmpeg=shared \
package/libsepol/libsepol.mk +1 -1
index 710ab25112..21ca419c74 100644
@@ -35,7 +35,7 @@ endef
 
 HOST_LIBSEPOL_MAKE_ENV = \
 	$(HOST_MAKE_ENV) \
-	DESTDIR=$(HOST_DIR)/usr \
+	DESTDIR=$(HOST_DIR) \
 	PREFIX=$(HOST_DIR)
 
 define HOST_LIBSEPOL_BUILD_CMDS
package/lua/lua.mk +1 -1
index 871d4f29ff..c5d6c088fd 100644
@@ -94,7 +94,7 @@ define LUA_INSTALL_TARGET_CMDS
 endef
 
 define HOST_LUA_INSTALL_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) INSTALL_TOP="$(HOST_DIR)/usr" -C $(@D) install
+	$(HOST_MAKE_ENV) $(MAKE) INSTALL_TOP="$(HOST_DIR)" -C $(@D) install
 	$(INSTALL) -m 0644 -D $(@D)/etc/lua.pc \
 		$(HOST_DIR)/lib/pkgconfig/lua.pc
 endef
package/luarocks/luarocks.mk +1 -1
index e965ab2288..2338a8b776 100644
@@ -21,7 +21,7 @@ endif
 HOST_LUAROCKS_CONF_OPTS = \
 	--prefix=$(HOST_DIR) \
 	--sysconfdir=$(LUAROCKS_CONFIG_DIR) \
-	--with-lua=$(HOST_DIR)/usr
+	--with-lua=$(HOST_DIR)
 
 ifeq ($(BR2_PACKAGE_LUAJIT),y)
 HOST_LUAROCKS_CONF_OPTS += --lua-suffix=jit
package/omxplayer/omxplayer.mk +1 -1
index 7425014d0c..9bb58778c2 100644
@@ -27,7 +27,7 @@ OMXPLAYER_MAKE_ENV = \
 	BUILDROOT=$(TOP_DIR) \
 	SDKSTAGE=$(STAGING_DIR) \
 	TARGETFS=$(TARGET_DIR) \
-	TOOLCHAIN=$(HOST_DIR)/usr \
+	TOOLCHAIN=$(HOST_DIR) \
 	HOST=$(GNU_TARGET_NAME) \
 	SYSROOT=$(STAGING_DIR) \
 	JOBS=$(PARALLEL_JOBS) \
package/pseudo/pseudo.mk +1 -1
index d78fc7aa8a..446427109f 100644
@@ -24,6 +24,6 @@ HOST_PSEUDO_CONF_OPTS = \
 	--with-rpath=$(HOST_DIR)/lib \
 	--bits=$(if $(filter %64,$(HOSTARCH)),64,32) \
 	--libdir=$(HOST_DIR)/lib \
-	--with-sqlite=$(HOST_DIR)/usr
+	--with-sqlite=$(HOST_DIR)
 
 $(eval $(host-autotools-package))
package/qt/qt.mk +2 -2
index e941f89624..465e81a778 100644
@@ -612,10 +612,10 @@ QT_CONF_FILE = $(HOST_DIR)/bin/qt.conf
 define QT_INSTALL_QT_CONF
 	mkdir -p $(dir $(QT_CONF_FILE))
 	echo "[Paths]"                             > $(QT_CONF_FILE)
-	echo "Prefix=$(HOST_DIR)/usr"             >> $(QT_CONF_FILE)
+	echo "Prefix=$(HOST_DIR)"             >> $(QT_CONF_FILE)
 	echo "Headers=$(STAGING_DIR)/usr/include" >> $(QT_CONF_FILE)
 	echo "Libraries=$(STAGING_DIR)/usr/lib"   >> $(QT_CONF_FILE)
-	echo "Data=$(HOST_DIR)/usr"               >> $(QT_CONF_FILE)
+	echo "Data=$(HOST_DIR)"               >> $(QT_CONF_FILE)
 	echo "Binaries=$(HOST_DIR)/bin"       >> $(QT_CONF_FILE)
 endef
 
package/qt5/qt5base/qt5base.mk +1 -1
index a91c138f68..fed213c53e 100644
@@ -234,7 +234,7 @@ define QT5BASE_CONFIGURE_CMDS
 		./configure \
 		-v \
 		-prefix /usr \
-		-hostprefix $(HOST_DIR)/usr \
+		-hostprefix $(HOST_DIR) \
 		-headerdir /usr/include/qt5 \
 		-sysroot $(STAGING_DIR) \
 		-plugindir /usr/lib/qt/plugins \
package/setools/setools.mk +2 -2
index 5e101b1d86..d2e9f05998 100644
@@ -64,8 +64,8 @@ HOST_SETOOLS_CONF_OPTS = \
 	--disable-swig-java \
 	--disable-swig-python \
 	--disable-swig-tcl \
-	--with-sepol-devel="$(HOST_DIR)/usr" \
-	--with-selinux-devel="$(HOST_DIR)/usr" \
+	--with-sepol-devel="$(HOST_DIR)" \
+	--with-selinux-devel="$(HOST_DIR)" \
 	PYTHON_LDFLAGS="-L$(HOST_DIR)/lib/" \
 	PYTHON_CPPFLAGS="-I$(HOST_SETOOLS_PYTHON_INCLUDES)" \
 	PYTHON_SITE_PKG="$(HOST_SETOOLS_PYTHON_SITE_PACKAGES)" \
package/upx/upx.mk +1 -1
index eec88c743a..1fe7162c21 100644
@@ -16,7 +16,7 @@ HOST_UPX_DEPENDENCIES = host-ucl host-zlib
 # stating to "please choose a target for 'make'"... :-(
 define HOST_UPX_BUILD_CMDS
 	$(HOST_MAKE_ENV) $(MAKE) CPPFLAGS="$(HOST_CPPFLAGS)" \
-		LDFLAGS="$(HOST_LDFLAGS)" UPX_UCLDIR=$(HOST_DIR)/usr \
+		LDFLAGS="$(HOST_LDFLAGS)" UPX_UCLDIR=$(HOST_DIR) \
 		CXXFLAGS_WERROR= \
 		-C $(@D) all
 endef
package/vboot-utils/vboot-utils.mk +1 -1
index 9879dbab75..a6a67ad317 100644
@@ -31,7 +31,7 @@ define HOST_VBOOT_UTILS_BUILD_CMDS
 endef
 
 define HOST_VBOOT_UTILS_INSTALL_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR)/usr \
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) \
 		futil_install cgpt_install devkeys_install
 endef
 
Signature · 1 line
2.11.0
#26 lore raw

PATCH 24/53 luarocks: things are no longer installed in $(HOST_DIR)/usr

In reply to Arnout Vandecappelle (Essensium/Mind)
---
 package/luarocks/luarocks.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/luarocks/luarocks.mk +1 -1
index 2338a8b776..bc700a5f95 100644
@@ -11,7 +11,7 @@ LUAROCKS_LICENSE_FILES = COPYING
 
 HOST_LUAROCKS_DEPENDENCIES = host-luainterpreter
 
-LUAROCKS_CONFIG_DIR = $(HOST_DIR)/usr/etc/luarocks
+LUAROCKS_CONFIG_DIR = $(HOST_DIR)/etc/luarocks
 LUAROCKS_CONFIG_FILE = $(LUAROCKS_CONFIG_DIR)/config-$(LUAINTERPRETER_ABIVER).lua
 LUAROCKS_CFLAGS = $(TARGET_CFLAGS) -fPIC
 ifeq ($(BR2_PACKAGE_LUA_5_3),y)
Signature · 1 line
2.11.0
#27 lore raw

PATCH 25/53 qt: things are no longer installed in $(HOST_DIR)/usr

In reply to Arnout Vandecappelle (Essensium/Mind)

Also fixup alignment that was broken due to mechanical replacement.

---
 package/qt/qt.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
package/qt/qt.mk +4 -4
index 465e81a778..960a34440c 100644
@@ -612,11 +612,11 @@ QT_CONF_FILE = $(HOST_DIR)/bin/qt.conf
 define QT_INSTALL_QT_CONF
 	mkdir -p $(dir $(QT_CONF_FILE))
 	echo "[Paths]"                             > $(QT_CONF_FILE)
-	echo "Prefix=$(HOST_DIR)"             >> $(QT_CONF_FILE)
+	echo "Prefix=$(HOST_DIR)"                 >> $(QT_CONF_FILE)
 	echo "Headers=$(STAGING_DIR)/usr/include" >> $(QT_CONF_FILE)
 	echo "Libraries=$(STAGING_DIR)/usr/lib"   >> $(QT_CONF_FILE)
-	echo "Data=$(HOST_DIR)"               >> $(QT_CONF_FILE)
-	echo "Binaries=$(HOST_DIR)/bin"       >> $(QT_CONF_FILE)
+	echo "Data=$(HOST_DIR)"                   >> $(QT_CONF_FILE)
+	echo "Binaries=$(HOST_DIR)/bin"           >> $(QT_CONF_FILE)
 endef
 
 # After running Qt normal installation process (which installs
@@ -630,7 +630,7 @@ define QT_INSTALL_STAGING_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
 	mkdir -p $(HOST_DIR)/bin
 	mv $(addprefix $(STAGING_DIR)/usr/bin/,$(QT_HOST_PROGRAMS)) $(HOST_DIR)/bin
-	ln -sf $(STAGING_DIR)/usr/mkspecs $(HOST_DIR)/usr/mkspecs
+	ln -sf $(STAGING_DIR)/usr/mkspecs $(HOST_DIR)/mkspecs
 	$(QT_INSTALL_QT_CONF)
 	for i in moc uic rcc lupdate lrelease ; do \
 		$(SED) "s,^$${i}_location=.*,$${i}_location=$(HOST_DIR)/bin/$${i}," \
Signature · 1 line
2.11.0
#28 lore raw

PATCH 26/53 boards: replace $HOST_DIR/usr/ with $HOST_DIR/ in scripts

In reply to Arnout Vandecappelle (Essensium/Mind)

Since things are no longer installed in $(HOST_DIR)/usr, the callers should also not refer to it.

This is a mechanical change with
git grep -l 'HOST_DIR}\?/usr/' board | xargs sed -i 's%\(HOST_DIR}\?\)/usr/%\1/%g'

---
 board/boundarydevices/common/post-build.sh | 4 ++--
 board/chromebook/snow/mksd.sh              | 4 ++--
 board/chromebook/snow/sign.sh              | 6 +++---
 board/cubietech/cubieboard2/post-build.sh  | 2 +-
 board/firefly/firefly-rk3288/post-image.sh | 2 +-
 board/lemaker/bananapro/post-build.sh      | 2 +-
 board/linksprite/pcduino/post-build.sh     | 2 +-
 board/nanopi-neo/post-build.sh             | 2 +-
 board/nexbox/a95x/post-build.sh            | 2 +-
 board/olimex/a20_olinuxino/post-build.sh   | 2 +-
 board/orangepi/post-build.sh               | 2 +-
 board/pc/post-image.sh                     | 2 +-
 board/solidrun/mx6cubox/post-build.sh      | 2 +-
 board/technologic/ts4800/post-image.sh     | 2 +-
 board/technologic/ts4900/post-image.sh     | 2 +-
 board/udoo/neo/post-build.sh               | 2 +-
 board/wandboard/post-build.sh              | 2 +-
 17 files changed, 21 insertions(+), 21 deletions(-)
board/boundarydevices/common/post-build.sh +2 -2
index f68fa0e61b..8f1d44496f 100755
@@ -8,13 +8,13 @@
 BOARD_DIR="$(dirname $0)"
 
 # bd u-boot looks for bootscript here
-$HOST_DIR/usr/bin/mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
+$HOST_DIR/bin/mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
 -n "boot script" -d $BOARD_DIR/6x_bootscript.txt $TARGET_DIR/6x_bootscript
 
 # u-boot / update script for bd upgradeu command
 if [ -e $BINARIES_DIR/u-boot.imx ];
 then
     install -D -m 0644 $BINARIES_DIR/u-boot.imx $TARGET_DIR/u-boot.imx
-    $HOST_DIR/usr/bin/mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
+    $HOST_DIR/bin/mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
     -n "upgrade script" -d $BOARD_DIR/6x_upgrade.txt $TARGET_DIR/6x_upgrade
 fi
board/chromebook/snow/mksd.sh +2 -2
index b6302aa86f..cba1578ec8 100755
@@ -14,8 +14,8 @@
 # cgpt does not create protective MBR, and the kernel refuses to read
 # GPT unless there's some kind of MBR in sector 0. So we need parted
 # to write that single sector before doing anything with the GPT.
-cgpt=$HOST_DIR/usr/bin/cgpt
-parted=$HOST_DIR/usr/sbin/parted
+cgpt=$HOST_DIR/bin/cgpt
+parted=$HOST_DIR/sbin/parted
 kernel=$BINARIES_DIR/uImage.kpart
 rootfs=$BINARIES_DIR/rootfs.ext2
 
board/chromebook/snow/sign.sh +3 -3
index 39005ed635..e8f111ff0a 100755
@@ -5,9 +5,9 @@
 # The resulting file is called uImage.kpart.
 
 BOARD_DIR=$(dirname $0)
-mkimage=$HOST_DIR/usr/bin/mkimage
-futility=$HOST_DIR/usr/bin/futility
-devkeys=$HOST_DIR/usr/share/vboot/devkeys
+mkimage=$HOST_DIR/bin/mkimage
+futility=$HOST_DIR/bin/futility
+devkeys=$HOST_DIR/share/vboot/devkeys
 
 run() { echo "$@"; "$@"; }
 die() { echo "$@" >&2; exit 1; }
board/cubietech/cubieboard2/post-build.sh +1 -1
index 465d493c08..d0a07a8171 100755
@@ -3,7 +3,7 @@
 # 2013, Carlo Caione <[email protected]>
 
 BOARD_DIR="$(dirname $0)"
-MKIMAGE=$HOST_DIR/usr/bin/mkimage
+MKIMAGE=$HOST_DIR/bin/mkimage
 BOOT_CMD=$BOARD_DIR/boot.cmd
 BOOT_CMD_H=$BINARIES_DIR/boot.scr
 
board/firefly/firefly-rk3288/post-image.sh +1 -1
index 1dd30a6e7e..d89bc7e550 100755
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-MKIMAGE=$HOST_DIR/usr/bin/mkimage
+MKIMAGE=$HOST_DIR/bin/mkimage
 
 BOARD_DIR="$(dirname $0)"
 GENIMAGE_CFG="${BOARD_DIR}/sd-image.cfg"
board/lemaker/bananapro/post-build.sh +1 -1
index fb4b6e99e1..a335310dbc 100755
@@ -4,7 +4,7 @@
 find $TARGET_DIR/lib/firmware/brcm -type f -not -name "brcmfmac43362*" -delete
 
 BOARD_DIR="$(dirname $0)"
-MKIMAGE=$HOST_DIR/usr/bin/mkimage
+MKIMAGE=$HOST_DIR/bin/mkimage
 BOOT_CMD=$BOARD_DIR/boot.cmd
 BOOT_CMD_H=$BINARIES_DIR/boot.scr
 
board/linksprite/pcduino/post-build.sh +1 -1
index 268c107193..e1e1877671 100755
@@ -3,7 +3,7 @@
 # 2013, Carlo Caione <[email protected]>
 
 BOARD_DIR="$(dirname $0)"
-MKIMAGE=$HOST_DIR/usr/bin/mkimage
+MKIMAGE=$HOST_DIR/bin/mkimage
 BOOT_CMD=$BOARD_DIR/boot.cmd
 BOOT_CMD_H=$BINARIES_DIR/boot.scr
 
board/nanopi-neo/post-build.sh +1 -1
index e6791e71ab..9759efb568 100755
@@ -4,7 +4,7 @@
 # 2016, "Yann E. MORIN" <[email protected]>
 
 BOARD_DIR="$( dirname "${0}" )"
-MKIMAGE="${HOST_DIR}/usr/bin/mkimage"
+MKIMAGE="${HOST_DIR}/bin/mkimage"
 BOOT_CMD="${BOARD_DIR}/boot.cmd"
 BOOT_CMD_H="${BINARIES_DIR}/boot.scr"
 
board/nexbox/a95x/post-build.sh +1 -1
index 9f4cc04518..f8706f2dff 100755
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 BOARD_DIR="$(dirname $0)"
-MKIMAGE=$HOST_DIR/usr/bin/mkimage
+MKIMAGE=$HOST_DIR/bin/mkimage
 
 $MKIMAGE -C none -A arm64 -T script -d $BOARD_DIR/boot.txt $BINARIES_DIR/boot.scr
 
board/olimex/a20_olinuxino/post-build.sh +1 -1
index ac8d4df184..e2d863aaf5 100755
@@ -3,7 +3,7 @@
 # $2    path of boot.cmd
 # $3    output directory for boot.scr
 
-MKIMAGE=$HOST_DIR/usr/bin/mkimage
+MKIMAGE=$HOST_DIR/bin/mkimage
 
 $MKIMAGE -A arm -O linux -T script -C none -d $2 $3/boot.scr
 
board/orangepi/post-build.sh +1 -1
index a544a19560..07e04df4d5 100755
@@ -3,7 +3,7 @@
 # 2013, Carlo Caione <[email protected]>
 
 BOARD_DIR="$(dirname $0)"
-MKIMAGE=$HOST_DIR/usr/bin/mkimage
+MKIMAGE=$HOST_DIR/bin/mkimage
 BOOT_CMD=$BOARD_DIR/boot.cmd
 BOOT_CMD_H=$BINARIES_DIR/boot.scr
 
board/pc/post-image.sh +1 -1
index 3b51409c24..c88ecb1dc2 100755
@@ -16,7 +16,7 @@ __EOF__
 else
   BOOT_TYPE=bios
   # Copy grub 1st stage to binaries, required for genimage
-  cp -f ${HOST_DIR}/usr/lib/grub/i386-pc/boot.img ${BINARIES_DIR}
+  cp -f ${HOST_DIR}/lib/grub/i386-pc/boot.img ${BINARIES_DIR}
 fi
 
 BOARD_DIR="$(dirname $0)"
board/solidrun/mx6cubox/post-build.sh +1 -1
index 07c480e616..43e091c5d7 100755
@@ -2,7 +2,7 @@
 
 BOARD_DIR="$(dirname $0)"
 
-$HOST_DIR/usr/bin/mkimage -A arm -O linux -T script -C none  \
+$HOST_DIR/bin/mkimage -A arm -O linux -T script -C none  \
 -n "boot script" -d $BOARD_DIR/boot.scr.txt $BOARD_DIR/boot.scr
 
 install -m 0644 -D $BOARD_DIR/boot.scr $TARGET_DIR/boot/boot.scr
board/technologic/ts4800/post-image.sh +1 -1
index 167dea812c..cc8e5da352 100755
@@ -9,7 +9,7 @@ GENIMAGE_TMP=${BUILD_DIR}/.genimage_tmp
 
 rm -rf ${GENIMAGE_TMP}
 
-${HOST_DIR}/usr/bin/genimage \
+${HOST_DIR}/bin/genimage \
         --config ${GENIMAGE_CFG} \
         --rootpath ${TARGET_DIR} \
         --tmppath ${GENIMAGE_TMP} \
board/technologic/ts4900/post-image.sh +1 -1
index 1e90cded72..cb966d883b 100755
@@ -9,7 +9,7 @@ GENIMAGE_TMP=$BUILD_DIR/.genimage_tmp
 
 rm -rf $GENIMAGE_TMP
 
-${HOST_DIR}/usr/bin/genimage \
+${HOST_DIR}/bin/genimage \
         --config ${GENIMAGE_CFG} \
         --rootpath $TARGET_DIR \
         --tmppath $GENIMAGE_TMP \
board/udoo/neo/post-build.sh +1 -1
index 07c480e616..43e091c5d7 100755
@@ -2,7 +2,7 @@
 
 BOARD_DIR="$(dirname $0)"
 
-$HOST_DIR/usr/bin/mkimage -A arm -O linux -T script -C none  \
+$HOST_DIR/bin/mkimage -A arm -O linux -T script -C none  \
 -n "boot script" -d $BOARD_DIR/boot.scr.txt $BOARD_DIR/boot.scr
 
 install -m 0644 -D $BOARD_DIR/boot.scr $TARGET_DIR/boot/boot.scr
board/wandboard/post-build.sh +1 -1
index 07c480e616..43e091c5d7 100755
@@ -2,7 +2,7 @@
 
 BOARD_DIR="$(dirname $0)"
 
-$HOST_DIR/usr/bin/mkimage -A arm -O linux -T script -C none  \
+$HOST_DIR/bin/mkimage -A arm -O linux -T script -C none  \
 -n "boot script" -d $BOARD_DIR/boot.scr.txt $BOARD_DIR/boot.scr
 
 install -m 0644 -D $BOARD_DIR/boot.scr $TARGET_DIR/boot/boot.scr
Signature · 1 line
2.11.0
#29 lore raw

PATCH 27/53 chromebook snow: remove $(HOST_DIR)/usr reference from README

In reply to Arnout Vandecappelle (Essensium/Mind)
---
 board/chromebook/snow/readme.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/chromebook/snow/readme.txt +1 -1
index e012cb3f9f..1afd949829 100644
@@ -88,7 +88,7 @@ you will probably want the rootfs to occupy the whole remaining space.
 
 cgpt may be used to check current layout:
 
-	output/host/usr/bin/cgpt show $SD
+	output/host/bin/cgpt show $SD
 
 All sizes and all offsets are in 512-byte blocks.
 
Signature · 1 line
2.11.0
#30 lore raw

PATCH 28/53 warpboard: remove $(HOST_DIR)/usr reference from README

In reply to Arnout Vandecappelle (Essensium/Mind)
---
 board/freescale/warpboard/README | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
board/freescale/warpboard/README +2 -2
index 55d51f8733..67d4e044e9 100644
@@ -23,7 +23,7 @@ Update uboot
 
 - Load u-boot.imx in the WarpBoard by using the imx-usb-loader host utility:
 
-  $ ./output/host/usr/bin/imx_usb -c output/host/etc/imx-loader.d/ output/images/u-boot.imx
+  $ ./output/host/bin/imx_usb -c output/host/etc/imx-loader.d/ output/images/u-boot.imx
 
 - U-Boot will appear in minicom
 
@@ -36,7 +36,7 @@ Update uboot
 
 - Transfer U-Boot into flash by running this command in host side:
 
- $ sudo ./output/host/usr/bin/dfu-util -D output/images/u-boot.imx -a boot
+ $ sudo ./output/host/bin/dfu-util -D output/images/u-boot.imx -a boot
 
 - remove power and put the WarpBoard back into normal boot mode by
   opening the j2 jumper.
Signature · 1 line
2.11.0
#31 lore raw

PATCH 29/53 stm32f429-disco: replace $HOST_DIR/usr with $HOST_DIR in flash script

In reply to Arnout Vandecappelle (Essensium/Mind)

Manual change because the script uses ${OUTPUT_DIR}/host instead of ${HOST_DIR}.

---
 board/stmicroelectronics/stm32f429-disco/flash.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/stmicroelectronics/stm32f429-disco/flash.sh +1 -1
index ffb8fcffa1..cf89a79cd6 100755
@@ -8,7 +8,7 @@ if ! test -d "${OUTPUT_DIR}" ; then
     exit 1
 fi
 
-${OUTPUT_DIR}/host/usr/bin/openocd -f board/stm32f429discovery.cfg \
+${OUTPUT_DIR}/host/bin/openocd -f board/stm32f429discovery.cfg \
   -c "init" \
   -c "reset init" \
   -c "flash probe 0" \
Signature · 1 line
2.11.0
#32 lore raw

PATCH 30/53 stm32f469-disco: replace $HOST_DIR/usr with $HOST_DIR in flash script

In reply to Arnout Vandecappelle (Essensium/Mind)

Manual change because the script uses ${OUTPUT_DIR}/host instead of ${HOST_DIR}.

---
 board/stmicroelectronics/stm32f469-disco/flash.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/stmicroelectronics/stm32f469-disco/flash.sh +1 -1
index a68bea09a7..0ec0beb2de 100755
@@ -8,7 +8,7 @@ if ! test -d "${OUTPUT_DIR}" ; then
     exit 1
 fi
 
-${OUTPUT_DIR}/host/usr/bin/openocd -f board/stm32f469discovery.cfg \
+${OUTPUT_DIR}/host/bin/openocd -f board/stm32f469discovery.cfg \
   -c "init" \
   -c "reset init" \
   -c "flash probe 0" \
Signature · 1 line
2.11.0
#33 lore raw

PATCH 31/53 eclipse-register-toolchain: toolchain is no longer installed in $(HOST_DIR)/usr

In reply to Arnout Vandecappelle (Essensium/Mind)
---
 support/scripts/eclipse-register-toolchain | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
support/scripts/eclipse-register-toolchain +1 -1
index 6f919985c0..891d29ee6f 100755
@@ -45,7 +45,7 @@ if test ! -d ${project_directory}/host ; then
     exit 1
 fi
 
-if test ! -e ${project_directory}/host/usr/bin/${toolchain_prefix}gcc ; then
+if test ! -e ${project_directory}/host/bin/${toolchain_prefix}gcc ; then
     echo "Cannot find the cross-compiler in the project directory"
     exit 1
 fi
Signature · 1 line
2.11.0
#34 lore raw

PATCH 32/53 manual: remove references to host/usr paths

In reply to Arnout Vandecappelle (Essensium/Mind)
---
 docs/manual/faq-troubleshooting.txt       | 2 +-
 docs/manual/using-buildroot-debugger.txt  | 2 +-
 docs/manual/using-buildroot-toolchain.txt | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
docs/manual/faq-troubleshooting.txt +1 -1
index 825899b047..b144c9e7f0 100644
@@ -127,7 +127,7 @@ installed what and remove it when the package is unselected. However, it
 is much more complicated than that:
 
  * It is not only about the +target/+ directory, but also the sysroot in
-   +host/usr/<tuple>/sysroot+ and the +host/+ directory itself. All files
+   +host/<tuple>/sysroot+ and the +host/+ directory itself. All files
    installed in those directories by various packages must be tracked.
 
  * When a package is unselected from the configuration, it is not
docs/manual/using-buildroot-debugger.txt +1 -1
index b5063ca94c..d5293beb53 100644
@@ -35,7 +35,7 @@ Then, on the host, you should start the cross gdb using the following
 command line:
 
 ----------------------------
-<buildroot>/output/host/usr/bin/<tuple>-gdb -x <buildroot>/output/staging/usr/share/buildroot/gdbinit foo
+<buildroot>/output/host/bin/<tuple>-gdb -x <buildroot>/output/staging/usr/share/buildroot/gdbinit foo
 ----------------------------
 
 Of course, +foo+ must be available in the current directory, built
docs/manual/using-buildroot-toolchain.txt +1 -1
index 9a98628fa8..6a90645649 100644
@@ -9,7 +9,7 @@ can use the toolchain that was generated by Buildroot.
 
 The toolchain generated by Buildroot is located by default in
 +output/host/+. The simplest way to use it is to add
-+output/host/usr/bin/+ to your PATH environment variable and then to
++output/host/bin/+ to your PATH environment variable and then to
 use +ARCH-linux-gcc+, +ARCH-linux-objdump+, +ARCH-linux-ld+, etc.
 
 It is possible to relocate the toolchain - but then +--sysroot+ must
Signature · 1 line
2.11.0
#35 lore raw

PATCH 33/53 grub2: remove host/usr reference from help text

In reply to Arnout Vandecappelle (Essensium/Mind)
---
 boot/grub2/Config.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
boot/grub2/Config.in +2 -2
index 7dc5cae218..2f4a3f069e 100644
@@ -31,8 +31,8 @@ config BR2_TARGET_GRUB2
 	     sudo tar -C /mnt -xf output/images/rootfs.tar
 	     sudo umount /mnt
 	  5. Install Grub2
-	     sudo ./output/host/usr/sbin/grub-bios-setup \
-			-b ./output/host/usr/lib/grub/i386-pc/boot.img \
+	     sudo ./output/host/sbin/grub-bios-setup \
+			-b ./output/host/lib/grub/i386-pc/boot.img \
 			-c ./output/images/grub.img -d . /dev/loop0
 	  6. Cleanup loop device
 	     sudo partx -d /dev/loop0
Signature · 1 line
2.11.0
#36 lore raw

PATCH 34/53 lttng-tools: remove host/usr reference from help text

In reply to Arnout Vandecappelle (Essensium/Mind)
---
 package/lttng-tools/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/lttng-tools/Config.in +1 -1
index 187e424b0b..9c86cc2646 100644
@@ -17,7 +17,7 @@ config BR2_PACKAGE_LTTNG_TOOLS
 	  and stop tracing sessions. Analysis of the trace can be done
 	  on the host machine using the babeltrace utility. This
 	  utility is automatically built by Buildroot in
-	  $(O)/host/usr/bin/babeltrace, as a dependency of
+	  $(O)/host/bin/babeltrace, as a dependency of
 	  lttng-tools. However, there is also a lttng-babeltrace
 	  package for the target, if babeltrace on the target is
 	  interesting.
Signature · 1 line
2.11.0
#37 lore raw

PATCH 35/53 mfgtools: remove host/usr reference from readme.txt

In reply to Arnout Vandecappelle (Essensium/Mind)
---
 package/mfgtools/readme.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/mfgtools/readme.txt +1 -1
index d54781f1f9..320e6ec493 100644
@@ -42,7 +42,7 @@ Depending on your ucl2.xml file, the sample doesn't flash anything.
 
 6. Run the MfgTools client:
 
-$ ./host/usr/bin/mfgtoolcli -l mmc -s uboot_defconfig=imx \
+$ ./host/bin/mfgtoolcli -l mmc -s uboot_defconfig=imx \
   -s dtbname=imx6q-sabrelite.dtb -s initramfs=rootfs.cpio.uboot \
   -s mmc=1 -p 1
 
Signature · 1 line
2.11.0
#38 lore raw

PATCH 36/53 lesstif: remove host/usr reference from .mk comment

In reply to Arnout Vandecappelle (Essensium/Mind)

While we're at it, correct it to $(HOST_DIR).

---
 package/lesstif/lesstif.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/lesstif/lesstif.mk +1 -1
index 933dd13373..646b729ce0 100644
@@ -31,7 +31,7 @@ define LESSTIF_NOMAN2HTML
 endef
 
 # Prevents to copy ac_find_motif.m4 on target, it would else
-# be created at $(TARGET_DIR)/$(TOPDIR)/output/host/usr/share/aclocal/ac_find_motif.m4
+# be created at $(TARGET_DIR)/$(HOST_DIR)/share/aclocal/ac_find_motif.m4
 define LESSTIF_FIXACLOCAL
 	sed -i -e "/install-data-am: install-aclocalDATA/d" $(@D)/scripts/autoconf/Makefile
 endef
Signature · 1 line
2.11.0
#39 lore raw

PATCH 37/53 board/gdb/bfin-bf512: remove host/usr reference from readme.txt

In reply to Arnout Vandecappelle (Essensium/Mind)
---
 board/gdb/bfin-bf512/readme.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
board/gdb/bfin-bf512/readme.txt +2 -2
index a56b5bcfe9..b8ff250a04 100644
@@ -1,10 +1,10 @@
 Run the simulation with GDB for FDPIC:
 
- ./output/host/usr/bin/bfin-buildroot-linux-uclibc-run --env operating --model bf512 output/images/vmlinux
+ ./output/host/bin/bfin-buildroot-linux-uclibc-run --env operating --model bf512 output/images/vmlinux
 
 Run the simulation with GDB for FLAT:
 
- ./output/host/usr/bin/bfin-buildroot-uclinux-uclibc-run --env operating --model bf512 output/images/vmlinux
+ ./output/host/bin/bfin-buildroot-uclinux-uclibc-run --env operating --model bf512 output/images/vmlinux
 
 The login prompt will appear in the terminal that started GDB.
 
Signature · 1 line
2.11.0
#40 lore raw

PATCH 38/53 board/csky: remove host/usr reference from readme.txt

In reply to Arnout Vandecappelle (Essensium/Mind)
---
 board/csky/readme.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/csky/readme.txt +1 -1
index daf7185910..b4605c541e 100644
@@ -84,5 +84,5 @@ Run
   Setup the Console with the rate 115200/8-N-1.
 
   $ cd output/images
-  $ ../host/usr/bin/csky-linux-gdb -x ../../board/csky/gx6605s/gdbinit vmlinux
+  $ ../host/bin/csky-linux-gdb -x ../../board/csky/gx6605s/gdbinit vmlinux
 
Signature · 1 line
2.11.0
#41 lore raw

PATCH 39/53 libffi: avoid $(HOST_DIR)/usr while moving headers

In reply to Arnout Vandecappelle (Essensium/Mind)
---
 package/libffi/libffi.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
package/libffi/libffi.mk +4 -4
index 38ef2d60d0..32e01e9cd1 100644
@@ -14,13 +14,13 @@ LIBFFI_AUTORECONF = YES
 # Move the headers to the usual location, and adjust the .pc file
 # accordingly.
 define LIBFFI_MOVE_HEADERS
-	mv $(1)/usr/lib/libffi-$(LIBFFI_VERSION)/include/*.h $(1)/usr/include/
+	mv $(1)/lib/libffi-$(LIBFFI_VERSION)/include/*.h $(1)/include/
 	$(SED) '/^includedir.*/d' -e '/^Cflags:.*/d' \
-		$(1)/usr/lib/pkgconfig/libffi.pc
-	rm -rf $(1)/usr/lib/libffi-*
+		$(1)/lib/pkgconfig/libffi.pc
+	rm -rf $(1)/lib/libffi-*
 endef
 
-LIBFFI_MOVE_STAGING_HEADERS = $(call LIBFFI_MOVE_HEADERS,$(STAGING_DIR))
+LIBFFI_MOVE_STAGING_HEADERS = $(call LIBFFI_MOVE_HEADERS,$(STAGING_DIR)/usr)
 LIBFFI_POST_INSTALL_STAGING_HOOKS += LIBFFI_MOVE_STAGING_HEADERS
 
 HOST_LIBFFI_MOVE_HOST_HEADERS = $(call LIBFFI_MOVE_HEADERS,$(HOST_DIR))
Signature · 1 line
2.11.0
#42 lore raw

PATCH 40/53 genromfs: use $(HOST_DIR) instead of $(HOST_DIR)/usr as prefix

In reply to Arnout Vandecappelle (Essensium/Mind)

genromfs is special because it uses "PREFIX" in the meaning of DESTDIR and "prefix" in the meaning of prefix. We were up to know using it incorrectly for host: PREFIX shouldn't be set and only prefix should be set.

Add an explanatory comment for this unusual behaviour.

---
 package/genromfs/genromfs.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/genromfs/genromfs.mk +3 -1
index 3025550637..fd696b45b2 100644
@@ -16,6 +16,8 @@ define GENROMFS_BUILD_CMDS
 		LDFLAGS="$(TARGET_LDFLAGS)"
 endef
 
+# "PREFIX" is the equivalent of DESTDIR in autotools, "prefix" is the
+# traditional prefix. "prefix" defaults to /usr so no need to set it.
 define GENROMFS_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) PREFIX=$(TARGET_DIR) install
 endef
@@ -25,7 +27,7 @@ define HOST_GENROMFS_BUILD_CMDS
 endef
 
 define HOST_GENROMFS_INSTALL_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) PREFIX=$(HOST_DIR) install
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) prefix=$(HOST_DIR) install
 endef
 
 $(eval $(generic-package))
Signature · 1 line
2.11.0
#43 lore raw

PATCH 41/53 libcap: use $(HOST_DIR) as prefix instead of DESTDIR

In reply to Arnout Vandecappelle (Essensium/Mind)

... and also remove the /usr prefix.

---
 package/libcap/libcap.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/libcap/libcap.mk +2 -2
index 35a6a97134..48c2cb3456 100644
@@ -63,8 +63,8 @@ define HOST_LIBCAP_BUILD_CMDS
 endef
 
 define HOST_LIBCAP_INSTALL_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) \
-		RAISE_SETFCAP=no prefix=/usr lib=lib install
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) prefix=$(HOST_DIR) \
+		RAISE_SETFCAP=no lib=lib install
 endef
 
 $(eval $(generic-package))
Signature · 1 line
2.11.0
#44 lore raw

PATCH 42/53 lzip: use $(HOST_DIR) as prefix instead of DESTDIR

In reply to Arnout Vandecappelle (Essensium/Mind)

... and remove the /usr prefix

---
 package/lzip/lzip.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/lzip/lzip.mk +2 -2
index 04c83f1133..cb8803737e 100644
@@ -15,7 +15,7 @@ define LZIP_CONFIGURE_CMDS
 endef
 
 define HOST_LZIP_CONFIGURE_CMDS
-	(cd $(@D); $(HOST_MAKE_ENV) ./configure --prefix=/usr \
+	(cd $(@D); $(HOST_MAKE_ENV) ./configure --prefix=$(HOST_DIR) \
 		$(HOST_CONFIGURE_OPTS) )
 endef
 
@@ -32,7 +32,7 @@ define LZIP_INSTALL_TARGET_CMDS
 endef
 
 define HOST_LZIP_INSTALL_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) install
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) install
 endef
 
 # It's not autotools-based
Signature · 1 line
2.11.0
#45 lore raw

PATCH 43/53 opkg-utils: use $(HOST_DIR) as PREFIX instead of DESTDIR

In reply to Arnout Vandecappelle (Essensium/Mind)

... and remove the /usr prefix

---
 package/opkg-utils/opkg-utils.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/opkg-utils/opkg-utils.mk +1 -1
index 6f4e64e34f..df202220d2 100644
@@ -15,7 +15,7 @@ define HOST_OPKG_UTILS_BUILD_CMDS
 endef
 
 define HOST_OPKG_UTILS_INSTALL_CMDS
-	$(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) PREFIX=/usr install
+	$(MAKE) -C $(@D) PREFIX=$(HOST_DIR) install
 endef
 
 $(eval $(host-generic-package))
Signature · 1 line
2.11.0
#46 lore raw

PATCH 44/53 raspberrypi-usbboot: remove /usr from DESTDIR-based install commands

In reply to Arnout Vandecappelle (Essensium/Mind)

We have a patch that adds $(DESTDIR) to the install commands of raspberrypi-usbboot, but it would still be installed in $(DESTDIR)/usr. We don't want that, so remove the /usr part in the installation commands.

Note that upstream has removed the 'install' target entirely, so there's no point trying to keep the patch in upstreamable shape (i.e. defaulting DESTDIR to /usr).

---
 .../0002-Makefile-add-DESTDIR-support.patch        | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
package/raspberrypi-usbboot/0002-Makefile-add-DESTDIR-support.patch +12 -10
index c37d5a1e0a..a757cb0e03 100644
@@ -7,6 +7,8 @@ This allows installing rpiboot outside of /usr if needed.
 
 Submitted-upstream: https://github.com/raspberrypi/usbboot/pull/2
 Signed-off-by: Thomas Petazzoni <[email protected]>
+[Arnout: remove /usr]
+Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
 ---
  Makefile | 20 ++++++++++----------
  1 file changed, 10 insertions(+), 10 deletions(-)
@@ -24,11 +26,11 @@ index d9a7220..7835b7f 100755
 -	cp usbbootcode.bin /usr/share/rpiboot
 -	cp msd.elf /usr/share/rpiboot
 -	cp buildroot.elf /usr/share/rpiboot
-+	cp rpiboot $(DESTDIR)/usr/bin
-+	mkdir -p $(DESTDIR)//usr/share/rpiboot
-+	cp usbbootcode.bin $(DESTDIR)/usr/share/rpiboot
-+	cp msd.elf $(DESTDIR)/usr/share/rpiboot
-+	cp buildroot.elf $(DESTDIR)/usr/share/rpiboot
++	cp rpiboot $(DESTDIR)bin
++	mkdir -p $(DESTDIR)/share/rpiboot
++	cp usbbootcode.bin $(DESTDIR)/share/rpiboot
++	cp msd.elf $(DESTDIR)/share/rpiboot
++	cp buildroot.elf $(DESTDIR)/share/rpiboot
  
  uninstall:
 -	rm -f /usr/bin/rpiboot
@@ -36,11 +38,11 @@ index d9a7220..7835b7f 100755
 -	rm -f /usr/share/rpiboot/msd.elf
 -	rm -f /usr/share/rpiboot/buildroot.elf
 -	rmdir --ignore-fail-on-non-empty /usr/share/rpiboot/
-+	rm -f $(DESTDIR)/usr/bin/rpiboot
-+	rm -f $(DESTDIR)/usr/share/rpiboot/usbbootcode.bin
-+	rm -f $(DESTDIR)/usr/share/rpiboot/msd.elf
-+	rm -f $(DESTDIR)/usr/share/rpiboot/buildroot.elf
-+	rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/rpiboot/
++	rm -f $(DESTDIR)/bin/rpiboot
++	rm -f $(DESTDIR)/share/rpiboot/usbbootcode.bin
++	rm -f $(DESTDIR)/share/rpiboot/msd.elf
++	rm -f $(DESTDIR)/share/rpiboot/buildroot.elf
++	rmdir --ignore-fail-on-non-empty $(DESTDIR)/share/rpiboot/
  
  clean: 
  	rm rpiboot
Signature · 1 line
2.11.0
#47 lore raw

PATCH 45/53 dos2unix: use prefix instead of DESTDIR for host installation

In reply to Arnout Vandecappelle (Essensium/Mind)

prefix defaults to /usr, so setting DESTDIR installs things in $(HOST_DIR)/usr.

---
 package/dos2unix/dos2unix.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/dos2unix/dos2unix.mk +1 -1
index 3540ec8562..ff4117307c 100644
@@ -39,7 +39,7 @@ define HOST_DOS2UNIX_BUILD_CMDS
 endef
 
 define HOST_DOS2UNIX_INSTALL_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) ENABLE_NLS= \
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) prefix=$(HOST_DIR) ENABLE_NLS= \
 		install
 endef
 
Signature · 1 line
2.11.0
#48 lore raw

PATCH 46/53 imx-uxb-loader: use prefix instead of DESTDIR for host installation

In reply to Arnout Vandecappelle (Essensium/Mind)

prefix defaults to /usr, so setting DESTDIR installs things in $(HOST_DIR)/usr.

---
 package/imx-usb-loader/imx-usb-loader.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
package/imx-usb-loader/imx-usb-loader.mk +1 -2
index 1d2c23f825..685fa9d24a 100644
@@ -15,8 +15,7 @@ define HOST_IMX_USB_LOADER_BUILD_CMDS
 endef
 
 define HOST_IMX_USB_LOADER_INSTALL_CMDS
-	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
-		DESTDIR=$(HOST_DIR) sysconfdir=/etc install
+	$(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D) prefix=$(HOST_DIR) install
 endef
 
 $(eval $(host-generic-package))
Signature · 1 line
2.11.0
#49 lore raw

PATCH 47/53 mtd: use PREFIX instead of DESTDIR for host installation

In reply to Arnout Vandecappelle (Essensium/Mind)

PREFIX defaults to /usr, so setting DESTDIR installs things in $(HOST_DIR)/usr.

---
 package/mtd/mtd.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/mtd/mtd.mk +1 -1
index 218265af9f..6443ef0d93 100644
@@ -46,7 +46,7 @@ define HOST_MTD_BUILD_CMDS
 endef
 
 define HOST_MTD_INSTALL_CMDS
-	$(MAKE1) BUILDDIR=$(@D) DESTDIR=$(HOST_DIR) -C $(@D) install
+	$(MAKE1) BUILDDIR=$(@D) PREFIX=$(HOST_DIR) -C $(@D) install
 endef
 
 MKFS_JFFS2 = $(HOST_DIR)/sbin/mkfs.jffs2
Signature · 1 line
2.11.0
#50 lore raw

PATCH 48/53 grub2: install in $(HOST_DIR) instead of $(HOST_DIR)/usr

In reply to Arnout Vandecappelle (Essensium/Mind)

grub2 builds for the target but installs with DESTDIR=$(HOST_DIR). Since we set prefix to /usr in TARGET_CONF_OPTS, this results in installing things in $(HOST_DIR)/usr.

To make sure we don't install in $(HOST_DIR)/usr, override --prefix and --exec-prefix.

---
 boot/grub2/grub2.mk | 2 ++
 1 file changed, 2 insertions(+)
boot/grub2/grub2.mk +2 -0
index 80f06c7f02..1b1ca105fe 100644
@@ -63,6 +63,8 @@ GRUB2_CONF_ENV = \
 GRUB2_CONF_OPTS = \
 	--target=$(GRUB2_TARGET) \
 	--with-platform=$(GRUB2_PLATFORM) \
+	--prefix=/ \
+	--exec-prefix=/ \
 	--disable-grub-mkfont \
 	--enable-efiemu=no \
 	ac_cv_lib_lzma_lzma_code=no \
Signature · 1 line
2.11.0
#51 lore raw

PATCH 49/53 sepolgen: strip /usr/ part from HOST_DIR

In reply to Arnout Vandecappelle (Essensium/Mind)

sepolgen is a bit weird: DESTDIR acts as a kind of prefix, PYTHONLIBDIR is relative to it (and a / is added between them).

---
 package/sepolgen/sepolgen.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/sepolgen/sepolgen.mk +2 -2
index 033b468f02..ab7f18d857 100644
@@ -30,11 +30,11 @@ endef
 ifeq ($(BR2_PACKAGE_PYTHON3),y)
 HOST_SEPOLGEN_DEPENDENCIES = host-python3
 HOST_SEPOLGEN_MAKE_CMDS = $(HOST_CONFIGURE_OPTS) \
-	PYTHONLIBDIR=/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
+	PYTHONLIBDIR=lib/python$(PYTHON3_VERSION_MAJOR)/site-packages
 else
 HOST_SEPOLGEN_DEPENDENCIES = host-python
 HOST_SEPOLGEN_MAKE_CMDS = $(HOST_CONFIGURE_OPTS) \
-	PYTHONLIBDIR=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
+	PYTHONLIBDIR=lib/python$(PYTHON_VERSION_MAJOR)/site-packages
 endif
 
 define HOST_SEPOLGEN_BUILD_CMDS
Signature · 1 line
2.11.0
#52 lore raw

PATCH 50/53 libsemanage: rework host installation

In reply to Arnout Vandecappelle (Essensium/Mind)

libsemanage has a pretty peculiar interpretation of DESTDIR and PREFIX. PREFIX is not consistently used: some installation paths are forced to $(DESTDIR)/usr/... . In other cases, PREFIX is indeed used. PREFIX defaults to $(DESTDIR)/usr

Try to be a little bit more correct by passing both DESTDIR and PREFIX, both set to $(HOST_DIR). This is not a complete fix: man pages are still installed in $(HOST_DIR)/usr - but we don't care about that.

---
 package/libsemanage/libsemanage.mk | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
package/libsemanage/libsemanage.mk +10 -7
index 5ef2d57e35..2964c56f96 100644
@@ -29,7 +29,12 @@ endef
 
 HOST_LIBSEMANAGE_DEPENDENCIES = host-bison host-audit host-libsepol host-libselinux \
 				host-ustr host-bzip2 host-swig
-HOST_LIBSEMANAGE_MAKE_OPTS += $(HOST_CONFIGURE_OPTS) \
+
+# DESTDIR is needed during the compile to compute library and header paths.
+HOST_LIBSEMANAGE_MAKE_OPTS += \
+	$(HOST_CONFIGURE_OPTS) \
+	DESTDIR=$(HOST_DIR) \
+	PREFIX=$(HOST_DIR) \
 	SWIG_LIB="$(HOST_DIR)/share/swig/$(SWIG_VERSION)/"
 
 ifeq ($(BR2_PACKAGE_PYTHON3),y)
@@ -47,15 +52,13 @@ HOST_LIBSEMANAGE_MAKE_OPTS += \
 endif
 
 define HOST_LIBSEMANAGE_BUILD_CMDS
-	# DESTDIR is needed during the compile to compute library and
-	# header paths.
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_CONFIGURE_OPTS) DESTDIR=$(HOST_DIR) all
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_LIBSEMANAGE_MAKE_OPTS) DESTDIR=$(HOST_DIR) swigify pywrap
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_LIBSEMANAGE_MAKE_OPTS) all
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_LIBSEMANAGE_MAKE_OPTS) swigify pywrap
 endef
 
 define HOST_LIBSEMANAGE_INSTALL_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_CONFIGURE_OPTS) DESTDIR=$(HOST_DIR) install
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_LIBSEMANAGE_MAKE_OPTS) DESTDIR=$(HOST_DIR) install-pywrap
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_LIBSEMANAGE_MAKE_OPTS) install
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_LIBSEMANAGE_MAKE_OPTS) install-pywrap
 endef
 
 $(eval $(generic-package))
Signature · 1 line
2.11.0
#53 lore raw

PATCH 51/53 libselinux: rework host installation

In reply to Arnout Vandecappelle (Essensium/Mind)

libselinux has a pretty peculiar interpretation of DESTDIR and PREFIX. PREFIX is not consistently used: some installation paths are forced to $(DESTDIR)/usr/... . In other cases, PREFIX is indeed used. PREFIX defaults to $(DESTDIR)/usr.

Try to be a little bit more correct by passing both DESTDIR and PREFIX, both set to $(HOST_DIR). This is not a complete fix: man pages are still installed in $(HOST_DIR)/usr - but we don't care about that.

Also simplify the symlink creation, like how it's done in libsepol.

---
 package/libselinux/libselinux.mk | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
package/libselinux/libselinux.mk +8 -9
index 0d97c17e3a..0483d4d2b0 100644
@@ -79,32 +79,31 @@ HOST_LIBSELINUX_PYINC = -I$(HOST_DIR)/include/python$(PYTHON_VERSION_MAJOR)/
 HOST_LIBSELINUX_PYLIBVER = python$(PYTHON_VERSION_MAJOR)
 endif
 
+# DESTDIR is needed during the compile to compute library and header paths.
 HOST_LIBSELINUX_MAKE_OPTS = \
 	$(HOST_CONFIGURE_OPTS) \
+	DESTDIR=$(HOST_DIR) \
+	PREFIX=$(HOST_DIR) \
 	LDFLAGS="$(HOST_LDFLAGS) -lpcre -lpthread" \
 	PYINC="$(HOST_LIBSELINUX_PYINC)" \
 	PYSITEDIR="$(HOST_DIR)/lib/$(HOST_LIBSELINUX_PYLIBVER)/site-packages" \
 	SWIG_LIB="$(HOST_DIR)/share/swig/$(SWIG_VERSION)/"
 
 define HOST_LIBSELINUX_BUILD_CMDS
-	# DESTDIR is needed during the compile to compute library and
-	# header paths.
 	$(HOST_MAKE_ENV) $(MAKE1) -C $(@D) \
-		$(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) \
-		SHLIBDIR=$(HOST_DIR)/lib all
+		$(HOST_LIBSELINUX_MAKE_OPTS) all
 	# Generate python interface wrapper
 	$(HOST_MAKE_ENV) $(MAKE1) -C $(@D) \
-		$(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) swigify pywrap
+		$(HOST_LIBSELINUX_MAKE_OPTS) swigify pywrap
 endef
 
 define HOST_LIBSELINUX_INSTALL_CMDS
 	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) \
-		$(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) \
-		SHLIBDIR=$(HOST_DIR)/lib SBINDIR=$(HOST_DIR)/sbin install
-	(cd $(HOST_DIR)/lib; $(HOSTLN) -sf libselinux.so.1 libselinux.so)
+		$(HOST_LIBSELINUX_MAKE_OPTS) install
+	ln -sf libselinux.so.1 $(HOST_DIR)/lib/libselinux.so
 	# Install python interface wrapper
 	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) \
-		$(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) install-pywrap
+		$(HOST_LIBSELINUX_MAKE_OPTS) install-pywrap
 endef
 
 $(eval $(generic-package))
Signature · 1 line
2.11.0
#54 lore raw

PATCH 52/53 checkpolicy: rework host installation

In reply to Arnout Vandecappelle (Essensium/Mind)

checkpolicy has a pretty peculiar interpretation of DESTDIR and PREFIX. PREFIX simply defaults to $(DESTDIR)/usr, and is used in the rest of the build system. DESTDIR isn't used any further.

For the host installation, we don't want the usr part, so set PREFIX instead of DESTDIR.

---
 package/checkpolicy/checkpolicy.mk | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
package/checkpolicy/checkpolicy.mk +6 -4
index d80bb792b4..f0cca593d3 100644
@@ -31,17 +31,19 @@ endef
 
 HOST_CHECKPOLICY_DEPENDENCIES = host-libselinux host-flex host-bison
 
-HOST_CHECKPOLICY_MAKE_OPTS = $(HOST_CONFIGURE_OPTS) \
+# PREFIX is used at build time to find host-libselinux
+HOST_CHECKPOLICY_MAKE_OPTS = \
+	$(HOST_CONFIGURE_OPTS) \
+	PREFIX=$(HOST_DIR) \
 	LEX="$(HOST_DIR)/bin/flex" \
 	YACC="$(HOST_DIR)/bin/bison -y"
 
-# DESTDIR is used at build time to find host-libselinux
 define HOST_CHECKPOLICY_BUILD_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_CHECKPOLICY_MAKE_OPTS) DESTDIR=$(HOST_DIR)
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_CHECKPOLICY_MAKE_OPTS)
 endef
 
 define HOST_CHECKPOLICY_INSTALL_CMDS
-	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_CHECKPOLICY_MAKE_OPTS) DESTDIR=$(HOST_DIR) install
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) $(HOST_CHECKPOLICY_MAKE_OPTS) install
 endef
 
 $(eval $(generic-package))
Signature · 1 line
2.11.0
#55 lore raw

PATCH 53/53 policycoreutils: rework host installation

In reply to Arnout Vandecappelle (Essensium/Mind)

policycoreutils has a pretty peculiar interpretation of DESTDIR and PREFIX. PREFIX is not consistently used: some installation paths and include paths are forced to $(DESTDIR)/usr/... . In other cases, PREFIX is indeed used. PREFIX defaults to $(DESTDIR)/usr

Try to be a little bit more correct by passing both DESTDIR and PREFIX, both set to $(HOST_DIR). This is not a complete fix: some things are still installed in $(HOST_DIR)/usr - but nothing we care about (just manpages, systemd services, ...). More importantly, however, it still looks for e.g. D-Bus in $(DESTDIR)/usr/include/dbus-1.0.

Still, it's better than nothing.

---
 package/policycoreutils/policycoreutils.mk | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
package/policycoreutils/policycoreutils.mk +8 -7
index 480fd6e09d..6fec4afb25 100644
@@ -87,13 +87,18 @@ HOST_POLICYCOREUTILS_DEPENDENCIES = \
 # Undefining _FILE_OFFSET_BITS here because of a "bug" with glibc fts.h
 # large file support.
 # See https://bugzilla.redhat.com/show_bug.cgi?id=574992 for more information
+# We need to pass DESTDIR at build time because it's used by
+# policycoreutils build system to find headers and libraries.
+# We also need to pass PREFIX because it defaults to $(DESTDIR)/usr
 HOST_POLICYCOREUTILS_MAKE_OPTS = \
 	$(HOST_CONFIGURE_OPTS) \
 	CFLAGS="$(HOST_CFLAGS) -U_FILE_OFFSET_BITS" \
 	CPPFLAGS="$(HOST_CPPFLAGS) -U_FILE_OFFSET_BITS" \
 	PYTHON="$(HOST_DIR)/bin/python" \
 	PYTHON_INSTALL_ARGS="$(HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPTS)" \
-	ARCH="$(HOSTARCH)"
+	ARCH="$(HOSTARCH)" \
+	DESTDIR=$(HOST_DIR) \
+	PREFIX=$(HOST_DIR)
 
 ifeq ($(BR2_PACKAGE_PYTHON3),y)
 HOST_POLICYCOREUTILS_DEPENDENCIES += host-python3
@@ -112,19 +117,15 @@ HOST_POLICYCOREUTILS_MAKE_DIRS = \
 	semodule_package setfiles restorecond \
 	audit2allow scripts semanage sepolicy
 
-# We need to pass DESTDIR at build time because it's used by
-# policycoreutils build system to find headers and libraries.
 define HOST_POLICYCOREUTILS_BUILD_CMDS
 	$(foreach d,$(HOST_POLICYCOREUTILS_MAKE_DIRS),
-		$(MAKE) -C $(@D)/$(d) $(HOST_POLICYCOREUTILS_MAKE_OPTS) \
-			DESTDIR=$(HOST_DIR) all
+		$(MAKE) -C $(@D)/$(d) $(HOST_POLICYCOREUTILS_MAKE_OPTS) all
 	)
 endef
 
 define HOST_POLICYCOREUTILS_INSTALL_CMDS
 	$(foreach d,$(HOST_POLICYCOREUTILS_MAKE_DIRS),
-		$(MAKE) -C $(@D)/$(d) $(HOST_POLICYCOREUTILS_MAKE_OPTS) \
-			DESTDIR=$(HOST_DIR) install
+		$(MAKE) -C $(@D)/$(d) $(HOST_POLICYCOREUTILS_MAKE_OPTS) install
 	)
 	# Fix python paths
 	$(SED) 's%/usr/bin/%$(HOST_DIR)/bin/%g' $(HOST_DIR)/bin/audit2allow
Signature · 1 line
2.11.0
#56 lore raw

cover Eliminate $(HOST_DIR)/usr

In reply to Arnout Vandecappelle (Essensium/Mind)

Hi all,

Quoted 15 lines · Arnout Vandecappelle (Essensium/Mind)

We currently use $(HOST_DIR)/usr as the prefix for host packages. That has a few disadvantages:

- There are some things installed in $(HOST_DIR)/etc and $(HOST_DIR)/sbin, which is inconsistent.

- To pack a buildroot-built toolchain into a tarball for use as an external toolchain, you have to pack output/host/usr instead of the more obvious output/host.

- Because of the above, the internal toolchain wrapper breaks which forces us to work around it (call the actual toolchain executable directly). This is OK for us, but when used in another build system, that's a problem.

Quoted 4 lines

- Paths are four characters longer.

This series replaces all occurences of 'host/usr' (in its various forms) with 'host', and updates relative paths accordingly.

[snip]

Do we want this series still for 2017.05?

If yes, I think it should be committed (or at least the first 7 or so patches)
pretty soon, so there are still a few weeks to iron out any major breakage before the -rc1.

If not, then I can just as well remove it from patchwork now, since it doesn't
make sense to apply it before June and then I can do a respin.

Remove 53 out of 215 patches on patchwork would be nice :-)

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#57 lore raw

cover Eliminate $(HOST_DIR)/usr

Arnout, all,

Quoted 18 lines · Arnout Vandecappelle

Hi all,

Quoted 15 lines · Arnout Vandecappelle (Essensium/Mind)

We currently use $(HOST_DIR)/usr as the prefix for host packages. That has a few disadvantages:

- There are some things installed in $(HOST_DIR)/etc and $(HOST_DIR)/sbin, which is inconsistent.

- To pack a buildroot-built toolchain into a tarball for use as an external toolchain, you have to pack output/host/usr instead of the more obvious output/host.

- Because of the above, the internal toolchain wrapper breaks which forces us to work around it (call the actual toolchain executable directly). This is OK for us, but when used in another build system, that's a problem.

Quoted 5 lines
Quoted 4 lines

- Paths are four characters longer.

This series replaces all occurences of 'host/usr' (in its various forms) with 'host', and updates relative paths accordingly.

[snip]

Signature · 1 line
Samuel