From: Christophe CURIS Date: Sun, 17 Nov 2013 17:51:21 +0000 (+0100) Subject: Configure: Added proper check for Xmu library for WRaster X-Git-Tag: wmaker-0.95.6~305 X-Git-Url: https://repo.or.cz/w/wmaker-crm.git/commitdiff_plain/c7f745c353f181eb052788e9ebc206ba9d69a68b 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 --- diff --git a/configure.ac b/configure.ac index 2f1fc71c..3224f6a7 100644 --- a/configure.ac +++ b/configure.ac @@ -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], diff --git a/m4/wm_xext_check.m4 b/m4/wm_xext_check.m4 index f5b44f3b..51da16f4 100644 --- a/m4/wm_xext_check.m4 +++ b/m4/wm_xext_check.m4 @@ -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 +@%:@include +@%:@include + +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 # ---------------------- #