Improved X extension detection in configure and added handling
of dpms.h headers that don't have function prototypes.
This commit is contained in:
parent
91d1fcf38d
commit
719757ca22
80
configure.in
80
configure.in
|
@ -97,37 +97,75 @@ if test x"$acx_host_winapi" = xXWINDOWS; then
|
||||||
AC_PATH_XTRA
|
AC_PATH_XTRA
|
||||||
save_CPPFLAGS="$CPPFLAGS"
|
save_CPPFLAGS="$CPPFLAGS"
|
||||||
CPPFLAGS="$X_CFLAGS $CPPFLAGS"
|
CPPFLAGS="$X_CFLAGS $CPPFLAGS"
|
||||||
|
XEXT_LDADD=
|
||||||
|
|
||||||
AC_CHECK_LIB(Xtst,
|
AC_CHECK_LIB(Xtst,
|
||||||
XTestQueryExtension,
|
XTestQueryExtension,
|
||||||
[X_LIBS="$X_LIBS -lXtst"],
|
[XEXT_LDADD="$XEXT_LDADD -lXtst"],
|
||||||
AC_MSG_ERROR(You must have the XTest library to build synergy),
|
AC_MSG_ERROR(You must have the XTest library to build synergy),
|
||||||
[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
|
[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
|
||||||
AC_CHECK_HEADERS([X11/extensions/XTest.h],,
|
AC_CHECK_HEADERS([X11/extensions/XTest.h],
|
||||||
|
,
|
||||||
AC_MSG_ERROR(You must have the XTest headers to compile synergy))
|
AC_MSG_ERROR(You must have the XTest headers to compile synergy))
|
||||||
AC_CHECK_HEADERS([X11/extensions/Xinerama.h],
|
|
||||||
[acx_xinerama_lib_ok=yes],
|
acx_have_xinerama=yes
|
||||||
[acx_xinerama_lib_ok=no],
|
AC_CHECK_LIB(Xinerama,
|
||||||
[#include <X11/Xlib.h>])
|
XineramaQueryExtension,
|
||||||
if test x"$acx_xinerama_lib_ok" = xyes; then
|
[acx_have_xinerama=yes],
|
||||||
AC_CHECK_LIB(Xinerama,
|
[acx_have_xinerama=no],
|
||||||
XineramaQueryExtension,
|
[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
|
||||||
[X_LIBS="$X_LIBS -lXinerama"],
|
if test x"$acx_have_xinerama" = xyes; then
|
||||||
[AC_DEFINE(HAVE_X11_EXTENSIONS_XINERAMA_H, 0)],
|
AC_CHECK_HEADERS([X11/extensions/Xinerama.h],
|
||||||
[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
|
[acx_have_xinerama=yes],
|
||||||
|
[acx_have_xinerama=no],
|
||||||
|
[#include <X11/Xlib.h>])
|
||||||
fi
|
fi
|
||||||
AC_CHECK_HEADERS([X11/extensions/dpms.h],
|
if test x"$acx_have_xinerama" = xyes; then
|
||||||
[acx_dpms_lib_ok=yes],
|
XEXT_LDADD="$XEXT_LDADD -lXinerama"
|
||||||
[acx_dpms_lib_ok=no],
|
fi
|
||||||
[#include <X11/Xlib.h>])
|
|
||||||
if test x"$acx_dpms_lib_ok" = xyes; then
|
X_DPMS_LDADD=
|
||||||
AC_CHECK_LIB(Xext,
|
acx_have_dpms=no
|
||||||
|
AC_CHECK_LIB(Xext,
|
||||||
|
DPMSQueryExtension,
|
||||||
|
[acx_have_dpms=yes],
|
||||||
|
[acx_have_dpms=no],
|
||||||
|
[$X_LIBS -lX11 $X_EXTRA_LIBS])
|
||||||
|
if test x"$acx_have_dpms" != xyes; then
|
||||||
|
AC_CHECK_LIB(Xdpms,
|
||||||
DPMSQueryExtension,
|
DPMSQueryExtension,
|
||||||
[true],
|
[acx_have_dpms=yes; XDPMS_LDADD=-lXdpms],
|
||||||
[AC_DEFINE(HAVE_X11_EXTENSIONS_DPMS_H, 0)],
|
[acx_have_dpms=no],
|
||||||
[$X_LIBS -lX11 $X_EXTRA_LIBS])
|
[$X_LIBS -lX11 $X_EXTRA_LIBS])
|
||||||
fi
|
fi
|
||||||
|
if test x"$acx_have_dpms" = xyes; then
|
||||||
|
AC_CHECK_HEADERS([X11/extensions/dpms.h],
|
||||||
|
[acx_have_dpms_h=yes],
|
||||||
|
[acx_have_dpms_h=no],
|
||||||
|
[#include <X11/Xlib.h>])
|
||||||
|
if test x"$acx_have_dpms_h" = xyes; then
|
||||||
|
XEXT_LDADD="$XEXT_LDADD $XDPMS_LDADD"
|
||||||
|
AC_MSG_CHECKING(for prototypes in X11/extensions/dpms.h)
|
||||||
|
acx_have_dpms_protos=no
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
extern "C" {
|
||||||
|
#include <X11/extensions/dpms.h>
|
||||||
|
}
|
||||||
|
],[
|
||||||
|
int s = DPMSModeOn;
|
||||||
|
DPMSQueryExtension(0, 0, 0);
|
||||||
|
],
|
||||||
|
[acx_have_dpms_protos=yes])
|
||||||
|
AC_MSG_RESULT($acx_have_dpms_protos)
|
||||||
|
if test x"$acx_have_dpms_protos" = xyes; then
|
||||||
|
AC_DEFINE(HAVE_DPMS_PROTOTYPES,1,[Define if the <X11/extensions/dpms.h> header file declares function prototypes.])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
CPPFLAGS="$save_CPPFLAGS"
|
CPPFLAGS="$save_CPPFLAGS"
|
||||||
ARCH_LIBS="$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $ARCH_LIBS"
|
ARCH_LIBS="$X_LIBS $X_PRE_LIBS $XEXT_LDADD -lXext -lX11 $X_EXTRA_LIBS $ARCH_LIBS"
|
||||||
ARCH_CFLAGS="$ARCH_CFLAGS $X_CFLAGS"
|
ARCH_CFLAGS="$ARCH_CFLAGS $X_CFLAGS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,22 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
# include <X11/Xmd.h>
|
# include <X11/Xmd.h>
|
||||||
# include <X11/extensions/dpms.h>
|
# include <X11/extensions/dpms.h>
|
||||||
|
# if !HAVE_DPMS_PROTOTYPES
|
||||||
|
# undef DPMSModeOn
|
||||||
|
# undef DPMSModeStandby
|
||||||
|
# undef DPMSModeSuspend
|
||||||
|
# undef DPMSModeOff
|
||||||
|
# define DPMSModeOn 0
|
||||||
|
# define DPMSModeStandby 1
|
||||||
|
# define DPMSModeSuspend 2
|
||||||
|
# define DPMSModeOff 3
|
||||||
|
extern Bool DPMSQueryExtension(Display *, int *, int *);
|
||||||
|
extern Bool DPMSCapable(Display *);
|
||||||
|
extern Status DPMSEnable(Display *);
|
||||||
|
extern Status DPMSDisable(Display *);
|
||||||
|
extern Status DPMSForceLevel(Display *, CARD16);
|
||||||
|
extern Status DPMSInfo(Display *, CARD16 *, BOOL *);
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue