Fixed bugs in configuration. Wasn't doing configuration for DPMS
and Xinerama correctly. Also was using '#if defined(...)' instead of '#if ...' for testing configure macros in some places. This yields the wrong answer if the macro is set to 0, which means missing/disabled.
This commit is contained in:
parent
12c95723b7
commit
91d1fcf38d
28
configure.in
28
configure.in
|
@ -104,23 +104,27 @@ if test x"$acx_host_winapi" = xXWINDOWS; then
|
|||
[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
|
||||
AC_CHECK_HEADERS([X11/extensions/XTest.h],,
|
||||
AC_MSG_ERROR(You must have the XTest headers to compile synergy))
|
||||
AC_CHECK_LIB(Xinerama,
|
||||
XineramaQueryExtension,
|
||||
[X_LIBS="$X_LIBS -lXinerama"],
|
||||
AC_CHECK_HEADERS([X11/extensions/Xinerama.h],
|
||||
[acx_xinerama_lib_ok=yes],
|
||||
[acx_xinerama_lib_ok=no],
|
||||
[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
|
||||
if test x"$acx_xinerama_lib_ok" != xno; then
|
||||
AC_CHECK_HEADERS([X11/extensions/Xinerama.h],,,
|
||||
[#include <X11/Xlib.h>])
|
||||
[#include <X11/Xlib.h>])
|
||||
if test x"$acx_xinerama_lib_ok" = xyes; then
|
||||
AC_CHECK_LIB(Xinerama,
|
||||
XineramaQueryExtension,
|
||||
[X_LIBS="$X_LIBS -lXinerama"],
|
||||
[AC_DEFINE(HAVE_X11_EXTENSIONS_XINERAMA_H, 0)],
|
||||
[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
|
||||
fi
|
||||
AC_CHECK_LIB(Xext,
|
||||
DPMSQueryExtension,
|
||||
AC_CHECK_HEADERS([X11/extensions/dpms.h],
|
||||
[acx_dpms_lib_ok=yes],
|
||||
[acx_dpms_lib_ok=no],
|
||||
[$X_LIBS -lX11 $X_EXTRA_LIBS])
|
||||
[#include <X11/Xlib.h>])
|
||||
if test x"$acx_dpms_lib_ok" = xyes; then
|
||||
AC_CHECK_HEADERS([X11/extensions/dpms.h],,,
|
||||
[#include <X11/Xlib.h>])
|
||||
AC_CHECK_LIB(Xext,
|
||||
DPMSQueryExtension,
|
||||
[true],
|
||||
[AC_DEFINE(HAVE_X11_EXTENSIONS_DPMS_H, 0)],
|
||||
[$X_LIBS -lX11 $X_EXTRA_LIBS])
|
||||
fi
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
ARCH_LIBS="$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $ARCH_LIBS"
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_SOCKLEN_T)
|
||||
#if !HAVE_SOCKLEN_T
|
||||
typedef int socklen_t;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*/
|
||||
|
||||
#include "stdpre.h"
|
||||
#if defined(HAVE_ISTREAM)
|
||||
#if HAVE_ISTREAM
|
||||
#include <istream>
|
||||
#else
|
||||
#include <iostream>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*/
|
||||
|
||||
#include "stdpre.h"
|
||||
#if defined(HAVE_OSTREAM)
|
||||
#if HAVE_OSTREAM
|
||||
#include <ostream>
|
||||
#else
|
||||
#include <iostream>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "stdpre.h"
|
||||
|
||||
#if defined(HAVE_SSTREAM) || !defined(__GNUC__) || (__GNUC__ >= 3)
|
||||
#if HAVE_SSTREAM || !defined(__GNUC__) || (__GNUC__ >= 3)
|
||||
|
||||
#include <sstream>
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "stdmap.h"
|
||||
#include "stdlist.h"
|
||||
#include "stdvector.h"
|
||||
#if defined(X_DISPLAY_MISSING)
|
||||
#if X_DISPLAY_MISSING
|
||||
# error X11 is required to build synergy
|
||||
#else
|
||||
# include <X11/Xlib.h>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "IEventQueueBuffer.h"
|
||||
#include "CMutex.h"
|
||||
#include "stdvector.h"
|
||||
#if defined(X_DISPLAY_MISSING)
|
||||
#if X_DISPLAY_MISSING
|
||||
# error X11 is required to build synergy
|
||||
#else
|
||||
# include <X11/Xlib.h>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "CXWindowsUtil.h"
|
||||
#include "CLog.h"
|
||||
#include "CStringUtil.h"
|
||||
#if defined(X_DISPLAY_MISSING)
|
||||
#if X_DISPLAY_MISSING
|
||||
# error X11 is required to build synergy
|
||||
#else
|
||||
# include <X11/X.h>
|
||||
|
@ -92,7 +92,7 @@
|
|||
#endif
|
||||
|
||||
// map special KeyID keys to KeySyms
|
||||
#if defined(HAVE_X11_XF86KEYSYM_H)
|
||||
#if HAVE_X11_XF86KEYSYM_H
|
||||
static const KeySym g_mapE000[] =
|
||||
{
|
||||
/* 0x00 */ 0, XF86XK_Eject, 0, 0, 0, 0, 0, 0,
|
||||
|
@ -647,7 +647,7 @@ CXWindowsKeyState::keyIDToKeySym(KeyID id, KeyModifierMask mask) const
|
|||
if ((id & 0xfffff000) == 0xe000) {
|
||||
// special character
|
||||
switch (id & 0x0000ff00) {
|
||||
#if defined(HAVE_X11_XF86KEYSYM_H)
|
||||
#if HAVE_X11_XF86KEYSYM_H
|
||||
case 0xe000:
|
||||
return g_mapE000[id & 0xff];
|
||||
#endif
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
|
||||
#include "CKeyState.h"
|
||||
#include "stdmap.h"
|
||||
#if defined(X_DISPLAY_MISSING)
|
||||
#if X_DISPLAY_MISSING
|
||||
# error X11 is required to build synergy
|
||||
#else
|
||||
# include <X11/Xlib.h>
|
||||
# if defined(HAVE_X11_EXTENSIONS_XTEST_H)
|
||||
# if HAVE_X11_EXTENSIONS_XTEST_H
|
||||
# include <X11/extensions/XTest.h>
|
||||
# else
|
||||
# error The XTest extension is required to build synergy
|
||||
|
|
|
@ -26,14 +26,14 @@
|
|||
#include "IEventQueue.h"
|
||||
#include "TMethodEventJob.h"
|
||||
#include <cstring>
|
||||
#if defined(X_DISPLAY_MISSING)
|
||||
#if X_DISPLAY_MISSING
|
||||
# error X11 is required to build synergy
|
||||
#else
|
||||
# include <X11/X.h>
|
||||
# include <X11/Xutil.h>
|
||||
# define XK_XKB_KEYS
|
||||
# include <X11/keysymdef.h>
|
||||
# if defined(HAVE_X11_EXTENSIONS_XTEST_H)
|
||||
# if HAVE_X11_EXTENSIONS_XTEST_H
|
||||
# include <X11/extensions/XTest.h>
|
||||
# else
|
||||
# error The XTest extension is required to build synergy
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "CPlatformScreen.h"
|
||||
#include "stdvector.h"
|
||||
#if defined(X_DISPLAY_MISSING)
|
||||
#if X_DISPLAY_MISSING
|
||||
# error X11 is required to build synergy
|
||||
#else
|
||||
# include <X11/Xlib.h>
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
#include "IEventQueue.h"
|
||||
#include "TMethodEventJob.h"
|
||||
#include <X11/Xatom.h>
|
||||
#if defined(HAVE_X11_EXTENSIONS_XTEST_H)
|
||||
#if HAVE_X11_EXTENSIONS_XTEST_H
|
||||
# include <X11/extensions/XTest.h>
|
||||
#else
|
||||
# error The XTest extension is required to build synergy
|
||||
#endif
|
||||
#if defined(HAVE_X11_EXTENSIONS_DPMS_H)
|
||||
#if HAVE_X11_EXTENSIONS_DPMS_H
|
||||
extern "C" {
|
||||
# include <X11/Xmd.h>
|
||||
# include <X11/extensions/dpms.h>
|
||||
|
@ -60,7 +60,7 @@ CXWindowsScreenSaver::CXWindowsScreenSaver(
|
|||
|
||||
// check for DPMS extension. this is an alternative screen saver
|
||||
// that powers down the display.
|
||||
#if defined(HAVE_X11_EXTENSIONS_DPMS_H)
|
||||
#if HAVE_X11_EXTENSIONS_DPMS_H
|
||||
int eventBase, errorBase;
|
||||
if (DPMSQueryExtension(m_display, &eventBase, &errorBase)) {
|
||||
if (DPMSCapable(m_display)) {
|
||||
|
@ -509,7 +509,7 @@ CXWindowsScreenSaver::handleDisableTimer(const CEvent&, void*)
|
|||
void
|
||||
CXWindowsScreenSaver::activateDPMS(bool activate)
|
||||
{
|
||||
#if defined(HAVE_X11_EXTENSIONS_DPMS_H)
|
||||
#if HAVE_X11_EXTENSIONS_DPMS_H
|
||||
if (m_dpms) {
|
||||
// DPMSForceLevel will generate a BadMatch if DPMS is disabled
|
||||
CXWindowsUtil::CErrorLock lock(m_display);
|
||||
|
@ -521,7 +521,7 @@ CXWindowsScreenSaver::activateDPMS(bool activate)
|
|||
void
|
||||
CXWindowsScreenSaver::enableDPMS(bool enable)
|
||||
{
|
||||
#if defined(HAVE_X11_EXTENSIONS_DPMS_H)
|
||||
#if HAVE_X11_EXTENSIONS_DPMS_H
|
||||
if (m_dpms) {
|
||||
if (enable) {
|
||||
DPMSEnable(m_display);
|
||||
|
@ -536,7 +536,7 @@ CXWindowsScreenSaver::enableDPMS(bool enable)
|
|||
bool
|
||||
CXWindowsScreenSaver::isDPMSEnabled() const
|
||||
{
|
||||
#if defined(HAVE_X11_EXTENSIONS_DPMS_H)
|
||||
#if HAVE_X11_EXTENSIONS_DPMS_H
|
||||
if (m_dpms) {
|
||||
CARD16 level;
|
||||
BOOL state;
|
||||
|
@ -554,7 +554,7 @@ CXWindowsScreenSaver::isDPMSEnabled() const
|
|||
bool
|
||||
CXWindowsScreenSaver::isDPMSActivated() const
|
||||
{
|
||||
#if defined(HAVE_X11_EXTENSIONS_DPMS_H)
|
||||
#if HAVE_X11_EXTENSIONS_DPMS_H
|
||||
if (m_dpms) {
|
||||
CARD16 level;
|
||||
BOOL state;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "IScreenSaver.h"
|
||||
#include "stdmap.h"
|
||||
#if defined(X_DISPLAY_MISSING)
|
||||
#if X_DISPLAY_MISSING
|
||||
# error X11 is required to build synergy
|
||||
#else
|
||||
# include <X11/Xlib.h>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "BasicTypes.h"
|
||||
#include "stdmap.h"
|
||||
#include "stdvector.h"
|
||||
#if defined(X_DISPLAY_MISSING)
|
||||
#if X_DISPLAY_MISSING
|
||||
# error X11 is required to build synergy
|
||||
#else
|
||||
# include <X11/Xlib.h>
|
||||
|
|
Loading…
Reference in New Issue