3 dnl Basic X11 related checks for X11. At the end, the following will be
5 dnl GTK_{CFLAGS,LIBS} From AM_PATH_GTK
6 dnl CPPFLAGS Will include $X_CFLAGS
7 dnl GNOME_HAVE_SM `true' or `false' depending on whether session
8 dnl management is available. It is available if
9 dnl both -lSM and X11/SM/SMlib.h exist. (Some
10 dnl Solaris boxes have the library but not the header)
11 dnl XPM_LIBS -lXpm if Xpm library is present, otherwise ""
13 dnl The following configure cache variables are defined (but not used):
14 dnl gnome_cv_passdown_{x_libs,X_LIBS,X_CFLAGS}
16 AC_DEFUN([GNOME_X_CHECKS],
18 AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(GTK not installed, or gtk-config not in path))
19 dnl Hope that GTK_CFLAGS have only -I and -D. Otherwise, we could
20 dnl test -z "$x_includes" || CPPFLAGS="$CPPFLAGS -I$x_includes"
22 dnl Use CPPFLAGS instead of CFLAGS because AC_CHECK_HEADERS uses
23 dnl CPPFLAGS, not CFLAGS
24 CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
26 saved_ldflags="$LDFLAGS"
27 LDFLAGS="$LDFLAGS $GTK_LIBS"
29 gnome_cv_passdown_x_libs="$GTK_LIBS"
30 gnome_cv_passdown_X_LIBS="$GTK_LIBS"
31 gnome_cv_passdown_X_CFLAGS="$GTK_CFLAGS"
32 gnome_cv_passdown_GTK_LIBS="$GTK_LIBS"
34 LDFLAGS="$saved_ldflags $GTK_LIBS"
36 dnl We are requiring GTK >= 1.1.1, which means this will be fine anyhow.
39 dnl AC_MSG_CHECKING([whether to use features from (unstable) GTK+ 1.1.x])
40 dnl AC_EGREP_CPP(answer_affirmatively,
41 dnl [#include <gtk/gtkfeatures.h>
42 dnl #ifdef GTK_HAVE_FEATURES_1_1_0
43 dnl answer_affirmatively
45 dnl ], dev_gtk=yes, dev_gtk=no)
46 dnl if test "$dev_gtk" = "yes"; then
49 dnl AC_MSG_RESULT("$dev_gtk")
57 dnl Assume that if we have -lSM then we also have -lICE.
58 AC_CHECK_LIB(SM, SmcSaveYourselfDone,
59 [GTK_LIBS="-lSM -lICE $GTK_LIBS"],GNOME_HAVE_SM=false,
64 if test "$GNOME_HAVE_SM" = true; then
65 AC_CHECK_HEADERS(X11/SM/SMlib.h,,GNOME_HAVE_SM=false)
68 if test "$GNOME_HAVE_SM" = true; then
73 AC_CHECK_LIB(Xpm, XpmFreeXpmImage, [XPM_LIBS="-lXpm"], , $x_libs)
76 AC_REQUIRE([GNOME_PTHREAD_CHECK])
77 LDFLAGS="$saved_ldflags"
79 AC_PROVIDE([GNOME_X_CHECKS])