1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 04:20:27 +01:00

Configure: Added proper check for Xmu library for WRaster

The original code supposed that the library was available and ready to use.
As it may not be the case (modern distro generally don't include dev files
by defaults), add a the appropriate checks to make sure WRaster compilation
will not fail later.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2013-11-17 18:51:21 +01:00
committed by Carlos R. Mafra
parent b8b59d939d
commit c7f745c353
2 changed files with 43 additions and 2 deletions

View File

@@ -451,8 +451,6 @@ X_LIBRARY_PATH=$x_libraries
XCFLAGS="$X_CFLAGS"
XLFLAGS="$X_LIBS"
XLIBS="-lX11 $X_EXTRA_LIBS"
LIBXMU="-lXmu"
AC_SUBST(LIBXMU)
lib_search_path="$lib_search_path $XLFLAGS"
inc_search_path="$inc_search_path $XCFLAGS"
@@ -509,6 +507,11 @@ AC_ARG_ENABLE([shm],
[enable_shm=auto])
WM_XEXT_CHECK_XSHM
dnl X Misceleanous Utility
dnl ======================
# the libXmu is used in WRaster
WM_EXT_CHECK_XMU
dnl XINERAMA support
dnl ================
AC_ARG_ENABLE([xinerama],

View File

@@ -75,6 +75,44 @@ AC_DEFUN_ONCE([WM_XEXT_CHECK_XSHM],
]) dnl AC_DEFUN
# WM_XEXT_CHECK_XMU
# -----------------
#
# Check for the libXmu (X Misceleanous Utilities)
# When found, append it to LIBXMU
# When not found, generate an error because we have no work-around for it
AC_DEFUN_ONCE([WM_EXT_CHECK_XMU],
[AC_CACHE_CHECK([for Xmu library], [wm_cv_xext_xmu],
[wm_cv_xext_xmu=no
dnl
dnl We check that the library is available
wm_save_LIBS="$LIBS"
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
@%:@include <X11/Xlib.h>
@%:@include <X11/Xutil.h>
@%:@include <X11/Xmu/StdCmap.h>
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"])
dnl The cached check already reported problems when not found
LIBXMU="$wm_cv_xext_xmu"
AC_SUBST(LIBXMU)dnl
])
# WM_XEXT_CHECK_XINERAMA
# ----------------------
#