Misc. fixes around libftdi
cover Misc. fixes around libftdi
Hi all,
The series includes a number of fixes/updates:
Patch 1/8: 2nd version of pending fix for libftdi (which fixes openocd failures)
Patch 2/8: a random libiio cmake fix
Patches 3-4/8: bump libftdi and add libftdi1
Patches 5-6/8: [RFC] use libftdi1 for the 2 packages explicitly dependending on libftdi (only build tests, runtime test feedback is welcome).
It seems ola also depends on libftdi, but does not support libftdi1. Who knows how many other packages silently depend on libftdi depending on the buildroot configuration...
Patch 7/8: bump CMake
Patch 8/8: [RFC] add a patch to finely enable/disable CMake tools being built, allowing to cut down ~25% of the buildtime of the cmake package.
Regards,
Daniel Sangue (1):
package/libftdi1: new package
Samuel Martin (7):
package/libftdi: fix libftdi.pc package/libiio: update cmake code for libxml2 detection package/libftdi: bump to version 0.20 package/avrdude: depends on libftdi1 instead of libftdi package/openocd: depends on libftdi1 instead of libftdi package/cmake: bump to version 3.1.1 package/cmake: only build what is necessary
package/Config.in | 1 + package/avrdude/avrdude.mk | 4 +- ...-allow-to-select-what-program-to-be-built.patch | 231 +++++++++++++++++++++ package/cmake/cmake.hash | 2 + package/cmake/cmake.mk | 8 +- ...bftdi.pc-requires-libusb-fix-static-build.patch | 27 +++ package/libftdi/libftdi.hash | 2 + package/libftdi/libftdi.mk | 2 +- ...he-standard-CMake-flag-to-drive-the-share.patch | 96 +++++++++ .../libftdi1/0002-cmake-fix-FindUSB1.cmake.patch | 34 +++ ...o-not-check-for-g-when-FTDIPP-is-disabled.patch | 46 ++++ package/libftdi1/Config.in | 37 ++++ package/libftdi1/libftdi1.hash | 2 + package/libftdi1/libftdi1.mk | 38 ++++ ...l2-detection-try-first-the-CMake-module-f.patch | 40 ++-- package/openocd/Config.in | 8 +- package/openocd/openocd.mk | 2 +- 17 files changed, 553 insertions(+), 27 deletions(-) create mode 100644 package/cmake/0001-CMake-allow-to-select-what-program-to-be-built.patch create mode 100644 package/cmake/cmake.hash create mode 100644 package/libftdi/0002-libftdi.pc-requires-libusb-fix-static-build.patch create mode 100644 package/libftdi/libftdi.hash create mode 100644 package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch create mode 100644 package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch create mode 100644 package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch create mode 100644 package/libftdi1/Config.in create mode 100644 package/libftdi1/libftdi1.hash create mode 100644 package/libftdi1/libftdi1.mk
--
2.2.2
PATCH v2 1/8 package/libftdi: fix libftdi.pc
This patch fixes libftdi pkg-config module, so that packages linking against libftdi correctly have all needed CFLAGS and LIBS defined, especially when running a static build.
Fixes:
http://autobuild.buildroot.org/results/e90/e90b4d5ad79d99487f21c9d18581e8eba7034501/
---
change v1->v2:
- libusb as "Require" (ThomasP)
--- ...bftdi.pc-requires-libusb-fix-static-build.patch | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 package/libftdi/0002-libftdi.pc-requires-libusb-fix-static-build.patch
package/libftdi/0002-libftdi.pc-requires-libusb-fix-static-build.patch new file +27 -0
@@ -0,0 +1,27 @@ +From d3d6ca63cb86727533d7d83c98e70002bb04f343 Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Wed, 21 Jan 2015 11:18:59 +0100 +Subject: [PATCH] libftdi.pc: requires libusb (fix static build) + +--- + libftdi.pc.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libftdi.pc.in b/libftdi.pc.in +index 2061b91..57f0a09 100644 +--- a/libftdi.pc.in ++++ b/libftdi.pc.in +@@ -5,8 +5,8 @@ includedir=@includedir@ + + Name: libftdi + Description: Library to program and control the FTDI USB controller +-Requires: ++Requires: libusb + Version: @VERSION@ +-Libs: -L${libdir} -lftdi -lusb ++Libs: -L${libdir} -lftdi + Cflags: -I${includedir} + +-- +2.1.0 +
Signature · 1 line
2.2.2
Thomas Petazzoni
AppliedPATCH v2 1/8 package/libftdi: fix libftdi.pc
Dear Samuel Martin,
Quoted 10 lines · Samuel Martin
This patch fixes libftdi pkg-config module, so that packages linking against libftdi correctly have all needed CFLAGS and LIBS defined, especially when running a static build.
Fixes:
http://autobuild.buildroot.org/results/e90/e90b4d5ad79d99487f21c9d18581e8eba7034501/Cc Thomas Petazzoni <[email protected]>Cc "Yann E. MORIN" <[email protected]>Signed-off-by Samuel Martin <[email protected]>
Applied, thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 2/8 package/libiio: update cmake code for libxml2 detection
In reply to Samuel MartinOnly check for libxml2 when it is needed.
This prevents CMake from falling back on the libxml2-config.cmake installed on the host system (i.e. when libxml2 >=2.9.2 is part of the host system), but not enabled as a target package (i.e. not existing in the staging tree).
--- ...l2-detection-try-first-the-CMake-module-f.patch | 40 +++++++++++++--------- 1 file changed, 23 insertions(+), 17 deletions(-)
package/libiio/0002-cmake-libxml2-detection-try-first-the-CMake-module-f.patch +23 -17
@@ -1,4 +1,4 @@ -From 4f849e1d2287206cfb7ff0fdeca96c22383b0d53 Mon Sep 17 00:00:00 2001 +From 238ce46fec88f5cba092ed4d8b52104eb2e31af2 Mon Sep 17 00:00:00 2001 From: Samuel Martin <[email protected]> Date: Mon, 29 Dec 2014 19:05:13 +0100 Subject: [PATCH] cmake: libxml2 detection: try first the CMake module from
@@ -7,36 +7,42 @@ Subject: [PATCH] cmake: libxml2 detection: try first the CMake module from Libxml2 >=2.9.2 provides its own CMake module, so check for it before falling back on the CMake's module FindLibXml2.cmake. +Also, only check for libxml2 when needed (i.e. network backend is +enabled). This prevents CMake from finding the libxml2-config.cmake +when is installed on the host system, but not in the staging tree. + Signed-off-by: Samuel Martin <[email protected]> --- - CMakeLists.txt | 14 +++++++++++++- - 1 file changed, 13 insertions(+), 1 deletion(-) + CMakeLists.txt | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 393fee3..b4f1d26 100644 +index dcc6617..810b329 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -38,7 +38,19 @@ endif() +@@ -53,7 +53,21 @@ endif() find_library(AVAHI_CLIENT_LIBRARIES avahi-client) find_library(AVAHI_COMMON_LIBRARIES avahi-common) find_library(PTHREAD_LIBRARIES pthread) -include(FindLibXml2) + -+# Since libxml2-2.9.2, libxml2 provides its own LibXml2-config.cmake, with all -+# variables correctly set. -+# So, try first to find the CMake module provided by libxml2 package, then fallback -+# on the CMake's FindLibXml2.cmake module (which can lack some definition, especially -+# in static build case). -+find_package(LibXml2 QUIET NO_MODULE) -+if(DEFINED LIBXML2_VERSION_STRING) -+ set(LIBXML2_FOUND ON) -+ set(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIRS}) -+else() -+ include(FindLibXml2) ++if(WITH_NETWORK_BACKEND) ++ # Since libxml2-2.9.2, libxml2 provides its own LibXml2-config.cmake, with all ++ # variables correctly set. ++ # So, try first to find the CMake module provided by libxml2 package, then fallback ++ # on the CMake's FindLibXml2.cmake module (which can lack some definition, especially ++ # in static build case). ++ find_package(LibXml2 QUIET NO_MODULE) ++ if(DEFINED LIBXML2_VERSION_STRING) ++ set(LIBXML2_FOUND ON) ++ set(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIRS}) ++ else() ++ include(FindLibXml2) ++ endif() +endif() set(LIBIIO_CFILES channel.c device.c context.c buffer.c utilities.c) set(LIBIIO_HEADERS iio.h) -- -2.2.1 +2.2.2
Signature · 1 line
2.2.2
PATCH 2/8 package/libiio: update cmake code for libxml2 detection
Quoted 6 lines · Samuel Martin
Only check for libxml2 when it is needed.
This prevents CMake from falling back on the libxml2-config.cmake installed on the host system (i.e. when libxml2 >=2.9.2 is part of the host system), but not enabled as a target package (i.e. not existing in the staging tree).
This is worrisome... I would hope that our cmake could be convinced never to
look in /usr/share/cmake when cross-compiling...
Regards,
Arnout
Quoted 2 lines
Signed-off-by Samuel Martin <[email protected]>
[snip]
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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 2/8 package/libiio: update cmake code for libxml2 detection
Hi Arnout, all,
Quoted 10 lines · Arnout Vandecappelle
Quoted 6 lines · Samuel Martin
Only check for libxml2 when it is needed.
This prevents CMake from falling back on the libxml2-config.cmake installed on the host system (i.e. when libxml2 >=2.9.2 is part of the host system), but not enabled as a target package (i.e. not existing in the staging tree).
This is worrisome... I would hope that our cmake could be convinced never to
look in/usr/share/cmakewhen cross-compiling...
I finally found some time to check the cmake thing, and it turns out that it is possible to control cmake to not searching outside of the sysroot.
I'll cook a patch doing it and respin the series shortly, and reject this patch.
Regards,
Signature · 1 line
Samuel
PATCH 2/8 package/libiio: update cmake code for libxml2 detection
In reply to Samuel MartinDear Samuel Martin,
Quoted 11 lines · Samuel Martin
Only check for libxml2 when it is needed.
This prevents CMake from falling back on the libxml2-config.cmake installed on the host system (i.e. when libxml2 >=2.9.2 is part of the host system), but not enabled as a target package (i.e. not existing in the staging tree).
Signed-off-by Samuel Martin <[email protected]>--- ...l2-detection-try-first-the-CMake-module-f.patch | 40 +++++++++++++--------- 1 file changed, 23 insertions(+), 17 deletions(-)
Is this fixing a bug happening in practice? I.e should it be applied to master or next?
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 2/8 package/libiio: update cmake code for libxml2 detection
Hi Thomas,
Quoted 10 lines · Thomas Petazzoni
Dear Samuel Martin,
Quoted 7 lines · Samuel Martin
Only check for libxml2 when it is needed.
This prevents CMake from falling back on the libxml2-config.cmake installed on the host system (i.e. when libxml2 >=2.9.2 is part of the host system), but not enabled as a target package (i.e. not existing in the staging tree).
Quoted 7 lines
Quoted 4 lines
Signed-off-by Samuel Martin <[email protected]>--- ...l2-detection-try-first-the-CMake-module-f.patch | 40 +++++++++++++--------- 1 file changed, 23 insertions(+), 17 deletions(-)Is this fixing a bug happening in practice? I.e should it be applied to master or next?
This patch does fix a bug here (that's why i explain the case triggering it). For the branch to apply it, I let you judge, but libxml2-2.9.2 will become more and more common. Archlinux already has it, the next release of Ubuntu-15.04 and Fedora-22 include it (but debian Jessy does not yet includes it); so if there is currently a few people triggering this bug, they may be more by the time we release the buildroot-2015.05.
BTW, I still have to check WRT Arnout's comment (how to tell cmake to never look at /usr/share/cmake when cross-compiling).
Regards,
Signature · 1 line
Samuel
PATCH 3/8 package/libftdi: bump to version 0.20
In reply to Samuel MartinAlso add *.hash file.
--- package/libftdi/libftdi.hash | 2 ++ package/libftdi/libftdi.mk | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 package/libftdi/libftdi.hash
package/libftdi/libftdi.hash new file +2 -0
@@ -0,0 +1,2 @@ +# Locally computed (after checking the signature from http://www.intra2net.com/en/developer/libftdi/download.php) +sha256 3176d5b5986438f33f5208e690a8bfe90941be501cc0a72118ce3d338d4b838e libftdi-0.20.tar.gz
package/libftdi/libftdi.mk +1 -1
@@ -4,7 +4,7 @@ # ################################################################################ -LIBFTDI_VERSION = 0.19 +LIBFTDI_VERSION = 0.20 LIBFTDI_SITE = http://www.intra2net.com/en/developer/libftdi/download LIBFTDI_DEPENDENCIES = libusb-compat libusb LIBFTDI_INSTALL_STAGING = YES
Signature · 1 line
2.2.2
PATCH 4/8 package/libftdi1: new package
In reply to Samuel MartinFrom: Daniel Sangue <[email protected]>
This version of libftdi can coexists beside the 0.x version.
[Samuel Martin:
- libftdi1.mk: bump to version 1.2 and add hash
- cleanup uneeded libusb-compat stuff
- Config.in: add comment when ftdipp1 deps are not met
- fix typos in variable names and legit CMake options for *_CONF_OPTS
- add support for python bindings and ftdi_eeprom
- fix static build
- fix build with toolchain w/o C++ support
]
---
change v1->v2
- rebase on top of master
- libftdi1.mk: bump to version 1.2
- add hash
- Config.in: cleanup deps for ftdipp1
- Config.in: add comment when ftdipp1 deps are not met
- libftdi1.mk: fix typos in LIBFTDI1_CONF_OPTS variable name
- libftdi1.mk: use proper CMake options for *_CONF_OPTS
- libftdi1.mk: update libftdi1 deps and conf. opts.
- libftdi1.mk: add support for python bindings and ftdi_eeprom
- libftdi1.mk: add patch fixing static build
- libftdi1.mk: add patch fixing FindUSB1.cmake module (for static build)
- libftdi1.mk: add patch correctly disabling ftdipp when the toolchain does not install libstdc++
- reword commit message
--- package/Config.in | 1 + ...he-standard-CMake-flag-to-drive-the-share.patch | 96 ++++++++++++++++++++++ .../libftdi1/0002-cmake-fix-FindUSB1.cmake.patch | 34 ++++++++ ...o-not-check-for-g-when-FTDIPP-is-disabled.patch | 46 +++++++++++ package/libftdi1/Config.in | 37 +++++++++ package/libftdi1/libftdi1.hash | 2 + package/libftdi1/libftdi1.mk | 38 +++++++++ 7 files changed, 254 insertions(+) create mode 100644 package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch create mode 100644 package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch create mode 100644 package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch create mode 100644 package/libftdi1/Config.in create mode 100644 package/libftdi1/libftdi1.hash create mode 100644 package/libftdi1/libftdi1.mk
package/Config.in +1 -0
@@ -721,6 +721,7 @@ menu "Hardware handling" source "package/libcec/Config.in" source "package/libfreefare/Config.in" source "package/libftdi/Config.in" + source "package/libftdi1/Config.in" source "package/libhid/Config.in" source "package/libiio/Config.in" source "package/libinput/Config.in"
package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch new file +96 -0
96 lines not on this page · raw message
package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch new file +34 -0
@@ -0,0 +1,34 @@ +From 81275d75ae88fe8ab1915d3ba260ea935e63c362 Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Sun, 25 Jan 2015 10:01:17 +0100 +Subject: [PATCH 2/2] cmake: fix FindUSB1.cmake + +Make sure all ldflags are correctly set, especially for static build. + +Signed-off-by: Samuel Martin <[email protected]> +--- + cmake/FindUSB1.cmake | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/cmake/FindUSB1.cmake b/cmake/FindUSB1.cmake +index b90e297..e7f1b3c 100644 +--- a/cmake/FindUSB1.cmake ++++ b/cmake/FindUSB1.cmake +@@ -26,8 +26,12 @@ else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) + PATH_SUFFIXES libusb-1.0 + PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS}) + +- FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0 +- PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS}) ++ set(LIBUSB_LIBRARIES ${PC_LIBUSB_STATIC_LDFLAGS} ${PC_LIBUSB_STATIC_LDFLAGS_OTHER}) ++ foreach(libname ${PC_LIBUSB_STATIC_LIBRARIES}) ++ FIND_LIBRARY(lib NAMES ${libname} ++ PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS}) ++ list(APPEND LIBUSB_LIBRARIES ${lib}) ++ endforeach() + + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR) +-- +2.2.2 +
package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch new file +46 -0
46 lines not on this page · raw message
package/libftdi1/Config.in new file +37 -0
@@ -0,0 +1,37 @@ +config BR2_PACKAGE_LIBFTDI1 + bool "libftdi1" + depends on BR2_TOOLCHAIN_HAS_THREADS # libusb + select BR2_PACKAGE_LIBUSB + help + Userspace access to FTDI USB interface chips (version 1.x) + + http://www.intra2net.com/en/developer/libftdi/index.php + +if BR2_PACKAGE_LIBFTDI1 + +config BR2_PACKAGE_LIBTFDI1_LIBFTDIPP1 + depends on BR2_INSTALL_LIBSTDCPP # boost + depends on BR2_LARGEFILE # boost + depends on BR2_TOOLCHAIN_HAS_THREADS # boost + select BR2_PACKAGE_BOOST + bool "libfdtipp1" + help + C++ bindings for libftdi + +comment "libfdtipp1 needs a toolchain w/ C++, largefile, threads" + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS + +config BR2_PACKAGE_LIBTFDI1_PYTHON_BINDINGS + depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3 + bool "python bindings" + help + Python bindings for libftdi + +config BR2_PACKAGE_LIBTFDI1_FDTI_EEPROM + select BR2_PACKAGE_LIBCONFUSE + bool "ftdi_eeprom tool" + +endif # BR2_PACKAGE_LIBFTDI1 + +comment "libftdi1 needs a toolchain w/ threads" + depends on !BR2_TOOLCHAIN_HAS_THREADS
package/libftdi1/libftdi1.hash new file +2 -0
@@ -0,0 +1,2 @@ +# Locally computed (after checking the signature from http://www.intra2net.com/en/developer/libftdi/download.php) +sha256 a6ea795c829219015eb372b03008351cee3fb39f684bff3bf8a4620b558488d6 libftdi1-1.2.tar.bz2
package/libftdi1/libftdi1.mk new file +38 -0
@@ -0,0 +1,38 @@ +################################################################################ +# +# libftdi1 +# +################################################################################ + +LIBFTDI1_VERSION = 1.2 +LIBFTDI1_SOURCE = libftdi1-$(LIBFTDI1_VERSION).tar.bz2 +LIBFTDI1_SITE = http://www.intra2net.com/en/developer/libftdi/download/ +LIBFTDI1_INSTALL_STAGING = YES +LIBFTDI1_DEPENDENCIES = libusb +LIBFTDI1_CONF_OPTS = -DDOCUMENTATION=OFF -DEXAMPLES=OFF + +ifeq ($(BR2_PACKAGE_LIBTFDI1_LIBFTDIPP1),y) +LIBFTDI1_DEPENDENCIES += boost +LIBFTDI1_CONF_OPTS += -DFTDIPP=ON +else +LIBFTDI1_CONF_OPTS += -DFTDIPP=OFF +endif + +ifeq ($(BR2_PACKAGE_LIBTFDI1_PYTHON_BINDINGS),y) +LIBFTDI1_DEPENDENCIES += $(if BR2_PACKAGE_PYTHON,python,python3) host-swig +LIBFTDI1_CONF_OPTS += -DPYTHON_BINDINGS=ON +else +LIBFTDI1_CONF_OPTS += -DPYTHON_BINDINGS=OFF +endif + +ifeq ($(BR2_PACKAGE_LIBTFDI1_FDTI_EEPROM),y) +# ftdi_eeprom optionally depends on libintl, so make sure gettext is built +# _before_ libfitdi1 when gettext is enbaled. +LIBFTDI1_DEPENDENCIES += libconfuse $(if $(BR2_PACKAGE_GETTEXT),gettext) +LIBFTDI1_CONF_OPTS += -DFTDI_EEPROM=ON +else +LIBFTDI1_CONF_OPTS += -DFTDI_EEPROM=OFF +endif + +$(eval $(cmake-package)) +
Signature · 1 line
2.2.2
PATCH 4/8 package/libftdi1: new package
Quoted 3 lines · Samuel Martin
From: Daniel Sangue <[email protected]>
This version of libftdi can coexists beside the 0.x version.
Perhaps this can be mentioned in the help text as well.
[snip]
Quoted 6 lines
package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch new file +0
-0
package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch line 8
Quoted 8 lines
package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch new file +8
-0@@ -0,0 +1,96 @@ +From 7e57ff280b55b45e74329b9988279e8831d32eab Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Sun, 25 Jan 2015 09:45:04 +0100 +Subject: [PATCH 1/2] cmake: use the standard CMake flag to drive the shared + object build + +Remove the STATICLIBS CMake option (and the code handling it) and let +the standard CMake flags drive the shared object build.
Can upstream be convinced to take this patch?
[snip]
Quoted 24 lines
package/libftdi1/Config.in new file +18
-0@@ -0,0 +1,37 @@ +config BR2_PACKAGE_LIBFTDI1 + bool "libftdi1" + depends on BR2_TOOLCHAIN_HAS_THREADS # libusb + select BR2_PACKAGE_LIBUSB + help + Userspace access to FTDI USB interface chips (version 1.x) + + http://www.intra2net.com/en/developer/libftdi/index.php + +if BR2_PACKAGE_LIBFTDI1 + +config BR2_PACKAGE_LIBTFDI1_LIBFTDIPP1 + depends on BR2_INSTALL_LIBSTDCPP # boost + depends on BR2_LARGEFILE # boost + depends on BR2_TOOLCHAIN_HAS_THREADS # boost + select BR2_PACKAGE_BOOST + bool "libfdtipp1" + help
package/libftdi1/Config.in line 28
Quoted 10 lines
package/libftdi1/Config.in new file +10
-0+ C++ bindings for libftdi + +comment "libfdtipp1 needs a toolchain w/ C++, largefile, threads" + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS + +config BR2_PACKAGE_LIBTFDI1_PYTHON_BINDINGS + depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3 + bool "python bindings" + help + Python bindings for libftdi
I wonder if it's worthwhile to make this configurable. Do the bindings occupy
significant space or take a long time to build?
But basically I have no important comments, so
Regards,
Arnout
Quoted 9 lines
package/libftdi1/Config.in new file +9
-0+ +config BR2_PACKAGE_LIBTFDI1_FDTI_EEPROM + select BR2_PACKAGE_LIBCONFUSE + bool "ftdi_eeprom tool" + +endif # BR2_PACKAGE_LIBFTDI1 + +comment "libftdi1 needs a toolchain w/ threads" + depends on !BR2_TOOLCHAIN_HAS_THREADS
[snip]
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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 5/8 package/avrdude: depends on libftdi1 instead of libftdi
In reply to Samuel Martin--- package/avrdude/avrdude.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
package/avrdude/avrdude.mk +2 -2
@@ -17,8 +17,8 @@ AVRDUDE_DEPENDENCIES = elfutils libusb libusb-compat ncurses \ AVRDUDE_LICENSE = GPLv2+ AVRDUDE_LICENSE_FILES = avrdude/COPYING -ifeq ($(BR2_PACKAGE_LIBFTDI),y) -AVRDUDE_DEPENDENCIES += libftdi +ifeq ($(BR2_PACKAGE_LIBFTDI1),y) +AVRDUDE_DEPENDENCIES += libftdi1 endif # if /etc/avrdude.conf exists, the installation process creates a
Signature · 1 line
2.2.2
PATCH 6/8 package/openocd: depends on libftdi1 instead of libftdi
In reply to Samuel Martin--- package/openocd/Config.in | 8 ++++---- package/openocd/openocd.mk | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
package/openocd/Config.in +4 -4
@@ -121,7 +121,7 @@ config BR2_PACKAGE_OPENOCD_PARPORT config BR2_PACKAGE_OPENOCD_FT2XXX bool "FT2232 based devices (DEPRECATED)" - select BR2_PACKAGE_LIBFTDI + select BR2_PACKAGE_LIBFTDI1 depends on BR2_TOOLCHAIN_HAS_THREADS # libftdi -> libusb depends on BR2_ARCH_HAS_ATOMICS help
@@ -135,7 +135,7 @@ config BR2_PACKAGE_OPENOCD_VPI config BR2_PACKAGE_OPENOCD_UBLASTER bool "Altera USB-Blaster" - select BR2_PACKAGE_LIBFTDI + select BR2_PACKAGE_LIBFTDI1 depends on BR2_TOOLCHAIN_HAS_THREADS # libftdi -> libusb depends on BR2_ARCH_HAS_ATOMICS help
@@ -176,7 +176,7 @@ config BR2_PACKAGE_OPENOCD_GW16012 config BR2_PACKAGE_OPENOCD_PRESTO bool "ASIX Presto Programmer" - select BR2_PACKAGE_LIBFTDI + select BR2_PACKAGE_LIBFTDI1 depends on BR2_TOOLCHAIN_HAS_THREADS # libftdi -> libusb depends on BR2_ARCH_HAS_ATOMICS help
@@ -185,7 +185,7 @@ config BR2_PACKAGE_OPENOCD_PRESTO config BR2_PACKAGE_OPENOCD_OPENJTAG bool "OpenJTAG Programmer" - select BR2_PACKAGE_LIBFTDI + select BR2_PACKAGE_LIBFTDI1 depends on BR2_TOOLCHAIN_HAS_THREADS # libftdi -> libusb depends on BR2_ARCH_HAS_ATOMICS help
package/openocd/openocd.mk +1 -1
@@ -23,7 +23,7 @@ OPENOCD_CONF_OPTS = \ # the dependencies they need. OPENOCD_DEPENDENCIES = \ - $(if $(BR2_PACKAGE_LIBFTDI),libftdi) \ + $(if $(BR2_PACKAGE_LIBFTDI),libftdi1) \ $(if $(BR2_PACKAGE_LIBUSB),libusb) \ $(if $(BR2_PACKAGE_LIBUSB_COMPAT),libusb-compat) \ $(if $(BR2_PACKAGE_LIBHID),libhid)
Signature · 1 line
2.2.2
PATCH 7/8 package/cmake: bump to version 3.1.1
In reply to Samuel MartinAlso add *.hash.
--- package/cmake/cmake.hash | 2 ++ package/cmake/cmake.mk | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 package/cmake/cmake.hash
package/cmake/cmake.hash new file +2 -0
@@ -0,0 +1,2 @@ +# Locally computed +# sha256 b58694e545d51cde5756a894f53107e3d9e469360e1d92e7f6892b55ebc0bebf cmake-3.1.1.tar.gz
package/cmake/cmake.mk +2 -2
@@ -4,8 +4,8 @@ # ################################################################################ -CMAKE_VERSION_MAJOR = 3.0 -CMAKE_VERSION = $(CMAKE_VERSION_MAJOR).2 +CMAKE_VERSION_MAJOR = 3.1 +CMAKE_VERSION = $(CMAKE_VERSION_MAJOR).1 CMAKE_SITE = http://www.cmake.org/files/v$(CMAKE_VERSION_MAJOR) CMAKE_LICENSE = BSD-3c CMAKE_LICENSE_FILES = Copyright.txt
Signature · 1 line
2.2.2
PATCH 8/8 package/cmake: only build what is necessary
In reply to Samuel MartinAdd a patch allowing to select the binaries to be built.
After applying this change, the time to build host-cmake is roughly 25% shorter.
---
Here is the actual results of the build I run on my machine:
4x Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz
8GB RAM
SSD
w/o the patch, automatic job-level (i.e. 5 in my case):
675.36user 29.59system 4:21.72elapsed 269%CPU 686.98user 31.07system 4:26.85elapsed 269%CPU 694.84user 31.11system 4:35.42elapsed 263%CPU 697.24user 31.19system 4:32.17elapsed 267%CPU 686.62user 30.89system 4:23.00elapsed 272%CPU 696.28user 31.33system 4:29.15elapsed 270%CPU 677.73user 30.18system 4:15.15elapsed 277%CPU 692.62user 31.45system 4:47.56elapsed 251%CPU 679.78user 31.53system 4:20.99elapsed 272%CPU 685.63user 32.10system 4:28.15elapsed 267%CPU
w/o the patch, w/ BR2_JLEVEL=1:
340.58user 18.57system 6:19.26elapsed 94%CPU
337.48user 18.70system 6:16.41elapsed 94%CPU
335.39user 18.53system 6:13.74elapsed 94%CPU
335.93user 17.94system 6:13.84elapsed 94%CPU
335.49user 18.19system 6:13.67elapsed 94%CPU
w/ the patch, automatic job-level (i.e. 5 in my case):
494.96user 23.91system 3:13.87elapsed 267%CPU 506.90user 24.37system 3:16.83elapsed 269%CPU 504.37user 24.42system 3:17.57elapsed 267%CPU 499.79user 24.19system 3:04.50elapsed 284%CPU 507.02user 23.67system 3:04.93elapsed 286%CPU 510.93user 24.43system 3:08.19elapsed 284%CPU 512.43user 24.16system 3:08.53elapsed 284%CPU 510.80user 24.65system 3:08.64elapsed 283%CPU 512.28user 24.38system 3:09.62elapsed 283%CPU 514.90user 24.46system 3:08.96elapsed 285%CPU
w/ the patch, w/ BR2_JLEVEL=1:
244.56user 14.88system 4:36.88elapsed 93%CPU
247.02user 15.43system 4:39.89elapsed 93%CPU
247.14user 15.04system 4:39.76elapsed 93%CPU
246.32user 14.75system 4:38.93elapsed 93%CPU
247.53user 14.64system 4:40.27elapsed 93%CPU
--- ...-allow-to-select-what-program-to-be-built.patch | 231 +++++++++++++++++++++ package/cmake/cmake.mk | 4 + 2 files changed, 235 insertions(+) create mode 100644 package/cmake/0001-CMake-allow-to-select-what-program-to-be-built.patch
package/cmake/0001-CMake-allow-to-select-what-program-to-be-built.patch new file +231 -0
@@ -0,0 +1,231 @@ +From 9aeb3ea5f9c69bbc9a69672762d5fae939c3fd8c Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Sun, 25 Jan 2015 18:11:13 +0100 +Subject: [PATCH] CMake: allow to select what program to be built + +Signed-off-by: Samuel Martin <[email protected]> +--- + CMakeLists.txt | 24 ++++++++++++++++++++++++ + Source/CMakeLists.txt | 33 ++++++++++++++++++++++++++++++++- + 2 files changed, 56 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 71850de..cb9375e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,6 +43,16 @@ if(CMAKE_ENCODING_UTF8) + set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8) + endif() + ++# options to select what programs to be built ++option(BUILD_CMAKE "Build cmake program" ON) ++mark_as_advanced(BUILD_CMAKE) ++ ++option(BUILD_CTEST "Build ctest program" ON) ++mark_as_advanced(BUILD_CTEST) ++ ++option(BUILD_CPACK "Build cpack program" ON) ++mark_as_advanced(BUILD_CPACK) ++ + #----------------------------------------------------------------------- + # a macro to deal with system libraries, implemented as a macro + # simply to improve readability of the main script +@@ -241,6 +251,7 @@ macro (CMAKE_BUILD_UTILITIES) + + #--------------------------------------------------------------------- + # Build zlib library for Curl, CMake, and CTest. ++ if(BUILD_CMAKE OR BUILD_CTEST OR NOT CMAKE_USE_SYSTEM_CURL) + set(CMAKE_ZLIB_HEADER "cm_zlib.h") + if(CMAKE_USE_SYSTEM_ZLIB) + find_package(ZLIB) +@@ -256,9 +267,11 @@ macro (CMAKE_BUILD_UTILITIES) + add_subdirectory(Utilities/cmzlib) + CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty") + endif() ++ endif() + + #--------------------------------------------------------------------- + # Build Curl library for CTest. ++ if(BUILD_CMAKE OR BUILD_CTEST) + if(CMAKE_USE_SYSTEM_CURL) + find_package(CURL) + if(NOT CURL_FOUND) +@@ -284,9 +297,11 @@ macro (CMAKE_BUILD_UTILITIES) + CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty") + CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty") + endif() ++ endif() + + #--------------------------------------------------------------------- + # Build Compress library for CTest. ++ if(BUILD_CMAKE OR BUILD_CTEST) + set(CMAKE_COMPRESS_INCLUDES + "${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress") + set(CMAKE_COMPRESS_LIBRARIES "cmcompress") +@@ -301,6 +316,7 @@ macro (CMAKE_BUILD_UTILITIES) + add_subdirectory(Utilities/cmbzip2) + CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty") + endif() ++ endif() + + #--------------------------------------------------------------------- + # Build or use system liblzma for libarchive. +@@ -321,6 +337,7 @@ macro (CMAKE_BUILD_UTILITIES) + + #--------------------------------------------------------------------- + # Build or use system libarchive for CMake and CTest. ++ if(BUILD_CMAKE OR BUILD_CTEST) + if(CMAKE_USE_SYSTEM_LIBARCHIVE) + find_package(LibArchive) + if(NOT LibArchive_FOUND) +@@ -347,9 +364,11 @@ macro (CMAKE_BUILD_UTILITIES) + CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty") + set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES}) + endif() ++ endif() + + #--------------------------------------------------------------------- + # Build expat library for CMake and CTest. ++ if(BUILD_CMAKE OR BUILD_CTEST) + if(CMAKE_USE_SYSTEM_EXPAT) + find_package(EXPAT) + if(NOT EXPAT_FOUND) +@@ -364,9 +383,11 @@ macro (CMAKE_BUILD_UTILITIES) + add_subdirectory(Utilities/cmexpat) + CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty") + endif() ++ endif() + + #--------------------------------------------------------------------- + # Build XMLRPC library for CMake and CTest. ++ if(BUILD_CMAKE OR BUILD_CTEST) + if(CTEST_USE_XMLRPC) + find_package(XMLRPC QUIET REQUIRED libwww-client) + if(NOT XMLRPC_FOUND) +@@ -376,6 +397,7 @@ macro (CMAKE_BUILD_UTILITIES) + set(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS}) + set(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES}) + endif() ++ endif() + + #--------------------------------------------------------------------- + # Use curses? +@@ -583,7 +605,9 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) + add_subdirectory(Utilities) + endif() + ++if(BUILD_CTEST) + add_subdirectory(Tests) ++endif() + + if(NOT CMake_TEST_EXTERNAL_CMAKE) + if(BUILD_TESTING) +diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt +index f9405b3..2e14def 100644 +--- a/Source/CMakeLists.txt ++++ b/Source/CMakeLists.txt +@@ -481,6 +481,7 @@ if(WIN32 AND NOT CYGWIN AND NOT BORLAND) + endif() + + # create a library used by the command line and the GUI ++if(BUILD_CMAKE) + add_library(CMakeLib ${SRCS}) + target_link_libraries(CMakeLib cmsys + ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES} +@@ -496,6 +497,7 @@ endif() + if(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW) + target_link_libraries(CMakeLib rpcrt4) + endif() ++endif() + + # + # CTestLib +@@ -565,8 +567,10 @@ set(CTEST_SRCS cmCTest.cxx + ) + + # Build CTestLib ++if(BUILD_CTEST) + add_library(CTestLib ${CTEST_SRCS}) + target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES}) ++endif() + + # + # Sources for CPack +@@ -628,9 +632,12 @@ if(APPLE) + endif() + + # Build CPackLib ++if(BUILD_CPACK) + add_library(CPackLib ${CPACK_SRCS}) + target_link_libraries(CPackLib CMakeLib) ++endif() + ++if(BUILD_CMAKE) + if(APPLE) + add_executable(cmakexbuild cmakexbuild.cxx) + target_link_libraries(cmakexbuild CMakeLib) +@@ -639,36 +646,60 @@ if(APPLE) + target_link_libraries(OSXScriptLauncher cmsys) + target_link_libraries(OSXScriptLauncher "-framework CoreFoundation") + endif() ++endif() + + # Build CMake executable ++if(BUILD_CMAKE) + add_executable(cmake cmakemain.cxx cmcmd.cxx cmcmd.h) + target_link_libraries(cmake CMakeLib) ++endif() + + # Build CTest executable ++if(BUILD_CTEST) + add_executable(ctest ctest.cxx) + target_link_libraries(ctest CTestLib) ++endif() + + # Build CPack executable ++if(BUILD_CPACK) + add_executable(cpack CPack/cpack.cxx) + target_link_libraries(cpack CPackLib) ++endif() + + # Curses GUI ++if(BUILD_CMAKE) + if(BUILD_CursesDialog) + include(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt) + endif() ++endif() + + # Qt GUI + option(BUILD_QtDialog "Build Qt dialog for CMake" FALSE) ++if(BUILD_CMAKE) + if(BUILD_QtDialog) + add_subdirectory(QtDialog) + endif() ++endif() + + include (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL) + include (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL) + +-install(TARGETS cmake ctest cpack DESTINATION bin) ++if(BUILD_CMAKE) ++install(TARGETS cmake DESTINATION bin) ++endif() ++ ++if(BUILD_CTEST) ++install(TARGETS ctest DESTINATION bin) ++endif() ++ ++if(BUILD_CPACK) ++install(TARGETS cpack DESTINATION bin) ++endif() ++ ++if(BUILD_CMAKE) + if(APPLE) + install(TARGETS cmakexbuild DESTINATION bin) + endif() ++endif() + + install(FILES cmCPluginAPI.h DESTINATION ${CMAKE_DATA_DIR}/include) +-- +2.2.2 +
package/cmake/cmake.mk +4 -0
@@ -22,6 +22,10 @@ define HOST_CMAKE_CONFIGURE_CMDS -DCMAKE_CXX_FLAGS="$(HOST_CXXFLAGS)" \ -DCMAKE_EXE_LINKER_FLAGS="$(HOST_LDFLAGS)" \ -DBUILD_CursesDialog=OFF \ + -DBUILD_CMAKE=ON \ + -DBUILD_CTEST=OFF \ + -DBUILD_CPACK=OFF \ + -DBUILD_TESTING=OFF \ ) endef
Signature · 1 line
2.2.2
PATCH 8/8 package/cmake: only build what is necessary
Hi Samuel,
Le 25/01/2015 22:13, Samuel Martin a ?crit :
Quoted 8 lines
Add a patch allowing to select the binaries to be built.
After applying this change, the time to build host-cmake is roughly 25% shorter.
Signed-off-by Samuel Martin <[email protected]>---
Here are my results without and with your patch:
without the patch BR2_JLEVEL=1:
real 4m59.761s user 3m46.531s sys 0m24.404s
without the patch BR2_JLEVEL=5:
real 3m25.126s user 4m2.761s sys 0m24.406s
With the patch BR2_JLEVEL=1:
real 3m37.735s user 2m45.789s sys 0m18.675s
With the patch BR2_JLEVEL=5:
real 2m31.274s user 2m58.932s sys 0m18.779s
Quoted 302 lines
Here is the actual results of the build I run on my machine:
4x Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz
8GB RAM
SSDw/o the patch, automatic job-level (i.e. 5 in my case):
675.36user 29.59system 4:21.72elapsed 269%CPU 686.98user 31.07system 4:26.85elapsed 269%CPU 694.84user 31.11system 4:35.42elapsed 263%CPU 697.24user 31.19system 4:32.17elapsed 267%CPU 686.62user 30.89system 4:23.00elapsed 272%CPU 696.28user 31.33system 4:29.15elapsed 270%CPU 677.73user 30.18system 4:15.15elapsed 277%CPU 692.62user 31.45system 4:47.56elapsed 251%CPU 679.78user 31.53system 4:20.99elapsed 272%CPU 685.63user 32.10system 4:28.15elapsed 267%CPUw/o the patch, w/ BR2_JLEVEL=1:
340.58user 18.57system 6:19.26elapsed 94%CPU
337.48user 18.70system 6:16.41elapsed 94%CPU
335.39user 18.53system 6:13.74elapsed 94%CPU
335.93user 17.94system 6:13.84elapsed 94%CPU
335.49user 18.19system 6:13.67elapsed 94%CPUw/ the patch, automatic job-level (i.e. 5 in my case):
494.96user 23.91system 3:13.87elapsed 267%CPU 506.90user 24.37system 3:16.83elapsed 269%CPU 504.37user 24.42system 3:17.57elapsed 267%CPU 499.79user 24.19system 3:04.50elapsed 284%CPU 507.02user 23.67system 3:04.93elapsed 286%CPU 510.93user 24.43system 3:08.19elapsed 284%CPU 512.43user 24.16system 3:08.53elapsed 284%CPU 510.80user 24.65system 3:08.64elapsed 283%CPU 512.28user 24.38system 3:09.62elapsed 283%CPU 514.90user 24.46system 3:08.96elapsed 285%CPUw/ the patch, w/ BR2_JLEVEL=1:
244.56user 14.88system 4:36.88elapsed 93%CPU
247.02user 15.43system 4:39.89elapsed 93%CPU
247.14user 15.04system 4:39.76elapsed 93%CPU
246.32user 14.75system 4:38.93elapsed 93%CPU
247.53user 14.64system 4:40.27elapsed 93%CPU--- ...-allow-to-select-what-program-to-be-built.patch | 231 +++++++++++++++++++++ package/cmake/cmake.mk | 4 + 2 files changed, 235 insertions(+) create mode 100644 package/cmake/0001-CMake-allow-to-select-what-program-to-be-built.patchpackage/cmake/0001-CMake-allow-to-select-what-program-to-be-built.patch new file +231
-0@@ -0,0 +1,231 @@ +From 9aeb3ea5f9c69bbc9a69672762d5fae939c3fd8c Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Sun, 25 Jan 2015 18:11:13 +0100 +Subject: [PATCH] CMake: allow to select what program to be built + +Signed-off-by: Samuel Martin <[email protected]> +--- + CMakeLists.txt | 24 ++++++++++++++++++++++++ + Source/CMakeLists.txt | 33 ++++++++++++++++++++++++++++++++- + 2 files changed, 56 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 71850de..cb9375e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,6 +43,16 @@ if(CMAKE_ENCODING_UTF8) + set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8) + endif() + ++# options to select what programs to be built ++option(BUILD_CMAKE "Build cmake program" ON) ++mark_as_advanced(BUILD_CMAKE) ++ ++option(BUILD_CTEST "Build ctest program" ON) ++mark_as_advanced(BUILD_CTEST) ++ ++option(BUILD_CPACK "Build cpack program" ON) ++mark_as_advanced(BUILD_CPACK) ++ + #----------------------------------------------------------------------- + # a macro to deal with system libraries, implemented as a macro + # simply to improve readability of the main script +@@ -241,6 +251,7 @@ macro (CMAKE_BUILD_UTILITIES) + + #--------------------------------------------------------------------- + # Build zlib library for Curl, CMake, and CTest. ++ if(BUILD_CMAKE OR BUILD_CTEST OR NOT CMAKE_USE_SYSTEM_CURL) + set(CMAKE_ZLIB_HEADER "cm_zlib.h") + if(CMAKE_USE_SYSTEM_ZLIB) + find_package(ZLIB) +@@ -256,9 +267,11 @@ macro (CMAKE_BUILD_UTILITIES) + add_subdirectory(Utilities/cmzlib) + CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty") + endif() ++ endif() + + #--------------------------------------------------------------------- + # Build Curl library for CTest. ++ if(BUILD_CMAKE OR BUILD_CTEST) + if(CMAKE_USE_SYSTEM_CURL) + find_package(CURL) + if(NOT CURL_FOUND) +@@ -284,9 +297,11 @@ macro (CMAKE_BUILD_UTILITIES) + CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty") + CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty") + endif() ++ endif() + + #--------------------------------------------------------------------- + # Build Compress library for CTest. ++ if(BUILD_CMAKE OR BUILD_CTEST) + set(CMAKE_COMPRESS_INCLUDES + "${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress") + set(CMAKE_COMPRESS_LIBRARIES "cmcompress") +@@ -301,6 +316,7 @@ macro (CMAKE_BUILD_UTILITIES) + add_subdirectory(Utilities/cmbzip2) + CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty") + endif() ++ endif() + + #--------------------------------------------------------------------- + # Build or use system liblzma for libarchive. +@@ -321,6 +337,7 @@ macro (CMAKE_BUILD_UTILITIES) + + #--------------------------------------------------------------------- + # Build or use system libarchive for CMake and CTest. ++ if(BUILD_CMAKE OR BUILD_CTEST) + if(CMAKE_USE_SYSTEM_LIBARCHIVE) + find_package(LibArchive) + if(NOT LibArchive_FOUND) +@@ -347,9 +364,11 @@ macro (CMAKE_BUILD_UTILITIES) + CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty") + set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES}) + endif() ++ endif() + + #--------------------------------------------------------------------- + # Build expat library for CMake and CTest. ++ if(BUILD_CMAKE OR BUILD_CTEST) + if(CMAKE_USE_SYSTEM_EXPAT) + find_package(EXPAT) + if(NOT EXPAT_FOUND) +@@ -364,9 +383,11 @@ macro (CMAKE_BUILD_UTILITIES) + add_subdirectory(Utilities/cmexpat) + CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty") + endif() ++ endif() + + #--------------------------------------------------------------------- + # Build XMLRPC library for CMake and CTest. ++ if(BUILD_CMAKE OR BUILD_CTEST) + if(CTEST_USE_XMLRPC) + find_package(XMLRPC QUIET REQUIRED libwww-client) + if(NOT XMLRPC_FOUND) +@@ -376,6 +397,7 @@ macro (CMAKE_BUILD_UTILITIES) + set(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS}) + set(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES}) + endif() ++ endif() + + #--------------------------------------------------------------------- + # Use curses? +@@ -583,7 +605,9 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) + add_subdirectory(Utilities) + endif() + ++if(BUILD_CTEST) + add_subdirectory(Tests) ++endif() + + if(NOT CMake_TEST_EXTERNAL_CMAKE) + if(BUILD_TESTING) +diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt +index f9405b3..2e14def 100644 +--- a/Source/CMakeLists.txt ++++ b/Source/CMakeLists.txt +@@ -481,6 +481,7 @@ if(WIN32 AND NOT CYGWIN AND NOT BORLAND) + endif() + + # create a library used by the command line and the GUI ++if(BUILD_CMAKE) + add_library(CMakeLib ${SRCS}) + target_link_libraries(CMakeLib cmsys + ${CMAKE_EXPAT_LIBRARIES} ${CMAKE_ZLIB_LIBRARIES} +@@ -496,6 +497,7 @@ endif() + if(CMAKE_BUILD_ON_VISUAL_STUDIO OR MINGW) + target_link_libraries(CMakeLib rpcrt4) + endif() ++endif() + + # + # CTestLib +@@ -565,8 +567,10 @@ set(CTEST_SRCS cmCTest.cxx + ) + + # Build CTestLib ++if(BUILD_CTEST) + add_library(CTestLib ${CTEST_SRCS}) + target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES}) ++endif() + + # + # Sources for CPack +@@ -628,9 +632,12 @@ if(APPLE) + endif() + + # Build CPackLib ++if(BUILD_CPACK) + add_library(CPackLib ${CPACK_SRCS}) + target_link_libraries(CPackLib CMakeLib) ++endif() + ++if(BUILD_CMAKE) + if(APPLE) + add_executable(cmakexbuild cmakexbuild.cxx) + target_link_libraries(cmakexbuild CMakeLib) +@@ -639,36 +646,60 @@ if(APPLE) + target_link_libraries(OSXScriptLauncher cmsys) + target_link_libraries(OSXScriptLauncher "-framework CoreFoundation") + endif() ++endif() + + # Build CMake executable ++if(BUILD_CMAKE) + add_executable(cmake cmakemain.cxx cmcmd.cxx cmcmd.h) + target_link_libraries(cmake CMakeLib) ++endif() + + # Build CTest executable ++if(BUILD_CTEST) + add_executable(ctest ctest.cxx) + target_link_libraries(ctest CTestLib) ++endif() + + # Build CPack executable ++if(BUILD_CPACK) + add_executable(cpack CPack/cpack.cxx) + target_link_libraries(cpack CPackLib) ++endif() + + # Curses GUI ++if(BUILD_CMAKE) + if(BUILD_CursesDialog) + include(${CMake_SOURCE_DIR}/Source/CursesDialog/CMakeLists.txt) + endif() ++endif() + + # Qt GUI + option(BUILD_QtDialog "Build Qt dialog for CMake" FALSE) ++if(BUILD_CMAKE) + if(BUILD_QtDialog) + add_subdirectory(QtDialog) + endif() ++endif() + + include (${CMake_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL) + include (${CMake_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL) + +-install(TARGETS cmake ctest cpack DESTINATION bin) ++if(BUILD_CMAKE) ++install(TARGETS cmake DESTINATION bin) ++endif() ++ ++if(BUILD_CTEST) ++install(TARGETS ctest DESTINATION bin) ++endif() ++ ++if(BUILD_CPACK) ++install(TARGETS cpack DESTINATION bin) ++endif() ++ ++if(BUILD_CMAKE) + if(APPLE) + install(TARGETS cmakexbuild DESTINATION bin) + endif() ++endif() + + install(FILES cmCPluginAPI.h DESTINATION ${CMAKE_DATA_DIR}/include) +-- +2.2.2 +package/cmake/cmake.mk +4
-0@@ -22,6 +22,10 @@ define HOST_CMAKE_CONFIGURE_CMDS -DCMAKE_CXX_FLAGS="$(HOST_CXXFLAGS)" \ -DCMAKE_EXE_LINKER_FLAGS="$(HOST_LDFLAGS)" \ -DBUILD_CursesDialog=OFF \ + -DBUILD_CMAKE=ON \ + -DBUILD_CTEST=OFF \ + -DBUILD_CPACK=OFF \ + -DBUILD_TESTING=OFF \ ) endef
Signature · 8 lines
Romain Naour OPEN WIDE Ing?nierie - Paris 23/25, rue Daviel| 75013 PARIS http://ingenierie.openwide.fr Le blog des technologies libres et embarqu?es : http://www.linuxembedded.fr