diff options
author | Lee Duncan <lduncan@suse.com> | 2021-02-17 11:00:14 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-17 11:00:14 -0800 |
commit | 0c0641401faae89e014ad06e4c175fd37bfc7b45 (patch) | |
tree | acc81d0d2b40b6cc937d74941eca063bf40bdc3b | |
parent | 0068fd9bea9939866735038bf8dac0c878ede867 (diff) | |
parent | e7f7032dad76d31ee3c9a8c807b7d71d314830ed (diff) | |
download | open-iscsi-0c0641401faae89e014ad06e4c175fd37bfc7b45.tar.gz |
Merge pull request #250 from zeha/cross
Avoid hardcoding pkg-config to fix cross build
-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 |