This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.
The branch, next has been updated
discards 486b5aa448355be55a7d2784f1a75486882c58b9 (commit)
discards 30a71b31c579cedcc17bd35287ec8e9b1c3db29d (commit)
discards 550ef008b17e6824b9b577c86d90ec365c4f8992 (commit)
discards ea590e604d2172ae71fa8723851f2633b05f4593 (commit)
discards 1a832c02ba66b17081e7077e9774965c5c34130d (commit)
discards a66731775876055cd266a95cd45d7ee8c869a933 (commit)
discards 5f516163c8d0f8001a3d9d8207cb6ad68b973005 (commit)
discards b1091a9329ceec6a1a76c2bf2d66e40484be997b (commit)
discards d1598ff95e76c8ceb8a241ebad34a0910921b9b5 (commit)
discards 03413b02456c37787b1554c8c2e4736b9910c05e (commit)
via 0ca19f44e64337ef033d3d3487c16cc402ea478d (commit)
via f9f9253f9c2f01c10b4c855ef04ce9c7c638f4f4 (commit)
via 4ece935f9d19efa78ff7b7774a8f0fd9ead08cbb (commit)
via 41775431251e260b4781e3bc14b1f399e40663b4 (commit)
via 736449a78910cfd9f35b62d4f07d09425e77c9bc (commit)
via 185b7af993eef404072f98f3632d92f5c8fe7a2d (commit)
via d4a249c142417fb1a04af9528286ab62a9340442 (commit)
via 2b49cd88a75048d85966e02f47157cfc4e5e2428 (commit)
via a2177013c80aa36a402e349230557e06b97bd4c6 (commit)
via 64ee8eb85261b97279b7aa59029a7e4a6806bf18 (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (486b5aa448355be55a7d2784f1a75486882c58b9)
N -- N -- N (0ca19f44e64337ef033d3d3487c16cc402ea478d)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/0ca19f44e64337ef033d3d3487c16cc402ea478d
commit 0ca19f44e64337ef033d3d3487c16cc402ea478d
Author: Christophe CURIS <[email protected]>
Date: Sun Nov 17 18:51:21 2013 +0100
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 <[email protected]>
diff --git a/configure.ac b/configure.ac
index 2f1fc71..3224f6a 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 f5b44f3..51da16f 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 <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
# ----------------------
#
http://repo.or.cz/w/wmaker-crm.git/commit/f9f9253f9c2f01c10b4c855ef04ce9c7c638f4f4
commit f9f9253f9c2f01c10b4c855ef04ce9c7c638f4f4
Author: Christophe CURIS <[email protected]>
Date: Sun Nov 17 18:51:20 2013 +0100
Configure: Moved configure's detection of XShm to a dedicated macro
The original check was not compliant with autoconf's syntax, did not have
a very good behaviour for user and was not easy to make evolve.
The new macro:
- uses as much as possible autoconf macros for portability and code
consistency;
- checks also for header usability with the compiler;
- provides a consistent behaviour on yes/no/auto (if user explicitly
enables support, do not silently disable if not found; if library is found
but not the header, complain to let user install it or explicitly disable
support)
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/configure.ac b/configure.ac
index 7259774..2f1fc71 100644
--- a/configure.ac
+++ b/configure.ac
@@ -499,6 +499,16 @@ AC_ARG_ENABLE([shape],
[enable_shape=auto])
WM_XEXT_CHECK_XSHAPE
+dnl MIT-SHM support
+dnl ===============
+AC_ARG_ENABLE([shm],
+ [AS_HELP_STRING([--disable-shm], [disable usage of MIT-SHM extension])],
+ [AS_CASE(["$enableval"],
+ [yes|no], [],
+ [AC_MSG_ERROR([bad value $enableval for --enable-shm]) ]) ],
+ [enable_shm=auto])
+WM_XEXT_CHECK_XSHM
+
dnl XINERAMA support
dnl ================
AC_ARG_ENABLE([xinerama],
@@ -587,28 +597,6 @@ AC_SUBST(XFTFLAGS)
AC_SUBST(XFTLIBS)
-dnl MIT-SHM support
-dnl ===============
-shm=yes
-AC_ARG_ENABLE(shm, AS_HELP_STRING([--disable-shm], [disable usage of MIT-SHM
extension]),
- shm=$enableval, shm=yes)
-
-if test "$shm" = yes; then
- AC_CHECK_LIB(Xext, XShmAttach, ok=yes, ok=no, $XLFLAGS $XLIBS)
-
- if test "$ok" = yes; then
- AC_CHECK_FUNC(shmget, ok=yes, ok=no)
- fi
-
- if test "$ok" = yes; then
- if test "$added_xext" = no; then
- XLIBS="-lXext $XLIBS"
- fi
- AC_DEFINE(USE_XSHM, 1, [define if X's shared memory extension
is available (set by configure)])
- fi
-fi
-
-
dnl ==============================================
dnl Graphic Format Libraries
dnl ==============================================
diff --git a/m4/wm_xext_check.m4 b/m4/wm_xext_check.m4
index a8c45f4..f5b44f3 100644
--- a/m4/wm_xext_check.m4
+++ b/m4/wm_xext_check.m4
@@ -39,6 +39,42 @@ AC_DEFUN_ONCE([WM_XEXT_CHECK_XSHAPE],
]) dnl AC_DEFUN
+# WM_XEXT_CHECK_XSHM
+# ------------------
+#
+# Check for the MIT-SHM extension for Shared Memory support
+# The check depends on variable 'enable_shm' being either:
+# yes - detect, fail if not found
+# no - do not detect, disable support
+# auto - detect, disable if not found
+#
+# When found, append appropriate stuff in XLIBS, and append info to
+# the variable 'supported_xext'
+# When not found, append info to variable 'unsupported'
+AC_DEFUN_ONCE([WM_XEXT_CHECK_XSHM],
+[WM_LIB_CHECK([XShm], [-lXext], [XShmAttach], [$XLIBS],
+ [wm_save_CFLAGS="$CFLAGS"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([dnl
+@%:@include <X11/Xlib.h>
+@%:@include <X11/extensions/XShm.h>
+], [dnl
+ XShmSegmentInfo si;
+
+ XShmAttach(NULL, &si);])],
+ [],
+ [AC_MSG_ERROR([found $CACHEVAR but cannot compile using XShm header])])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([dnl
+@%:@include <sys/ipc.h>
+@%:@include <sys/shm.h>
+], [dnl
+ shmget(IPC_PRIVATE, 1024, IPC_CREAT);])],
+ [],
+ [AC_MSG_ERROR([found $CACHEVAR but cannot compile using ipc/shm
headers])])
+ CFLAGS="$wm_save_CFLAGS"],
+ [supported_xext], [XLIBS], [enable_shm], [-])dnl
+]) dnl AC_DEFUN
+
+
# WM_XEXT_CHECK_XINERAMA
# ----------------------
#
http://repo.or.cz/w/wmaker-crm.git/commit/4ece935f9d19efa78ff7b7774a8f0fd9ead08cbb
commit 4ece935f9d19efa78ff7b7774a8f0fd9ead08cbb
Author: Christophe CURIS <[email protected]>
Date: Sun Nov 17 18:51:19 2013 +0100
Code refactoring: replaced macro 'XSHM' by 'USE_XSHM' for consistency
The usual way to define a macro in is to name macro with 'USE_xxx' when
they are used to enable a feature 'xxx'.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/configure.ac b/configure.ac
index e463ece..7259774 100644
--- a/configure.ac
+++ b/configure.ac
@@ -604,7 +604,7 @@ if test "$shm" = yes; then
if test "$added_xext" = no; then
XLIBS="-lXext $XLIBS"
fi
- AC_DEFINE(XSHM, 1, [define if X's shared memory extension is
available (set by configure)])
+ AC_DEFINE(USE_XSHM, 1, [define if X's shared memory extension
is available (set by configure)])
fi
fi
diff --git a/wrlib/context.c b/wrlib/context.c
index 3fdaafe..da9dbe6 100644
--- a/wrlib/context.c
+++ b/wrlib/context.c
@@ -664,7 +664,7 @@ RContext *RCreateContext(Display * dpy, int screen_number,
const RContextAttribu
}
/* check avaiability of MIT-SHM */
-#ifdef XSHM
+#ifdef USE_XSHM
if (!(context->attribs->flags & RC_UseSharedMemory)) {
context->attribs->flags |= RC_UseSharedMemory;
context->attribs->use_shared_memory = True;
diff --git a/wrlib/convert.c b/wrlib/convert.c
index f690e1f..f3c9a49 100644
--- a/wrlib/convert.c
+++ b/wrlib/convert.c
@@ -35,7 +35,7 @@
#include "wraster.h"
-#ifdef XSHM
+#ifdef USE_XSHM
extern Pixmap R_CreateXImageMappedPixmap(RContext * context, RXImage * ximage);
#endif
@@ -819,7 +819,7 @@ static RXImage *image2Bitmap(RContext * ctx, RImage *
image, int threshold)
int RConvertImage(RContext * context, RImage * image, Pixmap * pixmap)
{
RXImage *ximg = NULL;
-#ifdef XSHM
+#ifdef USE_XSHM
Pixmap tmp;
#endif
@@ -852,7 +852,7 @@ int RConvertImage(RContext * context, RImage * image,
Pixmap * pixmap)
*pixmap = XCreatePixmap(context->dpy, context->drawable, image->width,
image->height, context->depth);
-#ifdef XSHM
+#ifdef USE_XSHM
if (context->flags.use_shared_pixmap && ximg->is_shared)
tmp = R_CreateXImageMappedPixmap(context, ximg);
else
@@ -873,9 +873,9 @@ int RConvertImage(RContext * context, RImage * image,
Pixmap * pixmap)
} else {
RPutXImage(context, *pixmap, context->copy_gc, ximg, 0, 0, 0,
0, image->width, image->height);
}
-#else /* !XSHM */
+#else /* !USE_XSHM */
RPutXImage(context, *pixmap, context->copy_gc, ximg, 0, 0, 0, 0,
image->width, image->height);
-#endif /* !XSHM */
+#endif /* !USE_XSHM */
RDestroyXImage(context, ximg);
diff --git a/wrlib/wraster.h b/wrlib/wraster.h
index ff2b2c3..25e39e7 100644
--- a/wrlib/wraster.h
+++ b/wrlib/wraster.h
@@ -47,7 +47,7 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
-#ifdef XSHM
+#ifdef USE_XSHM
#include <X11/extensions/XShm.h>
#endif
@@ -204,7 +204,7 @@ typedef struct RXImage {
XImage *image;
/* Private data. Do not access */
-#ifdef XSHM
+#ifdef USE_XSHM
XShmSegmentInfo info;
char is_shared;
#endif
diff --git a/wrlib/xutil.c b/wrlib/xutil.c
index 6d0b242..82122d4 100644
--- a/wrlib/xutil.c
+++ b/wrlib/xutil.c
@@ -30,14 +30,14 @@
#include <assert.h>
-#ifdef XSHM
+#ifdef USE_XSHM
#include <sys/ipc.h>
#include <sys/shm.h>
-#endif /* XSHM */
+#endif /* USE_XSHM */
#include "wraster.h"
-#ifdef XSHM
+#ifdef USE_XSHM
static int shmError;
@@ -64,7 +64,7 @@ RXImage *RCreateXImage(RContext * context, int depth,
unsigned width, unsigned h
RErrorCode = RERR_NOMEMORY;
return NULL;
}
-#ifndef XSHM
+#ifndef USE_XSHM
rximg->image = XCreateImage(context->dpy, visual, depth, ZPixmap, 0,
NULL, width, height, 8, 0);
if (!rximg->image) {
free(rximg);
@@ -78,7 +78,7 @@ RXImage *RCreateXImage(RContext * context, int depth,
unsigned width, unsigned h
RErrorCode = RERR_NOMEMORY;
return NULL;
}
-#else /* XSHM */
+#else /* USE_XSHM */
if (!context->attribs->use_shared_memory) {
retry_without_shm:
@@ -145,16 +145,16 @@ RXImage *RCreateXImage(RContext * context, int depth,
unsigned width, unsigned h
goto retry_without_shm;
}
}
-#endif /* XSHM */
+#endif /* USE_XSHM */
return rximg;
}
void RDestroyXImage(RContext * context, RXImage * rximage)
{
-#ifndef XSHM
+#ifndef USE_XSHM
XDestroyImage(rximage->image);
-#else /* XSHM */
+#else /* USE_XSHM */
if (rximage->is_shared) {
XSync(context->dpy, False);
XShmDetach(context->dpy, &rximage->info);
@@ -186,7 +186,7 @@ RXImage *RGetXImage(RContext * context, Drawable d, int x,
int y, unsigned width
{
RXImage *ximg = NULL;
-#ifdef XSHM
+#ifdef USE_XSHM
if (context->attribs->use_shared_memory && 0) {
ximg = RCreateXImage(context, getDepth(context->dpy, d), width,
height);
@@ -208,7 +208,7 @@ RXImage *RGetXImage(RContext * context, Drawable d, int x,
int y, unsigned width
ximg->image = XGetImage(context->dpy, d, x, y, width, height,
AllPlanes, ZPixmap);
}
return ximg;
-#else /* !XSHM */
+#else /* !USE_XSHM */
ximg = malloc(sizeof(RXImage));
if (!ximg) {
RErrorCode = RERR_NOMEMORY;
@@ -218,14 +218,14 @@ RXImage *RGetXImage(RContext * context, Drawable d, int
x, int y, unsigned width
ximg->image = XGetImage(context->dpy, d, x, y, width, height,
AllPlanes, ZPixmap);
return ximg;
-#endif /* !XSHM */
+#endif /* !USE_XSHM */
}
void
RPutXImage(RContext * context, Drawable d, GC gc, RXImage * ximage, int src_x,
int src_y, int dest_x, int dest_y, unsigned int width, unsigned int
height)
{
-#ifndef XSHM
+#ifndef USE_XSHM
XPutImage(context->dpy, d, gc, ximage->image, src_x, src_y, dest_x,
dest_y, width, height);
#else
if (ximage->is_shared) {
@@ -235,10 +235,10 @@ RPutXImage(RContext * context, Drawable d, GC gc, RXImage
* ximage, int src_x,
XPutImage(context->dpy, d, gc, ximage->image, src_x, src_y,
dest_x, dest_y, width, height);
}
XFlush(context->dpy);
-#endif /* XSHM */
+#endif /* USE_XSHM */
}
-#ifdef XSHM
+#ifdef USE_XSHM
Pixmap R_CreateXImageMappedPixmap(RContext * context, RXImage * rximage)
{
Pixmap pix;
@@ -250,4 +250,4 @@ Pixmap R_CreateXImageMappedPixmap(RContext * context,
RXImage * rximage)
return pix;
}
-#endif /* XSHM */
+#endif /* USE_XSHM */
http://repo.or.cz/w/wmaker-crm.git/commit/41775431251e260b4781e3bc14b1f399e40663b4
commit 41775431251e260b4781e3bc14b1f399e40663b4
Author: Christophe CURIS <[email protected]>
Date: Sun Nov 17 18:51:18 2013 +0100
configure: Moved configure's detection of XRandR to a dedicated macro
The original check was not compliant with autoconf's syntax, did not have
a very good behaviour for user and was not easy to make evolve.
The new macro:
- uses as much as possible autoconf macros for portability and code
consistency;
- checks also for header usability with the compiler;
- provides a consistent behaviour on yes/no/auto (if user explicitly
enables support, do not silently disable if not found; if library is found
but not the header, complain to let user install it or explicitly disable
support)
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/configure.ac b/configure.ac
index 4f9cf6a..e463ece 100644
--- a/configure.ac
+++ b/configure.ac
@@ -511,19 +511,13 @@ WM_XEXT_CHECK_XINERAMA
dnl XRandR support
dnl ==============
-xrandr=no
-AC_ARG_ENABLE(xrandr, AS_HELP_STRING([--enable-xrandr], [enable XRandR window
extension support (NOT recommended, buggy)]),
- xrandr=$enableval, xrandr=no)
-added_xext=no
-
-LIBXRANDR=
-if test "$xrandr" = yes; then
- AC_CHECK_LIB(Xrandr, XRRQueryExtension, [LIBXRANDR=-lXrandr
- added_xext=yes
- AC_DEFINE(USE_XRANDR, 1, [define if you want support for XRandR
(set by configure)])],
- xrandr=no, $XLFLAGS $XLIBS)
-fi
-AC_SUBST(LIBXRANDR)
+AC_ARG_ENABLE([xrandr],
+ [AS_HELP_STRING([--enable-xrandr], [enable XRandR extension support (NOT
recommended, buggy)])],
+ [AS_CASE(["$enableval"],
+ [yes|no], [],
+ [AC_MSG_ERROR([bad value $enableval for --enable-xrandr]) ]) ],
+ [enable_xrandr=no])
+WM_XEXT_CHECK_XRANDR
dnl
dnl libWINGS uses math functions, check whether usage requires linking
@@ -830,7 +824,6 @@ echo "Supported X extensions: :$supported_xext"
echo "Supported graphic format libraries :$supported_gfx"
echo "Unsupported features :$unsupported"
echo "Antialiased text support in WINGs : $xft"
-echo "XRandR extension support : $xrandr"
echo "Translated message files to install : $mof"
dnl echo "Supported languages beside English : $languages"
if test "x$MOFILES" != "x"; then
diff --git a/m4/wm_xext_check.m4 b/m4/wm_xext_check.m4
index 8ba1f79..a8c45f4 100644
--- a/m4/wm_xext_check.m4
+++ b/m4/wm_xext_check.m4
@@ -98,3 +98,27 @@ sed -e 's,^[[^%]]*% *,,' | sed -e 's, *%.*$,,' `" dnl
])
AC_SUBST(LIBXINERAMA)dnl
])
+
+
+# WM_XEXT_CHECK_XRANDR
+# --------------------
+#
+# Check for the X RandR (Resize-and-Rotate) extension
+# The check depends on variable 'enable_xrandr' being either:
+# yes - detect, fail if not found
+# no - do not detect, disable support
+# auto - detect, disable if not found
+#
+# When found, append appropriate stuff in LIBXRANDR, and append info to
+# the variable 'supported_xext'
+# When not found, append info to variable 'unsupported'
+AC_DEFUN_ONCE([WM_XEXT_CHECK_XRANDR],
+[WM_LIB_CHECK([XRandR], [-lXrandr], [XRRQueryExtension], [$XLIBS],
+ [wm_save_CFLAGS="$CFLAGS"
+ AS_IF([wm_fn_lib_try_compile "X11/extensions/Xrandr.h" "Display *dpy;"
"XRRQueryExtension(dpy, NULL, NULL)" ""],
+ [],
+ [AC_MSG_ERROR([found $CACHEVAR but cannot compile using XRandR
header])])
+ CFLAGS="$wm_save_CFLAGS"],
+ [supported_xext], [LIBXRANDR], [], [-])dnl
+AC_SUBST([LIBXRANDR])dnl
+]) dnl AC_DEFUN
http://repo.or.cz/w/wmaker-crm.git/commit/736449a78910cfd9f35b62d4f07d09425e77c9bc
commit 736449a78910cfd9f35b62d4f07d09425e77c9bc
Author: Christophe CURIS <[email protected]>
Date: Sun Nov 17 18:51:17 2013 +0100
Code refactoring: replaced macro 'HAVE_XRANDR' by 'USE_XRANDR' for
consistency
The usual way to define a macro in is to name macro with 'USE_xxx' when
they are used to enable a feature 'xxx'.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/configure.ac b/configure.ac
index e5fad66..4f9cf6a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -520,7 +520,7 @@ LIBXRANDR=
if test "$xrandr" = yes; then
AC_CHECK_LIB(Xrandr, XRRQueryExtension, [LIBXRANDR=-lXrandr
added_xext=yes
- AC_DEFINE(HAVE_XRANDR, 1, [define if you want support for
XRandR (set by configure)])],
+ AC_DEFINE(USE_XRANDR, 1, [define if you want support for XRandR
(set by configure)])],
xrandr=no, $XLFLAGS $XLIBS)
fi
AC_SUBST(LIBXRANDR)
diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 0fb67e3..f11dab6 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -600,7 +600,7 @@ extern struct wmaker_global_variables {
} xkb;
#endif
-#ifdef HAVE_XRANDR
+#ifdef USE_XRANDR
struct {
Bool supported;
int event_base;
diff --git a/src/dialog.c b/src/dialog.c
index 63b8c50..43f12fc 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -1292,7 +1292,7 @@ void wShowInfoPanel(WScreen *scr)
strbuf = wstrappend(strbuf, _("nAdditional support for: "));
strbuf = wstrappend(strbuf, "WMSPEC");
-#ifdef HAVE_XRANDR
+#ifdef USE_XRANDR
strbuf = wstrappend(strbuf, ", XRandR ");
if (w_global.xext.randr.supported)
strbuf = wstrappend(strbuf, _("(Supported)"));
diff --git a/src/event.c b/src/event.c
index da75cf3..acb7e1f 100644
--- a/src/event.c
+++ b/src/event.c
@@ -42,7 +42,7 @@
#include "xdnd.h"
#endif
-#ifdef HAVE_XRANDR
+#ifdef USE_XRANDR
#include <X11/extensions/Xrandr.h>
#endif
@@ -265,7 +265,7 @@ void DispatchEvent(XEvent * event)
break;
case ConfigureNotify:
-#ifdef HAVE_XRANDR
+#ifdef USE_XRANDR
if (event->xconfigure.window == DefaultRootWindow(dpy))
XRRUpdateConfiguration(event);
#endif
@@ -557,7 +557,7 @@ static void handleExtensions(XEvent * event)
handleXkbIndicatorStateNotify(event);
}
#endif /*KEEP_XKB_LOCK_STATUS */
-#ifdef HAVE_XRANDR
+#ifdef USE_XRANDR
if (w_global.xext.randr.supported && event->type ==
(w_global.xext.randr.event_base + RRScreenChangeNotify)) {
/* From xrandr man page: "Clients must call back into Xlib using
* XRRUpdateConfiguration when screen configuration change
notify
diff --git a/src/screen.c b/src/screen.c
index 52c164a..3735fc0 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -31,7 +31,7 @@
#ifdef KEEP_XKB_LOCK_STATUS
#include <X11/XKBlib.h>
#endif /* KEEP_XKB_LOCK_STATUS */
-#ifdef HAVE_XRANDR
+#ifdef USE_XRANDR
#include <X11/extensions/Xrandr.h>
#endif
@@ -540,7 +540,7 @@ WScreen *wScreenInit(int screen_number)
}
#endif /* KEEP_XKB_LOCK_STATUS */
-#ifdef HAVE_XRANDR
+#ifdef USE_XRANDR
if (w_global.xext.randr.supported)
XRRSelectInput(dpy, scr->root_win, RRScreenChangeNotifyMask);
#endif
diff --git a/src/startup.c b/src/startup.c
index 581b644..6ede6f5 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -44,7 +44,7 @@
#ifdef KEEP_XKB_LOCK_STATUS
#include <X11/XKBlib.h>
#endif
-#ifdef HAVE_XRANDR
+#ifdef USE_XRANDR
#include <X11/extensions/Xrandr.h>
#endif
@@ -592,7 +592,7 @@ void StartUp(Bool defaultScreenOnly)
w_global.xext.shape.supported = XShapeQueryExtension(dpy,
&w_global.xext.shape.event_base, &j);
#endif
-#ifdef HAVE_XRANDR
+#ifdef USE_XRANDR
w_global.xext.randr.supported = XRRQueryExtension(dpy,
&w_global.xext.randr.event_base, &j);
#endif
http://repo.or.cz/w/wmaker-crm.git/commit/185b7af993eef404072f98f3632d92f5c8fe7a2d
commit 185b7af993eef404072f98f3632d92f5c8fe7a2d
Author: Christophe CURIS <[email protected]>
Date: Sun Nov 17 18:51:16 2013 +0100
configure: Moved configure's detection of Xinerama to a dedicated macro
The original check was not compliant with autoconf's syntax, did not have
a very good behaviour for user and was not easy to make evolve.
The new macro:
- uses as much as possible autoconf macros for portability and code
consistency;
- checks also for header usability with the compiler;
- provides a consistent behaviour on yes/no/auto (if user explicitly
enables support, do not silently disable if not found; if library is found
but not the header, complain to let user install it or explicitly disable
support)
The feature is also no more disabled by default, as it is something user
would expect from a modern window manager.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/configure.ac b/configure.ac
index 99df9c6..e5fad66 100644
--- a/configure.ac
+++ b/configure.ac
@@ -499,6 +499,16 @@ AC_ARG_ENABLE([shape],
[enable_shape=auto])
WM_XEXT_CHECK_XSHAPE
+dnl XINERAMA support
+dnl ================
+AC_ARG_ENABLE([xinerama],
+ [AS_HELP_STRING([--enable-xinerama], [enable Xinerama extension support])],
+ [AS_CASE(["$enableval"],
+ [yes|no], [],
+ [AC_MSG_ERROR([bad value $enableval for --enable-xinerama]) ]) ],
+ [enable_xinerama=auto])
+WM_XEXT_CHECK_XINERAMA
+
dnl XRandR support
dnl ==============
xrandr=no
@@ -583,41 +593,6 @@ AC_SUBST(XFTFLAGS)
AC_SUBST(XFTLIBS)
-dnl XINERAMA support
-dnl ================
-xinerama=no
-AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--enable-xinerama], [enable Xinerama
extension support]),
- xinerama=$enableval, xinerama=no)
-
-LIBXINERAMA=
-if test "$xinerama" = yes; then
- AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
- [LIBXINERAMA=-lXinerama
- xfxine=yes],
- xfxine=no, $XLFLAGS $XLIBS)
-
- AC_CHECK_LIB(Xext, XineramaGetInfo,
- [sunxine=yes
- ], sunxine=no, $XLFLAGS $XLIBS)
-
- if test "$xfxine" = yes; then
- xine=1
- fi
-
- if test "$sunxine" = yes; then
- xine=1
- AC_DEFINE(SOLARIS_XINERAMA, 1,
- [define if you want support for the XINERAMA extension and are
in Solaris (set by configure)])
- fi
-
- if test "$xine" = 1; then
- AC_DEFINE(USE_XINERAMA, 1,
- [define if you want support for the XINERAMA extension (set by
configure)])
- fi
-fi
-AC_SUBST(LIBXINERAMA)
-
-
dnl MIT-SHM support
dnl ===============
shm=yes
@@ -855,7 +830,6 @@ echo "Supported X extensions: :$supported_xext"
echo "Supported graphic format libraries :$supported_gfx"
echo "Unsupported features :$unsupported"
echo "Antialiased text support in WINGs : $xft"
-echo "Xinerama extension support : $xinerama"
echo "XRandR extension support : $xrandr"
echo "Translated message files to install : $mof"
dnl echo "Supported languages beside English : $languages"
diff --git a/m4/wm_xext_check.m4 b/m4/wm_xext_check.m4
index e535574..8ba1f79 100644
--- a/m4/wm_xext_check.m4
+++ b/m4/wm_xext_check.m4
@@ -37,3 +37,64 @@ AC_DEFUN_ONCE([WM_XEXT_CHECK_XSHAPE],
CFLAGS="$wm_save_CFLAGS"],
[supported_xext], [XLIBS], [enable_shape], [-])dnl
]) dnl AC_DEFUN
+
+
+# WM_XEXT_CHECK_XINERAMA
+# ----------------------
+#
+# Check for the Xinerama extension for multiscreen-as-one support
+# The check depends on variable 'enable_xinerama' being either:
+# yes - detect, fail if not found
+# no - do not detect, disable support
+# auto - detect, disable if not found
+#
+# When found, append appropriate stuff in LIBXINERAMA, and append info to
+# the variable 'supported_xext'
+# When not found, append info to variable 'unsupported'
+AC_DEFUN_ONCE([WM_XEXT_CHECK_XINERAMA],
+[LIBXINERAMA=""
+AS_IF([test "x$enable_xinerama" = "xno"],
+ [unsupported="$unsupported Xinerama"],
+ [AC_CACHE_CHECK([for Xinerama support library], [wm_cv_xext_xinerama],
+ [wm_cv_xext_xinerama=no
+ dnl
+ dnl We check that the library is available
+ wm_save_LIBS="$LIBS"
+ for wm_arg in dnl
+dnl Lib flag % Function name % info
+ "-lXinerama % XineramaQueryScreens" dnl
+ "-lXext % XineramaGetInfo % solaris" ; do
+ AS_IF([wm_fn_lib_try_link "`echo "$wm_arg" | dnl
+sed -e 's,^[[^%]]*% *,,' | sed -e 's, *%.*$,,' `" dnl
+"$XLFLAGS $XLIBS `echo "$wm_arg" | sed -e 's, *%.*$,,' `"],
+ [wm_cv_xext_xinerama="`echo "$wm_arg" | sed -e 's, *%[[^%]]*, ,'
`"
+ break])
+ done
+ LIBS="$wm_save_LIBS"
+ AS_IF([test "x$enable_xinerama$wm_cv_xext_xinerama" = "xyesno"],
+ [AC_MSG_ERROR([explicit Xinerama support requested but no library
found])])
+ dnl
+ dnl A library was found, check if header is available and compile
+ wm_save_CFLAGS="$CFLAGS"
+ AS_CASE([`echo "$wm_cv_xext_xinerama" | sed -e 's,^[[^%]]*,,' `],
+ [*solaris*], [wm_header="X11/extensions/xinerama.h" ;
wm_fct="XineramaGetInfo(NULL, 0, NULL, NULL, &intval)"],
+ [wm_header="X11/extensions/Xinerama.h" ;
wm_fct="XineramaQueryScreens(NULL, &intval)"])
+ AS_IF([wm_fn_lib_try_compile "$wm_header" "int intval;" "$wm_fct" ""],
+ [],
+ [AC_MSG_ERROR([found $wm_cv_xext_xinerama but cannot compile with
the header])])
+ AS_UNSET([wm_header])
+ AS_UNSET([wm_fct])
+ CFLAGS="$wm_save_CFLAGS"])
+ AS_IF([test "x$wm_cv_xext_xinerama" = "xno"],
+ [unsupported="$unsupported Xinerama"
+ enable_xinerama="no"],
+ [LIBXINERAMA="`echo "$wm_cv_xext_xinerama" | sed -e 's, *%.*$,,' `"
+ AC_DEFINE([USE_XINERAMA], [1],
+ [defined when usable Xinerama library with header was found])
+ AS_CASE([`echo "$wm_cv_xext_xinerama" | sed -e 's,^[[^%]]*,,' `],
+ [*solaris*], [AC_DEFINE([SOLARIS_XINERAMA], [1],
+ [defined when the Solaris Xinerama extension was detected])])
+ supported_xext="$supported_xext Xinerama"])
+ ])
+AC_SUBST(LIBXINERAMA)dnl
+])
http://repo.or.cz/w/wmaker-crm.git/commit/d4a249c142417fb1a04af9528286ab62a9340442
commit d4a249c142417fb1a04af9528286ab62a9340442
Author: Christophe CURIS <[email protected]>
Date: Sun Nov 17 18:51:15 2013 +0100
Code refactoring: replaced macro 'XINERAMA' by 'USE_XINERAMA' for
consistency
The usual way to define a macro in is to name macro with 'USE_xxx' when
they are used to enable a feature 'xxx'
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/configure.ac b/configure.ac
index efa0535..99df9c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -611,7 +611,7 @@ if test "$xinerama" = yes; then
fi
if test "$xine" = 1; then
- AC_DEFINE(XINERAMA, 1,
+ AC_DEFINE(USE_XINERAMA, 1,
[define if you want support for the XINERAMA extension (set by
configure)])
fi
fi
diff --git a/src/dialog.c b/src/dialog.c
index 3a019cf..63b8c50 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -1304,7 +1304,7 @@ void wShowInfoPanel(WScreen *scr)
strbuf = wstrappend(strbuf, ", MWM");
#endif
-#ifdef XINERAMA
+#ifdef USE_XINERAMA
strbuf = wstrappend(strbuf, _("n"));
#ifdef SOLARIS_XINERAMA
strbuf = wstrappend(strbuf, _("Solaris "));
diff --git a/src/workspace.c b/src/workspace.c
index 81c6a01..b0c436d 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -258,7 +258,7 @@ static void showWorkspaceName(WScreen * scr, int workspace)
char *name = w_global.workspace.array[workspace]->name;
int len = strlen(name);
int x, y;
-#ifdef XINERAMA
+#ifdef USE_XINERAMA
int head;
WMRect rect;
int xx, yy;
@@ -286,7 +286,7 @@ static void showWorkspaceName(WScreen * scr, int workspace)
w = WMWidthOfString(w_global.workspace.font_for_name, name, len);
h = WMFontHeight(w_global.workspace.font_for_name);
-#ifdef XINERAMA
+#ifdef USE_XINERAMA
head = wGetHeadForPointerLocation(scr);
rect = wGetRectForHead(scr, head);
if (scr->xine_info.count) {
@@ -301,7 +301,7 @@ static void showWorkspaceName(WScreen * scr, int workspace)
switch (wPreferences.workspace_name_display_position) {
case WD_TOP:
-#ifdef XINERAMA
+#ifdef USE_XINERAMA
px = xx;
#else
px = (scr->scr_width - (w + 4)) / 2;
@@ -309,7 +309,7 @@ static void showWorkspaceName(WScreen * scr, int workspace)
py = WORKSPACE_NAME_DISPLAY_PADDING;
break;
case WD_BOTTOM:
-#ifdef XINERAMA
+#ifdef USE_XINERAMA
px = xx;
#else
px = (scr->scr_width - (w + 4)) / 2;
@@ -334,7 +334,7 @@ static void showWorkspaceName(WScreen * scr, int workspace)
break;
case WD_CENTER:
default:
-#ifdef XINERAMA
+#ifdef USE_XINERAMA
px = xx;
py = yy;
#else
diff --git a/src/xinerama.c b/src/xinerama.c
index f9fe31e..92944b1 100644
--- a/src/xinerama.c
+++ b/src/xinerama.c
@@ -27,7 +27,7 @@
#include "framewin.h"
#include "placement.h"
-#ifdef XINERAMA
+#ifdef USE_XINERAMA
# ifdef SOLARIS_XINERAMA /* sucks */
# include <X11/extensions/xinerama.h>
# else
@@ -40,7 +40,7 @@ void wInitXinerama(WScreen * scr)
scr->xine_info.primary_head = 0;
scr->xine_info.screens = NULL;
scr->xine_info.count = 0;
-#ifdef XINERAMA
+#ifdef USE_XINERAMA
# ifdef SOLARIS_XINERAMA
if (XineramaGetState(dpy, scr->screen)) {
WXineramaInfo *info = &scr->xine_info;
@@ -79,7 +79,7 @@ void wInitXinerama(WScreen * scr)
XFree(xine_screens);
}
# endif /* !SOLARIS_XINERAMA */
-#endif /* XINERAMA */
+#endif /* USE_XINERAMA */
}
int wGetRectPlacementInfo(WScreen * scr, WMRect rect, int *flags)
diff --git a/util/wmsetbg.c b/util/wmsetbg.c
index 22653af..644c85d 100644
--- a/util/wmsetbg.c
+++ b/util/wmsetbg.c
@@ -39,7 +39,7 @@
#include <sys/types.h>
#include <ctype.h>
-#ifdef XINERAMA
+#ifdef USE_XINERAMA
# ifdef SOLARIS_XINERAMA /* sucks */
# include <X11/extensions/xinerama.h>
# else
@@ -78,7 +78,7 @@ int scrX, scrY;
WXineramaInfo xineInfo;
Bool smooth = False;
-#ifdef XINERAMA
+#ifdef USE_XINERAMA
Bool xineStretch = False;
#endif
@@ -104,7 +104,7 @@ static void initXinerama(void)
{
xineInfo.screens = NULL;
xineInfo.count = 0;
-#ifdef XINERAMA
+#ifdef USE_XINERAMA
# ifdef SOLARIS_XINERAMA
if (XineramaGetState(dpy, scr)) {
XRectangle head[MAXFRAMEBUFFERS];
@@ -141,7 +141,7 @@ static void initXinerama(void)
XFree(xine_screens);
}
# endif /* !SOLARIS_XINERAMA */
-#endif /* XINERAMA */
+#endif /* USE_XINERAMA */
}
static RImage *loadImage(RContext * rc, const char *file)
@@ -552,7 +552,7 @@ static BackgroundTexture *parseTexture(RContext * rc, char
*text)
texture->width = scrWidth;
texture->height = scrHeight;
-#ifdef XINERAMA
+#ifdef USE_XINERAMA
if (xineInfo.count && ! xineStretch) {
int i;
for (i = 0; i < xineInfo.count; ++i) {
@@ -564,9 +564,9 @@ static BackgroundTexture *parseTexture(RContext * rc, char
*text)
} else {
applyImage(rc, texture, image, type[0],
0, 0, scrWidth, scrHeight);
}
-#else /* !XINERAMA */
+#else /* !USE_XINERAMA */
applyImage(rc, texture, image, type[0], 0, 0,
scrWidth, scrHeight);
-#endif /* !XINERAMA */
+#endif /* !USE_XINERAMA */
RReleaseImage(image);
}
break;
@@ -1139,7 +1139,7 @@ static void print_help(void)
puts(" -d, --dither dither image");
puts(" -m, --match match colors");
puts(" -S, --smooth smooth scaled image");
-#ifdef XINERAMA
+#ifdef USE_XINERAMA
puts(" -X, --xinerama stretch image across Xinerama
heads");
#endif
puts(" -b, --back-color <color> background color");
@@ -1249,7 +1249,7 @@ int main(int argc, char **argv)
obey_user++;
} else if (strcmp(argv[i], "-S") == 0 || strcmp(argv[i],
"--smooth") == 0) {
smooth = True;
-#ifdef XINERAMA
+#ifdef USE_XINERAMA
} else if (strcmp(argv[i], "-X") == 0 || strcmp(argv[i],
"--xinerama") == 0) {
xineStretch = True;
#endif
http://repo.or.cz/w/wmaker-crm.git/commit/2b49cd88a75048d85966e02f47157cfc4e5e2428
commit 2b49cd88a75048d85966e02f47157cfc4e5e2428
Author: Christophe CURIS <[email protected]>
Date: Sun Nov 17 18:51:14 2013 +0100
configure: Moved configure's detection of XShape to a dedicated macro
The original check was not compliant with autoconf's syntax, did not
have a very good behaviour for user and was not easy to make evolve.
The new macro:
- uses as much as possible autoconf macros for portability and code
consistency;
- checks also for header usability with the compiler;
- provides a consistent behaviour on yes/no/auto (if user explicitly
enables support, do not silently disable if not found; if library is found
but not the header, complain to let user install it or explicitly disable
support)
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/configure.ac b/configure.ac
index 6130b67..efa0535 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,6 +158,7 @@ AS_IF([test "x$debug" = "xyes"],
dnl Tracking on what is detected for final status
dnl =============================================
unsupported=""
+supported_xext=""
supported_gfx=""
@@ -490,17 +491,13 @@ AC_ARG_ENABLE(modelock,
AS_HELP_STRING([--enable-modelock], [XKB keyboard langua
dnl XShape support
dnl ==============
-shape=yes
-AC_ARG_ENABLE(shape, AS_HELP_STRING([--disable-shape], [disable shaped window
extension support]),
- shape=$enableval, shape=yes)
-added_xext=no
-
-if test "$shape" = yes; then
- AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
- added_xext=yes
- AC_DEFINE(USE_XSHAPE, 1, [define if you want support for shaped
windows (set by configure)])],
- shape=no, $XLFLAGS $XLIBS)
-fi
+AC_ARG_ENABLE([shape],
+ [AS_HELP_STRING([--disable-shape], [disable shaped window extension
support])],
+ [AS_CASE(["$enableval"],
+ [yes|no], [],
+ [AC_MSG_ERROR([bad value $enableval for --enable-shape]) ]) ],
+ [enable_shape=auto])
+WM_XEXT_CHECK_XSHAPE
dnl XRandR support
dnl ==============
@@ -854,6 +851,7 @@ echo "Installation path prefix : $prefix"
echo "Installation path for binaries : $_bindir"
echo "Installation path for libraries : $libdir"
echo "Installation path for WPrefs.app : $wprefs_base_dir" | sed -e
's|${prefix}|'"$prefix|"
+echo "Supported X extensions: :$supported_xext"
echo "Supported graphic format libraries :$supported_gfx"
echo "Unsupported features :$unsupported"
echo "Antialiased text support in WINGs : $xft"
diff --git a/m4/wm_xext_check.m4 b/m4/wm_xext_check.m4
new file mode 100644
index 0000000..e535574
--- /dev/null
+++ b/m4/wm_xext_check.m4
@@ -0,0 +1,39 @@
+# wm_xext_check.m4 - Macros to check for X extensions support libraries
+#
+# Copyright (c) 2013 Christophe CURIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# WM_XEXT_CHECK_XSHAPE
+# --------------------
+#
+# Check for the X Shaped Window extension
+# The check depends on variable 'enable_xshape' being either:
+# yes - detect, fail if not found
+# no - do not detect, disable support
+# auto - detect, disable if not found
+#
+# When found, append appropriate stuff in XLIBS, and append info to
+# the variable 'supported_xext'
+# When not found, append info to variable 'unsupported'
+AC_DEFUN_ONCE([WM_XEXT_CHECK_XSHAPE],
+[WM_LIB_CHECK([XShape], [-lXext], [XShapeSelectInput], [$XLIBS],
+ [wm_save_CFLAGS="$CFLAGS"
+ AS_IF([wm_fn_lib_try_compile "X11/extensions/shape.h" "Window win;"
"XShapeSelectInput(NULL, win, 0)" ""],
+ [],
+ [AC_MSG_ERROR([found $CACHEVAR but cannot compile using XShape
header])])
+ CFLAGS="$wm_save_CFLAGS"],
+ [supported_xext], [XLIBS], [enable_shape], [-])dnl
+]) dnl AC_DEFUN
http://repo.or.cz/w/wmaker-crm.git/commit/a2177013c80aa36a402e349230557e06b97bd4c6
commit a2177013c80aa36a402e349230557e06b97bd4c6
Author: Christophe CURIS <[email protected]>
Date: Sun Nov 17 18:51:13 2013 +0100
configure: Created new macro to perform the repetitive part of Library check
There are a number of steps in the library check procedure that are a bit
repetitive, and have been placed into the macro WM_LIB_CHECK to make the
code simpler to write.
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/m4/windowmaker.m4 b/m4/windowmaker.m4
index fbab215..8ff1bd6 100644
--- a/m4/windowmaker.m4
+++ b/m4/windowmaker.m4
@@ -121,3 +121,64 @@ for wm_arg in $1 ; do
done
AS_VAR_POPDEF([VAR])dnl
])
+
+
+# WM_LIB_CHECK
+# ------------
+#
+# Check if a library exists (can be linked to) and check if its header can
+# compile (using code in parameter to the macro), then update the appropriate
+# stuff accordingly
+#
+# Usage: WM_LIB_CHECK([name], [lflaglist], [lfunc], [extralibs],
[headercheck], [supvar], [libvar], [enable_var], [cond_name])
+# $1 name: name of the feature used in messages and in supvar
+# $2 lflaglist: the list of linker '-l' options to try, stopping on first
success
+# $3 lfunc: the name of the function to look for when linking
+# $4 extralibs: optional, additional libraries included in the link check
+# $5 headercheck: the code that checks for the header
+# $6 supvar: if the library was found, append $name to this variable,
+# otherwise append $name to 'unsupported'
+# $7 libvar: if the library was found, append the working $lflag to this
variable
+# $8 enable_var: variable to check for user's feature request, if empty we
use "lowercase(enable_$1)"
+# $9 cond_name: name of the AC_DEFINE and the AM_CONDITIONAL
+# if empty, use "uppercase(USE_$1)", if equals "-" same but do
not create AM_CONDITIONAL
+AC_DEFUN([WM_LIB_CHECK],
+[AC_REQUIRE([_WM_LIB_CHECK_FUNCTS])
+m4_pushdef([ENABLEVAR], [m4_ifnblank([$8], [$8], enable_[]m4_tolower($1))])dnl
+m4_pushdef([CACHEVAR], [wm_cv_libchk_[]m4_tolower($1)])dnl
+m4_pushdef([USEVAR], [m4_bmatch([$9], [^-?$], [USE_[]m4_toupper($1)],
[$9])])dnl
+AS_IF([test "x$ENABLEVAR" = "xno"],
+ [unsupported="$unsupported $1"],
+ [AC_CACHE_CHECK([for $1 support library], CACHEVAR,
+ [CACHEVAR=no
+ wm_save_LIBS="$LIBS"
+ dnl
+ dnl We check that the library is available
+ m4_bmatch([$2], [ ], dnl Any space in 'lflaglist' means we have a
list of flags
+ [for wm_arg in $2 ; do
+ AS_IF([wm_fn_lib_try_link "$3" "$4 $wm_arg"],
+ [CACHEVAR="$wm_arg" ; break])
+ done],
+ [AS_IF([wm_fn_lib_try_link "$3" "$4 $2"],
+ [CACHEVAR="$2"]) ])
+ LIBS="$wm_save_LIBS"
+ AS_IF([test "x$ENABLEVAR$CACHEVAR" = "xyesno"],
+ [AC_MSG_ERROR([explicit $1 support requested but no library
found])])
+ dnl
+ dnl A library was found, check if header is available and compile
+ AS_IF([test "x$CACHEVAR" != "xno"], [$5])
+ ])
+ AS_IF([test "x$CACHEVAR" = "xno"],
+ [unsupported="$unsupported $1"
+ ENABLEVAR="no"],
+ [$6="$$6 $1"
+ WM_APPEND_ONCE([$CACHEVAR], [$7])
+ AC_DEFINE(USEVAR, [1],
+ [defined when valid $1 library with header was found])])
+ ])
+m4_bmatch([$9], [^-$], [],
+ [AM_CONDITIONAL(USEVAR, [test "x$ENABLEVAR" != "xno"])])dnl
+m4_popdef([ENABLEVAR])dnl
+m4_popdef([CACHEVAR])dnl
+m4_popdef([USEVAR])dnl
+])
diff --git a/m4/wm_imgfmt_check.m4 b/m4/wm_imgfmt_check.m4
index df7b59e..02245d2 100644
--- a/m4/wm_imgfmt_check.m4
+++ b/m4/wm_imgfmt_check.m4
@@ -92,23 +92,8 @@ AM_CONDITIONAL([USE_GIF], [test "x$enable_gif" != "xno"])dnl
# the variable 'supported_gfx'
# When not found, append info to variable 'unsupported'
AC_DEFUN_ONCE([WM_IMGFMT_CHECK_JPEG],
-[AC_REQUIRE([_WM_LIB_CHECK_FUNCTS])
-AS_IF([test "x$enable_jpeg" = "xno"],
- [unsupported="$unsupported JPEG"],
- [AC_CACHE_CHECK([for JPEG support library], [wm_cv_imgfmt_jpeg],
- [wm_cv_imgfmt_jpeg=no
- wm_save_LIBS="$LIBS"
- dnl
- dnl We check first if one of the known libraries is available
- AS_IF([wm_fn_lib_try_link "jpeg_destroy_compress" "$XLFLAGS $XLIBS
-ljpeg"],
- [wm_cv_imgfmt_jpeg="-ljpeg"])
- LIBS="$wm_save_LIBS"
- AS_IF([test "x$enable_jpeg$wm_cv_imgfmt_jpeg" = "xyesno"],
- [AC_MSG_ERROR([explicit JPEG support requested but no library
found])])
- AS_IF([test "x$wm_cv_imgfmt_jpeg" != "xno"],
- [dnl
- dnl A library was found, now check for the appropriate header
- AC_COMPILE_IFELSE(
+[WM_LIB_CHECK([JPEG], [-ljpeg], [jpeg_destroy_compress], [$XLFLAGS $XLIBS],
+ [AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[@%:@include <stdlib.h>
@%:@include <stdio.h>
@@ -118,21 +103,12 @@ AS_IF([test "x$enable_jpeg" = "xno"],
jpeg_destroy_decompress(&cinfo);])],
[],
[AS_ECHO([failed])
- AS_ECHO(["$as_me: error: found $wm_cv_imgfmt_jpeg but cannot
compile header"])
+ AS_ECHO(["$as_me: error: found $CACHEVAR but cannot compile
header"])
AS_ECHO(["$as_me: error: - does header 'jpeglib.h' exists?
(is package 'jpeg-dev' missing?)"])
AS_ECHO(["$as_me: error: - version of header is not
supported? (report to dev team)"])
AC_MSG_ERROR([JPEG library is not usable, cannot continue])])
- ])
- ])
- AS_IF([test "x$wm_cv_imgfmt_jpeg" = "xno"],
- [unsupported="$unsupported JPEG"
- enable_jpeg="no"],
- [supported_gfx="$supported_gfx JPEG"
- WM_APPEND_ONCE([$wm_cv_imgfmt_jpeg], [GFXLIBS])
- AC_DEFINE([USE_JPEG], [1],
- [defined when valid JPEG library with header was found])])
- ])
-AM_CONDITIONAL([USE_JPEG], [test "x$enable_jpeg" != "xno"])dnl
+ ],
+ [supported_gfx], [GFXLIBS])dnl
]) dnl AC_DEFUN
@@ -149,42 +125,16 @@ AM_CONDITIONAL([USE_JPEG], [test "x$enable_jpeg" !=
"xno"])dnl
# the variable 'supported_gfx'
# When not found, append info to variable 'unsupported'
AC_DEFUN_ONCE([WM_IMGFMT_CHECK_PNG],
-[AC_REQUIRE([_WM_LIB_CHECK_FUNCTS])
-AS_IF([test "x$enable_png" = "xno"],
- [unsupported="$unsupported PNG"],
- [AC_CACHE_CHECK([for PNG support library], [wm_cv_imgfmt_png],
- [wm_cv_imgfmt_png=no
- dnl
- dnl We check first if one of the known libraries is available
- wm_save_LIBS="$LIBS"
- for wm_arg in "-lpng" "-lpng -lz" "-lpng -lz -lm" ; do
- AS_IF([wm_fn_lib_try_link "png_get_valid" "$XLFLAGS $XLIBS
$wm_arg"],
- [wm_cv_imgfmt_png="$wm_arg" ; break])
- done
- LIBS="$wm_save_LIBS"
- AS_IF([test "x$enable_png$wm_cv_imgfmt_png" = "xyesno"],
- [AC_MSG_ERROR([explicit PNG support requested but no library
found])])
- AS_IF([test "x$wm_cv_imgfmt_png" != "xno"],
- [dnl
- dnl A library was found, now check for the appropriate header
- wm_save_CFLAGS="$CFLAGS"
- AS_IF([wm_fn_lib_try_compile "png.h" "" "return 0" ""],
- [],
- [AC_MSG_ERROR([found $wm_cv_imgfmt_png but could not find
appropriate header - are you missing libpng-dev package?])])
- AS_IF([wm_fn_lib_try_compile "png.h" "" "png_get_valid(NULL, NULL,
PNG_INFO_tRNS)" ""],
- [],
- [AC_MSG_ERROR([found $wm_cv_imgfmt_png and header, but cannot
compile - unsupported version?])])
- CFLAGS="$wm_save_CFLAGS"])
- ])
- AS_IF([test "x$wm_cv_imgfmt_png" = "xno"],
- [unsupported="$unsupported PNG"
- enable_png="no"],
- [supported_gfx="$supported_gfx PNG"
- WM_APPEND_ONCE([$wm_cv_imgfmt_png], [GFXLIBS])
- AC_DEFINE([USE_PNG], [1],
- [defined when valid PNG library with header was found])])
- ])
-AM_CONDITIONAL([USE_PNG], [test "x$enable_png" != "xno"])dnl
+[WM_LIB_CHECK([PNG], ["-lpng" "-lpng -lz" "-lpng -lz -lm"], [png_get_valid],
[$XLFLAGS $XLIBS],
+ [wm_save_CFLAGS="$CFLAGS"
+ AS_IF([wm_fn_lib_try_compile "png.h" "" "return 0" ""],
+ [],
+ [AC_MSG_ERROR([found $CACHEVAR but could not find appropriate header
- are you missing libpng-dev package?])])
+ AS_IF([wm_fn_lib_try_compile "png.h" "" "png_get_valid(NULL, NULL,
PNG_INFO_tRNS)" ""],
+ [],
+ [AC_MSG_ERROR([found $CACHEVAR and header, but cannot compile -
unsupported version?])])
+ CFLAGS="$wm_save_CFLAGS"],
+ [supported_gfx], [GFXLIBS])dnl
]) dnl AC_DEFUN
@@ -201,50 +151,26 @@ AM_CONDITIONAL([USE_PNG], [test "x$enable_png" !=
"xno"])dnl
# the variable 'supported_gfx'
# When not found, append info to variable 'unsupported'
AC_DEFUN_ONCE([WM_IMGFMT_CHECK_TIFF],
-[AC_REQUIRE([_WM_LIB_CHECK_FUNCTS])
-AS_IF([test "x$enable_tiff" = "xno"],
- [unsupported="$unsupported TIFF"],
- [AC_CACHE_CHECK([for TIFF support library], [wm_cv_imgfmt_tiff],
- [wm_cv_imgfmt_tiff=no
- dnl
- dnl We check first if one of the known libraries is available
- wm_save_LIBS="$LIBS"
- for wm_arg in "-ltiff" - dnl TIFF can have a dependancy
over zlib
- "-ltiff -lz" "-ltiff -lz -lm" - dnl It may also have
a dependancy to jpeg_lib
- "-ltiff -ljpeg" "-ltiff -ljpeg -lz" "-ltiff -ljpeg -lz -lm" -
dnl There is also a possible dependancy on JBIGKit
- "-ltiff -ljpeg -ljbig -lz" - dnl Probably for
historical reasons?
- "-ltiff34" "-ltiff34 -ljpeg" "-ltiff34 -ljpeg -lm" ; do
- AS_IF([wm_fn_lib_try_link "TIFFGetVersion" "$XLFLAGS $XLIBS
$wm_arg"],
- [wm_cv_imgfmt_tiff="$wm_arg" ; break])
- done
- LIBS="$wm_save_LIBS"
- AS_IF([test "x$enable_tiff$wm_cv_imgfmt_tiff" = "xyesno"],
- [AC_MSG_ERROR([explicit TIFF support requested but no library
found])])
- AS_IF([test "x$wm_cv_imgfmt_tiff" != "xno"],
- [dnl
- dnl A library was found, now check for the appropriate header
- wm_save_CFLAGS="$CFLAGS"
- AS_IF([wm_fn_lib_try_compile "tiffio.h" "" "return 0" ""],
- [],
- [AC_MSG_ERROR([found $wm_cv_imgfmt_tiff but could not find
appropriate header - are you missing libtiff-dev package?])])
- AS_IF([wm_fn_lib_try_compile "tiffio.h" 'const char *filename =
"dummy";' 'TIFFOpen(filename, "r")' ""],
- [],
- [AC_MSG_ERROR([found $wm_cv_imgfmt_tiff and header, but cannot
compile - unsupported version?])])
- CFLAGS="$wm_save_CFLAGS"])
- ])
- AS_IF([test "x$wm_cv_imgfmt_tiff" = "xno"],
- [unsupported="$unsupported TIFF"
- enable_tiff="no"],
- [supported_gfx="$supported_gfx TIFF"
- WM_APPEND_ONCE([$wm_cv_imgfmt_tiff], [GFXLIBS])
- AC_DEFINE([USE_TIFF], [1],
- [defined when valid TIFF library with header was found])])
- ])
-AM_CONDITIONAL([USE_TIFF], [test "x$enable_tiff" != "xno"])dnl
+[WM_LIB_CHECK([TIFF],
+ ["-ltiff" + dnl TIFF can have a dependancy over zlib
+ "-ltiff -lz" "-ltiff -lz -lm" + dnl It may also have a dependancy to
jpeg_lib
+ "-ltiff -ljpeg" "-ltiff -ljpeg -lz" "-ltiff -ljpeg -lz -lm" + dnl
There is also a possible dependancy on JBIGKit
+ "-ltiff -ljpeg -ljbig -lz" + dnl Probably for historical reasons?
+ "-ltiff34" "-ltiff34 -ljpeg" "-ltiff34 -ljpeg -lm"],
+ [TIFFGetVersion], [$XLFLAGS $XLIBS],
+ [wm_save_CFLAGS="$CFLAGS"
+ AS_IF([wm_fn_lib_try_compile "tiffio.h" "" "return 0" ""],
+ [],
+ [AC_MSG_ERROR([found $CACHEVAR but could not find appropriate header
- are you missing libtiff-dev package?])])
+ AS_IF([wm_fn_lib_try_compile "tiffio.h" 'const char *filename = "dummy";'
'TIFFOpen(filename, "r")' ""],
+ [],
+ [AC_MSG_ERROR([found $CACHEVAR and header, but cannot compile -
unsupported version?])])
+ CFLAGS="$wm_save_CFLAGS"],
+ [supported_gfx], [GFXLIBS])dnl
]) dnl AC_DEFUN
http://repo.or.cz/w/wmaker-crm.git/commit/64ee8eb85261b97279b7aa59029a7e4a6806bf18
commit 64ee8eb85261b97279b7aa59029a7e4a6806bf18
Author: Christophe CURIS <[email protected]>
Date: Sun Nov 17 22:30:16 2013 +0100
configure: Created new macro to append only once a flag to a variable
Signed-off-by: Christophe CURIS <[email protected]>
diff --git a/m4/windowmaker.m4 b/m4/windowmaker.m4
index 1eca694..fbab215 100644
--- a/m4/windowmaker.m4
+++ b/m4/windowmaker.m4
@@ -102,3 +102,22 @@ $[]2], [ $[]3;])],
AS_SET_STATUS([$wm_retval])
}
])
+
+
+# WM_APPEND_ONCE
+# --------------
+#
+# Append flags to a variable, but only if not already present
+#
+# Usage: WM_APPEND_ONCE([libflags], [variable])
+# $1 libflags: the list of flag to append
+# $2 variable: the variable, if unset use LIBS
+AC_DEFUN([WM_APPEND_ONCE],
+[AS_VAR_PUSHDEF([VAR], [m4_ifnblank([$2], [$2], [LIBS])])dnl
+for wm_arg in $1 ; do
+ AS_IF([echo " $VAR " | grep " $wm_arg " 2>&1 >/dev/null],
+ [@%:@ Flag already present in VAR],
+ [VAR="$VAR $wm_arg"])
+done
+AS_VAR_POPDEF([VAR])dnl
+])
diff --git a/m4/wm_imgfmt_check.m4 b/m4/wm_imgfmt_check.m4
index 2104203..df7b59e 100644
--- a/m4/wm_imgfmt_check.m4
+++ b/m4/wm_imgfmt_check.m4
@@ -70,12 +70,12 @@ const char *filename = "dummy";],
[unsupported="$unsupported GIF"
enable_gif="no"],
[supported_gfx="$supported_gfx GIF"
- GFXLIBS="$GFXLIBS `echo "$wm_cv_imgfmt_gif" | sed -e 's,
*version:.*,,' `"
+ WM_APPEND_ONCE([`echo "$wm_cv_imgfmt_gif" | sed -e 's, *version:.*,,'
`], [GFXLIBS])
AC_DEFINE_UNQUOTED([USE_GIF],
[`echo "$wm_cv_imgfmt_gif" | sed -e 's,.*version:,,' `],
[defined when valid GIF library with header was found])])
])
- AM_CONDITIONAL([USE_GIF], [test "x$enable_gif" != "xno"])dnl
+AM_CONDITIONAL([USE_GIF], [test "x$enable_gif" != "xno"])dnl
]) dnl AC_DEFUN
@@ -128,7 +128,7 @@ AS_IF([test "x$enable_jpeg" = "xno"],
[unsupported="$unsupported JPEG"
enable_jpeg="no"],
[supported_gfx="$supported_gfx JPEG"
- GFXLIBS="$GFXLIBS $wm_cv_imgfmt_jpeg"
+ WM_APPEND_ONCE([$wm_cv_imgfmt_jpeg], [GFXLIBS])
AC_DEFINE([USE_JPEG], [1],
[defined when valid JPEG library with header was found])])
])
@@ -180,7 +180,7 @@ AS_IF([test "x$enable_png" = "xno"],
[unsupported="$unsupported PNG"
enable_png="no"],
[supported_gfx="$supported_gfx PNG"
- GFXLIBS="$GFXLIBS $wm_cv_imgfmt_png"
+ WM_APPEND_ONCE([$wm_cv_imgfmt_png], [GFXLIBS])
AC_DEFINE([USE_PNG], [1],
[defined when valid PNG library with header was found])])
])
@@ -240,7 +240,7 @@ AS_IF([test "x$enable_tiff" = "xno"],
[unsupported="$unsupported TIFF"
enable_tiff="no"],
[supported_gfx="$supported_gfx TIFF"
- GFXLIBS="$GFXLIBS $wm_cv_imgfmt_tiff"
+ WM_APPEND_ONCE([$wm_cv_imgfmt_tiff], [GFXLIBS])
AC_DEFINE([USE_TIFF], [1],
[defined when valid TIFF library with header was found])])
])
@@ -289,7 +289,7 @@ AS_IF([test "x$enable_xpm" = "xno"],
[supported_gfx="$supported_gfx builtin-XPM"
enable_xpm="no"],
[supported_gfx="$supported_gfx XPM"
- GFXLIBS="$GFXLIBS $wm_cv_imgfmt_xpm"
+ WM_APPEND_ONCE([$wm_cv_imgfmt_xpm], [GFXLIBS])
AC_DEFINE([USE_XPM], [1],
[defined when valid XPM library with header was found])])
])
-----------------------------------------------------------------------
Summary of changes:
m4/windowmaker.m4 | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
--
wmaker-crm.git ("The Window Maker window manager")
--
To unsubscribe, send mail to [email protected].