1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-03 12:24:17 +01:00

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 <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2013-11-17 18:51:20 +01:00
committed by Carlos R. Mafra
parent 062f6dd59d
commit b8b59d939d
2 changed files with 46 additions and 22 deletions

View File

@@ -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 ==============================================