summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-03-05 10:49:14 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-03-05 10:51:48 -0800
commita32df086f823099a5e0c00b20f0bb965fed5aa60 (patch)
tree540eb70dde02ad392419d8e5cddd160508de5784
parentd2076f6a990acc295f2e98bdc2c95649978e7b5f (diff)
downloadxorg-lib-libSM-a32df086f823099a5e0c00b20f0bb965fed5aa60.tar.gz
Add uuid as private dependency to sm.pc for static linking
If a uuid.pc file was found, add it to Requires.private. Otherwise, add $LIBUUID_LIBS to Libs.private. Fixes: #1 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--configure.ac14
-rw-r--r--sm.pc.in3
2 files changed, 15 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index af8b89e..3635d6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,14 +31,26 @@ XTRANS_CONNECTION_FLAGS
AC_ARG_WITH(libuuid, AS_HELP_STRING([--with-libuuid], [Build with libuuid support for client IDs]))
+PKG_PROG_PKG_CONFIG()
AC_CHECK_FUNCS([uuid_create], [], [
if test x"$with_libuuid" != xno && test x"$have_system_uuid" != xyes; then
PKG_CHECK_MODULES(LIBUUID, uuid, [HAVE_LIBUUID=yes], [HAVE_LIBUUID=no])
fi
if test x"$with_libuuid" = xyes && test x"$HAVE_LIBUUID" = xno; then
- AC_MSG_ERROR([requested libuuid support but uuid.pc not found])
+ AC_MSG_ERROR([requested libuuid support but uuid.pc not found
+ and LIBUUID_CFLAGS and LIBUUID_LIBS not set])
fi
])
+UUID_LIB_PRIVATE=""
+UUID_PC=""
+if test x"$HAVE_LIBUUID" = xyes ; then
+ PKG_CHECK_EXISTS(uuid, [UUID_PC="uuid"])
+ if test x"$UUID_PC" = x ; then
+ UUID_LIB_PRIVATE="$LIBUUID_LIBS"
+ fi
+fi
+AC_SUBST([UUID_LIB_PRIVATE])
+AC_SUBST([UUID_PC])
AM_CONDITIONAL(WITH_LIBUUID, test x"$HAVE_LIBUUID" = xyes)
diff --git a/sm.pc.in b/sm.pc.in
index 3c82387..d3cddc0 100644
--- a/sm.pc.in
+++ b/sm.pc.in
@@ -7,6 +7,7 @@ Name: SM
Description: X Session Management Library
Version: @PACKAGE_VERSION@
Requires:
-Requires.private: ice xproto
+Requires.private: ice xproto @UUID_PC@
Cflags: -I${includedir}
Libs: -L${libdir} -lSM
+Libs.private: @UUID_LIB_PRIVATE@