source: vendor/synergy/current/configure.in@ 3181

Last change on this file since 3181 was 2749, checked in by bird, 19 years ago

synergy v1.3.1 sources (zip).

File size: 8.4 KB
Line 
1dnl synergy -- mouse and keyboard sharing utility
2dnl Copyright (C) 2002 Chris Schoeneman
3dnl
4dnl This package is free software; you can redistribute it and/or
5dnl modify it under the terms of the GNU General Public License
6dnl found in the file COPYING that should have accompanied this file.
7dnl
8dnl This package is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11dnl GNU General Public License for more details.
12
13dnl Process this file with autoconf to produce a configure script.
14
15dnl initialize
16AC_INIT(lib/common/common.h)
17AC_CONFIG_AUX_DIR(config)
18
19dnl current version, extracted from $srcdir/lib/common/Version.h
20MAJOR_VERSION=`grep '#.*define VERSION "' $srcdir/lib/common/Version.h | sed -e 's/.*"\([0-9]*\)\.[0-9]*\.[0-9]*".*/\1/'`
21MINOR_VERSION=`grep '#.*define VERSION "' $srcdir/lib/common/Version.h | sed -e 's/.*"[0-9]*\.\([0-9]*\)\.[0-9]*".*/\1/'`
22RELEASE_VERSION=`grep '#.*define VERSION "' $srcdir/lib/common/Version.h | sed -e 's/.*"[0-9]*\.[0-9]*\.\([0-9]*\)".*/\1/'`
23
24dnl initialize automake
25AM_INIT_AUTOMAKE(synergy, $MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION)
26AM_CONFIG_HEADER(config.h)
27
28dnl information on the package
29
30dnl decide on platform
31ARCH_LIBS=""
32ARCH_CFLAGS=""
33AC_CANONICAL_HOST
34case $host in
35*-*-mingw32* | *-*-windows*)
36 acx_host_arch="WIN32"
37 acx_host_winapi="MSWINDOWS"
38 ;;
39*-*-darwin*)
40 acx_host_arch="UNIX"
41 acx_host_winapi="CARBON"
42 ;;
43*)
44 acx_host_arch="UNIX"
45 acx_host_winapi="XWINDOWS"
46 ;;
47esac
48ARCH_CFLAGS="$ARCH_CFLAGS -DSYSAPI_$acx_host_arch=1 -DWINAPI_$acx_host_winapi=1"
49AM_CONDITIONAL(WIN32, test x$acx_host_arch = xWIN32)
50AM_CONDITIONAL(UNIX, test x$acx_host_arch = xUNIX)
51AM_CONDITIONAL(MSWINDOWS, test x$acx_host_winapi = xMSWINDOWS)
52AM_CONDITIONAL(CARBON, test x$acx_host_winapi = xCARBON)
53AM_CONDITIONAL(XWINDOWS, test x$acx_host_winapi = xXWINDOWS)
54
55dnl checks for programs
56AC_PROG_CC
57AC_PROG_CXX
58AC_PROG_RANLIB
59AC_CHECK_PROG(HAVE_DOT, dot, YES, NO)
60
61dnl AC_PROG_OBJC doesn't exist. Borrow some ideas from KDE.
62dnl AC_MSG_CHECKING(for an Objective-C compiler)
63OBJC="${CC}"
64OBJCFLAGS="${CFLAGS}"
65AC_SUBST(OBJC)
66AC_SUBST(OBJCFLAGS)
67_AM_DEPENDENCIES(OBJC)
68
69dnl do checks using C++
70AC_LANG_CPLUSPLUS
71
72dnl our files end in .cpp not .C so tests should also end in .cpp
73ac_ext=cpp
74
75dnl enable debugging or disable asserts
76AC_ARG_ENABLE([debug], [ --enable-debug enable debugging])
77if test "x$enable_debug" != xno; then
78 CXXFLAGS="$CXXFLAGS -g"
79else
80 CXXFLAGS="$CXXFLAGS -DNDEBUG"
81fi
82
83dnl check compiler
84ACX_CHECK_CXX
85
86dnl checks for libraries
87if test x"$acx_host_arch" = xUNIX; then
88 ACX_PTHREAD(,AC_MSG_ERROR(You must have pthreads to compile synergy))
89 ARCH_LIBS="$PTHREAD_LIBS $ARCH_LIBS"
90 ARCH_CFLAGS="$ARCH_CFLAGS $PTHREAD_CFLAGS"
91fi
92if test x"$acx_host_winapi" = xCARBON; then
93 ARCH_LIBS="-framework Carbon $ARCH_LIBS"
94fi
95ACX_CHECK_NANOSLEEP
96ACX_CHECK_INET_ATON
97
98dnl checks for header files
99AC_HEADER_STDC
100AC_CHECK_HEADERS([unistd.h sys/time.h sys/types.h locale.h wchar.h])
101AC_CHECK_HEADERS([sys/socket.h sys/select.h])
102AC_CHECK_HEADERS([sys/utsname.h])
103AC_CHECK_HEADERS([istream ostream sstream])
104AC_HEADER_TIME
105if test x"$acx_host_winapi" = xXWINDOWS; then
106 AC_PATH_X
107 AC_PATH_XTRA
108 save_CPPFLAGS="$CPPFLAGS"
109 CPPFLAGS="$X_CFLAGS $CPPFLAGS"
110 XEXT_LDADD=
111
112 AC_CHECK_LIB(Xtst,
113 XTestQueryExtension,
114 [XEXT_LDADD="$XEXT_LDADD -lXtst"],
115 AC_MSG_ERROR(You must have the XTest library to build synergy),
116 [$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
117 AC_CHECK_HEADERS([X11/extensions/XTest.h],
118 ,
119 AC_MSG_ERROR(You must have the XTest headers to compile synergy))
120
121 acx_have_xkb=no
122 AC_CHECK_LIB(X11,
123 XkbQueryExtension,
124 [acx_have_xkb=yes],
125 [acx_have_xkb=no],
126 [$X_LIBS $X_EXTRA_LIBS])
127 if test x"$acx_have_xkb" = xyes; then
128 AC_CHECK_HEADERS([X11/XKBlib.h X11/extensions/XKBstr.h],
129 [acx_have_xkb=yes],
130 [acx_have_xkb=no],
131 [#include <X11/Xlib.h>])
132 if test x"$acx_have_xkb" = xyes; then
133 AC_TRY_COMPILE([
134 #include <X11/Xlib.h>
135 #include <X11/XKBlib.h>
136 ],[
137 XkbQueryExtension(0, 0, 0, 0, 0, 0);
138 ],
139 [acx_have_xkb=yes],
140 [acx_have_xkb=no])
141 fi
142 fi
143 if test x"$acx_have_xkb" = xyes; then
144 AC_DEFINE(HAVE_XKB_EXTENSION, 1,
145 [Define this if the XKB extension is available.])
146 fi
147
148 acx_have_xinerama=yes
149 AC_CHECK_LIB(Xinerama,
150 XineramaQueryExtension,
151 [acx_have_xinerama=yes],
152 [acx_have_xinerama=no],
153 [$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
154 if test x"$acx_have_xinerama" = xyes; then
155 AC_CHECK_HEADERS([X11/extensions/Xinerama.h],
156 [acx_have_xinerama=yes],
157 [acx_have_xinerama=no],
158 [#include <X11/Xlib.h>])
159 fi
160 if test x"$acx_have_xinerama" = xyes; then
161 XEXT_LDADD="$XEXT_LDADD -lXinerama"
162 fi
163
164 X_DPMS_LDADD=
165 acx_have_dpms=no
166 AC_CHECK_LIB(Xext,
167 DPMSQueryExtension,
168 [acx_have_dpms=yes],
169 [acx_have_dpms=no],
170 [$X_LIBS -lX11 $X_EXTRA_LIBS])
171 if test x"$acx_have_dpms" != xyes; then
172 AC_CHECK_LIB(Xdpms,
173 DPMSQueryExtension,
174 [acx_have_dpms=yes; XDPMS_LDADD=-lXdpms],
175 [acx_have_dpms=no],
176 [$X_LIBS -lX11 $X_EXTRA_LIBS])
177 fi
178 if test x"$acx_have_dpms" = xyes; then
179 AC_CHECK_HEADERS([X11/extensions/dpms.h],
180 [acx_have_dpms_h=yes],
181 [acx_have_dpms_h=no],
182 [#include <X11/Xlib.h>])
183 if test x"$acx_have_dpms_h" = xyes; then
184 XEXT_LDADD="$XEXT_LDADD $XDPMS_LDADD"
185 AC_MSG_CHECKING(for prototypes in X11/extensions/dpms.h)
186 acx_have_dpms_protos=no
187 AC_TRY_COMPILE([
188 #include <X11/Xlib.h>
189 extern "C" {
190 #include <X11/extensions/dpms.h>
191 }
192 ],[
193 int s = DPMSModeOn;
194 DPMSQueryExtension(0, 0, 0);
195 ],
196 [acx_have_dpms_protos=yes])
197 AC_MSG_RESULT($acx_have_dpms_protos)
198 if test x"$acx_have_dpms_protos" = xyes; then
199 AC_DEFINE(HAVE_DPMS_PROTOTYPES,1,[Define if the <X11/extensions/dpms.h> header file declares function prototypes.])
200 fi
201 fi
202 fi
203
204 CPPFLAGS="$save_CPPFLAGS"
205 ARCH_LIBS="$X_LIBS $X_PRE_LIBS $XEXT_LDADD -lXext -lX11 $X_EXTRA_LIBS $ARCH_LIBS"
206 ARCH_CFLAGS="$ARCH_CFLAGS $X_CFLAGS"
207fi
208
209dnl checks for types
210AC_TYPE_SIZE_T
211ACX_CHECK_SOCKLEN_T
212
213dnl checks for structures
214AC_STRUCT_TM
215
216dnl checks for compiler characteristics
217AC_CHECK_SIZEOF(char, 1)
218AC_CHECK_SIZEOF(short, 2)
219AC_CHECK_SIZEOF(int, 2)
220AC_CHECK_SIZEOF(long, 4)
221ACX_CHECK_CXX_BOOL(,AC_MSG_ERROR(Your compiler must support bool to compile synergy))
222ACX_CHECK_CXX_EXCEPTIONS(,AC_MSG_ERROR(Your compiler must support exceptions to compile synergy))
223ACX_CHECK_CXX_CASTS(,AC_MSG_ERROR(Your compiler must support C++ casts to compile synergy))
224ACX_CHECK_CXX_MUTABLE(,AC_MSG_ERROR(Your compiler must support mutable to compile synergy))
225ACX_CHECK_CXX_STDLIB(,AC_MSG_ERROR(Your compiler must support the C++ standard library to compile synergy))
226
227dnl checks for library functions
228dnl AC_TYPE_SIGNAL
229AC_FUNC_MEMCMP
230AC_FUNC_STRFTIME
231AC_CHECK_FUNCS(gmtime_r)
232ACX_CHECK_GETPWUID_R
233AC_CHECK_FUNCS(vsnprintf)
234AC_FUNC_SELECT_ARGTYPES
235ACX_CHECK_POLL
236dnl use AC_REPLACE_FUNCS() for stuff in string.h
237
238dnl checks for system services
239
240dnl enable maximum compiler warnings and warnings are errors.
241ACX_CXX_WARNINGS
242ACX_CXX_WARNINGS_ARE_ERRORS
243
244dnl adjust compiler and linker variables
245CXXFLAGS="$CXXFLAGS $SYNERGY_CXXFLAGS $ARCH_CFLAGS"
246OBJCXXFLAGS="$OBJCXXFLAGS $CXXFLAGS $ARCH_CFLAGS"
247LIBS="$NANOSLEEP_LIBS $INET_ATON_LIBS $ARCH_LIBS $LIBS"
248
249dnl we need to have an environment variable set when building on OS X.
250dnl i'm not sure of the right way to do that. writing 'export ...' to
251dnl the makefiles isn't portable. here we'll hijack XXXDEPMODE (where
252dnl XXX depends on the language) to insert setting the environment
253dnl variable when running the compiler. we'd like to put that in CC,
254dnl CXX and OBJC but that breaks depcomp. let's hope this works.
255if test x"$acx_host_winapi" = xCARBON; then
256 MACOSX_DEPLOYMENT_TARGET="10.2"
257 CCDEPMODE="MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET $CCDEPMODE"
258 CXXDEPMODE="MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET $CXXDEPMODE"
259 OBJCDEPMODE="MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET $OBJCDEPMODE"
260else
261 MACOSX_DEPLOYMENT_TARGET="5"
262 CXXDEPMODE="FOO=$MACOSX_DEPLOYMENT_TARGET $CXXDEPMODE"
263fi
264
265AC_OUTPUT([
266Makefile
267cmd/Makefile
268cmd/launcher/Makefile
269cmd/synergyc/Makefile
270cmd/synergys/Makefile
271dist/Makefile
272dist/nullsoft/Makefile
273dist/rpm/Makefile
274dist/rpm/synergy.spec
275doc/Makefile
276doc/doxygen.cfg
277lib/Makefile
278lib/arch/Makefile
279lib/base/Makefile
280lib/client/Makefile
281lib/common/Makefile
282lib/io/Makefile
283lib/mt/Makefile
284lib/net/Makefile
285lib/platform/Makefile
286lib/server/Makefile
287lib/synergy/Makefile
288])
Note: See TracBrowser for help on using the repository browser.