1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | |
---|
3 | dnl required versions of other tools. |
---|
4 | m4_define([req_ver_glib], [1.3.11]) |
---|
5 | m4_define([req_ver_gtk], [2.1.0]) |
---|
6 | m4_define([req_ver_libbonobo], [1.107.0]) |
---|
7 | m4_define([req_ver_libspi], [0.12.1]) |
---|
8 | m4_define([req_ver_orbit], [2.3.100]) |
---|
9 | |
---|
10 | AC_INIT(magnifier/magnifier.c) |
---|
11 | |
---|
12 | dnl libtool versioning from libgnome |
---|
13 | |
---|
14 | GNOME_MAG_MAJOR_VERSION=0 |
---|
15 | GNOME_MAG_MINOR_VERSION=11 |
---|
16 | GNOME_MAG_INTERFACE_AGE=9 |
---|
17 | dnl below should change if the interface has additions, changes, removals. |
---|
18 | GNOME_MAG_CURRENT=`expr $GNOME_MAG_MINOR_VERSION - $GNOME_MAG_INTERFACE_AGE` |
---|
19 | |
---|
20 | dnl increment any time the source you release changes; set to |
---|
21 | dnl 0 if you increment CURRENT |
---|
22 | GNOME_MAG_REVISION=14 |
---|
23 | GNOME_MAG_MICRO_VERSION=$GNOME_MAG_REVISION |
---|
24 | |
---|
25 | dnl increment if any interfaces have been added; set to 0 |
---|
26 | dnl if any interfaces have been removed. removasl has |
---|
27 | dnl precedence over adding, so set to 0 if both happened. |
---|
28 | GNOME_MAG_AGE=0 |
---|
29 | |
---|
30 | AC_SUBST(GNOME_MAG_CURRENT) |
---|
31 | AC_SUBST(GNOME_MAG_REVISION) |
---|
32 | AC_SUBST(GNOME_MAG_AGE) |
---|
33 | LT_VERSION_INFO='-version-info ${GNOME_MAG_CURRENT}:${GNOME_MAG_REVISION}:${GNOME_MAG_AGE}' |
---|
34 | AC_SUBST(LT_VERSION_INFO) |
---|
35 | |
---|
36 | AM_CONFIG_HEADER(config.h) |
---|
37 | GNOME_MAG_VERSION="$GNOME_MAG_MAJOR_VERSION.$GNOME_MAG_MINOR_VERSION.$GNOME_MAG_MICRO_VERSION" |
---|
38 | AM_INIT_AUTOMAKE(gnome-mag, $GNOME_MAG_VERSION) |
---|
39 | AM_MAINTAINER_MODE |
---|
40 | |
---|
41 | AC_PROG_INTLTOOL |
---|
42 | |
---|
43 | AC_PROG_CC |
---|
44 | AC_LIBTOOL_WIN32_DLL |
---|
45 | AC_PROG_INSTALL |
---|
46 | AC_ISC_POSIX |
---|
47 | |
---|
48 | dnl GNOME_COMPILE_WARNINGS(maximum) |
---|
49 | |
---|
50 | AM_DISABLE_STATIC |
---|
51 | AM_PROG_LIBTOOL |
---|
52 | |
---|
53 | ALL_LINGUAS="ang ar az be bg bn br bs ca cs cy da de el en_CA en_GB es et eu fa fi fr ga gu he hi hr hu id is it ja ka ko lt lv mi mn ms nb ne nl nn no or pa pl pt pt_BR ro ru sk sl sq sr sr@Latn sv ta th tk tr uk vi zh_CN zh_TW" |
---|
54 | GETTEXT_PACKAGE=gnome-mag |
---|
55 | AC_SUBST(GETTEXT_PACKAGE) |
---|
56 | AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext package]) |
---|
57 | |
---|
58 | AM_GLIB_GNU_GETTEXT |
---|
59 | |
---|
60 | AC_MSG_CHECKING([for Win32]) |
---|
61 | case "$host" in |
---|
62 | *-*-mingw*) |
---|
63 | gnome_mag_native_win32=yes |
---|
64 | ;; |
---|
65 | *) |
---|
66 | gnome_mag_native_win32=no |
---|
67 | ;; |
---|
68 | esac |
---|
69 | AC_MSG_RESULT([$gnome_mag_native_win32]) |
---|
70 | AM_CONDITIONAL(OS_WIN32, test "$gnome_mag_native_win32" = "yes") |
---|
71 | |
---|
72 | if test "$gnome_mag_native_win32" = "yes"; then |
---|
73 | AC_CHECK_PROG(ms_librarian, lib.exe, yes, no) |
---|
74 | fi |
---|
75 | AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes) |
---|
76 | |
---|
77 | dnl Cache $ACLOCAL_FLAGS |
---|
78 | AC_CACHE_CHECK([for aclocal flags], ac_cv_atk_aclocal_flags,[ |
---|
79 | ac_cv_atk_aclocal_flags="$ACLOCAL_FLAGS" |
---|
80 | ]) |
---|
81 | ACLOCAL="$ACLOCAL $ac_cv_atk_aclocal_flags" |
---|
82 | |
---|
83 | AC_ARG_ENABLE(rebuilds, [ --disable-rebuilds disable all source autogeneration rules],,enable_rebuilds=yes) |
---|
84 | |
---|
85 | AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging [default=no]],,enable_debug=no) |
---|
86 | if test "$enable_debug" = "yes"; then |
---|
87 | GNOME_MAG_DEBUG_CFLAGS="-DG_ENABLE_DEBUG" |
---|
88 | else |
---|
89 | GNOME_MAG_DEBUG_CFLAGS="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED" |
---|
90 | fi |
---|
91 | AC_SUBST(GNOME_MAG_DEBUG_CFLAGS) |
---|
92 | |
---|
93 | changequote(,)dnl |
---|
94 | if test "x$GCC" = "xyes"; then |
---|
95 | case " $CFLAGS " in |
---|
96 | *[\ \ ]-Wall[\ \ ]*) ;; |
---|
97 | *) CFLAGS="$CFLAGS -Wall" ;; |
---|
98 | esac |
---|
99 | fi |
---|
100 | changequote([,])dnl |
---|
101 | |
---|
102 | AC_PATH_XTRA |
---|
103 | |
---|
104 | dnl test for X libraries |
---|
105 | if test x$no_x = xyes ; then |
---|
106 | AC_MSG_ERROR([X development libraries not found]) |
---|
107 | else |
---|
108 | X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS" |
---|
109 | fi |
---|
110 | |
---|
111 | dnl path to Xtst |
---|
112 | AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, XTST_LIBS=-lXtst) |
---|
113 | if test "x$XTST_LIBS" = x; then |
---|
114 | save_LIBS="$LIBS" |
---|
115 | for xtstpath in /usr/X11R6/lib /usr/openwin/lib $x_libraries; do |
---|
116 | LIBS="-L$xtstpath -lXtst" |
---|
117 | case "$host" in |
---|
118 | *solaris*) XTST_RPATH_FLAGS="-R$xtstpath" ;; |
---|
119 | esac |
---|
120 | AC_MSG_CHECKING(for -lXtst in $xtstpath) |
---|
121 | AC_TRY_LINK([], [XTestFakeKeyEvent()], [ |
---|
122 | AC_MSG_RESULT(yes) |
---|
123 | XTST_LIBS="$XTST_RPATH_FLAGS -L$xtstpath -lXtst" |
---|
124 | LIBS="$save_LIBS" |
---|
125 | break],[AC_MSG_RESULT(no)]) |
---|
126 | done |
---|
127 | if test "x$XTST_LIBS" = x; then |
---|
128 | AC_MSG_ERROR(Couldn't find the Xtst library. Check config.log for details) |
---|
129 | else |
---|
130 | X_LIBS="$X_LIBS $XTST_LIBS" |
---|
131 | AC_DEFINE(HAVE_XTST, 1, [The XTest extension is present]) |
---|
132 | fi |
---|
133 | fi |
---|
134 | |
---|
135 | dnl path to DAMAGE |
---|
136 | AC_CHECK_LIB(Xdamage, XDamageCreate, XDAMAGE_LIBS=-lXdamage) |
---|
137 | if test "x$XDAMAGE_LIBS" = x; then |
---|
138 | save_LIBS="$LIBS" |
---|
139 | for xdamagepath in /usr/X11R6/lib /usr/openwin/lib /usr/openwin/sfw/lib /opt/fdo/lib $x_libraries; do |
---|
140 | LIBS="-L$xdamagepath -lXdamage -lX11" |
---|
141 | case "$host" in |
---|
142 | *solaris*) XDAMAGE_RPATH_FLAGS="-R$xdamagepath" ;; |
---|
143 | esac |
---|
144 | AC_MSG_CHECKING(for -lXdamage in $xdamagepath) |
---|
145 | AC_TRY_LINK([], [XDamageCreate()], [ |
---|
146 | AC_MSG_RESULT(yes) |
---|
147 | XDAMAGE_LIBS="$XDAMAGE_RPATH_FLAGS -L$xdamagepath -lXdamage" |
---|
148 | LIBS="$save_LIBS" |
---|
149 | break],[AC_MSG_RESULT(no)]) |
---|
150 | done |
---|
151 | if test "x$XDAMAGE_LIBS" = x; then |
---|
152 | AC_MSG_WARN(Couldn't find the DAMAGE library. Check config.log for details) |
---|
153 | LIBS="$save_LIBS" |
---|
154 | else |
---|
155 | X_LIBS="$X_LIBS $XDAMAGE_LIBS" |
---|
156 | CFLAGS="-I /opt/fdo/include $CFLAGS" |
---|
157 | AC_CHECK_HEADER(X11/extensions/Xdamage.h, have_xdamage=yes) |
---|
158 | if test "x$have_xdamage" = x; then |
---|
159 | AC_CHECK_HEADER(X11/Xdamage.h, have_xdamage=yes) |
---|
160 | fi |
---|
161 | AC_DEFINE(HAVE_DAMAGE, 1, [The DAMAGE extension is present]) |
---|
162 | fi |
---|
163 | fi |
---|
164 | |
---|
165 | dnl path to XFIXES |
---|
166 | AC_CHECK_LIB(Xfixes, XFixesCreateRegion, XFIXES_LIBS=-lXfixes) |
---|
167 | if test "x$XFIXES_LIBS" = x; then |
---|
168 | save_LIBS="$LIBS" |
---|
169 | for xfixespath in /usr/X11R6/lib /usr/openwin/lib /usr/openwin/sfw/lib /opt/fdo/lib $x_libraries; do |
---|
170 | LIBS="-L$xfixespath -lXfixes -lX11" |
---|
171 | case "$host" in |
---|
172 | *solaris*) XFIXES_RPATH_FLAGS="-R$xfixespath" ;; |
---|
173 | esac |
---|
174 | AC_MSG_CHECKING(for -lXfixes in $xfixespath) |
---|
175 | AC_TRY_LINK([], [XFixesCreateRegion()], [ |
---|
176 | AC_MSG_RESULT(yes) |
---|
177 | XFIXES_LIBS="$XFIXES_RPATH_FLAGS -L$xfixespath -lXfixes" |
---|
178 | LIBS="$save_LIBS" |
---|
179 | break],[AC_MSG_RESULT(no)]) |
---|
180 | done |
---|
181 | if test "x$XFIXES_LIBS" = x; then |
---|
182 | AC_MSG_WARN(Couldn't find the XFIXES library. Check config.log for details) |
---|
183 | LIBS="$save_LIBS" |
---|
184 | else |
---|
185 | X_LIBS="$X_LIBS $XFIXES_LIBS" |
---|
186 | CFLAGS="-I /opt/fdo/include $CFLAGS" |
---|
187 | AC_CHECK_HEADER(X11/extensions/Xfixes.h, have_xfixes=yes) |
---|
188 | AC_DEFINE(HAVE_XFIXES, 1, [The XFIXES extension is present]) |
---|
189 | fi |
---|
190 | fi |
---|
191 | |
---|
192 | AC_SUBST(X_LIBS) |
---|
193 | |
---|
194 | PKG_CHECK_MODULES(DEPS, [ |
---|
195 | libloginhelper-1.0 >= 1.5.2 |
---|
196 | libbonobo-2.0 >= 1.107.0 |
---|
197 | ORBit-2.0 >= 2.3.100 |
---|
198 | glib-2.0 >= 1.3.11 |
---|
199 | gtk+-2.0 >= 2.1.0 |
---|
200 | gdk-pixbuf-2.0 >= 2.1.0 |
---|
201 | gdk-pixbuf-xlib-2.0 >= 2.1.0 |
---|
202 | ]) |
---|
203 | AC_SUBST(DEPS_LIBS) |
---|
204 | DEPS_CFLAGS="-I /opt/fdo/include $DEPS_CFLAGS" |
---|
205 | AC_SUBST(DEPS_CFLAGS) |
---|
206 | |
---|
207 | PKG_CHECK_MODULES(TEST, [ |
---|
208 | libspi-1.0 >= 1.5.0 |
---|
209 | libbonobo-2.0 >= 1.107.0 |
---|
210 | ORBit-2.0 >= 2.3.100 |
---|
211 | glib-2.0 >= 1.3.11 |
---|
212 | gtk+-2.0 >= 2.1.0 |
---|
213 | gdk-pixbuf-2.0 >= 2.1.0 |
---|
214 | gdk-pixbuf-xlib-2.0 >= 2.1.0 |
---|
215 | ]) |
---|
216 | AC_SUBST(TEST_LIBS) |
---|
217 | AC_SUBST(TEST_CFLAGS) |
---|
218 | |
---|
219 | old_LIBS="$LIBS" |
---|
220 | dnl Checks for inet libraries: |
---|
221 | AC_SEARCH_LIBS(gethostent, nsl) |
---|
222 | AC_SEARCH_LIBS(setsockopt, socket) |
---|
223 | AC_SEARCH_LIBS(connect, inet) |
---|
224 | |
---|
225 | INET_LIBS="$LIBS" |
---|
226 | AC_SUBST(INET_LIBS) |
---|
227 | |
---|
228 | LIBS="$old_LIBS" |
---|
229 | |
---|
230 | |
---|
231 | dnl orbit-idl. |
---|
232 | ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`" |
---|
233 | AC_SUBST(ORBIT_IDL) |
---|
234 | |
---|
235 | dnl Bonobo and Bonobo-Activation idl files |
---|
236 | BONOBO_ACTIVATION_IDL_DIR="`$PKG_CONFIG --variable=idldir bonobo-activation-2.0`" |
---|
237 | LIBBONOBO_IDL_DIR="`$PKG_CONFIG --variable=idldir libbonobo-2.0`" |
---|
238 | AC_SUBST(BONOBO_ACTIVATION_IDL_DIR) |
---|
239 | AC_SUBST(LIBBONOBO_IDL_DIR) |
---|
240 | |
---|
241 | AC_CHECK_LIB(popt, poptGetContext, [POPT_LIBS="-lpopt"], |
---|
242 | AC_MSG_ERROR([popt is required to build gnome-mag. |
---|
243 | You can download the latest version from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/])) |
---|
244 | AC_SUBST(POPT_LIBS) |
---|
245 | AC_MSG_CHECKING([for POPT_ARG_FLOAT in popt.h]) |
---|
246 | AC_TRY_CPP([#include <popt.h> |
---|
247 | #ifndef POPT_ARG_FLOAT |
---|
248 | #error popt too old |
---|
249 | #endif], AC_MSG_RESULT(yes), [ |
---|
250 | AC_MSG_RESULT(no) |
---|
251 | AC_MSG_ERROR([A newer version of popt is required to build gnome-mag. |
---|
252 | You can download the latest version from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/]) |
---|
253 | ]) |
---|
254 | |
---|
255 | |
---|
256 | AC_OUTPUT([ |
---|
257 | Makefile |
---|
258 | gnome-mag-1.0.pc |
---|
259 | po/Makefile.in |
---|
260 | idl/Makefile |
---|
261 | magnifier/Makefile |
---|
262 | cursors/Makefile |
---|
263 | cursors/1_32/Makefile |
---|
264 | test/Makefile |
---|
265 | ]) |
---|