Commit Graph

32 Commits (be3c8f8b2bf2893950b11ea7fa16cea074bc7903)

Author SHA1 Message Date
Rosen Penev 383abffb11 cmake: Install host packages to lib instead of lib64
Several CMake packages such as log4cplus and protobuf(-c) install to
lib64 instead of lib on some hosts. This completely breaks rpath linking.
Override it globally to avoid fixing each package individually.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Tested-by: Sebastian Kemper <sebastian_ml@gmx.net>
4 years ago
Amol Bhave 366e6ef5c3 build: use CMAKE_SOURCE_SUBDIR variable to cmake.mk
Sometimes, the CMakeLists.txt file is not in the root directory of a
repo. In those cases, the CMAKE_SOURCE_SUBDIR variable can be specified
to use CMakeLists.txt from a subdirectory instead.

Signed-off-by: Amol Bhave <ambhave@fb.com>
6 years ago
Felix Fietkau 294e908a2c cmake: skip build system check on compile
cmake checks the build system and its variables on its own to detect if
the makefiles need to be regenerated.
Unfortunately this can invalidate overrides passed in the
Build/Configure step. On non-Linux systems this breaks the build when
switching between targets of the same package architecture.

Fix this by forcibly disabling the build system check and relying on the
LEDE build system to take care of these things

Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Matthias Schiffer 3d71786154
build: move STAGING_DIR_HOSTPKG and BUILD_DIR_HOST back to a common directory for all targets
Using a single host package staging dir (and build dir) significantly speeds up
builds when multiple targets are built in succession, especially for large host
packages like NodeJS.

$(STAGING_DIR)/host is kept in addition to $(STAGING_DIR_HOSTPKG) in most
places; it is still used as destination for host files in Build/InstallDev.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
7 years ago
Hauke Mehrtens 559fb537d8 build: use CXXFLAGS if defined
Instead of using TARGET_CFLAGS and EXTRA_CFLAGS in cmake and scons
build use the TARGET_CXXFLAGS and EXTRA_CXXFLAGS like it is done for
normal make and configure. configure used TARGET_CXXFLAGS and
EXTRA_CFLAGS for the CXXFLAGS. The package-default.mk sets
"EXTRA_CXXFLAGS = $(EXTRA_CFLAGS)" so using EXTRA_CXXFLAGS flags should
be save.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
8 years ago
Felix Fietkau 50e7c1f79d include/cmake.mk: fix host builds
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Luke McKee eadf5fb7f8 cmake: include/cmake.mk add CMAKE_BINARY_SUBDIR to allow out of source tree builds
Some packages need out of source tree building with cmake, for example
when building kernel modules.
See an example here:
https://sourceforge.net/p/accel-ppp/code/ci/master/tree/README

Signed-off-by: Luke McKee <hojuruku@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name> [cleanup, rework]
8 years ago
Vasilis Tsiligiannis d55512075b include/cmake.mk: Add helper macro to handle conditionals for CMake boolean type variables
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>

SVN-Revision: 49164
8 years ago
Felix Fietkau 1d2c63c455 include/cmake.mk: search in $(STAGING_DIR)/usr instead of plain $(STAGING_DIR) to avoid picking up stuff from host/
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48492
8 years ago
Felix Fietkau 7b5236de85 include/cmake.mk: adjust for STAGING_DIR_HOST split
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48491
8 years ago
Felix Fietkau 48fc1f9781 build: for cmake, always use ccache from staging dir instead of relying on the host
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48079
8 years ago
Felix Fietkau d2ecd10f2f cmake.mk: enable -Bsymbolic-functions by default for linking shared libs, slightly improves performance and compression
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45508
9 years ago
Felix Fietkau 4cfc7b50ae cmake.mk: add host build support
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45282
9 years ago
Felix Fietkau a5422864f5 build: fix CMake assembly builds with ccache
CMAKE_ASM_COMPILER is automatically set to CMAKE_C_COMPILER by CMake, but
CMAKE_C_COMPILER_ARG1 is lost. This causes assembly builds to fail when ccache
is enabled (for example the package fastd on x86).

Fix this by explicitly defining CMAKE_ASM_COMPILER and CMAKE_ASM_COMPILER_ARG1.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>

SVN-Revision: 45119
9 years ago
Felix Fietkau da91462013 cmake: include external toolchain directory in CMAKE_FIND_ROOT_PATH (fixes #19074)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44825
9 years ago
Jo-Philipp Wich fd53d49f5b include: cmake: prevent inclusion of rpath in binaries
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 44328
9 years ago
Felix Fietkau 9a46799804 build: use gcc-provided ar, nm and ranlib where appropriate
Since GCC 4.7, GCC provides its own wrappers around ar, nm and ranlib, which
should be used for builds with link-time optimization. Since GCC 4.9, using them
actually necessary for LTO builds using convenience libraries to succeed.

There are some packages which try to automatically detect if gcc-{ar,nm,ranlib}
exist (one example is my package "fastd" in the package repository, which tries
to use LTO). This breaks because the OpenWrt build system explicitly sets the
binutils versions of these tools.

As it doesn't cause any issues to use gcc-{ar,nm,ranlib} instead of
{ar,nm,ranlib} even without LTO, this patch just makes OpenWrt use the
GCC-provided versions by default, which fixes the build of such packages with
GCC 4.9.

(I know that builds fail though when clang is used with -flto and
gcc-{ar,nm,ranlib}, but as all OpenWrt toolchains are based on GCC, this isn't
a real issue.)

Completely cleaning the tree (or at least `make clean toolchain/clean`) is
necessary to get a consistent state after the binutils plugins support patch and
this one (as trying to use gcc-{ar,nm,ranlib} with a binutils built without
plugin support will definitely lead to a build failure).

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>

SVN-Revision: 43784
9 years ago
Felix Fietkau ca6ba637cd include/cmake.mk: fix indentation
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 41144
10 years ago
Felix Fietkau 0e9245c19f include/cmake.mk: define CMAKE_AR and CMAKE_RANLIB to fix build errors
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40885
10 years ago
Felix Fietkau 9706d4e00e cmake.mk: fix support for ccache
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 38853
11 years ago
Jo-Philipp Wich 73a584f912 include: cmake: pass toolchain directory to default root find path as well
SVN-Revision: 37737
11 years ago
Felix Fietkau f3d5f6ccb0 cmake.mk: add support for overriding the source dir, and define the cmake prefix path to avoid picking up host libraries for target builds (patch by Henning Rogge)
SVN-Revision: 34914
12 years ago
Felix Fietkau b648860f9c cmake: add support for V=cs
SVN-Revision: 31485
12 years ago
Jo-Philipp Wich 9054bc91b3 cmake.mk: fix passing of LDFLAGS
SVN-Revision: 29701
12 years ago
Felix Fietkau 0d0915d168 cmake: fix ccache command when using host ccache (patch from #9611)
SVN-Revision: 27742
13 years ago
Jo-Philipp Wich cda35d2ef2 cmake.mk: fix bogus values for FIND_ROOT_PATH_MODE_*; kept plplot from compiling (#9573)
SVN-Revision: 27256
13 years ago
Felix Fietkau aea6afefe6 add LD_LIBRARY to cmake.mk
Otherwise cmake programs try to link with host ld.so

Signed-off-by: Jan Willies <jan@willies.info>

SVN-Revision: 26963
13 years ago
Jo-Philipp Wich 0f13d0a068 cmake.mk: don't assume toolchain binaries in .../bin/ if an external toolchain is used, rely on `which` instead
SVN-Revision: 26584
13 years ago
Michael Büsch 9e7801b913 cmake: Fix ccache
SVN-Revision: 25878
13 years ago
Michael Büsch 6da37f79c5 cmake: Pass VERBOSE=1 to the generated makefile to reveal flags and commands in a verbose openwrt build.
SVN-Revision: 25376
13 years ago
Michael Büsch 21e2dcd199 cmake: Remove -O3 from release CFLAGS. Honor the OpenWRT -Os flag instead.
SVN-Revision: 25372
13 years ago
Felix Fietkau c4d2dde396 add a template for cmake packages
SVN-Revision: 25265
13 years ago