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:
crs 2004-10-28 21:40:56 +00:00
parent 12c95723b7
commit 91d1fcf38d
14 changed files with 39 additions and 35 deletions

View File

@ -104,23 +104,27 @@ if test x"$acx_host_winapi" = xXWINDOWS; then
[$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_xinerama_lib_ok=no],
[#include <X11/Xlib.h>])
if test x"$acx_xinerama_lib_ok" = xyes; then
AC_CHECK_LIB(Xinerama, AC_CHECK_LIB(Xinerama,
XineramaQueryExtension, XineramaQueryExtension,
[X_LIBS="$X_LIBS -lXinerama"], [X_LIBS="$X_LIBS -lXinerama"],
[acx_xinerama_lib_ok=no], [AC_DEFINE(HAVE_X11_EXTENSIONS_XINERAMA_H, 0)],
[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS]) [$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>])
fi fi
AC_CHECK_LIB(Xext, AC_CHECK_HEADERS([X11/extensions/dpms.h],
DPMSQueryExtension,
[acx_dpms_lib_ok=yes], [acx_dpms_lib_ok=yes],
[acx_dpms_lib_ok=no], [acx_dpms_lib_ok=no],
[$X_LIBS -lX11 $X_EXTRA_LIBS])
if test x"$acx_dpms_lib_ok" = xyes; then
AC_CHECK_HEADERS([X11/extensions/dpms.h],,,
[#include <X11/Xlib.h>]) [#include <X11/Xlib.h>])
if test x"$acx_dpms_lib_ok" = xyes; then
AC_CHECK_LIB(Xext,
DPMSQueryExtension,
[true],
[AC_DEFINE(HAVE_X11_EXTENSIONS_DPMS_H, 0)],
[$X_LIBS -lX11 $X_EXTRA_LIBS])
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 -lXext -lX11 $X_EXTRA_LIBS $ARCH_LIBS"

View File

@ -24,7 +24,7 @@
# include <sys/socket.h> # include <sys/socket.h>
#endif #endif
#if !defined(HAVE_SOCKLEN_T) #if !HAVE_SOCKLEN_T
typedef int socklen_t; typedef int socklen_t;
#endif #endif

View File

@ -13,7 +13,7 @@
*/ */
#include "stdpre.h" #include "stdpre.h"
#if defined(HAVE_ISTREAM) #if HAVE_ISTREAM
#include <istream> #include <istream>
#else #else
#include <iostream> #include <iostream>

View File

@ -13,7 +13,7 @@
*/ */
#include "stdpre.h" #include "stdpre.h"
#if defined(HAVE_OSTREAM) #if HAVE_OSTREAM
#include <ostream> #include <ostream>
#else #else
#include <iostream> #include <iostream>

View File

@ -14,7 +14,7 @@
#include "stdpre.h" #include "stdpre.h"
#if defined(HAVE_SSTREAM) || !defined(__GNUC__) || (__GNUC__ >= 3) #if HAVE_SSTREAM || !defined(__GNUC__) || (__GNUC__ >= 3)
#include <sstream> #include <sstream>

View File

@ -20,7 +20,7 @@
#include "stdmap.h" #include "stdmap.h"
#include "stdlist.h" #include "stdlist.h"
#include "stdvector.h" #include "stdvector.h"
#if defined(X_DISPLAY_MISSING) #if X_DISPLAY_MISSING
# error X11 is required to build synergy # error X11 is required to build synergy
#else #else
# include <X11/Xlib.h> # include <X11/Xlib.h>

View File

@ -18,7 +18,7 @@
#include "IEventQueueBuffer.h" #include "IEventQueueBuffer.h"
#include "CMutex.h" #include "CMutex.h"
#include "stdvector.h" #include "stdvector.h"
#if defined(X_DISPLAY_MISSING) #if X_DISPLAY_MISSING
# error X11 is required to build synergy # error X11 is required to build synergy
#else #else
# include <X11/Xlib.h> # include <X11/Xlib.h>

View File

@ -16,7 +16,7 @@
#include "CXWindowsUtil.h" #include "CXWindowsUtil.h"
#include "CLog.h" #include "CLog.h"
#include "CStringUtil.h" #include "CStringUtil.h"
#if defined(X_DISPLAY_MISSING) #if X_DISPLAY_MISSING
# error X11 is required to build synergy # error X11 is required to build synergy
#else #else
# include <X11/X.h> # include <X11/X.h>
@ -92,7 +92,7 @@
#endif #endif
// map special KeyID keys to KeySyms // map special KeyID keys to KeySyms
#if defined(HAVE_X11_XF86KEYSYM_H) #if HAVE_X11_XF86KEYSYM_H
static const KeySym g_mapE000[] = static const KeySym g_mapE000[] =
{ {
/* 0x00 */ 0, XF86XK_Eject, 0, 0, 0, 0, 0, 0, /* 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) { if ((id & 0xfffff000) == 0xe000) {
// special character // special character
switch (id & 0x0000ff00) { switch (id & 0x0000ff00) {
#if defined(HAVE_X11_XF86KEYSYM_H) #if HAVE_X11_XF86KEYSYM_H
case 0xe000: case 0xe000:
return g_mapE000[id & 0xff]; return g_mapE000[id & 0xff];
#endif #endif

View File

@ -17,11 +17,11 @@
#include "CKeyState.h" #include "CKeyState.h"
#include "stdmap.h" #include "stdmap.h"
#if defined(X_DISPLAY_MISSING) #if X_DISPLAY_MISSING
# error X11 is required to build synergy # error X11 is required to build synergy
#else #else
# include <X11/Xlib.h> # include <X11/Xlib.h>
# if defined(HAVE_X11_EXTENSIONS_XTEST_H) # if HAVE_X11_EXTENSIONS_XTEST_H
# include <X11/extensions/XTest.h> # include <X11/extensions/XTest.h>
# else # else
# error The XTest extension is required to build synergy # error The XTest extension is required to build synergy

View File

@ -26,14 +26,14 @@
#include "IEventQueue.h" #include "IEventQueue.h"
#include "TMethodEventJob.h" #include "TMethodEventJob.h"
#include <cstring> #include <cstring>
#if defined(X_DISPLAY_MISSING) #if X_DISPLAY_MISSING
# error X11 is required to build synergy # error X11 is required to build synergy
#else #else
# include <X11/X.h> # include <X11/X.h>
# include <X11/Xutil.h> # include <X11/Xutil.h>
# define XK_XKB_KEYS # define XK_XKB_KEYS
# include <X11/keysymdef.h> # include <X11/keysymdef.h>
# if defined(HAVE_X11_EXTENSIONS_XTEST_H) # if HAVE_X11_EXTENSIONS_XTEST_H
# include <X11/extensions/XTest.h> # include <X11/extensions/XTest.h>
# else # else
# error The XTest extension is required to build synergy # error The XTest extension is required to build synergy

View File

@ -17,7 +17,7 @@
#include "CPlatformScreen.h" #include "CPlatformScreen.h"
#include "stdvector.h" #include "stdvector.h"
#if defined(X_DISPLAY_MISSING) #if X_DISPLAY_MISSING
# error X11 is required to build synergy # error X11 is required to build synergy
#else #else
# include <X11/Xlib.h> # include <X11/Xlib.h>

View File

@ -20,12 +20,12 @@
#include "IEventQueue.h" #include "IEventQueue.h"
#include "TMethodEventJob.h" #include "TMethodEventJob.h"
#include <X11/Xatom.h> #include <X11/Xatom.h>
#if defined(HAVE_X11_EXTENSIONS_XTEST_H) #if HAVE_X11_EXTENSIONS_XTEST_H
# include <X11/extensions/XTest.h> # include <X11/extensions/XTest.h>
#else #else
# error The XTest extension is required to build synergy # error The XTest extension is required to build synergy
#endif #endif
#if defined(HAVE_X11_EXTENSIONS_DPMS_H) #if HAVE_X11_EXTENSIONS_DPMS_H
extern "C" { extern "C" {
# include <X11/Xmd.h> # include <X11/Xmd.h>
# include <X11/extensions/dpms.h> # include <X11/extensions/dpms.h>
@ -60,7 +60,7 @@ CXWindowsScreenSaver::CXWindowsScreenSaver(
// check for DPMS extension. this is an alternative screen saver // check for DPMS extension. this is an alternative screen saver
// that powers down the display. // that powers down the display.
#if defined(HAVE_X11_EXTENSIONS_DPMS_H) #if HAVE_X11_EXTENSIONS_DPMS_H
int eventBase, errorBase; int eventBase, errorBase;
if (DPMSQueryExtension(m_display, &eventBase, &errorBase)) { if (DPMSQueryExtension(m_display, &eventBase, &errorBase)) {
if (DPMSCapable(m_display)) { if (DPMSCapable(m_display)) {
@ -509,7 +509,7 @@ CXWindowsScreenSaver::handleDisableTimer(const CEvent&, void*)
void void
CXWindowsScreenSaver::activateDPMS(bool activate) CXWindowsScreenSaver::activateDPMS(bool activate)
{ {
#if defined(HAVE_X11_EXTENSIONS_DPMS_H) #if HAVE_X11_EXTENSIONS_DPMS_H
if (m_dpms) { if (m_dpms) {
// DPMSForceLevel will generate a BadMatch if DPMS is disabled // DPMSForceLevel will generate a BadMatch if DPMS is disabled
CXWindowsUtil::CErrorLock lock(m_display); CXWindowsUtil::CErrorLock lock(m_display);
@ -521,7 +521,7 @@ CXWindowsScreenSaver::activateDPMS(bool activate)
void void
CXWindowsScreenSaver::enableDPMS(bool enable) CXWindowsScreenSaver::enableDPMS(bool enable)
{ {
#if defined(HAVE_X11_EXTENSIONS_DPMS_H) #if HAVE_X11_EXTENSIONS_DPMS_H
if (m_dpms) { if (m_dpms) {
if (enable) { if (enable) {
DPMSEnable(m_display); DPMSEnable(m_display);
@ -536,7 +536,7 @@ CXWindowsScreenSaver::enableDPMS(bool enable)
bool bool
CXWindowsScreenSaver::isDPMSEnabled() const CXWindowsScreenSaver::isDPMSEnabled() const
{ {
#if defined(HAVE_X11_EXTENSIONS_DPMS_H) #if HAVE_X11_EXTENSIONS_DPMS_H
if (m_dpms) { if (m_dpms) {
CARD16 level; CARD16 level;
BOOL state; BOOL state;
@ -554,7 +554,7 @@ CXWindowsScreenSaver::isDPMSEnabled() const
bool bool
CXWindowsScreenSaver::isDPMSActivated() const CXWindowsScreenSaver::isDPMSActivated() const
{ {
#if defined(HAVE_X11_EXTENSIONS_DPMS_H) #if HAVE_X11_EXTENSIONS_DPMS_H
if (m_dpms) { if (m_dpms) {
CARD16 level; CARD16 level;
BOOL state; BOOL state;

View File

@ -17,7 +17,7 @@
#include "IScreenSaver.h" #include "IScreenSaver.h"
#include "stdmap.h" #include "stdmap.h"
#if defined(X_DISPLAY_MISSING) #if X_DISPLAY_MISSING
# error X11 is required to build synergy # error X11 is required to build synergy
#else #else
# include <X11/Xlib.h> # include <X11/Xlib.h>

View File

@ -19,7 +19,7 @@
#include "BasicTypes.h" #include "BasicTypes.h"
#include "stdmap.h" #include "stdmap.h"
#include "stdvector.h" #include "stdvector.h"
#if defined(X_DISPLAY_MISSING) #if X_DISPLAY_MISSING
# error X11 is required to build synergy # error X11 is required to build synergy
#else #else
# include <X11/Xlib.h> # include <X11/Xlib.h>