2002-08-02 19:57:46 +00:00
|
|
|
dnl synergy -- mouse and keyboard sharing utility
|
|
|
|
dnl Copyright (C) 2002 Chris Schoeneman
|
|
|
|
dnl
|
|
|
|
dnl This package is free software; you can redistribute it and/or
|
|
|
|
dnl modify it under the terms of the GNU General Public License
|
|
|
|
dnl found in the file COPYING that should have accompanied this file.
|
|
|
|
dnl
|
|
|
|
dnl This package is distributed in the hope that it will be useful,
|
|
|
|
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
dnl GNU General Public License for more details.
|
|
|
|
|
2002-06-18 19:44:34 +00:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
|
2002-08-01 11:45:21 +00:00
|
|
|
dnl initialize
|
2003-01-04 22:01:32 +00:00
|
|
|
AC_INIT(lib/common/common.h)
|
2002-06-19 08:23:08 +00:00
|
|
|
AC_CONFIG_AUX_DIR(config)
|
2002-08-01 11:45:21 +00:00
|
|
|
|
2004-09-27 20:53:54 +00:00
|
|
|
dnl current version, extracted from $srcdir/lib/common/Version.h
|
|
|
|
MAJOR_VERSION=`grep '#.*define VERSION "' $srcdir/lib/common/Version.h | sed -e 's/.*"\([0-9]*\)\.[0-9]*\.[0-9]*".*/\1/'`
|
|
|
|
MINOR_VERSION=`grep '#.*define VERSION "' $srcdir/lib/common/Version.h | sed -e 's/.*"[0-9]*\.\([0-9]*\)\.[0-9]*".*/\1/'`
|
|
|
|
RELEASE_VERSION=`grep '#.*define VERSION "' $srcdir/lib/common/Version.h | sed -e 's/.*"[0-9]*\.[0-9]*\.\([0-9]*\)".*/\1/'`
|
2002-08-01 11:45:21 +00:00
|
|
|
|
|
|
|
dnl initialize automake
|
|
|
|
AM_INIT_AUTOMAKE(synergy, $MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION)
|
|
|
|
AM_CONFIG_HEADER(config.h)
|
2002-06-18 19:44:34 +00:00
|
|
|
|
|
|
|
dnl information on the package
|
|
|
|
|
2004-04-11 14:58:08 +00:00
|
|
|
dnl decide on platform
|
|
|
|
ARCH_LIBS=""
|
|
|
|
ARCH_CFLAGS=""
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
case $host in
|
2004-05-01 12:11:28 +00:00
|
|
|
*-*-mingw32* | *-*-windows*)
|
2004-04-11 14:58:08 +00:00
|
|
|
acx_host_arch="WIN32"
|
|
|
|
acx_host_winapi="MSWINDOWS"
|
|
|
|
;;
|
2004-05-01 12:11:28 +00:00
|
|
|
*-*-darwin*)
|
2004-04-11 14:58:08 +00:00
|
|
|
acx_host_arch="UNIX"
|
2004-05-15 19:41:46 +00:00
|
|
|
acx_host_winapi="CARBON"
|
2004-04-11 14:58:08 +00:00
|
|
|
;;
|
2004-05-01 12:11:28 +00:00
|
|
|
*)
|
2004-04-11 14:58:08 +00:00
|
|
|
acx_host_arch="UNIX"
|
|
|
|
acx_host_winapi="XWINDOWS"
|
|
|
|
;;
|
|
|
|
esac
|
2004-05-01 10:12:06 +00:00
|
|
|
ARCH_CFLAGS="$ARCH_CFLAGS -DSYSAPI_$acx_host_arch=1 -DWINAPI_$acx_host_winapi=1"
|
2004-04-11 14:58:08 +00:00
|
|
|
AM_CONDITIONAL(WIN32, test x$acx_host_arch = xWIN32)
|
|
|
|
AM_CONDITIONAL(UNIX, test x$acx_host_arch = xUNIX)
|
|
|
|
AM_CONDITIONAL(MSWINDOWS, test x$acx_host_winapi = xMSWINDOWS)
|
|
|
|
AM_CONDITIONAL(CARBON, test x$acx_host_winapi = xCARBON)
|
|
|
|
AM_CONDITIONAL(XWINDOWS, test x$acx_host_winapi = xXWINDOWS)
|
|
|
|
|
2002-06-18 19:44:34 +00:00
|
|
|
dnl checks for programs
|
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_RANLIB
|
2002-12-22 14:51:41 +00:00
|
|
|
AC_CHECK_PROG(HAVE_DOT, dot, YES, NO)
|
2002-06-18 19:44:34 +00:00
|
|
|
|
2002-09-01 10:31:10 +00:00
|
|
|
dnl do checks using C++
|
2002-09-01 16:43:47 +00:00
|
|
|
AC_LANG_CPLUSPLUS
|
2002-09-01 10:31:10 +00:00
|
|
|
|
2002-12-25 10:35:59 +00:00
|
|
|
dnl our files end in .cpp not .C so tests should also end in .cpp
|
|
|
|
ac_ext=cpp
|
|
|
|
|
2004-05-12 19:12:28 +00:00
|
|
|
dnl enable debugging or disable asserts
|
2004-05-15 19:41:46 +00:00
|
|
|
AC_ARG_ENABLE([debug], [ --enable-debug enable debugging])
|
2004-05-12 19:12:28 +00:00
|
|
|
if test "x$enable_debug" != xno; then
|
|
|
|
CXXFLAGS="$CXXFLAGS -g"
|
|
|
|
else
|
|
|
|
CXXFLAGS="$CXXFLAGS -DNDEBUG"
|
|
|
|
fi
|
|
|
|
|
2002-12-25 10:35:59 +00:00
|
|
|
dnl check compiler
|
|
|
|
ACX_CHECK_CXX
|
|
|
|
|
2002-10-28 22:49:21 +00:00
|
|
|
dnl checks for libraries
|
2004-04-11 14:58:08 +00:00
|
|
|
if test x"$acx_host_arch" = xUNIX; then
|
|
|
|
ACX_PTHREAD(,AC_MSG_ERROR(You must have pthreads to compile synergy))
|
|
|
|
ARCH_LIBS="$PTHREAD_LIBS $ARCH_LIBS"
|
|
|
|
ARCH_CFLAGS="$ARCH_CFLAGS $PTHREAD_CFLAGS"
|
|
|
|
fi
|
|
|
|
if test x"$acx_host_winapi" = xCARBON; then
|
|
|
|
ARCH_LIBS="-framework Carbon $ARCH_LIBS"
|
|
|
|
fi
|
2002-10-28 22:49:21 +00:00
|
|
|
ACX_CHECK_NANOSLEEP
|
2002-12-25 10:35:59 +00:00
|
|
|
ACX_CHECK_INET_ATON
|
2002-10-28 22:49:21 +00:00
|
|
|
|
2002-06-18 19:44:34 +00:00
|
|
|
dnl checks for header files
|
|
|
|
AC_HEADER_STDC
|
2004-05-01 10:12:06 +00:00
|
|
|
AC_CHECK_HEADERS([unistd.h sys/time.h sys/types.h wchar.h alloca.h])
|
2002-12-25 10:35:59 +00:00
|
|
|
AC_CHECK_HEADERS([sys/socket.h sys/select.h])
|
2002-09-01 10:31:10 +00:00
|
|
|
AC_CHECK_HEADERS([istream ostream sstream])
|
2002-06-19 12:21:26 +00:00
|
|
|
AC_HEADER_TIME
|
2004-04-11 14:58:08 +00:00
|
|
|
if test x"$acx_host_winapi" = xXWINDOWS; then
|
|
|
|
AC_PATH_X
|
|
|
|
AC_PATH_XTRA
|
|
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$X_CFLAGS $CPPFLAGS"
|
2004-10-30 16:16:32 +00:00
|
|
|
XEXT_LDADD=
|
|
|
|
|
2004-04-11 14:58:08 +00:00
|
|
|
AC_CHECK_LIB(Xtst,
|
|
|
|
XTestQueryExtension,
|
2004-10-30 16:16:32 +00:00
|
|
|
[XEXT_LDADD="$XEXT_LDADD -lXtst"],
|
2004-04-11 14:58:08 +00:00
|
|
|
AC_MSG_ERROR(You must have the XTest library to build synergy),
|
|
|
|
[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
|
2004-10-30 16:16:32 +00:00
|
|
|
AC_CHECK_HEADERS([X11/extensions/XTest.h],
|
|
|
|
,
|
2004-05-15 19:41:46 +00:00
|
|
|
AC_MSG_ERROR(You must have the XTest headers to compile synergy))
|
2004-10-30 16:16:32 +00:00
|
|
|
|
|
|
|
acx_have_xinerama=yes
|
|
|
|
AC_CHECK_LIB(Xinerama,
|
|
|
|
XineramaQueryExtension,
|
|
|
|
[acx_have_xinerama=yes],
|
|
|
|
[acx_have_xinerama=no],
|
|
|
|
[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
|
|
|
|
if test x"$acx_have_xinerama" = xyes; then
|
|
|
|
AC_CHECK_HEADERS([X11/extensions/Xinerama.h],
|
|
|
|
[acx_have_xinerama=yes],
|
|
|
|
[acx_have_xinerama=no],
|
|
|
|
[#include <X11/Xlib.h>])
|
|
|
|
fi
|
|
|
|
if test x"$acx_have_xinerama" = xyes; then
|
|
|
|
XEXT_LDADD="$XEXT_LDADD -lXinerama"
|
2004-05-15 19:41:46 +00:00
|
|
|
fi
|
2004-10-30 16:16:32 +00:00
|
|
|
|
|
|
|
X_DPMS_LDADD=
|
|
|
|
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,
|
2004-10-28 21:40:56 +00:00
|
|
|
DPMSQueryExtension,
|
2004-10-30 16:16:32 +00:00
|
|
|
[acx_have_dpms=yes; XDPMS_LDADD=-lXdpms],
|
|
|
|
[acx_have_dpms=no],
|
2004-10-28 21:40:56 +00:00
|
|
|
[$X_LIBS -lX11 $X_EXTRA_LIBS])
|
2004-05-15 19:41:46 +00:00
|
|
|
fi
|
2004-10-30 16:16:32 +00:00
|
|
|
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
|
|
|
|
|
2004-04-11 14:58:08 +00:00
|
|
|
CPPFLAGS="$save_CPPFLAGS"
|
2004-10-30 16:16:32 +00:00
|
|
|
ARCH_LIBS="$X_LIBS $X_PRE_LIBS $XEXT_LDADD -lXext -lX11 $X_EXTRA_LIBS $ARCH_LIBS"
|
2004-04-11 14:58:08 +00:00
|
|
|
ARCH_CFLAGS="$ARCH_CFLAGS $X_CFLAGS"
|
|
|
|
fi
|
2002-06-18 19:44:34 +00:00
|
|
|
|
|
|
|
dnl checks for types
|
2002-09-01 10:31:10 +00:00
|
|
|
AC_TYPE_SIZE_T
|
2002-12-25 10:35:59 +00:00
|
|
|
ACX_CHECK_SOCKLEN_T
|
2002-06-18 19:44:34 +00:00
|
|
|
|
|
|
|
dnl checks for structures
|
|
|
|
AC_STRUCT_TM
|
|
|
|
|
|
|
|
dnl checks for compiler characteristics
|
2002-06-19 11:23:49 +00:00
|
|
|
AC_CHECK_SIZEOF(char, 1)
|
|
|
|
AC_CHECK_SIZEOF(short, 2)
|
|
|
|
AC_CHECK_SIZEOF(int, 2)
|
|
|
|
AC_CHECK_SIZEOF(long, 4)
|
2002-09-01 10:31:10 +00:00
|
|
|
ACX_CHECK_CXX_BOOL(,AC_MSG_ERROR(Your compiler must support bool to compile synergy))
|
|
|
|
ACX_CHECK_CXX_EXCEPTIONS(,AC_MSG_ERROR(Your compiler must support exceptions to compile synergy))
|
|
|
|
ACX_CHECK_CXX_CASTS(,AC_MSG_ERROR(Your compiler must support C++ casts to compile synergy))
|
|
|
|
ACX_CHECK_CXX_MUTABLE(,AC_MSG_ERROR(Your compiler must support mutable to compile synergy))
|
|
|
|
ACX_CHECK_CXX_STDLIB(,AC_MSG_ERROR(Your compiler must support the C++ standard library to compile synergy))
|
2002-06-18 19:44:34 +00:00
|
|
|
|
|
|
|
dnl checks for library functions
|
|
|
|
dnl AC_TYPE_SIGNAL
|
|
|
|
AC_FUNC_MEMCMP
|
|
|
|
AC_FUNC_STRFTIME
|
2002-06-19 11:58:48 +00:00
|
|
|
AC_CHECK_FUNCS(gmtime_r)
|
2002-11-03 18:09:28 +00:00
|
|
|
ACX_CHECK_GETPWUID_R
|
2002-08-01 11:45:21 +00:00
|
|
|
AC_CHECK_FUNCS(vsnprintf)
|
2002-10-16 22:01:50 +00:00
|
|
|
AC_FUNC_SELECT_ARGTYPES
|
|
|
|
ACX_CHECK_POLL
|
2002-06-18 19:44:34 +00:00
|
|
|
dnl use AC_REPLACE_FUNCS() for stuff in string.h
|
|
|
|
|
|
|
|
dnl checks for system services
|
|
|
|
|
2004-02-28 12:19:49 +00:00
|
|
|
dnl enable maximum compiler warnings and warnings are errors.
|
|
|
|
ACX_CXX_WARNINGS
|
|
|
|
ACX_CXX_WARNINGS_ARE_ERRORS
|
2002-06-18 19:44:34 +00:00
|
|
|
|
2004-04-11 14:58:08 +00:00
|
|
|
dnl adjust compiler and linker variables
|
|
|
|
CXXFLAGS="$CXXFLAGS $SYNERGY_CXXFLAGS $ARCH_CFLAGS"
|
|
|
|
LIBS="$NANOSLEEP_LIBS $INET_ATON_LIBS $ARCH_LIBS $LIBS"
|
2002-06-18 19:44:34 +00:00
|
|
|
|
|
|
|
AC_OUTPUT([
|
|
|
|
Makefile
|
2002-07-30 16:52:46 +00:00
|
|
|
cmd/Makefile
|
2002-08-11 11:49:36 +00:00
|
|
|
cmd/launcher/Makefile
|
2002-08-11 22:43:07 +00:00
|
|
|
cmd/synergyc/Makefile
|
|
|
|
cmd/synergys/Makefile
|
2002-08-01 18:56:54 +00:00
|
|
|
dist/Makefile
|
2004-03-28 20:00:30 +00:00
|
|
|
dist/nullsoft/Makefile
|
2002-08-01 18:56:54 +00:00
|
|
|
dist/rpm/Makefile
|
|
|
|
dist/rpm/synergy.spec
|
2004-08-01 16:00:18 +00:00
|
|
|
doc/Makefile
|
2002-08-02 17:57:54 +00:00
|
|
|
doc/doxygen.cfg
|
2004-04-04 12:12:30 +00:00
|
|
|
lib/Makefile
|
|
|
|
lib/arch/Makefile
|
|
|
|
lib/base/Makefile
|
|
|
|
lib/client/Makefile
|
|
|
|
lib/common/Makefile
|
|
|
|
lib/io/Makefile
|
|
|
|
lib/mt/Makefile
|
|
|
|
lib/net/Makefile
|
|
|
|
lib/platform/Makefile
|
|
|
|
lib/server/Makefile
|
|
|
|
lib/synergy/Makefile
|
2002-06-18 19:44:34 +00:00
|
|
|
])
|