mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 12:58:08 +01:00
Do not stop compilation if library Xmu is not found
We use only 1 function from this library, and it is in a case that should be rare nowadays: displays with indexed color. This commit makes it acceptable to compile if the library is missing.
This commit is contained in:
committed by
Carlos R. Mafra
parent
4665972175
commit
e2cfed3377
10
NEWS
10
NEWS
@@ -12,6 +12,16 @@ which defaulted to ~/GNUstep. However, this environment variable was deprecated
|
||||
in gnustep-make v2. Therefore, it has been replaced by the WMAKER_USER_ROOT
|
||||
environment variable.
|
||||
|
||||
|
||||
libXmu is now an optional dependency
|
||||
------------------------------------
|
||||
|
||||
If the library is not found, compilation work, the only limitation will arise
|
||||
when trying to install the standard colormap on displays which are not TrueColor.
|
||||
Please note that if you have the library but not the headers, configure will
|
||||
still stop; there is no user option to explicitly disable the library use.
|
||||
|
||||
|
||||
-- 0.95.8
|
||||
|
||||
Move pointer with maximized windows
|
||||
|
||||
@@ -90,12 +90,11 @@ AC_DEFUN_ONCE([WM_EXT_CHECK_XMU],
|
||||
AS_IF([wm_fn_lib_try_link "XmuLookupStandardColormap" "-lXmu"],
|
||||
[wm_cv_xext_xmu="-lXmu"])
|
||||
LIBS="$wm_save_LIBS"
|
||||
AS_IF([test "x$wm_cv_xext_xmu" = "xno"],
|
||||
[AC_MSG_ERROR([library Xmu not found])])
|
||||
dnl
|
||||
dnl A library was found, check if header is available and compile
|
||||
wm_save_CFLAGS="$CFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([dnl
|
||||
AS_IF([test "x$wm_cv_xext_xmu" != "xno"],
|
||||
[dnl
|
||||
dnl A library was found, check if header is available and compile
|
||||
wm_save_CFLAGS="$CFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([dnl
|
||||
@%:@include <X11/Xlib.h>
|
||||
@%:@include <X11/Xutil.h>
|
||||
@%:@include <X11/Xmu/StdCmap.h>
|
||||
@@ -104,11 +103,18 @@ Display *dpy;
|
||||
Atom prop;
|
||||
], [dnl
|
||||
XmuLookupStandardColormap(dpy, 0, 0, 0, prop, False, True);]) ],
|
||||
[],
|
||||
[AC_MSG_ERROR([found $wm_cv_xext_xmu but cannot compile with the header])])
|
||||
CFLAGS="$wm_save_CFLAGS"])
|
||||
[],
|
||||
[AC_MSG_ERROR([found $wm_cv_xext_xmu but cannot compile with the header])])
|
||||
CFLAGS="$wm_save_CFLAGS"])
|
||||
])
|
||||
dnl The cached check already reported problems when not found
|
||||
LIBXMU="$wm_cv_xext_xmu"
|
||||
AS_IF([test "wm_cv_xext_xmu" = "xno"],
|
||||
[LIBXMU=""
|
||||
unsupported="$unsupported Xmu"],
|
||||
[AC_DEFINE([HAVE_LIBXMU], [1],
|
||||
[defined when the libXmu library was found])
|
||||
LIBXMU="$wm_cv_xext_xmu"
|
||||
supported_xext="$supported_xext Xmu"])
|
||||
AC_SUBST(LIBXMU)dnl
|
||||
])
|
||||
|
||||
|
||||
@@ -25,7 +25,10 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#ifdef HAVE_LIBXMU
|
||||
#include <X11/Xmu/StdCmap.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -137,6 +140,7 @@ static Bool allocateStandardPseudoColor(RContext * ctx, XStandardColormap * stdc
|
||||
|
||||
static Bool setupStandardColormap(RContext * ctx, Atom property)
|
||||
{
|
||||
#ifdef HAVE_LIBXMU
|
||||
if (!XmuLookupStandardColormap(ctx->dpy, ctx->screen_number,
|
||||
ctx->visual->visualid, ctx->depth, property, True, True)) {
|
||||
RErrorCode = RERR_STDCMAPFAIL;
|
||||
@@ -144,6 +148,12 @@ static Bool setupStandardColormap(RContext * ctx, Atom property)
|
||||
return False;
|
||||
}
|
||||
return True;
|
||||
#else
|
||||
(void) ctx;
|
||||
(void) property;
|
||||
RErrorCode = RERR_STDCMAPFAIL;
|
||||
return False;
|
||||
#endif
|
||||
}
|
||||
|
||||
static XColor *allocateColor(RContext *ctx, XColor *colors, int ncolors)
|
||||
|
||||
Reference in New Issue
Block a user