* [Buildroot] [PATCH v2 0/4] libftdi{0,1} related work @ 2015-03-08 11:26 Samuel Martin 2015-03-08 11:26 ` [Buildroot] [PATCH v2 1/4] package/libftdi: bump to version 0.20 Samuel Martin ` (3 more replies) 0 siblings, 4 replies; 19+ messages in thread From: Samuel Martin @ 2015-03-08 11:26 UTC (permalink / raw) To: buildroot Hi all, The short series does: - bump libftdi and add libftdi1 - 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... Regards, Samuel -- Daniel Sangue (1): package/libftdi1: new package Samuel Martin (3): package/libftdi: bump to version 0.20 package/avrdude: depends on libftdi1 instead of libftdi package/openocd: depends on libftdi1 instead of libftdi package/Config.in | 1 + package/avrdude/avrdude.mk | 4 +- 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 | 37 +++++++++ package/openocd/Config.in | 8 +- package/openocd/openocd.mk | 2 +- 12 files changed, 263 insertions(+), 8 deletions(-) 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.3.2 ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 1/4] package/libftdi: bump to version 0.20 2015-03-08 11:26 [Buildroot] [PATCH v2 0/4] libftdi{0,1} related work Samuel Martin @ 2015-03-08 11:26 ` Samuel Martin 2015-03-16 9:19 ` Thomas Petazzoni 2015-03-08 11:26 ` [Buildroot] [PATCH v2 2/4] package/libftdi1: new package Samuel Martin ` (2 subsequent siblings) 3 siblings, 1 reply; 19+ messages in thread From: Samuel Martin @ 2015-03-08 11:26 UTC (permalink / raw) To: buildroot Also add *.hash file. Cc: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Samuel Martin <s.martin49@gmail.com> --- changes v1->v2: - rebase --- package/libftdi/libftdi.hash | 2 ++ package/libftdi/libftdi.mk | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 package/libftdi/libftdi.hash diff --git a/package/libftdi/libftdi.hash b/package/libftdi/libftdi.hash new file mode 100644 index 0000000..5d9f876 --- /dev/null +++ b/package/libftdi/libftdi.hash @@ -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 diff --git a/package/libftdi/libftdi.mk b/package/libftdi/libftdi.mk index 22d2616..8370b0a 100644 --- a/package/libftdi/libftdi.mk +++ b/package/libftdi/libftdi.mk @@ -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 -- 2.3.2 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 1/4] package/libftdi: bump to version 0.20 2015-03-08 11:26 ` [Buildroot] [PATCH v2 1/4] package/libftdi: bump to version 0.20 Samuel Martin @ 2015-03-16 9:19 ` Thomas Petazzoni 0 siblings, 0 replies; 19+ messages in thread From: Thomas Petazzoni @ 2015-03-16 9:19 UTC (permalink / raw) To: buildroot Dear Samuel Martin, On Sun, 8 Mar 2015 12:26:01 +0100, Samuel Martin wrote: > Also add *.hash file. > > Cc: "Yann E. MORIN" <yann.morin.1998@free.fr> > Signed-off-by: Samuel Martin <s.martin49@gmail.com> Applied, thanks! Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 2/4] package/libftdi1: new package 2015-03-08 11:26 [Buildroot] [PATCH v2 0/4] libftdi{0,1} related work Samuel Martin 2015-03-08 11:26 ` [Buildroot] [PATCH v2 1/4] package/libftdi: bump to version 0.20 Samuel Martin @ 2015-03-08 11:26 ` Samuel Martin 2015-03-09 8:33 ` Yegor Yefremov 2015-03-16 13:12 ` Thomas Petazzoni 2015-03-08 11:26 ` [Buildroot] [PATCH v2 3/4] package/avrdude: depends on libftdi1 instead of libftdi Samuel Martin 2015-03-08 11:26 ` [Buildroot] [PATCH v2 4/4] package/openocd: " Samuel Martin 3 siblings, 2 replies; 19+ messages in thread From: Samuel Martin @ 2015-03-08 11:26 UTC (permalink / raw) To: buildroot From: Daniel Sangue <daniel.sangue@sangue.ch> This version of libftdi can coexists beside the 0.x version. Signed-off-by: Daniel Sangue <daniel.sangue@sangue.ch> [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 ] Signed-off-by: Samuel Martin <s.martin49@gmail.com> --- 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 | 37 +++++++++ 7 files changed, 253 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 diff --git a/package/Config.in b/package/Config.in index 1bce00a..b46eb79 100644 --- a/package/Config.in +++ b/package/Config.in @@ -752,6 +752,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" diff --git a/package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch b/package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch new file mode 100644 index 0000000..487fc28 --- /dev/null +++ b/package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch @@ -0,0 +1,96 @@ +From 7e57ff280b55b45e74329b9988279e8831d32eab Mon Sep 17 00:00:00 2001 +From: Samuel Martin <s.martin49@gmail.com> +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. + +Signed-off-by: Samuel Martin <s.martin49@gmail.com> +--- + CMakeLists.txt | 2 -- + ftdipp/CMakeLists.txt | 15 +-------------- + src/CMakeLists.txt | 13 +------------ + 3 files changed, 2 insertions(+), 28 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 74f80f4..0ba0b08 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,8 +46,6 @@ set(CPACK_COMPONENT_SHAREDLIBS_GROUP "Development") + set(CPACK_COMPONENT_STATICLIBS_GROUP "Development") + set(CPACK_COMPONENT_HEADERS_GROUP "Development") + +-option ( STATICLIBS "Build static libraries" ON ) +- + # guess LIB_SUFFIX, don't take debian multiarch into account + if ( NOT DEFINED LIB_SUFFIX ) + if( CMAKE_SYSTEM_NAME MATCHES "Linux" +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt +index 7500211..27e7884 100644 +--- a/ftdipp/CMakeLists.txt ++++ b/ftdipp/CMakeLists.txt +@@ -23,8 +23,7 @@ if (FTDIPP) + set(FTDI_BUILD_CPP True PARENT_SCOPE) + message(STATUS "Building libftdi1++") + +- # Shared library +- add_library(ftdipp1 SHARED ${cpp_sources}) ++ add_library(ftdipp1 ${cpp_sources}) + + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases + set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) +@@ -41,18 +40,6 @@ if (FTDIPP) + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} + ) +- +- # Static library +- if ( STATICLIBS ) +- add_library(ftdipp1-static STATIC ${cpp_sources}) +- set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1") +- set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) +- +- install ( TARGETS ftdipp1-static +- ARCHIVE DESTINATION lib${LIB_SUFFIX} +- COMPONENT staticlibs +- ) +- endif () + + install ( FILES ${cpp_headers} + DESTINATION include/${PROJECT_NAME} +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 9fd86a6..501d4a8 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -21,7 +21,7 @@ configure_file(ftdi_version_i.h.in "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h + set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/ftdi_stream.c CACHE INTERNAL "List of c sources" ) + set(c_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.h CACHE INTERNAL "List of c headers" ) + +-add_library(ftdi1 SHARED ${c_sources}) ++add_library(ftdi1 ${c_sources}) + + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases + set_target_properties(ftdi1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) +@@ -38,17 +38,6 @@ install ( TARGETS ftdi1 + ARCHIVE DESTINATION lib${LIB_SUFFIX} + ) + +-if ( STATICLIBS ) +- add_library(ftdi1-static STATIC ${c_sources}) +- target_link_libraries(ftdi1-static ${LIBUSB_LIBRARIES}) +- set_target_properties(ftdi1-static PROPERTIES OUTPUT_NAME "ftdi1") +- set_target_properties(ftdi1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) +- install ( TARGETS ftdi1-static +- ARCHIVE DESTINATION lib${LIB_SUFFIX} +- COMPONENT staticlibs +- ) +-endif () +- + install ( FILES ${c_headers} + DESTINATION include/${PROJECT_NAME} + COMPONENT headers +-- +2.2.2 + diff --git a/package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch b/package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch new file mode 100644 index 0000000..5619a0c --- /dev/null +++ b/package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch @@ -0,0 +1,34 @@ +From 81275d75ae88fe8ab1915d3ba260ea935e63c362 Mon Sep 17 00:00:00 2001 +From: Samuel Martin <s.martin49@gmail.com> +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 <s.martin49@gmail.com> +--- + 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 + diff --git a/package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch b/package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch new file mode 100644 index 0000000..be0913d --- /dev/null +++ b/package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch @@ -0,0 +1,46 @@ +From c215d5ecd985b57700e817920d0e99112b4a571b Mon Sep 17 00:00:00 2001 +From: Samuel Martin <s.martin49@gmail.com> +Date: Sun, 25 Jan 2015 13:35:24 +0100 +Subject: [PATCH] cmake: do not check for g++ when FTDIPP is disabled + +Signed-off-by: Samuel Martin <s.martin49@gmail.com> +--- + CMakeLists.txt | 6 ++++-- + ftdipp/CMakeLists.txt | 1 + + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0ba0b08..e880211 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,5 @@ + # Project +-project(libftdi1) ++project(libftdi1 C) + set(MAJOR_VERSION 1) + set(MINOR_VERSION 2) + set(PACKAGE libftdi1) +@@ -145,7 +145,9 @@ else(DOCUMENTATION AND DOXYGEN_FOUND) + endif(DOCUMENTATION AND DOXYGEN_FOUND) + + add_subdirectory(src) +-add_subdirectory(ftdipp) ++if(FTDIPP) ++ add_subdirectory(ftdipp) ++endif() + add_subdirectory(python) + add_subdirectory(ftdi_eeprom) + add_subdirectory(examples) +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt +index 27e7884..2d080f4 100644 +--- a/ftdipp/CMakeLists.txt ++++ b/ftdipp/CMakeLists.txt +@@ -1,4 +1,5 @@ + # Check ++project(libftdipp1 C CXX) + set(FTDI_BUILD_CPP False PARENT_SCOPE) + + option ( FTDIPP "Build C++ binding library libftdi1++" ON ) +-- +2.2.2 + diff --git a/package/libftdi1/Config.in b/package/libftdi1/Config.in new file mode 100644 index 0000000..1bb0bfd --- /dev/null +++ b/package/libftdi1/Config.in @@ -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 diff --git a/package/libftdi1/libftdi1.hash b/package/libftdi1/libftdi1.hash new file mode 100644 index 0000000..e53bc8f --- /dev/null +++ b/package/libftdi1/libftdi1.hash @@ -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 diff --git a/package/libftdi1/libftdi1.mk b/package/libftdi1/libftdi1.mk new file mode 100644 index 0000000..608c29a --- /dev/null +++ b/package/libftdi1/libftdi1.mk @@ -0,0 +1,37 @@ +################################################################################ +# +# 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)) -- 2.3.2 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 2/4] package/libftdi1: new package 2015-03-08 11:26 ` [Buildroot] [PATCH v2 2/4] package/libftdi1: new package Samuel Martin @ 2015-03-09 8:33 ` Yegor Yefremov 2015-03-09 10:13 ` Yegor Yefremov 2015-03-16 13:12 ` Thomas Petazzoni 1 sibling, 1 reply; 19+ messages in thread From: Yegor Yefremov @ 2015-03-09 8:33 UTC (permalink / raw) To: buildroot On Sun, Mar 8, 2015 at 12:26 PM, Samuel Martin <s.martin49@gmail.com> wrote: > From: Daniel Sangue <daniel.sangue@sangue.ch> > > This version of libftdi can coexists beside the 0.x version. > > Signed-off-by: Daniel Sangue <daniel.sangue@sangue.ch> > [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 > ] > Signed-off-by: Samuel Martin <s.martin49@gmail.com> > > --- > 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 | 37 +++++++++ > 7 files changed, 253 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 > > diff --git a/package/Config.in b/package/Config.in > index 1bce00a..b46eb79 100644 > --- a/package/Config.in > +++ b/package/Config.in > @@ -752,6 +752,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" > diff --git a/package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch b/package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch > new file mode 100644 > index 0000000..487fc28 > --- /dev/null > +++ b/package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch > @@ -0,0 +1,96 @@ > +From 7e57ff280b55b45e74329b9988279e8831d32eab Mon Sep 17 00:00:00 2001 > +From: Samuel Martin <s.martin49@gmail.com> > +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. > + > +Signed-off-by: Samuel Martin <s.martin49@gmail.com> > +--- > + CMakeLists.txt | 2 -- > + ftdipp/CMakeLists.txt | 15 +-------------- > + src/CMakeLists.txt | 13 +------------ > + 3 files changed, 2 insertions(+), 28 deletions(-) > + > +diff --git a/CMakeLists.txt b/CMakeLists.txt > +index 74f80f4..0ba0b08 100644 > +--- a/CMakeLists.txt > ++++ b/CMakeLists.txt > +@@ -46,8 +46,6 @@ set(CPACK_COMPONENT_SHAREDLIBS_GROUP "Development") > + set(CPACK_COMPONENT_STATICLIBS_GROUP "Development") > + set(CPACK_COMPONENT_HEADERS_GROUP "Development") > + > +-option ( STATICLIBS "Build static libraries" ON ) > +- > + # guess LIB_SUFFIX, don't take debian multiarch into account > + if ( NOT DEFINED LIB_SUFFIX ) > + if( CMAKE_SYSTEM_NAME MATCHES "Linux" > +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt > +index 7500211..27e7884 100644 > +--- a/ftdipp/CMakeLists.txt > ++++ b/ftdipp/CMakeLists.txt > +@@ -23,8 +23,7 @@ if (FTDIPP) > + set(FTDI_BUILD_CPP True PARENT_SCOPE) > + message(STATUS "Building libftdi1++") > + > +- # Shared library > +- add_library(ftdipp1 SHARED ${cpp_sources}) > ++ add_library(ftdipp1 ${cpp_sources}) > + > + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases > + set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) > +@@ -41,18 +40,6 @@ if (FTDIPP) > + LIBRARY DESTINATION lib${LIB_SUFFIX} > + ARCHIVE DESTINATION lib${LIB_SUFFIX} > + ) > +- > +- # Static library > +- if ( STATICLIBS ) > +- add_library(ftdipp1-static STATIC ${cpp_sources}) > +- set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1") > +- set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) > +- > +- install ( TARGETS ftdipp1-static > +- ARCHIVE DESTINATION lib${LIB_SUFFIX} > +- COMPONENT staticlibs > +- ) > +- endif () > + > + install ( FILES ${cpp_headers} > + DESTINATION include/${PROJECT_NAME} > +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt > +index 9fd86a6..501d4a8 100644 > +--- a/src/CMakeLists.txt > ++++ b/src/CMakeLists.txt > +@@ -21,7 +21,7 @@ configure_file(ftdi_version_i.h.in "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h > + set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/ftdi_stream.c CACHE INTERNAL "List of c sources" ) > + set(c_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.h CACHE INTERNAL "List of c headers" ) > + > +-add_library(ftdi1 SHARED ${c_sources}) > ++add_library(ftdi1 ${c_sources}) > + > + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases > + set_target_properties(ftdi1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) > +@@ -38,17 +38,6 @@ install ( TARGETS ftdi1 > + ARCHIVE DESTINATION lib${LIB_SUFFIX} > + ) > + > +-if ( STATICLIBS ) > +- add_library(ftdi1-static STATIC ${c_sources}) > +- target_link_libraries(ftdi1-static ${LIBUSB_LIBRARIES}) > +- set_target_properties(ftdi1-static PROPERTIES OUTPUT_NAME "ftdi1") > +- set_target_properties(ftdi1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) > +- install ( TARGETS ftdi1-static > +- ARCHIVE DESTINATION lib${LIB_SUFFIX} > +- COMPONENT staticlibs > +- ) > +-endif () > +- > + install ( FILES ${c_headers} > + DESTINATION include/${PROJECT_NAME} > + COMPONENT headers > +-- > +2.2.2 > + > diff --git a/package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch b/package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch > new file mode 100644 > index 0000000..5619a0c > --- /dev/null > +++ b/package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch > @@ -0,0 +1,34 @@ > +From 81275d75ae88fe8ab1915d3ba260ea935e63c362 Mon Sep 17 00:00:00 2001 > +From: Samuel Martin <s.martin49@gmail.com> > +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 <s.martin49@gmail.com> > +--- > + 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 > + > diff --git a/package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch b/package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch > new file mode 100644 > index 0000000..be0913d > --- /dev/null > +++ b/package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch > @@ -0,0 +1,46 @@ > +From c215d5ecd985b57700e817920d0e99112b4a571b Mon Sep 17 00:00:00 2001 > +From: Samuel Martin <s.martin49@gmail.com> > +Date: Sun, 25 Jan 2015 13:35:24 +0100 > +Subject: [PATCH] cmake: do not check for g++ when FTDIPP is disabled > + > +Signed-off-by: Samuel Martin <s.martin49@gmail.com> > +--- > + CMakeLists.txt | 6 ++++-- > + ftdipp/CMakeLists.txt | 1 + > + 2 files changed, 5 insertions(+), 2 deletions(-) > + > +diff --git a/CMakeLists.txt b/CMakeLists.txt > +index 0ba0b08..e880211 100644 > +--- a/CMakeLists.txt > ++++ b/CMakeLists.txt > +@@ -1,5 +1,5 @@ > + # Project > +-project(libftdi1) > ++project(libftdi1 C) > + set(MAJOR_VERSION 1) > + set(MINOR_VERSION 2) > + set(PACKAGE libftdi1) > +@@ -145,7 +145,9 @@ else(DOCUMENTATION AND DOXYGEN_FOUND) > + endif(DOCUMENTATION AND DOXYGEN_FOUND) > + > + add_subdirectory(src) > +-add_subdirectory(ftdipp) > ++if(FTDIPP) > ++ add_subdirectory(ftdipp) > ++endif() > + add_subdirectory(python) > + add_subdirectory(ftdi_eeprom) > + add_subdirectory(examples) > +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt > +index 27e7884..2d080f4 100644 > +--- a/ftdipp/CMakeLists.txt > ++++ b/ftdipp/CMakeLists.txt > +@@ -1,4 +1,5 @@ > + # Check > ++project(libftdipp1 C CXX) > + set(FTDI_BUILD_CPP False PARENT_SCOPE) > + > + option ( FTDIPP "Build C++ binding library libftdi1++" ON ) > +-- > +2.2.2 > + > diff --git a/package/libftdi1/Config.in b/package/libftdi1/Config.in > new file mode 100644 > index 0000000..1bb0bfd > --- /dev/null > +++ b/package/libftdi1/Config.in > @@ -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 > diff --git a/package/libftdi1/libftdi1.hash b/package/libftdi1/libftdi1.hash > new file mode 100644 > index 0000000..e53bc8f > --- /dev/null > +++ b/package/libftdi1/libftdi1.hash > @@ -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 > diff --git a/package/libftdi1/libftdi1.mk b/package/libftdi1/libftdi1.mk > new file mode 100644 > index 0000000..608c29a > --- /dev/null > +++ b/package/libftdi1/libftdi1.mk > @@ -0,0 +1,37 @@ > +################################################################################ > +# > +# 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)) I've applied two first patches: libftdi bump and libfdti1 package. During compiling I get following error: libftdi1-1.2.tar.bz2: OK (sha256: a6ea795c829219015eb372b03008351cee3fb39f684bff3bf8a4620b558488d6) >>> libftdi1 1.2 Extracting bzcat /home/YegorYefremov/MyProjects/versioned/br-latest/dl/libftdi1-1.2.tar.bz2 | tar --strip-components=1 -C /home/YegorYefremov/MyProjects/versioned/br-latest/prod-s1/build/libftdi1-1.2 -xf - >>> libftdi1 1.2 Patching Applying 0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch using patch: patching file CMakeLists.txt Hunk #1 FAILED at 46. 1 out of 1 hunk FAILED -- saving rejects to file CMakeLists.txt.rej patching file ftdipp/CMakeLists.txt Hunk #2 FAILED at 40. 1 out of 2 hunks FAILED -- saving rejects to file ftdipp/CMakeLists.txt.rej patching file src/CMakeLists.txt Patch failed! Please fix 0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch! I've made git pull today, so I'm on the newest state. First reject file: --- CMakeLists.txt +++ CMakeLists.txt @@ -46,8 +46,6 @@ set(CPACK_COMPONENT_STATICLIBS_GROUP "Development") set(CPACK_COMPONENT_HEADERS_GROUP "Development") -option ( STATICLIBS "Build static libraries" ON ) - # guess LIB_SUFFIX, don't take debian multiarch into account if ( NOT DEFINED LIB_SUFFIX ) if( CMAKE_SYSTEM_NAME MATCHES "Linux" Second: --- ftdipp/CMakeLists.txt +++ ftdipp/CMakeLists.txt @@ -40,18 +39,6 @@ LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX} ) - - # Static library - if ( STATICLIBS ) - add_library(ftdipp1-static STATIC ${cpp_sources}) - set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1") - set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) - - install ( TARGETS ftdipp1-static - ARCHIVE DESTINATION lib${LIB_SUFFIX} - COMPONENT staticlibs - ) - endif () install ( FILES ${cpp_headers} DESTINATION include/${PROJECT_NAME} Am I missing some other patches? Yegor ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 2/4] package/libftdi1: new package 2015-03-09 8:33 ` Yegor Yefremov @ 2015-03-09 10:13 ` Yegor Yefremov 2015-03-09 11:22 ` Yegor Yefremov 0 siblings, 1 reply; 19+ messages in thread From: Yegor Yefremov @ 2015-03-09 10:13 UTC (permalink / raw) To: buildroot On Mon, Mar 9, 2015 at 9:33 AM, Yegor Yefremov <yegorslists@googlemail.com> wrote: > On Sun, Mar 8, 2015 at 12:26 PM, Samuel Martin <s.martin49@gmail.com> wrote: >> From: Daniel Sangue <daniel.sangue@sangue.ch> >> >> This version of libftdi can coexists beside the 0.x version. >> >> Signed-off-by: Daniel Sangue <daniel.sangue@sangue.ch> >> [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 >> ] >> Signed-off-by: Samuel Martin <s.martin49@gmail.com> >> >> --- >> 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 | 37 +++++++++ >> 7 files changed, 253 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 >> >> diff --git a/package/Config.in b/package/Config.in >> index 1bce00a..b46eb79 100644 >> --- a/package/Config.in >> +++ b/package/Config.in >> @@ -752,6 +752,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" >> diff --git a/package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch b/package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch >> new file mode 100644 >> index 0000000..487fc28 >> --- /dev/null >> +++ b/package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch >> @@ -0,0 +1,96 @@ >> +From 7e57ff280b55b45e74329b9988279e8831d32eab Mon Sep 17 00:00:00 2001 >> +From: Samuel Martin <s.martin49@gmail.com> >> +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. >> + >> +Signed-off-by: Samuel Martin <s.martin49@gmail.com> >> +--- >> + CMakeLists.txt | 2 -- >> + ftdipp/CMakeLists.txt | 15 +-------------- >> + src/CMakeLists.txt | 13 +------------ >> + 3 files changed, 2 insertions(+), 28 deletions(-) >> + >> +diff --git a/CMakeLists.txt b/CMakeLists.txt >> +index 74f80f4..0ba0b08 100644 >> +--- a/CMakeLists.txt >> ++++ b/CMakeLists.txt >> +@@ -46,8 +46,6 @@ set(CPACK_COMPONENT_SHAREDLIBS_GROUP "Development") >> + set(CPACK_COMPONENT_STATICLIBS_GROUP "Development") >> + set(CPACK_COMPONENT_HEADERS_GROUP "Development") >> + >> +-option ( STATICLIBS "Build static libraries" ON ) >> +- >> + # guess LIB_SUFFIX, don't take debian multiarch into account >> + if ( NOT DEFINED LIB_SUFFIX ) >> + if( CMAKE_SYSTEM_NAME MATCHES "Linux" >> +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt >> +index 7500211..27e7884 100644 >> +--- a/ftdipp/CMakeLists.txt >> ++++ b/ftdipp/CMakeLists.txt >> +@@ -23,8 +23,7 @@ if (FTDIPP) >> + set(FTDI_BUILD_CPP True PARENT_SCOPE) >> + message(STATUS "Building libftdi1++") >> + >> +- # Shared library >> +- add_library(ftdipp1 SHARED ${cpp_sources}) >> ++ add_library(ftdipp1 ${cpp_sources}) >> + >> + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases >> + set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) >> +@@ -41,18 +40,6 @@ if (FTDIPP) >> + LIBRARY DESTINATION lib${LIB_SUFFIX} >> + ARCHIVE DESTINATION lib${LIB_SUFFIX} >> + ) >> +- >> +- # Static library >> +- if ( STATICLIBS ) >> +- add_library(ftdipp1-static STATIC ${cpp_sources}) >> +- set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1") >> +- set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) >> +- >> +- install ( TARGETS ftdipp1-static >> +- ARCHIVE DESTINATION lib${LIB_SUFFIX} >> +- COMPONENT staticlibs >> +- ) >> +- endif () >> + >> + install ( FILES ${cpp_headers} >> + DESTINATION include/${PROJECT_NAME} >> +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt >> +index 9fd86a6..501d4a8 100644 >> +--- a/src/CMakeLists.txt >> ++++ b/src/CMakeLists.txt >> +@@ -21,7 +21,7 @@ configure_file(ftdi_version_i.h.in "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h >> + set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/ftdi_stream.c CACHE INTERNAL "List of c sources" ) >> + set(c_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.h CACHE INTERNAL "List of c headers" ) >> + >> +-add_library(ftdi1 SHARED ${c_sources}) >> ++add_library(ftdi1 ${c_sources}) >> + >> + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases >> + set_target_properties(ftdi1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) >> +@@ -38,17 +38,6 @@ install ( TARGETS ftdi1 >> + ARCHIVE DESTINATION lib${LIB_SUFFIX} >> + ) >> + >> +-if ( STATICLIBS ) >> +- add_library(ftdi1-static STATIC ${c_sources}) >> +- target_link_libraries(ftdi1-static ${LIBUSB_LIBRARIES}) >> +- set_target_properties(ftdi1-static PROPERTIES OUTPUT_NAME "ftdi1") >> +- set_target_properties(ftdi1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) >> +- install ( TARGETS ftdi1-static >> +- ARCHIVE DESTINATION lib${LIB_SUFFIX} >> +- COMPONENT staticlibs >> +- ) >> +-endif () >> +- >> + install ( FILES ${c_headers} >> + DESTINATION include/${PROJECT_NAME} >> + COMPONENT headers >> +-- >> +2.2.2 >> + >> diff --git a/package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch b/package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch >> new file mode 100644 >> index 0000000..5619a0c >> --- /dev/null >> +++ b/package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch >> @@ -0,0 +1,34 @@ >> +From 81275d75ae88fe8ab1915d3ba260ea935e63c362 Mon Sep 17 00:00:00 2001 >> +From: Samuel Martin <s.martin49@gmail.com> >> +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 <s.martin49@gmail.com> >> +--- >> + 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 >> + >> diff --git a/package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch b/package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch >> new file mode 100644 >> index 0000000..be0913d >> --- /dev/null >> +++ b/package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch >> @@ -0,0 +1,46 @@ >> +From c215d5ecd985b57700e817920d0e99112b4a571b Mon Sep 17 00:00:00 2001 >> +From: Samuel Martin <s.martin49@gmail.com> >> +Date: Sun, 25 Jan 2015 13:35:24 +0100 >> +Subject: [PATCH] cmake: do not check for g++ when FTDIPP is disabled >> + >> +Signed-off-by: Samuel Martin <s.martin49@gmail.com> >> +--- >> + CMakeLists.txt | 6 ++++-- >> + ftdipp/CMakeLists.txt | 1 + >> + 2 files changed, 5 insertions(+), 2 deletions(-) >> + >> +diff --git a/CMakeLists.txt b/CMakeLists.txt >> +index 0ba0b08..e880211 100644 >> +--- a/CMakeLists.txt >> ++++ b/CMakeLists.txt >> +@@ -1,5 +1,5 @@ >> + # Project >> +-project(libftdi1) >> ++project(libftdi1 C) >> + set(MAJOR_VERSION 1) >> + set(MINOR_VERSION 2) >> + set(PACKAGE libftdi1) >> +@@ -145,7 +145,9 @@ else(DOCUMENTATION AND DOXYGEN_FOUND) >> + endif(DOCUMENTATION AND DOXYGEN_FOUND) >> + >> + add_subdirectory(src) >> +-add_subdirectory(ftdipp) >> ++if(FTDIPP) >> ++ add_subdirectory(ftdipp) >> ++endif() >> + add_subdirectory(python) >> + add_subdirectory(ftdi_eeprom) >> + add_subdirectory(examples) >> +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt >> +index 27e7884..2d080f4 100644 >> +--- a/ftdipp/CMakeLists.txt >> ++++ b/ftdipp/CMakeLists.txt >> +@@ -1,4 +1,5 @@ >> + # Check >> ++project(libftdipp1 C CXX) >> + set(FTDI_BUILD_CPP False PARENT_SCOPE) >> + >> + option ( FTDIPP "Build C++ binding library libftdi1++" ON ) >> +-- >> +2.2.2 >> + >> diff --git a/package/libftdi1/Config.in b/package/libftdi1/Config.in >> new file mode 100644 >> index 0000000..1bb0bfd >> --- /dev/null >> +++ b/package/libftdi1/Config.in >> @@ -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 >> diff --git a/package/libftdi1/libftdi1.hash b/package/libftdi1/libftdi1.hash >> new file mode 100644 >> index 0000000..e53bc8f >> --- /dev/null >> +++ b/package/libftdi1/libftdi1.hash >> @@ -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 >> diff --git a/package/libftdi1/libftdi1.mk b/package/libftdi1/libftdi1.mk >> new file mode 100644 >> index 0000000..608c29a >> --- /dev/null >> +++ b/package/libftdi1/libftdi1.mk >> @@ -0,0 +1,37 @@ >> +################################################################################ >> +# >> +# 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)) > > I've applied two first patches: libftdi bump and libfdti1 package. > During compiling I get following error: > > libftdi1-1.2.tar.bz2: OK (sha256: > a6ea795c829219015eb372b03008351cee3fb39f684bff3bf8a4620b558488d6) >>>> libftdi1 1.2 Extracting > bzcat /home/YegorYefremov/MyProjects/versioned/br-latest/dl/libftdi1-1.2.tar.bz2 > | tar --strip-components=1 -C > /home/YegorYefremov/MyProjects/versioned/br-latest/prod-s1/build/libftdi1-1.2 > -xf - >>>> libftdi1 1.2 Patching > > Applying 0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch > using patch: > patching file CMakeLists.txt > Hunk #1 FAILED at 46. > 1 out of 1 hunk FAILED -- saving rejects to file CMakeLists.txt.rej > patching file ftdipp/CMakeLists.txt > Hunk #2 FAILED at 40. > 1 out of 2 hunks FAILED -- saving rejects to file ftdipp/CMakeLists.txt.rej > patching file src/CMakeLists.txt > Patch failed! Please fix > 0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch! > > I've made git pull today, so I'm on the newest state. > > First reject file: > > --- CMakeLists.txt > +++ CMakeLists.txt > @@ -46,8 +46,6 @@ > set(CPACK_COMPONENT_STATICLIBS_GROUP "Development") > set(CPACK_COMPONENT_HEADERS_GROUP "Development") > > -option ( STATICLIBS "Build static libraries" ON ) > - > # guess LIB_SUFFIX, don't take debian multiarch into account > if ( NOT DEFINED LIB_SUFFIX ) > if( CMAKE_SYSTEM_NAME MATCHES "Linux" > > Second: > > --- ftdipp/CMakeLists.txt > +++ ftdipp/CMakeLists.txt > @@ -40,18 +39,6 @@ > LIBRARY DESTINATION lib${LIB_SUFFIX} > ARCHIVE DESTINATION lib${LIB_SUFFIX} > ) > - > - # Static library > - if ( STATICLIBS ) > - add_library(ftdipp1-static STATIC ${cpp_sources}) > - set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1") > - set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) > - > - install ( TARGETS ftdipp1-static > - ARCHIVE DESTINATION lib${LIB_SUFFIX} > - COMPONENT staticlibs > - ) > - endif () > > install ( FILES ${cpp_headers} > DESTINATION include/${PROJECT_NAME} > > Am I missing some other patches? When applying the libftdi1 patch via "git am" I get following warnings: Applying: package/libftdi1: new package /home/user/Documents/versioned/br-test/.git/rebase-apply/patch:74: trailing whitespace. /home/user/Documents/versioned/br-test/.git/rebase-apply/patch:77: trailing whitespace. # guess LIB_SUFFIX, don't take debian multiarch into account /home/user/Documents/versioned/br-test/.git/rebase-apply/patch:87: trailing whitespace. /home/user/Documents/versioned/br-test/.git/rebase-apply/patch:91: trailing whitespace. /home/user/Documents/versioned/br-test/.git/rebase-apply/patch:98: trailing whitespace. - warning: squelched 14 whitespace errors warning: 16 lines applied after fixing whitespace errors. The problem seems to be e-mail version of a patch. I've tried both mbox variant from patchwork and saving the patch from my web gmail. But direct cherry-picking was successful. Yegor ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 2/4] package/libftdi1: new package 2015-03-09 10:13 ` Yegor Yefremov @ 2015-03-09 11:22 ` Yegor Yefremov 0 siblings, 0 replies; 19+ messages in thread From: Yegor Yefremov @ 2015-03-09 11:22 UTC (permalink / raw) To: buildroot On Mon, Mar 9, 2015 at 11:13 AM, Yegor Yefremov <yegorslists@googlemail.com> wrote: > On Mon, Mar 9, 2015 at 9:33 AM, Yegor Yefremov > <yegorslists@googlemail.com> wrote: >> On Sun, Mar 8, 2015 at 12:26 PM, Samuel Martin <s.martin49@gmail.com> wrote: >>> From: Daniel Sangue <daniel.sangue@sangue.ch> >>> >>> This version of libftdi can coexists beside the 0.x version. >>> >>> Signed-off-by: Daniel Sangue <daniel.sangue@sangue.ch> >>> [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 >>> ] >>> Signed-off-by: Samuel Martin <s.martin49@gmail.com> >>> >>> --- >>> 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 | 37 +++++++++ >>> 7 files changed, 253 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 >>> >>> diff --git a/package/Config.in b/package/Config.in >>> index 1bce00a..b46eb79 100644 >>> --- a/package/Config.in >>> +++ b/package/Config.in >>> @@ -752,6 +752,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" >>> diff --git a/package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch b/package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch >>> new file mode 100644 >>> index 0000000..487fc28 >>> --- /dev/null >>> +++ b/package/libftdi1/0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch >>> @@ -0,0 +1,96 @@ >>> +From 7e57ff280b55b45e74329b9988279e8831d32eab Mon Sep 17 00:00:00 2001 >>> +From: Samuel Martin <s.martin49@gmail.com> >>> +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. >>> + >>> +Signed-off-by: Samuel Martin <s.martin49@gmail.com> >>> +--- >>> + CMakeLists.txt | 2 -- >>> + ftdipp/CMakeLists.txt | 15 +-------------- >>> + src/CMakeLists.txt | 13 +------------ >>> + 3 files changed, 2 insertions(+), 28 deletions(-) >>> + >>> +diff --git a/CMakeLists.txt b/CMakeLists.txt >>> +index 74f80f4..0ba0b08 100644 >>> +--- a/CMakeLists.txt >>> ++++ b/CMakeLists.txt >>> +@@ -46,8 +46,6 @@ set(CPACK_COMPONENT_SHAREDLIBS_GROUP "Development") >>> + set(CPACK_COMPONENT_STATICLIBS_GROUP "Development") >>> + set(CPACK_COMPONENT_HEADERS_GROUP "Development") >>> + >>> +-option ( STATICLIBS "Build static libraries" ON ) >>> +- >>> + # guess LIB_SUFFIX, don't take debian multiarch into account >>> + if ( NOT DEFINED LIB_SUFFIX ) >>> + if( CMAKE_SYSTEM_NAME MATCHES "Linux" >>> +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt >>> +index 7500211..27e7884 100644 >>> +--- a/ftdipp/CMakeLists.txt >>> ++++ b/ftdipp/CMakeLists.txt >>> +@@ -23,8 +23,7 @@ if (FTDIPP) >>> + set(FTDI_BUILD_CPP True PARENT_SCOPE) >>> + message(STATUS "Building libftdi1++") >>> + >>> +- # Shared library >>> +- add_library(ftdipp1 SHARED ${cpp_sources}) >>> ++ add_library(ftdipp1 ${cpp_sources}) >>> + >>> + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases >>> + set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) >>> +@@ -41,18 +40,6 @@ if (FTDIPP) >>> + LIBRARY DESTINATION lib${LIB_SUFFIX} >>> + ARCHIVE DESTINATION lib${LIB_SUFFIX} >>> + ) >>> +- >>> +- # Static library >>> +- if ( STATICLIBS ) >>> +- add_library(ftdipp1-static STATIC ${cpp_sources}) >>> +- set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1") >>> +- set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) >>> +- >>> +- install ( TARGETS ftdipp1-static >>> +- ARCHIVE DESTINATION lib${LIB_SUFFIX} >>> +- COMPONENT staticlibs >>> +- ) >>> +- endif () >>> + >>> + install ( FILES ${cpp_headers} >>> + DESTINATION include/${PROJECT_NAME} >>> +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt >>> +index 9fd86a6..501d4a8 100644 >>> +--- a/src/CMakeLists.txt >>> ++++ b/src/CMakeLists.txt >>> +@@ -21,7 +21,7 @@ configure_file(ftdi_version_i.h.in "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h >>> + set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/ftdi_stream.c CACHE INTERNAL "List of c sources" ) >>> + set(c_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.h CACHE INTERNAL "List of c headers" ) >>> + >>> +-add_library(ftdi1 SHARED ${c_sources}) >>> ++add_library(ftdi1 ${c_sources}) >>> + >>> + math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases >>> + set_target_properties(ftdi1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) >>> +@@ -38,17 +38,6 @@ install ( TARGETS ftdi1 >>> + ARCHIVE DESTINATION lib${LIB_SUFFIX} >>> + ) >>> + >>> +-if ( STATICLIBS ) >>> +- add_library(ftdi1-static STATIC ${c_sources}) >>> +- target_link_libraries(ftdi1-static ${LIBUSB_LIBRARIES}) >>> +- set_target_properties(ftdi1-static PROPERTIES OUTPUT_NAME "ftdi1") >>> +- set_target_properties(ftdi1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) >>> +- install ( TARGETS ftdi1-static >>> +- ARCHIVE DESTINATION lib${LIB_SUFFIX} >>> +- COMPONENT staticlibs >>> +- ) >>> +-endif () >>> +- >>> + install ( FILES ${c_headers} >>> + DESTINATION include/${PROJECT_NAME} >>> + COMPONENT headers >>> +-- >>> +2.2.2 >>> + >>> diff --git a/package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch b/package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch >>> new file mode 100644 >>> index 0000000..5619a0c >>> --- /dev/null >>> +++ b/package/libftdi1/0002-cmake-fix-FindUSB1.cmake.patch >>> @@ -0,0 +1,34 @@ >>> +From 81275d75ae88fe8ab1915d3ba260ea935e63c362 Mon Sep 17 00:00:00 2001 >>> +From: Samuel Martin <s.martin49@gmail.com> >>> +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 <s.martin49@gmail.com> >>> +--- >>> + 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 >>> + >>> diff --git a/package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch b/package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch >>> new file mode 100644 >>> index 0000000..be0913d >>> --- /dev/null >>> +++ b/package/libftdi1/0003-cmake-do-not-check-for-g-when-FTDIPP-is-disabled.patch >>> @@ -0,0 +1,46 @@ >>> +From c215d5ecd985b57700e817920d0e99112b4a571b Mon Sep 17 00:00:00 2001 >>> +From: Samuel Martin <s.martin49@gmail.com> >>> +Date: Sun, 25 Jan 2015 13:35:24 +0100 >>> +Subject: [PATCH] cmake: do not check for g++ when FTDIPP is disabled >>> + >>> +Signed-off-by: Samuel Martin <s.martin49@gmail.com> >>> +--- >>> + CMakeLists.txt | 6 ++++-- >>> + ftdipp/CMakeLists.txt | 1 + >>> + 2 files changed, 5 insertions(+), 2 deletions(-) >>> + >>> +diff --git a/CMakeLists.txt b/CMakeLists.txt >>> +index 0ba0b08..e880211 100644 >>> +--- a/CMakeLists.txt >>> ++++ b/CMakeLists.txt >>> +@@ -1,5 +1,5 @@ >>> + # Project >>> +-project(libftdi1) >>> ++project(libftdi1 C) >>> + set(MAJOR_VERSION 1) >>> + set(MINOR_VERSION 2) >>> + set(PACKAGE libftdi1) >>> +@@ -145,7 +145,9 @@ else(DOCUMENTATION AND DOXYGEN_FOUND) >>> + endif(DOCUMENTATION AND DOXYGEN_FOUND) >>> + >>> + add_subdirectory(src) >>> +-add_subdirectory(ftdipp) >>> ++if(FTDIPP) >>> ++ add_subdirectory(ftdipp) >>> ++endif() >>> + add_subdirectory(python) >>> + add_subdirectory(ftdi_eeprom) >>> + add_subdirectory(examples) >>> +diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt >>> +index 27e7884..2d080f4 100644 >>> +--- a/ftdipp/CMakeLists.txt >>> ++++ b/ftdipp/CMakeLists.txt >>> +@@ -1,4 +1,5 @@ >>> + # Check >>> ++project(libftdipp1 C CXX) >>> + set(FTDI_BUILD_CPP False PARENT_SCOPE) >>> + >>> + option ( FTDIPP "Build C++ binding library libftdi1++" ON ) >>> +-- >>> +2.2.2 >>> + >>> diff --git a/package/libftdi1/Config.in b/package/libftdi1/Config.in >>> new file mode 100644 >>> index 0000000..1bb0bfd >>> --- /dev/null >>> +++ b/package/libftdi1/Config.in >>> @@ -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 >>> diff --git a/package/libftdi1/libftdi1.hash b/package/libftdi1/libftdi1.hash >>> new file mode 100644 >>> index 0000000..e53bc8f >>> --- /dev/null >>> +++ b/package/libftdi1/libftdi1.hash >>> @@ -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 >>> diff --git a/package/libftdi1/libftdi1.mk b/package/libftdi1/libftdi1.mk >>> new file mode 100644 >>> index 0000000..608c29a >>> --- /dev/null >>> +++ b/package/libftdi1/libftdi1.mk >>> @@ -0,0 +1,37 @@ >>> +################################################################################ >>> +# >>> +# 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)) >> >> I've applied two first patches: libftdi bump and libfdti1 package. >> During compiling I get following error: >> >> libftdi1-1.2.tar.bz2: OK (sha256: >> a6ea795c829219015eb372b03008351cee3fb39f684bff3bf8a4620b558488d6) >>>>> libftdi1 1.2 Extracting >> bzcat /home/YegorYefremov/MyProjects/versioned/br-latest/dl/libftdi1-1.2.tar.bz2 >> | tar --strip-components=1 -C >> /home/YegorYefremov/MyProjects/versioned/br-latest/prod-s1/build/libftdi1-1.2 >> -xf - >>>>> libftdi1 1.2 Patching >> >> Applying 0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch >> using patch: >> patching file CMakeLists.txt >> Hunk #1 FAILED at 46. >> 1 out of 1 hunk FAILED -- saving rejects to file CMakeLists.txt.rej >> patching file ftdipp/CMakeLists.txt >> Hunk #2 FAILED at 40. >> 1 out of 2 hunks FAILED -- saving rejects to file ftdipp/CMakeLists.txt.rej >> patching file src/CMakeLists.txt >> Patch failed! Please fix >> 0001-cmake-use-the-standard-CMake-flag-to-drive-the-share.patch! >> >> I've made git pull today, so I'm on the newest state. >> >> First reject file: >> >> --- CMakeLists.txt >> +++ CMakeLists.txt >> @@ -46,8 +46,6 @@ >> set(CPACK_COMPONENT_STATICLIBS_GROUP "Development") >> set(CPACK_COMPONENT_HEADERS_GROUP "Development") >> >> -option ( STATICLIBS "Build static libraries" ON ) >> - >> # guess LIB_SUFFIX, don't take debian multiarch into account >> if ( NOT DEFINED LIB_SUFFIX ) >> if( CMAKE_SYSTEM_NAME MATCHES "Linux" >> >> Second: >> >> --- ftdipp/CMakeLists.txt >> +++ ftdipp/CMakeLists.txt >> @@ -40,18 +39,6 @@ >> LIBRARY DESTINATION lib${LIB_SUFFIX} >> ARCHIVE DESTINATION lib${LIB_SUFFIX} >> ) >> - >> - # Static library >> - if ( STATICLIBS ) >> - add_library(ftdipp1-static STATIC ${cpp_sources}) >> - set_target_properties(ftdipp1-static PROPERTIES OUTPUT_NAME "ftdipp1") >> - set_target_properties(ftdipp1-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) >> - >> - install ( TARGETS ftdipp1-static >> - ARCHIVE DESTINATION lib${LIB_SUFFIX} >> - COMPONENT staticlibs >> - ) >> - endif () >> >> install ( FILES ${cpp_headers} >> DESTINATION include/${PROJECT_NAME} >> >> Am I missing some other patches? > > When applying the libftdi1 patch via "git am" I get following warnings: > > Applying: package/libftdi1: new package > /home/user/Documents/versioned/br-test/.git/rebase-apply/patch:74: > trailing whitespace. > > /home/user/Documents/versioned/br-test/.git/rebase-apply/patch:77: > trailing whitespace. > # guess LIB_SUFFIX, don't take debian multiarch into account > /home/user/Documents/versioned/br-test/.git/rebase-apply/patch:87: > trailing whitespace. > > /home/user/Documents/versioned/br-test/.git/rebase-apply/patch:91: > trailing whitespace. > > /home/user/Documents/versioned/br-test/.git/rebase-apply/patch:98: > trailing whitespace. > - > warning: squelched 14 whitespace errors > warning: 16 lines applied after fixing whitespace errors. > > The problem seems to be e-mail version of a patch. I've tried both > mbox variant from patchwork and saving the patch from my web gmail. > But direct cherry-picking was successful. Python wrapper has installation issue: install step copies both *.so and *.py files to site-packages make step finalizing the rootfs removes ftdi1.py from site-packages Other than that, "import ftdi1" is successful Any idea? ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 2/4] package/libftdi1: new package 2015-03-08 11:26 ` [Buildroot] [PATCH v2 2/4] package/libftdi1: new package Samuel Martin 2015-03-09 8:33 ` Yegor Yefremov @ 2015-03-16 13:12 ` Thomas Petazzoni 1 sibling, 0 replies; 19+ messages in thread From: Thomas Petazzoni @ 2015-03-16 13:12 UTC (permalink / raw) To: buildroot Dear Samuel Martin, On Sun, 8 Mar 2015 12:26:02 +0100, Samuel Martin wrote: > From: Daniel Sangue <daniel.sangue@sangue.ch> > > This version of libftdi can coexists beside the 0.x version. > > Signed-off-by: Daniel Sangue <daniel.sangue@sangue.ch> > [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 > ] > Signed-off-by: Samuel Martin <s.martin49@gmail.com> I've applied. But to be honest, I have *way* too many changes to make to patches you send. Please be more careful. See below. > +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" We usually always have the "bool" property first, then the "selects" then the "depends on". > + 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 Comment about thread not needed, since the whole package depends on threads anyway. > + > +config BR2_PACKAGE_LIBTFDI1_PYTHON_BINDINGS > + depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3 > + bool "python bindings" Ditto bool vs. depends on ordering. > + help > + Python bindings for libftdi > + > +config BR2_PACKAGE_LIBTFDI1_FDTI_EEPROM > + select BR2_PACKAGE_LIBCONFUSE > + bool "ftdi_eeprom tool" Ditto. > diff --git a/package/libftdi1/libftdi1.mk b/package/libftdi1/libftdi1.mk > new file mode 100644 > index 0000000..608c29a > --- /dev/null > +++ b/package/libftdi1/libftdi1.mk > @@ -0,0 +1,37 @@ > +################################################################################ > +# > +# 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 Missing license information. > +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 How on earth can this work ? It should be: LIBFTDI1_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON),python,python3) host-swig Committed with these things fixed. However, please make sure to contribute your libftdi1 patches upstream. I think you should really review your patches more carefully. Having so many issues doesn't really increase the trust we can have in your patches, which means we are less likely to apply them quickly. And I'm not talking about actual testing, I'm really talking about reviewing. Thanks, Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 3/4] package/avrdude: depends on libftdi1 instead of libftdi 2015-03-08 11:26 [Buildroot] [PATCH v2 0/4] libftdi{0,1} related work Samuel Martin 2015-03-08 11:26 ` [Buildroot] [PATCH v2 1/4] package/libftdi: bump to version 0.20 Samuel Martin 2015-03-08 11:26 ` [Buildroot] [PATCH v2 2/4] package/libftdi1: new package Samuel Martin @ 2015-03-08 11:26 ` Samuel Martin 2015-03-08 11:48 ` Baruch Siach 2015-03-08 11:26 ` [Buildroot] [PATCH v2 4/4] package/openocd: " Samuel Martin 3 siblings, 1 reply; 19+ messages in thread From: Samuel Martin @ 2015-03-08 11:26 UTC (permalink / raw) To: buildroot Signed-off-by: Samuel Martin <s.martin49@gmail.com> --- changes v1->v2: - rebase --- package/avrdude/avrdude.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/avrdude/avrdude.mk b/package/avrdude/avrdude.mk index 03d6490..a4e0ebd 100644 --- a/package/avrdude/avrdude.mk +++ b/package/avrdude/avrdude.mk @@ -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 -- 2.3.2 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 3/4] package/avrdude: depends on libftdi1 instead of libftdi 2015-03-08 11:26 ` [Buildroot] [PATCH v2 3/4] package/avrdude: depends on libftdi1 instead of libftdi Samuel Martin @ 2015-03-08 11:48 ` Baruch Siach 2015-03-08 17:03 ` Samuel Martin 0 siblings, 1 reply; 19+ messages in thread From: Baruch Siach @ 2015-03-08 11:48 UTC (permalink / raw) To: buildroot Hi Samuel, On Sun, Mar 08, 2015 at 12:26:03PM +0100, Samuel Martin wrote: > Signed-off-by: Samuel Martin <s.martin49@gmail.com> > > --- > changes v1->v2: > - rebase > --- > package/avrdude/avrdude.mk | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/package/avrdude/avrdude.mk b/package/avrdude/avrdude.mk > index 03d6490..a4e0ebd 100644 > --- a/package/avrdude/avrdude.mk > +++ b/package/avrdude/avrdude.mk > @@ -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 How do you tell avrdude to link with libftdi1 and not libftdi when both are built? The same question goes for openocd. > endif > > # if /etc/avrdude.conf exists, the installation process creates a baruch -- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 3/4] package/avrdude: depends on libftdi1 instead of libftdi 2015-03-08 11:48 ` Baruch Siach @ 2015-03-08 17:03 ` Samuel Martin 2015-03-16 13:15 ` Thomas Petazzoni 0 siblings, 1 reply; 19+ messages in thread From: Samuel Martin @ 2015-03-08 17:03 UTC (permalink / raw) To: buildroot Hi Baruch, On Sun, Mar 8, 2015 at 12:48 PM, Baruch Siach <baruch@tkos.co.il> wrote: > Hi Samuel, > > On Sun, Mar 08, 2015 at 12:26:03PM +0100, Samuel Martin wrote: >> Signed-off-by: Samuel Martin <s.martin49@gmail.com> >> >> --- >> changes v1->v2: >> - rebase >> --- >> package/avrdude/avrdude.mk | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/package/avrdude/avrdude.mk b/package/avrdude/avrdude.mk >> index 03d6490..a4e0ebd 100644 >> --- a/package/avrdude/avrdude.mk >> +++ b/package/avrdude/avrdude.mk >> @@ -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 > > How do you tell avrdude to link with libftdi1 and not libftdi when both are > built? The same question goes for openocd. Both avrdude and openocd first check for libftdi1, and use it if any, otherwise check for libftdi. So, unless I'm missing something this is ok; but that's true I forgot to mention this point in the commit log. :-/ Regards, -- Samuel ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 3/4] package/avrdude: depends on libftdi1 instead of libftdi 2015-03-08 17:03 ` Samuel Martin @ 2015-03-16 13:15 ` Thomas Petazzoni 2015-03-17 16:24 ` Samuel Martin 0 siblings, 1 reply; 19+ messages in thread From: Thomas Petazzoni @ 2015-03-16 13:15 UTC (permalink / raw) To: buildroot Dear Samuel Martin, On Sun, 8 Mar 2015 18:03:09 +0100, Samuel Martin wrote: > > How do you tell avrdude to link with libftdi1 and not libftdi when both are > > built? The same question goes for openocd. > > Both avrdude and openocd first check for libftdi1, and use it if any, > otherwise check for libftdi. > So, unless I'm missing something this is ok; but that's true I forgot > to mention this point in the commit log. :-/ So the patch should actually be: ifeq ($(BR2_PACKAGE_LIBFTDI1),y) AVRDUDE_DEPENDENCIES += libftdi1 else ifeq ($(BR2_PACKAGE_LIBFTDI),y) AVRDUDE_DEPENDENCIES += libftdi endif Can you fix and resend? Thanks, Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 3/4] package/avrdude: depends on libftdi1 instead of libftdi 2015-03-16 13:15 ` Thomas Petazzoni @ 2015-03-17 16:24 ` Samuel Martin 2015-03-17 16:48 ` Thomas Petazzoni 0 siblings, 1 reply; 19+ messages in thread From: Samuel Martin @ 2015-03-17 16:24 UTC (permalink / raw) To: buildroot Hi Thomas, On Mon, Mar 16, 2015 at 2:15 PM, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote: > Dear Samuel Martin, > > On Sun, 8 Mar 2015 18:03:09 +0100, Samuel Martin wrote: > >> > How do you tell avrdude to link with libftdi1 and not libftdi when both are >> > built? The same question goes for openocd. >> >> Both avrdude and openocd first check for libftdi1, and use it if any, >> otherwise check for libftdi. >> So, unless I'm missing something this is ok; but that's true I forgot >> to mention this point in the commit log. :-/ > > So the patch should actually be: > > ifeq ($(BR2_PACKAGE_LIBFTDI1),y) > AVRDUDE_DEPENDENCIES += libftdi1 > else ifeq ($(BR2_PACKAGE_LIBFTDI),y) > AVRDUDE_DEPENDENCIES += libftdi > endif Well, my first thought was simply to drop the libftdi support because of the additional dependency it pulls (libusb-compat): - with dependency on libftdi: arvdude -> libftdi -> libusb-compat -> libusb - with dependency on libftdi1: arvdude -> libftdi1 -> libusb Note that, the configure script uses libftdi1 (if found) in priority over libftdi. > > Can you fix and resend? On it. > > Thanks, > > Thomas > -- > Thomas Petazzoni, CTO, Free Electrons > Embedded Linux, Kernel and Android engineering > http://free-electrons.com Regards, -- Samuel ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 3/4] package/avrdude: depends on libftdi1 instead of libftdi 2015-03-17 16:24 ` Samuel Martin @ 2015-03-17 16:48 ` Thomas Petazzoni 2015-03-17 17:25 ` Samuel Martin 0 siblings, 1 reply; 19+ messages in thread From: Thomas Petazzoni @ 2015-03-17 16:48 UTC (permalink / raw) To: buildroot Dear Samuel Martin, On Tue, 17 Mar 2015 17:24:07 +0100, Samuel Martin wrote: > Well, my first thought was simply to drop the libftdi support because > of the additional dependency it pulls (libusb-compat): > - with dependency on libftdi: > arvdude -> libftdi -> libusb-compat -> libusb > - with dependency on libftdi1: > arvdude -> libftdi1 -> libusb > > Note that, the configure script uses libftdi1 (if found) in priority > over libftdi. Yes, but what happens if the user has BR2_PACKAGE_AVRDUDE=y and BR2_PACKAGE_LIBFTDI=y ? Then with your patch, we have an "undefined behavior": if libftdi happens to be built before avrdude, avrdude will have libftdi support, otherwise not. Unless of course you propose a patch that allows to explicitly enable/disable libftdi support in avrdude. But otherwise, if avrdude *can* use libftdi, then it should have an optional dependency on it. Best regards, Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 3/4] package/avrdude: depends on libftdi1 instead of libftdi 2015-03-17 16:48 ` Thomas Petazzoni @ 2015-03-17 17:25 ` Samuel Martin 2015-03-17 20:06 ` Thomas Petazzoni 0 siblings, 1 reply; 19+ messages in thread From: Samuel Martin @ 2015-03-17 17:25 UTC (permalink / raw) To: buildroot On Tue, Mar 17, 2015 at 5:48 PM, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote: > Dear Samuel Martin, > > On Tue, 17 Mar 2015 17:24:07 +0100, Samuel Martin wrote: > >> Well, my first thought was simply to drop the libftdi support because >> of the additional dependency it pulls (libusb-compat): >> - with dependency on libftdi: >> arvdude -> libftdi -> libusb-compat -> libusb >> - with dependency on libftdi1: >> arvdude -> libftdi1 -> libusb >> >> Note that, the configure script uses libftdi1 (if found) in priority >> over libftdi. > > Yes, but what happens if the user has BR2_PACKAGE_AVRDUDE=y and > BR2_PACKAGE_LIBFTDI=y ? Then with your patch, we have an "undefined > behavior": if libftdi happens to be built before avrdude, avrdude will > have libftdi support, otherwise not. > > Unless of course you propose a patch that allows to explicitly > enable/disable libftdi support in avrdude. But otherwise, if avrdude > *can* use libftdi, then it should have an optional dependency on it. Nope, the behavior is not undefined: if libftdi gets built before arvdude, libftdi1 will also be built before avrdude (because it's one of its deps,), so the avrdude configure script will detect both but use libfti1 in priority over libftdi, see the arvdude confi summary: <snip> Configuration summary: ---------------------- DO HAVE libelf DO HAVE libusb DO HAVE libusb_1_0 DO HAVE libftdi1 DO HAVE libftdi (but prefer to use libftdi1) </snip> Regards, -- Samuel ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 3/4] package/avrdude: depends on libftdi1 instead of libftdi 2015-03-17 17:25 ` Samuel Martin @ 2015-03-17 20:06 ` Thomas Petazzoni 2015-03-17 20:21 ` Samuel Martin 0 siblings, 1 reply; 19+ messages in thread From: Thomas Petazzoni @ 2015-03-17 20:06 UTC (permalink / raw) To: buildroot Dear Samuel Martin, On Tue, 17 Mar 2015 18:25:52 +0100, Samuel Martin wrote: > Nope, the behavior is not undefined: if libftdi gets built before > arvdude, libftdi1 will also be built before avrdude (because it's one > of its deps,) Hum, I don't follow you here. I don't see where libftdi depends on libftdi1. What prevents from doing a configuration that has libftdi and avrdude enabled, and not libftdi1 ? Apparently nothing: $ grep -E "(LIBFTDI|LIBFTDI1|AVRDUDE)" .config BR2_PACKAGE_AVRDUDE=y BR2_PACKAGE_LIBFTDI=y # BR2_PACKAGE_LIBFTDI1 is not set Best regards, Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 3/4] package/avrdude: depends on libftdi1 instead of libftdi 2015-03-17 20:06 ` Thomas Petazzoni @ 2015-03-17 20:21 ` Samuel Martin 0 siblings, 0 replies; 19+ messages in thread From: Samuel Martin @ 2015-03-17 20:21 UTC (permalink / raw) To: buildroot Thomas, On Tue, Mar 17, 2015 at 9:06 PM, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote: > Dear Samuel Martin, > > On Tue, 17 Mar 2015 18:25:52 +0100, Samuel Martin wrote: > >> Nope, the behavior is not undefined: if libftdi gets built before >> arvdude, libftdi1 will also be built before avrdude (because it's one >> of its deps,) > > Hum, I don't follow you here. I don't see where libftdi depends on > libftdi1. doh! i think we are misunderstanding each others... :-| > > What prevents from doing a configuration that has libftdi and avrdude > enabled, and not libftdi1 ? nothing at all, this still is a legit config. > > Apparently nothing: > > $ grep -E "(LIBFTDI|LIBFTDI1|AVRDUDE)" .config > BR2_PACKAGE_AVRDUDE=y > BR2_PACKAGE_LIBFTDI=y > # BR2_PACKAGE_LIBFTDI1 is not set > > Best regards, > > Thomas > -- > Thomas Petazzoni, CTO, Free Electrons > Embedded Linux, Kernel and Android engineering > http://free-electrons.com Regards, -- Samuel ^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 4/4] package/openocd: depends on libftdi1 instead of libftdi 2015-03-08 11:26 [Buildroot] [PATCH v2 0/4] libftdi{0,1} related work Samuel Martin ` (2 preceding siblings ...) 2015-03-08 11:26 ` [Buildroot] [PATCH v2 3/4] package/avrdude: depends on libftdi1 instead of libftdi Samuel Martin @ 2015-03-08 11:26 ` Samuel Martin 2015-03-16 13:15 ` Thomas Petazzoni 3 siblings, 1 reply; 19+ messages in thread From: Samuel Martin @ 2015-03-08 11:26 UTC (permalink / raw) To: buildroot Signed-off-by: Samuel Martin <s.martin49@gmail.com> --- changes v1->v2: - rebase --- package/openocd/Config.in | 8 ++++---- package/openocd/openocd.mk | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/openocd/Config.in b/package/openocd/Config.in index 7c140c7..2db17fa 100644 --- a/package/openocd/Config.in +++ b/package/openocd/Config.in @@ -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 diff --git a/package/openocd/openocd.mk b/package/openocd/openocd.mk index fd7e09f..4023af8 100644 --- a/package/openocd/openocd.mk +++ b/package/openocd/openocd.mk @@ -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) -- 2.3.2 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Buildroot] [PATCH v2 4/4] package/openocd: depends on libftdi1 instead of libftdi 2015-03-08 11:26 ` [Buildroot] [PATCH v2 4/4] package/openocd: " Samuel Martin @ 2015-03-16 13:15 ` Thomas Petazzoni 0 siblings, 0 replies; 19+ messages in thread From: Thomas Petazzoni @ 2015-03-16 13:15 UTC (permalink / raw) To: buildroot Dear Samuel Martin, On Sun, 8 Mar 2015 12:26:04 +0100, Samuel Martin wrote: > OPENOCD_DEPENDENCIES = \ > - $(if $(BR2_PACKAGE_LIBFTDI),libftdi) \ > + $(if $(BR2_PACKAGE_LIBFTDI),libftdi1) \ Again, untested patch. This should be: $(if $(BR2_PACKAGE_LIBFTDI1),libftdi1) \ Please fix and resend. Thanks, Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com ^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2015-03-17 20:21 UTC | newest] Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-03-08 11:26 [Buildroot] [PATCH v2 0/4] libftdi{0,1} related work Samuel Martin 2015-03-08 11:26 ` [Buildroot] [PATCH v2 1/4] package/libftdi: bump to version 0.20 Samuel Martin 2015-03-16 9:19 ` Thomas Petazzoni 2015-03-08 11:26 ` [Buildroot] [PATCH v2 2/4] package/libftdi1: new package Samuel Martin 2015-03-09 8:33 ` Yegor Yefremov 2015-03-09 10:13 ` Yegor Yefremov 2015-03-09 11:22 ` Yegor Yefremov 2015-03-16 13:12 ` Thomas Petazzoni 2015-03-08 11:26 ` [Buildroot] [PATCH v2 3/4] package/avrdude: depends on libftdi1 instead of libftdi Samuel Martin 2015-03-08 11:48 ` Baruch Siach 2015-03-08 17:03 ` Samuel Martin 2015-03-16 13:15 ` Thomas Petazzoni 2015-03-17 16:24 ` Samuel Martin 2015-03-17 16:48 ` Thomas Petazzoni 2015-03-17 17:25 ` Samuel Martin 2015-03-17 20:06 ` Thomas Petazzoni 2015-03-17 20:21 ` Samuel Martin 2015-03-08 11:26 ` [Buildroot] [PATCH v2 4/4] package/openocd: " Samuel Martin 2015-03-16 13:15 ` Thomas Petazzoni
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.