source: trunk/third/bonobo/macros/gnome-x-checks.m4 @ 15509

Revision 15509, 2.4 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r15508, which included commits to RCS files with non-trunk default branches.
Line 
1dnl GNOME_X_CHECKS
2dnl
3dnl Basic X11 related checks for X11.  At the end, the following will be
4dnl defined/changed:
5dnl   GTK_{CFLAGS,LIBS}      From AM_PATH_GTK
6dnl   CPPFLAGS               Will include $X_CFLAGS
7dnl   GNOME_HAVE_SM          `true' or `false' depending on whether session
8dnl                          management is available.  It is available if
9dnl                          both -lSM and X11/SM/SMlib.h exist.  (Some
10dnl                          Solaris boxes have the library but not the header)
11dnl   XPM_LIBS               -lXpm if Xpm library is present, otherwise ""
12dnl
13dnl The following configure cache variables are defined (but not used):
14dnl   gnome_cv_passdown_{x_libs,X_LIBS,X_CFLAGS}
15dnl
16AC_DEFUN([GNOME_X_CHECKS],
17[
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"
21        dnl
22        dnl Use CPPFLAGS instead of CFLAGS because AC_CHECK_HEADERS uses
23        dnl CPPFLAGS, not CFLAGS
24        CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
25
26        saved_ldflags="$LDFLAGS"
27        LDFLAGS="$LDFLAGS $GTK_LIBS"
28
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"
33
34        LDFLAGS="$saved_ldflags $GTK_LIBS"
35
36dnl We are requiring GTK >= 1.1.1, which means this will be fine anyhow.
37        USE_DEVGTK=true
38
39dnl     AC_MSG_CHECKING([whether to use features from (unstable) GTK+ 1.1.x])
40dnl     AC_EGREP_CPP(answer_affirmatively,
41dnl     [#include <gtk/gtkfeatures.h>
42dnl     #ifdef GTK_HAVE_FEATURES_1_1_0
43dnl        answer_affirmatively
44dnl     #endif
45dnl     ], dev_gtk=yes, dev_gtk=no)
46dnl     if test "$dev_gtk" = "yes"; then
47dnl        USE_DEVGTK=true
48dnl     fi
49dnl     AC_MSG_RESULT("$dev_gtk")
50
51        GNOME_HAVE_SM=true
52        case "$GTK_LIBS" in
53         *-lSM*)
54            dnl Already found it.
55            ;;
56         *)
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,
60                $x_libs -lICE)
61            ;;
62        esac
63
64        if test "$GNOME_HAVE_SM" = true; then
65           AC_CHECK_HEADERS(X11/SM/SMlib.h,,GNOME_HAVE_SM=false)
66        fi
67
68        if test "$GNOME_HAVE_SM" = true; then
69           AC_DEFINE(HAVE_LIBSM)
70        fi
71
72        XPM_LIBS=""
73        AC_CHECK_LIB(Xpm, XpmFreeXpmImage, [XPM_LIBS="-lXpm"], , $x_libs)
74        AC_SUBST(XPM_LIBS)
75
76        AC_REQUIRE([GNOME_PTHREAD_CHECK])
77        LDFLAGS="$saved_ldflags"
78
79        AC_PROVIDE([GNOME_X_CHECKS])
80])
Note: See TracBrowser for help on using the repository browser.