From e7f7032dad76d31ee3c9a8c807b7d71d314830ed Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Mon, 15 Feb 2021 14:33:05 +0000 Subject: Avoid hardcoding pkg-config to fix cross build Debian Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=982307 --- iscsiuio/configure.ac | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/iscsiuio/configure.ac b/iscsiuio/configure.ac index 8099f09..9b85448 100644 --- a/iscsiuio/configure.ac +++ b/iscsiuio/configure.ac @@ -67,10 +67,21 @@ AM_CONDITIONAL([DEBUG], [test x$debug = xtrue]) AC_ARG_WITH([systemd], AS_HELP_STRING([--without-systemd], [Build without systemd]), [case "${withval}" in - yes) LDFLAGS="`pkg-config --libs libsystemd`" ;; - no) CFLAGS="${CFLAGS} -DNO_SYSTEMD" ;; + yes) with_libsystemd=yes ;; + no) wth_libsystemd=no ;; *) AC_MSG_ERROR([bad value $withval for --with-systemd]) ;; - esac],[LDFLAGS="`pkg-config --libs libsystemd`"]) + esac],[with_libsystemd=auto]) +AS_IF([test "$with_libsystemd" != no],[ + PKG_CHECK_MODULES([LIBSYSTEMD],[libsystemd],[LDFLAGS=$LIBSYSTEMD_LIBS],[ + if test "$with_libsystemd" = yes; then + AC_MSG_ERROR([could not find libsystemd using pkg-config]) + else + CFLAGS="${CFLAGS} -DNO_SYSTEMD" + fi + ]) +],[ + CFLAGS="${CFLAGS} -DNO_SYSTEMD" +]) AC_CONFIG_COMMANDS([default],[[ if [ -n "$SOURCE_DATE_EPOCH" ] ; then -- cgit v1.2.1