Code refactoring: replaced macro 'SHAPE' by 'USE_XSHAPE' 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 <christophe.curis@free.fr>
configure: made the functions to try lib link+compile more generic

The function can have a wider use, so moved then to a more neutral place
and gave them more generic names.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
configure: Created new macro to append only once a flag to a variable

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
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 <christophe.curis@free.fr>
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 <christophe.curis@free.fr>
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 <christophe.curis@free.fr>
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 <christophe.curis@free.fr>
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 <christophe.curis@free.fr>
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 <christophe.curis@free.fr>
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 <christophe.curis@free.fr>
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>
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>