1
0
mirror of https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git synced 2026-10-24 00:48:53 +03:00
Commit Graph

45 Commits

Author SHA1 Message Date
Bartosz Golaszewski
4caa127fe5 build: drop the LGPL-3.0 license file from EXTRA_DIST
The release tarball building is currently broken because it looks for
a file that no longer exists. Drop the LGPL-3.0 license file from
EXTRA_DIST.

Fixes: 76ecc337c5 ("licensing: relicense C++ bindings under LGPL-2.1-or-later")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2024-05-13 11:25:31 +02:00
Kent Gibson
220281b46f examples: add dedicated examples
The tools have served as example code, but have become too complicated
to serve that purpose.

Add a set of examples that have no purpose other than providing minimal
examples of common use cases.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2023-06-14 14:54:25 +02:00
Bartosz Golaszewski
7251691618 build: drop a reference to libgpiomockup from a comment in Makefile
We no longer use libgpiomockup. Replace the reference to it with
libgpiosim.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2023-06-06 12:14:57 +02:00
Bartosz Golaszewski
9595913c8f build: use AM_V_GEN when calling external programs
In order to output a status line in silent mode and the whole command in
default mode, use the AM_V_GEN predefined automake variable when executing
external programs like doxygen and help2man.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2023-03-27 12:09:34 +02:00
Benjamin Li
1dd855ae6b contrib: add sample Android.bp to build within an Android tree
Add an Android.bp file for Soong, the Android build system, to build
the library including C++ bindings along with all the CLI tools.

This reference Android build file will live in a contrib/ folder to
indiciate it is a less-maintained part of libgpiod. It will need to
be moved to the root directory in order to use it, though, as Soong
doesn't let Blueprint files reference sources in a parent directory.

  error: external/libgpiod/contrib/Android.bp:5:1: module "libgpiod" variant "...": Path is outside directory: ../include
  error: external/libgpiod/contrib/Android.bp:5:1: module "libgpiod" variant "...": Path is outside directory: ../bindings/cxx
  error: external/libgpiod/contrib/Android.bp:5:1: module "libgpiod" variant "...": Path is outside directory: ../lib/*.c
  error: external/libgpiod/contrib/Android.bp:5:1: module "libgpiod" variant "...": Path is outside directory: ../bindings/cxx/*.cpp

Signed-off-by: Benjamin Li <benl@squareup.com>
[Bartosz: add the build file to the release tarball generated by 'make dist']
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2023-03-12 14:37:39 +01:00
Bartosz Golaszewski
67bb2c9012 bindings: rust: make reuse happy
Add missing license text files and use the CC0-1.0 license for the
rust-specific .gitignore file.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
2022-12-07 09:54:05 +01:00
Bartosz Golaszewski
ea84f882d5 licensing: relicense C++ library code under LGPL-3.0-or-later
Using LGPL-2.1 for C++ library code is an issue raised several times on
the linux-gpio mailing list. Programs using C++ libraries often include
significant portions of code generated behind the scenes from C++ headers
(via templates, default implementations etc.).

Section 3 of LGPL-3.0 clarifies the use of code defined in or generated
from C++ headers so this changset proposes to use LGPL-3.0 for all C++
library code in libgpiod.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Kent Gibson <warthog618@gmail.com>
2021-02-18 17:42:16 +01:00
Bartosz Golaszewski
154e7c5a82 licensing: relicense non-library code under GPL-2.0-or-later
LGPL-2.1 is a license meant for shared libraries. Because I didn't know
any better I used it for all files in the repository, including programs
linking against libgpiod. The standard approach for many similar projects
is to use LGPL for library code and GPL for programs (and also Makefiles
and other files containing code or configuration).

Relicense all programs, tests, makefiles and autotools files under
GPL-2.0 or later.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Kent Gibson <warthog618@gmail.com>
2021-02-18 17:42:12 +01:00
Bartosz Golaszewski
dfb707c255 licensing: make the project REUSE-compliant
In order to make the licensing situation of libgpiod clear and enable
easy reusing of the code, let's make all the files in the repository
compliant with the REUSE v3.0 specification.

In order to achieve that:
  - put all used licenses into a separate LICENSES/ directory
  - add SPDX license identifiers to all files that were missing them with
    regular text files being licensed under CC-BY-SA-4.0, while files
    containing code and configuration are licensed under GPL-2.0-or-later
  - replace custom copyright texts with SPDX-FileCopyrightText
  - update the gpio.h kernel uAPI header with the upstream version where
    the SDPX license identifier was fixed to use 'GPL-2.0-only' variant
    instead of the deprecated 'GPL-2.0'

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Kent Gibson <warthog618@gmail.com>
2021-02-18 17:42:08 +01:00
Alexander Stein
e3f449c617 doc: use autotoolized Doxyfile
This has several advantages:
* More simplified Makefile.am
* Actually used doxygen config is available as a file
* Building doc out-of-tree is possible

Signed-off-by: Alexander Stein <alexander.stein@mailbox.org>
[Bartosz: add a dependency on Doxygen to the doc target in Makefile]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2020-08-13 20:41:04 +02:00
Bartosz Golaszewski
e79194cf91 build: move libgpiod.pc.in into lib/
This file is specific to the core library. Move it into the lib/ source
directory.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-08-19 11:52:22 +02:00
Bartosz Golaszewski
99d38a56e5 bindings: cxx: use catch2 to implement a proper test-suite
Currently the only tests we have for C++ bindings are in a simple
program that makes a lot of assumptions about the environment and
doesn't even work anymore with recent kernels.

Remove it and replace it with a proper test-suite implemented using
libgpiomockup and Catch2.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-08-07 11:28:34 +02:00
Bartosz Golaszewski
8159d9b540 treewide: rearrange source directories
The src directory containing lib and tools is not necessary and will
actually cause problems if we tried to add a new component to src/
which would depend on libraries from the bindings directory because it
(bindings) already depends on src/lib.

Simplify the directory structure. Move lib and tools to the root source
directory and update all relevant files. That way we can specify the
exact build order of components from the top source Makefile.am.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-03-07 13:49:00 +01:00
Bartosz Golaszewski
6cbc2e5755 doc: add automatically generated man pages for gpio-tools
Extend the build files to automatically generate man pages for
gpio-tools using help2man if it's present in the system and we're not
cross-compiling (as the built programs must be executable for help2man
to work).

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-02-18 14:27:16 +01:00
Bartosz Golaszewski
03a2a19b85 doc: delete generated files on make clean
Delete the entire doc directory when running make clean.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
2019-02-18 14:20:32 +01:00
Bartosz Golaszewski
4fcb25ca3b build: user SPDX license identifier
Use the SPDX license identifier for LGPLv2.1 or later in the remaining
build and helper files.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2018-03-04 12:12:56 +01:00
Bartosz Golaszewski
8078a4a2ad bindings: implement C++ bindings
Wrap the C API in a set of C++ classes which allow to use all libgpiod
functionalities in an object-oriented manner.

Include simplified reimplementations of gpio-tools and a set of
tests/examples showing how to use the C++ interface.

The C++ API is fully documented in doxygen.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2018-02-19 09:45:45 +01:00
Bartosz Golaszewski
3b41916bdc dist: include Doxyfile in the release tarball
Doxyfile was missing from release tarballs. Include it.

Reported-by: SZ Lin <sz.lin@moxa.com>
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2018-02-08 18:25:58 +01:00
Clemens Gruber
819e2f5ee3 build: add pkg-config support
Create a libgpiod.pc file for pkg-config. Allows to use
PKG_CHECK_MODULES([gpiod], [libgpiod >= 1.0],,) in other
autoconf-based projects.

Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2018-01-23 11:12:29 +01:00
Bartosz Golaszewski
0704bcdbbf all: update the copyright notice
All these files have been updated in 2018.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2018-01-13 23:16:31 +01:00
Bartosz Golaszewski
7df216bf4d all: modify the license preamble in files
This project contains both a library and executables so it's better to
use an umbrella term "This program ..." than "This library ..." in all
the source files.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2018-01-10 01:50:36 +01:00
SZ Lin
7d61309458 all: make license type consistent between source files and COPYING file
The license type of COPYING file is "LGPL-2.1+", but it is declared
as "LGPL-2.1" in the preamble of source files.

This patch fixes license type inconsistency issue in each source file.

Signed-off-by: SZ Lin <sz.lin@moxa.com>
[Bartosz: tweaked the commit message]
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-12-01 18:43:54 +01:00
Thierry Reding
ce029942c0 build: store m4 files in an `m4' subdirectory
This is similar to the AUX directory that the autotools use to put
their files into, except that the `m4' directory will contain
autoconf macro files.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-03-08 14:51:17 +01:00
Bartosz Golaszewski
8ff90454fc tests: add a simple unit testing framework and a couple tests
Implement a simple unit testing framework working together with the
gpio-mockup module present in the mainline linux kernel.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-02-17 14:40:43 +01:00
Bartosz Golaszewski
f3f6982d1f libgpiod: relicense under LGPLv2.1
The library is much less useful under GPLv3 - change the license
to the more permissive LGPLv2.1 for the entire project.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-01-29 21:37:22 +01:00
Bartosz Golaszewski
c87228df5b build: don't try to process docs if doxygen is not installed
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-18 15:25:00 +01:00
Bartosz Golaszewski
03ee658849 doc: pass the EXTRA_VERSION to doxygen as well
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-16 11:43:18 +01:00
Bartosz Golaszewski
149d252f61 configure: don't use the m4 directory
This fixes the buildroot build.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-15 19:01:27 +01:00
Bartosz Golaszewski
06cb40722a build: create an organized directory structure
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-15 18:48:18 +01:00
Bartosz Golaszewski
a3c12f997e doc: doxygen: set the project version from Makefile
Drop the PROJECT_NUMBER option from the Doxyfile and pass the version
to doxygen via command-line when invoking it from Makefile.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-14 18:53:01 +01:00
Bartosz Golaszewski
5200b6b3da build: drop redundant version variables
Just use the variable defined by AC_INIT().

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-14 18:32:22 +01:00
Bartosz Golaszewski
0ffe021d5e build: drop the aclocal flags
We don't use the m4 local directory for now.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-13 17:52:16 +01:00
Bartosz Golaszewski
fb6cd1007f build: add a configure option for tools
This allows to build the tools conditionally, depending
on the configuration.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-13 17:41:53 +01:00
Bartosz Golaszewski
7301730068 build: add library versioning
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-13 14:59:11 +01:00
Bartosz Golaszewski
d7cbba2371 make: readability tweaks
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-13 14:49:30 +01:00
Bartosz Golaszewski
9eaab68902 make: compile the library with debug symbols
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-12 12:52:38 +01:00
Bartosz Golaszewski
d184d41670 tools-common: new source file
Introduce a .c file containing code that is common across all GPIO
tools but not really related to the libgpiod functionality. This file
is statically linked with every executable.

While we're at it - make gpiodetect use it right away.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-06 15:14:36 +01:00
Bartosz Golaszewski
cee0b5616e gpiofind: new tool
Add a simple program for finding the gpiochip and offset of a GPIO
line by name.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-06 14:34:55 +01:00
Bartosz Golaszewski
4048a08a96 gpiomon: fix Makefile.am
Add gpiomon to the list of programs to build.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-05 16:11:08 +01:00
Bartosz Golaszewski
152a26d34d gpiomon: new tool
Implement a simple GPIO event monitor.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-05 15:22:41 +01:00
Bartosz Golaszewski
22247d609b build: install headers too
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-05 10:27:31 +01:00
Bartosz Golaszewski
65cc3e18ab build: add dependencies to Makefile.am
This fixes the build with multiple make jobs.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-03 11:22:44 +01:00
Bartosz Golaszewski
ad4b8fabf4 documentation: add Doxyfile
Add doxygen configuration and a new target to Makefile.am to generate
documentation. Also: update gitignore.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-02 13:38:07 +01:00
Bartosz Golaszewski
97c4b6d750 build: define _GNU_SOURCE for .c files
This is needed for asprintf().

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-02 13:35:36 +01:00
Bartosz Golaszewski
797d9864db build: add autotools configuration
This allows to build the library and programs using autotools.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
2017-01-02 11:29:13 +01:00