build system: checking to link against extensions (Xinerama, Randr, Shape) is not enough, we have to check the headers as well

This commit is contained in:
Mathias Gumz 2009-10-03 09:06:03 +02:00
parent 8e8939821c
commit 2a85804222

View file

@ -199,24 +199,6 @@ fi
Xext_lib=""
dnl Check for XShape extension support and proper library files.
AC_MSG_CHECKING([whether to build support for the XShape extension])
AC_ARG_ENABLE(
shape, [ --enable-shape enable support of the XShape extension ([default=yes])],
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xext, XShapeCombineShape,
AC_DEFINE(SHAPE, 1, "shaped window support")
LIBS="$LIBS -lXext")
else
AC_MSG_RESULT([no])
fi,
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xext, XShapeCombineShape,
AC_DEFINE(SHAPE, 1, "shaped window support")
LIBS="$LIBS -lXext")
)
dnl Check for the Slit
AC_MSG_CHECKING([whether to include the Slit])
@ -498,60 +480,129 @@ AC_ARG_ENABLE(
)
AM_CONDITIONAL(MULTIBYTE, test x$MULTIBYTE = xtrue)
AC_MSG_CHECKING([whether to have RANDR (The X Resize and Rotate Extension) support])
AC_ARG_ENABLE(
randr,
[ --enable-randr RANDR (The X Resize and Rotate Extension) support ([default=yes])],
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xrandr, XRRQueryExtension,
AC_DEFINE(HAVE_RANDR, 1, "randr support")
LIBS="$LIBS -lXrandr")
else
AC_MSG_RESULT([no])
fi,
dnl Check for Xinerama support and proper library files.
enableval="yes"
AC_MSG_CHECKING([whether to build support for the Xinerama extension])
AC_ARG_ENABLE(xinerama,
AC_HELP_STRING([--enable-xinerama],
[enable support of the Xinerama extension [default=yes]]), ,
[enableval=yes])
if test "x$enableval" = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
AC_TRY_COMPILE(
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xinerama.h>
, XineramaQueryScreens(0, 0),
AC_MSG_RESULT([yes])
AC_DEFINE(XINERAMA, [1], [Define to 1 if you have XINERAMA])
LIBS="$LIBS -lXinerama",
AC_MSG_RESULT([no])))
else
AC_MSG_RESULT([no])
CONFIGOPTS="$CONFIGOPTS --disable-xinerama"
fi
dnl Check for XShape extension support and proper library files.
enableval="yes"
AC_MSG_CHECKING([whether to build support for the XShape extension])
AC_ARG_ENABLE(shape,
AC_HELP_STRING([--enable-shape],
[enable support of the XShape extension [default=yes]]), ,
[enableval=yes])
if test "x$enableval" = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xext, XShapeCombineShape,
AC_MSG_CHECKING([for X11/extensions/shape.h])
AC_TRY_COMPILE(
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/shape.h>
, long foo = ShapeSet,
AC_MSG_RESULT([yes])
AC_DEFINE(SHAPE, [1], [Define to 1 if you have SHAPE])
LIBS="$LIBS -lXext"
FEATURES="$FEATURES XShape",
AC_MSG_RESULT([no])))
else
AC_MSG_RESULT([no])
CONFIGOPTS="$CONFIGOPTS --disable-shape"
fi
dnl Check for RANDR support and proper library files.
enableval="yes"
AC_MSG_CHECKING([whether to build support for the Xrandr (X resize and rotate) extension])
AC_ARG_ENABLE(randr,
AC_HELP_STRING([--enable-randr],
[enable support of the Xrandr extension [default=yes]]), ,
[enableval=yes])
if test "x$enableval" = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xrandr, XRRQueryExtension,
AC_DEFINE(HAVE_RANDR, 1, "randr support")
LIBS="$LIBS -lXrandr")
)
AC_MSG_CHECKING([for X11/extensions/randr.h])
AC_TRY_COMPILE(
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xrandr.h>
, XRRQueryExtension(0, 0, 0),
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_RANDR, [1], [Define to 1 if you have RANDR])
LIBS="$LIBS -lXrandr",
AC_MSG_RESULT([no])))
else
AC_MSG_RESULT([no])
CONFIGOPTS="$CONFIGOPTS --disable-randr"
fi
enableval="yes"
AC_MSG_CHECKING([whether to have RANDR 1.2 support])
AC_ARG_ENABLE(
randr1.2,
[ --enable-randr1.2 RANDR 1.2 support ([default=yes])],
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
AC_DEFINE(HAVE_RANDR1_2, 1, "randr 1.2 support"))
else
AC_MSG_RESULT([no])
fi,
AC_ARG_ENABLE(randr1.2,
AC_HELP_STRING([--enable-randr1.2],
[RANDR 1.2 support [default=yes]]), ,
[enableval=yes])
if test "x$enableval" = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
AC_DEFINE(HAVE_RANDR1_2, 1, "randr 1.2 support"))
)
AC_CHECK_LIB(Xrandr, XRRQueryExtension,
AC_MSG_CHECKING([for X11/extensions/randr.h])
AC_TRY_COMPILE(
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xrandr.h>
, XRRUpdateConfiguration(0),
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_RANDR1_2, [1], [Define to 1 if you have RANDR 1.2])
LIBS="$LIBS -lXrandr",
AC_MSG_RESULT([no])))
else
AC_MSG_RESULT([no])
CONFIGOPTS="$CONFIGOPTS --disable-randr1.2"
fi
dnl Check for Xinerama support
AC_MSG_CHECKING([whether to build support for the Xinerama extension])
AC_ARG_ENABLE(
xinerama,
[ --enable-xinerama enable xinerama extension ([default=yes])],
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
AC_DEFINE(XINERAMA, 1, "Xinerama support")
LIBS="$LIBS -lXinerama")
else
AC_MSG_RESULT([no])
fi,
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
AC_DEFINE(XINERAMA, 1, "Xinerama support")
LIBS="$LIBS -lXinerama")
)
# #
# AC_MSG_CHECKING([whether to have RANDR 1.2 support])
# AC_ARG_ENABLE(
# randr1.2,
# [ --enable-randr1.2 RANDR 1.2 support ([default=yes])],
# if test x$enableval = "xyes"; then
# AC_MSG_RESULT([yes])
# AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
# AC_DEFINE(HAVE_RANDR1_2, 1, "randr 1.2 support"))
# else
# AC_MSG_RESULT([no])
# fi,
# AC_MSG_RESULT([yes])
# AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
# AC_DEFINE(HAVE_RANDR1_2, 1, "randr 1.2 support"))
# )
AC_ARG_WITH(
menu,