Use pkg-config to check for X11 libraries

As a side effect, we stop checking for pangox, which
gnome-session doesn't use and which is deprecated
upstream.

https://bugzilla.gnome.org/show_bug.cgi?id=694792
parent 3864e7b0
......@@ -75,6 +75,7 @@ PKG_CHECK_MODULES(SESSION_PROPERTIES,
gtk+-3.0 >= $GTK3_REQUIRED
)
PKG_CHECK_MODULES(X11, x11)
PKG_CHECK_MODULES(SM, sm)
PKG_CHECK_MODULES(ICE, ice)
PKG_CHECK_MODULES(XEXT, xext xau)
......@@ -144,44 +145,6 @@ AC_SUBST(SYSTEMD_LIBS)
AM_CONDITIONAL(HAVE_SYSTEMD, [test "$enable_systemd" = "yes"], [Using systemd])
dnl ====================================================================
dnl X development libraries check
dnl ====================================================================
# If Pango included the shared library dependencies from X11 in
# the pkg-config output, then we use that (to avoid duplicates).
# but if they were omitted to avoid binary compatibility problems
# then we need to repeat the checks.
if $PKG_CONFIG --exists pangoxft ; then
PANGO_PACKAGES="pangox pangoxft"
else
PANGO_PACKAGES="pangox"
fi
x_libs="`$PKG_CONFIG --libs $PANGO_PACKAGES`"
case x_libs in
*-lX11*) pango_omitted_x_deps=no ;;
*) pango_omitted_x_deps=yes ;;
esac
if test $pango_omitted_x_deps = yes ; then
AC_PATH_XTRA
if test x$no_x = xyes ; then
AC_MSG_ERROR([X development libraries not found])
else
X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
fi
fi
AC_CHECK_LIB(Xau, XauFileName, [X_LIBS="$X_LIBS -lXau"],
[AC_MSG_ERROR([
*** Can't find the Xauth library. It is needed to compile gnome-session.])],
$X_LIBS)
AC_SUBST(X_LIBS)
dnl ====================================================================
dnl Check for XSync extension
dnl ====================================================================
......
......@@ -67,6 +67,7 @@ gnome_session_SOURCES = \
gnome_session_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(X11_CFLAGS) \
$(SM_CFLAGS) \
$(ICE_CFLAGS) \
$(XEXT_CFLAGS) \
......@@ -83,6 +84,7 @@ gnome_session_CPPFLAGS = \
gnome_session_LDADD = \
libgsmutil.la \
$(X11_LIBS) \
$(SM_LIBS) \
$(ICE_LIBS) \
$(XRENDER_LIBS) \
......
......@@ -50,7 +50,7 @@ gnome_session_check_accelerated_helper_CPPFLAGS = \
gnome_session_check_accelerated_helper_LDADD = \
$(GL_TEST_LIBS) \
$(X_LIBS)
$(X11_LIBS)
gnome_session_check_accelerated_SOURCES = \
gnome-session-check-accelerated.c
......@@ -62,7 +62,7 @@ gnome_session_check_accelerated_CPPFLAGS = \
gnome_session_check_accelerated_LDADD = \
$(GTK3_LIBS) \
$(X_LIBS)
$(X11_LIBS)
if BUILD_SESSION_SELECTOR
gnome_session_selector_CPPFLAGS = \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment