diff options
author | Helmut Grohne <helmut@subdivi.de> | 2021-02-15 14:33:05 +0000 |
---|---|---|
committer | Chris Hofstaedtler <zeha@debian.org> | 2021-02-15 14:33:05 +0000 |
commit | e7f7032dad76d31ee3c9a8c807b7d71d314830ed (patch) | |
tree | acc81d0d2b40b6cc937d74941eca063bf40bdc3b /iscsiuio | |
parent | 0068fd9bea9939866735038bf8dac0c878ede867 (diff) | |
download | open-iscsi-e7f7032dad76d31ee3c9a8c807b7d71d314830ed.tar.gz |
Avoid hardcoding pkg-config to fix cross build
Debian Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=982307
Diffstat (limited to 'iscsiuio')
-rw-r--r-- | iscsiuio/configure.ac | 17 |
1 files 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 |