@@ -19,11 +19,13 @@ build:
- autoconf-archive
# doxygen is available by default, but just in case.
- doxygen
+ - help2man
- gi-docgen
- gir1.2-glib-2.0-dev
- gobject-introspection
- graphviz
- libtool
+ - pandoc
- pkg-config
sphinx:
@@ -327,18 +327,6 @@ then
AC_MSG_ERROR([systemdsystemunitdir not found - needed to enable systemd support]))
fi
-AC_CHECK_PROG([has_doxygen], [doxygen], [true], [false])
-AC_CHECK_PROG([has_sphinx], [sphinx-build], [true], [false])
-AM_CONDITIONAL([WITH_DOCS], [test "x$has_doxygen" = xtrue && test "x$has_sphinx" = xtrue])
-if test "x$has_doxygen" = xfalse
-then
- AC_MSG_NOTICE([doxygen not found - documentation cannot be generated])
-fi
-if test "x$has_sphinx" = xfalse
-then
- AC_MSG_NOTICE([sphinx-build not found - documentation cannot be generated])
-fi
-
if test "x$cross_compiling" = xno
then
AC_CHECK_PROG([has_help2man], [help2man], [true], [false])
@@ -346,7 +334,25 @@ fi
AM_CONDITIONAL([WITH_MANPAGES], [test "x$has_help2man" = xtrue])
if test "x$has_help2man" = xfalse
then
- AC_MSG_NOTICE([help2man not found - man pages cannot be generated automatically])
+ AC_MSG_NOTICE([help2man not found - man pages and documentation cannot be generated])
+fi
+
+AC_DEFUN([DOC_PROG_NOT_FOUND], [AC_MSG_NOTICE([$1 not found - documentation cannot be generated])])
+AC_CHECK_PROG([has_doxygen], [doxygen], [true], [false])
+AC_CHECK_PROG([has_sphinx], [sphinx-build], [true], [false])
+AC_CHECK_PROG([has_pandoc], [pandoc], [true], [false])
+AM_CONDITIONAL([WITH_DOCS], [test "x$has_doxygen" = xtrue && test "x$has_sphinx" = xtrue && test "x$has_pandoc" = xtrue && test "x$has_help2man" = xtrue])
+if test "x$has_doxygen" = xfalse
+then
+ DOC_PROG_NOT_FOUND(["doxygen"])
+fi
+if test "x$has_sphinx" = xfalse
+then
+ DOC_PROG_NOT_FOUND(["sphinx-build"])
+fi
+if test "x$has_pandoc" = xfalse
+then
+ DOC_PROG_NOT_FOUND(["pandoc"])
fi
AC_CONFIG_FILES([Makefile
@@ -3,3 +3,11 @@
doxygen-output
sphinx-output
+
+# Automatically generated .rst
+gpiodetect.rst
+gpioinfo.rst
+gpioget.rst
+gpioset.rst
+gpiomon.rst
+gpionotify.rst
@@ -33,6 +33,7 @@ DOCS_DEPS = \
Doxyfile \
index.rst \
glib_api.rst \
+ gpio_tools.rst \
python_api.rst \
python_chip_info.rst \
python_chip.rst \
@@ -100,8 +100,30 @@ subprocess.run(
"--enable-tools",
"--enable-bindings-glib",
"--enable-introspection",
+ "--enable-tools",
],
check=True,
)
subprocess.run(["make", "-j"], check=True)
os.chdir(cwd)
+
+for page in [
+ "gpiodetect",
+ "gpioinfo",
+ "gpioget",
+ "gpioset",
+ "gpiomon",
+ "gpionotify",
+]:
+ subprocess.run(
+ [
+ "pandoc",
+ "--from=man",
+ "--to=rst",
+ "--standalone",
+ "--wrap=none",
+ f"--output={page}.rst",
+ f"../man/{page}.man",
+ ],
+ check=True,
+ )
new file mode 100644
@@ -0,0 +1,25 @@
+..
+ SPDX-License-Identifier: CC-BY-SA-4.0
+ SPDX-FileCopyrightText: 2025 Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+
+..
+ This file is part of libgpiod.
+
+ GPIO tools documentation
+
+Command-line tools
+==================
+
+The **libgpiod** project includes a suite of **command-line tools** to
+facilitate GPIO manipulation from console and shell scripts.
+
+.. toctree::
+ :maxdepth: 1
+ :caption: Manual entries
+
+ gpiodetect<gpiodetect>
+ gpioinfo<gpioinfo>
+ gpioget<gpioget>
+ gpioset<gpioset>
+ gpiomon<gpiomon>
+ gpionotify<gpionotify>
@@ -26,3 +26,4 @@ this interface.
core_api
bindings
+ gpio_tools