Skip to content

Commit 7e7cec2

Browse files
authored
Merge pull request #2883 from havardAasen/gpiod
Restrict libgpiod to < 2.0.0 when configuring
2 parents 6e0ed87 + 96f8e50 commit 7e7cec2

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/.tmp_versions
44
/Makefile.inc
55
/Makefile.modinc
6+
/aclocal.m4
67
/config.guess
78
/config.h
89
/config.log

src/autogen.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ case :$AUTOGEN_TARGET: in
88
[ -e config.guess ] || cp $automake_libdir/config.guess .
99
[ -e config.sub ] || cp $automake_libdir/config.sub .
1010
[ -e install-sh ] || cp $automake_libdir/install-sh .
11+
aclocal --force
1112
autoconf
1213
# autoconf only updates the timestamp if the output actually changed.
1314
# The target's timestamp must be updated or make is confused

src/configure.ac

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ AC_PATH_PROG(EGREP, egrep)
8080
#
8181
# check for pkg-config
8282
#
83-
AC_PATH_PROG([PKG_CONFIG], [pkg-config])
83+
PKG_PROG_PKG_CONFIG
8484
if test -z "$PKG_CONFIG"; then
8585
AC_MSG_ERROR([pkg-config is required to build LinuxCNC])
8686
fi
@@ -533,11 +533,12 @@ install with "sudo apt-get install libusb-1.0-0-dev" or disable with
533533
#
534534
# check for libgpiod
535535
#
536-
AC_MSG_CHECKING([for libgpiod])
537-
AC_CHECK_LIB(gpiod, main,
536+
PKG_CHECK_MODULES([LIBGPIOD], [libgpiod < 2.0.0],
538537
[AC_DEFINE_UNQUOTED([LIBGPIOD_VER], `pkg-config libgpiod --modversion | awk -F. '{print ($1 * 100)+($2) }'`,
539538
[libgpiod version, undefined if not present])
540-
LDFLAGS="$LDFLAGS -lgpiod"
539+
LDFLAGS="$LDFLAGS $LIBGPIOD_LIBS"
540+
LIBGPIOD_VERSION=`pkg-config libgpiod --modversion`
541+
AC_MSG_NOTICE([libgpiod version $LIBGPIOD_VERSION found])
541542
AC_SUBST([LIBGPIOD_VER], `pkg-config libgpiod --modversion | awk -F. '{print ($1 * 100)+($2) }'`)],
542543
[AC_MSG_WARN([Could not find libgpiod, not building hal_gpio])])
543544

0 commit comments

Comments
 (0)