#
# This file is part of libgpiod.
#
-# Copyright (C) 2017-2018 Bartosz Golaszewski <bartekgola@gmail.com>
+# Copyright (C) 2017-2019 Bartosz Golaszewski <bartekgola@gmail.com>
#
ACLOCAL_AMFLAGS = -I m4
endif
+if WITH_TOOLS
+
+SUBDIRS += man
+
+endif
+
if HAS_DOXYGEN
doc:
#
# This file is part of libgpiod.
#
-# Copyright (C) 2017-2018 Bartosz Golaszewski <bartekgola@gmail.com>
+# Copyright (C) 2017-2019 Bartosz Golaszewski <bartekgola@gmail.com>
#
AC_PREREQ(2.61)
AC_MSG_NOTICE([doxygen not found - documentation cannot be generated])
fi
+if test "x$cross_compiling" = xno
+then
+ AC_CHECK_PROG([has_help2man], [help2man], [true], [false])
+ 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])
+ fi
+fi
+
AC_CONFIG_FILES([libgpiod.pc
Makefile
include/Makefile
bindings/cxx/Makefile
bindings/cxx/examples/Makefile
bindings/python/Makefile
- bindings/python/examples/Makefile])
+ bindings/python/examples/Makefile
+ man/Makefile])
AC_OUTPUT
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+#
+# This file is part of libgpiod.
+#
+# Copyright (C) 2019 Bartosz Golaszewski <bartekgola@gmail.com>
+#
+
+if WITH_MANPAGES
+
+dist_man1_MANS = gpiodetect.man gpioinfo.man gpioget.man gpioset.man gpiofind.man gpiomon.man
+
+%.man: $(top_srcdir)/src/tools/$(*F)
+ help2man $(top_srcdir)/src/tools/$(*F) --include=./template --output=./$@ --no-info
+
+clean-local:
+ rm -f $(dist_man1_MANS)
+
+endif
--- /dev/null
+[AUTHOR]
+Bartosz Golaszewski <bartekgola@gmail.com>
+
+[REPORTING BUGS]
+Report bugs to:
+ Bartosz Golaszewski <bartekgola@gmail.com>
+ linux-gpio <linux-gpio@vger.kernel.org>