]>
Commit | Line | Data |
---|---|---|
1 | dnl Process this file with autoconf to produce a configure script. | |
2 | AC_REVISION($Id$)dnl | |
3 | ||
4 | AC_PREREQ(2.58) | |
5 | ||
6 | dnl --------------------------------------------------------------------------- | |
7 | dnl | |
8 | dnl Top-level configure.in for wxWidgets by Robert Roebling, Phil Blecker, | |
9 | dnl Vadim Zeitlin and Ron Lee | |
10 | dnl | |
11 | dnl This script is under the wxWidgets licence. | |
12 | dnl | |
13 | dnl Version: $Id$ | |
14 | dnl --------------------------------------------------------------------------- | |
15 | ||
16 | dnl --------------------------------------------------------------------------- | |
17 | dnl initialization | |
18 | dnl --------------------------------------------------------------------------- | |
19 | ||
20 | AC_INIT([wxWidgets], [2.8.0], [wx-dev@lists.wxwidgets.org]) | |
21 | ||
22 | dnl the file passed to AC_CONFIG_SRCDIR should be specific to our package | |
23 | AC_CONFIG_SRCDIR([wx-config.in]) | |
24 | ||
25 | dnl sets build, host, target variables and the same with _alias | |
26 | AC_CANONICAL_BUILD | |
27 | AC_CANONICAL_HOST | |
28 | AC_CANONICAL_TARGET | |
29 | ||
30 | ||
31 | dnl When making releases do: | |
32 | dnl | |
33 | dnl wx_release_number += 1 | |
34 | ||
35 | wx_major_version_number=2 | |
36 | wx_minor_version_number=8 | |
37 | wx_release_number=0 | |
38 | wx_subrelease_number=0 | |
39 | ||
40 | WX_RELEASE=$wx_major_version_number.$wx_minor_version_number | |
41 | WX_VERSION=$WX_RELEASE.$wx_release_number | |
42 | WX_SUBVERSION=$WX_VERSION.$wx_subrelease_number | |
43 | ||
44 | WX_MSW_VERSION=$wx_major_version_number$wx_minor_version_number$wx_release_number | |
45 | ||
46 | ||
47 | dnl Autoconf-2.60 changed the meaning of top_builddir variable, so we have | |
48 | dnl to use our own replacement that will work with both 2.5x and 2.60+: | |
49 | wx_top_builddir="`pwd`" | |
50 | AC_SUBST(wx_top_builddir) | |
51 | ||
52 | ||
53 | dnl ------------------------------------------------------------------------ | |
54 | dnl Check platform (host system) | |
55 | dnl ------------------------------------------------------------------------ | |
56 | ||
57 | dnl OS (assume Unix) | |
58 | USE_UNIX=1 | |
59 | USE_OS2=0 | |
60 | USE_WIN32=0 | |
61 | USE_DOS=0 | |
62 | USE_BEOS=0 | |
63 | USE_MAC=0 | |
64 | ||
65 | dnl Unix kind | |
66 | USE_AIX= | |
67 | USE_BSD= dnl any BSD | |
68 | USE_DARWIN= dnl a.k.a. Mac OS X | |
69 | USE_FREEBSD= | |
70 | USE_GNU= dnl GNU/Hurd | |
71 | USE_HPUX= | |
72 | USE_LINUX= | |
73 | USE_NETBSD= | |
74 | USE_OPENBSD= | |
75 | USE_OSF= dnl OSF/1 (obsolete?) | |
76 | USE_SGI= | |
77 | USE_SOLARIS= dnl Solaris ("SunOS" >= 5) | |
78 | USE_SUN= dnl SunOS or Solaris | |
79 | USE_SUNOS= dnl old/real SunOS (obsolete) | |
80 | USE_SVR4= dnl SysV R4 | |
81 | USE_SYSV= dnl any System V | |
82 | USE_VMS= | |
83 | USE_ULTRIX= | |
84 | USE_UNIXWARE= | |
85 | ||
86 | dnl hardware platform | |
87 | USE_ALPHA= | |
88 | ||
89 | dnl on some platforms xxx_r() functions are declared inside "#ifdef | |
90 | dnl _REENTRANT" and it's easier to just define this symbol for these platforms | |
91 | dnl than checking it during run-time | |
92 | NEEDS_D_REENTRANT_FOR_R_FUNCS=0 | |
93 | ||
94 | dnl the list of all available toolkits | |
95 | dnl | |
96 | dnl update NUM_TOOLKITS calculation below when adding a new toolkit here! | |
97 | ALL_TOOLKITS="COCOA GTK MAC MGL MICROWIN MOTIF MSW PM X11 DFB" | |
98 | ||
99 | dnl NB: these wxUSE_XXX constants have value of 0 or 1 unlike all the other ones | |
100 | dnl which are either yes or no | |
101 | DEFAULT_wxUSE_COCOA=0 | |
102 | DEFAULT_wxUSE_GTK=0 | |
103 | DEFAULT_wxUSE_MAC=0 | |
104 | DEFAULT_wxUSE_MGL=0 | |
105 | DEFAULT_wxUSE_MICROWIN=0 | |
106 | DEFAULT_wxUSE_MOTIF=0 | |
107 | DEFAULT_wxUSE_MSW=0 | |
108 | DEFAULT_wxUSE_PM=0 | |
109 | DEFAULT_wxUSE_X11=0 | |
110 | DEFAULT_wxUSE_DFB=0 | |
111 | ||
112 | dnl these are the values which are really default for the given platform - | |
113 | dnl they're not cached and are only used if no --with-toolkit was given *and* | |
114 | dnl nothing was found in the cache | |
115 | DEFAULT_DEFAULT_wxUSE_COCOA=0 | |
116 | DEFAULT_DEFAULT_wxUSE_GTK=0 | |
117 | DEFAULT_DEFAULT_wxUSE_MAC=0 | |
118 | DEFAULT_DEFAULT_wxUSE_MGL=0 | |
119 | DEFAULT_DEFAULT_wxUSE_MICROWIN=0 | |
120 | DEFAULT_DEFAULT_wxUSE_MOTIF=0 | |
121 | DEFAULT_DEFAULT_wxUSE_MSW=0 | |
122 | DEFAULT_DEFAULT_wxUSE_PM=0 | |
123 | DEFAULT_DEFAULT_wxUSE_X11=0 | |
124 | DEFAULT_DEFAULT_wxUSE_DFB=0 | |
125 | ||
126 | PROGRAM_EXT= | |
127 | SO_SUFFIX=so | |
128 | SAMPLES_RPATH_FLAG= | |
129 | SAMPLES_RPATH_POSTLINK= | |
130 | ||
131 | DEFAULT_STD_FLAG=yes | |
132 | ||
133 | dnl to support a new system, you need to add its canonical name (as determined | |
134 | dnl by config.sub or specified by the configure command line) to this "case" | |
135 | dnl and also define the shared library flags below - search for | |
136 | dnl SHARED_LIB_SETUP to find the exact place | |
137 | case "${host}" in | |
138 | *-hp-hpux* ) | |
139 | USE_HPUX=1 | |
140 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 | |
141 | NEEDS_D_REENTRANT_FOR_R_FUNCS=1 | |
142 | SO_SUFFIX=sl | |
143 | AC_DEFINE(__HPUX__) | |
144 | ||
145 | dnl many standard declarations in HP-UX headers are only included if either | |
146 | dnl _HPUX_SOURCE is defined, see stdsyms(5) | |
147 | CPPFLAGS="-D_HPUX_SOURCE $CPPFLAGS" | |
148 | ;; | |
149 | *-*-linux* ) | |
150 | USE_LINUX=1 | |
151 | AC_DEFINE(__LINUX__) | |
152 | TMP=`uname -m` | |
153 | if test "x$TMP" = "xalpha"; then | |
154 | USE_ALPHA=1 | |
155 | AC_DEFINE(__ALPHA__) | |
156 | fi | |
157 | DEFAULT_DEFAULT_wxUSE_GTK=1 | |
158 | ;; | |
159 | *-*-gnu* | *-*-k*bsd*-gnu ) | |
160 | USE_GNU=1 | |
161 | TMP=`uname -m` | |
162 | if test "x$TMP" = "xalpha"; then | |
163 | USE_ALPHA=1 | |
164 | AC_DEFINE(__ALPHA__) | |
165 | fi | |
166 | DEFAULT_DEFAULT_wxUSE_GTK=1 | |
167 | ;; | |
168 | *-*-irix5* | *-*-irix6* ) | |
169 | USE_SGI=1 | |
170 | USE_SVR4=1 | |
171 | AC_DEFINE(__SGI__) | |
172 | AC_DEFINE(__SVR4__) | |
173 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 | |
174 | ;; | |
175 | *-*-solaris2* ) | |
176 | USE_SUN=1 | |
177 | USE_SOLARIS=1 | |
178 | USE_SVR4=1 | |
179 | AC_DEFINE(__SUN__) | |
180 | AC_DEFINE(__SOLARIS__) | |
181 | AC_DEFINE(__SVR4__) | |
182 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 | |
183 | NEEDS_D_REENTRANT_FOR_R_FUNCS=1 | |
184 | ;; | |
185 | *-*-sunos4* ) | |
186 | USE_SUN=1 | |
187 | USE_SUNOS=1 | |
188 | USE_BSD=1 | |
189 | AC_DEFINE(__SUN__) | |
190 | AC_DEFINE(__SUNOS__) | |
191 | AC_DEFINE(__BSD__) | |
192 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 | |
193 | ;; | |
194 | *-*-freebsd*) | |
195 | USE_BSD=1 | |
196 | USE_FREEBSD=1 | |
197 | AC_DEFINE(__FREEBSD__) | |
198 | AC_DEFINE(__BSD__) | |
199 | DEFAULT_DEFAULT_wxUSE_GTK=1 | |
200 | ;; | |
201 | *-*-openbsd*|*-*-mirbsd*) | |
202 | USE_BSD=1 | |
203 | USE_OPENBSD=1 | |
204 | AC_DEFINE(__OPENBSD__) | |
205 | AC_DEFINE(__BSD__) | |
206 | DEFAULT_DEFAULT_wxUSE_GTK=1 | |
207 | ;; | |
208 | *-*-netbsd*) | |
209 | USE_BSD=1 | |
210 | USE_NETBSD=1 | |
211 | AC_DEFINE(__NETBSD__) | |
212 | AC_DEFINE(__BSD__) | |
213 | DEFAULT_DEFAULT_wxUSE_GTK=1 | |
214 | NEEDS_D_REENTRANT_FOR_R_FUNCS=1 | |
215 | ||
216 | dnl some standard declarations in NetBSD headers are only included if | |
217 | dnl _NETBSD_SOURCE and _LIBC are defined, e.g. getservbyname_r in netdb.h | |
218 | CPPFLAGS="-D_NETBSD_SOURCE -D_LIBC $CPPFLAGS" | |
219 | ;; | |
220 | *-*-osf* ) | |
221 | USE_ALPHA=1 | |
222 | USE_OSF=1 | |
223 | AC_DEFINE(__ALPHA__) | |
224 | AC_DEFINE(__OSF__) | |
225 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 | |
226 | NEEDS_D_REENTRANT_FOR_R_FUNCS=1 | |
227 | ;; | |
228 | *-*-dgux5* ) | |
229 | USE_ALPHA=1 | |
230 | USE_SVR4=1 | |
231 | AC_DEFINE(__ALPHA__) | |
232 | AC_DEFINE(__SVR4__) | |
233 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 | |
234 | ;; | |
235 | *-*-sysv5* ) | |
236 | USE_SYSV=1 | |
237 | USE_SVR4=1 | |
238 | AC_DEFINE(__SYSV__) | |
239 | AC_DEFINE(__SVR4__) | |
240 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 | |
241 | ;; | |
242 | *-*-aix* ) | |
243 | USE_AIX=1 | |
244 | USE_SYSV=1 | |
245 | USE_SVR4=1 | |
246 | dnl quoting from http://www-1.ibm.com/servers/esdd/articles/gnu.html: | |
247 | dnl | |
248 | dnl Both archive libraries and shared libraries on AIX have an .a | |
249 | dnl extension. This will explain why you can't link with an .so and | |
250 | dnl why it works with the name changed to .a. | |
251 | SO_SUFFIX=a | |
252 | AC_DEFINE(__AIX__) | |
253 | AC_DEFINE(__SYSV__) | |
254 | AC_DEFINE(__SVR4__) | |
255 | DEFAULT_DEFAULT_wxUSE_MOTIF=1 | |
256 | ;; | |
257 | ||
258 | *-*-*UnixWare*) | |
259 | USE_SYSV=1 | |
260 | USE_SVR4=1 | |
261 | USE_UNIXWARE=1 | |
262 | AC_DEFINE(__UNIXWARE__) | |
263 | ;; | |
264 | ||
265 | *-*-cygwin* | *-*-mingw32* ) | |
266 | dnl MBN: some of the defines have been moved after toolkit detection | |
267 | dnl because for wxMotif/wxGTK/wxX11 to build on Cygwin | |
268 | dnl USE_UNIX must be set and not USE_WIN32 | |
269 | SO_SUFFIX=dll | |
270 | PROGRAM_EXT=".exe" | |
271 | DEFAULT_DEFAULT_wxUSE_MSW=1 | |
272 | ;; | |
273 | ||
274 | *-pc-msdosdjgpp ) | |
275 | USE_UNIX=0 | |
276 | USE_DOS=1 | |
277 | AC_DEFINE(__DOS__) | |
278 | PROGRAM_EXT=".exe" | |
279 | DEFAULT_DEFAULT_wxUSE_MGL=1 | |
280 | ;; | |
281 | ||
282 | *-pc-os2_emx | *-pc-os2-emx ) | |
283 | AC_DEFINE(__EMX__) | |
284 | USE_OS2=1 | |
285 | AC_DEFINE(__OS2__) | |
286 | PROGRAM_EXT=".exe" | |
287 | DEFAULT_DEFAULT_wxUSE_PM=1 | |
288 | dnl "c++" wrapper is not always available, so always use plain gcc. | |
289 | CXX=gcc | |
290 | LDFLAGS="$LDFLAGS -Zcrtdll" | |
291 | dnl | |
292 | dnl Some special code that's automatically added by autoconf-2.57 for OS/2 | |
293 | dnl and hopefully also by autoconf-2.58 and newer on all other platforms. | |
294 | dnl For now however, we still need it to make sure the configure script | |
295 | dnl works on OS/2 no matter what platform it is generated on. | |
296 | ac_executable_extensions=".exe" | |
297 | export ac_executable_extensions | |
298 | dnl This strange code is necessary to deal with handling of | |
299 | dnl backslashes by ksh and pdksh's sh variant. | |
300 | ac_save_IFS="$IFS" | |
301 | IFS='\\' | |
302 | ac_TEMP_PATH= | |
303 | for ac_dir in $PATH; do | |
304 | IFS=$ac_save_IFS | |
305 | if test -z "$ac_TEMP_PATH"; then | |
306 | ac_TEMP_PATH="$ac_dir" | |
307 | else | |
308 | ac_TEMP_PATH="$ac_TEMP_PATH/$ac_dir" | |
309 | fi | |
310 | done | |
311 | export PATH="$ac_TEMP_PATH" | |
312 | unset ac_TEMP_PATH | |
313 | DEFAULT_STD_FLAG=no | |
314 | ;; | |
315 | ||
316 | *-*-darwin* ) | |
317 | dnl Darwin based distributions (including Mac OS X) | |
318 | USE_BSD=1 | |
319 | USE_DARWIN=1 | |
320 | SO_SUFFIX=dylib | |
321 | AC_DEFINE(__BSD__) | |
322 | AC_DEFINE(__DARWIN__) | |
323 | AC_DEFINE(TARGET_CARBON) | |
324 | DEFAULT_DEFAULT_wxUSE_MAC=1 | |
325 | DEFAULT_STD_FLAG=no | |
326 | ;; | |
327 | powerpc-apple-macos* ) | |
328 | dnl Classic Mac OS (< X) | |
329 | USE_UNIX=0 | |
330 | dnl For some reason the test that should be cross-compiler capable fails | |
331 | dnl However, there is no doubt that MacOS PowerPC is big endian. | |
332 | ac_cv_c_bigendian=yes | |
333 | SO_SUFFIX=shlib | |
334 | dnl AC_DEFINE(TARGET_CARBON) | |
335 | dnl platform.h needs TARGET_CARBON before setup.h, we'll add it to CPPFLAGS | |
336 | DEFAULT_DEFAULT_wxUSE_MAC=1 | |
337 | DEFAULT_STD_FLAG=no | |
338 | ;; | |
339 | ||
340 | *-*-beos* ) | |
341 | dnl leave USE_UNIX on - BeOS is sufficiently Unix-like for this | |
342 | USE_BEOS=1 | |
343 | AC_DEFINE(__BEOS__) | |
344 | ;; | |
345 | ||
346 | *) | |
347 | AC_MSG_WARN([*** System type ${host} is unknown, assuming generic Unix and continuing nevertheless.]) | |
348 | AC_MSG_WARN([*** Please report the build results to wx-dev@lists.wxwidgets.org.]) | |
349 | ||
350 | DEFAULT_DEFAULT_wxUSE_X11=1 | |
351 | DEFAULT_wxUSE_SHARED=no | |
352 | esac | |
353 | ||
354 | dnl --------------------------------------------------------------------------- | |
355 | dnl command line options for configure | |
356 | dnl --------------------------------------------------------------------------- | |
357 | ||
358 | dnl the default values for all options - we collect them all here to simplify | |
359 | dnl modification of the default values (for example, if the defaults for some | |
360 | dnl platform should be changed, it can be done here too) | |
361 | dnl | |
362 | dnl NB: see also DEFAULT_wxUSE<toolkit> variables defined above | |
363 | ||
364 | WX_ARG_CACHE_INIT | |
365 | ||
366 | dnl useful to test the compilation with minimum options, define as 0 for normal | |
367 | dnl usage | |
368 | DEBUG_CONFIGURE=0 | |
369 | if test $DEBUG_CONFIGURE = 1; then | |
370 | DEFAULT_wxUSE_UNIVERSAL=no | |
371 | DEFAULT_wxUSE_STL=no | |
372 | ||
373 | DEFAULT_wxUSE_NANOX=no | |
374 | ||
375 | DEFAULT_wxUSE_THREADS=yes | |
376 | ||
377 | DEFAULT_wxUSE_SHARED=${DEFAULT_wxUSE_SHARED:-yes} | |
378 | DEFAULT_wxUSE_OPTIMISE=no | |
379 | DEFAULT_wxUSE_PROFILE=no | |
380 | DEFAULT_wxUSE_NO_DEPS=no | |
381 | DEFAULT_wxUSE_VARARG_MACROS=no | |
382 | DEFAULT_wxUSE_NO_RTTI=no | |
383 | DEFAULT_wxUSE_NO_EXCEPTIONS=no | |
384 | DEFAULT_wxUSE_UNIVERSAL_BINARY=no | |
385 | DEFAULT_wxUSE_RPATH=yes | |
386 | DEFAULT_wxUSE_PERMISSIVE=no | |
387 | DEFAULT_wxUSE_DEBUG_FLAG=yes | |
388 | DEFAULT_wxUSE_DEBUG_INFO=yes | |
389 | DEFAULT_wxUSE_DEBUG_GDB=yes | |
390 | DEFAULT_wxUSE_MEM_TRACING=no | |
391 | DEFAULT_wxUSE_DEBUG_CONTEXT=no | |
392 | DEFAULT_wxUSE_DMALLOC=no | |
393 | DEFAULT_wxUSE_APPLE_IEEE=no | |
394 | ||
395 | DEFAULT_wxUSE_EXCEPTIONS=no | |
396 | DEFAULT_wxUSE_LOG=yes | |
397 | DEFAULT_wxUSE_LOGWINDOW=no | |
398 | DEFAULT_wxUSE_LOGGUI=no | |
399 | DEFAULT_wxUSE_LOGDIALOG=no | |
400 | ||
401 | DEFAULT_wxUSE_GUI=yes | |
402 | DEFAULT_wxUSE_CONTROLS=no | |
403 | ||
404 | DEFAULT_wxUSE_REGEX=no | |
405 | DEFAULT_wxUSE_XML=no | |
406 | DEFAULT_wxUSE_EXPAT=no | |
407 | DEFAULT_wxUSE_ZLIB=no | |
408 | DEFAULT_wxUSE_LIBPNG=no | |
409 | DEFAULT_wxUSE_LIBJPEG=no | |
410 | DEFAULT_wxUSE_LIBTIFF=no | |
411 | DEFAULT_wxUSE_LIBXPM=no | |
412 | DEFAULT_wxUSE_LIBMSPACK=no | |
413 | DEFAULT_wxUSE_LIBSDL=no | |
414 | DEFAULT_wxUSE_LIBGNOMEPRINT=no | |
415 | DEFAULT_wxUSE_LIBGNOMEVFS=no | |
416 | DEFAULT_wxUSE_LIBHILDON=no | |
417 | DEFAULT_wxUSE_ODBC=no | |
418 | DEFAULT_wxUSE_OPENGL=no | |
419 | ||
420 | DEFAULT_wxUSE_ON_FATAL_EXCEPTION=no | |
421 | DEFAULT_wxUSE_STACKWALKER=no | |
422 | DEFAULT_wxUSE_DEBUGREPORT=no | |
423 | DEFAULT_wxUSE_SNGLINST_CHECKER=no | |
424 | DEFAULT_wxUSE_STD_IOSTREAM=no | |
425 | DEFAULT_wxUSE_STD_STRING=no | |
426 | DEFAULT_wxUSE_CMDLINE_PARSER=no | |
427 | DEFAULT_wxUSE_DATETIME=no | |
428 | DEFAULT_wxUSE_TIMER=no | |
429 | DEFAULT_wxUSE_STOPWATCH=no | |
430 | DEFAULT_wxUSE_FILE=no | |
431 | DEFAULT_wxUSE_FFILE=no | |
432 | DEFAULT_wxUSE_STDPATHS=no | |
433 | DEFAULT_wxUSE_TEXTBUFFER=no | |
434 | DEFAULT_wxUSE_TEXTFILE=no | |
435 | DEFAULT_wxUSE_SOUND=no | |
436 | DEFAULT_wxUSE_MEDIACTRL=no | |
437 | DEFAULT_wxUSE_GSTREAMER8=no | |
438 | DEFAULT_wxUSE_PRINTF_POS_PARAMS=no | |
439 | DEFAULT_wxUSE_INTL=no | |
440 | DEFAULT_wxUSE_CONFIG=no | |
441 | DEFAULT_wxUSE_FONTMAP=no | |
442 | DEFAULT_wxUSE_STREAMS=no | |
443 | DEFAULT_wxUSE_SOCKETS=no | |
444 | DEFAULT_wxUSE_OLE=no | |
445 | DEFAULT_wxUSE_DATAOBJ=no | |
446 | DEFAULT_wxUSE_DIALUP_MANAGER=no | |
447 | DEFAULT_wxUSE_JOYSTICK=no | |
448 | DEFAULT_wxUSE_DYNLIB_CLASS=no | |
449 | DEFAULT_wxUSE_DYNAMIC_LOADER=no | |
450 | DEFAULT_wxUSE_LONGLONG=no | |
451 | DEFAULT_wxUSE_GEOMETRY=no | |
452 | ||
453 | DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=no | |
454 | DEFAULT_wxUSE_NORMALIZED_PS_FONTS=no | |
455 | DEFAULT_wxUSE_POSTSCRIPT=no | |
456 | ||
457 | DEFAULT_wxUSE_CLIPBOARD=no | |
458 | DEFAULT_wxUSE_TOOLTIPS=no | |
459 | DEFAULT_wxUSE_DRAG_AND_DROP=no | |
460 | DEFAULT_wxUSE_DRAGIMAGE=no | |
461 | DEFAULT_wxUSE_SPLINES=no | |
462 | DEFAULT_wxUSE_MOUSEWHEEL=no | |
463 | ||
464 | DEFAULT_wxUSE_MDI=no | |
465 | DEFAULT_wxUSE_MDI_ARCHITECTURE=no | |
466 | DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=no | |
467 | DEFAULT_wxUSE_PRINTING_ARCHITECTURE=no | |
468 | ||
469 | DEFAULT_wxUSE_RESOURCES=no | |
470 | DEFAULT_wxUSE_CONSTRAINTS=no | |
471 | DEFAULT_wxUSE_IPC=no | |
472 | DEFAULT_wxUSE_HELP=no | |
473 | DEFAULT_wxUSE_MS_HTML_HELP=no | |
474 | DEFAULT_wxUSE_WXHTML_HELP=no | |
475 | DEFAULT_wxUSE_TREELAYOUT=no | |
476 | DEFAULT_wxUSE_METAFILE=no | |
477 | DEFAULT_wxUSE_MIMETYPE=no | |
478 | DEFAULT_wxUSE_SYSTEM_OPTIONS=no | |
479 | DEFAULT_wxUSE_PROTOCOL=no | |
480 | DEFAULT_wxUSE_PROTOCOL_HTTP=no | |
481 | DEFAULT_wxUSE_PROTOCOL_FTP=no | |
482 | DEFAULT_wxUSE_PROTOCOL_FILE=no | |
483 | DEFAULT_wxUSE_URL=no | |
484 | DEFAULT_wxUSE_VARIANT=no | |
485 | ||
486 | DEFAULT_wxUSE_ABOUTDLG=no | |
487 | DEFAULT_wxUSE_COMMONDLGS=no | |
488 | DEFAULT_wxUSE_CHOICEDLG=no | |
489 | DEFAULT_wxUSE_COLOURDLG=no | |
490 | DEFAULT_wxUSE_DIRDLG=no | |
491 | DEFAULT_wxUSE_FILEDLG=no | |
492 | DEFAULT_wxUSE_FINDREPLDLG=no | |
493 | DEFAULT_wxUSE_FONTDLG=no | |
494 | DEFAULT_wxUSE_MSGDLG=no | |
495 | DEFAULT_wxUSE_NUMBERDLG=no | |
496 | DEFAULT_wxUSE_TEXTDLG=no | |
497 | DEFAULT_wxUSE_SPLASH=no | |
498 | DEFAULT_wxUSE_STARTUP_TIPS=no | |
499 | DEFAULT_wxUSE_PROGRESSDLG=no | |
500 | DEFAULT_wxUSE_WIZARDDLG=no | |
501 | ||
502 | DEFAULT_wxUSE_MENUS=no | |
503 | DEFAULT_wxUSE_MINIFRAME=no | |
504 | DEFAULT_wxUSE_HTML=no | |
505 | DEFAULT_wxUSE_RICHTEXT=no | |
506 | DEFAULT_wxUSE_XRC=no | |
507 | DEFAULT_wxUSE_AUI=no | |
508 | DEFAULT_wxUSE_WEBKIT=no | |
509 | DEFAULT_wxUSE_FILESYSTEM=no | |
510 | DEFAULT_wxUSE_FS_INET=no | |
511 | DEFAULT_wxUSE_FS_ZIP=no | |
512 | DEFAULT_wxUSE_FS_ARCHIVE=no | |
513 | DEFAULT_wxUSE_BUSYINFO=no | |
514 | DEFAULT_wxUSE_ARCHIVE_STREAMS=no | |
515 | DEFAULT_wxUSE_ZIPSTREAM=no | |
516 | DEFAULT_wxUSE_TARSTREAM=no | |
517 | DEFAULT_wxUSE_VALIDATORS=no | |
518 | ||
519 | DEFAULT_wxUSE_ACCEL=no | |
520 | DEFAULT_wxUSE_ANIMATIONCTRL=no | |
521 | DEFAULT_wxUSE_BUTTON=no | |
522 | DEFAULT_wxUSE_BMPBUTTON=no | |
523 | DEFAULT_wxUSE_BITMAPCOMBOBOX=no | |
524 | DEFAULT_wxUSE_CALCTRL=no | |
525 | DEFAULT_wxUSE_CARET=no | |
526 | DEFAULT_wxUSE_CHECKBOX=no | |
527 | DEFAULT_wxUSE_CHECKLST=no | |
528 | DEFAULT_wxUSE_CHOICE=no | |
529 | DEFAULT_wxUSE_CHOICEBOOK=no | |
530 | DEFAULT_wxUSE_COLLPANE=no | |
531 | DEFAULT_wxUSE_COLOURPICKERCTRL=no | |
532 | DEFAULT_wxUSE_COMBOBOX=no | |
533 | DEFAULT_wxUSE_COMBOCTRL=no | |
534 | DEFAULT_wxUSE_DATEPICKCTRL=no | |
535 | DEFAULT_wxUSE_DISPLAY=no | |
536 | DEFAULT_wxUSE_DETECT_SM=no | |
537 | DEFAULT_wxUSE_DIRPICKERCTRL=no | |
538 | DEFAULT_wxUSE_FILEPICKERCTRL=no | |
539 | DEFAULT_wxUSE_FONTPICKERCTRL=no | |
540 | DEFAULT_wxUSE_GAUGE=no | |
541 | DEFAULT_wxUSE_GRAPHICS_CONTEXT=no | |
542 | DEFAULT_wxUSE_GRID=no | |
543 | DEFAULT_wxUSE_HYPERLINKCTRL=no | |
544 | DEFAULT_wxUSE_DATAVIEWCTRL=no | |
545 | DEFAULT_wxUSE_IMAGLIST=no | |
546 | DEFAULT_wxUSE_LISTBOOK=no | |
547 | DEFAULT_wxUSE_LISTBOX=no | |
548 | DEFAULT_wxUSE_LISTCTRL=no | |
549 | DEFAULT_wxUSE_NOTEBOOK=no | |
550 | DEFAULT_wxUSE_ODCOMBOBOX=no | |
551 | DEFAULT_wxUSE_RADIOBOX=no | |
552 | DEFAULT_wxUSE_RADIOBTN=no | |
553 | DEFAULT_wxUSE_SASH=no | |
554 | DEFAULT_wxUSE_SCROLLBAR=no | |
555 | DEFAULT_wxUSE_SLIDER=no | |
556 | DEFAULT_wxUSE_SPINBTN=no | |
557 | DEFAULT_wxUSE_SPINCTRL=no | |
558 | DEFAULT_wxUSE_SPLITTER=no | |
559 | DEFAULT_wxUSE_STATBMP=no | |
560 | DEFAULT_wxUSE_STATBOX=no | |
561 | DEFAULT_wxUSE_STATLINE=no | |
562 | DEFAULT_wxUSE_STATTEXT=no | |
563 | DEFAULT_wxUSE_STATUSBAR=yes | |
564 | DEFAULT_wxUSE_TAB_DIALOG=no | |
565 | DEFAULT_wxUSE_TEXTCTRL=no | |
566 | DEFAULT_wxUSE_TOGGLEBTN=no | |
567 | DEFAULT_wxUSE_TOOLBAR=no | |
568 | DEFAULT_wxUSE_TOOLBAR_NATIVE=no | |
569 | DEFAULT_wxUSE_TREEBOOK=no | |
570 | DEFAULT_wxUSE_TOOLBOOK=no | |
571 | DEFAULT_wxUSE_TREECTRL=no | |
572 | DEFAULT_wxUSE_POPUPWIN=no | |
573 | DEFAULT_wxUSE_TIPWINDOW=no | |
574 | ||
575 | DEFAULT_wxUSE_UNICODE=no | |
576 | DEFAULT_wxUSE_UNICODE_MSLU=no | |
577 | DEFAULT_wxUSE_WCSRTOMBS=no | |
578 | ||
579 | DEFAULT_wxUSE_PALETTE=no | |
580 | DEFAULT_wxUSE_IMAGE=no | |
581 | DEFAULT_wxUSE_GIF=no | |
582 | DEFAULT_wxUSE_PCX=no | |
583 | DEFAULT_wxUSE_TGA=no | |
584 | DEFAULT_wxUSE_PNM=no | |
585 | DEFAULT_wxUSE_IFF=no | |
586 | DEFAULT_wxUSE_XPM=no | |
587 | DEFAULT_wxUSE_ICO_CUR=no | |
588 | DEFAULT_wxUSE_ACCESSIBILITY=no | |
589 | ||
590 | DEFAULT_wxUSE_MONOLITHIC=no | |
591 | DEFAULT_wxUSE_PLUGINS=no | |
592 | DEFAULT_wxUSE_OFFICIAL_BUILD=no | |
593 | else | |
594 | DEFAULT_wxUSE_UNIVERSAL=no | |
595 | DEFAULT_wxUSE_STL=no | |
596 | ||
597 | DEFAULT_wxUSE_NANOX=no | |
598 | ||
599 | DEFAULT_wxUSE_THREADS=yes | |
600 | ||
601 | DEFAULT_wxUSE_SHARED=${DEFAULT_wxUSE_SHARED:-yes} | |
602 | DEFAULT_wxUSE_OPTIMISE=yes | |
603 | DEFAULT_wxUSE_PROFILE=no | |
604 | DEFAULT_wxUSE_NO_DEPS=no | |
605 | DEFAULT_wxUSE_VARARG_MACROS=yes | |
606 | DEFAULT_wxUSE_NO_RTTI=no | |
607 | DEFAULT_wxUSE_NO_EXCEPTIONS=no | |
608 | DEFAULT_wxUSE_UNIVERSAL_BINARY=no | |
609 | DEFAULT_wxUSE_RPATH=yes | |
610 | DEFAULT_wxUSE_PERMISSIVE=no | |
611 | DEFAULT_wxUSE_DEBUG_FLAG=no | |
612 | DEFAULT_wxUSE_DEBUG_INFO=no | |
613 | DEFAULT_wxUSE_DEBUG_GDB=no | |
614 | DEFAULT_wxUSE_MEM_TRACING=no | |
615 | DEFAULT_wxUSE_DEBUG_CONTEXT=no | |
616 | DEFAULT_wxUSE_DMALLOC=no | |
617 | DEFAULT_wxUSE_APPLE_IEEE=yes | |
618 | ||
619 | DEFAULT_wxUSE_EXCEPTIONS=yes | |
620 | DEFAULT_wxUSE_LOG=yes | |
621 | DEFAULT_wxUSE_LOGWINDOW=yes | |
622 | DEFAULT_wxUSE_LOGGUI=yes | |
623 | DEFAULT_wxUSE_LOGDIALOG=yes | |
624 | ||
625 | DEFAULT_wxUSE_GUI=yes | |
626 | ||
627 | DEFAULT_wxUSE_REGEX=yes | |
628 | DEFAULT_wxUSE_XML=yes | |
629 | DEFAULT_wxUSE_EXPAT=yes | |
630 | DEFAULT_wxUSE_ZLIB=yes | |
631 | DEFAULT_wxUSE_LIBPNG=yes | |
632 | DEFAULT_wxUSE_LIBJPEG=yes | |
633 | DEFAULT_wxUSE_LIBTIFF=yes | |
634 | DEFAULT_wxUSE_LIBXPM=yes | |
635 | DEFAULT_wxUSE_LIBMSPACK=yes | |
636 | DEFAULT_wxUSE_LIBSDL=no | |
637 | DEFAULT_wxUSE_LIBGNOMEPRINT=no | |
638 | DEFAULT_wxUSE_LIBGNOMEVFS=no | |
639 | DEFAULT_wxUSE_LIBHILDON=no | |
640 | DEFAULT_wxUSE_ODBC=no | |
641 | DEFAULT_wxUSE_OPENGL=no | |
642 | ||
643 | DEFAULT_wxUSE_ON_FATAL_EXCEPTION=yes | |
644 | DEFAULT_wxUSE_STACKWALKER=yes | |
645 | DEFAULT_wxUSE_DEBUGREPORT=yes | |
646 | DEFAULT_wxUSE_SNGLINST_CHECKER=yes | |
647 | DEFAULT_wxUSE_STD_IOSTREAM=$DEFAULT_STD_FLAG | |
648 | DEFAULT_wxUSE_STD_STRING=$DEFAULT_STD_FLAG | |
649 | DEFAULT_wxUSE_CMDLINE_PARSER=yes | |
650 | DEFAULT_wxUSE_DATETIME=yes | |
651 | DEFAULT_wxUSE_TIMER=yes | |
652 | DEFAULT_wxUSE_STOPWATCH=yes | |
653 | DEFAULT_wxUSE_FILE=yes | |
654 | DEFAULT_wxUSE_FFILE=yes | |
655 | DEFAULT_wxUSE_STDPATHS=yes | |
656 | DEFAULT_wxUSE_TEXTBUFFER=yes | |
657 | DEFAULT_wxUSE_TEXTFILE=yes | |
658 | DEFAULT_wxUSE_SOUND=yes | |
659 | DEFAULT_wxUSE_MEDIACTRL=no | |
660 | DEFAULT_wxUSE_GSTREAMER8=no | |
661 | DEFAULT_wxUSE_PRINTF_POS_PARAMS=yes | |
662 | DEFAULT_wxUSE_INTL=yes | |
663 | DEFAULT_wxUSE_CONFIG=yes | |
664 | DEFAULT_wxUSE_FONTMAP=yes | |
665 | DEFAULT_wxUSE_STREAMS=yes | |
666 | DEFAULT_wxUSE_SOCKETS=yes | |
667 | DEFAULT_wxUSE_OLE=yes | |
668 | DEFAULT_wxUSE_DATAOBJ=yes | |
669 | DEFAULT_wxUSE_DIALUP_MANAGER=yes | |
670 | DEFAULT_wxUSE_JOYSTICK=yes | |
671 | DEFAULT_wxUSE_DYNLIB_CLASS=yes | |
672 | DEFAULT_wxUSE_DYNAMIC_LOADER=yes | |
673 | DEFAULT_wxUSE_LONGLONG=yes | |
674 | DEFAULT_wxUSE_GEOMETRY=yes | |
675 | ||
676 | DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=yes | |
677 | DEFAULT_wxUSE_NORMALIZED_PS_FONTS=yes | |
678 | DEFAULT_wxUSE_POSTSCRIPT=yes | |
679 | ||
680 | DEFAULT_wxUSE_CLIPBOARD=yes | |
681 | DEFAULT_wxUSE_TOOLTIPS=yes | |
682 | DEFAULT_wxUSE_DRAG_AND_DROP=yes | |
683 | DEFAULT_wxUSE_DRAGIMAGE=yes | |
684 | DEFAULT_wxUSE_SPLINES=yes | |
685 | DEFAULT_wxUSE_MOUSEWHEEL=yes | |
686 | ||
687 | DEFAULT_wxUSE_MDI=yes | |
688 | DEFAULT_wxUSE_MDI_ARCHITECTURE=yes | |
689 | DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=yes | |
690 | DEFAULT_wxUSE_PRINTING_ARCHITECTURE=yes | |
691 | ||
692 | DEFAULT_wxUSE_RESOURCES=no | |
693 | DEFAULT_wxUSE_CONSTRAINTS=yes | |
694 | DEFAULT_wxUSE_IPC=yes | |
695 | DEFAULT_wxUSE_HELP=yes | |
696 | DEFAULT_wxUSE_MS_HTML_HELP=yes | |
697 | DEFAULT_wxUSE_WXHTML_HELP=yes | |
698 | DEFAULT_wxUSE_TREELAYOUT=yes | |
699 | DEFAULT_wxUSE_METAFILE=yes | |
700 | DEFAULT_wxUSE_MIMETYPE=yes | |
701 | DEFAULT_wxUSE_SYSTEM_OPTIONS=yes | |
702 | DEFAULT_wxUSE_PROTOCOL=yes | |
703 | DEFAULT_wxUSE_PROTOCOL_HTTP=yes | |
704 | DEFAULT_wxUSE_PROTOCOL_FTP=yes | |
705 | DEFAULT_wxUSE_PROTOCOL_FILE=yes | |
706 | DEFAULT_wxUSE_URL=yes | |
707 | DEFAULT_wxUSE_VARIANT=yes | |
708 | ||
709 | DEFAULT_wxUSE_ABOUTDLG=yes | |
710 | DEFAULT_wxUSE_COMMONDLGS=yes | |
711 | DEFAULT_wxUSE_CHOICEDLG=yes | |
712 | DEFAULT_wxUSE_COLOURDLG=yes | |
713 | DEFAULT_wxUSE_DIRDLG=yes | |
714 | DEFAULT_wxUSE_FILEDLG=yes | |
715 | DEFAULT_wxUSE_FINDREPLDLG=yes | |
716 | DEFAULT_wxUSE_FONTDLG=yes | |
717 | DEFAULT_wxUSE_MSGDLG=yes | |
718 | DEFAULT_wxUSE_NUMBERDLG=yes | |
719 | DEFAULT_wxUSE_TEXTDLG=yes | |
720 | DEFAULT_wxUSE_SPLASH=yes | |
721 | DEFAULT_wxUSE_STARTUP_TIPS=yes | |
722 | DEFAULT_wxUSE_PROGRESSDLG=yes | |
723 | DEFAULT_wxUSE_WIZARDDLG=yes | |
724 | ||
725 | DEFAULT_wxUSE_MENUS=yes | |
726 | DEFAULT_wxUSE_MINIFRAME=yes | |
727 | DEFAULT_wxUSE_HTML=yes | |
728 | DEFAULT_wxUSE_RICHTEXT=yes | |
729 | DEFAULT_wxUSE_XRC=yes | |
730 | DEFAULT_wxUSE_AUI=yes | |
731 | DEFAULT_wxUSE_WEBKIT=yes | |
732 | DEFAULT_wxUSE_FILESYSTEM=yes | |
733 | DEFAULT_wxUSE_FS_INET=yes | |
734 | DEFAULT_wxUSE_FS_ZIP=yes | |
735 | DEFAULT_wxUSE_FS_ARCHIVE=yes | |
736 | DEFAULT_wxUSE_BUSYINFO=yes | |
737 | DEFAULT_wxUSE_ARCHIVE_STREAMS=yes | |
738 | DEFAULT_wxUSE_ZIPSTREAM=yes | |
739 | DEFAULT_wxUSE_TARSTREAM=yes | |
740 | DEFAULT_wxUSE_VALIDATORS=yes | |
741 | ||
742 | DEFAULT_wxUSE_ACCEL=yes | |
743 | DEFAULT_wxUSE_ANIMATIONCTRL=yes | |
744 | DEFAULT_wxUSE_BUTTON=yes | |
745 | DEFAULT_wxUSE_BMPBUTTON=yes | |
746 | DEFAULT_wxUSE_BITMAPCOMBOBOX=yes | |
747 | DEFAULT_wxUSE_CALCTRL=yes | |
748 | DEFAULT_wxUSE_CARET=yes | |
749 | DEFAULT_wxUSE_CHECKBOX=yes | |
750 | DEFAULT_wxUSE_CHECKLST=yes | |
751 | DEFAULT_wxUSE_CHOICE=yes | |
752 | DEFAULT_wxUSE_CHOICEBOOK=yes | |
753 | DEFAULT_wxUSE_COLLPANE=yes | |
754 | DEFAULT_wxUSE_COLOURPICKERCTRL=yes | |
755 | DEFAULT_wxUSE_COMBOBOX=yes | |
756 | DEFAULT_wxUSE_COMBOCTRL=yes | |
757 | DEFAULT_wxUSE_DATEPICKCTRL=yes | |
758 | DEFAULT_wxUSE_DISPLAY=yes | |
759 | DEFAULT_wxUSE_DETECT_SM=yes | |
760 | DEFAULT_wxUSE_DIRPICKERCTRL=yes | |
761 | DEFAULT_wxUSE_FILEPICKERCTRL=yes | |
762 | DEFAULT_wxUSE_FONTPICKERCTRL=yes | |
763 | DEFAULT_wxUSE_GAUGE=yes | |
764 | DEFAULT_wxUSE_GRID=yes | |
765 | DEFAULT_wxUSE_GRAPHICS_CONTEXT=no | |
766 | DEFAULT_wxUSE_HYPERLINKCTRL=yes | |
767 | DEFAULT_wxUSE_DATAVIEWCTRL=no | |
768 | DEFAULT_wxUSE_IMAGLIST=yes | |
769 | DEFAULT_wxUSE_LISTBOOK=yes | |
770 | DEFAULT_wxUSE_LISTBOX=yes | |
771 | DEFAULT_wxUSE_LISTCTRL=yes | |
772 | DEFAULT_wxUSE_NOTEBOOK=yes | |
773 | DEFAULT_wxUSE_ODCOMBOBOX=yes | |
774 | DEFAULT_wxUSE_RADIOBOX=yes | |
775 | DEFAULT_wxUSE_RADIOBTN=yes | |
776 | DEFAULT_wxUSE_SASH=yes | |
777 | DEFAULT_wxUSE_SCROLLBAR=yes | |
778 | DEFAULT_wxUSE_SLIDER=yes | |
779 | DEFAULT_wxUSE_SPINBTN=yes | |
780 | DEFAULT_wxUSE_SPINCTRL=yes | |
781 | DEFAULT_wxUSE_SPLITTER=yes | |
782 | DEFAULT_wxUSE_STATBMP=yes | |
783 | DEFAULT_wxUSE_STATBOX=yes | |
784 | DEFAULT_wxUSE_STATLINE=yes | |
785 | DEFAULT_wxUSE_STATTEXT=yes | |
786 | DEFAULT_wxUSE_STATUSBAR=yes | |
787 | DEFAULT_wxUSE_TAB_DIALOG=no | |
788 | DEFAULT_wxUSE_TEXTCTRL=yes | |
789 | DEFAULT_wxUSE_TOGGLEBTN=yes | |
790 | DEFAULT_wxUSE_TOOLBAR=yes | |
791 | DEFAULT_wxUSE_TOOLBAR_NATIVE=yes | |
792 | DEFAULT_wxUSE_TREEBOOK=yes | |
793 | DEFAULT_wxUSE_TOOLBOOK=yes | |
794 | DEFAULT_wxUSE_TREECTRL=yes | |
795 | DEFAULT_wxUSE_POPUPWIN=yes | |
796 | DEFAULT_wxUSE_TIPWINDOW=yes | |
797 | ||
798 | DEFAULT_wxUSE_UNICODE=no | |
799 | DEFAULT_wxUSE_UNICODE_MSLU=yes | |
800 | DEFAULT_wxUSE_WCSRTOMBS=no | |
801 | ||
802 | DEFAULT_wxUSE_PALETTE=yes | |
803 | DEFAULT_wxUSE_IMAGE=yes | |
804 | DEFAULT_wxUSE_GIF=yes | |
805 | DEFAULT_wxUSE_PCX=yes | |
806 | DEFAULT_wxUSE_TGA=yes | |
807 | DEFAULT_wxUSE_IFF=no dnl why is this set to "no"? | |
808 | DEFAULT_wxUSE_PNM=yes | |
809 | DEFAULT_wxUSE_XPM=yes | |
810 | DEFAULT_wxUSE_ICO_CUR=yes | |
811 | DEFAULT_wxUSE_ACCESSIBILITY=no | |
812 | ||
813 | DEFAULT_wxUSE_MONOLITHIC=no | |
814 | DEFAULT_wxUSE_PLUGINS=no | |
815 | DEFAULT_wxUSE_OFFICIAL_BUILD=no | |
816 | ||
817 | dnl Applicable only when --with-gtk was used: | |
818 | DEFAULT_wxUSE_GTK2=yes | |
819 | fi | |
820 | ||
821 | ||
822 | dnl WX_ARG_WITH should be used to select whether an external package will be | |
823 | dnl used or not, to configure compile-time features of this package itself, | |
824 | dnl use WX_ARG_ENABLE instead | |
825 | ||
826 | dnl ============================ | |
827 | dnl external package dependecies | |
828 | dnl ============================ | |
829 | ||
830 | dnl these options use AC_ARG_WITH and not WX_ARG_WITH on purpose - we cache | |
831 | dnl these values manually | |
832 | for toolkit in `echo $ALL_TOOLKITS`; do | |
833 | LINE=`grep "wxUSE_$toolkit=" ${wx_arg_cache_file}` | |
834 | if test "x$LINE" != "x" ; then | |
835 | has_toolkit_in_cache=1 | |
836 | eval "DEFAULT_$LINE" | |
837 | eval "CACHE_$toolkit=1" | |
838 | ||
839 | LINE=`grep "wx${toolkit}_VERSION=" ${wx_arg_cache_file}` | |
840 | if test "x$LINE" != "x" ; then | |
841 | eval "DEFAULT_$LINE" | |
842 | fi | |
843 | fi | |
844 | done | |
845 | ||
846 | dnl --------------------------------------------------------------------------- | |
847 | dnl --disable-gui will build only non-GUI part of wxWidgets: check for this | |
848 | dnl first to disable many other switches if it's given | |
849 | dnl | |
850 | dnl NB: this is still in testing stage, don't use if you don't know what you're | |
851 | dnl doing | |
852 | dnl --------------------------------------------------------------------------- | |
853 | ||
854 | WX_ARG_ENABLE(gui, [ --enable-gui use GUI classes], wxUSE_GUI) | |
855 | WX_ARG_ENABLE(monolithic, [ --enable-monolithic build wxWidgets as single library], wxUSE_MONOLITHIC) | |
856 | WX_ARG_ENABLE(plugins, [ --enable-plugins build parts of wxWidgets as loadable components], wxUSE_PLUGINS) | |
857 | WX_ARG_WITH(subdirs, [ --without-subdirs don't generate makefiles for samples/demos/...], wxWITH_SUBDIRS, without) | |
858 | ||
859 | if test "$wxUSE_GUI" = "yes"; then | |
860 | ||
861 | WX_ARG_ENABLE(universal, [ --enable-universal use wxWidgets GUI controls instead of native ones], wxUSE_UNIVERSAL) | |
862 | AC_ARG_WITH(gtk, [[ --with-gtk[=VERSION] use GTK+, VERSION can be 2 (default), 1 or "any"]], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1]) | |
863 | AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1]) | |
864 | AC_ARG_WITH(mac, [ --with-mac use Mac OS X], [wxUSE_MAC="$withval" CACHE_MAC=1 TOOLKIT_GIVEN=1]) | |
865 | AC_ARG_WITH(cocoa, [ --with-cocoa use Cocoa], [wxUSE_COCOA="$withval" CACHE_COCOA=1 TOOLKIT_GIVEN=1]) | |
866 | AC_ARG_WITH(wine, [ --with-wine use Wine], [wxUSE_WINE="$withval" CACHE_WINE=1]) | |
867 | AC_ARG_WITH(msw, [ --with-msw use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1]) | |
868 | AC_ARG_WITH(pm, [ --with-pm use OS/2 Presentation Manager], [wxUSE_PM="$withval" CACHE_PM=1 TOOLKIT_GIVEN=1]) | |
869 | AC_ARG_WITH(mgl, [ --with-mgl use SciTech MGL], [wxUSE_MGL="$withval" wxUSE_UNIVERSAL="yes" CACHE_MGL=1 TOOLKIT_GIVEN=1]) | |
870 | AC_ARG_WITH(directfb, [ --with-directfb use DirectFB], [wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1]) | |
871 | AC_ARG_WITH(microwin, [ --with-microwin use MicroWindows], [wxUSE_MICROWIN="$withval" CACHE_MICROWIN=1 TOOLKIT_GIVEN=1]) | |
872 | AC_ARG_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1]) | |
873 | WX_ARG_ENABLE(nanox, [ --enable-nanox use NanoX], wxUSE_NANOX) | |
874 | ||
875 | AC_ARG_ENABLE(gtk2, [ --disable-gtk2 use GTK+ 1.2 instead of 2.0], [wxUSE_GTK2="$enableval"]) | |
876 | WX_ARG_ENABLE(gpe, [ --enable-gpe use GNOME PDA Environment features if possible], wxUSE_GPE) | |
877 | ||
878 | WX_ARG_SYS_WITH(libpng, [ --with-libpng use libpng (PNG image format)], wxUSE_LIBPNG) | |
879 | WX_ARG_SYS_WITH(libjpeg, [ --with-libjpeg use libjpeg (JPEG file format)], wxUSE_LIBJPEG) | |
880 | WX_ARG_SYS_WITH(libtiff, [ --with-libtiff use libtiff (TIFF file format)], wxUSE_LIBTIFF) | |
881 | WX_ARG_SYS_WITH(libxpm, [ --with-libxpm use libxpm (XPM file format)], wxUSE_LIBXPM) | |
882 | WX_ARG_WITH(libmspack, [ --with-libmspack use libmspack (CHM help files loading)], wxUSE_LIBMSPACK) | |
883 | WX_ARG_WITH(sdl, [ --with-sdl use SDL for audio on Unix], wxUSE_LIBSDL) | |
884 | WX_ARG_WITH(gnomeprint, [ --with-gnomeprint use GNOME print for printing under GNOME], wxUSE_LIBGNOMEPRINT) | |
885 | WX_ARG_WITH(gnomevfs, [ --with-gnomevfs use GNOME VFS for associating MIME types], wxUSE_LIBGNOMEVFS) | |
886 | WX_ARG_WITH(hildon, [ --with-hildon use Hildon framework for Nokia 770], wxUSE_LIBHILDON) | |
887 | WX_ARG_WITH(opengl, [ --with-opengl use OpenGL (or Mesa)], wxUSE_OPENGL) | |
888 | ||
889 | if test "$wxUSE_UNIVERSAL" = "yes"; then | |
890 | AC_ARG_WITH(themes, [ --with-themes=all|list use only the specified comma-separated list of wxUniversal themes], [wxUNIV_THEMES="$withval"]) | |
891 | fi | |
892 | ||
893 | fi | |
894 | dnl for GUI only | |
895 | ||
896 | WX_ARG_WITH(dmalloc, [ --with-dmalloc use dmalloc library (http://dmalloc.com/)], wxUSE_DMALLOC) | |
897 | WX_ARG_SYS_WITH(regex, [ --with-regex enable support for wxRegEx class], wxUSE_REGEX) | |
898 | WX_ARG_SYS_WITH(zlib, [ --with-zlib use zlib for LZW compression], wxUSE_ZLIB) | |
899 | WX_ARG_SYS_WITH(odbc, [ --with-odbc use the IODBC and wxODBC classes], wxUSE_ODBC) | |
900 | WX_ARG_SYS_WITH(expat, [ --with-expat enable XML support using expat parser], wxUSE_EXPAT) | |
901 | ||
902 | dnl --------------------------------------------------------------------------- | |
903 | dnl compile options | |
904 | dnl --------------------------------------------------------------------------- | |
905 | ||
906 | WX_ARG_ENABLE(shared, [ --enable-shared create shared library code], wxUSE_SHARED) | |
907 | WX_ARG_ENABLE(optimise, [ --enable-optimise create optimised code], wxUSE_OPTIMISE) | |
908 | WX_ARG_ENABLE(debug, [ --enable-debug same as debug_flag and debug_info], wxUSE_DEBUG) | |
909 | WX_ARG_ENABLE(stl, [ --enable-stl use STL for containers], wxUSE_STL) | |
910 | if test "$USE_OS2" = "1"; then | |
911 | DEFAULT_wxUSE_OMF=no | |
912 | WX_ARG_ENABLE(omf, [ --enable-omf use OMF object format], wxUSE_OMF) | |
913 | fi | |
914 | ||
915 | if test "$wxUSE_DEBUG" = "yes"; then | |
916 | DEFAULT_wxUSE_DEBUG_FLAG=yes | |
917 | DEFAULT_wxUSE_DEBUG_INFO=yes | |
918 | BUILD=debug | |
919 | elif test "$wxUSE_DEBUG" = "no"; then | |
920 | DEFAULT_wxUSE_DEBUG_FLAG=no | |
921 | DEFAULT_wxUSE_DEBUG_INFO=no | |
922 | BUILD=release | |
923 | fi | |
924 | ||
925 | WX_ARG_ENABLE(debug_flag, [ --enable-debug_flag set __WXDEBUG__ flag (recommended for developers!)], wxUSE_DEBUG_FLAG) | |
926 | WX_ARG_ENABLE(debug_info, [ --enable-debug_info create code with debugging information], wxUSE_DEBUG_INFO) | |
927 | WX_ARG_ENABLE(debug_gdb, [ --enable-debug_gdb create code with extra GDB debugging information], wxUSE_DEBUG_GDB) | |
928 | WX_ARG_ENABLE(debug_cntxt, [ --enable-debug_cntxt use wxDebugContext], wxUSE_DEBUG_CONTEXT) | |
929 | WX_ARG_ENABLE(mem_tracing, [ --enable-mem_tracing create code with memory tracing], wxUSE_MEM_TRACING) | |
930 | WX_ARG_ENABLE(profile, [ --enable-profile create code with profiling information], wxUSE_PROFILE) | |
931 | WX_ARG_ENABLE(no_rtti, [ --enable-no_rtti create code without RTTI information], wxUSE_NO_RTTI) | |
932 | WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without C++ exceptions handling], wxUSE_NO_EXCEPTIONS) | |
933 | WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE) | |
934 | WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS) | |
935 | WX_ARG_ENABLE(vararg_macros, [ --disable-vararg_macros don't use vararg macros, even if they are supported], wxUSE_VARARG_MACROS) | |
936 | WX_ARG_ENABLE_PARAM(universal_binary, [[ --enable-universal_binary[=SDK] create Mac PowerPC and Intel Universal binary (not yet working)]], wxUSE_UNIVERSAL_BINARY) | |
937 | ||
938 | WX_ARG_ENABLE(compat24, [ --enable-compat24 enable wxWidgets 2.4 compatibility], WXWIN_COMPATIBILITY_2_4, enable) | |
939 | WX_ARG_ENABLE(compat26, [ --disable-compat26 disable wxWidgets 2.6 compatibility], WXWIN_COMPATIBILITY_2_6, disable) | |
940 | ||
941 | WX_ARG_ENABLE(rpath, [ --disable-rpath disable use of rpath for uninstalled builds], wxUSE_RPATH) | |
942 | ||
943 | ||
944 | dnl --------------------------------------------------------------------------- | |
945 | dnl (small) optional non GUI classes | |
946 | dnl --------------------------------------------------------------------------- | |
947 | ||
948 | WX_ARG_ENABLE(intl, [ --enable-intl use internationalization system], wxUSE_INTL) | |
949 | WX_ARG_ENABLE(config, [ --enable-config use wxConfig (and derived) classes], wxUSE_CONFIG) | |
950 | ||
951 | WX_ARG_ENABLE(protocols, [ --enable-protocols use wxProtocol and derived classes], wxUSE_PROTOCOL) | |
952 | WX_ARG_ENABLE(ftp, [ --enable-ftp use wxFTP (requires wxProtocol], wxUSE_PROTOCOL_FTP) | |
953 | WX_ARG_ENABLE(http, [ --enable-http use wxHTTP (requires wxProtocol], wxUSE_PROTOCOL_HTTP) | |
954 | WX_ARG_ENABLE(fileproto, [ --enable-fileproto use wxFileProto class (requires wxProtocol], wxUSE_PROTOCOL_FILE) | |
955 | WX_ARG_ENABLE(sockets, [ --enable-sockets use socket/network classes], wxUSE_SOCKETS) | |
956 | WX_ARG_ENABLE(ole, [ --enable-ole use OLE classes (Win32 only)], wxUSE_OLE) | |
957 | WX_ARG_ENABLE(dataobj, [ --enable-dataobj use data object classes], wxUSE_DATAOBJ) | |
958 | ||
959 | WX_ARG_ENABLE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC) | |
960 | ||
961 | dnl please keep the settings below in alphabetical order | |
962 | WX_ARG_ENABLE(apple_ieee, [ --enable-apple_ieee use the Apple IEEE codec], wxUSE_APPLE_IEEE) | |
963 | WX_ARG_ENABLE(arcstream, [ --enable-arcstream use wxArchive streams], wxUSE_ARCHIVE_STREAMS) | |
964 | WX_ARG_ENABLE(backtrace, [ --enable-backtrace use wxStackWalker class for getting backtraces], wxUSE_STACKWALKER) | |
965 | WX_ARG_ENABLE(catch_segvs, [ --enable-catch_segvs catch signals in wxApp::OnFatalException (Unix only)], wxUSE_ON_FATAL_EXCEPTION) | |
966 | WX_ARG_ENABLE(cmdline, [ --enable-cmdline use wxCmdLineParser class], wxUSE_CMDLINE_PARSER) | |
967 | WX_ARG_ENABLE(datetime, [ --enable-datetime use wxDateTime class], wxUSE_DATETIME) | |
968 | WX_ARG_ENABLE(debugreport, [ --enable-debugreport use wxDebugReport class], wxUSE_DEBUGREPORT) | |
969 | WX_ARG_ENABLE(dialupman, [ --enable-dialupman use dialup network classes], wxUSE_DIALUP_MANAGER) | |
970 | WX_ARG_ENABLE(dynlib, [ --enable-dynlib use wxLibrary class for DLL loading], wxUSE_DYNLIB_CLASS) | |
971 | WX_ARG_ENABLE(dynamicloader, [ --enable-dynamicloader use (new) wxDynamicLibrary class], wxUSE_DYNAMIC_LOADER) | |
972 | WX_ARG_ENABLE(exceptions, [ --enable-exceptions build exception-safe library], wxUSE_EXCEPTIONS) | |
973 | WX_ARG_ENABLE(ffile, [ --enable-ffile use wxFFile class], wxUSE_FFILE) | |
974 | WX_ARG_ENABLE(file, [ --enable-file use wxFile class], wxUSE_FILE) | |
975 | WX_ARG_ENABLE(filesystem, [ --enable-filesystem use virtual file systems classes], wxUSE_FILESYSTEM) | |
976 | WX_ARG_ENABLE(fontmap, [ --enable-fontmap use font encodings conversion classes], wxUSE_FONTMAP) | |
977 | WX_ARG_ENABLE(fs_archive, [ --enable-fs_archive use virtual archive filesystems], wxUSE_FS_ARCHIVE) | |
978 | WX_ARG_ENABLE(fs_inet, [ --enable-fs_inet use virtual HTTP/FTP filesystems], wxUSE_FS_INET) | |
979 | WX_ARG_ENABLE(fs_zip, [ --enable-fs_zip now replaced by fs_archive], wxUSE_FS_ZIP) | |
980 | WX_ARG_ENABLE(geometry, [ --enable-geometry use geometry class], wxUSE_GEOMETRY) | |
981 | WX_ARG_ENABLE(log, [ --enable-log use logging system], wxUSE_LOG) | |
982 | WX_ARG_ENABLE(longlong, [ --enable-longlong use wxLongLong class], wxUSE_LONGLONG) | |
983 | WX_ARG_ENABLE(mimetype, [ --enable-mimetype use wxMimeTypesManager], wxUSE_MIMETYPE) | |
984 | WX_ARG_ENABLE(mslu, [ --enable-mslu use MS Layer for Unicode on Windows 9x (Win32 only)], wxUSE_UNICODE_MSLU) | |
985 | WX_ARG_ENABLE(snglinst, [ --enable-snglinst use wxSingleInstanceChecker class], wxUSE_SNGLINST_CHECKER) | |
986 | WX_ARG_ENABLE(std_iostreams, [ --enable-std_iostreams use standard C++ stream classes], wxUSE_STD_IOSTREAM) | |
987 | WX_ARG_ENABLE(std_string, [ --enable-std_string use standard C++ string classes], wxUSE_STD_STRING) | |
988 | WX_ARG_ENABLE(stdpaths, [ --enable-stdpaths use wxStandardPaths class], wxUSE_STDPATHS) | |
989 | WX_ARG_ENABLE(stopwatch, [ --enable-stopwatch use wxStopWatch class], wxUSE_STOPWATCH) | |
990 | WX_ARG_ENABLE(streams, [ --enable-streams use wxStream etc classes], wxUSE_STREAMS) | |
991 | WX_ARG_ENABLE(system_options,[ --enable-sysoptions use wxSystemOptions], wxUSE_SYSTEM_OPTIONS) | |
992 | WX_ARG_ENABLE(tarstream, [ --enable-tarstream use wxTar streams], wxUSE_TARSTREAM) | |
993 | WX_ARG_ENABLE(textbuf, [ --enable-textbuf use wxTextBuffer class], wxUSE_TEXTBUFFER) | |
994 | WX_ARG_ENABLE(textfile, [ --enable-textfile use wxTextFile class], wxUSE_TEXTFILE) | |
995 | WX_ARG_ENABLE(timer, [ --enable-timer use wxTimer class], wxUSE_TIMER) | |
996 | WX_ARG_ENABLE(unicode, [ --enable-unicode compile wxString with Unicode support], wxUSE_UNICODE) | |
997 | WX_ARG_ENABLE(sound, [ --enable-sound use wxSound class], wxUSE_SOUND) | |
998 | WX_ARG_ENABLE(mediactrl, [ --enable-mediactrl use wxMediaCtrl class], wxUSE_MEDIACTRL) | |
999 | WX_ARG_ENABLE(gstreamer8, [ --enable-gstreamer8 force GStreamer 0.8 instead of 0.10 with the wxMediaCtrl class on unix], wxUSE_GSTREAMER8) | |
1000 | WX_ARG_ENABLE(printfposparam,[ --enable-printfposparam use wxVsnprintf() which supports positional parameters], wxUSE_PRINTF_POS_PARAMS) | |
1001 | WX_ARG_ENABLE(zipstream, [ --enable-zipstream use wxZip streams], wxUSE_ZIPSTREAM) | |
1002 | ||
1003 | WX_ARG_ENABLE(url, [ --enable-url use wxURL class], wxUSE_URL) | |
1004 | WX_ARG_ENABLE(variant, [ --enable-variant use wxVariant class], wxUSE_VARIANT) | |
1005 | WX_ARG_ENABLE(protocol, [ --enable-protocol use wxProtocol class], wxUSE_PROTOCOL) | |
1006 | WX_ARG_ENABLE(protocol_http, [ --enable-protocol-http HTTP support in wxProtocol], wxUSE_PROTOCOL_HTTP) | |
1007 | WX_ARG_ENABLE(protocol_ftp, [ --enable-protocol-ftp FTP support in wxProtocol], wxUSE_PROTOCOL_FTP) | |
1008 | WX_ARG_ENABLE(protocol_file, [ --enable-protocol-file FILE support in wxProtocol], wxUSE_PROTOCOL_FILE) | |
1009 | ||
1010 | ||
1011 | dnl --------------------------------------------------------------------------- | |
1012 | dnl "big" options (i.e. those which change a lot of things throughout the library) | |
1013 | dnl --------------------------------------------------------------------------- | |
1014 | ||
1015 | WX_ARG_ENABLE(threads, [ --enable-threads use threads], wxUSE_THREADS) | |
1016 | ||
1017 | if test "$wxUSE_GUI" = "yes"; then | |
1018 | ||
1019 | dnl --------------------------------------------------------------------------- | |
1020 | dnl "big" GUI options | |
1021 | dnl --------------------------------------------------------------------------- | |
1022 | ||
1023 | WX_ARG_ENABLE(docview, [ --enable-docview use document view architecture], wxUSE_DOC_VIEW_ARCHITECTURE) | |
1024 | WX_ARG_ENABLE(help, [ --enable-help use help subsystem], wxUSE_HELP) | |
1025 | WX_ARG_ENABLE(mshtmlhelp, [ --enable-mshtmlhelp use MS HTML Help (win32)], wxUSE_MS_HTML_HELP) | |
1026 | WX_ARG_ENABLE(html, [ --enable-html use wxHTML sub-library], wxUSE_HTML) | |
1027 | WX_ARG_ENABLE(htmlhelp, [ --enable-htmlhelp use wxHTML-based help], wxUSE_WXHTML_HELP) | |
1028 | WX_ARG_ENABLE(xrc, [ --enable-xrc use XRC resources sub-library], wxUSE_XRC) | |
1029 | WX_ARG_ENABLE(aui, [ --enable-aui use AUI docking library], wxUSE_AUI) | |
1030 | WX_ARG_ENABLE(constraints, [ --enable-constraints use layout-constraints system], wxUSE_CONSTRAINTS) | |
1031 | WX_ARG_ENABLE(printarch, [ --enable-printarch use printing architecture], wxUSE_PRINTING_ARCHITECTURE) | |
1032 | WX_ARG_ENABLE(mdi, [ --enable-mdi use multiple document interface architecture], wxUSE_MDI) | |
1033 | WX_ARG_ENABLE(mdidoc, [ --enable-mdidoc use docview architecture with MDI], wxUSE_MDI_ARCHITECTURE) | |
1034 | WX_ARG_ENABLE(loggui, [ --enable-loggui use standard GUI logger], wxUSE_LOGGUI) | |
1035 | WX_ARG_ENABLE(logwin, [ --enable-logwin use wxLogWindow], wxUSE_LOGWINDOW) | |
1036 | WX_ARG_ENABLE(logdialog, [ --enable-logdialog use wxLogDialog], wxUSE_LOGDIALOG) | |
1037 | WX_ARG_ENABLE(webkit, [ --enable-webkit use wxWebKitCtrl (Mac)], wxUSE_WEBKIT) | |
1038 | WX_ARG_ENABLE(richtext, [ --enable-richtext use wxRichTextCtrl], wxUSE_RICHTEXT) | |
1039 | WX_ARG_ENABLE(graphics_ctx, [ --enable-graphics_ctx use graphics context 2D drawing API], wxUSE_GRAPHICS_CONTEXT) | |
1040 | ||
1041 | dnl --------------------------------------------------------------------------- | |
1042 | dnl PostScript options | |
1043 | dnl --------------------------------------------------------------------------- | |
1044 | WX_ARG_ENABLE(postscript, [ --enable-postscript use wxPostscriptDC device context (default for gtk+)], wxUSE_POSTSCRIPT) | |
1045 | ||
1046 | dnl VZ: these options seem to be always on, if someone wants to change it please do | |
1047 | dnl WX_ARG_ENABLE(PS-normalized, [ --enable-PS-normalized use normalized PS fonts], dnl wxUSE_NORMALIZED_PS_FONTS) | |
1048 | dnl WX_ARG_ENABLE(afmfonts, [ --enable-afmfonts use Adobe Font Metric Font table], dnl wxUSE_AFM_FOR_POSTSCRIPT) | |
1049 | ||
1050 | dnl --------------------------------------------------------------------------- | |
1051 | dnl resources | |
1052 | dnl --------------------------------------------------------------------------- | |
1053 | ||
1054 | WX_ARG_ENABLE(prologio, [ --enable-prologio not available; see contrib], wxUSE_PROLOGIO) | |
1055 | WX_ARG_ENABLE(resources, [ --enable-resources not available; see contrib], wxUSE_RESOURCES) | |
1056 | ||
1057 | dnl --------------------------------------------------------------------------- | |
1058 | dnl IPC &c | |
1059 | dnl --------------------------------------------------------------------------- | |
1060 | ||
1061 | WX_ARG_ENABLE(clipboard, [ --enable-clipboard use wxClipboard class], wxUSE_CLIPBOARD) | |
1062 | WX_ARG_ENABLE(dnd, [ --enable-dnd use Drag'n'Drop classes], wxUSE_DRAG_AND_DROP) | |
1063 | WX_ARG_ENABLE(metafile, [ --enable-metafile use win32 metafiles], wxUSE_METAFILE) | |
1064 | ||
1065 | dnl WX_ARG_ENABLE(treelayout, [ --enable-treelayout use wxTreeLayout class], wxUSE_TREELAYOUT) | |
1066 | ||
1067 | dnl --------------------------------------------------------------------------- | |
1068 | dnl optional GUI controls (in alphabetical order except the first one) | |
1069 | dnl --------------------------------------------------------------------------- | |
1070 | ||
1071 | WX_ARG_ENABLE(controls, [ --enable-controls use all usual controls], wxUSE_CONTROLS) | |
1072 | ||
1073 | dnl even with --enable-controls, some may be disabled by giving | |
1074 | dnl --disable-<control> later on the command line - but by default all will be | |
1075 | dnl used (and vice versa) | |
1076 | if test "$wxUSE_CONTROLS" = "yes"; then | |
1077 | DEFAULT_wxUSE_ACCEL=yes | |
1078 | DEFAULT_wxUSE_ANIMATIONCTRL=yes | |
1079 | DEFAULT_wxUSE_BMPBUTTON=yes | |
1080 | DEFAULT_wxUSE_BUTTON=yes | |
1081 | DEFAULT_wxUSE_CALCTRL=yes | |
1082 | DEFAULT_wxUSE_CARET=yes | |
1083 | DEFAULT_wxUSE_COMBOBOX=yes | |
1084 | DEFAULT_wxUSE_CHECKBOX=yes | |
1085 | DEFAULT_wxUSE_CHECKLISTBOX=yes | |
1086 | DEFAULT_wxUSE_CHOICE=yes | |
1087 | DEFAULT_wxUSE_CHOICEBOOK=yes | |
1088 | DEFAULT_wxUSE_COLLPANE=yes | |
1089 | DEFAULT_wxUSE_COLOURPICKERCTRL=yes | |
1090 | DEFAULT_wxUSE_COMBOBOX=yes | |
1091 | DEFAULT_wxUSE_DATEPICKCTRL=yes | |
1092 | DEFAULT_wxUSE_DISPLAY=yes | |
1093 | DEFAULT_wxUSE_DETECT_SM=yes | |
1094 | DEFAULT_wxUSE_DIRPICKERCTRL=yes | |
1095 | DEFAULT_wxUSE_FILEPICKERCTRL=yes | |
1096 | DEFAULT_wxUSE_FONTPICKERCTRL=yes | |
1097 | DEFAULT_wxUSE_GAUGE=yes | |
1098 | DEFAULT_wxUSE_GRID=yes | |
1099 | DEFAULT_wxUSE_HYPERLINKCTRL=yes | |
1100 | DEFAULT_wxUSE_DATAVIEWCTRL=no | |
1101 | DEFAULT_wxUSE_IMAGLIST=yes | |
1102 | DEFAULT_wxUSE_LISTBOOK=yes | |
1103 | DEFAULT_wxUSE_LISTBOX=yes | |
1104 | DEFAULT_wxUSE_LISTCTRL=yes | |
1105 | DEFAULT_wxUSE_NOTEBOOK=yes | |
1106 | DEFAULT_wxUSE_RADIOBOX=yes | |
1107 | DEFAULT_wxUSE_RADIOBTN=yes | |
1108 | DEFAULT_wxUSE_SASH=yes | |
1109 | DEFAULT_wxUSE_SCROLLBAR=yes | |
1110 | DEFAULT_wxUSE_SLIDER=yes | |
1111 | DEFAULT_wxUSE_SPINBTN=yes | |
1112 | DEFAULT_wxUSE_SPINCTRL=yes | |
1113 | DEFAULT_wxUSE_SPLITTER=yes | |
1114 | DEFAULT_wxUSE_STATBMP=yes | |
1115 | DEFAULT_wxUSE_STATBOX=yes | |
1116 | DEFAULT_wxUSE_STATLINE=yes | |
1117 | DEFAULT_wxUSE_STATUSBAR=yes | |
1118 | DEFAULT_wxUSE_TAB_DIALOG=yes | |
1119 | DEFAULT_wxUSE_TOGGLEBTN=yes | |
1120 | DEFAULT_wxUSE_TOOLBAR=yes | |
1121 | DEFAULT_wxUSE_TOOLBAR_NATIVE=yes | |
1122 | DEFAULT_wxUSE_TOOLTIPS=yes | |
1123 | DEFAULT_wxUSE_TREEBOOK=yes | |
1124 | DEFAULT_wxUSE_TOOLBOOK=yes | |
1125 | DEFAULT_wxUSE_TREECTRL=yes | |
1126 | DEFAULT_wxUSE_POPUPWIN=yes | |
1127 | DEFAULT_wxUSE_TIPWINDOW=yes | |
1128 | elif test "$wxUSE_CONTROLS" = "no"; then | |
1129 | DEFAULT_wxUSE_ACCEL=no | |
1130 | DEFAULT_wxUSE_ANIMATIONCTRL=no | |
1131 | DEFAULT_wxUSE_BMPBUTTON=no | |
1132 | DEFAULT_wxUSE_BUTTON=no | |
1133 | DEFAULT_wxUSE_CALCTRL=no | |
1134 | DEFAULT_wxUSE_CARET=no | |
1135 | DEFAULT_wxUSE_COLLPANE=no | |
1136 | DEFAULT_wxUSE_COMBOBOX=no | |
1137 | DEFAULT_wxUSE_CHECKBOX=no | |
1138 | DEFAULT_wxUSE_CHECKLISTBOX=no | |
1139 | DEFAULT_wxUSE_CHOICE=no | |
1140 | DEFAULT_wxUSE_CHOICEBOOK=no | |
1141 | DEFAULT_wxUSE_COLOURPICKERCTRL=no | |
1142 | DEFAULT_wxUSE_COMBOBOX=no | |
1143 | DEFAULT_wxUSE_DATEPICKCTRL=no | |
1144 | DEFAULT_wxUSE_DISPLAY=no | |
1145 | DEFAULT_wxUSE_DETECT_SM=no | |
1146 | DEFAULT_wxUSE_DIRPICKERCTRL=no | |
1147 | DEFAULT_wxUSE_FILEPICKERCTRL=no | |
1148 | DEFAULT_wxUSE_FONTPICKERCTRL=no | |
1149 | DEFAULT_wxUSE_GAUGE=no | |
1150 | DEFAULT_wxUSE_GRID=no | |
1151 | DEFAULT_wxUSE_HYPERLINKCTRL=no | |
1152 | DEFAULT_wxUSE_DATAVIEWCTRL=no | |
1153 | DEFAULT_wxUSE_IMAGLIST=no | |
1154 | DEFAULT_wxUSE_LISTBOOK=no | |
1155 | DEFAULT_wxUSE_LISTBOX=no | |
1156 | DEFAULT_wxUSE_LISTCTRL=no | |
1157 | DEFAULT_wxUSE_NOTEBOOK=no | |
1158 | DEFAULT_wxUSE_RADIOBOX=no | |
1159 | DEFAULT_wxUSE_RADIOBTN=no | |
1160 | DEFAULT_wxUSE_SASH=no | |
1161 | DEFAULT_wxUSE_SCROLLBAR=no | |
1162 | DEFAULT_wxUSE_SLIDER=no | |
1163 | DEFAULT_wxUSE_SPINBTN=no | |
1164 | DEFAULT_wxUSE_SPINCTRL=no | |
1165 | DEFAULT_wxUSE_SPLITTER=no | |
1166 | DEFAULT_wxUSE_STATBMP=no | |
1167 | DEFAULT_wxUSE_STATBOX=no | |
1168 | DEFAULT_wxUSE_STATLINE=no | |
1169 | DEFAULT_wxUSE_STATUSBAR=no | |
1170 | DEFAULT_wxUSE_TAB_DIALOG=no | |
1171 | DEFAULT_wxUSE_TOGGLEBTN=no | |
1172 | DEFAULT_wxUSE_TOOLBAR=no | |
1173 | DEFAULT_wxUSE_TOOLBAR_NATIVE=no | |
1174 | DEFAULT_wxUSE_TOOLTIPS=no | |
1175 | DEFAULT_wxUSE_TREEBOOK=no | |
1176 | DEFAULT_wxUSE_TOOLBOOK=no | |
1177 | DEFAULT_wxUSE_TREECTRL=no | |
1178 | DEFAULT_wxUSE_POPUPWIN=no | |
1179 | DEFAULT_wxUSE_TIPWINDOW=no | |
1180 | fi | |
1181 | ||
1182 | WX_ARG_ENABLE(accel, [ --enable-accel use accelerators], wxUSE_ACCEL) | |
1183 | WX_ARG_ENABLE(animatectrl, [ --enable-animatectrl use wxAnimationCtrl class], wxUSE_ANIMATIONCTRL) | |
1184 | WX_ARG_ENABLE(button, [ --enable-button use wxButton class], wxUSE_BUTTON) | |
1185 | WX_ARG_ENABLE(bmpbutton, [ --enable-bmpbutton use wxBitmapButton class], wxUSE_BMPBUTTON) | |
1186 | WX_ARG_ENABLE(bmpcombobox, [ --enable-bmpcombobox use wxBitmapComboBox class], wxUSE_BITMAPCOMBOBOX) | |
1187 | WX_ARG_ENABLE(calendar, [ --enable-calendar use wxCalendarCtrl class], wxUSE_CALCTRL) | |
1188 | WX_ARG_ENABLE(caret, [ --enable-caret use wxCaret class], wxUSE_CARET) | |
1189 | WX_ARG_ENABLE(checkbox, [ --enable-checkbox use wxCheckBox class], wxUSE_CHECKBOX) | |
1190 | WX_ARG_ENABLE(checklst, [ --enable-checklst use wxCheckListBox (listbox with checkboxes) class], wxUSE_CHECKLST) | |
1191 | WX_ARG_ENABLE(choice, [ --enable-choice use wxChoice class], wxUSE_CHOICE) | |
1192 | WX_ARG_ENABLE(choicebook, [ --enable-choicebook use wxChoicebook class], wxUSE_CHOICEBOOK) | |
1193 | WX_ARG_ENABLE(collpane, [ --enable-collpane use wxCollapsiblePane class], wxUSE_COLLPANE) | |
1194 | WX_ARG_ENABLE(colourpicker,[ --enable-colourpicker use wxColourPickerCtrl class], wxUSE_COLOURPICKERCTRL) | |
1195 | WX_ARG_ENABLE(combobox, [ --enable-combobox use wxComboBox class], wxUSE_COMBOBOX) | |
1196 | WX_ARG_ENABLE(comboctrl, [ --enable-comboctrl use wxComboCtrl class], wxUSE_COMBOCTRL) | |
1197 | WX_ARG_ENABLE(datepick, [ --enable-datepick use wxDatePickerCtrl class], wxUSE_DATEPICKCTRL) | |
1198 | WX_ARG_ENABLE(dirpicker, [ --enable-dirpicker use wxDirPickerCtrl class], wxUSE_DIRPICKERCTRL) | |
1199 | WX_ARG_ENABLE(display, [ --enable-display use wxDisplay class], wxUSE_DISPLAY) | |
1200 | WX_ARG_ENABLE(detect_sm, [ --enable-detect_sm use code to detect X11 session manager], wxUSE_DETECT_SM) | |
1201 | WX_ARG_ENABLE(filepicker, [ --enable-filepicker use wxFilePickerCtrl class], wxUSE_FILEPICKERCTRL) | |
1202 | WX_ARG_ENABLE(fontpicker, [ --enable-fontpicker use wxFontPickerCtrl class], wxUSE_FONTPICKERCTRL) | |
1203 | WX_ARG_ENABLE(gauge, [ --enable-gauge use wxGauge class], wxUSE_GAUGE) | |
1204 | WX_ARG_ENABLE(grid, [ --enable-grid use wxGrid class], wxUSE_GRID) | |
1205 | WX_ARG_ENABLE(dataviewctrl,[ --enable-dataviewctrl, use wxDataViewCtrl class], wxUSE_DATAVIEWCTRL) | |
1206 | WX_ARG_ENABLE(hyperlink, [ --enable-hyperlink use wxHyperlinkCtrl class], wxUSE_HYPERLINKCTRL) | |
1207 | WX_ARG_ENABLE(imaglist, [ --enable-imaglist use wxImageList class], wxUSE_IMAGLIST) | |
1208 | WX_ARG_ENABLE(listbook, [ --enable-listbook use wxListbook class], wxUSE_LISTBOOK) | |
1209 | WX_ARG_ENABLE(listbox, [ --enable-listbox use wxListBox class], wxUSE_LISTBOX) | |
1210 | WX_ARG_ENABLE(listctrl, [ --enable-listctrl use wxListCtrl class], wxUSE_LISTCTRL) | |
1211 | WX_ARG_ENABLE(notebook, [ --enable-notebook use wxNotebook class], wxUSE_NOTEBOOK) | |
1212 | WX_ARG_ENABLE(odcombobox, [ --enable-odcombobox use wxOwnerDrawnComboBox class], wxUSE_ODCOMBOBOX) | |
1213 | WX_ARG_ENABLE(radiobox, [ --enable-radiobox use wxRadioBox class], wxUSE_RADIOBOX) | |
1214 | WX_ARG_ENABLE(radiobtn, [ --enable-radiobtn use wxRadioButton class], wxUSE_RADIOBTN) | |
1215 | WX_ARG_ENABLE(sash, [ --enable-sash use wxSashWindow class], wxUSE_SASH) | |
1216 | WX_ARG_ENABLE(scrollbar, [ --enable-scrollbar use wxScrollBar class and scrollable windows], wxUSE_SCROLLBAR) | |
1217 | WX_ARG_ENABLE(slider, [ --enable-slider use wxSlider class], wxUSE_SLIDER) | |
1218 | WX_ARG_ENABLE(spinbtn, [ --enable-spinbtn use wxSpinButton class], wxUSE_SPINBTN) | |
1219 | WX_ARG_ENABLE(spinctrl, [ --enable-spinctrl use wxSpinCtrl class], wxUSE_SPINCTRL) | |
1220 | WX_ARG_ENABLE(splitter, [ --enable-splitter use wxSplitterWindow class], wxUSE_SPLITTER) | |
1221 | WX_ARG_ENABLE(statbmp, [ --enable-statbmp use wxStaticBitmap class], wxUSE_STATBMP) | |
1222 | WX_ARG_ENABLE(statbox, [ --enable-statbox use wxStaticBox class], wxUSE_STATBOX) | |
1223 | WX_ARG_ENABLE(statline, [ --enable-statline use wxStaticLine class], wxUSE_STATLINE) | |
1224 | WX_ARG_ENABLE(stattext, [ --enable-stattext use wxStaticText class], wxUSE_STATTEXT) | |
1225 | WX_ARG_ENABLE(statusbar, [ --enable-statusbar use wxStatusBar class], wxUSE_STATUSBAR) | |
1226 | WX_ARG_ENABLE(tabdialog, [ --enable-tabdialog use wxTabControl class], wxUSE_TAB_DIALOG) | |
1227 | WX_ARG_ENABLE(textctrl, [ --enable-textctrl use wxTextCtrl class], wxUSE_TEXTCTRL) | |
1228 | WX_ARG_ENABLE(togglebtn, [ --enable-togglebtn use wxToggleButton class], wxUSE_TOGGLEBTN) | |
1229 | WX_ARG_ENABLE(toolbar, [ --enable-toolbar use wxToolBar class], wxUSE_TOOLBAR) | |
1230 | WX_ARG_ENABLE(tbarnative, [ --enable-tbarnative use native wxToolBar class], wxUSE_TOOLBAR_NATIVE) | |
1231 | WX_ARG_ENABLE(treebook, [ --enable-treebook use wxTreebook class], wxUSE_TREEBOOK) | |
1232 | WX_ARG_ENABLE(toolbook, [ --enable-toolbook use wxToolbook class], wxUSE_TOOLBOOK) | |
1233 | WX_ARG_ENABLE(treectrl, [ --enable-treectrl use wxTreeCtrl class], wxUSE_TREECTRL) | |
1234 | WX_ARG_ENABLE(tipwindow, [ --enable-tipwindow use wxTipWindow class], wxUSE_TIPWINDOW) | |
1235 | WX_ARG_ENABLE(popupwin, [ --enable-popupwin use wxPopUpWindow class], wxUSE_POPUPWIN) | |
1236 | ||
1237 | dnl --------------------------------------------------------------------------- | |
1238 | dnl common dialogs | |
1239 | dnl --------------------------------------------------------------------------- | |
1240 | ||
1241 | WX_ARG_ENABLE(commondlg, [ --enable-commondlg use all common dialogs], wxUSE_COMMONDLGS) | |
1242 | WX_ARG_ENABLE(aboutdlg, [ --enable-aboutdlg use wxAboutBox], wxUSE_ABOUTDLG) | |
1243 | WX_ARG_ENABLE(choicedlg, [ --enable-choicedlg use wxChoiceDialog], wxUSE_CHOICEDLG) | |
1244 | WX_ARG_ENABLE(coldlg, [ --enable-coldlg use wxColourDialog], wxUSE_COLOURDLG) | |
1245 | WX_ARG_ENABLE(filedlg, [ --enable-filedlg use wxFileDialog], wxUSE_FILEDLG) | |
1246 | WX_ARG_ENABLE(finddlg, [ --enable-finddlg use wxFindReplaceDialog], wxUSE_FINDREPLDLG) | |
1247 | WX_ARG_ENABLE(fontdlg, [ --enable-fontdlg use wxFontDialog], wxUSE_FONTDLG) | |
1248 | WX_ARG_ENABLE(dirdlg, [ --enable-dirdlg use wxDirDialog], wxUSE_DIRDLG) | |
1249 | WX_ARG_ENABLE(msgdlg, [ --enable-msgdlg use wxMessageDialog], wxUSE_MSGDLG) | |
1250 | WX_ARG_ENABLE(numberdlg, [ --enable-numberdlg use wxNumberEntryDialog], wxUSE_NUMBERDLG) | |
1251 | WX_ARG_ENABLE(splash, [ --enable-splash use wxSplashScreen], wxUSE_SPLASH) | |
1252 | WX_ARG_ENABLE(textdlg, [ --enable-textdlg use wxTextDialog], wxUSE_TEXTDLG) | |
1253 | WX_ARG_ENABLE(tipdlg, [ --enable-tipdlg use startup tips], wxUSE_STARTUP_TIPS) | |
1254 | WX_ARG_ENABLE(progressdlg, [ --enable-progressdlg use wxProgressDialog], wxUSE_PROGRESSDLG) | |
1255 | WX_ARG_ENABLE(wizarddlg, [ --enable-wizarddlg use wxWizard], wxUSE_WIZARDDLG) | |
1256 | ||
1257 | dnl --------------------------------------------------------------------------- | |
1258 | dnl misc GUI options | |
1259 | dnl --------------------------------------------------------------------------- | |
1260 | ||
1261 | WX_ARG_ENABLE(menus, [ --enable-menus use wxMenu/wxMenuBar/wxMenuItem classes], wxUSE_MENUS) | |
1262 | WX_ARG_ENABLE(miniframe, [ --enable-miniframe use wxMiniFrame class], wxUSE_MINIFRAME) | |
1263 | WX_ARG_ENABLE(tooltips, [ --enable-tooltips use wxToolTip class], wxUSE_TOOLTIPS) | |
1264 | WX_ARG_ENABLE(splines, [ --enable-splines use spline drawing code], wxUSE_SPLINES) | |
1265 | WX_ARG_ENABLE(mousewheel, [ --enable-mousewheel use mousewheel], wxUSE_MOUSEWHEEL) | |
1266 | WX_ARG_ENABLE(validators, [ --enable-validators use wxValidator and derived classes], wxUSE_VALIDATORS) | |
1267 | WX_ARG_ENABLE(busyinfo, [ --enable-busyinfo use wxBusyInfo], wxUSE_BUSYINFO) | |
1268 | WX_ARG_ENABLE(joystick, [ --enable-joystick use wxJoystick], wxUSE_JOYSTICK) | |
1269 | WX_ARG_ENABLE(metafile, [ --enable-metafiles use wxMetaFile (Win32 only)], wxUSE_METAFILE) | |
1270 | WX_ARG_ENABLE(dragimage, [ --enable-dragimage use wxDragImage], wxUSE_DRAGIMAGE) | |
1271 | WX_ARG_ENABLE(accessibility,[ --enable-accessibility enable accessibility support], wxUSE_ACCESSIBILITY) | |
1272 | ||
1273 | if test "$wxUSE_MSW" = "1"; then | |
1274 | WX_ARG_ENABLE(dccache, [ --enable-dccache cache temporary wxDC objects (Win32 only)], wxUSE_DC_CACHEING) | |
1275 | fi | |
1276 | ||
1277 | dnl --------------------------------------------------------------------------- | |
1278 | dnl support for image formats that do not rely on external library | |
1279 | dnl --------------------------------------------------------------------------- | |
1280 | ||
1281 | WX_ARG_ENABLE(palette, [ --enable-palette use wxPalette class], wxUSE_PALETTE) | |
1282 | WX_ARG_ENABLE(image, [ --enable-image use wxImage class], wxUSE_IMAGE) | |
1283 | WX_ARG_ENABLE(gif, [ --enable-gif use gif images (GIF file format)], wxUSE_GIF) | |
1284 | WX_ARG_ENABLE(pcx, [ --enable-pcx use pcx images (PCX file format)], wxUSE_PCX) | |
1285 | WX_ARG_ENABLE(tga, [ --enable-tga use tga images (TGA file format)], wxUSE_TGA) | |
1286 | WX_ARG_ENABLE(iff, [ --enable-iff use iff images (IFF file format)], wxUSE_IFF) | |
1287 | WX_ARG_ENABLE(pnm, [ --enable-pnm use pnm images (PNM file format)], wxUSE_PNM) | |
1288 | WX_ARG_ENABLE(xpm, [ --enable-xpm use xpm images (XPM file format)], wxUSE_XPM) | |
1289 | WX_ARG_ENABLE(ico_cur, [ --enable-icocur use Windows ICO and CUR formats], wxUSE_ICO_CUR) | |
1290 | ||
1291 | fi | |
1292 | ||
1293 | dnl --------------------------------------------------------------------------- | |
1294 | dnl flavour support | |
1295 | dnl --------------------------------------------------------------------------- | |
1296 | ||
1297 | dnl Should this be --enable? I flip-flopped a couple of times and this seems | |
1298 | dnl in the spirit if not the letter, we have gtk-prefix and the like in this group. | |
1299 | dnl It doesn't actually change anything but the output file names. | |
1300 | AC_ARG_WITH(flavour, [ --with-flavour=NAME specify a name to identify this build], [WX_FLAVOUR="$withval"]) | |
1301 | ||
1302 | dnl --------------------------------------------------------------------------- | |
1303 | dnl some win32 settings | |
1304 | dnl --------------------------------------------------------------------------- | |
1305 | ||
1306 | WX_ARG_ENABLE(official_build, [ --enable-official_build official build of wxWidgets (win32 DLL only)], wxUSE_OFFICIAL_BUILD) | |
1307 | AC_ARG_ENABLE(vendor, [ --enable-vendor=VENDOR vendor name (win32 DLL only)], [VENDOR="$enableval"]) | |
1308 | if test "x$VENDOR" = "x"; then | |
1309 | VENDOR="custom" | |
1310 | fi | |
1311 | ||
1312 | ||
1313 | dnl for GUI only | |
1314 | ||
1315 | dnl cache the options values before (may be) aborting below | |
1316 | WX_ARG_CACHE_FLUSH | |
1317 | ||
1318 | dnl check that no more than one toolkit is given and that if none are given that | |
1319 | dnl we have a default one | |
1320 | ||
1321 | AC_MSG_CHECKING(for toolkit) | |
1322 | ||
1323 | # In Wine, we need to default to MSW, not GTK or MOTIF | |
1324 | if test "$wxUSE_WINE" = "yes"; then | |
1325 | DEFAULT_DEFAULT_wxUSE_GTK=0 | |
1326 | DEFAULT_DEFAULT_wxUSE_MOTIF=0 | |
1327 | DEFAULT_DEFAULT_wxUSE_MSW=1 | |
1328 | wxUSE_SHARED=no | |
1329 | CC=${CC:-winegcc} | |
1330 | CXX=${CXX:-wineg++} | |
1331 | fi | |
1332 | ||
1333 | ||
1334 | if test "$wxUSE_GUI" = "yes"; then | |
1335 | ||
1336 | if test "$USE_BEOS" = 1; then | |
1337 | AC_MSG_ERROR([BeOS GUI is not supported yet, use --disable-gui]) | |
1338 | fi | |
1339 | ||
1340 | if test "$TOOLKIT_GIVEN" = 1; then | |
1341 | dnl convert "yes", "any" or a number to 1 and "no" to 0 | |
1342 | for toolkit in `echo $ALL_TOOLKITS`; do | |
1343 | var=wxUSE_$toolkit | |
1344 | eval "value=\$${var}" | |
1345 | if test "x$value" = "xno"; then | |
1346 | eval "$var=0" | |
1347 | elif test "x$value" != "x"; then | |
1348 | eval "$var=1" | |
1349 | fi | |
1350 | ||
1351 | if test "x$value" != "x" -a "x$value" != "xyes" -a "x$value" != "xno"; then | |
1352 | eval "wx${toolkit}_VERSION=$value" | |
1353 | fi | |
1354 | done | |
1355 | else | |
1356 | dnl try to guess the most apropriate toolkit for this platform | |
1357 | for toolkit in `echo $ALL_TOOLKITS`; do | |
1358 | if test "$has_toolkit_in_cache" != 1; then | |
1359 | var=DEFAULT_DEFAULT_wxUSE_$toolkit | |
1360 | else | |
1361 | var=DEFAULT_wxUSE_$toolkit | |
1362 | ||
1363 | eval "version=\$DEFAULT_wx${toolkit}_VERSION" | |
1364 | if test "x$version" != "x"; then | |
1365 | eval "wx${toolkit}_VERSION=$version" | |
1366 | fi | |
1367 | fi | |
1368 | eval "wxUSE_$toolkit=\$${var}" | |
1369 | done | |
1370 | fi | |
1371 | ||
1372 | dnl we suppose that expr is available (maybe there is a better way to do | |
1373 | dnl this? what about using ALL_TOOLKITS? TODO) | |
1374 | NUM_TOOLKITS=`expr ${wxUSE_COCOA:-0} + ${wxUSE_GTK:-0} + ${wxUSE_MAC:-0} \ | |
1375 | + ${wxUSE_MGL:-0} + ${wxUSE_DFB:-0} + ${wxUSE_MICROWIN:-0} \ | |
1376 | + ${wxUSE_MOTIF:-0} + ${wxUSE_MSW:-0} + ${wxUSE_X11:-0}` | |
1377 | ||
1378 | dnl Allow wxUSE_PM only for OS/2 with EMX. | |
1379 | case "${host}" in | |
1380 | *-pc-os2_emx | *-pc-os2-emx ) | |
1381 | NUM_TOOLKITS=`expr ${NUM_TOOLKITS} + ${wxUSE_PM:-0}` | |
1382 | esac | |
1383 | ||
1384 | case "$NUM_TOOLKITS" in | |
1385 | 1) | |
1386 | ;; | |
1387 | 0) | |
1388 | AC_MSG_ERROR(Please specify a toolkit -- cannot determine the default for ${host}) | |
1389 | ;; | |
1390 | *) | |
1391 | AC_MSG_ERROR(Please specify at most one toolkit (maybe some are cached in configarg.cache?)) | |
1392 | esac | |
1393 | ||
1394 | # to be removed when --disable-gtk2 isn't needed | |
1395 | if test "x$wxUSE_GTK2" = "xyes"; then | |
1396 | wxGTK_VERSION=2 | |
1397 | elif test "x$wxUSE_GTK2" = "xno"; then | |
1398 | wxGTK_VERSION=1 | |
1399 | fi | |
1400 | ||
1401 | dnl cache the wxUSE_<TOOLKIT> values too | |
1402 | for toolkit in `echo $ALL_TOOLKITS`; do | |
1403 | var=wxUSE_$toolkit | |
1404 | eval "value=\$${var}" | |
1405 | if test "x$value" != x; then | |
1406 | cache_var=CACHE_$toolkit | |
1407 | eval "cache=\$${cache_var}" | |
1408 | if test "$cache" = 1; then | |
1409 | echo "$var=$value" >> ${wx_arg_cache_file} | |
1410 | eval "version=\$wx${toolkit}_VERSION" | |
1411 | if test "x$version" != "x"; then | |
1412 | echo "wx${toolkit}_VERSION=$version" >> ${wx_arg_cache_file} | |
1413 | fi | |
1414 | fi | |
1415 | if test "$value" = 1; then | |
1416 | toolkit_echo=`echo $toolkit | tr "[[A-Z]]" "[[a-z]]"` | |
1417 | AC_MSG_RESULT($toolkit_echo) | |
1418 | fi | |
1419 | fi | |
1420 | done | |
1421 | else | |
1422 | if test "x$host_alias" != "x"; then | |
1423 | AC_MSG_RESULT(base ($host_alias hosted) only) | |
1424 | else | |
1425 | AC_MSG_RESULT(base only) | |
1426 | fi | |
1427 | fi | |
1428 | ||
1429 | dnl --------------------------------------------------------------------------- | |
1430 | dnl Checks for programs | |
1431 | dnl --------------------------------------------------------------------------- | |
1432 | ||
1433 | dnl flush the cache because checking for programs might abort | |
1434 | AC_CACHE_SAVE | |
1435 | ||
1436 | dnl C-compiler checks | |
1437 | dnl defines CC with the compiler to use | |
1438 | dnl defines GCC with yes if using gcc | |
1439 | dnl defines GCC empty if not using gcc | |
1440 | dnl defines CFLAGS | |
1441 | dnl | |
1442 | dnl this magic incantation is needed to prevent AC_PROG_CC from setting the | |
1443 | dnl default CFLAGS (something like "-g -O2") -- we don't need this as we add | |
1444 | dnl -g and -O flags ourselves below | |
1445 | CFLAGS=${CFLAGS:=} | |
1446 | AC_BAKEFILE_PROG_CC | |
1447 | ||
1448 | dnl is -traditional needed for correct compilations | |
1449 | dnl adds -traditional for gcc if needed | |
1450 | AC_PROG_GCC_TRADITIONAL | |
1451 | ||
1452 | dnl C++-compiler checks | |
1453 | dnl defines CXX with the compiler to use | |
1454 | dnl defines GXX with yes if using gxx | |
1455 | dnl defines GXX empty if not using gxx | |
1456 | dnl defines CXXFLAGS | |
1457 | dnl | |
1458 | dnl see CFLAGS line above | |
1459 | CXXFLAGS=${CXXFLAGS:=} | |
1460 | AC_BAKEFILE_PROG_CXX | |
1461 | ||
1462 | dnl ranlib command | |
1463 | dnl defines RANLIB with the appropriate command | |
1464 | AC_PROG_RANLIB | |
1465 | ||
1466 | dnl ar command | |
1467 | dnl defines AR with the appropriate command | |
1468 | AC_CHECK_TOOL(AR, ar) | |
1469 | if test "x$AR" = "x" ; then | |
1470 | AC_MSG_ERROR([ar is needed to build wxWidgets]) | |
1471 | fi | |
1472 | ||
1473 | dnl install checks | |
1474 | dnl defines INSTALL with the appropriate command | |
1475 | AC_PROG_INSTALL | |
1476 | ||
1477 | dnl make install path absolute (if not already); | |
1478 | dnl will fail with (some) MSDOS paths | |
1479 | case ${INSTALL} in | |
1480 | /* ) # Absolute | |
1481 | ;; | |
1482 | ?:* ) # Drive letter, considered as absolute. | |
1483 | ;; | |
1484 | *) | |
1485 | INSTALL=`pwd`/${INSTALL} ;; | |
1486 | esac | |
1487 | ||
1488 | ||
1489 | case "${host}" in | |
1490 | ||
1491 | dnl The other BSD's should probably go in here too, since this is | |
1492 | dnl to workaround a strange static lib BSDism. | |
1493 | dnl Mac OS X install seems to ignore -p option... | |
1494 | *-*-darwin* ) | |
1495 | INSTALL_PROGRAM="cp -fp" | |
1496 | INSTALL_DATA="cp -fp" | |
1497 | ;; | |
1498 | *) | |
1499 | ;; | |
1500 | esac | |
1501 | ||
1502 | dnl strip command | |
1503 | dnl defines STRIP as strip or nothing (true) if not found | |
1504 | AC_CHECK_TOOL(STRIP, strip, true) | |
1505 | ||
1506 | dnl Win32 tools | |
1507 | if test "$wxUSE_WINE" = "yes"; then | |
1508 | AC_CHECK_TOOL(WINDRES, wrc) | |
1509 | RESCOMP="$WINDRES" | |
1510 | else | |
1511 | case "${host}" in | |
1512 | *-*-cygwin* | *-*-mingw32* ) | |
1513 | dnl Bakefile CVS (as of 2005-11-24) now detects windres properly | |
1514 | dnl ... maybe it does, but it does not make it available here | |
1515 | dnl anymore, so do it ourselves still. | |
1516 | AC_CHECK_TOOL(WINDRES, windres) | |
1517 | RESCOMP="$WINDRES" | |
1518 | AC_CHECK_TOOL(DLLTOOL, dlltool) | |
1519 | ;; | |
1520 | esac | |
1521 | fi | |
1522 | ||
1523 | dnl does make support "-include" (only GNU make does AFAIK)? | |
1524 | AC_CACHE_CHECK([if make is GNU make], wx_cv_prog_makeisgnu, | |
1525 | [ | |
1526 | if ( ${SHELL-sh} -c "${MAKE-make} --version" 2> /dev/null | | |
1527 | $EGREP -s GNU > /dev/null); then | |
1528 | wx_cv_prog_makeisgnu="yes" | |
1529 | else | |
1530 | wx_cv_prog_makeisgnu="no" | |
1531 | fi | |
1532 | ]) | |
1533 | ||
1534 | if test "x$wx_cv_prog_makeisgnu" = "xyes"; then | |
1535 | IF_GNU_MAKE="" | |
1536 | else | |
1537 | IF_GNU_MAKE="#" | |
1538 | fi | |
1539 | ||
1540 | AC_SUBST(IF_GNU_MAKE) | |
1541 | ||
1542 | dnl we don't need to check for VPATH support in GNU make - it does have it | |
1543 | if test "x$wx_cv_prog_makeisgnu" != "xyes"; then | |
1544 | dnl check if VPATH works | |
1545 | AC_CACHE_CHECK([if make supports VPATH], wx_cv_prog_makevpath, [ | |
1546 | dnl create Makefile | |
1547 | cat - << EOF > confMake | |
1548 | check : file | |
1549 | cp \$? \$@ | |
1550 | cp \$? final_file | |
1551 | EOF | |
1552 | ||
1553 | if test ! -d sub ; then | |
1554 | mkdir sub | |
1555 | fi | |
1556 | echo dummy > sub/file | |
1557 | ${MAKE-make} -f confMake VPATH=sub 2>&5 > /dev/null | |
1558 | RESULT=$? | |
1559 | rm -f sub/file check final_file confMake | |
1560 | rmdir sub | |
1561 | if test "$RESULT" = 0; then | |
1562 | wx_cv_prog_makevpath="yes" | |
1563 | else | |
1564 | wx_cv_prog_makevpath="no" | |
1565 | fi | |
1566 | ]) | |
1567 | ||
1568 | if test "x$wx_cv_prog_makevpath" != "xyes"; then | |
1569 | AC_MSG_ERROR([ | |
1570 | You need a make-utility that is able to use the variable | |
1571 | VPATH correctly. | |
1572 | If your version of make does not support VPATH correctly, | |
1573 | please install GNU-make (possibly as gmake), and start | |
1574 | configure with the following command: | |
1575 | export MAKE=gmake; ./configure for sh-type shells | |
1576 | setenv MAKE gmake; ./configure for csh-type shells | |
1577 | Also please do remember to use gmake in this case every time | |
1578 | you are trying to compile. | |
1579 | ]) | |
1580 | fi dnl make without VPATH | |
1581 | fi dnl not GNU make | |
1582 | ||
1583 | dnl needed for making link to setup.h | |
1584 | AC_PROG_LN_S | |
1585 | ||
1586 | ||
1587 | dnl ------------------------------------------------------------------------ | |
1588 | dnl Platform specific tests | |
1589 | dnl ------------------------------------------------------------------------ | |
1590 | ||
1591 | dnl xlC needs -qunique under AIX so that one source file can be | |
1592 | dnl compiled to multiple object files and safely linked together. | |
1593 | if test "x$XLCXX" = "xyes" -a "x$USE_AIX" = "x1"; then | |
1594 | CXXFLAGS="-qunique $CXXFLAGS" | |
1595 | fi | |
1596 | ||
1597 | dnl This case is for PowerPC OS X vs. everything else | |
1598 | case "${host}" in | |
1599 | powerpc-*-darwin* ) | |
1600 | AC_MSG_CHECKING([if __POWERPC__ is already defined]) | |
1601 | AC_TRY_COMPILE([],[#ifndef __POWERPC__ | |
1602 | choke me for lack of PowerPC | |
1603 | #endif | |
1604 | ], | |
1605 | [AC_MSG_RESULT([yes])], | |
1606 | [AC_MSG_RESULT([no]) | |
1607 | AC_DEFINE(__POWERPC__) | |
1608 | ]) | |
1609 | ;; | |
1610 | esac | |
1611 | ||
1612 | dnl This case is for OS X vs. everything else | |
1613 | case "${host}" in | |
1614 | *-*-darwin* ) | |
1615 | AC_MSG_CHECKING([if CoreFoundation/CFBase.h is usable]) | |
1616 | AC_TRY_COMPILE([#include <CoreFoundation/CFBase.h> | |
1617 | ],[], | |
1618 | [AC_MSG_RESULT([yes])], | |
1619 | [AC_MSG_RESULT([no]) | |
1620 | AC_MSG_CHECKING([if __CF_USE_FRAMEWORK_INCLUDES__ is required]) | |
1621 | AC_TRY_COMPILE([#define __CF_USE_FRAMEWORK_INCLUDES__ | |
1622 | #include <CoreFoundation/CFBase.h> | |
1623 | ],[], | |
1624 | [AC_MSG_RESULT([yes]) | |
1625 | dnl We must use -D so source files that don't include wx/setup.h | |
1626 | dnl but do include CFBase will work. | |
1627 | CPPFLAGS="-D__CF_USE_FRAMEWORK_INCLUDES__ $CPPFLAGS"], | |
1628 | [AC_MSG_FAILURE([no. CoreFoundation not available.])] | |
1629 | ) | |
1630 | ] | |
1631 | ) | |
1632 | ;; | |
1633 | esac | |
1634 | ||
1635 | dnl Determine whether we want to use Cygwin as Windows or POSIX platform: the | |
1636 | dnl latter makes more sense for wxGTK/Motif/X11 ports | |
1637 | wants_win32=0 | |
1638 | doesnt_want_win32=0 | |
1639 | case "${host}" in | |
1640 | *-*-cygwin*) | |
1641 | if test "$wxUSE_MSW" = 1 ; then | |
1642 | wants_win32=1 | |
1643 | else | |
1644 | dnl when we use cygwin compiler with -mno-cygwin option it uses mingw32 | |
1645 | dnl headers and libraries, so it's Windows-like in this case | |
1646 | AC_CACHE_CHECK([if -mno-cygwin is in effect], wx_cv_nocygwin, | |
1647 | [ | |
1648 | AC_TRY_COMPILE( | |
1649 | [], | |
1650 | [ | |
1651 | #ifdef __MINGW32__ | |
1652 | choke me | |
1653 | #endif | |
1654 | ], | |
1655 | wx_cv_nocygwin=no, | |
1656 | wx_cv_nocygwin=yes | |
1657 | ) | |
1658 | ] | |
1659 | ) | |
1660 | ||
1661 | if test "$wx_cv_nocygwin" = "yes"; then | |
1662 | wants_win32=1 | |
1663 | else | |
1664 | doesnt_want_win32=1 | |
1665 | fi | |
1666 | fi | |
1667 | if test "$wants_win32" = 1 ; then | |
1668 | BAKEFILE_FORCE_PLATFORM=win32 | |
1669 | fi | |
1670 | ;; | |
1671 | *-*-mingw*) | |
1672 | wants_win32=1 | |
1673 | ;; | |
1674 | esac | |
1675 | ||
1676 | if test "$wxUSE_WINE" = "yes"; then | |
1677 | wants_win32=1 | |
1678 | LDFLAGS_GUI="-mwindows" | |
1679 | fi | |
1680 | ||
1681 | dnl NB: The two tests bellow are *NOT* mutually exclusive! They should only | |
1682 | dnl take effect on Cygwin/Mingw and not other platforms. | |
1683 | if test "$wants_win32" = 1 ; then | |
1684 | USE_UNIX=0 | |
1685 | USE_WIN32=1 | |
1686 | AC_DEFINE(__WIN32__) | |
1687 | AC_DEFINE(__WIN95__) | |
1688 | AC_DEFINE(__WINDOWS__) | |
1689 | AC_DEFINE(__GNUWIN32__) | |
1690 | AC_DEFINE(STRICT) | |
1691 | fi | |
1692 | if test "$doesnt_want_win32" = 1 ; then | |
1693 | USE_UNIX=1 | |
1694 | USE_WIN32=0 | |
1695 | fi | |
1696 | dnl (end of Windows-only piece) | |
1697 | ||
1698 | if test "$USE_UNIX" = 1 ; then | |
1699 | wxUSE_UNIX=yes | |
1700 | AC_DEFINE(__UNIX__) | |
1701 | fi | |
1702 | ||
1703 | dnl This case is for OS/2 vs. everything else | |
1704 | case "${host}" in | |
1705 | *-pc-os2_emx | *-pc-os2-emx ) | |
1706 | dnl --------------------------------------------------------------------- | |
1707 | dnl When we are using gcc on OS/2, we want to be either using resources | |
1708 | dnl (PM) or a more complete POSIX emulation for Motif/GTK+/X11. | |
1709 | dnl Moreover we need to link explicitly against either stdcpp.a or | |
1710 | dnl stdcxx.a (depending on compiler version), since we are using "gcc", | |
1711 | dnl not "g++/c++". | |
1712 | dnl --------------------------------------------------------------------- | |
1713 | dnl (OS/2-only piece) | |
1714 | if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_GTK" = 1 -o "$wxUSE_X11" = 1; then | |
1715 | dnl More complete Unix emulation for unix-like ports | |
1716 | dnl by linking in POSIX/2's cExt (if available). | |
1717 | AC_CHECK_LIB(cExt, drand48, LIBS="$LIBS -lcExt") | |
1718 | else | |
1719 | dnl Include resources for the "native" port (wxPM). | |
1720 | RESPROGRAMOBJ="\${top_srcdir}/include/wx/os2/wx.res" | |
1721 | fi | |
1722 | dnl Check for the gcc version (and thereby for the C runtime library). | |
1723 | dnl wx_cv_gccversion = EMX2 -> Standard EMX environment | |
1724 | dnl wx_cv_gccversion = EMX3 -> EMX with gcc-3.0.3 or gcc-3.2.1 | |
1725 | dnl wx_cv_gccversion = Innotek5 -> gcc-3.2.2 with Innotek libc5 | |
1726 | dnl wx_cv_gccversion = Innotek6 -> gcc-3.3.5 with Innotek libc6. | |
1727 | AC_CACHE_CHECK([for gcc/libc version], wx_cv_gccversion,[ | |
1728 | AC_TRY_RUN( | |
1729 | dnl Check the gcc version macro. | |
1730 | [ | |
1731 | #include <stdio.h> | |
1732 | ||
1733 | int main() | |
1734 | { | |
1735 | FILE *f=fopen("conftestval", "w"); | |
1736 | if (!f) exit(1); | |
1737 | fprintf(f, | |
1738 | #if (__GNUC__ < 3) | |
1739 | "EMX2" | |
1740 | #elif (__GNUC__==3) && ((__GNUC_MINOR__ < 2) || ((__GNUC_MINOR__==2) && (__GNUC_PATCHLEVEL__<2))) | |
1741 | "EMX3" | |
1742 | #elif (__GNUC__==3) && (__GNUC_MINOR__==2) && (__GNUC_PATCHLEVEL__==2) | |
1743 | "Innotek5" | |
1744 | #else | |
1745 | "Innotek6" | |
1746 | #endif | |
1747 | ); | |
1748 | exit(0); | |
1749 | } | |
1750 | ], | |
1751 | wx_cv_gccversion=`cat conftestval`, | |
1752 | wx_cv_gccversion="EMX2", | |
1753 | dnl Compilation error: Assuming standard EMX environment | |
1754 | wx_cv_gccversion="EMX2" | |
1755 | ) | |
1756 | ]) | |
1757 | if test "$wx_cv_gccversion" = "EMX2"; then | |
1758 | LIBS="$LIBS -lstdcpp" | |
1759 | LDFLAGS="$LDFLAGS -Zsysv-signals" | |
1760 | else | |
1761 | if test "$wx_cv_gccversion" = "EMX3"; then | |
1762 | LIBS="$LIBS -lstdcxx -lgcc" | |
1763 | LDFLAGS="$LDFLAGS -Zsysv-signals" | |
1764 | else | |
1765 | LIBS="$LIBS -lstdc++" | |
1766 | fi | |
1767 | fi | |
1768 | if test "$wxUSE_SHARED" = "yes" -a "$wxUSE_OMF" = "no"; then | |
1769 | AC_MSG_WARN([Building DLLs requires OMF mode, enabled]) | |
1770 | wxUSE_OMF=yes | |
1771 | enable_omf=yes | |
1772 | fi | |
1773 | dnl (end of OS/2-only piece) | |
1774 | ;; | |
1775 | *) | |
1776 | dnl --------------------------------------------------------------------- | |
1777 | dnl look for strcasecmp() in string.h and then strings.h if it's not | |
1778 | dnl there. Don't do this on OS/2, where "stricmp" is the function to be | |
1779 | dnl used. | |
1780 | dnl --------------------------------------------------------------------- | |
1781 | dnl (non-OS/2-only piece) | |
1782 | ||
1783 | AC_CACHE_CHECK([for strcasecmp() in string.h], ac_cv_string_strcasecmp, [ | |
1784 | AC_TRY_LINK([ | |
1785 | #include <string.h> | |
1786 | ], | |
1787 | [ | |
1788 | strcasecmp("foo", "bar"); | |
1789 | ], | |
1790 | ac_cv_string_strcasecmp=yes, | |
1791 | ac_cv_string_strcasecmp=no | |
1792 | ) | |
1793 | ]) | |
1794 | ||
1795 | if test x"$ac_cv_string_strcasecmp" = "xyes"; then | |
1796 | AC_DEFINE(HAVE_STRCASECMP_IN_STRING_H) | |
1797 | else | |
1798 | AC_CACHE_CHECK([for strcasecmp() in strings.h], ac_cv_strings_strcasecmp, [ | |
1799 | AC_TRY_LINK([ | |
1800 | #include <strings.h> | |
1801 | ], | |
1802 | [ | |
1803 | strcasecmp("foo", "bar"); | |
1804 | ], | |
1805 | ac_cv_strings_strcasecmp=yes, | |
1806 | ac_cv_strings_strcasecmp=no | |
1807 | ) | |
1808 | ]) | |
1809 | ||
1810 | if test x"$ac_cv_strings_strcasecmp" = "xyes"; then | |
1811 | AC_DEFINE(HAVE_STRCASECMP_IN_STRINGS_H) | |
1812 | else | |
1813 | AC_MSG_ERROR([No case-insensitive string comparison function found.]) | |
1814 | fi | |
1815 | fi | |
1816 | ||
1817 | dnl (end of non-OS/2-only piece) | |
1818 | ;; | |
1819 | esac | |
1820 | ||
1821 | dnl ------------------------------------------------------------------------ | |
1822 | dnl Check for headers | |
1823 | dnl ------------------------------------------------------------------------ | |
1824 | ||
1825 | AC_CHECK_HEADERS(stdlib.h fnmatch.h langinfo.h malloc.h unistd.h wchar.h) | |
1826 | ||
1827 | dnl maybe wchar_t is in wcstr.h if we don't have wchar.h? | |
1828 | if test "$ac_cv_header_wchar_h" != "yes"; then | |
1829 | AC_CHECK_HEADERS(wcstr.h) | |
1830 | fi | |
1831 | ||
1832 | case "${host}" in | |
1833 | *-pc-os2_emx | *-pc-os2-emx ) | |
1834 | dnl Explicitly link -lintl if langinfo.h is available | |
1835 | dnl and intl not yet included in libc | |
1836 | if test $ac_cv_header_langinfo_h = "yes" \ | |
1837 | -a \( "$wx_cv_gccversion" = "EMX2" \ | |
1838 | -o "$wx_cv_gccversion" = "EMX3" \ | |
1839 | -o "$wx_cv_gccversion" = "Innotek5" \); then | |
1840 | LIBS="$LIBS -lintl" | |
1841 | fi | |
1842 | ;; | |
1843 | esac | |
1844 | ||
1845 | dnl POSIX needs this for select(), but old systems don't have it | |
1846 | if test "$USE_UNIX" = 1 ; then | |
1847 | AC_CHECK_HEADERS([sys/select.h]) | |
1848 | fi | |
1849 | ||
1850 | dnl --------------------------------------------------------------------------- | |
1851 | dnl Checks for compiler characteristics | |
1852 | dnl --------------------------------------------------------------------------- | |
1853 | ||
1854 | dnl defines const to be empty if c-compiler does not support const fully | |
1855 | AC_C_CONST | |
1856 | dnl defines inline to a sensible value for the c-compiler | |
1857 | AC_C_INLINE | |
1858 | ||
1859 | dnl check the sizes of integral types (give some reasonable default values for | |
1860 | dnl cross-compiling) | |
1861 | dnl defines the size of certain types of variables in SIZEOF_<TYPE> | |
1862 | AC_CHECK_SIZEOF(char, 1) | |
1863 | AC_CHECK_SIZEOF(short, 2) | |
1864 | AC_CHECK_SIZEOF(void *, 4) | |
1865 | AC_CHECK_SIZEOF(int, 4) | |
1866 | AC_CHECK_SIZEOF(long, 4) | |
1867 | AC_CHECK_SIZEOF(size_t, 4) | |
1868 | ||
1869 | case "${host}" in | |
1870 | arm-*-linux* ) | |
1871 | AC_CHECK_SIZEOF(long long, 8) | |
1872 | ;; | |
1873 | *-hp-hpux* ) | |
1874 | AC_CHECK_SIZEOF(long long, 0) | |
1875 | if test "$ac_cv_sizeof_long_long" != "0"; then | |
1876 | dnl HPUX 10.20 headers need this define in order to use long long definitions | |
1877 | CPPFLAGS="-D_INCLUDE_LONGLONG $CPPFLAGS" | |
1878 | fi | |
1879 | ;; | |
1880 | * ) | |
1881 | AC_CHECK_SIZEOF(long long, 0) | |
1882 | esac | |
1883 | ||
1884 | dnl SGI/Irix's stdio.h does not include wchar_t. Mac OS X does not provide | |
1885 | dnl wchar.h and wchar_t is defined by stdlib.h (GD) | |
1886 | AC_CHECK_SIZEOF(wchar_t, 0, | |
1887 | [ | |
1888 | /* DJGPP's wchar_t is now a keyword in C++ (still not C though) */ | |
1889 | #if defined(__DJGPP__) && !( (__GNUC_MINOR__ >= 8 && __GNUC__ == 2 ) || __GNUC__ >= 3 ) | |
1890 | # error "fake wchar_t" | |
1891 | #endif | |
1892 | #ifdef HAVE_WCHAR_H | |
1893 | # ifdef __CYGWIN__ | |
1894 | # include <stddef.h> | |
1895 | # endif | |
1896 | # include <wchar.h> | |
1897 | #endif | |
1898 | #ifdef HAVE_STDLIB_H | |
1899 | # include <stdlib.h> | |
1900 | #endif | |
1901 | #include <stdio.h> | |
1902 | ] | |
1903 | ) | |
1904 | if test "$ac_cv_sizeof_wchar_t" != "0"; then | |
1905 | wxUSE_WCHAR_T=yes | |
1906 | else | |
1907 | wxUSE_WCHAR_T=no | |
1908 | fi | |
1909 | ||
1910 | dnl checks needed to define wxVaCopy | |
1911 | AC_CACHE_CHECK([for va_copy], | |
1912 | wx_cv_func_va_copy, | |
1913 | [ | |
1914 | AC_LINK_IFELSE([ | |
1915 | #include <stdarg.h> | |
1916 | void foo(char *f, ...) | |
1917 | { | |
1918 | va_list ap1, ap2; | |
1919 | va_start(ap1, f); | |
1920 | va_copy(ap2, ap1); | |
1921 | va_end(ap2); | |
1922 | va_end(ap1); | |
1923 | } | |
1924 | int main() | |
1925 | { | |
1926 | foo("hi", 17); | |
1927 | return 0; | |
1928 | }], | |
1929 | wx_cv_func_va_copy=yes, | |
1930 | wx_cv_func_va_copy=no | |
1931 | ) | |
1932 | ] | |
1933 | ) | |
1934 | ||
1935 | if test $wx_cv_func_va_copy = "yes"; then | |
1936 | AC_DEFINE(HAVE_VA_COPY) | |
1937 | else | |
1938 | dnl try to understand how can we copy va_lists | |
1939 | AC_CACHE_CHECK([if va_list can be copied by value], | |
1940 | wx_cv_type_va_list_lvalue, | |
1941 | [ | |
1942 | AC_RUN_IFELSE([ | |
1943 | #include <stdarg.h> | |
1944 | int foo(char *f, ...) | |
1945 | { | |
1946 | va_list ap1, ap2; | |
1947 | va_start(ap1, f); | |
1948 | ap2 = ap1; | |
1949 | if ( va_arg(ap1, int) != 17 || va_arg(ap2, int) != 17 ) | |
1950 | return 1; | |
1951 | va_end(ap2); | |
1952 | va_end(ap1); | |
1953 | return 0; | |
1954 | } | |
1955 | int main() | |
1956 | { | |
1957 | return foo("hi", 17); | |
1958 | }], | |
1959 | wx_cv_type_va_list_lvalue=yes, | |
1960 | wx_cv_type_va_list_lvalue=no, | |
1961 | dnl assume most common case for cross-compiling... | |
1962 | wx_cv_type_va_list_lvalue=yes | |
1963 | ) | |
1964 | ] | |
1965 | ) | |
1966 | ||
1967 | if test $wx_cv_type_va_list_lvalue != "yes"; then | |
1968 | dnl we suppose that the only thing which can't be copied like this | |
1969 | dnl are arrays... only experience will show whether this is really true | |
1970 | AC_DEFINE(VA_LIST_IS_ARRAY) | |
1971 | fi | |
1972 | fi | |
1973 | ||
1974 | dnl don't check for vararg macros if they're explicitly disabled: this is | |
1975 | dnl useful if the user code using the library wants to limit itself to standard | |
1976 | dnl C++ only (e.g. is compiled with g++ -std=c++98) | |
1977 | if test "$wxUSE_VARARG_MACROS" = "yes"; then | |
1978 | ||
1979 | dnl Check if variadic macros (C99 feature) are supported: | |
1980 | AC_CACHE_CHECK( | |
1981 | [whether the compiler supports variadic macros], | |
1982 | [wx_cv_have_variadic_macros], | |
1983 | [ | |
1984 | dnl C compiler might support variadic macros when C++ one doesn't | |
1985 | dnl (happens with gcc/g++ 2.95.4), so must use C++ one explicitly | |
1986 | AC_LANG_PUSH(C++) | |
1987 | AC_COMPILE_IFELSE( | |
1988 | AC_LANG_PROGRAM( | |
1989 | [ | |
1990 | #include <stdio.h> | |
1991 | #define test(fmt, ...) printf(fmt, __VA_ARGS__) | |
1992 | ], | |
1993 | [ | |
1994 | test("%s %d %p", "test", 1, 0); | |
1995 | ] | |
1996 | ), | |
1997 | [wx_cv_have_variadic_macros=yes], | |
1998 | [wx_cv_have_variadic_macros=no] | |
1999 | ) | |
2000 | AC_LANG_POP() | |
2001 | ] | |
2002 | ) | |
2003 | ||
2004 | if test $wx_cv_have_variadic_macros = "yes"; then | |
2005 | AC_DEFINE(HAVE_VARIADIC_MACROS) | |
2006 | fi | |
2007 | ||
2008 | fi dnl wxUSE_VARARG_MACROS == yes | |
2009 | ||
2010 | dnl check for large file support | |
2011 | AC_SYS_LARGEFILE | |
2012 | ||
2013 | dnl we need to define _FILE_OFFSET_BITS or _LARGE_FILES on the compiler command | |
2014 | dnl line because otherwise the system headers risk being included before | |
2015 | dnl wx/defs.h which defines these constants leading to inconsistent | |
2016 | dnl sizeof(off_t) in different source files of the same program and linking | |
2017 | dnl problems | |
2018 | if test "x$wx_largefile" = "xyes"; then | |
2019 | if test "x$ac_cv_sys_file_offset_bits" = "x64"; then | |
2020 | WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES" | |
2021 | ||
2022 | dnl We get "Large Files (ILP32) not supported in strict ANSI mode." | |
2023 | dnl #error from HP standard headers unless __STDC_EXT__ is defined. | |
2024 | dnl The compiler should define it automatically, but some old g++ | |
2025 | dnl versions don't define it, so test and add it if necessary. AFAIK | |
2026 | dnl the problem only affects the C++ compiler so it is added to | |
2027 | dnl CXXFLAGS only. | |
2028 | if test "$USE_HPUX" = 1 -a "$GXX" = "yes"; then | |
2029 | AC_CACHE_CHECK( | |
2030 | [if -D__STDC_EXT__ is required], | |
2031 | wx_cv_STDC_EXT_required, | |
2032 | [ | |
2033 | AC_LANG_PUSH(C++) | |
2034 | AC_TRY_COMPILE( | |
2035 | [], | |
2036 | [ | |
2037 | #ifndef __STDC_EXT__ | |
2038 | choke me | |
2039 | #endif | |
2040 | ], | |
2041 | wx_cv_STDC_EXT_required=no, | |
2042 | wx_cv_STDC_EXT_required=yes | |
2043 | ) | |
2044 | AC_LANG_POP() | |
2045 | ] | |
2046 | ) | |
2047 | if test "x$wx_cv_STDC_EXT_required" = "xyes"; then | |
2048 | WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -D__STDC_EXT__" | |
2049 | fi | |
2050 | fi | |
2051 | else | |
2052 | WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_LARGE_FILES" | |
2053 | fi | |
2054 | dnl AC_FUNC_FSEEKO sets HAVE_FSEEKO and $ac_cv_sys_largefile_source | |
2055 | AC_FUNC_FSEEKO | |
2056 | if test "$ac_cv_sys_largefile_source" != no; then | |
2057 | WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_LARGEFILE_SOURCE=$ac_cv_sys_largefile_source" | |
2058 | fi | |
2059 | fi | |
2060 | ||
2061 | dnl check for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling) | |
2062 | WX_C_BIGENDIAN | |
2063 | ||
2064 | dnl check for iostream (as opposed to iostream.h) standard header | |
2065 | WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH)) | |
2066 | ||
2067 | dnl check whether C++ compiler supports bool built-in type | |
2068 | WX_CPP_BOOL | |
2069 | ||
2070 | dnl check whether C++ compiler supports explicit keyword | |
2071 | WX_CPP_EXPLICIT | |
2072 | ||
2073 | dnl check whether C++ compiler supports C++ casts | |
2074 | AC_CXX_CONST_CAST | |
2075 | AC_CXX_REINTERPRET_CAST | |
2076 | AC_CXX_STATIC_CAST | |
2077 | dnl we don't use HAVE_DYNAMIC_CAST anywhere right now... | |
2078 | dnl AC_CXX_DYNAMIC_CAST | |
2079 | ||
2080 | dnl With Sun CC, temporaries have block scope by default. This flag is needed | |
2081 | dnl to get the expression scope behaviour that conforms to the standard. | |
2082 | if test "x$SUNCXX" = xyes; then | |
2083 | CXXFLAGS="-features=tmplife $CXXFLAGS" | |
2084 | fi | |
2085 | ||
2086 | dnl Sun X11 headers are (still, in 2005!) non-ANSI and the best they could do | |
2087 | dnl was to hack their C++ compiler to accept them silently -- but C compiler | |
2088 | dnl still spits out dozens of warnings for each X include file, so suppress | |
2089 | dnl them | |
2090 | if test "x$SUNCC" = xyes; then | |
2091 | CFLAGS="-erroff=E_NO_EXPLICIT_TYPE_GIVEN $CFLAGS" | |
2092 | fi | |
2093 | ||
2094 | dnl SGI mipsPro compiler gives this warning for "conversion from pointer to | |
2095 | dnl same-sized integral type" even when there is an explicit cast and as there | |
2096 | dnl is no way to turn it off and there are hundreds of these warnings in wx | |
2097 | dnl sources, just turn it off for now | |
2098 | dnl | |
2099 | dnl a better long term solution would be to use #pragma set/reset woff in | |
2100 | dnl wxPtrToUInt() and use it instead of casts elsewhere | |
2101 | if test "x$SGICC" = "xyes"; then | |
2102 | CFLAGS="-woff 3970 $CFLAGS" | |
2103 | fi | |
2104 | if test "x$SGICXX" = "xyes"; then | |
2105 | CXXFLAGS="-woff 3970 $CXXFLAGS" | |
2106 | fi | |
2107 | ||
2108 | dnl HP-UX c89/aCC compiler warnings | |
2109 | if test "x$HPCC" = "xyes"; then | |
2110 | dnl 2011: "unrecognized preprocessor directive": nice warning but it's given | |
2111 | dnl even for directives inside #if which is not true (i.e. which are | |
2112 | dnl used for other compilers/OS) and so we have no way to get rid of it | |
2113 | dnl 2450: "long long is non standard" -- yes, we know | |
2114 | CFLAGS="+W 2011,2450 $CFLAGS" | |
2115 | fi | |
2116 | if test "x$HPCXX" = "xyes"; then | |
2117 | dnl 2340: "value copied to temporary, reference to temporary used": very | |
2118 | dnl painful as triggered by any occurrence of user-defined conversion | |
2119 | CXXFLAGS="+W 2340 $CXXFLAGS" | |
2120 | fi | |
2121 | ||
2122 | dnl DEC/Compaq/HP cxx warnings | |
2123 | if test "x$COMPAQCXX" = "xyes"; then | |
2124 | dnl -w0 enables all warnings, then we disable some of them: | |
2125 | dnl basclsnondto: base class dtor non virtual (sometimes we do want this) | |
2126 | dnl unrimpret: "end of routine block may be unreachable" is given for | |
2127 | dnl every "if ( ) return ...; else return ...;" | |
2128 | dnl intconlosbit: "conversion to integral type of smaller size could lose | |
2129 | dnl data" this is a useful warning but there are too many of | |
2130 | dnl them for now | |
2131 | CXXFLAGS="-w0 -msg_disable basclsnondto,unrimpret,intconlosbit" | |
2132 | fi | |
2133 | ||
2134 | dnl the next few tests are all for C++ features and so need to be done using | |
2135 | dnl C++ compiler | |
2136 | AC_LANG_PUSH(C++) | |
2137 | ||
2138 | dnl check for std::string or std::wstring | |
2139 | if test "$wxUSE_STD_STRING" = "yes" -o "$wxUSE_STL" = "yes"; then | |
2140 | if test "$wxUSE_UNICODE" = "yes"; then | |
2141 | std_string="std::wstring" | |
2142 | char_type="wchar_t" | |
2143 | else | |
2144 | std_string="std::string" | |
2145 | char_type="char" | |
2146 | fi | |
2147 | ||
2148 | dnl check if <string> declares std::[w]string | |
2149 | AC_CACHE_CHECK([for $std_string in <string>], | |
2150 | wx_cv_class_stdstring, | |
2151 | [ | |
2152 | AC_TRY_COMPILE([#include <string>], | |
2153 | [$std_string foo;], | |
2154 | wx_cv_class_stdstring=yes, | |
2155 | wx_cv_class_stdstring=no | |
2156 | ) | |
2157 | ] | |
2158 | ) | |
2159 | ||
2160 | if test "$wx_cv_class_stdstring" = yes; then | |
2161 | if test "$wxUSE_UNICODE" = "yes"; then | |
2162 | AC_DEFINE(HAVE_STD_WSTRING) | |
2163 | fi | |
2164 | dnl we don't need HAVE_STD_STRING, we just suppose it's available if | |
2165 | dnl wxUSE_STD_STRING==yes | |
2166 | else | |
2167 | AC_CACHE_CHECK([if std::basic_string<$char_type> works], | |
2168 | wx_cv_class_stdbasicstring, | |
2169 | [ | |
2170 | AC_TRY_COMPILE([ | |
2171 | #ifdef HAVE_WCHAR_H | |
2172 | # ifdef __CYGWIN__ | |
2173 | # include <stddef.h> | |
2174 | # endif | |
2175 | # include <wchar.h> | |
2176 | #endif | |
2177 | #ifdef HAVE_STDLIB_H | |
2178 | # include <stdlib.h> | |
2179 | #endif | |
2180 | #include <stdio.h> | |
2181 | #include <string> | |
2182 | ], | |
2183 | [std::basic_string<$char_type> foo; | |
2184 | const $char_type* dummy = foo.c_str();], | |
2185 | wx_cv_class_stdbasicstring=yes, | |
2186 | wx_cv_class_stdbasicstring=no | |
2187 | ) | |
2188 | ] | |
2189 | ) | |
2190 | ||
2191 | if test "$wx_cv_class_stdbasicstring" != yes; then | |
2192 | if test "$wxUSE_STL" = "yes"; then | |
2193 | AC_MSG_ERROR([Can't use --enable-stl without $std_string or std::basic_string<$char_type>]) | |
2194 | elif grep wxUSE_STD_STRING $wx_arg_cache_file >/dev/null; then | |
2195 | AC_MSG_ERROR([Can't use --enable-std_string without $std_string or std::basic_string<$char_type>]) | |
2196 | else | |
2197 | AC_MSG_WARN([No $std_string or std::basic_string<$char_type>, switching to --disable-std_string]) | |
2198 | wxUSE_STD_STRING=no | |
2199 | fi | |
2200 | fi | |
2201 | fi | |
2202 | fi | |
2203 | ||
2204 | if test "$wxUSE_STD_IOSTREAM" = "yes"; then | |
2205 | AC_CHECK_TYPES([std::istream, std::ostream],, | |
2206 | [wxUSE_STD_IOSTREAM=no], | |
2207 | [#include <iostream>]) | |
2208 | ||
2209 | if test "$wxUSE_STD_IOSTREAM" != "yes"; then | |
2210 | if grep wxUSE_STD_IOSTREAM $wx_arg_cache_file >/dev/null; then | |
2211 | AC_MSG_ERROR([Can't use --enable-std_iostreams without std::istream and std::ostream]) | |
2212 | else | |
2213 | AC_MSG_WARN([No std::iostreams, switching to --disable-std_iostreams]) | |
2214 | fi | |
2215 | fi | |
2216 | fi | |
2217 | ||
2218 | if test "$wxUSE_STL" = "yes"; then | |
2219 | dnl check for basic STL functionality | |
2220 | AC_CACHE_CHECK([for basic STL functionality], | |
2221 | wx_cv_lib_stl, | |
2222 | [AC_TRY_COMPILE([#include <string> | |
2223 | #include <functional> | |
2224 | #include <algorithm> | |
2225 | #include <vector> | |
2226 | #include <list>], | |
2227 | [std::vector<int> moo; | |
2228 | std::list<int> foo; | |
2229 | std::vector<int>::iterator it = | |
2230 | std::find_if(moo.begin(), moo.end(), | |
2231 | std::bind2nd(std::less<int>(), 3));], | |
2232 | wx_cv_lib_stl=yes, | |
2233 | wx_cv_lib_stl=no | |
2234 | )] | |
2235 | ) | |
2236 | ||
2237 | if test "$wx_cv_lib_stl" != yes; then | |
2238 | AC_MSG_ERROR([Can't use --enable-stl as basic STL functionality is missing]) | |
2239 | fi | |
2240 | ||
2241 | dnl check for compliant std::string::compare | |
2242 | AC_CACHE_CHECK([for compliant std::string::compare], | |
2243 | wx_cv_func_stdstring_compare, | |
2244 | [AC_TRY_COMPILE([#include <string>], | |
2245 | [std::string foo, bar; | |
2246 | foo.compare(bar); | |
2247 | foo.compare(1, 1, bar); | |
2248 | foo.compare(1, 1, bar, 1, 1); | |
2249 | foo.compare(""); | |
2250 | foo.compare(1, 1, ""); | |
2251 | foo.compare(1, 1, "", 2);], | |
2252 | wx_cv_func_stdstring_compare=yes, | |
2253 | wx_cv_func_stdstring_compare=no | |
2254 | )] | |
2255 | ) | |
2256 | ||
2257 | if test "$wx_cv_func_stdstring_compare" = yes; then | |
2258 | AC_DEFINE(HAVE_STD_STRING_COMPARE) | |
2259 | fi | |
2260 | ||
2261 | dnl check for hash_map and hash_set headers | |
2262 | AC_CHECK_HEADER([hash_map], | |
2263 | [AC_CACHE_CHECK([for standard hash_map and hash_set], | |
2264 | wx_cv_class_stdhashmapset, | |
2265 | [AC_TRY_COMPILE([#include <hash_map> | |
2266 | #include <hash_set>], | |
2267 | [std::hash_map<double*, char*, std::hash<double*>, std::equal_to<double*> > test1; | |
2268 | std::hash_set<char*, std::hash<char*>, std::equal_to<char*> > test2;], | |
2269 | wx_cv_class_stdhashmapset=yes, | |
2270 | wx_cv_class_stdhashmapset=no) | |
2271 | ] | |
2272 | )] | |
2273 | ) | |
2274 | ||
2275 | if test "$wx_cv_class_stdhashmapset" = yes; then | |
2276 | AC_DEFINE(HAVE_HASH_MAP) | |
2277 | AC_DEFINE(HAVE_STD_HASH_MAP) | |
2278 | fi | |
2279 | ||
2280 | AC_CHECK_HEADER([ext/hash_map], | |
2281 | [AC_CACHE_CHECK([for GNU hash_map and hash_set], | |
2282 | wx_cv_class_gnuhashmapset, | |
2283 | [AC_TRY_COMPILE([#include <ext/hash_map> | |
2284 | #include <ext/hash_set>], | |
2285 | [__gnu_cxx::hash_map<double*, char*, __gnu_cxx::hash<double*>, std::equal_to<double*> > test1; | |
2286 | __gnu_cxx::hash_set<char*, __gnu_cxx::hash<char*>, std::equal_to<char*> > test2;], | |
2287 | wx_cv_class_gnuhashmapset=yes, | |
2288 | wx_cv_class_gnuhashmapset=no) | |
2289 | ] | |
2290 | )] | |
2291 | ) | |
2292 | ||
2293 | if test "$wx_cv_class_gnuhashmapset" = yes; then | |
2294 | AC_DEFINE(HAVE_EXT_HASH_MAP) | |
2295 | AC_DEFINE(HAVE_GNU_CXX_HASH_MAP) | |
2296 | fi | |
2297 | fi | |
2298 | ||
2299 | dnl pop C++ | |
2300 | AC_LANG_POP() | |
2301 | ||
2302 | dnl --------------------------------------------------------------------------- | |
2303 | dnl Define search path for includes and libraries: all headers and libs will be | |
2304 | dnl looked for in all directories of this path | |
2305 | dnl --------------------------------------------------------------------------- | |
2306 | ||
2307 | dnl Notice that /usr/include should *not* be in this list, otherwise it breaks | |
2308 | dnl compilation on Solaris/AIX/... with gcc because standard (non ANSI C) | |
2309 | dnl headers are included instead of the "fixed" (ANSI-fied) gcc ones. | |
2310 | dnl | |
2311 | dnl Also try to put all directories which may contain X11R6 before those which | |
2312 | dnl may contain X11R5/4 - we want to use R6 on machines which have both! | |
2313 | dnl | |
2314 | dnl In the same vein. Motif 2.1 should be tried before Motif 1.2 for the | |
2315 | dnl systems which have both (AIX 4.x does) | |
2316 | SEARCH_INCLUDE="\ | |
2317 | /usr/local/include \ | |
2318 | \ | |
2319 | /usr/Motif-2.1/include \ | |
2320 | /usr/Motif-1.2/include \ | |
2321 | /usr/include/Motif1.2 \ | |
2322 | \ | |
2323 | /usr/dt/include \ | |
2324 | /usr/openwin/include \ | |
2325 | \ | |
2326 | /usr/include/Xm \ | |
2327 | \ | |
2328 | /usr/X11R6/include \ | |
2329 | /usr/X11R6.4/include \ | |
2330 | /usr/X11R5/include \ | |
2331 | /usr/X11R4/include \ | |
2332 | \ | |
2333 | /usr/include/X11R6 \ | |
2334 | /usr/include/X11R5 \ | |
2335 | /usr/include/X11R4 \ | |
2336 | \ | |
2337 | /usr/local/X11R6/include \ | |
2338 | /usr/local/X11R5/include \ | |
2339 | /usr/local/X11R4/include \ | |
2340 | \ | |
2341 | /usr/local/include/X11R6 \ | |
2342 | /usr/local/include/X11R5 \ | |
2343 | /usr/local/include/X11R4 \ | |
2344 | \ | |
2345 | /usr/X11/include \ | |
2346 | /usr/include/X11 \ | |
2347 | /usr/local/X11/include \ | |
2348 | /usr/local/include/X11 \ | |
2349 | \ | |
2350 | /usr/XFree86/include/X11 \ | |
2351 | /usr/pkg/include \ | |
2352 | \ | |
2353 | /usr/openwin/share/include" | |
2354 | ||
2355 | dnl try to find out the standard lib locations for the systems with multiple | |
2356 | dnl ABIs | |
2357 | AC_MSG_CHECKING([for libraries directory]) | |
2358 | ||
2359 | case "${host}" in | |
2360 | *-*-irix6* ) | |
2361 | AC_CACHE_VAL( | |
2362 | wx_cv_std_libpath, | |
2363 | [ | |
2364 | for d in WX_STD_LIBPATH(); do | |
2365 | for e in a so sl dylib dll.a; do | |
2366 | libc="$d/libc.$e" | |
2367 | if test -f $libc; then | |
2368 | save_LIBS="$LIBS" | |
2369 | LIBS="$libc" | |
2370 | AC_LINK_IFELSE([int main() { return 0; }], | |
2371 | wx_cv_std_libpath=`echo $d | sed s@/usr/@@`) | |
2372 | LIBS="$save_LIBS" | |
2373 | if test "x$wx_cv_std_libpath" != "x"; then | |
2374 | break 2 | |
2375 | fi | |
2376 | fi | |
2377 | done | |
2378 | done | |
2379 | if test "x$wx_cv_std_libpath" = "x"; then | |
2380 | wx_cv_std_libpath="lib" | |
2381 | fi | |
2382 | ] | |
2383 | ) | |
2384 | ;; | |
2385 | ||
2386 | *-*-solaris2* ) | |
2387 | dnl use ../lib or ../lib/64 depending on the size of void* | |
2388 | if test "$ac_cv_sizeof_void_p" = 8 -a -d "/usr/lib/64"; then | |
2389 | wx_cv_std_libpath="lib/64" | |
2390 | else | |
2391 | wx_cv_std_libpath="lib" | |
2392 | fi | |
2393 | ;; | |
2394 | ||
2395 | *-*-linux* ) | |
2396 | dnl use ../lib or ../lib64 depending on the size of void* | |
2397 | if test "$ac_cv_sizeof_void_p" = 8 -a \ | |
2398 | -d "/usr/lib64" -a ! -h "/usr/lib64"; then | |
2399 | wx_cv_std_libpath="lib64" | |
2400 | else | |
2401 | wx_cv_std_libpath="lib" | |
2402 | fi | |
2403 | ;; | |
2404 | ||
2405 | *) | |
2406 | wx_cv_std_libpath="lib"; | |
2407 | ;; | |
2408 | esac | |
2409 | ||
2410 | AC_MSG_RESULT($wx_cv_std_libpath) | |
2411 | ||
2412 | SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s@include@$wx_cv_std_libpath@g` /usr/$wx_cv_std_libpath" | |
2413 | ||
2414 | dnl Cross compiling with gcc? | |
2415 | if test "$build" != "$host" -a "$GCC" = yes; then | |
2416 | dnl for gcc cross-compilers "$CC -print-prog-name=ld" prints the path to | |
2417 | dnl the linker. Stripping off the trailing '/bin/ld' gives us a candiate | |
2418 | dnl for a 'root' below which libraries and headers for the target system | |
2419 | dnl might be installed. | |
2420 | if cross_root=`$CC -print-prog-name=ld 2>/dev/null`; then | |
2421 | cross_root=`dirname $cross_root` | |
2422 | cross_root=`dirname $cross_root` | |
2423 | ||
2424 | dnl substitute this candiate root for '^/usr' in the search lists, | |
2425 | dnl strip out any that don't start '^/usr'. | |
2426 | SEARCH_LIB=`for x in $SEARCH_LIB; do echo $x; done | sed -ne "s|^/usr|$cross_root|p"` | |
2427 | SEARCH_INCLUDE=`for x in $SEARCH_INCLUDE; do echo $x; done | sed -ne "s|^/usr|$cross_root|p"` | |
2428 | SEARCH_INCLUDE="$SEARCH_INCLUDE $cross_root/include" | |
2429 | ||
2430 | dnl also have pkg-config search for *.pc files under this 'root' | |
2431 | if test -z "$PKG_CONFIG_PATH"; then | |
2432 | PKG_CONFIG_PATH="$cross_root/local/lib/pkgconfig:$cross_root/lib/pkgconfig" | |
2433 | export PKG_CONFIG_PATH | |
2434 | fi | |
2435 | ||
2436 | dnl AC_PATH_XTRA doesn't work currently unless -x-includes and | |
2437 | dnl -x-libraries are given on the command line. So if they are not | |
2438 | dnl set then set them here to plausible defaults. | |
2439 | if test -z "$x_includes" -o "$x_includes" = NONE; then | |
2440 | WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, X11/Intrinsic.h) | |
2441 | x_includes=$ac_find_includes | |
2442 | fi | |
2443 | if test -z "$x_libraries" -o "$x_libraries" = NONE; then | |
2444 | WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xt) | |
2445 | x_libraries=$ac_find_libraries | |
2446 | fi | |
2447 | fi | |
2448 | fi | |
2449 | ||
2450 | dnl ------------------------------------------------------------------------ | |
2451 | dnl Check for libraries | |
2452 | dnl ------------------------------------------------------------------------ | |
2453 | ||
2454 | dnl flush the cache because checking for libraries below might abort | |
2455 | AC_CACHE_SAVE | |
2456 | ||
2457 | dnl check for glibc version | |
2458 | dnl | |
2459 | dnl VZ: I have no idea why had this check been there originally, but now | |
2460 | dnl we could probably do without it by just always adding _GNU_SOURCE | |
2461 | if test "$USE_LINUX" = 1 -o "$USE_GNU" = 1; then | |
2462 | AC_CACHE_CHECK([for glibc 2.1 or later], wx_cv_lib_glibc21,[ | |
2463 | AC_TRY_COMPILE([#include <features.h>], | |
2464 | [ | |
2465 | #if (__GLIBC__ < 2) || (__GLIBC_MINOR__ < 1) | |
2466 | not glibc 2.1 | |
2467 | #endif | |
2468 | ], | |
2469 | [ | |
2470 | wx_cv_lib_glibc21=yes | |
2471 | ], | |
2472 | [ | |
2473 | wx_cv_lib_glibc21=no | |
2474 | ] | |
2475 | ) | |
2476 | ]) | |
2477 | if test "$wx_cv_lib_glibc21" = "yes"; then | |
2478 | AC_DEFINE(wxHAVE_GLIBC2) | |
2479 | fi | |
2480 | fi | |
2481 | ||
2482 | dnl we may need _GNU_SOURCE for 2 things: | |
2483 | dnl | |
2484 | dnl 1. to get PTHREAD_MUTEX_RECURSIVE with glibc 2.1+ (strictly speaking we | |
2485 | dnl only need _XOPEN_SOURCE=500 but just defining this disables _BSD_SOURCE | |
2486 | dnl which breaks libtiff compilation, so it is simpler to just define | |
2487 | dnl _GNU_SOURCE to get everything) | |
2488 | dnl | |
2489 | dnl 2. for Unicode functions | |
2490 | if test "x$wx_cv_lib_glibc21" = "xyes"; then | |
2491 | if test "$wxUSE_UNICODE" = "yes" -o "$wxUSE_THREADS" = "yes"; then | |
2492 | AC_DEFINE(_GNU_SOURCE) | |
2493 | fi | |
2494 | fi | |
2495 | ||
2496 | dnl Only add the -lm library if floating point functions cannot be used | |
2497 | dnl without it. This check is important on cygwin because of the bizarre | |
2498 | dnl way that they have organized functions into libraries. On cygwin, both | |
2499 | dnl libc.a and libm.a are symbolic links to a single lib libcygwin.a. This | |
2500 | dnl means that | |
2501 | dnl 1) linking with -lm is not necessary, and | |
2502 | dnl 2) linking with -lm is dangerous if the order of libraries is wrong | |
2503 | dnl In particular, if you compile any program with -mno-cygwin and link with | |
2504 | dnl -lm, it will crash instantly when it is run. This happens because the | |
2505 | dnl linker incorrectly links the Cygwin libm.a (==libcygwin.a), which replaces | |
2506 | dnl the ___main function instead of allowing it to be defined by | |
2507 | dnl /usr/lib/mingw/libmingw32.a as it should be. | |
2508 | dnl | |
2509 | dnl On MacOS X, this test will find that -lm is unnecessary and leave it out. | |
2510 | dnl | |
2511 | dnl Just check a few floating point functions. If they are all found without | |
2512 | dnl -lm, then we must not need -lm. | |
2513 | have_cos=0 | |
2514 | have_floor=0 | |
2515 | AC_CHECK_FUNCS(cos, have_cos=1) | |
2516 | AC_CHECK_FUNCS(floor, have_floor=1) | |
2517 | AC_MSG_CHECKING(if floating point functions link without -lm) | |
2518 | if test "$have_cos" = 1 -a "$have_floor" = 1; then | |
2519 | AC_MSG_RESULT(yes) | |
2520 | else | |
2521 | AC_MSG_RESULT(no) | |
2522 | LIBS="$LIBS -lm" | |
2523 | # use different functions to avoid configure caching | |
2524 | have_sin=0 | |
2525 | have_ceil=0 | |
2526 | AC_CHECK_FUNCS(sin, have_sin=1) | |
2527 | AC_CHECK_FUNCS(ceil, have_ceil=1) | |
2528 | AC_MSG_CHECKING(if floating point functions link with -lm) | |
2529 | if test "$have_sin" = 1 -a "$have_ceil" = 1; then | |
2530 | AC_MSG_RESULT(yes) | |
2531 | else | |
2532 | AC_MSG_RESULT(no) | |
2533 | # not sure we should warn the user, crash, etc. | |
2534 | fi | |
2535 | fi | |
2536 | ||
2537 | dnl check for C99 string to long long conversion functions, assume that if we | |
2538 | dnl have the unsigned variants, then we have the signed ones as well | |
2539 | if test "wxUSE_UNICODE" = "yes"; then | |
2540 | WX_CHECK_FUNCS(wcstoull) | |
2541 | else | |
2542 | WX_CHECK_FUNCS(strtoull) | |
2543 | fi | |
2544 | ||
2545 | dnl --------------------------------------------------------------------------- | |
2546 | dnl Optional libraries | |
2547 | dnl | |
2548 | dnl --with-<lib>=sys | |
2549 | dnl looks for system library and fails if not found | |
2550 | dnl | |
2551 | dnl --with-<lib> | |
2552 | dnl --with-<lib>=yes | |
2553 | dnl looks for system library and, if not found, prints a warning, | |
2554 | dnl falls back to the builtin wx version, and continues configuration | |
2555 | dnl | |
2556 | dnl --with-<lib>=builtin | |
2557 | dnl uses builtin wx version without searching for system library | |
2558 | dnl | |
2559 | dnl --with-<lib>=no | |
2560 | dnl --without-<lib> | |
2561 | dnl do not use library (neither system nor builtin wx version) | |
2562 | dnl | |
2563 | dnl --------------------------------------------------------------------------- | |
2564 | ||
2565 | dnl ------------------------------------------------------------------------ | |
2566 | dnl Check for regex libraries | |
2567 | dnl ------------------------------------------------------------------------ | |
2568 | ||
2569 | if test "$wxUSE_REGEX" != "no"; then | |
2570 | AC_DEFINE(wxUSE_REGEX) | |
2571 | ||
2572 | if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_REGEX" = "yes"; then | |
2573 | AC_MSG_WARN([Defaulting to the the builtin regex library for Unicode build.]) | |
2574 | wxUSE_REGEX=builtin | |
2575 | fi | |
2576 | ||
2577 | if test "$wxUSE_REGEX" = "sys" -o "$wxUSE_REGEX" = "yes" ; then | |
2578 | dnl according to Unix 98 specs, regcomp() is in libc but I believe that | |
2579 | dnl on some old systems it may be in libregex - check for it too? | |
2580 | AC_CHECK_HEADER(regex.h, [AC_CHECK_FUNCS(regcomp re_search)]) | |
2581 | ||
2582 | if test "x$ac_cv_func_regcomp" != "xyes"; then | |
2583 | if test "$wxUSE_REGEX" = "sys" ; then | |
2584 | AC_MSG_ERROR([system regex library not found! Use --with-regex to use built-in version]) | |
2585 | else | |
2586 | AC_MSG_WARN([system regex library not found, will use built-in instead]) | |
2587 | wxUSE_REGEX=builtin | |
2588 | fi | |
2589 | else | |
2590 | dnl we are using the system library | |
2591 | wxUSE_REGEX=sys | |
2592 | dnl only the built-in supports advanced REs | |
2593 | AC_DEFINE(WX_NO_REGEX_ADVANCED) | |
2594 | fi | |
2595 | fi | |
2596 | fi | |
2597 | ||
2598 | dnl ------------------------------------------------------------------------ | |
2599 | dnl Check for zlib compression library | |
2600 | dnl ------------------------------------------------------------------------ | |
2601 | ||
2602 | ZLIB_LINK= | |
2603 | if test "$wxUSE_ZLIB" != "no" ; then | |
2604 | AC_DEFINE(wxUSE_ZLIB) | |
2605 | ||
2606 | if test "$wxUSE_ZLIB" = "sys" -o "$wxUSE_ZLIB" = "yes" ; then | |
2607 | dnl don't test for zlib under Mac -- its verson there is 1.1.3 but we | |
2608 | dnl should still use it because hopefully (can someone confirm this?) | |
2609 | dnl Apple did fix the security problem in it and not using the system | |
2610 | dnl library results in a whole bunch of warnings when linking with | |
2611 | dnl Carbon framework | |
2612 | if test "$USE_DARWIN" = 1; then | |
2613 | system_zlib_h_ok="yes" | |
2614 | else | |
2615 | dnl we have troubles with ancient zlib versions (e.g. 1.0.4 is | |
2616 | dnl known to not work) and although I don't know which is | |
2617 | dnl the minimal required version it's safer to test for 1.1.4 as | |
2618 | dnl it fixes a security problem in 1.1.3 -- and hopefully nobody | |
2619 | dnl has anything more ancient (1.1.3 was released in July 1998) | |
2620 | dnl anyhow | |
2621 | AC_CACHE_CHECK([for zlib.h >= 1.1.4], ac_cv_header_zlib_h, | |
2622 | [AC_TRY_RUN( | |
2623 | dnl zlib.h defines ZLIB_VERSION="x.y.z" | |
2624 | [ | |
2625 | #include <zlib.h> | |
2626 | #include <stdio.h> | |
2627 | ||
2628 | int main() | |
2629 | { | |
2630 | FILE *f=fopen("conftestval", "w"); | |
2631 | if (!f) exit(1); | |
2632 | fprintf(f, "%s", | |
2633 | ZLIB_VERSION[0] == '1' && | |
2634 | (ZLIB_VERSION[2] > '1' || | |
2635 | (ZLIB_VERSION[2] == '1' && | |
2636 | ZLIB_VERSION[4] >= '4')) ? "yes" : "no"); | |
2637 | exit(0); | |
2638 | } | |
2639 | ], | |
2640 | ac_cv_header_zlib_h=`cat conftestval`, | |
2641 | ac_cv_header_zlib_h=no, | |
2642 | dnl cross-compiling: don't have an answer, try later | |
2643 | unset ac_cv_header_zlib_h | |
2644 | )] | |
2645 | ) | |
2646 | dnl If the test above did not come up with a value (e.g. cross | |
2647 | dnl compiling) then this should give a definitive answer | |
2648 | AC_CHECK_HEADER(zlib.h) | |
2649 | ||
2650 | system_zlib_h_ok=$ac_cv_header_zlib_h | |
2651 | fi | |
2652 | ||
2653 | if test "$system_zlib_h_ok" = "yes"; then | |
2654 | AC_CHECK_LIB(z, deflate, ZLIB_LINK=" -lz") | |
2655 | fi | |
2656 | ||
2657 | if test "x$ZLIB_LINK" = "x" ; then | |
2658 | if test "$wxUSE_ZLIB" = "sys" ; then | |
2659 | AC_MSG_ERROR([zlib library not found or too old! Use --with-zlib=builtin to use built-in version]) | |
2660 | else | |
2661 | AC_MSG_WARN([zlib library not found or too old, will use built-in instead]) | |
2662 | wxUSE_ZLIB=builtin | |
2663 | fi | |
2664 | else | |
2665 | dnl we are using the system library | |
2666 | wxUSE_ZLIB=sys | |
2667 | fi | |
2668 | fi | |
2669 | fi | |
2670 | ||
2671 | dnl ------------------------------------------------------------------------ | |
2672 | dnl Check for png library | |
2673 | dnl ------------------------------------------------------------------------ | |
2674 | ||
2675 | PNG_LINK= | |
2676 | if test "$wxUSE_LIBPNG" != "no" ; then | |
2677 | AC_DEFINE(wxUSE_LIBPNG) | |
2678 | ||
2679 | if test "$wxUSE_MGL" = 1 -a "$wxUSE_LIBPNG" = "builtin" ; then | |
2680 | AC_MSG_WARN([wxMGL doesn't work with builtin png library, will use MGL one instead]) | |
2681 | wxUSE_LIBPNG=sys | |
2682 | fi | |
2683 | ||
2684 | dnl for the check below to have a chance to succeed, we must already have | |
2685 | dnl libz somewhere (don't do this when bulding wxMGL since its libpng | |
2686 | dnl doesn't depend on zlib) | |
2687 | if test "$wxUSE_MGL" != 1 -a "$wxUSE_LIBPNG" = "sys" -a "$wxUSE_ZLIB" != "sys" ; then | |
2688 | AC_MSG_WARN([system png library doesn't work without system zlib, will use built-in instead]) | |
2689 | wxUSE_LIBPNG=builtin | |
2690 | fi | |
2691 | ||
2692 | if test "$wxUSE_MGL" != 1 ; then | |
2693 | dnl Don't check for libpng when building wxMGL, libmgl contains it | |
2694 | if test "$wxUSE_LIBPNG" = "sys" -o "$wxUSE_LIBPNG" = "yes" ; then | |
2695 | dnl libpng version 0.9 is known to not work, if an even newer | |
2696 | dnl version is required, just bump it up in the test below | |
2697 | AC_CACHE_CHECK([for png.h > 0.90], ac_cv_header_png_h, | |
2698 | [AC_TRY_RUN( | |
2699 | dnl png.h defines PNG_LIBPNG_VER=number | |
2700 | [ | |
2701 | #include <png.h> | |
2702 | #include <stdio.h> | |
2703 | ||
2704 | int main() | |
2705 | { | |
2706 | FILE *f=fopen("conftestval", "w"); | |
2707 | if (!f) exit(1); | |
2708 | fprintf(f, "%s", | |
2709 | PNG_LIBPNG_VER > 90 ? "yes" : "no"); | |
2710 | exit(0); | |
2711 | } | |
2712 | ], | |
2713 | ac_cv_header_png_h=`cat conftestval`, | |
2714 | ac_cv_header_png_h=no, | |
2715 | dnl cross-compiling: test (later) if we have any png.h | |
2716 | unset ac_cv_header_png_h | |
2717 | )] | |
2718 | ) | |
2719 | AC_CHECK_HEADER(png.h) | |
2720 | ||
2721 | if test "$ac_cv_header_png_h" = "yes"; then | |
2722 | AC_CHECK_LIB(png, png_check_sig, PNG_LINK=" -lpng -lz", , [-lz -lm]) | |
2723 | fi | |
2724 | ||
2725 | if test "x$PNG_LINK" = "x" ; then | |
2726 | if test "$wxUSE_LIBPNG" = "sys" ; then | |
2727 | AC_MSG_ERROR([system png library not found or too old! Use --with-libpng=builtin to use built-in version]) | |
2728 | else | |
2729 | AC_MSG_WARN([system png library not found or too old, will use built-in instead]) | |
2730 | wxUSE_LIBPNG=builtin | |
2731 | fi | |
2732 | else | |
2733 | dnl we are using the system library | |
2734 | wxUSE_LIBPNG=sys | |
2735 | fi | |
2736 | fi | |
2737 | fi | |
2738 | ||
2739 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS png" | |
2740 | fi | |
2741 | ||
2742 | dnl ------------------------------------------------------------------------ | |
2743 | dnl Check for jpeg library | |
2744 | dnl ------------------------------------------------------------------------ | |
2745 | ||
2746 | JPEG_LINK= | |
2747 | if test "$wxUSE_LIBJPEG" != "no" ; then | |
2748 | AC_DEFINE(wxUSE_LIBJPEG) | |
2749 | ||
2750 | if test "$wxUSE_MGL" = 1 -a "$wxUSE_LIBJPEG" = "builtin" ; then | |
2751 | AC_MSG_WARN([wxMGL doesn't work with builtin jpeg library, will use MGL one instead]) | |
2752 | wxUSE_LIBJPEG=sys | |
2753 | fi | |
2754 | ||
2755 | if test "$wxUSE_MGL" != 1 ; then | |
2756 | dnl Don't check for libjpeg when building wxMGL, libmgl contains it | |
2757 | if test "$wxUSE_LIBJPEG" = "sys" -o "$wxUSE_LIBJPEG" = "yes" ; then | |
2758 | dnl can't use AC_CHECK_HEADER as jconfig.h defines things like | |
2759 | dnl HAVE_STDLIB_H which are already defined and this provokes | |
2760 | dnl a compiler warning which configure considers as an error... | |
2761 | AC_MSG_CHECKING(for jpeglib.h) | |
2762 | AC_CACHE_VAL(ac_cv_header_jpeglib_h, | |
2763 | AC_TRY_COMPILE( | |
2764 | [ | |
2765 | #undef HAVE_STDLIB_H | |
2766 | #include <stdio.h> | |
2767 | #include <jpeglib.h> | |
2768 | ], | |
2769 | [ | |
2770 | ], | |
2771 | ac_cv_header_jpeglib_h=yes, | |
2772 | ac_cv_header_jpeglib_h=no | |
2773 | ) | |
2774 | ) | |
2775 | AC_MSG_RESULT($ac_cv_header_jpeglib_h) | |
2776 | ||
2777 | if test "$ac_cv_header_jpeglib_h" = "yes"; then | |
2778 | AC_CHECK_LIB(jpeg, jpeg_read_header, JPEG_LINK=" -ljpeg") | |
2779 | fi | |
2780 | ||
2781 | if test "x$JPEG_LINK" = "x" ; then | |
2782 | if test "$wxUSE_LIBJPEG" = "sys" ; then | |
2783 | AC_MSG_ERROR([system jpeg library not found! Use --with-libjpeg=builtin to use built-in version]) | |
2784 | else | |
2785 | AC_MSG_WARN([system jpeg library not found, will use built-in instead]) | |
2786 | wxUSE_LIBJPEG=builtin | |
2787 | fi | |
2788 | else | |
2789 | dnl we are using the system library | |
2790 | wxUSE_LIBJPEG=sys | |
2791 | fi | |
2792 | fi | |
2793 | fi | |
2794 | fi | |
2795 | ||
2796 | dnl ------------------------------------------------------------------------ | |
2797 | dnl Check for tiff library | |
2798 | dnl ------------------------------------------------------------------------ | |
2799 | ||
2800 | TIFF_LINK= | |
2801 | TIFF_PREREQ_LINKS=-lm | |
2802 | if test "$wxUSE_LIBTIFF" != "no" ; then | |
2803 | AC_DEFINE(wxUSE_LIBTIFF) | |
2804 | ||
2805 | if test "$wxUSE_LIBTIFF" = "sys" -o "$wxUSE_LIBTIFF" = "yes" ; then | |
2806 | dnl libtiff may depend on libjpeg and libz so use them in the test | |
2807 | dnl below or it would fail | |
2808 | if test "$wxUSE_LIBJPEG" = "sys"; then | |
2809 | TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $JPEG_LINK" | |
2810 | fi | |
2811 | if test "$wxUSE_ZLIB" = "sys"; then | |
2812 | TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $ZLIB_LINK" | |
2813 | fi | |
2814 | AC_CHECK_HEADER(tiffio.h, | |
2815 | [ | |
2816 | AC_CHECK_LIB(tiff, TIFFError, | |
2817 | TIFF_LINK=" -ltiff", | |
2818 | , | |
2819 | $TIFF_PREREQ_LINKS) | |
2820 | ] | |
2821 | ) | |
2822 | ||
2823 | if test "x$TIFF_LINK" = "x" ; then | |
2824 | if test "$wxUSE_LIBTIFF" = "sys" ; then | |
2825 | AC_MSG_ERROR([system tiff library not found! Use --with-libtiff=builtin to use built-in version]) | |
2826 | else | |
2827 | AC_MSG_WARN([system tiff library not found, will use built-in instead]) | |
2828 | wxUSE_LIBTIFF=builtin | |
2829 | fi | |
2830 | else | |
2831 | dnl we are using the system library | |
2832 | wxUSE_LIBTIFF=sys | |
2833 | fi | |
2834 | fi | |
2835 | fi | |
2836 | ||
2837 | dnl ------------------------------------------------------------------------ | |
2838 | dnl Check for expat libraries | |
2839 | dnl ------------------------------------------------------------------------ | |
2840 | ||
2841 | if test "$wxUSE_WCHAR_T" != "yes"; then | |
2842 | if test "$wxUSE_EXPAT" != "no"; then | |
2843 | AC_MSG_WARN([wxWidgets requires wchar_t to use expat, disabling]) | |
2844 | wxUSE_EXPAT=no | |
2845 | fi | |
2846 | if test "$wxUSE_XML" != "no"; then | |
2847 | AC_MSG_WARN([wxWidgets requires wchar_t to use xml, disabling]) | |
2848 | wxUSE_XML=no | |
2849 | fi | |
2850 | fi | |
2851 | ||
2852 | if test "$wxUSE_EXPAT" != "no"; then | |
2853 | wxUSE_XML=yes | |
2854 | AC_DEFINE(wxUSE_EXPAT) | |
2855 | AC_DEFINE(wxUSE_XML) | |
2856 | ||
2857 | if test "$wxUSE_EXPAT" = "sys" -o "$wxUSE_EXPAT" = "yes" ; then | |
2858 | AC_CHECK_HEADER([expat.h], [found_expat_h=1]) | |
2859 | if test "x$found_expat_h" = "x1"; then | |
2860 | dnl Expat 1.95.6 comes with broken expat.h: | |
2861 | AC_CACHE_CHECK([if expat.h is valid C++ header], | |
2862 | wx_cv_expat_is_not_broken, | |
2863 | [ | |
2864 | AC_LANG_PUSH(C++) | |
2865 | AC_TRY_COMPILE([#include <expat.h>],[], | |
2866 | wx_cv_expat_is_not_broken=yes, | |
2867 | wx_cv_expat_is_not_broken=no | |
2868 | ) | |
2869 | AC_LANG_POP() | |
2870 | ] | |
2871 | ) | |
2872 | if test "$wx_cv_expat_is_not_broken" = "yes" ; then | |
2873 | AC_CHECK_LIB(expat, XML_ParserCreate, EXPAT_LINK=" -lexpat") | |
2874 | fi | |
2875 | fi | |
2876 | if test "x$EXPAT_LINK" = "x" ; then | |
2877 | if test "$wxUSE_EXPAT" = "sys" ; then | |
2878 | AC_MSG_ERROR([system expat library not found! Use --with-expat=builtin to use built-in version]) | |
2879 | else | |
2880 | AC_MSG_WARN([system expat library not found, will use built-in instead]) | |
2881 | wxUSE_EXPAT=builtin | |
2882 | fi | |
2883 | else | |
2884 | dnl we are using the system library | |
2885 | wxUSE_EXPAT=sys | |
2886 | fi | |
2887 | fi | |
2888 | if test "$wxUSE_EXPAT" = "builtin" ; then | |
2889 | dnl Expat needs this: | |
2890 | AC_CONFIG_SUBDIRS([src/expat]) | |
2891 | fi | |
2892 | fi | |
2893 | ||
2894 | ||
2895 | dnl ------------------------------------------------------------------------ | |
2896 | dnl Check for libmspack | |
2897 | dnl ------------------------------------------------------------------------ | |
2898 | ||
2899 | if test "$wxUSE_LIBMSPACK" != "no"; then | |
2900 | AC_CHECK_HEADER([mspack.h], [found_mspack_h=1]) | |
2901 | if test "x$found_mspack_h" = "x1"; then | |
2902 | AC_CHECK_LIB(mspack, mspack_create_chm_decompressor, | |
2903 | MSPACK_LINK=" -lmspack") | |
2904 | fi | |
2905 | if test "x$MSPACK_LINK" = "x" ; then | |
2906 | wxUSE_LIBMSPACK=no | |
2907 | fi | |
2908 | fi | |
2909 | ||
2910 | if test "$wxUSE_LIBMSPACK" != "no"; then | |
2911 | AC_DEFINE(wxUSE_LIBMSPACK) | |
2912 | fi | |
2913 | ||
2914 | ||
2915 | dnl ---------------------------------------------------------------- | |
2916 | dnl search for toolkit (widget sets) | |
2917 | dnl ---------------------------------------------------------------- | |
2918 | ||
2919 | AFMINSTALL= | |
2920 | WIN32INSTALL= | |
2921 | ||
2922 | TOOLKIT= | |
2923 | TOOLKIT_INCLUDE= | |
2924 | WIDGET_SET= | |
2925 | ||
2926 | dnl are we building for a win32 target environment? | |
2927 | dnl If so, setup common stuff needed for both GUI and Base libs. | |
2928 | if test "$USE_WIN32" = 1 ; then | |
2929 | AC_CHECK_HEADERS(w32api.h) | |
2930 | AC_CHECK_HEADER(windows.h, [], | |
2931 | [ | |
2932 | AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h) | |
2933 | ]) | |
2934 | ||
2935 | dnl --- FIXME: This is still a somewhat random list of libs, | |
2936 | dnl --- some of them should probably be included conditionally. | |
2937 | LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32" | |
2938 | ||
2939 | if test "$wxUSE_ACCESSIBILITY" = "yes" ; then | |
2940 | LIBS="$LIBS -loleacc" | |
2941 | fi | |
2942 | ||
2943 | case "${host}" in | |
2944 | *-*-cygwin* ) | |
2945 | dnl Cygwin doesn't include these by default | |
2946 | LIBS="$LIBS -lkernel32 -luser32" | |
2947 | esac | |
2948 | ||
2949 | dnl add extra odbc libs if we have compiled in odbc | |
2950 | if test "$wxUSE_ODBC" = "sys" ; then | |
2951 | wxUSE_ODBC = "yes" | |
2952 | fi | |
2953 | if test "$wxUSE_ODBC" = "yes" ; then | |
2954 | LIBS=" -lodbc32 -lole32 -loleaut32 $LIBS" | |
2955 | AC_DEFINE(wxUSE_ODBC) | |
2956 | fi | |
2957 | dnl We might want to abort here if wxUSE_ODBC="builtin" isn't supported on msw. | |
2958 | ||
2959 | dnl This one is still used by some sample makefiles. | |
2960 | RESFLAGS="--include-dir \$(top_srcdir)/include --include-dir \$(top_srcdir)/\$(program_dir) --define __WIN32__ --define __WIN95__ --define __GNUWIN32__" | |
2961 | RESPROGRAMOBJ="\$(PROGRAM)_resources.o" | |
2962 | ||
2963 | dnl This lot we export to wx-config. It must add the relevant | |
2964 | dnl include directories at the point when they can be known. | |
2965 | dnl (but are these (still) required anyway?) | |
2966 | WXCONFIG_RESFLAGS="--define __WIN32__ --define __WIN95__ --define __GNUWIN32__" | |
2967 | ||
2968 | dnl install Win32-specific files in "make install" | |
2969 | WIN32INSTALL=win32install | |
2970 | ||
2971 | dnl pbt.h is missing on Wine at least | |
2972 | AC_CHECK_HEADERS(pbt.h, [], [AC_DEFINE(NEED_PBT_H)]) | |
2973 | fi | |
2974 | ||
2975 | if test "$wxUSE_GUI" = "yes"; then | |
2976 | USE_GUI=1 | |
2977 | ||
2978 | GUI_TK_LIBRARY= | |
2979 | ||
2980 | WXGTK12= | |
2981 | WXGTK127= | |
2982 | WXGTK20= | |
2983 | WXGPE= | |
2984 | ||
2985 | if test "$wxUSE_COCOA" = 1 ; then | |
2986 | if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes"; then | |
2987 | AC_MSG_WARN([Printing not supported under wxCocoa yet, disabled]) | |
2988 | wxUSE_PRINTING_ARCHITECTURE=no | |
2989 | fi | |
2990 | if test "$wxUSE_DRAG_AND_DROP" = "yes"; then | |
2991 | AC_MSG_WARN([Drag and Drop not supported under wxCocoa yet, disabled]) | |
2992 | wxUSE_DRAG_AND_DROP=no | |
2993 | fi | |
2994 | if test "$wxUSE_DRAGIMAGE" = "yes"; then | |
2995 | AC_MSG_WARN([Drag Image and DandD not supported under wxCocoa yet, disabled]) | |
2996 | wxUSE_DRAGIMAGE=no | |
2997 | fi | |
2998 | fi | |
2999 | ||
3000 | if test "$wxUSE_MSW" = 1 ; then | |
3001 | TOOLKIT=MSW | |
3002 | GUIDIST=MSW_DIST | |
3003 | ||
3004 | dnl -mwindows causes a heap of other default gui libs to be linked in. | |
3005 | case "${host}" in | |
3006 | *-*-mingw32* ) | |
3007 | WXCONFIG_LDFLAGS_GUI="$LDFLAGS -Wl,--subsystem,windows -mwindows" | |
3008 | esac | |
3009 | fi | |
3010 | ||
3011 | if test "$wxUSE_GTK" = 1; then | |
3012 | dnl GTK+ test program must be compiled with C compiler | |
3013 | AC_MSG_CHECKING([for GTK+ version]) | |
3014 | ||
3015 | gtk_version_cached=1 | |
3016 | AC_CACHE_VAL(wx_cv_lib_gtk, | |
3017 | [ | |
3018 | dnl stupid GTK+ AM macros produce their own messages, so we | |
3019 | dnl have to pass to the next line | |
3020 | gtk_version_cached=0 | |
3021 | AC_MSG_RESULT() | |
3022 | ||
3023 | dnl we must link against lgthread unless the user | |
3024 | dnl used --disable-threads | |
3025 | GTK_MODULES= | |
3026 | if test "$wxUSE_THREADS" = "yes"; then | |
3027 | GTK_MODULES=gthread | |
3028 | fi | |
3029 | ||
3030 | dnl detect GTK2 | |
3031 | wx_cv_lib_gtk= | |
3032 | if test "x$wxGTK_VERSION" != "x1" | |
3033 | then | |
3034 | dnl The gthread.pc that ships with solaris returns '-mt', | |
3035 | dnl it's correct for Sun CC, but gcc requires '-pthreads'. | |
3036 | dnl So disable the compile check and remove the -mt below. | |
3037 | case "${host}" in | |
3038 | *-*-solaris2* ) | |
3039 | if test "$wxUSE_THREADS" = "yes" -a "$GCC" = yes; then | |
3040 | enable_gtktest=no | |
3041 | fi | |
3042 | esac | |
3043 | ||
3044 | AM_PATH_GTK_2_0(2.0.0, wx_cv_lib_gtk=2.0, , $GTK_MODULES) | |
3045 | ||
3046 | dnl Remove the '-mt' for gcc on solaris | |
3047 | case "${host}" in | |
3048 | *-*-solaris2* ) | |
3049 | if test "$wxUSE_THREADS" = "yes" -a "$GCC" = yes; then | |
3050 | GTK_CFLAGS=`echo $GTK_CFLAGS | sed 's/-mt//'` | |
3051 | GTK_LIBS=`echo $GTK_LIBS | sed 's/-mt//'` | |
3052 | fi | |
3053 | dnl solaris also requires -lX11 for static lib | |
3054 | if test "$wxUSE_SHARED" != "yes"; then | |
3055 | GTK_LIBS="$GTK_LIBS -lX11" | |
3056 | fi | |
3057 | esac | |
3058 | fi | |
3059 | ||
3060 | dnl detect GTK1.x | |
3061 | if test -z "$wx_cv_lib_gtk"; then | |
3062 | if test "x$wxGTK_VERSION" = "x1" -o "x$wxGTK_VERSION" = "xany" ; then | |
3063 | AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7, , $GTK_MODULES) | |
3064 | ||
3065 | if test -z "$wx_cv_lib_gtk"; then | |
3066 | AM_PATH_GTK(1.2.3, wx_cv_lib_gtk=1.2.3, , $GTK_MODULES) | |
3067 | fi | |
3068 | fi | |
3069 | fi | |
3070 | ||
3071 | if test -z "$wx_cv_lib_gtk"; then | |
3072 | dnl looks better in AC_MSG_RESULT | |
3073 | wx_cv_lib_gtk=none | |
3074 | else | |
3075 | dnl we need to cache GTK_CFLAGS and GTK_LIBS for the | |
3076 | dnl subsequent runs | |
3077 | wx_cv_cflags_gtk=$GTK_CFLAGS | |
3078 | wx_cv_libs_gtk=`echo $GTK_LIBS | sed -e 's/ -l[[^ ]]*cairo[[^ ]]*//g'` | |
3079 | fi | |
3080 | ] | |
3081 | ) | |
3082 | ||
3083 | dnl if it wasn't cached, the messages from AM_PATH_GTK() above are | |
3084 | dnl enough | |
3085 | if test "$gtk_version_cached" = 1; then | |
3086 | AC_MSG_RESULT($wx_cv_lib_gtk) | |
3087 | fi | |
3088 | ||
3089 | case "$wx_cv_lib_gtk" in | |
3090 | 2.0) WXGTK20=1 | |
3091 | TOOLKIT_VERSION=2 | |
3092 | ;; | |
3093 | 1.2.7) WXGTK127=1 | |
3094 | WXGTK12=1 | |
3095 | ;; | |
3096 | 1.2.3) WXGTK12=1 | |
3097 | ;; | |
3098 | *) AC_MSG_ERROR([ | |
3099 | The development files for GTK+ were not found. For GTK+ 2, please | |
3100 | ensure that pkg-config is in the path and that gtk+-2.0.pc is | |
3101 | installed. For GTK+ 1.2 please check that gtk-config is in the path, | |
3102 | and that the version is 1.2.3 or above. Also check that the | |
3103 | libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config | |
3104 | --libs' are in the LD_LIBRARY_PATH or equivalent. | |
3105 | ]) | |
3106 | ;; | |
3107 | esac | |
3108 | ||
3109 | if test "$WXGTK20" = 1; then | |
3110 | save_CFLAGS="$CFLAGS" | |
3111 | save_LIBS="$LIBS" | |
3112 | CFLAGS="$wx_cv_cflags_gtk $CFLAGS" | |
3113 | LIBS="$LIBS $wx_cv_libs_gtk" | |
3114 | ||
3115 | dnl gtk_icon_size_lookup is not available in the GTK+ headers | |
3116 | dnl that have shipped with some versions of Sun's JDS. Not using | |
3117 | dnl AC_CHECK_FUNCS here since it only checks the function exists | |
3118 | dnl in the lib (not the header). | |
3119 | AC_CHECK_DECLS([gtk_icon_size_lookup], [], | |
3120 | [AC_DEFINE(NEED_GTK_ICON_SIZE_LOOKUP)], | |
3121 | [#include <gtk/gtk.h>]) | |
3122 | ||
3123 | dnl test if we have at least GTK+ 2.6: | |
3124 | AC_MSG_CHECKING([if GTK+ is version >= 2.6]) | |
3125 | AC_TRY_COMPILE([ | |
3126 | #include <gtk/gtk.h> | |
3127 | ], | |
3128 | [ | |
3129 | #if !GTK_CHECK_VERSION(2,6,0) | |
3130 | Not GTK+ 2.6 | |
3131 | #endif | |
3132 | ], | |
3133 | [ | |
3134 | AC_DEFINE(__WXGTK26__) | |
3135 | AC_DEFINE(__WXGTK24__) | |
3136 | AC_MSG_RESULT([yes]) | |
3137 | ac_wxgtk26=1 | |
3138 | ], | |
3139 | [ | |
3140 | AC_MSG_RESULT([no]) | |
3141 | ac_wxgtk26=0 | |
3142 | ]) | |
3143 | ||
3144 | if test "$ac_wxgtk26" = 0; then | |
3145 | dnl test if we have at least GTK+ 2.4: | |
3146 | AC_MSG_CHECKING([if GTK+ is version >= 2.4]) | |
3147 | AC_TRY_COMPILE([ | |
3148 | #include <gtk/gtk.h> | |
3149 | ], | |
3150 | [ | |
3151 | #if !GTK_CHECK_VERSION(2,4,0) | |
3152 | Not GTK+ 2.4 | |
3153 | #endif | |
3154 | ], | |
3155 | [ | |
3156 | AC_DEFINE(__WXGTK24__) | |
3157 | AC_MSG_RESULT([yes]) | |
3158 | ], | |
3159 | [ | |
3160 | AC_MSG_RESULT([no]) | |
3161 | ]) | |
3162 | fi | |
3163 | ||
3164 | CFLAGS="$save_CFLAGS" | |
3165 | LIBS="$save_LIBS" | |
3166 | else | |
3167 | if test "$wxUSE_UNICODE" = "yes"; then | |
3168 | AC_MSG_WARN([Unicode configuration not supported with GTK+ 1.x]) | |
3169 | wxUSE_UNICODE=no | |
3170 | fi | |
3171 | ||
3172 | dnl test for XIM support in libgdk | |
3173 | AC_CHECK_LIB(gdk, gdk_im_open, AC_DEFINE(HAVE_XIM)) | |
3174 | fi | |
3175 | ||
3176 | dnl we need poll() in src/gtk/app.cpp (we know that Darwin doesn't | |
3177 | dnl have it but we do the check for the others) | |
3178 | if test "$USE_DARWIN" != 1; then | |
3179 | AC_CHECK_FUNCS(poll) | |
3180 | fi | |
3181 | ||
3182 | TOOLKIT_INCLUDE="$wx_cv_cflags_gtk" | |
3183 | GUI_TK_LIBRARY="$wx_cv_libs_gtk $GUI_TK_LIBRARY" | |
3184 | ||
3185 | AFMINSTALL=afminstall | |
3186 | TOOLKIT=GTK | |
3187 | GUIDIST=GTK_DIST | |
3188 | ||
3189 | dnl test for external libxpm if we're configured to use it | |
3190 | if test "$wxUSE_GPE" = "yes"; then | |
3191 | AC_MSG_CHECKING(for gpewidget library) | |
3192 | WX_PATH_FIND_LIBRARIES($SEARCH_LIB,gpewidget) | |
3193 | if test "$ac_find_libraries" != "" ; then | |
3194 | WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY) | |
3195 | dnl -lgpewidget must be before all GTK libs and | |
3196 | dnl we guess its path from the prefix | |
3197 | GUI_TK_LIBRARY="-L${prefix}/lib -lgpewidget $GUI_TK_LIBRARY" | |
3198 | WXGPE=1 | |
3199 | AC_MSG_RESULT([found in $ac_find_libraries]) | |
3200 | else | |
3201 | AC_MSG_RESULT(not found) | |
3202 | fi | |
3203 | ||
3204 | dnl AC_MSG_CHECKING(for gpe library) | |
3205 | dnl WX_PATH_FIND_LIBRARIES($SEARCH_LIB,gpe) | |
3206 | dnl if test "$ac_find_libraries" != "" ; then | |
3207 | dnl WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY) | |
3208 | dnl GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lgpe" | |
3209 | dnl AC_MSG_RESULT(found in $ac_find_libraries) | |
3210 | dnl else | |
3211 | dnl AC_MSG_RESULT(not found) | |
3212 | dnl fi | |
3213 | fi | |
3214 | fi | |
3215 | ||
3216 | if test "$wxUSE_MGL" = 1; then | |
3217 | AC_MSG_CHECKING(for SciTech MGL library) | |
3218 | if test "x$MGL_ROOT" = x ; then | |
3219 | AC_MSG_RESULT(not found) | |
3220 | AC_MSG_ERROR([Cannot find MGL library. Make sure MGL_ROOT is set.]) | |
3221 | else | |
3222 | AC_MSG_RESULT($MGL_ROOT) | |
3223 | fi | |
3224 | ||
3225 | AC_MSG_CHECKING(for libmgl location) | |
3226 | dnl Find MGL library that we want | |
3227 | dnl FIXME_MGL - test for MGL variants for freebsd etc.; | |
3228 | dnl and for non-x86 versions | |
3229 | case "${host}" in | |
3230 | *-*-linux* ) | |
3231 | dnl glibc.so, glibc are for older versions of MGL, | |
3232 | dnl x86/a, x86/so are used by >= 5.0 R11 | |
3233 | if test "x$wxUSE_SHARED" = xyes ; then | |
3234 | mgl_os_candidates="linux/gcc/x86/so linux/gcc/x86/a linux/gcc/glibc.so linux/gcc/glibc" | |
3235 | else | |
3236 | mgl_os_candidates="linux/gcc/x86/a linux/gcc/x86/so linux/gcc/glibc linux/gcc/glibc.so" | |
3237 | fi | |
3238 | ;; | |
3239 | *-pc-msdosdjgpp ) | |
3240 | mgl_os_candidates="dos32/dj2" | |
3241 | ;; | |
3242 | *) | |
3243 | AC_MSG_ERROR(This system type ${host} is not yet supported by wxMGL.) | |
3244 | esac | |
3245 | ||
3246 | mgl_lib_type="" | |
3247 | mgl_os="" | |
3248 | ||
3249 | for mgl_os_i in $mgl_os_candidates ; do | |
3250 | if test "x$mgl_os" = x ; then | |
3251 | if test "$wxUSE_DEBUG_FLAG" = yes ; then | |
3252 | if test -f $MGL_ROOT/lib/debug/$mgl_os_i/libmgl.a -o \ | |
3253 | -f $MGL_ROOT/lib/debug/$mgl_os_i/libmgl.so; then | |
3254 | mgl_lib_type=debug | |
3255 | mgl_os=$mgl_os_i | |
3256 | fi | |
3257 | fi | |
3258 | if test "x$mgl_lib_type" = x ; then | |
3259 | if test -f $MGL_ROOT/lib/release/$mgl_os_i/libmgl.a -o \ | |
3260 | -f $MGL_ROOT/lib/release/$mgl_os_i/libmgl.so; then | |
3261 | mgl_lib_type=release | |
3262 | mgl_os=$mgl_os_i | |
3263 | fi | |
3264 | fi | |
3265 | fi | |
3266 | done | |
3267 | ||
3268 | if test "x$mgl_os" = x ; then | |
3269 | AC_MSG_RESULT(not found) | |
3270 | AC_MSG_ERROR([Cannot find MGL libraries, make sure they are compiled.]) | |
3271 | fi | |
3272 | AC_MSG_RESULT("$MGL_ROOT/lib/$mgl_lib_type/$mgl_os") | |
3273 | ||
3274 | wxUSE_UNIVERSAL="yes" | |
3275 | ||
3276 | TOOLKIT_INCLUDE="-I$MGL_ROOT/include" | |
3277 | GUI_TK_LIBRARY="-L$MGL_ROOT/lib/$mgl_lib_type/$mgl_os -lmgl -lmglcpp -lpm" | |
3278 | ||
3279 | AFMINSTALL=afminstall | |
3280 | TOOLKIT=MGL | |
3281 | GUIDIST=MGL_DIST | |
3282 | fi | |
3283 | ||
3284 | if test "$wxUSE_DFB" = 1; then | |
3285 | PKG_PROG_PKG_CONFIG() | |
3286 | ||
3287 | PKG_CHECK_MODULES(DIRECTFB, | |
3288 | [directfb >= 0.9.23], | |
3289 | [ | |
3290 | wxUSE_UNIVERSAL="yes" | |
3291 | TOOLKIT_INCLUDE="$DIRECTFB_CFLAGS" | |
3292 | GUI_TK_LIBRARY="$DIRECTFB_LIBS" | |
3293 | TOOLKIT=DFB | |
3294 | GUIDIST=DFB_DIST | |
3295 | ], | |
3296 | [ | |
3297 | AC_MSG_ERROR([DirectFB not found.]) | |
3298 | ] | |
3299 | ) | |
3300 | fi | |
3301 | ||
3302 | if test "$wxUSE_MICROWIN" = 1; then | |
3303 | AC_MSG_CHECKING(for MicroWindows) | |
3304 | if test "x$MICROWINDOWS" = x ; then | |
3305 | AC_MSG_RESULT(not found) | |
3306 | AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWINDOWS is set.]) | |
3307 | else | |
3308 | AC_MSG_RESULT($MICROWINDOWS) | |
3309 | fi | |
3310 | ||
3311 | if test -f $MICROWINDOWS/lib/libmwin.a; then | |
3312 | AC_MSG_RESULT(MicroWindows' libraries found.) | |
3313 | else | |
3314 | AC_MSG_ERROR([Cannot find MicroWindows libraries, make sure they are compiled.]) | |
3315 | fi | |
3316 | ||
3317 | TOOLKIT_INCLUDE="-I$MICROWINDOWS/include" | |
3318 | GUI_TK_LIBRARY="-L$MICROWINDOWS/lib -lmwin -lmwengine -mwfonts -mwdrivers -mwinlib" | |
3319 | ||
3320 | wxUSE_UNIVERSAL="yes" | |
3321 | ||
3322 | AFMINSTALL=afminstall | |
3323 | TOOLKIT=MICROWIN | |
3324 | GUIDIST=MICROWIN_DIST | |
3325 | ||
3326 | TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1" | |
3327 | fi | |
3328 | ||
3329 | dnl common part of X11 and Motif port checks | |
3330 | if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then | |
3331 | dnl use standard macros to check for X headers/libs, this brings | |
3332 | dnl support for the standard configure options --x-includes, | |
3333 | dnl --x-libraries and --no-x | |
3334 | AC_PATH_XTRA | |
3335 | ||
3336 | if test "$no_x" = "yes"; then | |
3337 | AC_MSG_ERROR([X11 not found, please use --x-includes and/or --x-libraries options (see config.log for details)]) | |
3338 | fi | |
3339 | ||
3340 | dnl for some reason AC_PATH_XTRA seems to add -INONE and -LNONE (and | |
3341 | dnl also sometimes -RNONE) to X_CFLAGS and X_LIBS respectively, filter | |
3342 | dnl this junk out | |
3343 | GUI_TK_LIBRARY=`echo $X_LIBS | sed 's/ -LNONE//' | sed 's/ -RNONE//'` | |
3344 | TOOLKIT_INCLUDE=`echo $X_CFLAGS | sed 's/ -INONE//'` | |
3345 | AFMINSTALL=afminstall | |
3346 | COMPILED_X_PROGRAM=0 | |
3347 | ||
3348 | fi | |
3349 | ||
3350 | if test "$wxUSE_X11" = 1; then | |
3351 | if test "$wxUSE_NANOX" = "yes"; then | |
3352 | AC_MSG_CHECKING(for MicroWindows/NanoX distribution) | |
3353 | if test "x$MICROWIN" = x ; then | |
3354 | AC_MSG_RESULT(not found) | |
3355 | AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWIN is set.]) | |
3356 | else | |
3357 | AC_MSG_RESULT($MICROWIN) | |
3358 | AC_DEFINE(wxUSE_NANOX) | |
3359 | fi | |
3360 | fi | |
3361 | ||
3362 | if test "$wxUSE_UNICODE" = "yes"; then | |
3363 | PKG_PROG_PKG_CONFIG() | |
3364 | ||
3365 | PKG_CHECK_MODULES(PANGOX, pangox, | |
3366 | [ | |
3367 | CFLAGS="$PANGOX_CFLAGS $CFLAGS" | |
3368 | CXXFLAGS="$PANGOX_CFLAGS $CXXFLAGS" | |
3369 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOX_LIBS" | |
3370 | ], | |
3371 | [ | |
3372 | AC_MSG_ERROR([pangox library not found, library cannot be compiled in Unicode mode]) | |
3373 | ] | |
3374 | ) | |
3375 | PKG_CHECK_MODULES(PANGOFT2, pangoft2, | |
3376 | [ | |
3377 | CFLAGS="$PANGOFT2_CFLAGS $CFLAGS" | |
3378 | CXXFLAGS="$PANGOFT2_CFLAGS $CXXFLAGS" | |
3379 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOFT2_LIBS" | |
3380 | ], | |
3381 | [ | |
3382 | AC_MSG_WARN([pangoft2 library not found, library will be compiled without printing support]) | |
3383 | wxUSE_PRINTING_ARCHITECTURE="no" | |
3384 | ] | |
3385 | ) | |
3386 | PKG_CHECK_MODULES(PANGOXFT, pangoxft, | |
3387 | [ | |
3388 | AC_DEFINE(HAVE_PANGO_XFT) | |
3389 | CFLAGS="$PANGOXFT_CFLAGS $CFLAGS" | |
3390 | CXXFLAGS="$PANGOXFT_CFLAGS $CXXFLAGS" | |
3391 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOXFT_LIBS" | |
3392 | ], | |
3393 | [ | |
3394 | AC_MSG_WARN([pangoxft library not found, library will be compiled without anti-aliasing support]) | |
3395 | ] | |
3396 | ) | |
3397 | save_LIBS="$LIBS" | |
3398 | LIBS="$LIBS $PANGOX_LIBS" | |
3399 | AC_CHECK_FUNCS([pango_font_family_is_monospace]) | |
3400 | LIBS="$save_LIBS" | |
3401 | fi | |
3402 | ||
3403 | wxUSE_UNIVERSAL="yes" | |
3404 | ||
3405 | if test "$wxUSE_NANOX" = "yes"; then | |
3406 | TOOLKIT_INCLUDE="-I\$(top_srcdir)/include/wx/x11/nanox -I\$(MICROWIN)/src/include $TOOLKIT_INCLUDE" | |
3407 | TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__NANOX__ -DMWPIXEL_FORMAT=MWPF_TRUECOLOR0888 -DHAVE_FILEIO -DHAVE_BMP_SUPPORT=1 -DHAVE_GIF_SUPPORT=1 -DHAVE_PNM_SUPPORT=1 -DHAVE_XPM_SUPPORT=1 -DUNIX=1 -DUSE_EXPOSURE -DSCREEN_HEIGHT=480 -DSCREEN_WIDTH=640 -DSCREEN_DEPTH=4 -DX11=1" | |
3408 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY \$(MICROWIN)/src/lib/libnano-X.a" | |
3409 | else | |
3410 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lX11" | |
3411 | fi | |
3412 | ||
3413 | TOOLKIT=X11 | |
3414 | GUIDIST=X11_DIST | |
3415 | fi | |
3416 | ||
3417 | if test "$wxUSE_MOTIF" = 1; then | |
3418 | if test "$wxUSE_UNICODE" = "yes"; then | |
3419 | AC_MSG_ERROR([Unicode configuration not supported with Motif]) | |
3420 | fi | |
3421 | ||
3422 | AC_MSG_CHECKING(for Motif/Lesstif headers) | |
3423 | WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h) | |
3424 | if test "$ac_find_includes" != "" ; then | |
3425 | AC_MSG_RESULT(found in $ac_find_includes) | |
3426 | WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE) | |
3427 | TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE$ac_path_to_include" | |
3428 | else | |
3429 | save_CFLAGS=$CFLAGS | |
3430 | CFLAGS="$TOOLKIT_INCLUDE $CFLAGS" | |
3431 | ||
3432 | AC_TRY_COMPILE( | |
3433 | [ | |
3434 | #include <Xm/Xm.h> | |
3435 | ], | |
3436 | [ | |
3437 | int version; | |
3438 | version = xmUseVersion; | |
3439 | ], | |
3440 | [ | |
3441 | AC_MSG_RESULT(found in default search path) | |
3442 | COMPILED_X_PROGRAM=1 | |
3443 | ], | |
3444 | [ | |
3445 | AC_MSG_RESULT(no) | |
3446 | AC_MSG_ERROR(please set CPPFLAGS to contain the location of Xm/Xm.h) | |
3447 | ] | |
3448 | ) | |
3449 | ||
3450 | CFLAGS=$save_CFLAGS | |
3451 | fi | |
3452 | ||
3453 | ||
3454 | AC_MSG_CHECKING(for Motif/Lesstif library) | |
3455 | WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm) | |
3456 | ||
3457 | if test "x$ac_find_libraries" != "x" ; then | |
3458 | AC_MSG_RESULT(found in $ac_find_libraries) | |
3459 | ||
3460 | WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY) | |
3461 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link" | |
3462 | else | |
3463 | dnl it might happen that we found headers in one of the standard | |
3464 | dnl paths but the libs are elsewhere but still in default (linker) | |
3465 | dnl path -- try to compile a test program to check for this | |
3466 | save_CFLAGS=$CFLAGS | |
3467 | CFLAGS="$TOOLKIT_INCLUDE $CFLAGS" | |
3468 | save_LIBS="$LIBS" | |
3469 | LIBS="$GUI_TK_LIBRARY -lXm -lXmu -lXext -lX11" | |
3470 | ||
3471 | AC_TRY_LINK( | |
3472 | [ | |
3473 | #include <Xm/Xm.h> | |
3474 | ], | |
3475 | [ | |
3476 | int version; | |
3477 | version = xmUseVersion; | |
3478 | ], | |
3479 | [ | |
3480 | AC_MSG_RESULT(found in default search path) | |
3481 | COMPILED_X_PROGRAM=1 | |
3482 | ], | |
3483 | [ | |
3484 | AC_MSG_RESULT(no) | |
3485 | AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm) | |
3486 | ] | |
3487 | ) | |
3488 | ||
3489 | CFLAGS=$save_CFLAGS | |
3490 | LIBS="$save_LIBS" | |
3491 | fi | |
3492 | ||
3493 | AC_MSG_CHECKING([if we need -lXp and/or -lSM -lICE]) | |
3494 | libp_link="" | |
3495 | libsm_ice_link="" | |
3496 | libs_found=0 | |
3497 | for libp in "" " -lXp"; do | |
3498 | if test "$libs_found" = "0"; then | |
3499 | for libsm_ice in "" " -lSM -lICE"; do | |
3500 | if test "$libs_found" = "0"; then | |
3501 | save_LIBS="$LIBS" | |
3502 | LIBS="$GUI_TK_LIBRARY -lXm ${libp} -lXmu -lXext -lXt${libsm_ice} -lX11" | |
3503 | save_CFLAGS=$CFLAGS | |
3504 | CFLAGS="$TOOLKIT_INCLUDE $CFLAGS" | |
3505 | ||
3506 | AC_TRY_LINK( | |
3507 | [ | |
3508 | #include <Xm/Xm.h> | |
3509 | #include <Xm/List.h> | |
3510 | ], | |
3511 | [ | |
3512 | XmString string = NULL; | |
3513 | Widget w = NULL; | |
3514 | int position = 0; | |
3515 | XmListAddItem(w, string, position); | |
3516 | ], | |
3517 | [ | |
3518 | libp_link="$libp" | |
3519 | libsm_ice_link="$libsm_ice" | |
3520 | AC_MSG_RESULT( | |
3521 | [need${libp_link}${libsm_ice_link}]) | |
3522 | libs_found=1 | |
3523 | ], [] | |
3524 | ) | |
3525 | ||
3526 | LIBS="$save_LIBS" | |
3527 | CFLAGS=$save_CFLAGS | |
3528 | fi | |
3529 | done | |
3530 | fi | |
3531 | done | |
3532 | ||
3533 | if test "$libs_found" = "0"; then | |
3534 | AC_MSG_RESULT([can't find the right libraries]) | |
3535 | AC_MSG_ERROR([can't link a simple motif program]) | |
3536 | fi | |
3537 | ||
3538 | dnl this seems to be needed under IRIX and shouldn't do any harm | |
3539 | dnl elsewhere | |
3540 | AC_CHECK_LIB(Sgm, [SgCreateList], [libsgm_link=" -lSgm"]) | |
3541 | ||
3542 | save_CFLAGS=$CFLAGS | |
3543 | CFLAGS="$TOOLKIT_INCLUDE $CFLAGS" | |
3544 | ||
3545 | AC_CACHE_CHECK([for Motif 2], | |
3546 | wx_cv_lib_motif2, | |
3547 | AC_TRY_COMPILE([ | |
3548 | #include <Xm/Xm.h> | |
3549 | ], | |
3550 | [ | |
3551 | #if XmVersion < 2000 | |
3552 | Not Motif 2 | |
3553 | #endif | |
3554 | ], | |
3555 | wx_cv_lib_motif2="yes", | |
3556 | wx_cv_lib_motif2="no")) | |
3557 | if test "$wx_cv_lib_motif2" = "yes"; then | |
3558 | AC_DEFINE(__WXMOTIF20__,1) | |
3559 | else | |
3560 | AC_DEFINE(__WXMOTIF20__,0) | |
3561 | fi | |
3562 | ||
3563 | AC_CACHE_CHECK([whether Motif is Lesstif], | |
3564 | wx_cv_lib_lesstif, | |
3565 | AC_TRY_COMPILE([ | |
3566 | #include <Xm/Xm.h> | |
3567 | ], | |
3568 | [ | |
3569 | #if !defined(LesstifVersion) || LesstifVersion <= 0 | |
3570 | Not Lesstif | |
3571 | #endif | |
3572 | ], | |
3573 | wx_cv_lib_lesstif="yes", | |
3574 | wx_cv_lib_lesstif="no") | |
3575 | ) | |
3576 | if test "$wx_cv_lib_lesstif" = "yes"; then | |
3577 | AC_DEFINE(__WXLESSTIF__,1) | |
3578 | else | |
3579 | AC_DEFINE(__WXLESSTIF__,0) | |
3580 | fi | |
3581 | ||
3582 | CFLAGS=$save_CFLAGS | |
3583 | ||
3584 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY${libsgm_link} -lXm${libp_link} -lXmu -lXext -lXt${libsm_ice_link} -lX11" | |
3585 | TOOLKIT=MOTIF | |
3586 | GUIDIST=MOTIF_DIST | |
3587 | fi | |
3588 | ||
3589 | dnl more tests common to X11 and Motif: | |
3590 | if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then | |
3591 | dnl test for external libxpm if we're configured to use it | |
3592 | if test "$wxUSE_LIBXPM" = "sys"; then | |
3593 | AC_MSG_CHECKING(for Xpm library) | |
3594 | WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm) | |
3595 | if test "$ac_find_libraries" != "" ; then | |
3596 | WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY) | |
3597 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link" | |
3598 | AC_MSG_RESULT(found in $ac_find_libraries) | |
3599 | ||
3600 | AC_CACHE_CHECK([for X11/xpm.h], | |
3601 | wx_cv_x11_xpm_h, | |
3602 | [ | |
3603 | save_CFLAGS=$CFLAGS | |
3604 | CFLAGS="$TOOLKIT_INCLUDE $CFLAGS" | |
3605 | ||
3606 | AC_TRY_COMPILE( | |
3607 | [ | |
3608 | #include <X11/xpm.h> | |
3609 | ], | |
3610 | [ | |
3611 | int version; | |
3612 | version = XpmLibraryVersion(); | |
3613 | ], | |
3614 | wx_cv_x11_xpm_h=yes, | |
3615 | wx_cv_x11_xpm_h=no | |
3616 | ) | |
3617 | ||
3618 | CFLAGS=$save_CFLAGS | |
3619 | ] | |
3620 | ) | |
3621 | ||
3622 | if test $wx_cv_x11_xpm_h = "yes"; then | |
3623 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXpm" | |
3624 | AC_DEFINE(wxHAVE_LIB_XPM) | |
3625 | else | |
3626 | AC_MSG_WARN([built-in less efficient XPM decoder will be used]) | |
3627 | fi | |
3628 | fi | |
3629 | ||
3630 | fi | |
3631 | ||
3632 | dnl XShapeQueryExtension checks: first the library, then prototype | |
3633 | AC_CHECK_LIB([Xext], [XShapeQueryExtension], | |
3634 | [ | |
3635 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXext" | |
3636 | wxHAVE_XEXT_LIB=1 | |
3637 | ], | |
3638 | [], [$GUI_TK_LIBRARY -lX11]) | |
3639 | ||
3640 | if test "$wxHAVE_XEXT_LIB" = 1; then | |
3641 | save_CFLAGS="$CFLAGS" | |
3642 | CFLAGS="$TOOLKIT_INCLUDE $CFLAGS" | |
3643 | ||
3644 | AC_MSG_CHECKING([for X11/extensions/shape.h]) | |
3645 | AC_TRY_COMPILE([ | |
3646 | #include <X11/Xlib.h> | |
3647 | #include <X11/extensions/shape.h> | |
3648 | ], | |
3649 | [ | |
3650 | int dummy1, dummy2; | |
3651 | XShapeQueryExtension((Display*)NULL, | |
3652 | (int*)NULL, (int*)NULL); | |
3653 | ], | |
3654 | [ | |
3655 | AC_DEFINE(HAVE_XSHAPE) | |
3656 | AC_MSG_RESULT([found]) | |
3657 | ], | |
3658 | [ | |
3659 | AC_MSG_RESULT([not found]) | |
3660 | ]) | |
3661 | CFLAGS="$save_CFLAGS" | |
3662 | ||
3663 | fi | |
3664 | fi | |
3665 | ||
3666 | if test "$wxUSE_MAC" = 1; then | |
3667 | AC_MSG_CHECKING([for compiler syntax to enable Pascal strings]) | |
3668 | if test "$GCC" = yes; then | |
3669 | AC_MSG_RESULT([gcc]) | |
3670 | CPPFLAGS_PASCAL="-fpascal-strings" | |
3671 | elif test "`echo $CXX | sed -e 's@.*/@@'`" = "xlC"; then | |
3672 | AC_MSG_RESULT([xlc]) | |
3673 | CPPFLAGS_PASCAL="-qmacpstr" | |
3674 | else | |
3675 | AC_MSG_RESULT([none]) | |
3676 | fi | |
3677 | ||
3678 | if test "x$wxUSE_UNIX" = "xyes"; then | |
3679 | CPPFLAGS="$CPPFLAGS_PASCAL -I\${top_srcdir}/src/mac/carbon/morefilex -I/Developer/Headers/FlatCarbon $CPPFLAGS" | |
3680 | else | |
3681 | dnl platform.h needs TARGET_CARBON before setup.h | |
3682 | CPPFLAGS="$CPPFLAGS_PASCAL -I\${top_srcdir}/src/mac/carbon/morefilex -DTARGET_CARBON $CPPFLAGS" | |
3683 | fi | |
3684 | ||
3685 | TOOLKIT=MAC | |
3686 | dnl we can't call this MAC_DIST or autoconf thinks its a macro | |
3687 | GUIDIST=MACX_DIST | |
3688 | dnl wxMac version of wxBase and wxCocoa or wxBase-only built on Darwin | |
3689 | dnl are different, so they need different names: | |
3690 | WXBASEPORT="_carbon" | |
3691 | fi | |
3692 | ||
3693 | if test "$wxUSE_COCOA" = 1; then | |
3694 | TOOLKIT=COCOA | |
3695 | GUIDIST=COCOA_DIST | |
3696 | fi | |
3697 | ||
3698 | if test "$wxUSE_PM" = 1; then | |
3699 | TOOLKIT=PM | |
3700 | GUIDIST=PM_DIST | |
3701 | AC_CACHE_CHECK([for type SPBCDATA], | |
3702 | wx_cv_spbcdata, | |
3703 | [ | |
3704 | AC_TRY_COMPILE( | |
3705 | [ | |
3706 | #define INCL_PM | |
3707 | #include <os2.h> | |
3708 | ], | |
3709 | [ | |
3710 | SPBCDATA test; | |
3711 | ], | |
3712 | wx_cv_spbcdata=yes, | |
3713 | wx_cv_spbcdata=no | |
3714 | ) | |
3715 | ] | |
3716 | ) | |
3717 | ||
3718 | if test $wx_cv_spbcdata = "yes"; then | |
3719 | AC_DEFINE(HAVE_SPBCDATA) | |
3720 | fi | |
3721 | fi | |
3722 | ||
3723 | dnl the name of the directory where the files for this toolkit live | |
3724 | if test "$TOOLKIT" = "PM" ; then | |
3725 | TOOLKIT_DIR="os2" | |
3726 | else | |
3727 | TOOLKIT_DIR=`echo ${TOOLKIT} | tr "[[A-Z]]" "[[a-z]]"` | |
3728 | fi | |
3729 | ||
3730 | if test "$wxUSE_UNIVERSAL" = "yes"; then | |
3731 | TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXUNIVERSAL__" | |
3732 | WIDGET_SET=univ | |
3733 | fi | |
3734 | ||
3735 | dnl distribute samples/demos/utils with GUI versions | |
3736 | GUIDIST="${GUIDIST} SAMPLES_DIST DEMOS_DIST UTILS_DIST MISC_DIST" | |
3737 | DISTDIR="wx\$(TOOLKIT)" | |
3738 | else | |
3739 | USE_GUI=0 | |
3740 | ||
3741 | dnl this doesn't quite work right for wxBase, but the places | |
3742 | dnl where it is wrong aren't fatal (yet) though. | |
3743 | TOOLKIT_DIR="base" | |
3744 | ||
3745 | dnl the sources, their dependenices and the headers | |
3746 | if test "$USE_WIN32" = 1 ; then | |
3747 | dnl yes, the toolkit for wxBase on win32 is actually MSW | |
3748 | dnl wxBase on unix does not need a 'TOOLKIT' defined. | |
3749 | TOOLKIT="MSW" | |
3750 | fi | |
3751 | ||
3752 | dnl distribute only wxBase sources/headers | |
3753 | GUIDIST="BASE_DIST" | |
3754 | DISTDIR="wxBase" | |
3755 | fi | |
3756 | ||
3757 | dnl --------------------------------------------------------------------------- | |
3758 | dnl Optional libraries included when system library is not used | |
3759 | dnl --------------------------------------------------------------------------- | |
3760 | ||
3761 | dnl do this after test for X11 above so that we have a chance of finding Xlib.h | |
3762 | if test "$wxUSE_GUI" = "yes"; then | |
3763 | if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_PM" != 1; then | |
3764 | dnl defines HAVE_X11_XKBLIB_H | |
3765 | AC_CHECK_HEADERS(X11/Xlib.h) | |
3766 | AC_CHECK_HEADERS([X11/XKBlib.h], [], [], | |
3767 | [ | |
3768 | #if HAVE_X11_XLIB_H | |
3769 | #include <X11/Xlib.h> | |
3770 | #endif | |
3771 | ]) | |
3772 | fi | |
3773 | fi | |
3774 | ||
3775 | ||
3776 | dnl ---------------------------------------------------------------- | |
3777 | dnl iODBC support | |
3778 | dnl ---------------------------------------------------------------- | |
3779 | ||
3780 | IODBC_C_SRC="" | |
3781 | ||
3782 | ||
3783 | dnl ODBC is handled separately for MSW | |
3784 | if test "$TOOLKIT" != "MSW" ; then | |
3785 | ||
3786 | if test "$wxUSE_ODBC" = "sys" -o "$wxUSE_ODBC" = "yes" ; then | |
3787 | dnl This is not ideal we really ough to use the unixodbc-config | |
3788 | dnl or iodbc-config if they exist. | |
3789 | ||
3790 | AC_CHECK_HEADER([sql.h], [found_sql_h=1]) | |
3791 | if test "x$found_sql_h" = "x1" ; then | |
3792 | AC_CHECK_LIB(iodbc, SQLAllocEnv, ODBC_LINK=" -liodbc", | |
3793 | [ | |
3794 | AC_CHECK_LIB(unixodbc, SQLAllocEnv, ODBC_LINK=" -lunixodbc", | |
3795 | [ | |
3796 | AC_CHECK_LIB(odbc, SQLAllocEnv, ODBC_LINK=" -lodbc") | |
3797 | ]) | |
3798 | ]) | |
3799 | fi | |
3800 | if test "x$ODBC_LINK" = "x" ; then | |
3801 | if test "$wxUSE_ODBC" = "sys" ; then | |
3802 | AC_MSG_ERROR([system ODBC library not found! Use --with-odbc=builtin to use built-in version]) | |
3803 | else | |
3804 | AC_MSG_WARN([system ODBC library not found, will use built-in instead]) | |
3805 | wxUSE_ODBC=builtin | |
3806 | fi | |
3807 | else | |
3808 | dnl we are using the system library | |
3809 | wxUSE_ODBC=sys | |
3810 | fi | |
3811 | fi | |
3812 | ||
3813 | if test "$wxUSE_ODBC" = "builtin" ; then | |
3814 | AC_DEFINE(wxUSE_BUILTIN_IODBC) | |
3815 | fi | |
3816 | fi | |
3817 | ||
3818 | if test "$wxUSE_ODBC" != "no" ; then | |
3819 | AC_DEFINE(wxUSE_ODBC) | |
3820 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS db" | |
3821 | ||
3822 | dnl is this still necessary? | |
3823 | WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_IODBC_" | |
3824 | fi | |
3825 | ||
3826 | dnl --------------------------------------------------------------------------- | |
3827 | dnl wxDisplay Sanity checks | |
3828 | dnl --------------------------------------------------------------------------- | |
3829 | ||
3830 | if test "$wxUSE_DISPLAY" = "yes"; then | |
3831 | dnl --------------------------------------------------------------------------- | |
3832 | dnl Xinerama (for unix ) - Brian Victor | |
3833 | dnl --------------------------------------------------------------------------- | |
3834 | if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_MAC" != 1 -a "$wxUSE_COCOA" != 1; then | |
3835 | AC_MSG_CHECKING([for Xinerama]) | |
3836 | WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],Xinerama) | |
3837 | if test "$ac_find_libraries" != "" ; then | |
3838 | WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) | |
3839 | if test "$ac_path_to_link" != " -L/usr/lib" ; then | |
3840 | LDFLAGS="$LDFLAGS $ac_path_to_link" | |
3841 | fi | |
3842 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXinerama" | |
3843 | AC_MSG_RESULT([yes]) | |
3844 | ||
3845 | AC_MSG_CHECKING([for Xxf86vm extension]) | |
3846 | WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],Xxf86vm) | |
3847 | if test "$ac_find_libraries" != "" ; then | |
3848 | AC_MSG_RESULT([yes]) | |
3849 | AC_CHECK_HEADERS([X11/extensions/xf86vmode.h], | |
3850 | [ | |
3851 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXxf86vm" | |
3852 | ], | |
3853 | [], | |
3854 | [ | |
3855 | #if HAVE_X11_XLIB_H | |
3856 | #include <X11/Xlib.h> | |
3857 | #endif | |
3858 | ]) | |
3859 | else | |
3860 | AC_MSG_RESULT([no]) | |
3861 | fi | |
3862 | ||
3863 | else | |
3864 | AC_MSG_RESULT([no]) | |
3865 | AC_MSG_WARN([Xinerama not found; disabling wxDisplay]) | |
3866 | wxUSE_DISPLAY="no" | |
3867 | fi | |
3868 | elif test "$wxUSE_MSW" = 1; then | |
3869 | dnl --------------------------------------------------------------------------- | |
3870 | dnl DirectDraw for MSW - optionally used by WxDisplay. | |
3871 | dnl --------------------------------------------------------------------------- | |
3872 | AC_CHECK_HEADERS([ddraw.h], [], [], [#include <windows.h>]) | |
3873 | fi | |
3874 | fi | |
3875 | ||
3876 | dnl --------------------------------------------------------------------------- | |
3877 | dnl X11 session management | |
3878 | dnl --------------------------------------------------------------------------- | |
3879 | if test "$wxUSE_DETECT_SM" = "yes"; then | |
3880 | if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_MAC" != 1 -a "$wxUSE_COCOA" != 1; then | |
3881 | AC_MSG_CHECKING([for -lSM - X11 session management]) | |
3882 | WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],SM) | |
3883 | if test "$ac_find_libraries" != "" ; then | |
3884 | WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) | |
3885 | if test "$ac_path_to_link" != " -L/usr/lib" ; then | |
3886 | LDFLAGS="$LDFLAGS $ac_path_to_link" | |
3887 | fi | |
3888 | GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lSM" | |
3889 | AC_MSG_RESULT([yes]) | |
3890 | else | |
3891 | AC_MSG_RESULT([no]) | |
3892 | AC_MSG_WARN([libSM not found; disabling session management detection]) | |
3893 | wxUSE_DETECT_SM="no" | |
3894 | fi | |
3895 | else | |
3896 | wxUSE_DETECT_SM="no" | |
3897 | fi | |
3898 | fi | |
3899 | ||
3900 | ||
3901 | dnl --------------------------------------------------------------------------- | |
3902 | dnl OpenGL libraries | |
3903 | dnl --------------------------------------------------------------------------- | |
3904 | ||
3905 | USE_OPENGL=0 | |
3906 | if test "$wxUSE_OPENGL" = "yes"; then | |
3907 | if test "$wxUSE_MGL" = 1 -o "$wxUSE_DFB" = "1"; then | |
3908 | AC_MSG_WARN([wxGLCanvas not implemented for this port, library will be compiled without it.]) | |
3909 | wxUSE_OPENGL="no" | |
3910 | elif test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = "1"; then | |
3911 | OPENGL_LIBS="-framework OpenGL -framework AGL" | |
3912 | elif test "$wxUSE_MSW" = 1; then | |
3913 | OPENGL_LIBS="-lopengl32 -lglu32" | |
3914 | else | |
3915 | dnl adjust CPPFLAGS to include GL/gl.h location if necessary | |
3916 | dnl (/opt/graphics/OpenGL is for HP-UX systems, bug 925307) | |
3917 | AC_MSG_CHECKING([for OpenGL headers]) | |
3918 | WX_PATH_FIND_INCLUDES([$SEARCH_INCLUDE /opt/graphics/OpenGL/include], GL/gl.h) | |
3919 | if test "$ac_find_includes" != "" ; then | |
3920 | AC_MSG_RESULT(found in $ac_find_includes) | |
3921 | WX_INCLUDE_PATH_EXIST($ac_find_includes, $CPPFLAGS) | |
3922 | CPPFLAGS="$ac_path_to_include $CPPFLAGS" | |
3923 | else | |
3924 | AC_MSG_RESULT([not found]) | |
3925 | fi | |
3926 | ||
3927 | AC_CHECK_HEADER(GL/gl.h, [ | |
3928 | AC_CHECK_HEADER(GL/glu.h, [ | |
3929 | found_gl=0 | |
3930 | ||
3931 | AC_MSG_CHECKING([for -lGL]) | |
3932 | WX_PATH_FIND_LIBRARIES([$SEARCH_LIB /opt/graphics/OpenGL/lib],GL) | |
3933 | if test "$ac_find_libraries" != "" ; then | |
3934 | AC_MSG_RESULT([found in $ac_find_libraries]) | |
3935 | ||
3936 | WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) | |
3937 | if test "$ac_path_to_link" != " -L/usr/lib" ; then | |
3938 | LDFLAGS_GL="$ac_path_to_link" | |
3939 | fi | |
3940 | ||
3941 | dnl don't suppose that libGL and libGLU are always in the | |
3942 | dnl same directory -- this is not true for some common | |
3943 | dnl distributions | |
3944 | AC_MSG_CHECKING([for -lGLU]) | |
3945 | WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],GLU) | |
3946 | if test "$ac_find_libraries" != "" ; then | |
3947 | WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) | |
3948 | if test "$ac_path_to_link" != " -L/usr/lib" -a \ | |
3949 | "$ac_path_to_link" != "$LDFLAGS_GL"; then | |
3950 | LDFLAGS_GL="$LDFLAGS_GL$ac_path_to_link" | |
3951 | fi | |
3952 | ||
3953 | found_gl=1 | |
3954 | OPENGL_LIBS="-lGL -lGLU" | |
3955 | AC_MSG_RESULT([yes]) | |
3956 | else | |
3957 | AC_MSG_RESULT([no]) | |
3958 | fi | |
3959 | else | |
3960 | AC_MSG_RESULT([no]) | |
3961 | fi | |
3962 | ||
3963 | if test "$found_gl" != 1; then | |
3964 | AC_MSG_CHECKING([for -lMesaGL]) | |
3965 | WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],MesaGL) | |
3966 | if test "$ac_find_libraries" != "" ; then | |
3967 | WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) | |
3968 | LDFLAGS_GL="$LDFLAGS$ac_path_to_link" | |
3969 | OPENGL_LIBS="-lMesaGL -lMesaGLU" | |
3970 | AC_MSG_RESULT([yes]) | |
3971 | else | |
3972 | AC_MSG_RESULT([no]) | |
3973 | fi | |
3974 | fi | |
3975 | ]) | |
3976 | ]) | |
3977 | ||
3978 | if test "x$OPENGL_LIBS" = "x"; then | |
3979 | dnl it should be an error and not a warning because OpenGL is not on | |
3980 | dnl by default and so if it had been explicitly requested, we | |
3981 | dnl shouldn't just fall back to compiling the library without it | |
3982 | AC_MSG_ERROR(OpenGL libraries not available) | |
3983 | fi | |
3984 | fi | |
3985 | ||
3986 | if test "$wxUSE_OPENGL" = "yes"; then | |
3987 | USE_OPENGL=1 | |
3988 | AC_DEFINE(wxUSE_OPENGL) | |
3989 | AC_DEFINE(wxUSE_GLCANVAS) | |
3990 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl opengl/cube opengl/penguin opengl/isosurf" | |
3991 | fi | |
3992 | fi | |
3993 | ||
3994 | ||
3995 | dnl the symbol which allows conditional compilation for the given toolkit | |
3996 | if test -n "$TOOLKIT" ; then | |
3997 | TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WX${TOOLKIT}__" | |
3998 | fi | |
3999 | ||
4000 | ||
4001 | dnl --- the marker for quick search, leave it here: SHARED_LIB_SETUP --- | |
4002 | ||
4003 | if test "$wxUSE_SHARED" = "yes"; then | |
4004 | case "${host}" in | |
4005 | *-pc-msdosdjgpp ) | |
4006 | dnl only static for now | |
4007 | wxUSE_SHARED=no | |
4008 | AC_MSG_WARN([Host system doesn't support shared libraries, disabling]) | |
4009 | ;; | |
4010 | esac | |
4011 | fi | |
4012 | ||
4013 | if test "$wxUSE_SHARED" = "yes"; then | |
4014 | ||
4015 | dnl use versioned symbols if available on the platform | |
4016 | WX_VERSIONED_SYMBOLS([\$(wx_top_builddir)/version-script]) | |
4017 | ||
4018 | case "${host}" in | |
4019 | *-*-linux* | *-*-gnu* ) | |
4020 | SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(wx_top_builddir)/lib" | |
4021 | WXCONFIG_RPATH="-Wl,-rpath,\$libdir" | |
4022 | ;; | |
4023 | ||
4024 | *-*-solaris2* ) | |
4025 | if test "$GCC" = yes ; then | |
4026 | dnl newer versions of gcc need -isystem to compile X headers on | |
4027 | dnl Solaris (which use old style C syntax) | |
4028 | CPPFLAGS="-isystem /usr/openwin/include $CPPFLAGS" | |
4029 | ||
4030 | dnl gcc may use Sun's ld, in which case -rpath gives a confusing | |
4031 | dnl error message. We have to try both -Wl,-rpath and -Wl,-R: | |
4032 | saveLdflags="$LDFLAGS" | |
4033 | LDFLAGS="$saveLdflags -Wl,-rpath,/" | |
4034 | AC_MSG_CHECKING([if the linker accepts -rpath]) | |
4035 | AC_TRY_LINK( | |
4036 | [],[], | |
4037 | [ | |
4038 | AC_MSG_RESULT([yes]) | |
4039 | SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(wx_top_builddir)/lib" | |
4040 | WXCONFIG_RPATH="-Wl,-rpath,\$libdir" | |
4041 | ],[ | |
4042 | AC_MSG_RESULT([no]) | |
4043 | AC_MSG_CHECKING([if the linker accepts -R]) | |
4044 | LDFLAGS="$saveLdflags -Wl,-R,/" | |
4045 | AC_TRY_LINK( | |
4046 | [],[], | |
4047 | [ | |
4048 | AC_MSG_RESULT([yes]) | |
4049 | SAMPLES_RPATH_FLAG="-Wl,-R,\$(wx_top_builddir)/lib" | |
4050 | WXCONFIG_RPATH="-Wl,-R,\$libdir" | |
4051 | ],[ | |
4052 | AC_MSG_RESULT([no]) | |
4053 | ]) | |
4054 | ]) | |
4055 | LDFLAGS="$saveLdflags" | |
4056 | else | |
4057 | SAMPLES_RPATH_FLAG="-R\$(wx_top_builddir)/lib" | |
4058 | WXCONFIG_RPATH="-R\$libdir" | |
4059 | fi | |
4060 | ;; | |
4061 | ||
4062 | *-*-darwin* ) | |
4063 | install_name_tool=`which install_name_tool` | |
4064 | if test "$install_name_tool" -a -x "$install_name_tool"; then | |
4065 | SAMPLES_RPATH_POSTLINK="\$(wx_top_builddir)/change-install-names \$(LIBDIRNAME) \$(prefix) \$@" | |
4066 | cat <<EOF >change-install-names | |
4067 | #!/bin/sh | |
4068 | libnames=\`cd \${1} ; ls -1 | grep '\.[[0-9]][[0-9]]*\.dylib\$'\` | |
4069 | inst_cmd="install_name_tool " | |
4070 | for i in \${libnames} ; do | |
4071 | inst_cmd="\${inst_cmd} -change \${2}/lib/\${i} \${1}/\${i}" | |
4072 | done | |
4073 | \${inst_cmd} \${3} | |
4074 | EOF | |
4075 | chmod +x change-install-names | |
4076 | fi | |
4077 | ;; | |
4078 | ||
4079 | *-*-cygwin* | *-*-mingw32* ) | |
4080 | dnl this one shouldn't be used for the library build so put it in a | |
4081 | dnl separate variable from WXCONFIG_CPPFLAGS | |
4082 | WXCONFIG_ONLY_CPPFLAGS="$WXCONFIG_ONLY_CPPFLAGS -DWXUSINGDLL" | |
4083 | ;; | |
4084 | ||
4085 | *-*-hpux* ) | |
4086 | SAMPLES_RPATH_FLAG="-Wl,+b,\$(wx_top_builddir)/lib" | |
4087 | WXCONFIG_RPATH="-Wl,+b,\$libdir" | |
4088 | ;; | |
4089 | ||
4090 | esac | |
4091 | ||
4092 | if test $wxUSE_RPATH = "no"; then | |
4093 | SAMPLES_RPATH_FLAG='' | |
4094 | SAMPLES_RPATH_POSTLINK='' | |
4095 | WXCONFIG_RPATH='' | |
4096 | fi | |
4097 | ||
4098 | SHARED=1 | |
4099 | ||
4100 | else | |
4101 | ||
4102 | config_linkage_component="-static" | |
4103 | SHARED=0 | |
4104 | ||
4105 | fi | |
4106 | ||
4107 | ||
4108 | UNICODE=0 | |
4109 | lib_unicode_suffix= | |
4110 | WX_CHARTYPE="ansi" | |
4111 | if test "$wxUSE_UNICODE" = "yes"; then | |
4112 | lib_unicode_suffix=u | |
4113 | WX_CHARTYPE="unicode" | |
4114 | UNICODE=1 | |
4115 | fi | |
4116 | ||
4117 | lib_debug_suffix= | |
4118 | WX_DEBUGTYPE="release" | |
4119 | DEBUG_FLAG=0 | |
4120 | if test "$wxUSE_DEBUG_FLAG" = "yes"; then | |
4121 | lib_debug_suffix=d | |
4122 | WX_DEBUGTYPE="debug" | |
4123 | DEBUG_FLAG=1 | |
4124 | fi | |
4125 | ||
4126 | WX_FLAVOUR=${WX_FLAVOUR:+-$WX_FLAVOUR} | |
4127 | WX_LIB_FLAVOUR=`echo $WX_FLAVOUR | tr '-' '_'` | |
4128 | ||
4129 | DEBUG_INFO=0 | |
4130 | if test "$wxUSE_DEBUG_INFO" = "yes"; then | |
4131 | DEBUG_INFO=1 | |
4132 | fi | |
4133 | ||
4134 | WX_VERSION_TAG=`echo WX${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}_${WX_RELEASE} | tr "[[a-z]]" "[[A-Z]]"` | |
4135 | ||
4136 | TOOLCHAIN_NAME="${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}-${WX_RELEASE}" | |
4137 | ||
4138 | TOOLCHAIN_FULLNAME="${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}-${WX_CHARTYPE}-${WX_DEBUGTYPE}${config_linkage_component}-${WX_RELEASE}${WX_FLAVOUR}" | |
4139 | ||
4140 | if test "$cross_compiling" = "yes"; then | |
4141 | HOST_SUFFIX="-$host_alias" | |
4142 | TOOLCHAIN_NAME="$TOOLCHAIN_NAME$HOST_SUFFIX" | |
4143 | TOOLCHAIN_FULLNAME="${host_alias}-$TOOLCHAIN_FULLNAME" | |
4144 | fi | |
4145 | ||
4146 | dnl library link name | |
4147 | dnl These just save us from exporting lib_{unicode,debug,flavour}_suffix. | |
4148 | dnl If we ever need to do that, we won't need to keep these. | |
4149 | WX_LIBRARY_BASENAME_NOGUI="wx_base${WXBASEPORT}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}" | |
4150 | if test "${TOOLKIT_DIR}" = "os2"; then | |
4151 | WX_LIBRARY_BASENAME_GUI="wx_pm${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}" | |
4152 | else | |
4153 | WX_LIBRARY_BASENAME_GUI="wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}" | |
4154 | fi | |
4155 | ||
4156 | ||
4157 | ||
4158 | if test "$wxUSE_COCOA" = 1; then | |
4159 | AC_LANG_SAVE | |
4160 | AC_WX_LANG_OBJECTIVEC | |
4161 | dnl Recent AppKit/NSEvent.h include parts of IOKit which eventually | |
4162 | dnl gets IOKit/graphics/IOGraphicsTypes.h included which typedefs | |
4163 | dnl Point but only if MacTypes.h was not included first. Of course, | |
4164 | dnl if MacTypes.h is included later then you're screwed when it | |
4165 | dnl tries to typedef Point. Defining __Point__ will cause IOGraphicsTypes.h | |
4166 | dnl to not typedef Point and thus fix the problem. | |
4167 | AC_MSG_CHECKING([if AppKit/NSEvent.h conflicts with CoreFoundation]) | |
4168 | AC_TRY_COMPILE([#include <AppKit/NSEvent.h> | |
4169 | #include <CoreFoundation/CoreFoundation.h> | |
4170 | ],[], | |
4171 | [AC_MSG_RESULT([no])], | |
4172 | [AC_MSG_RESULT([yes]) | |
4173 | AC_MSG_CHECKING([if defining __Point__ will fix it]) | |
4174 | AC_TRY_COMPILE([#define __Point__ 1 | |
4175 | #include <AppKit/NSEvent.h> | |
4176 | #include <CoreFoundation/CoreFoundation.h> | |
4177 | ],[], | |
4178 | [AC_MSG_RESULT([yes]) | |
4179 | AC_DEFINE(__Point__) | |
4180 | ], | |
4181 | [AC_MSG_FAILURE([no])] | |
4182 | )] | |
4183 | ) | |
4184 | AC_LANG_RESTORE | |
4185 | fi | |
4186 | ||
4187 | if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1; then | |
4188 | dnl base name of the resource file for wxMac must be the same | |
4189 | dnl as library installation base name (-install_name) | |
4190 | WX_RESOURCES_MACOSX_ASCII="libwx_${TOOLCHAIN_NAME}.${wx_release_number}.r" | |
4191 | WX_RESOURCES_MACOSX_DATA="libwx_${TOOLCHAIN_NAME}.${wx_release_number}.rsrc" | |
4192 | ||
4193 | dnl add the resources target for wxMac | |
4194 | LIBWXMACRES="\$(wx_top_builddir)/lib/${WX_RESOURCES_MACOSX_ASCII}" | |
4195 | ||
4196 | AC_CHECK_PROG(REZ, Rez, Rez, /Developer/Tools/Rez) | |
4197 | AC_CHECK_PROG(DEREZ, DeRez, DeRez, /Developer/Tools/DeRez) | |
4198 | AC_CHECK_PROG(SETFILE, SetFile, SetFile, /Developer/Tools/SetFile) | |
4199 | ||
4200 | MACSETFILE="\$(SETFILE)" | |
4201 | ||
4202 | dnl resources are bundled both with shared library and applications | |
4203 | dnl since the carb resource *must* be included in the application | |
4204 | if test "$wxUSE_MAC" = 1; then | |
4205 | POSTLINK_COMMAND="\$(REZ) -d __DARWIN__ -t APPL Carbon.r -o" | |
4206 | RESCOMP="$REZ" | |
4207 | WXCONFIG_RESFLAGS="-d __DARWIN__ -t APPL Carbon.r -o" | |
4208 | else | |
4209 | POSTLINK_COMMAND="echo -n | \$(REZ) -d __DARWIN__ -t APPL ${LIBWXMACRES}" | |
4210 | RESCOMP="echo -n \| $REZ" | |
4211 | WXCONFIG_RESFLAGS="-d __DARWIN__ -t APPL \$libdir/$WX_RESOURCES_MACOSX_ASCII" | |
4212 | fi | |
4213 | ||
4214 | else | |
4215 | dnl default value is to (silently) do nothing in the makefile | |
4216 | MACSETFILE="@true" | |
4217 | ||
4218 | if test "$wxUSE_PM" = 1; then | |
4219 | RESCOMP="emxbind" | |
4220 | WXCONFIG_RESFLAGS="-ep" | |
4221 | ||
4222 | dnl Is this one really used anywhere for pm? | |
4223 | POSTLINK_COMMAND="$RESCOMP $WXCONFIG_RESFLAGS" | |
4224 | else | |
4225 | POSTLINK_COMMAND="@true" | |
4226 | fi | |
4227 | ||
4228 | fi | |
4229 | ||
4230 | ||
4231 | dnl --------------------------------------------------------------------------- | |
4232 | dnl Checks for typedefs | |
4233 | dnl --------------------------------------------------------------------------- | |
4234 | ||
4235 | dnl defines mode_t if not already defined | |
4236 | AC_TYPE_MODE_T | |
4237 | dnl defines off_t if not already defined | |
4238 | AC_TYPE_OFF_T | |
4239 | dnl defines pid_t if not already defined | |
4240 | AC_TYPE_PID_T | |
4241 | dnl defines size_t if not already defined | |
4242 | AC_TYPE_SIZE_T | |
4243 | dnl defines uid_t and gid_t if not already defined | |
4244 | AC_TYPE_UID_T | |
4245 | ||
4246 | dnl sets HAVE_SSIZE_T if ssize_t is defined | |
4247 | AC_CHECK_TYPES(ssize_t) | |
4248 | ||
4249 | dnl check what exactly size_t is on this machine - this is necessary to avoid | |
4250 | dnl ambiguous overloads in several places, notably wx/string.h and wx/array.h | |
4251 | AC_LANG_PUSH(C++) dnl tests below use overloaded functions and so need C++ | |
4252 | AC_CACHE_CHECK([if size_t is unsigned int], | |
4253 | wx_cv_size_t_is_uint, | |
4254 | [ | |
4255 | dnl an obvious check like AC_TRY_COMPILE[struct Foo { ... };] doesn't work | |
4256 | dnl with egcs (at least) up to 1.1.1 as it allows you to compile duplicate | |
4257 | dnl methods in a local class (i.e. class inside a function) declaration | |
4258 | dnl without any objections!! | |
4259 | dnl | |
4260 | dnl hence the hack below: we must have Foo at global scope! | |
4261 | AC_TRY_COMPILE([#include <stddef.h>], | |
4262 | [ | |
4263 | return 0; } | |
4264 | ||
4265 | struct Foo { void foo(size_t); void foo(unsigned int); }; | |
4266 | ||
4267 | int bar() { | |
4268 | ], | |
4269 | wx_cv_size_t_is_uint=no, | |
4270 | wx_cv_size_t_is_uint=yes | |
4271 | ) | |
4272 | ] | |
4273 | ) | |
4274 | ||
4275 | if test "$wx_cv_size_t_is_uint" = "yes"; then | |
4276 | AC_DEFINE(wxSIZE_T_IS_UINT) | |
4277 | else | |
4278 | AC_CACHE_CHECK([if size_t is unsigned long], | |
4279 | wx_cv_size_t_is_ulong, | |
4280 | AC_TRY_COMPILE([#include <stddef.h>], | |
4281 | [ | |
4282 | return 0; } | |
4283 | ||
4284 | struct Foo { void foo(size_t); void foo(unsigned long); }; | |
4285 | ||
4286 | int bar() { | |
4287 | ], | |
4288 | wx_cv_size_t_is_ulong=no, | |
4289 | wx_cv_size_t_is_ulong=yes | |
4290 | ) | |
4291 | ) | |
4292 | ||
4293 | if test "$wx_cv_size_t_is_ulong" = "yes"; then | |
4294 | AC_DEFINE(wxSIZE_T_IS_ULONG) | |
4295 | fi | |
4296 | fi | |
4297 | ||
4298 | AC_LANG_POP() dnl C++ | |
4299 | ||
4300 | dnl --------------------------------------------------------------------------- | |
4301 | dnl Checks for structures | |
4302 | dnl --------------------------------------------------------------------------- | |
4303 | ||
4304 | dnl does passwd struct has the pw_gecos field? | |
4305 | AC_CACHE_CHECK([for pw_gecos in struct passwd], wx_cv_struct_pw_gecos, | |
4306 | [ | |
4307 | AC_TRY_COMPILE([#include <pwd.h>], | |
4308 | [ | |
4309 | char *p; | |
4310 | struct passwd *pw; | |
4311 | p = pw->pw_gecos; | |
4312 | ], | |
4313 | [ | |
4314 | wx_cv_struct_pw_gecos=yes | |
4315 | ], | |
4316 | [ | |
4317 | wx_cv_struct_pw_gecos=no | |
4318 | ] | |
4319 | ) | |
4320 | ] | |
4321 | ) | |
4322 | ||
4323 | if test "$wx_cv_struct_pw_gecos" = "yes"; then | |
4324 | AC_DEFINE(HAVE_PW_GECOS) | |
4325 | fi | |
4326 | ||
4327 | dnl --------------------------------------------------------------------------- | |
4328 | dnl Check for functions | |
4329 | dnl --------------------------------------------------------------------------- | |
4330 | ||
4331 | dnl don't check for wchar_t functions if we haven't got wchar_t itself | |
4332 | if test "$wxUSE_WCHAR_T" = "yes"; then | |
4333 | AC_DEFINE(wxUSE_WCHAR_T) | |
4334 | ||
4335 | dnl check for wcslen in all possible places | |
4336 | WCSLEN_FOUND=0 | |
4337 | WCHAR_LINK= | |
4338 | AC_CHECK_FUNCS(wcslen, WCSLEN_FOUND=1) | |
4339 | ||
4340 | if test "$WCSLEN_FOUND" = 0; then | |
4341 | if test "$TOOLKIT" = "MSW"; then | |
4342 | AC_CHECK_LIB(msvcrt, wcslen, WCHAR_OK=1) | |
4343 | else | |
4344 | AC_CHECK_LIB(w, wcslen, [ | |
4345 | WCHAR_LINK=" -lw" | |
4346 | WCSLEN_FOUND=1 | |
4347 | ]) | |
4348 | fi | |
4349 | fi | |
4350 | ||
4351 | if test "$WCSLEN_FOUND" = 1; then | |
4352 | AC_DEFINE(HAVE_WCSLEN) | |
4353 | fi | |
4354 | ||
4355 | dnl On HP-UX aCC need this define to find mbstrtowcs() &c | |
4356 | dnl Can't be used for g++ since the mbstate_t in wchar.h can conflict | |
4357 | dnl with g++'s in <cwchar> (unless -D_INCLUDE__STDC_A1_SOURCE is in the | |
4358 | dnl flags when g++ is configured, it will declare it's own). | |
4359 | if test "$USE_HPUX" = 1 -a "$GCC" != "yes"; then | |
4360 | CPPFLAGS="-D_INCLUDE__STDC_A1_SOURCE $CPPFLAGS" | |
4361 | fi | |
4362 | ||
4363 | dnl Try to use wcsrtombs instead of wcstombs which is buggy in old GNU | |
4364 | dnl libc versions if possible. AC_CHECK_FUNCS only checks it's in the | |
4365 | dnl library, not the header, so do a header check for mbstate_t first. | |
4366 | AC_CHECK_TYPES([mbstate_t], | |
4367 | [AC_CHECK_FUNCS(wcsrtombs)], | |
4368 | [], | |
4369 | [#include <wchar.h>]) | |
4370 | else | |
4371 | AC_MSG_WARN([Wide character support is unavailable]) | |
4372 | fi | |
4373 | ||
4374 | dnl check for vsnprintf() -- a safe version of vsprintf()) | |
4375 | dnl | |
4376 | dnl the trouble here is that on some systems (e.g HP-UX 10) this function is | |
4377 | dnl present in libc but not in the system headers and so AC_CHECK_FUNCS (which, | |
4378 | dnl stupidly, provides a dummy function declaration inside its extension) | |
4379 | dnl succeeds, even with C++ compiler, but the compilation of wxWidgets fails | |
4380 | dnl | |
4381 | dnl so we first check if the function is in the library | |
4382 | dnl | |
4383 | dnl FIXME: replace this mess with WX_CHECK_FUNCS() | |
4384 | AC_CHECK_FUNCS(snprintf vsnprintf) | |
4385 | ||
4386 | if test "$ac_cv_func_vsnprintf" = "yes"; then | |
4387 | dnl yes it is -- now check if it is in the headers | |
4388 | AC_CACHE_CHECK([for vsnprintf declaration], wx_cv_func_vsnprintf_decl, | |
4389 | [ | |
4390 | dnl our troubles are not over: HP-UX 11 prototypes vsnprintf() as | |
4391 | dnl taking "char *" and not "const char *" while Metrowerks does | |
4392 | dnl provide a correct vsnprintf declaration but in C++ mode it's | |
4393 | dnl always in std namespace and so we have to bring it in scope | |
4394 | AC_TRY_COMPILE( | |
4395 | [ | |
4396 | #include <stdio.h> | |
4397 | #include <stdarg.h> | |
4398 | #ifdef __MSL__ | |
4399 | #if __MSL__ >= 0x6000 | |
4400 | namespace std {} | |
4401 | using namespace std; | |
4402 | #endif | |
4403 | #endif | |
4404 | ], | |
4405 | [ | |
4406 | char *buf; | |
4407 | va_list ap; | |
4408 | vsnprintf(buf, 10u, "%s", ap); | |
4409 | ], | |
4410 | wx_cv_func_vsnprintf_decl=yes, | |
4411 | wx_cv_func_vsnprintf_decl=no | |
4412 | ) | |
4413 | ] | |
4414 | ) | |
4415 | ||
4416 | if test "$wx_cv_func_vsnprintf_decl" = "yes"; then | |
4417 | AC_DEFINE(HAVE_VSNPRINTF_DECL) | |
4418 | ||
4419 | dnl we know there is a vsnprintf declaration, but some old headers | |
4420 | dnl may have one taking a "char *" format instead of "const char *" | |
4421 | AC_CACHE_CHECK([if vsnprintf declaration is broken], wx_cv_func_broken_vsnprintf_decl, | |
4422 | [ | |
4423 | AC_TRY_COMPILE( | |
4424 | [ | |
4425 | #include <stdio.h> | |
4426 | #include <stdarg.h> | |
4427 | #ifdef __MSL__ | |
4428 | #if __MSL__ >= 0x6000 | |
4429 | namespace std {} | |
4430 | using namespace std; | |
4431 | #endif | |
4432 | #endif | |
4433 | ], | |
4434 | [ | |
4435 | char *buf; | |
4436 | va_list ap; | |
4437 | const char *fmt = "%s"; | |
4438 | vsnprintf(buf, 10u, fmt, ap); | |
4439 | ], | |
4440 | wx_cv_func_broken_vsnprintf_decl=no, | |
4441 | wx_cv_func_broken_vsnprintf_decl=yes | |
4442 | ) | |
4443 | ] | |
4444 | ) | |
4445 | ||
4446 | if test "$wx_cv_func_broken_vsnprintf_decl" = "yes"; then | |
4447 | AC_DEFINE(HAVE_BROKEN_VSNPRINTF_DECL) | |
4448 | fi | |
4449 | fi | |
4450 | fi | |
4451 | ||
4452 | dnl the same as above but for snprintf() now: it's not present in at least AIX | |
4453 | dnl 4.2 headers | |
4454 | if test "$ac_cv_func_snprintf" = "yes"; then | |
4455 | AC_CACHE_CHECK([for snprintf declaration], wx_cv_func_snprintf_decl, | |
4456 | [ | |
4457 | AC_TRY_COMPILE( | |
4458 | [ | |
4459 | #include <stdio.h> | |
4460 | #include <stdarg.h> | |
4461 | #ifdef __MSL__ | |
4462 | #if __MSL__ >= 0x6000 | |
4463 | namespace std {} | |
4464 | using namespace std; | |
4465 | #endif | |
4466 | #endif | |
4467 | ], | |
4468 | [ | |
4469 | char *buf; | |
4470 | snprintf(buf, 10u, "%s", "wx"); | |
4471 | ], | |
4472 | wx_cv_func_snprintf_decl=yes, | |
4473 | wx_cv_func_snprintf_decl=no | |
4474 | ) | |
4475 | ] | |
4476 | ) | |
4477 | ||
4478 | if test "$wx_cv_func_snprintf_decl" = "yes"; then | |
4479 | AC_DEFINE(HAVE_SNPRINTF_DECL) | |
4480 | ||
4481 | dnl we know there is an snprintf declaration, but some old headers | |
4482 | dnl may have one taking a "char *" format instead of "const char *" | |
4483 | AC_CACHE_CHECK([if snprintf declaration is broken], wx_cv_func_broken_snprintf_decl, | |
4484 | [ | |
4485 | AC_TRY_COMPILE( | |
4486 | [ | |
4487 | #include <stdio.h> | |
4488 | #include <stdarg.h> | |
4489 | #ifdef __MSL__ | |
4490 | #if __MSL__ >= 0x6000 | |
4491 | namespace std {} | |
4492 | using namespace std; | |
4493 | #endif | |
4494 | #endif | |
4495 | ], | |
4496 | [ | |
4497 | char *buf; | |
4498 | const char *fmt = "%s"; | |
4499 | snprintf(buf, 10u, fmt, "wx"); | |
4500 | ], | |
4501 | wx_cv_func_broken_snprintf_decl=no, | |
4502 | wx_cv_func_broken_snprintf_decl=yes | |
4503 | ) | |
4504 | ] | |
4505 | ) | |
4506 | ||
4507 | if test "$wx_cv_func_broken_snprintf_decl" = "yes"; then | |
4508 | AC_DEFINE(HAVE_BROKEN_SNPRINTF_DECL) | |
4509 | fi | |
4510 | fi | |
4511 | ||
4512 | if test "$wxUSE_PRINTF_POS_PARAMS" = "yes"; then | |
4513 | ||
4514 | dnl check if snprintf() has support for positional arguments | |
4515 | dnl NB: if snprintf() has positional support we can safely suppose that also | |
4516 | dnl other *printf() functions support them as they all belong to the same | |
4517 | dnl family and they all fallback to the same implementation | |
4518 | AC_CACHE_CHECK([if snprintf supports positional arguments], wx_cv_func_snprintf_pos_params, | |
4519 | [ | |
4520 | AC_TRY_RUN( | |
4521 | [ | |
4522 | #include <stdio.h> | |
4523 | ||
4524 | int main (void) | |
4525 | { | |
4526 | char buffer[128]; | |
4527 | snprintf (buffer, 128, "%2\$d %3\$d %1\$d", 1, 2, 3); | |
4528 | if (strcmp ("2 3 1", buffer) == 0) | |
4529 | exit (0); | |
4530 | exit (1); | |
4531 | } | |
4532 | ], | |
4533 | wx_cv_func_snprintf_pos_params=no, | |
4534 | wx_cv_func_snprintf_pos_params=yes, | |
4535 | dnl be pessimistic when cross-compiling | |
4536 | [ | |
4537 | AC_MSG_WARN([Assuming Unix98 printf() is not available, | |
4538 | define HAVE_UNIX98_PRINTF as 1 in setup.h if it is available.]) | |
4539 | wx_cv_func_snprintf_pos_params=no | |
4540 | ] | |
4541 | ) | |
4542 | ] | |
4543 | ) | |
4544 | ||
4545 | if test "$wx_cv_func_snprintf_pos_params" = "yes"; then | |
4546 | AC_DEFINE(HAVE_UNIX98_PRINTF) | |
4547 | fi | |
4548 | fi | |
4549 | fi | |
4550 | ||
4551 | if test "$wxUSE_UNICODE" = yes; then | |
4552 | ||
4553 | dnl our wxVsnprintf() implementation needs to use the system swprintf() in Unicode | |
4554 | dnl builds so let's check if swprintf() is declared as C99 imposes: | |
4555 | dnl int swprintf(wchar_t *s, size_t n, const wchar_t *format, ...); | |
4556 | dnl or rather as: | |
4557 | dnl int swprintf(wchar_t *s, const wchar_t *format, ...); | |
4558 | AC_CHECK_FUNCS(swprintf) | |
4559 | ||
4560 | if test "$ac_cv_func_swprintf" = "yes"; then | |
4561 | AC_CACHE_CHECK([if swprintf declaration is broken], wx_cv_func_broken_swprintf_decl, | |
4562 | [ | |
4563 | AC_TRY_COMPILE( | |
4564 | [ | |
4565 | #include <stdio.h> | |
4566 | #include <stdarg.h> | |
4567 | #include <wchar.h> | |
4568 | ], | |
4569 | [ | |
4570 | wchar_t *buf; | |
4571 | const wchar_t *fmt = L"test"; | |
4572 | swprintf(buf, 10u, fmt); | |
4573 | ], | |
4574 | wx_cv_func_broken_swprintf_decl=no, | |
4575 | wx_cv_func_broken_swprintf_decl=yes | |
4576 | ) | |
4577 | ] | |
4578 | ) | |
4579 | ||
4580 | if test "$wx_cv_func_broken_swprintf_decl" = "yes"; then | |
4581 | AC_DEFINE(HAVE_BROKEN_SWPRINTF_DECL) | |
4582 | fi | |
4583 | fi | |
4584 | ||
4585 | dnl also look if we have wide char IO functions, notice that [f]putws are | |
4586 | dnl declared in special widec.h under Solaris | |
4587 | wchar_headers="#include <stdio.h> | |
4588 | #include <wchar.h>" | |
4589 | case "${host}" in | |
4590 | *-*-solaris2* ) | |
4591 | AC_CHECK_HEADERS(widec.h) | |
4592 | if test "$ac_cv_header_widec_h" = "yes"; then | |
4593 | wchar_headers="$wchar_headers | |
4594 | #include <widec.h>" | |
4595 | fi | |
4596 | esac | |
4597 | ||
4598 | WX_CHECK_FUNCS(wputc wputchar putws fputws wprintf vswprintf,,, | |
4599 | [$wchar_headers]) | |
4600 | ||
4601 | dnl MinGW has a vswprintf with a different prototype, and | |
4602 | dnl a _vsnwprintf with the correct prototype, but AC_CHECK_FUNCS | |
4603 | dnl finds it even if it is not declared in some versions... | |
4604 | AC_MSG_CHECKING([for _vsnwprintf]) | |
4605 | AC_TRY_COMPILE([#include <wchar.h>], | |
4606 | [&_vsnwprintf;], | |
4607 | [AC_MSG_RESULT([yes]) | |
4608 | AC_DEFINE(HAVE__VSNWPRINTF)], | |
4609 | [AC_MSG_RESULT([no])]); | |
4610 | fi | |
4611 | ||
4612 | if test "x$ac_cv_header_fnmatch_h" = "xyes"; then | |
4613 | WX_CHECK_FUNCS(fnmatch,,,[#include <fnmatch.h>]) | |
4614 | fi | |
4615 | ||
4616 | if test "$wxUSE_FILE" = "yes"; then | |
4617 | WX_CHECK_FUNCS(fsync) | |
4618 | fi | |
4619 | ||
4620 | WX_CHECK_FUNCS(round,,,[#include <math.h>]) | |
4621 | ||
4622 | dnl the following tests are for Unix(like) systems only | |
4623 | if test "$TOOLKIT" != "MSW"; then | |
4624 | ||
4625 | dnl check for available version of iconv() | |
4626 | ||
4627 | AM_ICONV | |
4628 | LIBS="$LIBICONV $LIBS" | |
4629 | ||
4630 | dnl check for POSIX signals if we need them | |
4631 | if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes" -a "$wxUSE_UNIX" = "yes"; then | |
4632 | AC_CHECK_FUNCS(sigaction) | |
4633 | ||
4634 | if test "$ac_cv_func_sigaction" = "no"; then | |
4635 | AC_MSG_WARN([No POSIX signal functions on this system, wxApp::OnFatalException will not be called]) | |
4636 | wxUSE_ON_FATAL_EXCEPTION=no | |
4637 | fi | |
4638 | ||
4639 | if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then | |
4640 | AC_CACHE_CHECK([for sa_handler type], wx_cv_type_sa_handler, | |
4641 | [ | |
4642 | dnl C compiler happily compiles the code even if there is type mismatch | |
4643 | AC_LANG_PUSH(C++) | |
4644 | AC_TRY_COMPILE([#include <signal.h>], | |
4645 | [ | |
4646 | extern void testSigHandler(int); | |
4647 | ||
4648 | struct sigaction sa; | |
4649 | sa.sa_handler = testSigHandler; | |
4650 | ], [ | |
4651 | wx_cv_type_sa_handler=int | |
4652 | ], [ | |
4653 | wx_cv_type_sa_handler=void | |
4654 | ]) | |
4655 | AC_LANG_POP() | |
4656 | ]) | |
4657 | ||
4658 | AC_DEFINE_UNQUOTED(wxTYPE_SA_HANDLER, $wx_cv_type_sa_handler) | |
4659 | fi | |
4660 | fi | |
4661 | ||
4662 | dnl backtrace() and backtrace_symbols() for wxStackWalker | |
4663 | if test "$wxUSE_STACKWALKER" = "yes" -a "$wxUSE_UNIX" = "yes"; then | |
4664 | AC_CACHE_CHECK([for backtrace() in <execinfo.h>], wx_cv_func_backtrace, | |
4665 | [ | |
4666 | AC_LANG_PUSH(C++) | |
4667 | AC_TRY_COMPILE([#include <execinfo.h>], | |
4668 | [ | |
4669 | void *trace[1]; | |
4670 | char **messages; | |
4671 | ||
4672 | backtrace(trace, 1); | |
4673 | messages = backtrace_symbols(trace, 1); | |
4674 | ], | |
4675 | wx_cv_func_backtrace=yes, | |
4676 | wx_cv_func_backtrace=no | |
4677 | ) | |
4678 | AC_LANG_POP() | |
4679 | ] | |
4680 | ) | |
4681 | ||
4682 | ||
4683 | if test "$wx_cv_func_backtrace" = "no"; then | |
4684 | AC_MSG_WARN([backtrace() is not available, wxStackWalker will not be available]) | |
4685 | wxUSE_STACKWALKER=no | |
4686 | else | |
4687 | AC_CACHE_CHECK([for __cxa_demangle() in <cxxabi.h>], wx_cv_func_cxa_demangle, | |
4688 | [ | |
4689 | AC_LANG_PUSH(C++) | |
4690 | AC_TRY_LINK([#include <cxxabi.h>], | |
4691 | [ | |
4692 | int rc; | |
4693 | __cxxabiv1::__cxa_demangle("foo", 0, 0, &rc); | |
4694 | ], | |
4695 | wx_cv_func_cxa_demangle=yes, | |
4696 | wx_cv_func_cxa_demangle=no | |
4697 | ) | |
4698 | AC_LANG_POP() | |
4699 | ] | |
4700 | ) | |
4701 | ||
4702 | if test "$wx_cv_func_cxa_demangle" = "yes"; then | |
4703 | AC_DEFINE(HAVE_CXA_DEMANGLE) | |
4704 | fi | |
4705 | fi | |
4706 | fi | |
4707 | ||
4708 | if test "$wxUSE_STACKWALKER" = "yes" -a "$USE_WIN32" != "1" -a "$USE_UNIX" != "1"; then | |
4709 | AC_MSG_WARN([wxStackWalker is only available on Win32 and UNIX... disabled]) | |
4710 | wxUSE_STACKWALKER=no | |
4711 | fi | |
4712 | ||
4713 | ||
4714 | dnl check for the function for temp files creation | |
4715 | AC_CHECK_FUNCS(mkstemp mktemp, break) | |
4716 | ||
4717 | dnl get the library function to use for wxGetDiskSpace(): it is statfs() under | |
4718 | dnl Linux and *BSD and statvfs() under Solaris | |
4719 | AC_CACHE_CHECK(for statfs, wx_cv_func_statfs, | |
4720 | AC_TRY_COMPILE( | |
4721 | [ | |
4722 | #if defined(__BSD__) | |
4723 | #include <sys/param.h> | |
4724 | #include <sys/mount.h> | |
4725 | #else | |
4726 | #include <sys/vfs.h> | |
4727 | #endif | |
4728 | ], | |
4729 | [ | |
4730 | long l; | |
4731 | struct statfs fs; | |
4732 | statfs("/", &fs); | |
4733 | l = fs.f_bsize; | |
4734 | l += fs.f_blocks; | |
4735 | l += fs.f_bavail; | |
4736 | ], | |
4737 | wx_cv_func_statfs=yes, | |
4738 | wx_cv_func_statfs=no | |
4739 | ) | |
4740 | ) | |
4741 | ||
4742 | if test "$wx_cv_func_statfs" = "yes"; then | |
4743 | dnl check whether we have its dcelaration too: some systems (AIX 4) lack it | |
4744 | AC_CACHE_CHECK(for statfs declaration, wx_cv_func_statfs_decl, | |
4745 | AC_LANG_PUSH(C++) | |
4746 | AC_TRY_COMPILE( | |
4747 | [ | |
4748 | #if defined(__BSD__) | |
4749 | #include <sys/param.h> | |
4750 | #include <sys/mount.h> | |
4751 | #else | |
4752 | #include <sys/vfs.h> | |
4753 | #endif | |
4754 | ], | |
4755 | [ | |
4756 | struct statfs fs; | |
4757 | statfs("", &fs); | |
4758 | ], | |
4759 | wx_cv_func_statfs_decl=yes, | |
4760 | wx_cv_func_statfs_decl=no | |
4761 | ) | |
4762 | AC_LANG_POP() | |
4763 | ) | |
4764 | ||
4765 | if test "$wx_cv_func_statfs_decl" = "yes"; then | |
4766 | AC_DEFINE(HAVE_STATFS_DECL) | |
4767 | fi | |
4768 | ||
4769 | wx_cv_type_statvfs_t="struct statfs" | |
4770 | AC_DEFINE(HAVE_STATFS) | |
4771 | else | |
4772 | AC_CACHE_CHECK(for statvfs, wx_cv_func_statvfs, | |
4773 | AC_TRY_COMPILE( | |
4774 | [ | |
4775 | #include <stddef.h> | |
4776 | #include <sys/statvfs.h> | |
4777 | ], | |
4778 | [ | |
4779 | statvfs("/", NULL); | |
4780 | ], | |
4781 | wx_cv_func_statvfs=yes, | |
4782 | wx_cv_func_statvfs=no | |
4783 | ) | |
4784 | ) | |
4785 | ||
4786 | if test "$wx_cv_func_statvfs" = "yes"; then | |
4787 | dnl we also have to check whether we should use statvfs_t (works under | |
4788 | dnl Solaris 8, doesn't work under Solaris 7) or "struct statvfs" (vice | |
4789 | dnl versa) as the argument for statvfs in 64 bit off_t mode (in 32 bit | |
4790 | dnl mode both work fine) | |
4791 | dnl | |
4792 | dnl for this check C++ compiler has to be used as passing incompatible | |
4793 | dnl pointers is just a warning and not an error in C | |
4794 | AC_CACHE_CHECK(for statvfs argument type, wx_cv_type_statvfs_t, | |
4795 | AC_LANG_PUSH(C++) | |
4796 | AC_TRY_COMPILE( | |
4797 | [ | |
4798 | #include <sys/statvfs.h> | |
4799 | ], | |
4800 | [ | |
4801 | long l; | |
4802 | statvfs_t fs; | |
4803 | statvfs("/", &fs); | |
4804 | l = fs.f_bsize; | |
4805 | l += fs.f_blocks; | |
4806 | l += fs.f_bavail; | |
4807 | ], | |
4808 | wx_cv_type_statvfs_t=statvfs_t, | |
4809 | [ | |
4810 | AC_TRY_COMPILE( | |
4811 | [ | |
4812 | #include <sys/statvfs.h> | |
4813 | ], | |
4814 | [ | |
4815 | long l; | |
4816 | struct statvfs fs; | |
4817 | statvfs("/", &fs); | |
4818 | l = fs.f_bsize; | |
4819 | l += fs.f_blocks; | |
4820 | l += fs.f_bavail; | |
4821 | ], | |
4822 | wx_cv_type_statvfs_t="struct statvfs", | |
4823 | wx_cv_type_statvfs_t="unknown" | |
4824 | ) | |
4825 | ] | |
4826 | ) | |
4827 | AC_LANG_POP() | |
4828 | ) | |
4829 | ||
4830 | if test "$wx_cv_type_statvfs_t" != "unknown"; then | |
4831 | AC_DEFINE(HAVE_STATVFS) | |
4832 | fi | |
4833 | else | |
4834 | dnl set it for the test below | |
4835 | wx_cv_type_statvfs_t="unknown" | |
4836 | fi | |
4837 | fi | |
4838 | ||
4839 | if test "$wx_cv_type_statvfs_t" != "unknown"; then | |
4840 | AC_DEFINE_UNQUOTED(WX_STATFS_T, $wx_cv_type_statvfs_t) | |
4841 | else | |
4842 | AC_MSG_WARN([wxGetDiskSpace() function won't work without statfs()]) | |
4843 | fi | |
4844 | ||
4845 | dnl check for fcntl() or at least flock() needed by Unix implementation of | |
4846 | dnl wxSingleInstanceChecker | |
4847 | if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then | |
4848 | AC_CHECK_FUNCS(fcntl flock, break) | |
4849 | ||
4850 | if test "$ac_cv_func_fcntl" != "yes" -a "$ac_cv_func_flock" != "yes"; then | |
4851 | AC_MSG_WARN(wxSingleInstanceChecker not available) | |
4852 | wxUSE_SNGLINST_CHECKER=no | |
4853 | fi | |
4854 | fi | |
4855 | ||
4856 | dnl check for timegm() used by datetime.cpp | |
4857 | AC_CHECK_FUNCS(timegm) | |
4858 | ||
4859 | dnl look for a function to modify the environment | |
4860 | AC_CHECK_FUNCS(putenv setenv, break) | |
4861 | ||
4862 | HAVE_SOME_SLEEP_FUNC=0 | |
4863 | if test "$USE_BEOS" = 1; then | |
4864 | dnl BeOS has its own (wonder where did they get it from) sleep() function | |
4865 | dnl in unistd.h | |
4866 | AC_DEFINE(HAVE_SLEEP) | |
4867 | HAVE_SOME_SLEEP_FUNC=1 | |
4868 | fi | |
4869 | ||
4870 | if test "$USE_DARWIN" = 1; then | |
4871 | dnl Mac OS X/Darwin has both nanosleep and usleep | |
4872 | dnl but only usleep is defined in unistd.h | |
4873 | AC_DEFINE(HAVE_USLEEP) | |
4874 | HAVE_SOME_SLEEP_FUNC=1 | |
4875 | fi | |
4876 | ||
4877 | if test "$HAVE_SOME_SLEEP_FUNC" != 1; then | |
4878 | dnl try nanosleep() in libc and libposix4, if this fails - usleep() | |
4879 | POSIX4_LINK= | |
4880 | AC_CHECK_FUNCS(nanosleep, | |
4881 | AC_DEFINE(HAVE_NANOSLEEP), | |
4882 | [ | |
4883 | AC_CHECK_LIB(posix4, nanosleep, | |
4884 | [ | |
4885 | AC_DEFINE(HAVE_NANOSLEEP) | |
4886 | POSIX4_LINK=" -lposix4" | |
4887 | ], | |
4888 | [ | |
4889 | WX_CHECK_FUNCS(usleep,, | |
4890 | AC_MSG_WARN([wxSleep() function will not work]) | |
4891 | ) | |
4892 | ] | |
4893 | ) | |
4894 | ] | |
4895 | ) | |
4896 | fi | |
4897 | ||
4898 | dnl check for uname (POSIX) and gethostname (BSD) | |
4899 | WX_CHECK_FUNCS(uname,,,[#include <sys/utsname.h>]) | |
4900 | if test "$wx_cv_func_uname" != yes; then | |
4901 | WX_CHECK_FUNCS(gethostname) | |
4902 | fi | |
4903 | ||
4904 | WX_CHECK_FUNCS(strtok_r, [], [], [#define _REENTRANT]) | |
4905 | ||
4906 | dnl check for inet_addr and inet_aton (these may live either in libc, or in | |
4907 | dnl libnsl or libresolv or libsocket) | |
4908 | INET_LINK= | |
4909 | AC_CHECK_FUNCS(inet_addr, | |
4910 | AC_DEFINE(HAVE_INET_ADDR), | |
4911 | [ | |
4912 | AC_CHECK_LIB(nsl, inet_addr, | |
4913 | INET_LINK="nsl", | |
4914 | [ | |
4915 | AC_CHECK_LIB(resolv, inet_addr, | |
4916 | INET_LINK="resolv", | |
4917 | [ | |
4918 | AC_CHECK_LIB(socket, inet_addr, | |
4919 | INET_LINK="socket" | |
4920 | ) | |
4921 | ] | |
4922 | ) | |
4923 | ] | |
4924 | ) | |
4925 | ] | |
4926 | ) | |
4927 | ||
4928 | AC_CHECK_FUNCS(inet_aton, | |
4929 | AC_DEFINE(HAVE_INET_ATON), | |
4930 | [ | |
4931 | dnl only check it in the same lib | |
4932 | AC_CHECK_LIB($INET_LINK, inet_aton, AC_DEFINE(HAVE_INET_ATON)) | |
4933 | ]) | |
4934 | ||
4935 | if test "x$INET_LINK" != "x"; then | |
4936 | AC_DEFINE(HAVE_INET_ADDR) | |
4937 | INET_LINK=" -l$INET_LINK" | |
4938 | fi | |
4939 | ||
4940 | WX_CHECK_FUNCS(fdopen) | |
4941 | ||
4942 | fi | |
4943 | ||
4944 | dnl if !MSW | |
4945 | ||
4946 | ||
4947 | dnl ------------------------------------------ | |
4948 | dnl Checks specific to contrib libs (MMedia) | |
4949 | dnl ------------------------------------------ | |
4950 | ||
4951 | dnl Check for ESD: | |
4952 | EXTRALIBS_ESD= | |
4953 | AC_CHECK_LIB(esd, esd_close, [ | |
4954 | AC_CHECK_HEADERS([esd.h], [ | |
4955 | EXTRALIBS_ESD="-lesd" | |
4956 | ]) | |
4957 | ]) | |
4958 | AC_SUBST(EXTRALIBS_ESD) | |
4959 | ||
4960 | dnl check for known CD-ROM interface | |
4961 | AC_MSG_CHECKING([for known CD-ROM interface]) | |
4962 | AC_TRY_COMPILE([#ifdef __linux__ | |
4963 | #include <linux/cdrom.h> | |
4964 | #else | |
4965 | /* For Solaris */ | |
4966 | #include <sys/cdio.h> | |
4967 | #endif | |
4968 | ], | |
4969 | [struct cdrom_tocentry entry, old_entry;], | |
4970 | [AC_MSG_RESULT([yes]) | |
4971 | AC_DEFINE(HAVE_KNOWN_CDROM_INTERFACE)], | |
4972 | [AC_MSG_RESULT([no])]) | |
4973 | ||
4974 | dnl =========================================================================== | |
4975 | dnl Now we have all the info we need - use it! | |
4976 | dnl =========================================================================== | |
4977 | ||
4978 | dnl flush the cache | |
4979 | AC_CACHE_SAVE | |
4980 | ||
4981 | dnl --------------------------------------------------------------------------- | |
4982 | dnl thread support for Unix (for Win32 and OS/2 see past | |
4983 | dnl the next matching "else") | |
4984 | dnl --------------------------------------------------------------------------- | |
4985 | ||
4986 | dnl under MSW (except mingw32) we always have thread support | |
4987 | if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then | |
4988 | ||
4989 | dnl the code below: | |
4990 | dnl | |
4991 | dnl defines THREADS_LINK and THREADS_CFLAGS which are the options | |
4992 | dnl necessary to build the MT programs for the linker and compiler | |
4993 | dnl respectively | |
4994 | dnl | |
4995 | dnl sets wxUSE_THREADS=1 if thread support is activated | |
4996 | ||
4997 | THREADS_LINK= | |
4998 | THREADS_CFLAGS= | |
4999 | ||
5000 | if test "$wxUSE_THREADS" = "yes" ; then | |
5001 | if test "$USE_BEOS" = 1; then | |
5002 | AC_MSG_WARN([BeOS threads are not yet supported... disabled]) | |
5003 | wxUSE_THREADS="no" | |
5004 | fi | |
5005 | fi | |
5006 | ||
5007 | if test "$wxUSE_THREADS" = "yes" ; then | |
5008 | dnl find if POSIX threads are available | |
5009 | dnl | |
5010 | dnl the tests here are based on ACX_PTHREAD macro from autoconf macro | |
5011 | dnl archive from http://ac-archive.sourceforge.net/ | |
5012 | dnl | |
5013 | dnl thanks to Steven G. Johnson <stevenj@alum.mit.edu> and Alejandro | |
5014 | dnl Forero Cuervo <bachue@bachue.com> for the original code | |
5015 | ||
5016 | dnl TODO: cache the result | |
5017 | ||
5018 | dnl define the list of the thread options to try in the loop below | |
5019 | dnl with the convention that anything starting with '-' is a cpp flag | |
5020 | dnl while anything else is a library (i.e. there is an implicit "-l") | |
5021 | THREAD_OPTS="-pthread" | |
5022 | case "${host}" in | |
5023 | *-*-solaris2* | *-*-sunos4* ) | |
5024 | if test "x$GCC" = "xyes"; then | |
5025 | dnl Solaris/gcc combination use this one for some reason | |
5026 | THREAD_OPTS="-pthreads $THREAD_OPTS" | |
5027 | else | |
5028 | THREAD_OPTS="-mt $THREAD_OPTS" | |
5029 | fi | |
5030 | ;; | |
5031 | *-*-freebsd*) | |
5032 | dnl look, in order, for the kernel threads, then Linux threads | |
5033 | dnl and finally the userland threads | |
5034 | THREAD_OPTS="-kthread lthread $THREAD_OPTS c_r" | |
5035 | ;; | |
5036 | *-*-darwin* | *-*-cygwin* ) | |
5037 | dnl Darwin / Mac OS X just uses -lpthread tested below | |
5038 | dnl and so does Cygwin | |
5039 | THREAD_OPTS="" | |
5040 | ;; | |
5041 | *-*-aix*) | |
5042 | dnl AIX calls the library libpthreads - thanks IBM! | |
5043 | THREAD_OPTS="pthreads" | |
5044 | ;; | |
5045 | *-hp-hpux* ) | |
5046 | if test "x$GCC" = "xyes"; then | |
5047 | dnl g++ versions before 3.3.2 don't support -pthread. | |
5048 | $CXX -dumpspecs | grep 'pthread:' >/dev/null || | |
5049 | THREAD_OPTS="" | |
5050 | else | |
5051 | dnl HP-UX aCC (tested with version B3910B A.06.05 [Jul 25 | |
5052 | dnl 2005]) supports -mt | |
5053 | THREAD_OPTS="-mt" | |
5054 | fi | |
5055 | ;; | |
5056 | ||
5057 | *-*-irix* ) | |
5058 | dnl gcc under IRIX doesn't seem to like -pthread, but it | |
5059 | dnl doesn't give an error for it neither, just a warning | |
5060 | dnl message -- but this is still very annoying | |
5061 | if test "x$GCC" = "xyes"; then | |
5062 | THREAD_OPTS="" | |
5063 | fi | |
5064 | ;; | |
5065 | ||
5066 | *-*-*UnixWare*) | |
5067 | dnl flying by man pages here: Caldera online docs use this | |
5068 | if test "x$GCC" != "xyes"; then | |
5069 | THREAD_OPTS="-Ethread" | |
5070 | fi | |
5071 | ;; | |
5072 | esac | |
5073 | ||
5074 | dnl simply linking with libpthread should make the test below work but | |
5075 | dnl it's far from certain that the threaded programs compiled without | |
5076 | dnl any special switches actually work, so try it after all the others | |
5077 | THREAD_OPTS="$THREAD_OPTS pthread none" | |
5078 | ||
5079 | dnl now test for all possibilities | |
5080 | THREADS_OK=no | |
5081 | for flag in $THREAD_OPTS; do | |
5082 | case $flag in | |
5083 | none) | |
5084 | AC_MSG_CHECKING([whether pthreads work without any flags]) | |
5085 | ;; | |
5086 | ||
5087 | -*) | |
5088 | AC_MSG_CHECKING([whether pthreads work with $flag]) | |
5089 | THREADS_CFLAGS="$flag" | |
5090 | ;; | |
5091 | ||
5092 | *) | |
5093 | AC_MSG_CHECKING([for the pthreads library -l$flag]) | |
5094 | THREADS_LINK="-l$flag" | |
5095 | ;; | |
5096 | esac | |
5097 | ||
5098 | save_LIBS="$LIBS" | |
5099 | save_CFLAGS="$CFLAGS" | |
5100 | LIBS="$THREADS_LINK $LIBS" | |
5101 | CFLAGS="$THREADS_CFLAGS $CFLAGS" | |
5102 | ||
5103 | AC_TRY_LINK([#include <pthread.h>], | |
5104 | [pthread_create(0,0,0,0);], | |
5105 | THREADS_OK=yes) | |
5106 | ||
5107 | LIBS="$save_LIBS" | |
5108 | CFLAGS="$save_CFLAGS" | |
5109 | ||
5110 | AC_MSG_RESULT($THREADS_OK) | |
5111 | if test "x$THREADS_OK" = "xyes"; then | |
5112 | break; | |
5113 | fi | |
5114 | ||
5115 | THREADS_LINK="" | |
5116 | THREADS_CFLAGS="" | |
5117 | done | |
5118 | ||
5119 | if test "x$THREADS_OK" != "xyes"; then | |
5120 | wxUSE_THREADS=no | |
5121 | AC_MSG_WARN([No thread support on this system... disabled]) | |
5122 | else | |
5123 | dnl yes, these special compiler flags should be used with the | |
5124 | dnl linker as well | |
5125 | LDFLAGS="$THREADS_CFLAGS $LDFLAGS" | |
5126 | LIBS="$THREADS_LINK $LIBS" | |
5127 | ||
5128 | AC_MSG_CHECKING([if more special flags are required for pthreads]) | |
5129 | flag=no | |
5130 | case "${host}" in | |
5131 | *-aix*) | |
5132 | dnl again quoting from | |
5133 | dnl http://www-1.ibm.com/servers/esdd/articles/gnu.html: | |
5134 | dnl | |
5135 | dnl When compiling and linking with -pthread, the library | |
5136 | dnl search path should include -L/usr/lib/threads at the | |
5137 | dnl beginning of the path. | |
5138 | LDFLAGS="-L/usr/lib/threads $LDFLAGS" | |
5139 | flag="-D_THREAD_SAFE" | |
5140 | ;; | |
5141 | *-freebsd*) | |
5142 | flag="-D_THREAD_SAFE" | |
5143 | ;; | |
5144 | *-hp-hpux* ) | |
5145 | flag="-D_REENTRANT" | |
5146 | if test "x$GCC" != "xyes"; then | |
5147 | dnl see http://docs.hp.com/hpux/onlinedocs/2213/threads.htm | |
5148 | flag="$flag -D_RWSTD_MULTI_THREAD" | |
5149 | fi | |
5150 | ;; | |
5151 | *solaris* | alpha*-osf*) | |
5152 | flag="-D_REENTRANT" | |
5153 | ;; | |
5154 | esac | |
5155 | AC_MSG_RESULT(${flag}) | |
5156 | if test "x$flag" != xno; then | |
5157 | THREADS_CFLAGS="$THREADS_CFLAGS $flag" | |
5158 | fi | |
5159 | ||
5160 | dnl don't add these options to CPPFLAGS as cpp might not know them | |
5161 | WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS $THREADS_CFLAGS" | |
5162 | fi | |
5163 | fi | |
5164 | ||
5165 | dnl do other tests only if we are using threads | |
5166 | if test "$wxUSE_THREADS" = "yes" ; then | |
5167 | AC_CHECK_FUNCS(thr_setconcurrency) | |
5168 | ||
5169 | dnl can't use AC_CHECK_FUNCS for this one as it's usually a macro and so | |
5170 | dnl wouldn't be found by it | |
5171 | AC_CACHE_CHECK([for pthread_cleanup_push/pop], wx_cv_func_pthread_cleanup, | |
5172 | [ | |
5173 | AC_TRY_COMPILE([#include <pthread.h> | |
5174 | void ThreadCleanupFunc(void *p); | |
5175 | ], | |
5176 | [ | |
5177 | void *p; | |
5178 | pthread_cleanup_push(ThreadCleanupFunc, p); | |
5179 | pthread_cleanup_pop(0); | |
5180 | ], [ | |
5181 | wx_cv_func_pthread_cleanup=yes | |
5182 | ], [ | |
5183 | wx_cv_func_pthread_cleanup=no | |
5184 | ] | |
5185 | ) | |
5186 | ]) | |
5187 | if test "x$wx_cv_func_pthread_cleanup" = "xyes"; then | |
5188 | AC_DEFINE(wxHAVE_PTHREAD_CLEANUP) | |
5189 | fi | |
5190 | ||
5191 | AC_CHECK_HEADERS(sched.h) | |
5192 | if test "$ac_cv_header_sched_h" = "yes"; then | |
5193 | AC_CHECK_FUNC(sched_yield, | |
5194 | AC_DEFINE(HAVE_SCHED_YIELD), | |
5195 | [ | |
5196 | AC_CHECK_LIB(posix4, | |
5197 | sched_yield, | |
5198 | [AC_DEFINE(HAVE_SCHED_YIELD) POSIX4_LINK=" -lposix4"], | |
5199 | AC_MSG_WARN(wxThread::Yield will not work properly) | |
5200 | ) | |
5201 | ] | |
5202 | ) | |
5203 | fi | |
5204 | ||
5205 | dnl to be able to set the thread priority, we need to have all of the | |
5206 | dnl following functions: | |
5207 | dnl 1. pthread_attr_getschedpolicy | |
5208 | dnl 2. sched_get_priority_min and sched_get_priority_max | |
5209 | dnl (this one can be in either libpthread or libposix4 (under Solaris)) | |
5210 | dnl 3. pthread_attr_getschedparam and pthread_attr_setschedparam | |
5211 | HAVE_PRIOR_FUNCS=0 | |
5212 | AC_CHECK_FUNC(pthread_attr_getschedpolicy, | |
5213 | [AC_CHECK_FUNC(pthread_attr_setschedparam, | |
5214 | [AC_CHECK_FUNC(sched_get_priority_max, | |
5215 | HAVE_PRIOR_FUNCS=1, | |
5216 | [AC_CHECK_LIB([posix4], sched_get_priority_max, | |
5217 | [ | |
5218 | HAVE_PRIOR_FUNCS=1 | |
5219 | POSIX4_LINK=" -lposix4" | |
5220 | ], | |
5221 | )] | |
5222 | )] | |
5223 | )] | |
5224 | ) | |
5225 | ||
5226 | if test "$HAVE_PRIOR_FUNCS" = 1; then | |
5227 | AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS) | |
5228 | else | |
5229 | AC_MSG_WARN(Setting thread priority will not work) | |
5230 | fi | |
5231 | ||
5232 | AC_CHECK_FUNC(pthread_cancel, | |
5233 | AC_DEFINE(HAVE_PTHREAD_CANCEL), | |
5234 | AC_MSG_WARN([wxThread::Kill() will not work properly])) | |
5235 | ||
5236 | AC_CHECK_FUNC(pthread_attr_setstacksize, | |
5237 | AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE)) | |
5238 | ||
5239 | dnl mutexattr_t initialization is done in quite different ways on different | |
5240 | dnl platforms, so check for a few things: | |
5241 | dnl | |
5242 | dnl HAVE_MUTEX_RECURSIVE means that we can create recursive mutexes | |
5243 | dnl HAVE_MUTEXATTR_SETTYPE means that we do it using | |
5244 | dnl pthread_mutexattr_settype(PTHREAD_MUTEX_RECURSIVE) and if it is not | |
5245 | dnl defined, we do it by directly assigned | |
5246 | dnl PTHREAD_MUTEX_RECURSIVE_MUTEX_INITIALIZER_NP to attr | |
5247 | ||
5248 | AC_CACHE_CHECK([for pthread_mutexattr_t], wx_cv_type_pthread_mutexattr_t, | |
5249 | [ | |
5250 | AC_TRY_COMPILE([#include <pthread.h>], | |
5251 | [ | |
5252 | pthread_mutexattr_t attr; | |
5253 | pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); | |
5254 | ], | |
5255 | wx_cv_type_pthread_mutexattr_t=yes, | |
5256 | wx_cv_type_pthread_mutexattr_t=no | |
5257 | ) | |
5258 | ]) | |
5259 | ||
5260 | if test "$wx_cv_type_pthread_mutexattr_t" = "yes"; then | |
5261 | AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_T) | |
5262 | ||
5263 | dnl check if we already have the declaration we need, it is not | |
5264 | dnl present in some systems' headers | |
5265 | AC_CACHE_CHECK([for pthread_mutexattr_settype declaration], | |
5266 | wx_cv_func_pthread_mutexattr_settype_decl, [ | |
5267 | AC_TRY_COMPILE([#include <pthread.h>], | |
5268 | [ | |
5269 | pthread_mutexattr_t attr; | |
5270 | pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); | |
5271 | ], | |
5272 | wx_cv_func_pthread_mutexattr_settype_decl=yes, | |
5273 | wx_cv_func_pthread_mutexattr_settype_decl=no | |
5274 | ) | |
5275 | ]) | |
5276 | if test "$wx_cv_func_pthread_mutexattr_settype_decl" = "yes"; then | |
5277 | AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_SETTYPE_DECL) | |
5278 | fi | |
5279 | else | |
5280 | dnl don't despair, there may be another way to do it | |
5281 | AC_CACHE_CHECK([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER], | |
5282 | wx_cv_type_pthread_rec_mutex_init, | |
5283 | [ | |
5284 | AC_TRY_COMPILE([#include <pthread.h>], | |
5285 | [ | |
5286 | pthread_mutex_t attr = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; | |
5287 | ], [ | |
5288 | wx_cv_type_pthread_rec_mutex_init=yes | |
5289 | ], [ | |
5290 | wx_cv_type_pthread_rec_mutex_init=no | |
5291 | ] | |
5292 | ) | |
5293 | ]) | |
5294 | if test "$wx_cv_type_pthread_rec_mutex_init" = "yes"; then | |
5295 | AC_DEFINE(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER) | |
5296 | else | |
5297 | dnl this may break code working elsewhere, so at least warn about it | |
5298 | AC_MSG_WARN([wxMutex won't be recursive on this platform]) | |
5299 | fi | |
5300 | fi | |
5301 | fi | |
5302 | ||
5303 | dnl from if !MSW | |
5304 | else | |
5305 | if test "$wxUSE_THREADS" = "yes" ; then | |
5306 | case "${host}" in | |
5307 | *-*-mingw32* ) | |
5308 | dnl check if the compiler accepts -mthreads | |
5309 | AC_CACHE_CHECK([if compiler supports -mthreads], | |
5310 | wx_cv_cflags_mthread, | |
5311 | [ | |
5312 | CFLAGS_OLD="$CFLAGS" | |
5313 | CFLAGS="-mthreads $CFLAGS" | |
5314 | AC_TRY_COMPILE([], [], | |
5315 | wx_cv_cflags_mthread=yes, | |
5316 | wx_cv_cflags_mthread=no | |
5317 | ) | |
5318 | ] | |
5319 | ) | |
5320 | ||
5321 | if test "$wx_cv_cflags_mthread" = "yes"; then | |
5322 | dnl it does, use it | |
5323 | WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -mthreads" | |
5324 | LDFLAGS="$LDFLAGS -mthreads" | |
5325 | else | |
5326 | dnl it doesn't | |
5327 | CFLAGS="$CFLAGS_OLD" | |
5328 | fi | |
5329 | ;; | |
5330 | *-pc-os2*emx ) | |
5331 | WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -Zmt -D__ST_MT_ERRNO__" | |
5332 | LDFLAGS="$LDFLAGS -Zmt" | |
5333 | ;; | |
5334 | esac | |
5335 | fi | |
5336 | fi | |
5337 | ||
5338 | AC_CHECK_FUNC(localtime_r, [ AC_DEFINE(HAVE_LOCALTIME_R) ]) | |
5339 | AC_CHECK_FUNC(gmtime_r, [ AC_DEFINE(HAVE_GMTIME_R) ]) | |
5340 | AC_CHECK_FUNC(readdir_r, [ AC_DEFINE(HAVE_READDIR_R) ]) | |
5341 | dnl By preference, we probably should use getaddrinfo which avoids thread | |
5342 | dnl safety issues and supports IPv6, however there currently is no code | |
5343 | dnl for it, so testing for it is temporarily disabled and we are restricted | |
5344 | dnl to gethostbyname_r/gethostbyaddr_r and getservbyname_r | |
5345 | ||
5346 | dnl AC_CHECK_FUNC(getaddrinfo, AC_DEFINE(HAVE_GETADDRINFO), [ | |
5347 | dnl no getaddrinfo, so check for gethostbyname_r and | |
5348 | dnl related functions (taken from python's configure.in) | |
5349 | dnl sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments | |
5350 | AX_FUNC_WHICH_GETHOSTBYNAME_R | |
5351 | if test "x$ac_cv_func_which_gethostbyname_r" = "xno" -o \ | |
5352 | "x$ac_cv_func_which_gethostbyname_r" = "xunknown" ; then | |
5353 | AC_CHECK_FUNC(gethostbyname, [ AC_DEFINE(HAVE_GETHOSTBYNAME) ]) | |
5354 | fi | |
5355 | dnl A similar test for getservbyname_r | |
5356 | dnl I'm tempted to just not do this test which is taking much time and | |
5357 | dnl do something similar as for gethostbyaddr_r, but OTOH the macro | |
5358 | dnl doing the test already exists, so using it is easy enough. - SN | |
5359 | AC_raf_FUNC_WHICH_GETSERVBYNAME_R | |
5360 | if test "x$ac_cv_func_which_getservbyname_r" = "xno" -o \ | |
5361 | "x$ac_cv_func_which_getservbyname_r" = "xunknown" ; then | |
5362 | AC_CHECK_FUNCS(getservbyname,[ AC_DEFINE(HAVE_GETSERVBYNAME) ]) | |
5363 | fi | |
5364 | dnl For gethostbyaddr_r, we currently do no separate test, instead, we | |
5365 | dnl silently assume it's available exactly if gethostbyname_r is | |
5366 | dnl available and always requires two more arguments than | |
5367 | dnl gethostbyname_r. | |
5368 | dnl (also, I'm lazy and there no m4 file that's ready for use for this | |
5369 | dnl function, although it should be easy to rewrite the gethostbyname_r | |
5370 | dnl check to fit this case, if it's really needed. - SN ) | |
5371 | dnl ] | |
5372 | dnl ) | |
5373 | ||
5374 | if test "$wxUSE_THREADS" = "yes"; then | |
5375 | AC_DEFINE(wxUSE_THREADS) | |
5376 | ||
5377 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread" | |
5378 | else | |
5379 | dnl on some systems, _REENTRANT should be defined if we want to use any _r() | |
5380 | dnl functions - add tests for other functions here as well | |
5381 | if test "$wx_cv_func_strtok_r" = "yes"; then | |
5382 | AC_MSG_CHECKING(if -D_REENTRANT is needed) | |
5383 | if test "$NEEDS_D_REENTRANT_FOR_R_FUNCS" = 1; then | |
5384 | WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_REENTRANT" | |
5385 | AC_MSG_RESULT(yes) | |
5386 | else | |
5387 | AC_MSG_RESULT(no) | |
5388 | fi | |
5389 | fi | |
5390 | fi | |
5391 | ||
5392 | if test "$WXGTK20" = 1 ; then | |
5393 | AC_DEFINE_UNQUOTED(__WXGTK20__,$WXGTK20) | |
5394 | WXGTK12=1 | |
5395 | fi | |
5396 | ||
5397 | if test "$WXGTK12" = 1 ; then | |
5398 | AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12) | |
5399 | fi | |
5400 | ||
5401 | if test "$WXGTK127" = 1 ; then | |
5402 | AC_DEFINE_UNQUOTED(__WXGTK127__,$WXGTK127) | |
5403 | fi | |
5404 | ||
5405 | if test "$WXGPE" = 1 ; then | |
5406 | AC_DEFINE_UNQUOTED(__WXGPE__,$WXGPE) | |
5407 | fi | |
5408 | ||
5409 | dnl DEBUG_CFLAGS contains debugging options (supposed to be the same for C and C++ | |
5410 | dnl compilers: we'd need a separate DEBUG_CXXFLAGS if this is ever not the case) | |
5411 | DEBUG_CFLAGS= | |
5412 | if test "$wxUSE_DEBUG_INFO" = "yes" ; then | |
5413 | DEBUG_CFLAGS="-g" | |
5414 | wxUSE_OPTIMISE=no | |
5415 | fi | |
5416 | ||
5417 | if test "$wxUSE_DEBUG_GDB" = "yes" ; then | |
5418 | wxUSE_DEBUG_INFO=yes | |
5419 | if test "$GCC" = yes; then | |
5420 | DEBUG_CFLAGS="-ggdb" | |
5421 | fi | |
5422 | fi | |
5423 | ||
5424 | if test "$wxUSE_DEBUG_FLAG" = "yes" ; then | |
5425 | AC_DEFINE(WXDEBUG) | |
5426 | WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D__WXDEBUG__" | |
5427 | else | |
5428 | if test "$wxUSE_GTK" = 1 ; then | |
5429 | if test "x$wxGTK_VERSION" = "x1" ; then | |
5430 | CPPFLAGS="-DGTK_NO_CHECK_CASTS $CPPFLAGS" | |
5431 | fi | |
5432 | fi | |
5433 | fi | |
5434 | ||
5435 | if test "$wxUSE_MEM_TRACING" = "yes" ; then | |
5436 | AC_DEFINE(wxUSE_MEMORY_TRACING) | |
5437 | AC_DEFINE(wxUSE_GLOBAL_MEMORY_OPERATORS) | |
5438 | AC_DEFINE(wxUSE_DEBUG_NEW_ALWAYS) | |
5439 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS memcheck" | |
5440 | fi | |
5441 | ||
5442 | if test "$wxUSE_DMALLOC" = "yes" ; then | |
5443 | DMALLOC_LIBS="-ldmallocthcxx" | |
5444 | fi | |
5445 | ||
5446 | dnl cc/cxx/ld option for profiling | |
5447 | PROFILE_FLAGS= | |
5448 | if test "$wxUSE_PROFILE" = "yes" ; then | |
5449 | PROFILE_FLAGS=" -pg" | |
5450 | fi | |
5451 | ||
5452 | if test "$GCC" = "yes" ; then | |
5453 | if test "$wxUSE_NO_RTTI" = "yes" ; then | |
5454 | WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-rtti" | |
5455 | fi | |
5456 | if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then | |
5457 | WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-exceptions" | |
5458 | fi | |
5459 | if test "$wxUSE_PERMISSIVE" = "yes" ; then | |
5460 | WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -fpermissive" | |
5461 | fi | |
5462 | ||
5463 | dnl Ian Brown <ian.brown@printsoft.de> reports that versions of gcc before | |
5464 | dnl 3.0 overflow the table of contents on rs6000 as they create an entry | |
5465 | dnl for each subroutine by default -- using the switch below only creates | |
5466 | dnl one entry per file instead at the price of minor performance penalty | |
5467 | dnl | |
5468 | dnl As of wx2.4 a bug in the hppa gcc compiler causes a similar problem | |
5469 | dnl without -ffunction-sections. No idea how long we'll need to maintain | |
5470 | dnl this, or even the extent of gcc/wx version combinations affected, but | |
5471 | dnl also as above, this 'fix' does not come without side effects. | |
5472 | dnl | |
5473 | dnl TODO: test for the gcc version here (how?) | |
5474 | case "${host}" in | |
5475 | powerpc*-*-aix* ) | |
5476 | WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -mminimal-toc" | |
5477 | ;; | |
5478 | *-hppa* ) | |
5479 | WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -ffunction-sections" | |
5480 | ;; | |
5481 | esac | |
5482 | fi | |
5483 | ||
5484 | dnl C/C++ compiler option for optimization (supposed to be the same for both) | |
5485 | OPTIMISE_CFLAGS= | |
5486 | if test "$wxUSE_OPTIMISE" = "no" ; then | |
5487 | if test "$GCC" = yes ; then | |
5488 | dnl use -O0 because compiling with it is faster than compiling with no | |
5489 | dnl optimization options at all (at least with g++ 3.2) | |
5490 | OPTIMISE_CFLAGS="-O0" | |
5491 | fi | |
5492 | else | |
5493 | if test "$GCC" = yes ; then | |
5494 | case "${host}" in | |
5495 | *-pc-os2_emx | *-pc-os2-emx ) | |
5496 | dnl Not all of the supported gcc versions understand | |
5497 | dnl -fstrict-aliasing and none actually needs it (yet). | |
5498 | OPTIMISE_CFLAGS="-O2" | |
5499 | ;; | |
5500 | *) | |
5501 | dnl Switch on optimisation but keep strict-aliasing off for | |
5502 | dnl now (see -fstrict-aliasing in the gcc manual). When it is | |
5503 | dnl switched back on consider using -Wstrict-aliasing=2. | |
5504 | OPTIMISE_CFLAGS="-O2 -fno-strict-aliasing" | |
5505 | ;; | |
5506 | esac | |
5507 | else | |
5508 | OPTIMISE_CFLAGS="-O" | |
5509 | fi | |
5510 | fi | |
5511 | ||
5512 | dnl --------------------------------------------------------------------------- | |
5513 | dnl compatibility level | |
5514 | dnl --------------------------------------------------------------------------- | |
5515 | ||
5516 | if test "x$WXWIN_COMPATIBILITY_2_4" = "xyes"; then | |
5517 | AC_DEFINE(WXWIN_COMPATIBILITY_2_4) | |
5518 | ||
5519 | WXWIN_COMPATIBILITY_2_6="yes" | |
5520 | fi | |
5521 | ||
5522 | if test "x$WXWIN_COMPATIBILITY_2_6" != "xno"; then | |
5523 | AC_DEFINE(WXWIN_COMPATIBILITY_2_6) | |
5524 | fi | |
5525 | ||
5526 | dnl --------------------------------------------------------------------------- | |
5527 | dnl the library may be built without GUI classes at all | |
5528 | dnl --------------------------------------------------------------------------- | |
5529 | ||
5530 | if test "$wxUSE_GUI" = "yes"; then | |
5531 | AC_DEFINE(wxUSE_GUI) | |
5532 | ||
5533 | dnl the things we always pull in the GUI version of the library: | |
5534 | dnl 1. basic things like wxApp, wxWindow, wxControl, wxFrame, wxDialog (the | |
5535 | dnl library really can't be built without those) | |
5536 | dnl 2. basic controls: wxButton, wxStaticText, wxTextCtrl (these are used in | |
5537 | dnl almost any program and the first 2 are needed to show a message box | |
5538 | dnl which want to be always able to do) | |
5539 | dnl 3. GDI stuff: icon, cursors and all that. Although it would be very nice | |
5540 | dnl to compile without them (if the app doesn't do any drawing, it doesn't | |
5541 | dnl need the dcs, pens, brushes, ...), this just can't be done now | |
5542 | dnl 4. menu stuff: wxMenu, wxMenuBar, wxMenuItem | |
5543 | dnl 5. misc stuff: timers, settings, message box | |
5544 | fi | |
5545 | ||
5546 | dnl --------------------------------------------------------------------------- | |
5547 | dnl Unix/Windows | |
5548 | dnl --------------------------------------------------------------------------- | |
5549 | ||
5550 | if test "$wxUSE_UNIX" = "yes"; then | |
5551 | AC_DEFINE(wxUSE_UNIX) | |
5552 | fi | |
5553 | ||
5554 | dnl ------------------------------------------------------------------------ | |
5555 | dnl DLL support | |
5556 | dnl ------------------------------------------------------------------------ | |
5557 | ||
5558 | dnl under MSW we always have LoadLibrary/GetProcAddress | |
5559 | if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then | |
5560 | ||
5561 | HAVE_DL_FUNCS=0 | |
5562 | HAVE_SHL_FUNCS=0 | |
5563 | if test "$wxUSE_DYNAMIC_LOADER" = "yes" -o "$wxUSE_DYNLIB_CLASS" = "yes" ; then | |
5564 | if test "$USE_DARWIN" = 1; then | |
5565 | dnl dlopen/dlerror is implemented in dynlib.cpp for Darwin/Mac OS X | |
5566 | HAVE_DL_FUNCS=1 | |
5567 | elif test "$USE_DOS" = 1; then | |
5568 | HAVE_DL_FUNCS=0 | |
5569 | else | |
5570 | dnl the test is a bit complicated because we check for dlopen() both with | |
5571 | dnl and without -ldl and we also try to find shl_load() if there is no | |
5572 | dnl dlopen() on this system | |
5573 | AC_CHECK_FUNCS(dlopen, | |
5574 | [ | |
5575 | AC_DEFINE(HAVE_DLOPEN) | |
5576 | HAVE_DL_FUNCS=1 | |
5577 | ], | |
5578 | [ | |
5579 | AC_CHECK_LIB(dl, dlopen, | |
5580 | [ | |
5581 | AC_DEFINE(HAVE_DLOPEN) | |
5582 | HAVE_DL_FUNCS=1 | |
5583 | DL_LINK=" -ldl$DL_LINK" | |
5584 | ], | |
5585 | [ | |
5586 | AC_CHECK_FUNCS(shl_load, | |
5587 | [ | |
5588 | AC_DEFINE(HAVE_SHL_LOAD) | |
5589 | HAVE_SHL_FUNCS=1 | |
5590 | ], | |
5591 | [ | |
5592 | AC_CHECK_LIB(shl_load, dld, | |
5593 | [ | |
5594 | HAVE_SHL_FUNCS=1 | |
5595 | DL_LINK=" -ldld$DL_LINK" | |
5596 | ]) | |
5597 | ]) | |
5598 | ]) | |
5599 | ]) | |
5600 | ||
5601 | dnl check also for dlerror() | |
5602 | if test "$HAVE_DL_FUNCS" = 1; then | |
5603 | AC_CHECK_FUNCS(dlerror, | |
5604 | AC_DEFINE(HAVE_DLERROR), | |
5605 | [ | |
5606 | AC_CHECK_LIB(dl, dlerror, AC_DEFINE(HAVE_DLERROR)) | |
5607 | ] | |
5608 | ) | |
5609 | fi | |
5610 | fi | |
5611 | ||
5612 | if test "$HAVE_DL_FUNCS" = 0; then | |
5613 | if test "$HAVE_SHL_FUNCS" = 0; then | |
5614 | if test "$USE_UNIX" = 1 -o "$USE_DOS" = 1; then | |
5615 | AC_MSG_WARN([Missing dynamic loading support, several features will be disabled]) | |
5616 | wxUSE_DYNAMIC_LOADER=no | |
5617 | wxUSE_DYNLIB_CLASS=no | |
5618 | else | |
5619 | AC_MSG_WARN([Assuming wxLibrary class works on this platform]) | |
5620 | fi | |
5621 | fi | |
5622 | fi | |
5623 | fi | |
5624 | fi | |
5625 | ||
5626 | if test "$wxUSE_DYNAMIC_LOADER" = "yes" ; then | |
5627 | AC_DEFINE(wxUSE_DYNAMIC_LOADER) | |
5628 | fi | |
5629 | if test "$wxUSE_DYNLIB_CLASS" = "yes" ; then | |
5630 | AC_DEFINE(wxUSE_DYNLIB_CLASS) | |
5631 | fi | |
5632 | ||
5633 | ||
5634 | dnl --------------------------------------------------------------------------- | |
5635 | dnl Verify consistency of plugins/monolithic/shared settings: | |
5636 | dnl --------------------------------------------------------------------------- | |
5637 | ||
5638 | if test "$wxUSE_PLUGINS" = "yes" ; then | |
5639 | if test "$wxUSE_SHARED" = "no" ; then | |
5640 | AC_MSG_WARN([plugins supported only in shared build, disabling]) | |
5641 | wxUSE_PLUGINS=no | |
5642 | fi | |
5643 | if test "$wxUSE_MONOLITHIC" = "yes" ; then | |
5644 | AC_MSG_WARN([plugins not supported monolithic build, disabling]) | |
5645 | wxUSE_PLUGINS=no | |
5646 | fi | |
5647 | if test "$wxUSE_DYNLIB_CLASS" = "no" ; then | |
5648 | AC_MSG_WARN([plugins require wxDynamicLibrary, disabling]) | |
5649 | wxUSE_PLUGINS=no | |
5650 | fi | |
5651 | if test "$wxUSE_PLUGINS" = "yes" ; then | |
5652 | AC_DEFINE(wxUSE_PLUGINS) | |
5653 | fi | |
5654 | fi | |
5655 | ||
5656 | dnl --------------------------------------------------------------------------- | |
5657 | dnl Register non-GUI class options for makefiles and setup.h | |
5658 | dnl --------------------------------------------------------------------------- | |
5659 | ||
5660 | if test "$wxUSE_STL" = "yes"; then | |
5661 | AC_DEFINE(wxUSE_STL) | |
5662 | fi | |
5663 | ||
5664 | if test "$wxUSE_APPLE_IEEE" = "yes"; then | |
5665 | AC_DEFINE(wxUSE_APPLE_IEEE) | |
5666 | fi | |
5667 | ||
5668 | if test "$wxUSE_TIMER" = "yes"; then | |
5669 | AC_DEFINE(wxUSE_TIMER) | |
5670 | fi | |
5671 | ||
5672 | dnl Unix implementation needs additional checks because audio support | |
5673 | dnl comes in many favours: | |
5674 | if test "$USE_UNIX" = "1" ; then | |
5675 | dnl mmedia doesn't compile with wxMGL, remove this if this is ever fixed | |
5676 | if test "$wxUSE_MGL" != 1; then | |
5677 | dnl it's not enough to check for just the header because OSS under NetBSD | |
5678 | dnl redefines ioctl as oss_ioctrl inside it and so we also need to test | |
5679 | dnl whether we need -lossaudio at link-time | |
5680 | AC_CACHE_CHECK([for SNDCTL_DSP_SPEED in sys/soundcard.h], ac_cv_header_sys_soundcard, [ | |
5681 | AC_TRY_LINK([ | |
5682 | #include <sys/ioctl.h> | |
5683 | #include <sys/soundcard.h> | |
5684 | ], | |
5685 | [ | |
5686 | ioctl(0, SNDCTL_DSP_SPEED, 0); | |
5687 | ], | |
5688 | ac_cv_header_sys_soundcard=yes, | |
5689 | [ | |
5690 | saveLibs="$LIBS" | |
5691 | LIBS="$saveLibs -lossaudio" | |
5692 | AC_TRY_LINK([ | |
5693 | #include <sys/ioctl.h> | |
5694 | #include <sys/soundcard.h> | |
5695 | ], | |
5696 | [ | |
5697 | ioctl(0, SNDCTL_DSP_SPEED, 0); | |
5698 | ], | |
5699 | ac_cv_header_sys_soundcard=yes, | |
5700 | [ | |
5701 | LIBS="$saveLibs" | |
5702 | ac_cv_header_sys_soundcard=no | |
5703 | ] | |
5704 | ) | |
5705 | ] | |
5706 | ) | |
5707 | ]) | |
5708 | fi | |
5709 | ||
5710 | if test "$ac_cv_header_sys_soundcard" = "yes"; then | |
5711 | AC_DEFINE(HAVE_SYS_SOUNDCARD_H) | |
5712 | else | |
5713 | DISABLED_CONTRIB="$DISABLED_CONTRIB mmedia" | |
5714 | fi | |
5715 | fi | |
5716 | ||
5717 | WITH_PLUGIN_SDL=0 | |
5718 | if test "$wxUSE_SOUND" = "yes"; then | |
5719 | if test "$USE_UNIX" = "1" ; then | |
5720 | if test "$wxUSE_LIBSDL" != "no"; then | |
5721 | AM_PATH_SDL([1.2.0], | |
5722 | [ | |
5723 | EXTRALIBS_SDL="$SDL_LIBS" | |
5724 | CFLAGS="$SDL_CFLAGS $CFLAGS" | |
5725 | CXXFLAGS="$SDL_CFLAGS $CXXFLAGS" | |
5726 | AC_DEFINE(wxUSE_LIBSDL) | |
5727 | ], | |
5728 | [wxUSE_LIBSDL="no"]) | |
5729 | if test "$wxUSE_LIBSDL" = "yes" -a "$wxUSE_PLUGINS" = "yes" ; then | |
5730 | WITH_PLUGIN_SDL=1 | |
5731 | fi | |
5732 | fi | |
5733 | else | |
5734 | dnl wxMGL doesn't support sound under DOS, only under Unix | |
5735 | if test "$wxUSE_MGL" = 1; then | |
5736 | AC_MSG_WARN([wxSound not supported in MGL under DOS... disabled]) | |
5737 | wxUSE_SOUND="no" | |
5738 | fi | |
5739 | fi | |
5740 | fi | |
5741 | ||
5742 | if test "$wxUSE_SOUND" = "yes"; then | |
5743 | AC_DEFINE(wxUSE_SOUND) | |
5744 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sound" | |
5745 | fi | |
5746 | ||
5747 | if test "$WXGTK20" = 1; then | |
5748 | PKG_PROG_PKG_CONFIG() | |
5749 | ||
5750 | if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then | |
5751 | if test "$wxUSE_LIBGNOMEPRINT" = "yes" ; then | |
5752 | ||
5753 | PKG_CHECK_MODULES(LIBGNOMEPRINTUI, | |
5754 | [libgnomeprintui-2.2 >= 2.8], | |
5755 | [ | |
5756 | CFLAGS="$LIBGNOMEPRINTUI_CFLAGS $CFLAGS" | |
5757 | CXXFLAGS="$LIBGNOMEPRINTUI_CFLAGS $CXXFLAGS" | |
5758 | AC_DEFINE(wxUSE_LIBGNOMEPRINT) | |
5759 | ], | |
5760 | [ | |
5761 | AC_MSG_WARN([libgnomeprintui not found, library will use standard PostScript printing]) | |
5762 | wxUSE_LIBGNOMEPRINT="no" | |
5763 | ] | |
5764 | ) | |
5765 | fi | |
5766 | fi | |
5767 | ||
5768 | if test "$wxUSE_MIMETYPE" = "yes" ; then | |
5769 | if test "$wxUSE_LIBGNOMEVFS" = "yes" ; then | |
5770 | ||
5771 | PKG_CHECK_MODULES(GNOMEVFS, | |
5772 | [gnome-vfs-2.0 >= 2.0], | |
5773 | [ | |
5774 | CFLAGS="$GNOMEVFS_CFLAGS $CFLAGS" | |
5775 | CXXFLAGS="$GNOMEVFS_CFLAGS $CXXFLAGS" | |
5776 | AC_DEFINE(wxUSE_LIBGNOMEVFS) | |
5777 | ], | |
5778 | [ | |
5779 | AC_MSG_WARN([libgnomevfs not found, library won't be able to associate MIME type]) | |
5780 | wxUSE_LIBGNOMEVFS="no" | |
5781 | ] | |
5782 | ) | |
5783 | fi | |
5784 | fi | |
5785 | ||
5786 | if test "$wxUSE_LIBHILDON" = "yes" ; then | |
5787 | PKG_CHECK_MODULES(HILDON, | |
5788 | [hildon-lgpl >= 0.9], | |
5789 | [ | |
5790 | EXTRALIBS_HILDON="$HILDON_LIBS" | |
5791 | CFLAGS="$CFLAGS $HILDON_CFLAGS" | |
5792 | CXXFLAGS="$CXXFLAGS $HILDON_CFLAGS" | |
5793 | AC_DEFINE(wxUSE_LIBHILDON) | |
5794 | ], | |
5795 | [ | |
5796 | AC_MSG_WARN([libhildon_lgpl not found]) | |
5797 | wxUSE_LIBHILDON="no" | |
5798 | ] | |
5799 | ) | |
5800 | fi | |
5801 | fi | |
5802 | ||
5803 | if test "$wxUSE_CMDLINE_PARSER" = "yes"; then | |
5804 | AC_DEFINE(wxUSE_CMDLINE_PARSER) | |
5805 | fi | |
5806 | ||
5807 | if test "$wxUSE_STOPWATCH" = "yes"; then | |
5808 | AC_DEFINE(wxUSE_STOPWATCH) | |
5809 | fi | |
5810 | ||
5811 | if test "$wxUSE_DATETIME" = "yes"; then | |
5812 | AC_DEFINE(wxUSE_DATETIME) | |
5813 | fi | |
5814 | ||
5815 | if test "$wxUSE_FILE" = "yes"; then | |
5816 | AC_DEFINE(wxUSE_FILE) | |
5817 | fi | |
5818 | ||
5819 | if test "$wxUSE_FFILE" = "yes"; then | |
5820 | AC_DEFINE(wxUSE_FFILE) | |
5821 | fi | |
5822 | ||
5823 | if test "$wxUSE_ARCHIVE_STREAMS" = "yes"; then | |
5824 | if test "$wxUSE_STREAMS" != yes; then | |
5825 | AC_MSG_WARN(wxArchive requires wxStreams... disabled) | |
5826 | wxUSE_ARCHIVE_STREAMS=no | |
5827 | else | |
5828 | AC_DEFINE(wxUSE_ARCHIVE_STREAMS) | |
5829 | fi | |
5830 | fi | |
5831 | ||
5832 | if test "$wxUSE_ZIPSTREAM" = "yes"; then | |
5833 | if test "$wxUSE_ARCHIVE_STREAMS" != "yes"; then | |
5834 | AC_MSG_WARN(wxZip requires wxArchive... disabled) | |
5835 | elif test "$wxUSE_ZLIB" = "no"; then | |
5836 | AC_MSG_WARN(wxZip requires wxZlib... disabled) | |
5837 | else | |
5838 | AC_DEFINE(wxUSE_ZIPSTREAM) | |
5839 | fi | |
5840 | fi | |
5841 | ||
5842 | if test "$wxUSE_TARSTREAM" = "yes"; then | |
5843 | if test "$wxUSE_ARCHIVE_STREAMS" != "yes"; then | |
5844 | AC_MSG_WARN(wxTar requires wxArchive... disabled) | |
5845 | else | |
5846 | AC_DEFINE(wxUSE_TARSTREAM) | |
5847 | fi | |
5848 | fi | |
5849 | ||
5850 | if test "$wxUSE_FILESYSTEM" = "yes"; then | |
5851 | if test "$wxUSE_STREAMS" != yes -o \( "$wxUSE_FILE" != yes -a "$wxUSE_FFILE" != yes \); then | |
5852 | AC_MSG_WARN(wxFileSystem requires wxStreams and wxFile or wxFFile... disabled) | |
5853 | wxUSE_FILESYSTEM=no | |
5854 | else | |
5855 | AC_DEFINE(wxUSE_FILESYSTEM) | |
5856 | fi | |
5857 | fi | |
5858 | ||
5859 | if test "$wxUSE_FS_ARCHIVE" = "yes"; then | |
5860 | if test "$wxUSE_FILESYSTEM" != yes -o "$wxUSE_ARCHIVE_STREAMS" != yes; then | |
5861 | AC_MSG_WARN(wxArchiveFSHandler requires wxArchive and wxFileSystem... disabled) | |
5862 | else | |
5863 | AC_DEFINE(wxUSE_FS_ARCHIVE) | |
5864 | fi | |
5865 | fi | |
5866 | ||
5867 | if test "$wxUSE_FS_ZIP" = "yes"; then | |
5868 | if test "$wxUSE_FS_ARCHIVE" != yes; then | |
5869 | AC_MSG_WARN(wxZipFSHandler requires wxArchiveFSHandler... disabled) | |
5870 | else | |
5871 | AC_DEFINE(wxUSE_FS_ZIP) | |
5872 | fi | |
5873 | fi | |
5874 | ||
5875 | if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then | |
5876 | if test "$USE_UNIX" != 1; then | |
5877 | AC_MSG_WARN([Catching fatal exceptions not currently supported on this system, wxApp::OnFatalException will not be called]) | |
5878 | wxUSE_ON_FATAL_EXCEPTION=no | |
5879 | else | |
5880 | AC_DEFINE(wxUSE_ON_FATAL_EXCEPTION) | |
5881 | fi | |
5882 | fi | |
5883 | ||
5884 | if test "$wxUSE_STACKWALKER" = "yes"; then | |
5885 | AC_DEFINE(wxUSE_STACKWALKER) | |
5886 | fi | |
5887 | ||
5888 | if test "$wxUSE_DEBUGREPORT" = "yes"; then | |
5889 | if test "$USE_UNIX" != "1" -a "$USE_WIN32" != "1"; then | |
5890 | AC_MSG_WARN([Creating debug reports not currently supported on this system, disabled]) | |
5891 | wxUSE_DEBUGREPORT=no | |
5892 | else | |
5893 | AC_DEFINE(wxUSE_DEBUGREPORT) | |
5894 | if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then | |
5895 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS debugrpt" | |
5896 | fi | |
5897 | fi | |
5898 | fi | |
5899 | ||
5900 | if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then | |
5901 | AC_DEFINE(wxUSE_SNGLINST_CHECKER) | |
5902 | fi | |
5903 | ||
5904 | if test "$wxUSE_BUSYINFO" = "yes"; then | |
5905 | AC_DEFINE(wxUSE_BUSYINFO) | |
5906 | fi | |
5907 | ||
5908 | if test "$wxUSE_STD_IOSTREAM" = "yes"; then | |
5909 | AC_DEFINE(wxUSE_STD_IOSTREAM) | |
5910 | fi | |
5911 | ||
5912 | if test "$wxUSE_STD_STRING" = "yes"; then | |
5913 | AC_DEFINE(wxUSE_STD_STRING) | |
5914 | fi | |
5915 | ||
5916 | if test "$wxUSE_STDPATHS" = "yes"; then | |
5917 | AC_DEFINE(wxUSE_STDPATHS) | |
5918 | fi | |
5919 | ||
5920 | if test "$wxUSE_TEXTBUFFER" = "yes"; then | |
5921 | AC_DEFINE(wxUSE_TEXTBUFFER) | |
5922 | fi | |
5923 | ||
5924 | if test "$wxUSE_TEXTFILE" = "yes"; then | |
5925 | if test "$wxUSE_FILE" != "yes" -o "$wxUSE_TEXTBUFFER" != "yes" ; then | |
5926 | AC_MSG_WARN(wxTextFile requires wxFile and wxTextBuffer... disabled) | |
5927 | else | |
5928 | AC_DEFINE(wxUSE_TEXTFILE) | |
5929 | fi | |
5930 | fi | |
5931 | ||
5932 | if test "$wxUSE_CONFIG" = "yes" ; then | |
5933 | if test "$wxUSE_TEXTFILE" != "yes"; then | |
5934 | AC_MSG_WARN(wxConfig requires wxTextFile... disabled) | |
5935 | else | |
5936 | AC_DEFINE(wxUSE_CONFIG) | |
5937 | AC_DEFINE(wxUSE_CONFIG_NATIVE) | |
5938 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS config" | |
5939 | fi | |
5940 | fi | |
5941 | ||
5942 | if test "$wxUSE_INTL" = "yes" ; then | |
5943 | if test "$wxUSE_FILE" != "yes"; then | |
5944 | AC_MSG_WARN(I18n code requires wxFile... disabled) | |
5945 | else | |
5946 | AC_DEFINE(wxUSE_INTL) | |
5947 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS internat" | |
5948 | GUIDIST="$GUIDIST INTL_DIST" | |
5949 | fi | |
5950 | fi | |
5951 | ||
5952 | if test "$wxUSE_LOG" = "yes"; then | |
5953 | AC_DEFINE(wxUSE_LOG) | |
5954 | ||
5955 | if test "$wxUSE_LOGGUI" = "yes"; then | |
5956 | AC_DEFINE(wxUSE_LOGGUI) | |
5957 | fi | |
5958 | ||
5959 | if test "$wxUSE_LOGWINDOW" = "yes"; then | |
5960 | AC_DEFINE(wxUSE_LOGWINDOW) | |
5961 | fi | |
5962 | ||
5963 | if test "$wxUSE_LOGDIALOG" = "yes"; then | |
5964 | AC_DEFINE(wxUSE_LOG_DIALOG) | |
5965 | fi | |
5966 | ||
5967 | dnl the keyboard sample requires wxUSE_LOG | |
5968 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS keyboard" | |
5969 | fi | |
5970 | ||
5971 | if test "$wxUSE_LONGLONG" = "yes"; then | |
5972 | AC_DEFINE(wxUSE_LONGLONG) | |
5973 | fi | |
5974 | ||
5975 | if test "$wxUSE_GEOMETRY" = "yes"; then | |
5976 | AC_DEFINE(wxUSE_GEOMETRY) | |
5977 | fi | |
5978 | ||
5979 | if test "$wxUSE_STREAMS" = "yes" ; then | |
5980 | AC_DEFINE(wxUSE_STREAMS) | |
5981 | fi | |
5982 | ||
5983 | if test "$wxUSE_PRINTF_POS_PARAMS" = "yes"; then | |
5984 | AC_DEFINE(wxUSE_PRINTF_POS_PARAMS) | |
5985 | fi | |
5986 | ||
5987 | ||
5988 | dnl --------------------------------------------------------------------------- | |
5989 | dnl time/date functions | |
5990 | dnl --------------------------------------------------------------------------- | |
5991 | ||
5992 | if test "$wxUSE_DATETIME" = "yes"; then | |
5993 | dnl check for strptime and for its declaration as some systems lack it | |
5994 | dnl FIXME: use WX_CHECK_FUNCS instead | |
5995 | AC_CHECK_FUNCS(strptime) | |
5996 | if test "$ac_cv_func_strptime" = "yes"; then | |
5997 | AC_CACHE_CHECK([for strptime declaration], wx_cv_func_strptime_decl, | |
5998 | [ | |
5999 | AC_LANG_PUSH(C++) | |
6000 | AC_TRY_COMPILE( | |
6001 | [ | |
6002 | #include <time.h> | |
6003 | ], | |
6004 | [ | |
6005 | struct tm t; | |
6006 | strptime("foo", "bar", &t); | |
6007 | ], | |
6008 | wx_cv_func_strptime_decl=yes, | |
6009 | wx_cv_func_strptime_decl=no | |
6010 | ) | |
6011 | AC_LANG_POP() | |
6012 | ] | |
6013 | ) | |
6014 | fi | |
6015 | if test "$wx_cv_func_strptime_decl" = "yes"; then | |
6016 | AC_DEFINE(HAVE_STRPTIME_DECL) | |
6017 | fi | |
6018 | ||
6019 | dnl check for timezone variable | |
6020 | dnl doesn't exist under Darwin / Mac OS X which uses tm_gmtoff instead | |
6021 | AC_CACHE_CHECK(for timezone variable in <time.h>, | |
6022 | wx_cv_var_timezone, | |
6023 | [ | |
6024 | AC_LANG_PUSH(C++) | |
6025 | AC_TRY_COMPILE( | |
6026 | [ | |
6027 | #include <time.h> | |
6028 | ], | |
6029 | [ | |
6030 | int tz; | |
6031 | tz = timezone; | |
6032 | ], | |
6033 | [ | |
6034 | wx_cv_var_timezone=timezone | |
6035 | ], | |
6036 | [ | |
6037 | AC_TRY_COMPILE( | |
6038 | [ | |
6039 | #include <time.h> | |
6040 | ], | |
6041 | [ | |
6042 | int tz; | |
6043 | tz = _timezone; | |
6044 | ], | |
6045 | [ | |
6046 | wx_cv_var_timezone=_timezone | |
6047 | ], | |
6048 | [ | |
6049 | AC_TRY_COMPILE( | |
6050 | [ | |
6051 | #include <time.h> | |
6052 | ], | |
6053 | [ | |
6054 | int tz; | |
6055 | tz = __timezone; | |
6056 | ], | |
6057 | [ | |
6058 | wx_cv_var_timezone=__timezone | |
6059 | ], | |
6060 | [ | |
6061 | if test "$USE_DOS" = 0 ; then | |
6062 | AC_MSG_WARN(no timezone variable, will use tm_gmtoff instead) | |
6063 | fi | |
6064 | ] | |
6065 | ) | |
6066 | ] | |
6067 | ) | |
6068 | ] | |
6069 | ) | |
6070 | AC_LANG_POP() | |
6071 | ] | |
6072 | ) | |
6073 | ||
6074 | dnl as we want $wx_cv_var_timezone to be expanded, use AC_DEFINE_UNQUOTED | |
6075 | if test "x$wx_cv_var_timezone" != x ; then | |
6076 | AC_DEFINE_UNQUOTED(WX_TIMEZONE, $wx_cv_var_timezone) | |
6077 | fi | |
6078 | ||
6079 | dnl check for localtime (it's POSIX, but the check can do no harm...) | |
6080 | AC_CHECK_FUNCS(localtime) | |
6081 | ||
6082 | if test "$ac_cv_func_localtime" = "yes"; then | |
6083 | AC_CACHE_CHECK(for tm_gmtoff in struct tm, | |
6084 | wx_cv_struct_tm_has_gmtoff, | |
6085 | [ | |
6086 | AC_TRY_COMPILE( | |
6087 | [ | |
6088 | #include <time.h> | |
6089 | ], | |
6090 | [ | |
6091 | struct tm tm; | |
6092 | tm.tm_gmtoff++; | |
6093 | ], | |
6094 | [ | |
6095 | wx_cv_struct_tm_has_gmtoff=yes | |
6096 | ], | |
6097 | wx_cv_struct_tm_has_gmtoff=no | |
6098 | ) | |
6099 | ]) | |
6100 | fi | |
6101 | ||
6102 | if test "$wx_cv_struct_tm_has_gmtoff" = "yes"; then | |
6103 | AC_DEFINE(WX_GMTOFF_IN_TM) | |
6104 | fi | |
6105 | ||
6106 | dnl check for gettimeofday (SVr4, BSD 4.3) and ftime (V7, BSD 4.3) for the | |
6107 | dnl function to be used for high resolution timers | |
6108 | AC_CHECK_FUNCS(gettimeofday ftime, break) | |
6109 | ||
6110 | if test "$ac_cv_func_gettimeofday" = "yes"; then | |
6111 | AC_CACHE_CHECK([whether gettimeofday takes two arguments], | |
6112 | wx_cv_func_gettimeofday_has_2_args, | |
6113 | [ | |
6114 | dnl on some _really_ old systems it takes only 1 argument | |
6115 | AC_TRY_COMPILE( | |
6116 | [ | |
6117 | #include <sys/time.h> | |
6118 | #include <unistd.h> | |
6119 | ], | |
6120 | [ | |
6121 | struct timeval tv; | |
6122 | gettimeofday(&tv, NULL); | |
6123 | ], | |
6124 | wx_cv_func_gettimeofday_has_2_args=yes, | |
6125 | AC_TRY_COMPILE( | |
6126 | [ | |
6127 | #include <sys/time.h> | |
6128 | #include <unistd.h> | |
6129 | ], | |
6130 | [ | |
6131 | struct timeval tv; | |
6132 | gettimeofday(&tv); | |
6133 | ], | |
6134 | wx_cv_func_gettimeofday_has_2_args=no, | |
6135 | [ | |
6136 | AC_MSG_WARN([failed to determine number of gettimeofday() arguments]) | |
6137 | wx_cv_func_gettimeofday_has_2_args=unknown | |
6138 | ] | |
6139 | ) | |
6140 | ) | |
6141 | ]) | |
6142 | ||
6143 | if test "$wx_cv_func_gettimeofday_has_2_args" != "yes"; then | |
6144 | AC_DEFINE(WX_GETTIMEOFDAY_NO_TZ) | |
6145 | fi | |
6146 | fi | |
6147 | ||
6148 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest" | |
6149 | fi | |
6150 | ||
6151 | dnl ------------------------------------------------------------------------ | |
6152 | dnl wxSocket | |
6153 | dnl ------------------------------------------------------------------------ | |
6154 | ||
6155 | dnl VZ: the GUI hooks wxSocket needs are not implemented yet in some toolkits | |
6156 | if test "$wxUSE_SOCKETS" = "yes"; then | |
6157 | if test "$wxUSE_MGL" = "1"; then | |
6158 | AC_MSG_WARN([wxSocket not yet supported under MGL... disabled]) | |
6159 | wxUSE_SOCKETS="no" | |
6160 | fi | |
6161 | fi | |
6162 | ||
6163 | if test "$wxUSE_SOCKETS" = "yes"; then | |
6164 | dnl under MSW we always have sockets | |
6165 | if test "$TOOLKIT" != "MSW"; then | |
6166 | dnl under Solaris and OS/2, socket functions live in -lsocket | |
6167 | AC_CHECK_FUNC(socket,, | |
6168 | [ | |
6169 | AC_CHECK_LIB(socket, socket, | |
6170 | if test "$INET_LINK" != " -lsocket"; then | |
6171 | INET_LINK="$INET_LINK -lsocket" | |
6172 | fi, | |
6173 | [ | |
6174 | AC_MSG_WARN([socket library not found - sockets will be disabled]) | |
6175 | wxUSE_SOCKETS=no | |
6176 | ] | |
6177 | ) | |
6178 | ] | |
6179 | ) | |
6180 | fi | |
6181 | fi | |
6182 | ||
6183 | if test "$wxUSE_SOCKETS" = "yes" ; then | |
6184 | dnl this test may be appropriate if building under cygwin | |
6185 | dnl right now I'm assuming it also uses the winsock stuff | |
6186 | dnl like mingw does.. -- RL | |
6187 | if test "$TOOLKIT" != "MSW"; then | |
6188 | dnl determine the type of third argument for getsockname | |
6189 | dnl This test needs to be done in C++ mode since gsocket.cpp now | |
6190 | dnl is C++ code and pointer cast that are possible even without | |
6191 | dnl warning in C still fail in C++. | |
6192 | AC_CACHE_CHECK([what is the type of the third argument of getsockname], | |
6193 | wx_cv_type_getsockname3, | |
6194 | [ | |
6195 | AC_LANG_PUSH(C++) | |
6196 | AC_TRY_COMPILE( | |
6197 | [ | |
6198 | #include <sys/types.h> | |
6199 | #include <sys/socket.h> | |
6200 | ], | |
6201 | [ | |
6202 | socklen_t len; | |
6203 | getsockname(0, 0, &len); | |
6204 | ], | |
6205 | wx_cv_type_getsockname3=socklen_t, | |
6206 | [ | |
6207 | dnl the compiler will compile the version with size_t | |
6208 | dnl even if the real type of the last parameter is int | |
6209 | dnl but it should give at least a warning about | |
6210 | dnl converting between incompatible pointer types, so | |
6211 | dnl try to use it to get the correct behaviour at | |
6212 | dnl least with gcc (otherwise we'd always use size_t) | |
6213 | CFLAGS_OLD="$CFLAGS" | |
6214 | if test "$GCC" = yes ; then | |
6215 | CFLAGS="-Werror $CFLAGS" | |
6216 | fi | |
6217 | ||
6218 | AC_TRY_COMPILE( | |
6219 | [ | |
6220 | #include <sys/types.h> | |
6221 | #include <sys/socket.h> | |
6222 | ], | |
6223 | [ | |
6224 | size_t len; | |
6225 | getsockname(0, 0, &len); | |
6226 | ], | |
6227 | wx_cv_type_getsockname3=size_t, | |
6228 | AC_TRY_COMPILE( | |
6229 | [ | |
6230 | #include <sys/types.h> | |
6231 | #include <sys/socket.h> | |
6232 | ], | |
6233 | [ | |
6234 | int len; | |
6235 | getsockname(0, 0, &len); | |
6236 | ], | |
6237 | wx_cv_type_getsockname3=int, | |
6238 | wx_cv_type_getsockname3=unknown | |
6239 | ) | |
6240 | ) | |
6241 | ||
6242 | CFLAGS="$CFLAGS_OLD" | |
6243 | ] | |
6244 | ) | |
6245 | AC_LANG_POP() | |
6246 | ]) | |
6247 | ||
6248 | if test "$wx_cv_type_getsockname3" = "unknown"; then | |
6249 | wxUSE_SOCKETS=no | |
6250 | AC_MSG_WARN([Couldn't find socklen_t synonym for this system]) | |
6251 | else | |
6252 | AC_DEFINE_UNQUOTED(WX_SOCKLEN_T, $wx_cv_type_getsockname3) | |
6253 | fi | |
6254 | dnl Do this again for getsockopt as it may be different | |
6255 | AC_CACHE_CHECK([what is the type of the fifth argument of getsockopt], | |
6256 | wx_cv_type_getsockopt5, | |
6257 | [ | |
6258 | AC_TRY_COMPILE( | |
6259 | [ | |
6260 | #include <sys/types.h> | |
6261 | #include <sys/socket.h> | |
6262 | ], | |
6263 | [ | |
6264 | socklen_t len; | |
6265 | getsockopt(0, 0, 0, 0, &len); | |
6266 | ], | |
6267 | wx_cv_type_getsockopt5=socklen_t, | |
6268 | [ | |
6269 | dnl Note that the rules for compatibility of pointers | |
6270 | dnl are somewhat different between C and C++, so code | |
6271 | dnl that fails in C++ may not even give a warning about | |
6272 | dnl converting between incompatible pointer types in C. | |
6273 | dnl So this test needs to be done in C++ mode. | |
6274 | AC_LANG_PUSH(C++) | |
6275 | AC_TRY_COMPILE( | |
6276 | [ | |
6277 | #include <sys/types.h> | |
6278 | #include <sys/socket.h> | |
6279 | ], | |
6280 | [ | |
6281 | size_t len; | |
6282 | getsockopt(0, 0, 0, 0, &len); | |
6283 | ], | |
6284 | wx_cv_type_getsockopt5=size_t, | |
6285 | AC_TRY_COMPILE( | |
6286 | [ | |
6287 | #include <sys/types.h> | |
6288 | #include <sys/socket.h> | |
6289 | ], | |
6290 | [ | |
6291 | int len; | |
6292 | getsockopt(0, 0, 0, 0, &len); | |
6293 | ], | |
6294 | wx_cv_type_getsockopt5=int, | |
6295 | wx_cv_type_getsockopt5=unknown | |
6296 | ) | |
6297 | ) | |
6298 | AC_LANG_POP() | |
6299 | ] | |
6300 | ) | |
6301 | ]) | |
6302 | ||
6303 | if test "$wx_cv_type_getsockopt5" = "unknown"; then | |
6304 | wxUSE_SOCKETS=no | |
6305 | AC_MSG_WARN([Couldn't find socklen_t synonym for this system]) | |
6306 | else | |
6307 | AC_DEFINE_UNQUOTED(SOCKOPTLEN_T, $wx_cv_type_getsockopt5) | |
6308 | fi | |
6309 | fi | |
6310 | fi | |
6311 | ||
6312 | if test "$wxUSE_SOCKETS" = "yes" ; then | |
6313 | AC_DEFINE(wxUSE_SOCKETS) | |
6314 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sockets" | |
6315 | fi | |
6316 | ||
6317 | if test "$wxUSE_PROTOCOL" = "yes"; then | |
6318 | if test "$wxUSE_SOCKETS" != "yes"; then | |
6319 | AC_MSG_WARN(Protocol classes require sockets... disabled) | |
6320 | wxUSE_PROTOCOL=no | |
6321 | fi | |
6322 | fi | |
6323 | ||
6324 | if test "$wxUSE_PROTOCOL" = "yes"; then | |
6325 | AC_DEFINE(wxUSE_PROTOCOL) | |
6326 | ||
6327 | if test "$wxUSE_PROTOCOL_HTTP" = "yes"; then | |
6328 | AC_DEFINE(wxUSE_PROTOCOL_HTTP) | |
6329 | fi | |
6330 | if test "$wxUSE_PROTOCOL_FTP" = "yes"; then | |
6331 | AC_DEFINE(wxUSE_PROTOCOL_FTP) | |
6332 | fi | |
6333 | if test "$wxUSE_PROTOCOL_FILE" = "yes"; then | |
6334 | AC_DEFINE(wxUSE_PROTOCOL_FILE) | |
6335 | fi | |
6336 | else | |
6337 | if test "$wxUSE_FS_INET" = "yes"; then | |
6338 | AC_MSG_WARN([HTTP filesystem require protocol classes... disabled]) | |
6339 | wxUSE_FS_INET="no" | |
6340 | fi | |
6341 | fi | |
6342 | ||
6343 | if test "$wxUSE_URL" = "yes"; then | |
6344 | if test "$wxUSE_PROTOCOL" != "yes"; then | |
6345 | AC_MSG_WARN(wxURL class requires wxProtocol... disabled) | |
6346 | wxUSE_URL=no | |
6347 | fi | |
6348 | if test "$wxUSE_URL" = "yes"; then | |
6349 | AC_DEFINE(wxUSE_URL) | |
6350 | fi | |
6351 | fi | |
6352 | ||
6353 | if test "$wxUSE_VARIANT" = "yes"; then | |
6354 | AC_DEFINE(wxUSE_VARIANT) | |
6355 | fi | |
6356 | ||
6357 | if test "$wxUSE_FS_INET" = "yes"; then | |
6358 | AC_DEFINE(wxUSE_FS_INET) | |
6359 | fi | |
6360 | ||
6361 | dnl --------------------------------------------------------------------------- | |
6362 | dnl Joystick support | |
6363 | dnl --------------------------------------------------------------------------- | |
6364 | ||
6365 | if test "$wxUSE_GUI" = "yes" -a "$wxUSE_JOYSTICK" = "yes"; then | |
6366 | wxUSE_JOYSTICK=no | |
6367 | ||
6368 | dnl under MSW we always have joystick support | |
6369 | if test "$TOOLKIT" = "MSW"; then | |
6370 | wxUSE_JOYSTICK=yes | |
6371 | ||
6372 | dnl mac only available on darwin | |
6373 | elif test "$TOOLKIT" = "MAC" -o "$TOOLKIT" = "COCOA"; then | |
6374 | if test "$USE_DARWIN" = 1; then | |
6375 | dnl check for a bug in the headers, some have bad setEventCallout | |
6376 | AC_MSG_CHECKING([headers have declarations needed for joystick support]) | |
6377 | AC_LANG_PUSH(C++) | |
6378 | AC_TRY_COMPILE( [ #include <IOKit/hid/IOHIDLib.h> ], | |
6379 | [ IOHIDQueueInterface *qi = NULL; | |
6380 | IOHIDCallbackFunction cb = NULL; | |
6381 | qi->setEventCallout(NULL, cb, NULL, NULL); ], | |
6382 | [ wxUSE_JOYSTICK=yes ] | |
6383 | ) | |
6384 | AC_LANG_POP() | |
6385 | AC_MSG_RESULT($wxUSE_JOYSTICK) | |
6386 | fi | |
6387 | ||
6388 | dnl joystick support is only for Linux 2.1.x or greater | |
6389 | else | |
6390 | dnl wxJoystick not supported by wxMGL at all | |
6391 | if test "$wxUSE_MGL" != "1"; then | |
6392 | dnl notice the dummy includes argument: without it, AC_CHECK_HEADER | |
6393 | dnl checks only whether the header can be preprocessed, not that it | |
6394 | dnl can be compiled and in Linux 2.6.16 joystick.h is present but | |
6395 | dnl can't be compiled because of an error and with the default | |
6396 | dnl AC_CHECK_HEADER semantics we'd still detect it in this case and | |
6397 | dnl build would fail later | |
6398 | AC_CHECK_HEADER(linux/joystick.h, wxUSE_JOYSTICK=yes,,[#include <stdio.h>]) | |
6399 | fi | |
6400 | fi | |
6401 | ||
6402 | if test "$wxUSE_JOYSTICK" = "yes"; then | |
6403 | AC_DEFINE(wxUSE_JOYSTICK) | |
6404 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest" | |
6405 | else | |
6406 | AC_MSG_WARN(Joystick not supported by this system... disabled) | |
6407 | fi | |
6408 | fi | |
6409 | ||
6410 | ||
6411 | dnl --------------------------------------------------------------------------- | |
6412 | dnl String stuff | |
6413 | dnl --------------------------------------------------------------------------- | |
6414 | ||
6415 | if test "$wxUSE_FONTMAP" = "yes" ; then | |
6416 | AC_DEFINE(wxUSE_FONTMAP) | |
6417 | fi | |
6418 | ||
6419 | if test "$wxUSE_UNICODE" = "yes" ; then | |
6420 | AC_DEFINE(wxUSE_UNICODE) | |
6421 | ||
6422 | if test "$USE_WIN32" != 1; then | |
6423 | wxUSE_UNICODE_MSLU=no | |
6424 | fi | |
6425 | ||
6426 | if test "$USE_WIN32" = 1 -a "$wxUSE_UNICODE_MSLU" = "yes"; then | |
6427 | AC_CHECK_LIB(unicows,main, | |
6428 | [ | |
6429 | AC_DEFINE(wxUSE_UNICODE_MSLU) | |
6430 | ], | |
6431 | [ | |
6432 | AC_MSG_WARN([Compiler doesn't support MSLU (libunicows.a), disabled. | |
6433 | Applications will only run on Windows NT/2000/XP!]) | |
6434 | wxUSE_UNICODE_MSLU=no | |
6435 | ]) | |
6436 | fi | |
6437 | fi | |
6438 | ||
6439 | if test "$wxUSE_wxUSE_EXPERIMENTAL_PRINTF" = "yes"; then | |
6440 | AC_DEFINE(wxUSE_EXPERIMENTAL_PRINTF) | |
6441 | fi | |
6442 | ||
6443 | dnl ---------------------------------------------------------------- | |
6444 | dnl Register PostScript options for makefiles and setup.h | |
6445 | dnl ---------------------------------------------------------------- | |
6446 | ||
6447 | if test "$wxUSE_POSTSCRIPT" = "yes" ; then | |
6448 | AC_DEFINE(wxUSE_POSTSCRIPT) | |
6449 | fi | |
6450 | ||
6451 | AC_DEFINE(wxUSE_AFM_FOR_POSTSCRIPT) | |
6452 | ||
6453 | AC_DEFINE(wxUSE_NORMALIZED_PS_FONTS) | |
6454 | ||
6455 | dnl --------------------------------------------------------------------------- | |
6456 | dnl big GUI components: MDI, doc/view, printing, help, ... | |
6457 | dnl --------------------------------------------------------------------------- | |
6458 | ||
6459 | if test "$wxUSE_CONSTRAINTS" = "yes"; then | |
6460 | AC_DEFINE(wxUSE_CONSTRAINTS) | |
6461 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS layout" | |
6462 | fi | |
6463 | ||
6464 | if test "$wxUSE_MDI" = "yes"; then | |
6465 | AC_DEFINE(wxUSE_MDI) | |
6466 | ||
6467 | if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then | |
6468 | AC_DEFINE(wxUSE_MDI_ARCHITECTURE) | |
6469 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mdi" | |
6470 | fi | |
6471 | fi | |
6472 | ||
6473 | if test "$wxUSE_DOC_VIEW_ARCHITECTURE" = "yes" ; then | |
6474 | AC_DEFINE(wxUSE_DOC_VIEW_ARCHITECTURE) | |
6475 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docview" | |
6476 | if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then | |
6477 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docvwmdi" | |
6478 | fi | |
6479 | fi | |
6480 | ||
6481 | if test "$wxUSE_HELP" = "yes"; then | |
6482 | AC_DEFINE(wxUSE_HELP) | |
6483 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS help" | |
6484 | ||
6485 | if test "$wxUSE_MSW" = 1; then | |
6486 | if test "$wxUSE_MS_HTML_HELP" = "yes"; then | |
6487 | AC_DEFINE(wxUSE_MS_HTML_HELP) | |
6488 | fi | |
6489 | fi | |
6490 | ||
6491 | if test "$wxUSE_WXHTML_HELP" = "yes"; then | |
6492 | if test "$wxUSE_HTML" = "yes"; then | |
6493 | AC_DEFINE(wxUSE_WXHTML_HELP) | |
6494 | else | |
6495 | AC_MSG_WARN(Cannot use wxHTML-based help without wxHTML so it won't be compiled) | |
6496 | wxUSE_WXHTML_HELP=no | |
6497 | fi | |
6498 | fi | |
6499 | fi | |
6500 | ||
6501 | if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then | |
6502 | if test "$wxUSE_CONSTRAINTS" != "yes"; then | |
6503 | AC_MSG_WARN(Printing support cannot be used without constraints so it won't be compiled without it) | |
6504 | else | |
6505 | AC_DEFINE(wxUSE_PRINTING_ARCHITECTURE) | |
6506 | fi | |
6507 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS printing" | |
6508 | fi | |
6509 | ||
6510 | if test "$wxUSE_PROLOGIO" = "yes" -o "$wxUSE_RESOURCES" = "yes"; then | |
6511 | AC_MSG_ERROR([wxExpr and old-style resources are now available in contrib only]) | |
6512 | fi | |
6513 | ||
6514 | dnl --------------------------------------------------------------------------- | |
6515 | dnl wxMetafile availability | |
6516 | dnl --------------------------------------------------------------------------- | |
6517 | ||
6518 | if test "$wxUSE_METAFILE" = "yes"; then | |
6519 | if test "$wxUSE_MSW" != 1 -a "$wxUSE_MAC" != 1 -a "$wxUSE_PM" != 1; then | |
6520 | AC_MSG_WARN([wxMetafile is not available on this system... disabled]) | |
6521 | wxUSE_METAFILE=no | |
6522 | fi | |
6523 | fi | |
6524 | ||
6525 | dnl --------------------------------------------------------------------------- | |
6526 | dnl IPC: IPC, Drag'n'Drop, Clipboard, ... | |
6527 | dnl --------------------------------------------------------------------------- | |
6528 | ||
6529 | dnl check for ole headers and disable a few features requiring it if not | |
6530 | dnl present (earlier versions of mingw32 don't have ole2.h) | |
6531 | if test "$USE_WIN32" = 1 -a \( "$wxUSE_DATAOBJ" = "yes" \ | |
6532 | -o "$wxUSE_CLIPBOARD" = "yes" \ | |
6533 | -o "$wxUSE_OLE" = "yes" \ | |
6534 | -o "$wxUSE_DRAG_AND_DROP" = "yes" \) ; then | |
6535 | AC_CHECK_HEADERS(ole2.h) | |
6536 | ||
6537 | if test "$ac_cv_header_ole2_h" = "yes" ; then | |
6538 | if test "$GCC" = yes ; then | |
6539 | AC_MSG_CHECKING([if g++ requires -fvtable-thunks]) | |
6540 | AC_TRY_COMPILE([#include <windows.h> | |
6541 | #include <ole2.h>], | |
6542 | [], | |
6543 | [AC_MSG_RESULT(no)], | |
6544 | [AC_MSG_RESULT(yes) | |
6545 | WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fvtable-thunks"]) | |
6546 | LIBS=" -lrpcrt4 -loleaut32 -lole32 -luuid$LIBS" | |
6547 | if test "$wxUSE_OLE" = "yes" ; then | |
6548 | AC_DEFINE(wxUSE_OLE) | |
6549 | AC_DEFINE(wxUSE_OLE_AUTOMATION) | |
6550 | AC_DEFINE(wxUSE_OLE_ACTIVEX) | |
6551 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS oleauto" | |
6552 | fi | |
6553 | fi | |
6554 | ||
6555 | dnl for OLE clipboard and dnd | |
6556 | if test "$wxUSE_DATAOBJ" = "yes" ; then | |
6557 | AC_DEFINE(wxUSE_DATAOBJ) | |
6558 | fi | |
6559 | else | |
6560 | AC_MSG_WARN([Some features disabled because OLE headers not found]) | |
6561 | ||
6562 | wxUSE_CLIPBOARD=no | |
6563 | wxUSE_DRAG_AND_DROP=no | |
6564 | wxUSE_DATAOBJ=no | |
6565 | wxUSE_OLE=no | |
6566 | fi | |
6567 | ||
6568 | if test "$wxUSE_METAFILE" = "yes"; then | |
6569 | AC_DEFINE(wxUSE_METAFILE) | |
6570 | ||
6571 | dnl this one should probably be made separately configurable | |
6572 | AC_DEFINE(wxUSE_ENH_METAFILE) | |
6573 | fi | |
6574 | fi | |
6575 | ||
6576 | if test "$wxUSE_IPC" = "yes"; then | |
6577 | if test "$wxUSE_SOCKETS" != "yes" -a "$USE_WIN32" != 1; then | |
6578 | AC_MSG_WARN(wxWidgets IPC classes require sockets... disabled) | |
6579 | wxUSE_IPC=no | |
6580 | fi | |
6581 | ||
6582 | if test "$wxUSE_IPC" = "yes"; then | |
6583 | AC_DEFINE(wxUSE_IPC) | |
6584 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ipc" | |
6585 | fi | |
6586 | fi | |
6587 | ||
6588 | if test "$wxUSE_DATAOBJ" = "yes"; then | |
6589 | if test "$wxUSE_MGL" = 1; then | |
6590 | AC_MSG_WARN([wxDataObject not yet supported under MGL... disabled]) | |
6591 | wxUSE_DATAOBJ=no | |
6592 | else | |
6593 | AC_DEFINE(wxUSE_DATAOBJ) | |
6594 | fi | |
6595 | else | |
6596 | AC_MSG_WARN([Clipboard and drag-and-drop require wxDataObject -- disabled]) | |
6597 | wxUSE_CLIPBOARD=no | |
6598 | wxUSE_DRAG_AND_DROP=no | |
6599 | fi | |
6600 | ||
6601 | if test "$wxUSE_CLIPBOARD" = "yes"; then | |
6602 | if test "$wxUSE_MGL" = 1; then | |
6603 | AC_MSG_WARN([Clipboard not yet supported under MGL... disabled]) | |
6604 | wxUSE_CLIPBOARD=no | |
6605 | fi | |
6606 | ||
6607 | if test "$wxUSE_CLIPBOARD" = "yes"; then | |
6608 | AC_DEFINE(wxUSE_CLIPBOARD) | |
6609 | fi | |
6610 | fi | |
6611 | ||
6612 | if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then | |
6613 | if test "$wxUSE_GTK" = 1; then | |
6614 | if test "$WXGTK12" != 1; then | |
6615 | AC_MSG_WARN([Drag and drop is only supported under GTK+ 1.2... disabled]) | |
6616 | wxUSE_DRAG_AND_DROP=no | |
6617 | fi | |
6618 | fi | |
6619 | ||
6620 | if test "$wxUSE_MOTIF" = 1; then | |
6621 | AC_MSG_WARN([Drag and drop not yet supported under Motif... disabled]) | |
6622 | wxUSE_DRAG_AND_DROP=no | |
6623 | fi | |
6624 | ||
6625 | if test "$wxUSE_X11" = 1; then | |
6626 | AC_MSG_WARN([Drag and drop not yet supported under X11... disabled]) | |
6627 | wxUSE_DRAG_AND_DROP=no | |
6628 | fi | |
6629 | ||
6630 | if test "$wxUSE_MGL" = 1; then | |
6631 | AC_MSG_WARN([Drag and drop not yet supported under MGL... disabled]) | |
6632 | wxUSE_DRAG_AND_DROP=no | |
6633 | fi | |
6634 | ||
6635 | if test "$wxUSE_DRAG_AND_DROP" = "yes"; then | |
6636 | AC_DEFINE(wxUSE_DRAG_AND_DROP) | |
6637 | fi | |
6638 | ||
6639 | fi | |
6640 | ||
6641 | if test "$wxUSE_DRAG_AND_DROP" = "yes" -o "$wxUSE_CLIPBOARD" = "yes"; then | |
6642 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd" | |
6643 | fi | |
6644 | ||
6645 | if test "$wxUSE_SPLINES" = "yes" ; then | |
6646 | AC_DEFINE(wxUSE_SPLINES) | |
6647 | fi | |
6648 | ||
6649 | if test "$wxUSE_MOUSEWHEEL" = "yes" ; then | |
6650 | AC_DEFINE(wxUSE_MOUSEWHEEL) | |
6651 | fi | |
6652 | ||
6653 | dnl --------------------------------------------------------------------------- | |
6654 | dnl GUI controls | |
6655 | dnl --------------------------------------------------------------------------- | |
6656 | ||
6657 | USES_CONTROLS=0 | |
6658 | if test "$wxUSE_CONTROLS" = "yes"; then | |
6659 | USES_CONTROLS=1 | |
6660 | fi | |
6661 | ||
6662 | if test "$wxUSE_ACCEL" = "yes"; then | |
6663 | AC_DEFINE(wxUSE_ACCEL) | |
6664 | USES_CONTROLS=1 | |
6665 | fi | |
6666 | ||
6667 | if test "$wxUSE_ANIMATIONCTRL" = "yes"; then | |
6668 | AC_DEFINE(wxUSE_ANIMATIONCTRL) | |
6669 | USES_CONTROLS=1 | |
6670 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS animate" | |
6671 | fi | |
6672 | ||
6673 | if test "$wxUSE_BUTTON" = "yes"; then | |
6674 | AC_DEFINE(wxUSE_BUTTON) | |
6675 | USES_CONTROLS=1 | |
6676 | fi | |
6677 | ||
6678 | if test "$wxUSE_BMPBUTTON" = "yes"; then | |
6679 | AC_DEFINE(wxUSE_BMPBUTTON) | |
6680 | USES_CONTROLS=1 | |
6681 | fi | |
6682 | ||
6683 | if test "$wxUSE_CALCTRL" = "yes"; then | |
6684 | AC_DEFINE(wxUSE_CALENDARCTRL) | |
6685 | USES_CONTROLS=1 | |
6686 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS calendar" | |
6687 | fi | |
6688 | ||
6689 | if test "$wxUSE_CARET" = "yes"; then | |
6690 | AC_DEFINE(wxUSE_CARET) | |
6691 | USES_CONTROLS=1 | |
6692 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS caret" | |
6693 | fi | |
6694 | ||
6695 | if test "$wxUSE_COLLPANE" = "yes"; then | |
6696 | AC_DEFINE(wxUSE_COLLPANE) | |
6697 | USES_CONTROLS=1 | |
6698 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS collpane" | |
6699 | fi | |
6700 | ||
6701 | if test "$wxUSE_COMBOBOX" = "yes"; then | |
6702 | AC_DEFINE(wxUSE_COMBOBOX) | |
6703 | USES_CONTROLS=1 | |
6704 | fi | |
6705 | ||
6706 | if test "$wxUSE_COMBOCTRL" = "yes"; then | |
6707 | AC_DEFINE(wxUSE_COMBOCTRL) | |
6708 | USES_CONTROLS=1 | |
6709 | fi | |
6710 | ||
6711 | if test "$wxUSE_CHOICE" = "yes"; then | |
6712 | AC_DEFINE(wxUSE_CHOICE) | |
6713 | USES_CONTROLS=1 | |
6714 | fi | |
6715 | ||
6716 | if test "$wxUSE_CHOICEBOOK" = "yes"; then | |
6717 | AC_DEFINE(wxUSE_CHOICEBOOK) | |
6718 | USES_CONTROLS=1 | |
6719 | fi | |
6720 | ||
6721 | if test "$wxUSE_CHECKBOX" = "yes"; then | |
6722 | AC_DEFINE(wxUSE_CHECKBOX) | |
6723 | USES_CONTROLS=1 | |
6724 | fi | |
6725 | ||
6726 | if test "$wxUSE_CHECKLST" = "yes"; then | |
6727 | AC_DEFINE(wxUSE_CHECKLISTBOX) | |
6728 | USES_CONTROLS=1 | |
6729 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS checklst" | |
6730 | fi | |
6731 | ||
6732 | if test "$wxUSE_COLOURPICKERCTRL" = "yes"; then | |
6733 | AC_DEFINE(wxUSE_COLOURPICKERCTRL) | |
6734 | USES_CONTROLS=1 | |
6735 | fi | |
6736 | ||
6737 | if test "$wxUSE_DATEPICKCTRL" = "yes"; then | |
6738 | AC_DEFINE(wxUSE_DATEPICKCTRL) | |
6739 | USES_CONTROLS=1 | |
6740 | fi | |
6741 | ||
6742 | if test "$wxUSE_DIRPICKERCTRL" = "yes"; then | |
6743 | AC_DEFINE(wxUSE_DIRPICKERCTRL) | |
6744 | USES_CONTROLS=1 | |
6745 | fi | |
6746 | ||
6747 | if test "$wxUSE_FILEPICKERCTRL" = "yes"; then | |
6748 | AC_DEFINE(wxUSE_FILEPICKERCTRL) | |
6749 | USES_CONTROLS=1 | |
6750 | fi | |
6751 | ||
6752 | if test "$wxUSE_FONTPICKERCTRL" = "yes"; then | |
6753 | AC_DEFINE(wxUSE_FONTPICKERCTRL) | |
6754 | USES_CONTROLS=1 | |
6755 | fi | |
6756 | ||
6757 | if test "$wxUSE_DISPLAY" = "yes"; then | |
6758 | AC_DEFINE(wxUSE_DISPLAY) | |
6759 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS display multimon" | |
6760 | fi | |
6761 | ||
6762 | if test "$wxUSE_DETECT_SM" = "yes"; then | |
6763 | AC_DEFINE(wxUSE_DETECT_SM) | |
6764 | fi | |
6765 | ||
6766 | if test "$wxUSE_GAUGE" = "yes"; then | |
6767 | AC_DEFINE(wxUSE_GAUGE) | |
6768 | USES_CONTROLS=1 | |
6769 | fi | |
6770 | ||
6771 | if test "$wxUSE_GRID" = "yes"; then | |
6772 | AC_DEFINE(wxUSE_GRID) | |
6773 | USES_CONTROLS=1 | |
6774 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS grid" | |
6775 | fi | |
6776 | ||
6777 | if test "$wxUSE_HYPERLINKCTRL" = "yes"; then | |
6778 | AC_DEFINE(wxUSE_HYPERLINKCTRL) | |
6779 | USES_CONTROLS=1 | |
6780 | fi | |
6781 | ||
6782 | if test "$wxUSE_BITMAPCOMBOBOX" = "yes"; then | |
6783 | AC_DEFINE(wxUSE_BITMAPCOMBOBOX) | |
6784 | USES_CONTROLS=1 | |
6785 | fi | |
6786 | ||
6787 | if test "$wxUSE_DATAVIEWCTRL" = "yes"; then | |
6788 | AC_DEFINE(wxUSE_DATAVIEWCTRL) | |
6789 | USES_CONTROLS=1 | |
6790 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dataview" | |
6791 | fi | |
6792 | ||
6793 | if test "$wxUSE_IMAGLIST" = "yes"; then | |
6794 | AC_DEFINE(wxUSE_IMAGLIST) | |
6795 | fi | |
6796 | ||
6797 | if test "$wxUSE_LISTBOOK" = "yes"; then | |
6798 | AC_DEFINE(wxUSE_LISTBOOK) | |
6799 | USES_CONTROLS=1 | |
6800 | fi | |
6801 | ||
6802 | if test "$wxUSE_LISTBOX" = "yes"; then | |
6803 | AC_DEFINE(wxUSE_LISTBOX) | |
6804 | USES_CONTROLS=1 | |
6805 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS listbox" | |
6806 | fi | |
6807 | ||
6808 | if test "$wxUSE_LISTCTRL" = "yes"; then | |
6809 | if test "$wxUSE_IMAGLIST" = "yes"; then | |
6810 | AC_DEFINE(wxUSE_LISTCTRL) | |
6811 | USES_CONTROLS=1 | |
6812 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS listctrl" | |
6813 | else | |
6814 | AC_MSG_WARN([wxListCtrl requires wxImageList and won't be compiled without it]) | |
6815 | fi | |
6816 | fi | |
6817 | ||
6818 | if test "$wxUSE_NOTEBOOK" = "yes"; then | |
6819 | AC_DEFINE(wxUSE_NOTEBOOK) | |
6820 | USES_CONTROLS=1 | |
6821 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS notebook" | |
6822 | fi | |
6823 | ||
6824 | if test "$wxUSE_ODCOMBOBOX" = "yes"; then | |
6825 | AC_DEFINE(wxUSE_ODCOMBOBOX) | |
6826 | USES_CONTROLS=1 | |
6827 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS combo" | |
6828 | fi | |
6829 | ||
6830 | dnl if test "$wxUSE_PROPSHEET" = "yes"; then | |
6831 | dnl AC_DEFINE(wxUSE_PROPSHEET) | |
6832 | dnl USES_CONTROLS=1 | |
6833 | dnl SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS proplist" | |
6834 | dnl fi | |
6835 | ||
6836 | if test "$wxUSE_RADIOBOX" = "yes"; then | |
6837 | AC_DEFINE(wxUSE_RADIOBOX) | |
6838 | USES_CONTROLS=1 | |
6839 | fi | |
6840 | ||
6841 | if test "$wxUSE_RADIOBTN" = "yes"; then | |
6842 | AC_DEFINE(wxUSE_RADIOBTN) | |
6843 | USES_CONTROLS=1 | |
6844 | fi | |
6845 | ||
6846 | if test "$wxUSE_SASH" = "yes"; then | |
6847 | AC_DEFINE(wxUSE_SASH) | |
6848 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sashtest" | |
6849 | fi | |
6850 | ||
6851 | if test "$wxUSE_SCROLLBAR" = "yes"; then | |
6852 | AC_DEFINE(wxUSE_SCROLLBAR) | |
6853 | USES_CONTROLS=1 | |
6854 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS scroll scrollsub" | |
6855 | fi | |
6856 | ||
6857 | if test "$wxUSE_SLIDER" = "yes"; then | |
6858 | AC_DEFINE(wxUSE_SLIDER) | |
6859 | USES_CONTROLS=1 | |
6860 | fi | |
6861 | ||
6862 | if test "$wxUSE_SPINBTN" = "yes"; then | |
6863 | AC_DEFINE(wxUSE_SPINBTN) | |
6864 | USES_CONTROLS=1 | |
6865 | fi | |
6866 | ||
6867 | if test "$wxUSE_SPINCTRL" = "yes"; then | |
6868 | AC_DEFINE(wxUSE_SPINCTRL) | |
6869 | USES_CONTROLS=1 | |
6870 | fi | |
6871 | ||
6872 | if test "$wxUSE_SPLITTER" = "yes"; then | |
6873 | AC_DEFINE(wxUSE_SPLITTER) | |
6874 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splitter" | |
6875 | fi | |
6876 | ||
6877 | if test "$wxUSE_STATBMP" = "yes"; then | |
6878 | AC_DEFINE(wxUSE_STATBMP) | |
6879 | USES_CONTROLS=1 | |
6880 | fi | |
6881 | ||
6882 | if test "$wxUSE_STATBOX" = "yes"; then | |
6883 | AC_DEFINE(wxUSE_STATBOX) | |
6884 | USES_CONTROLS=1 | |
6885 | fi | |
6886 | ||
6887 | if test "$wxUSE_STATTEXT" = "yes"; then | |
6888 | AC_DEFINE(wxUSE_STATTEXT) | |
6889 | USES_CONTROLS=1 | |
6890 | fi | |
6891 | ||
6892 | if test "$wxUSE_STATLINE" = "yes"; then | |
6893 | AC_DEFINE(wxUSE_STATLINE) | |
6894 | USES_CONTROLS=1 | |
6895 | fi | |
6896 | ||
6897 | if test "$wxUSE_STATUSBAR" = "yes"; then | |
6898 | dnl this will get undefined in wx/chkconf.h if it's not supported | |
6899 | AC_DEFINE(wxUSE_NATIVE_STATUSBAR) | |
6900 | AC_DEFINE(wxUSE_STATUSBAR) | |
6901 | USES_CONTROLS=1 | |
6902 | ||
6903 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS statbar" | |
6904 | fi | |
6905 | ||
6906 | if test "$wxUSE_TAB_DIALOG" = "yes"; then | |
6907 | AC_DEFINE(wxUSE_TAB_DIALOG) | |
6908 | fi | |
6909 | ||
6910 | if test "$wxUSE_TEXTCTRL" = "yes"; then | |
6911 | AC_DEFINE(wxUSE_TEXTCTRL) | |
6912 | USES_CONTROLS=1 | |
6913 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS text" | |
6914 | fi | |
6915 | ||
6916 | if test "$wxUSE_TOGGLEBTN" = "yes"; then | |
6917 | if test "$wxUSE_COCOA" = 1 ; then | |
6918 | AC_MSG_WARN([Toggle button not yet supported under Mac OS X... disabled]) | |
6919 | wxUSE_TOGGLEBTN=no | |
6920 | fi | |
6921 | ||
6922 | if test "$wxUSE_TOGGLEBTN" = "yes"; then | |
6923 | AC_DEFINE(wxUSE_TOGGLEBTN) | |
6924 | USES_CONTROLS=1 | |
6925 | fi | |
6926 | fi | |
6927 | ||
6928 | if test "$wxUSE_TOOLBAR" = "yes"; then | |
6929 | AC_DEFINE(wxUSE_TOOLBAR) | |
6930 | USES_CONTROLS=1 | |
6931 | ||
6932 | if test "$wxUSE_UNIVERSAL" = "yes"; then | |
6933 | wxUSE_TOOLBAR_NATIVE="no" | |
6934 | else | |
6935 | wxUSE_TOOLBAR_NATIVE="yes" | |
6936 | AC_DEFINE(wxUSE_TOOLBAR_NATIVE) | |
6937 | fi | |
6938 | ||
6939 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS toolbar" | |
6940 | fi | |
6941 | ||
6942 | if test "$wxUSE_TOOLTIPS" = "yes"; then | |
6943 | if test "$wxUSE_MOTIF" = 1; then | |
6944 | AC_MSG_WARN([wxTooltip not supported yet under Motif... disabled]) | |
6945 | else | |
6946 | if test "$wxUSE_UNIVERSAL" = "yes"; then | |
6947 | AC_MSG_WARN([wxTooltip not supported yet in wxUniversal... disabled]) | |
6948 | else | |
6949 | AC_DEFINE(wxUSE_TOOLTIPS) | |
6950 | fi | |
6951 | fi | |
6952 | fi | |
6953 | ||
6954 | if test "$wxUSE_TREEBOOK" = "yes"; then | |
6955 | AC_DEFINE(wxUSE_TREEBOOK) | |
6956 | USES_CONTROLS=1 | |
6957 | fi | |
6958 | ||
6959 | if test "$wxUSE_TOOLBOOK" = "yes"; then | |
6960 | AC_DEFINE(wxUSE_TOOLBOOK) | |
6961 | USES_CONTROLS=1 | |
6962 | fi | |
6963 | ||
6964 | if test "$wxUSE_TREECTRL" = "yes"; then | |
6965 | if test "$wxUSE_IMAGLIST" = "yes"; then | |
6966 | AC_DEFINE(wxUSE_TREECTRL) | |
6967 | USES_CONTROLS=1 | |
6968 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treectrl" | |
6969 | else | |
6970 | AC_MSG_WARN([wxTreeCtrl requires wxImageList and won't be compiled without it]) | |
6971 | fi | |
6972 | fi | |
6973 | ||
6974 | if test "$wxUSE_POPUPWIN" = "yes"; then | |
6975 | if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1 ; then | |
6976 | AC_MSG_WARN([Popup window not yet supported under Mac OS X... disabled]) | |
6977 | else | |
6978 | if test "$wxUSE_PM" = 1; then | |
6979 | AC_MSG_WARN([wxPopupWindow not yet supported under PM... disabled]) | |
6980 | else | |
6981 | AC_DEFINE(wxUSE_POPUPWIN) | |
6982 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS popup" | |
6983 | ||
6984 | USES_CONTROLS=1 | |
6985 | fi | |
6986 | fi | |
6987 | fi | |
6988 | ||
6989 | if test "$wxUSE_DIALUP_MANAGER" = "yes"; then | |
6990 | if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1 -o "$wxUSE_MGL" = 1; then | |
6991 | AC_MSG_WARN([Dialup manager not supported on this platform... disabled]) | |
6992 | else | |
6993 | AC_DEFINE(wxUSE_DIALUP_MANAGER) | |
6994 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dialup" | |
6995 | fi | |
6996 | fi | |
6997 | ||
6998 | if test "$wxUSE_TIPWINDOW" = "yes"; then | |
6999 | if test "$wxUSE_PM" = 1; then | |
7000 | AC_MSG_WARN([wxTipWindow not yet supported under PM... disabled]) | |
7001 | else | |
7002 | AC_DEFINE(wxUSE_TIPWINDOW) | |
7003 | fi | |
7004 | fi | |
7005 | ||
7006 | if test "$USES_CONTROLS" = 1; then | |
7007 | AC_DEFINE(wxUSE_CONTROLS) | |
7008 | fi | |
7009 | ||
7010 | dnl --------------------------------------------------------------------------- | |
7011 | dnl misc options | |
7012 | dnl --------------------------------------------------------------------------- | |
7013 | ||
7014 | dnl please keep the settings below in alphabetical order | |
7015 | if test "$wxUSE_ACCESSIBILITY" = "yes"; then | |
7016 | AC_DEFINE(wxUSE_ACCESSIBILITY) | |
7017 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS access" | |
7018 | fi | |
7019 | ||
7020 | if test "$wxUSE_DC_CACHEING" = "yes"; then | |
7021 | AC_DEFINE(wxUSE_DC_CACHEING) | |
7022 | fi | |
7023 | ||
7024 | if test "$wxUSE_DRAGIMAGE" = "yes"; then | |
7025 | AC_DEFINE(wxUSE_DRAGIMAGE) | |
7026 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dragimag" | |
7027 | fi | |
7028 | ||
7029 | if test "$wxUSE_EXCEPTIONS" = "yes"; then | |
7030 | if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then | |
7031 | AC_MSG_WARN([--enable-exceptions can't be used with --enable-no_exceptions]) | |
7032 | else | |
7033 | AC_DEFINE(wxUSE_EXCEPTIONS) | |
7034 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS except" | |
7035 | fi | |
7036 | fi | |
7037 | ||
7038 | USE_HTML=0 | |
7039 | if test "$wxUSE_HTML" = "yes"; then | |
7040 | AC_DEFINE(wxUSE_HTML) | |
7041 | USE_HTML=1 | |
7042 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html html/about html/help html/helpview html/printing html/test html/virtual html/widget html/zip htlbox" | |
7043 | if test "$wxUSE_MAC" = 1; then | |
7044 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html/htmlctrl" | |
7045 | fi | |
7046 | fi | |
7047 | if test "$wxUSE_WEBKIT" = "yes"; then | |
7048 | if test "$wxUSE_MAC" = 1 -a "$USE_DARWIN" = 1; then | |
7049 | old_CPPFLAGS="$CPPFLAGS" | |
7050 | CPPFLAGS="-x objective-c++ $CPPFLAGS" | |
7051 | AC_CHECK_HEADER([WebKit/HIWebView.h], | |
7052 | [ | |
7053 | AC_DEFINE(wxUSE_WEBKIT) | |
7054 | WEBKIT_LINK="-framework WebKit" | |
7055 | ], | |
7056 | [ | |
7057 | AC_MSG_WARN([WebKit headers not found; disabling wxWebKit]) | |
7058 | wxUSE_WEBKIT=no | |
7059 | ], | |
7060 | [#include <Carbon/Carbon.h>]) | |
7061 | CPPFLAGS="$old_CPPFLAGS" | |
7062 | elif test "$wxUSE_COCOA" = 1; then | |
7063 | AC_DEFINE(wxUSE_WEBKIT) | |
7064 | else | |
7065 | wxUSE_WEBKIT=no | |
7066 | fi | |
7067 | fi | |
7068 | ||
7069 | USE_XRC=0 | |
7070 | if test "$wxUSE_XRC" = "yes"; then | |
7071 | if test "$wxUSE_XML" != "yes"; then | |
7072 | AC_MSG_WARN([XML library not built, XRC resources disabled]) | |
7073 | wxUSE_XRC=no | |
7074 | else | |
7075 | AC_DEFINE(wxUSE_XRC) | |
7076 | USE_XRC=1 | |
7077 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS xrc" | |
7078 | fi | |
7079 | fi | |
7080 | ||
7081 | USE_AUI=0 | |
7082 | if test "$wxUSE_AUI" = "yes"; then | |
7083 | AC_DEFINE(wxUSE_AUI) | |
7084 | USE_AUI=1 | |
7085 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS aui" | |
7086 | fi | |
7087 | ||
7088 | if test "$wxUSE_MENUS" = "yes"; then | |
7089 | AC_DEFINE(wxUSE_MENUS) | |
7090 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS menu" | |
7091 | fi | |
7092 | ||
7093 | if test "$wxUSE_METAFILE" = "yes"; then | |
7094 | AC_DEFINE(wxUSE_METAFILE) | |
7095 | fi | |
7096 | ||
7097 | if test "$wxUSE_MIMETYPE" = "yes"; then | |
7098 | AC_DEFINE(wxUSE_MIMETYPE) | |
7099 | fi | |
7100 | ||
7101 | if test "$wxUSE_MINIFRAME" = "yes"; then | |
7102 | AC_DEFINE(wxUSE_MINIFRAME) | |
7103 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS minifram" | |
7104 | fi | |
7105 | ||
7106 | if test "$wxUSE_SYSTEM_OPTIONS" = "yes"; then | |
7107 | AC_DEFINE(wxUSE_SYSTEM_OPTIONS) | |
7108 | if test "$TOOLKIT" = "MSW" -o "$TOOLKIT" = "GTK" -o "$TOOLKIT" = "X11" -o \ | |
7109 | "$TOOLKIT" = "MOTIF" -o "$TOOLKIT" = "COCOA"; then | |
7110 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS taskbar" | |
7111 | fi | |
7112 | fi | |
7113 | ||
7114 | ||
7115 | if test "$wxUSE_VALIDATORS" = "yes"; then | |
7116 | AC_DEFINE(wxUSE_VALIDATORS) | |
7117 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS validate" | |
7118 | fi | |
7119 | ||
7120 | if test "$wxUSE_PALETTE" = "yes" ; then | |
7121 | AC_DEFINE(wxUSE_PALETTE) | |
7122 | fi | |
7123 | ||
7124 | if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_UNICODE_MSLU" = "yes" ; then | |
7125 | dnl Must be done this late because -lunicows must be before all the other libs | |
7126 | LIBS=" -lunicows $LIBS" | |
7127 | fi | |
7128 | ||
7129 | USE_RICHTEXT=0 | |
7130 | if test "$wxUSE_RICHTEXT" = "yes"; then | |
7131 | AC_DEFINE(wxUSE_RICHTEXT) | |
7132 | USE_RICHTEXT=1 | |
7133 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS richtext" | |
7134 | fi | |
7135 | ||
7136 | dnl --------------------------------------------------------------------------- | |
7137 | dnl wxImage options | |
7138 | dnl --------------------------------------------------------------------------- | |
7139 | ||
7140 | if test "$wxUSE_IMAGE" = "yes" ; then | |
7141 | AC_DEFINE(wxUSE_IMAGE) | |
7142 | ||
7143 | if test "$wxUSE_GIF" = "yes" ; then | |
7144 | AC_DEFINE(wxUSE_GIF) | |
7145 | fi | |
7146 | ||
7147 | if test "$wxUSE_PCX" = "yes" ; then | |
7148 | AC_DEFINE(wxUSE_PCX) | |
7149 | fi | |
7150 | ||
7151 | if test "$wxUSE_TGA" = "yes" ; then | |
7152 | AC_DEFINE(wxUSE_TGA) | |
7153 | fi | |
7154 | ||
7155 | if test "$wxUSE_IFF" = "yes" ; then | |
7156 | AC_DEFINE(wxUSE_IFF) | |
7157 | fi | |
7158 | ||
7159 | if test "$wxUSE_PNM" = "yes" ; then | |
7160 | AC_DEFINE(wxUSE_PNM) | |
7161 | fi | |
7162 | ||
7163 | if test "$wxUSE_XPM" = "yes" ; then | |
7164 | AC_DEFINE(wxUSE_XPM) | |
7165 | fi | |
7166 | ||
7167 | if test "$wxUSE_ICO_CUR" = "yes" ; then | |
7168 | AC_DEFINE(wxUSE_ICO_CUR) | |
7169 | fi | |
7170 | fi | |
7171 | ||
7172 | dnl --------------------------------------------------------------------------- | |
7173 | dnl common dialogs | |
7174 | dnl --------------------------------------------------------------------------- | |
7175 | ||
7176 | if test "$wxUSE_ABOUTDLG" = "yes"; then | |
7177 | AC_DEFINE(wxUSE_ABOUTDLG) | |
7178 | fi | |
7179 | ||
7180 | if test "$wxUSE_CHOICEDLG" = "yes"; then | |
7181 | AC_DEFINE(wxUSE_CHOICEDLG) | |
7182 | fi | |
7183 | ||
7184 | if test "$wxUSE_COLOURDLG" = "yes"; then | |
7185 | AC_DEFINE(wxUSE_COLOURDLG) | |
7186 | fi | |
7187 | ||
7188 | if test "$wxUSE_FILEDLG" = "yes"; then | |
7189 | AC_DEFINE(wxUSE_FILEDLG) | |
7190 | fi | |
7191 | ||
7192 | if test "$wxUSE_FINDREPLDLG" = "yes"; then | |
7193 | AC_DEFINE(wxUSE_FINDREPLDLG) | |
7194 | fi | |
7195 | ||
7196 | if test "$wxUSE_FONTDLG" = "yes"; then | |
7197 | AC_DEFINE(wxUSE_FONTDLG) | |
7198 | fi | |
7199 | ||
7200 | if test "$wxUSE_DIRDLG" = "yes"; then | |
7201 | if test "$wxUSE_TREECTRL" != "yes"; then | |
7202 | AC_MSG_WARN(wxDirDialog requires wxTreeCtrl so it won't be compiled without it) | |
7203 | else | |
7204 | AC_DEFINE(wxUSE_DIRDLG) | |
7205 | fi | |
7206 | fi | |
7207 | ||
7208 | if test "$wxUSE_MSGDLG" = "yes"; then | |
7209 | AC_DEFINE(wxUSE_MSGDLG) | |
7210 | fi | |
7211 | ||
7212 | if test "$wxUSE_NUMBERDLG" = "yes"; then | |
7213 | AC_DEFINE(wxUSE_NUMBERDLG) | |
7214 | fi | |
7215 | ||
7216 | if test "$wxUSE_PROGRESSDLG" = "yes"; then | |
7217 | if test "$wxUSE_CONSTRAINTS" != "yes"; then | |
7218 | AC_MSG_WARN(wxProgressDialog requires constraints so it won't be compiled without them) | |
7219 | else | |
7220 | AC_DEFINE(wxUSE_PROGRESSDLG) | |
7221 | fi | |
7222 | fi | |
7223 | ||
7224 | if test "$wxUSE_SPLASH" = "yes"; then | |
7225 | AC_DEFINE(wxUSE_SPLASH) | |
7226 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splash" | |
7227 | fi | |
7228 | ||
7229 | if test "$wxUSE_STARTUP_TIPS" = "yes"; then | |
7230 | if test "$wxUSE_CONSTRAINTS" != "yes"; then | |
7231 | AC_MSG_WARN(Startup tips requires constraints and won't be compiled without them) | |
7232 | else | |
7233 | AC_DEFINE(wxUSE_STARTUP_TIPS) | |
7234 | fi | |
7235 | fi | |
7236 | ||
7237 | if test "$wxUSE_TEXTDLG" = "yes"; then | |
7238 | AC_DEFINE(wxUSE_TEXTDLG) | |
7239 | fi | |
7240 | ||
7241 | if test "$wxUSE_WIZARDDLG" = "yes"; then | |
7242 | AC_DEFINE(wxUSE_WIZARDDLG) | |
7243 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS wizard" | |
7244 | fi | |
7245 | ||
7246 | dnl --------------------------------------------------------------------------- | |
7247 | dnl wxGraphicsContext | |
7248 | dnl --------------------------------------------------------------------------- | |
7249 | ||
7250 | if test "$wxUSE_GRAPHICS_CONTEXT" = "yes"; then | |
7251 | if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = "1"; then | |
7252 | AC_DEFINE(wxUSE_GRAPHICS_CONTEXT) | |
7253 | elif test "$wxUSE_GTK" != 1; then | |
7254 | dnl for other builds we'll just wing it for now... | |
7255 | AC_DEFINE(wxUSE_GRAPHICS_CONTEXT) | |
7256 | else | |
7257 | dnl ...but let's check for cairo availability for wxGTK builds | |
7258 | PKG_CHECK_MODULES(CAIRO, cairo, | |
7259 | [AC_DEFINE(wxUSE_GRAPHICS_CONTEXT)], | |
7260 | [AC_MSG_WARN([Cairo library not found, unable to set wxUSE_GRAPHICS_CONTEXT])] | |
7261 | ) | |
7262 | fi | |
7263 | fi | |
7264 | ||
7265 | dnl --------------------------------------------------------------------------- | |
7266 | dnl wxMediaCtrl | |
7267 | dnl --------------------------------------------------------------------------- | |
7268 | ||
7269 | USE_MEDIA=0 | |
7270 | ||
7271 | if test "$wxUSE_MEDIACTRL" = "yes"; then | |
7272 | USE_MEDIA=1 | |
7273 | ||
7274 | dnl ----------------------------------------------------------------------- | |
7275 | dnl GStreamer | |
7276 | dnl ----------------------------------------------------------------------- | |
7277 | if test "$wxUSE_GTK" = 1; then | |
7278 | wxUSE_GSTREAMER="no" | |
7279 | ||
7280 | dnl ------------------------------------------------------------------- | |
7281 | dnl Test for at least 0.8 gstreamer module from pkg-config | |
7282 | dnl Even totem doesn't accept 0.9 evidently. | |
7283 | dnl | |
7284 | dnl So, we first check to see if 0.10 if available - if not we | |
7285 | dnl try the older 0.8 version | |
7286 | dnl ------------------------------------------------------------------- | |
7287 | GST_VERSION_MAJOR=0 | |
7288 | GST_VERSION_MINOR=10 | |
7289 | GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR | |
7290 | ||
7291 | if test "$wxUSE_GSTREAMER8" = "no"; then | |
7292 | PKG_CHECK_MODULES(GST, | |
7293 | [gstreamer-$GST_VERSION gstreamer-plugins-base-$GST_VERSION gconf-2.0], | |
7294 | [ | |
7295 | wxUSE_GSTREAMER="yes" | |
7296 | GST_LIBS="$GST_LIBS -lgstinterfaces-$GST_VERSION" | |
7297 | ], | |
7298 | [ | |
7299 | AC_MSG_WARN([GStreamer 0.10 not available, falling back to 0.8]) | |
7300 | GST_VERSION_MINOR=8 | |
7301 | ] | |
7302 | ) | |
7303 | else | |
7304 | dnl check only for 0.8 | |
7305 | GST_VERSION_MINOR=8 | |
7306 | fi | |
7307 | ||
7308 | if test $GST_VERSION_MINOR = "8"; then | |
7309 | GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR | |
7310 | PKG_CHECK_MODULES(GST, | |
7311 | [gstreamer-$GST_VERSION gstreamer-interfaces-$GST_VERSION gstreamer-gconf-$GST_VERSION], | |
7312 | wxUSE_GSTREAMER="yes", | |
7313 | [ | |
7314 | AC_MSG_WARN([GStreamer 0.8/0.10 not available.]) | |
7315 | ]) | |
7316 | fi | |
7317 | ||
7318 | ||
7319 | if test "$wxUSE_GSTREAMER" = "yes"; then | |
7320 | dnl system gstreamer package is compiled with Sun CC and outputs | |
7321 | dnl CC-specific "-mt" in its flags, remove it for gcc compilation | |
7322 | case "${host}" in | |
7323 | *-*-solaris2* ) | |
7324 | if "$GCC" = yes; then | |
7325 | GST_CFLAGS=`echo $GST_CFLAGS | sed 's/-mt//'` | |
7326 | GST_LIBS=`echo $GST_LIBS | sed 's/-mt//'` | |
7327 | fi | |
7328 | esac | |
7329 | ||
7330 | CPPFLAGS="$GST_CFLAGS $CPPFLAGS" | |
7331 | LIBS="$GST_LIBS $LIBS" | |
7332 | ||
7333 | AC_DEFINE(wxUSE_GSTREAMER) | |
7334 | else | |
7335 | USE_MEDIA=0 | |
7336 | fi | |
7337 | fi | |
7338 | ||
7339 | if test $USE_MEDIA = 1; then | |
7340 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mediaplayer" | |
7341 | AC_DEFINE(wxUSE_MEDIACTRL) | |
7342 | fi | |
7343 | fi | |
7344 | ||
7345 | dnl --------------------------------------------------------------------------- | |
7346 | dnl get the string with OS info - used by wxGetOsDescription() on MacOS X | |
7347 | dnl --------------------------------------------------------------------------- | |
7348 | ||
7349 | if test "$cross_compiling" = "yes"; then | |
7350 | dnl Use best guess from host as we can't use uname when cross compiling | |
7351 | OSINFO="\"$host\"" | |
7352 | else | |
7353 | dnl attualy work out OS version | |
7354 | OSINFO=`uname -s -r -m` | |
7355 | OSINFO="\"$OSINFO\"" | |
7356 | fi | |
7357 | ||
7358 | AC_DEFINE_UNQUOTED(WXWIN_OS_DESCRIPTION, $OSINFO) | |
7359 | ||
7360 | dnl --------------------------------------------------------------------------- | |
7361 | dnl define the variable containing the installation prefix (used in dcpsg.cpp) | |
7362 | dnl --------------------------------------------------------------------------- | |
7363 | ||
7364 | if test "x$prefix" != "xNONE"; then | |
7365 | wxPREFIX=$prefix | |
7366 | else | |
7367 | wxPREFIX=$ac_default_prefix | |
7368 | fi | |
7369 | ||
7370 | AC_DEFINE_UNQUOTED(wxINSTALL_PREFIX, "$wxPREFIX") | |
7371 | ||
7372 | ||
7373 | dnl --------------------------------------------------------------------------- | |
7374 | dnl define variables with all built libraries for wx-config | |
7375 | dnl --------------------------------------------------------------------------- | |
7376 | ||
7377 | CORE_BASE_LIBS="net base" | |
7378 | CORE_GUI_LIBS="adv core" | |
7379 | ||
7380 | if test "$wxUSE_XML" = "yes" ; then | |
7381 | CORE_BASE_LIBS="xml $CORE_BASE_LIBS" | |
7382 | fi | |
7383 | if test "$wxUSE_ODBC" != "no" ; then | |
7384 | CORE_BASE_LIBS="odbc $CORE_BASE_LIBS" | |
7385 | CORE_GUI_LIBS="dbgrid $CORE_GUI_LIBS" | |
7386 | fi | |
7387 | if test "$wxUSE_HTML" = "yes" ; then | |
7388 | CORE_GUI_LIBS="html $CORE_GUI_LIBS" | |
7389 | fi | |
7390 | if test "$wxUSE_DEBUGREPORT" = "yes" ; then | |
7391 | CORE_GUI_LIBS="qa $CORE_GUI_LIBS" | |
7392 | fi | |
7393 | if test "$wxUSE_XRC" = "yes" ; then | |
7394 | CORE_GUI_LIBS="xrc $CORE_GUI_LIBS" | |
7395 | fi | |
7396 | if test "$wxUSE_AUI" = "yes" ; then | |
7397 | CORE_GUI_LIBS="aui $CORE_GUI_LIBS" | |
7398 | fi | |
7399 | ||
7400 | if test "$wxUSE_GUI" != "yes"; then | |
7401 | CORE_GUI_LIBS="" | |
7402 | fi | |
7403 | ||
7404 | AC_SUBST(CORE_BASE_LIBS) | |
7405 | AC_SUBST(CORE_GUI_LIBS) | |
7406 | ||
7407 | dnl --------------------------------------------------------------------------- | |
7408 | dnl Output the makefiles and such from the results found above | |
7409 | dnl --------------------------------------------------------------------------- | |
7410 | ||
7411 | dnl all additional libraries (except wxWidgets itself) we link with | |
7412 | ||
7413 | if test "$wxUSE_MAC" = 1 ; then | |
7414 | if test "$wxUSE_SOUND" = "yes" || test "$wxUSE_MEDIACTRL" = "yes"; then | |
7415 | if test "$USE_DARWIN" = 1; then | |
7416 | LDFLAGS="$LDFLAGS -framework QuickTime" | |
7417 | else | |
7418 | LDFLAGS="$LDFLAGS -lQuickTimeLib" | |
7419 | fi | |
7420 | fi | |
7421 | if test "$USE_DARWIN" = 1; then | |
7422 | LDFLAGS="$LDFLAGS -framework IOKit -framework Carbon -framework Cocoa -framework System" | |
7423 | else | |
7424 | LDFLAGS="$LDFLAGS -lCarbonLib" | |
7425 | fi | |
7426 | fi | |
7427 | if test "$wxUSE_COCOA" = 1 ; then | |
7428 | LDFLAGS="$LDFLAGS -framework IOKit -framework Cocoa" | |
7429 | if test "$wxUSE_MEDIACTRL" = "yes"; then | |
7430 | LDFLAGS="$LDFLAGS -framework QuickTime" | |
7431 | fi | |
7432 | fi | |
7433 | if test "$USE_DARWIN" = 1 -a "$wxUSE_MAC" != 1 -a "$wxUSE_COCOA" != 1 ; then | |
7434 | LDFLAGS="$LDFLAGS -framework IOKit -framework CoreServices -framework System -framework ApplicationServices" | |
7435 | fi | |
7436 | ||
7437 | LIBS="$ZLIB_LINK $POSIX4_LINK $INET_LINK $WCHAR_LINK $DL_LINK $LIBS" | |
7438 | ||
7439 | if test "$wxUSE_GUI" = "yes"; then | |
7440 | ||
7441 | dnl TODO add checks that these samples will really compile (i.e. all the | |
7442 | dnl library features they need are present) | |
7443 | ||
7444 | dnl TODO some samples are never built so far: mfc (requires VC++) | |
7445 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS artprov controls dialogs drawing \ | |
7446 | dynamic erase event exec font image minimal mobile \ | |
7447 | mobile/wxedit mobile/styles propsize render \ | |
7448 | rotate shaped vscroll widgets" | |
7449 | ||
7450 | if test "$wxUSE_MONOLITHIC" != "yes"; then | |
7451 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS console" | |
7452 | fi | |
7453 | if test "$TOOLKIT" = "MSW"; then | |
7454 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS regtest" | |
7455 | if test "$wxUSE_UNIVERSAL" != "yes"; then | |
7456 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ownerdrw nativdlg" | |
7457 | fi | |
7458 | fi | |
7459 | if test "$TOOLKIT" = "PM" -a "$wxUSE_UNIVERSAL" != "yes"; then | |
7460 | SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS ownerdrw" | |
7461 | fi | |
7462 | else | |
7463 | SAMPLES_SUBDIRS="console" | |
7464 | fi | |
7465 | ||
7466 | ||
7467 | dnl C/C++ compiler options used to compile wxWidgets | |
7468 | dnl | |
7469 | dnl check for icc before gcc as icc is also recognized as gcc | |
7470 | if test "x$INTELCC" = "xyes" ; then | |
7471 | dnl Warnings which can't be easily suppressed in C code are disabled: | |
7472 | dnl | |
7473 | dnl remark #810: conversion from "x" to "y" may lose significant bits | |
7474 | dnl remark #869: parameter "foo" was never referenced | |
7475 | dnl remark #1572: floating-point equality and inequality comparisons | |
7476 | dnl are unreliable | |
7477 | dnl remark #1684: conversion from pointer to same-sized integral type | |
7478 | dnl | |
7479 | dnl (for others see below) | |
7480 | CWARNINGS="-Wall -wd810,869,981,1418,1572,1684" | |
7481 | elif test "$GCC" = yes ; then | |
7482 | CWARNINGS="-Wall -Wundef" | |
7483 | fi | |
7484 | ||
7485 | if test "x$INTELCXX" = "xyes" ; then | |
7486 | dnl Intel compiler gives some warnings which simply can't be worked | |
7487 | dnl around or of which we have too many (810, 869) so it's impractical to | |
7488 | dnl keep them enabled even if in theory it would be nice and some others | |
7489 | dnl (279) are generated for standard macros and so there is nothing we can | |
7490 | dnl do about them | |
7491 | dnl | |
7492 | dnl remark #279: controlling expression is constant | |
7493 | dnl remark #383: value copied to temporary, reference to temporary used | |
7494 | dnl remark #444: destructor for base class "xxx" is not virtual | |
7495 | dnl remark #810: conversion from "x" to "y" may lose significant bits | |
7496 | dnl remark #869: parameter "foo" was never referenced | |
7497 | dnl remark #981: operands are evaluated in unspecified order | |
7498 | dnl remark #1418: external definition with no prior declaration | |
7499 | dnl remark #1419: external declaration in primary source file | |
7500 | CXXWARNINGS="-Wall -wd279,383,444,810,869,981,1418,1419" | |
7501 | elif test "$GXX" = yes ; then | |
7502 | dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror" | |
7503 | CXXWARNINGS="-Wall -Wundef -Wno-ctor-dtor-privacy" | |
7504 | fi | |
7505 | ||
7506 | ||
7507 | dnl combine everything together and remove the extra white space while doing it | |
7508 | WXCONFIG_CFLAGS=`echo $WXCONFIG_CFLAGS` | |
7509 | WXCONFIG_CXXFLAGS=`echo $WXCONFIG_CFLAGS $WXCONFIG_CXXFLAGS` | |
7510 | ||
7511 | ||
7512 | dnl add -I options we use during library compilation | |
7513 | dnl | |
7514 | dnl note that the order is somewhat important: wxWidgets headers should | |
7515 | dnl come first and the one with setup.h should be before $(top_srcdir)/include | |
7516 | dnl in case the latter contains setup.h used by non-autoconf makefiles (e.g. | |
7517 | dnl CodeWarrior): | |
7518 | CPPFLAGS=`echo $WXCONFIG_CPPFLAGS \ | |
7519 | -I\\${wx_top_builddir}/lib/wx/include/${TOOLCHAIN_FULLNAME} \ | |
7520 | -I\\${top_srcdir}/include $TOOLKIT_INCLUDE \ | |
7521 | $CPPFLAGS ` | |
7522 | ||
7523 | C_AND_CXX_FLAGS="$DEBUG_CFLAGS $PROFILE_FLAGS $OPTIMISE_CFLAGS" | |
7524 | CFLAGS=`echo $WXCONFIG_CFLAGS $CWARNINGS $C_AND_CXX_FLAGS $CFLAGS ` | |
7525 | CXXFLAGS=`echo $WXCONFIG_CXXFLAGS $CXXWARNINGS $C_AND_CXX_FLAGS $CXXFLAGS ` | |
7526 | ||
7527 | dnl now that we added WXCONFIG_CPPFLAGS to CPPFLAGS we can add the wx-config | |
7528 | dnl only stuff to it | |
7529 | WXCONFIG_CPPFLAGS=`echo $WXCONFIG_CPPFLAGS $WXCONFIG_ONLY_CPPFLAGS` | |
7530 | ||
7531 | ||
7532 | if test "x$MWCC" = "xyes"; then | |
7533 | dnl Correct MW 8.3 to be more similar to GCC. In particular we | |
7534 | dnl must use <regex.h> from system not our local copy on OS X, | |
7535 | dnl but must use local not system on OS 9. | |
7536 | dnl The following should make all -I paths usable for <> includes | |
7537 | dnl while first checking in real system paths. With 8.3 using | |
7538 | dnl -gccincludes it will actually check local paths before system | |
7539 | dnl even for <> which is totally wrong. | |
7540 | ||
7541 | dnl Note that because this absolutely needs to be before any -I | |
7542 | dnl that we have to tack it on to the end of the compiler commandline. | |
7543 | CC="$CC -cwd source -I-" | |
7544 | CXX="$CXX -cwd source -I-" | |
7545 | fi | |
7546 | ||
7547 | ||
7548 | LIBS=`echo $LIBS` | |
7549 | EXTRALIBS="$LDFLAGS $LDFLAGS_VERSIONING $LIBS $DMALLOC_LIBS" | |
7550 | EXTRALIBS_XML="$EXPAT_LINK" | |
7551 | EXTRALIBS_HTML="$MSPACK_LINK" | |
7552 | EXTRALIBS_ODBC="$ODBC_LINK" | |
7553 | if test "$wxUSE_GUI" = "yes"; then | |
7554 | EXTRALIBS_GUI=`echo $GUI_TK_LIBRARY $PNG_LINK $JPEG_LINK $TIFF_LINK $WEBKIT_LINK $EXTRALIBS_HILDON $EXTRALIBS_GNOMEVFS $EXTRALIBS_GNOMEPRINT` | |
7555 | fi | |
7556 | if test "$wxUSE_OPENGL" = "yes"; then | |
7557 | EXTRALIBS_OPENGL="$LDFLAGS_GL $OPENGL_LIBS" | |
7558 | fi | |
7559 | ||
7560 | LDFLAGS="$LDFLAGS $PROFILE_FLAGS" | |
7561 | ||
7562 | WXCONFIG_LIBS="$LIBS" | |
7563 | ||
7564 | dnl wx-config must output builtin 3rd party libs in --libs in static build: | |
7565 | if test "$wxUSE_REGEX" = "builtin" ; then | |
7566 | wxconfig_3rdparty="regex${lib_unicode_suffix} $wxconfig_3rdparty" | |
7567 | fi | |
7568 | if test "$wxUSE_EXPAT" = "builtin" ; then | |
7569 | wxconfig_3rdparty="expat $wxconfig_3rdparty" | |
7570 | fi | |
7571 | if test "$wxUSE_ODBC" = "builtin" ; then | |
7572 | wxconfig_3rdparty="odbc $wxconfig_3rdparty" | |
7573 | fi | |
7574 | if test "$wxUSE_LIBTIFF" = "builtin" ; then | |
7575 | wxconfig_3rdparty="tiff $wxconfig_3rdparty" | |
7576 | fi | |
7577 | if test "$wxUSE_LIBJPEG" = "builtin" ; then | |
7578 | wxconfig_3rdparty="jpeg $wxconfig_3rdparty" | |
7579 | fi | |
7580 | if test "$wxUSE_LIBPNG" = "builtin" ; then | |
7581 | wxconfig_3rdparty="png $wxconfig_3rdparty" | |
7582 | fi | |
7583 | if test "$wxUSE_ZLIB" = "builtin" ; then | |
7584 | wxconfig_3rdparty="zlib $wxconfig_3rdparty" | |
7585 | fi | |
7586 | ||
7587 | for i in $wxconfig_3rdparty ; do | |
7588 | WXCONFIG_LIBS="-lwx${i}${lib_debug_suffix}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX} $WXCONFIG_LIBS" | |
7589 | done | |
7590 | ||
7591 | ||
7592 | if test "x$wxUSE_UNIVERSAL" = "xyes" ; then | |
7593 | WXUNIV=1 | |
7594 | ||
7595 | case "$wxUNIV_THEMES" in | |
7596 | ''|all) | |
7597 | AC_DEFINE(wxUSE_ALL_THEMES) | |
7598 | ;; | |
7599 | ||
7600 | *) | |
7601 | for t in `echo $wxUNIV_THEMES | tr , ' ' | tr a-z A-Z`; do | |
7602 | AC_DEFINE_UNQUOTED(wxUSE_THEME_$t) | |
7603 | done | |
7604 | esac | |
7605 | else | |
7606 | WXUNIV=0 | |
7607 | fi | |
7608 | ||
7609 | AC_SUBST(wxUSE_ZLIB) | |
7610 | AC_SUBST(wxUSE_REGEX) | |
7611 | AC_SUBST(wxUSE_EXPAT) | |
7612 | AC_SUBST(wxUSE_ODBC) | |
7613 | AC_SUBST(wxUSE_LIBJPEG) | |
7614 | AC_SUBST(wxUSE_LIBPNG) | |
7615 | AC_SUBST(wxUSE_LIBTIFF) | |
7616 | ||
7617 | if test $wxUSE_MONOLITHIC = "yes" ; then | |
7618 | MONOLITHIC=1 | |
7619 | else | |
7620 | MONOLITHIC=0 | |
7621 | fi | |
7622 | ||
7623 | if test $wxUSE_PLUGINS = "yes" ; then | |
7624 | USE_PLUGINS=1 | |
7625 | else | |
7626 | USE_PLUGINS=0 | |
7627 | fi | |
7628 | ||
7629 | if test $wxUSE_ODBC != "no" ; then | |
7630 | USE_ODBC=1 | |
7631 | else | |
7632 | USE_ODBC=0 | |
7633 | fi | |
7634 | ||
7635 | if test "$wxUSE_DEBUGREPORT" = "yes" ; then | |
7636 | USE_QA=1 | |
7637 | else | |
7638 | USE_QA=0 | |
7639 | fi | |
7640 | ||
7641 | if test $wxUSE_OFFICIAL_BUILD = "yes" ; then | |
7642 | OFFICIAL_BUILD=1 | |
7643 | else | |
7644 | OFFICIAL_BUILD=0 | |
7645 | fi | |
7646 | ||
7647 | AC_SUBST(VENDOR) | |
7648 | AC_SUBST(OFFICIAL_BUILD) | |
7649 | AC_SUBST(WX_FLAVOUR) | |
7650 | AC_SUBST(WX_LIB_FLAVOUR) | |
7651 | ||
7652 | AC_SUBST(WXUNIV) | |
7653 | AC_SUBST(MONOLITHIC) | |
7654 | AC_SUBST(USE_PLUGINS) | |
7655 | AC_SUBST(LIBS) | |
7656 | AC_SUBST(EXTRALIBS) | |
7657 | AC_SUBST(EXTRALIBS_XML) | |
7658 | AC_SUBST(EXTRALIBS_HTML) | |
7659 | AC_SUBST(EXTRALIBS_ODBC) | |
7660 | AC_SUBST(EXTRALIBS_GUI) | |
7661 | AC_SUBST(EXTRALIBS_OPENGL) | |
7662 | AC_SUBST(EXTRALIBS_SDL) | |
7663 | AC_SUBST(WITH_PLUGIN_SDL) | |
7664 | AC_SUBST(EXTRALIBS_GNOMEPRINT) | |
7665 | AC_SUBST(EXTRALIBS_GNOMEVFS) | |
7666 | AC_SUBST(EXTRALIBS_HILDON) | |
7667 | AC_SUBST(UNICODE) | |
7668 | AC_SUBST(BUILD) | |
7669 | AC_SUBST(DEBUG_INFO) | |
7670 | AC_SUBST(DEBUG_FLAG) | |
7671 | TOOLKIT_LOWERCASE=`echo $TOOLKIT | tr "[[A-Z]]" "[[a-z]]"` | |
7672 | AC_SUBST(TOOLKIT_LOWERCASE) | |
7673 | AC_SUBST(TOOLKIT_VERSION) | |
7674 | AC_SUBST(SAMPLES_RPATH_FLAG) | |
7675 | AC_SUBST(SAMPLES_RPATH_POSTLINK) | |
7676 | AC_SUBST(HOST_SUFFIX) | |
7677 | AC_SUBST(CPPUNIT_CFLAGS) | |
7678 | AC_SUBST(CPPUNIT_LIBS) | |
7679 | ||
7680 | case "$TOOLKIT" in | |
7681 | GTK) | |
7682 | TOOLKIT_DESC="GTK+" | |
7683 | if test "$WXGTK20" = 1; then | |
7684 | TOOLKIT_DESC="$TOOLKIT_DESC 2" | |
7685 | if test "$wxUSE_LIBGNOMEPRINT" = "yes" ; then | |
7686 | TOOLKIT_EXTRA="$TOOLKIT_EXTRA gnomeprint"; | |
7687 | fi | |
7688 | if test "$wxUSE_LIBGNOMEVFS" = "yes" ; then | |
7689 | TOOLKIT_EXTRA="$TOOLKIT_EXTRA gnomevfs" | |
7690 | fi | |
7691 | if test "$wxUSE_LIBHILDON" = "yes"; then | |
7692 | TOOLKIT_EXTRA="$TOOLKIT_EXTRA hildon" | |
7693 | fi | |
7694 | ||
7695 | if test "$TOOLKIT_EXTRA" != ""; then | |
7696 | TOOLKIT_DESC="$TOOLKIT_DESC with support for `echo $TOOLKIT_EXTRA | tr -s ' '`" | |
7697 | fi | |
7698 | fi | |
7699 | ;; | |
7700 | ||
7701 | ?*) | |
7702 | TOOLKIT_DESC=$TOOLKIT_LOWERCASE | |
7703 | ;; | |
7704 | ||
7705 | *) | |
7706 | TOOLKIT_DESC="base only" | |
7707 | ;; | |
7708 | esac | |
7709 | ||
7710 | if test "$wxUSE_WINE" = "yes"; then | |
7711 | BAKEFILE_FORCE_PLATFORM=win32 | |
7712 | fi | |
7713 | ||
7714 | dnl --------------------------------------------------------------------------- | |
7715 | dnl Add Universal binary support | |
7716 | dnl Note we don't do this earlier because adding these cpp/ld flags could | |
7717 | dnl cause configure tests to fail. | |
7718 | dnl --------------------------------------------------------------------------- | |
7719 | if test "$wxUSE_MAC" = 1 ; then | |
7720 | if test "x$wxUSE_UNIVERSAL_BINARY" != xno ; then | |
7721 | dnl --enable-universal_binary uses a default SDK (currently 10.4u) | |
7722 | dnl --enable-universal_binary=SDK names a path to an SDK | |
7723 | if test "x$wxUSE_UNIVERSAL_BINARY" == xyes; then | |
7724 | OSX_UNIV_OPTS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk" | |
7725 | else | |
7726 | dnl '' would mean universal with no SDK, which may be the case if | |
7727 | dnl the compiler uses a sysroot by default | |
7728 | OSX_UNIV_OPTS=${wxUSE_UNIVERSAL_BINARY:+"-isysroot '$wxUSE_UNIVERSAL_BINARY'"} | |
7729 | fi | |
7730 | OSX_UNIV_OPTS="$OSX_UNIV_OPTS -arch ppc -arch i386" | |
7731 | CXXFLAGS="$OSX_UNIV_OPTS $CXXFLAGS" | |
7732 | CFLAGS="$OSX_UNIV_OPTS $CFLAGS" | |
7733 | LDFLAGS="$OSX_UNIV_OPTS $LDFLAGS" | |
7734 | bk_use_pch=no | |
7735 | fi | |
7736 | # TODO: where do we add "-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" for libtool (static builds only)? | |
7737 | # The makefile currently uses AR and RANLIB, which libtool apparently supercedes. | |
7738 | fi | |
7739 | ||
7740 | dnl gcc 3.4 has a pch bug which truncates wide character constants in headers. | |
7741 | dnl Hopefully for a non-unicode build there aren't any wide constants in | |
7742 | dnl headers, but for a unicode build it's best to disable pch. | |
7743 | if test "$wxUSE_UNICODE" = yes -a "$GCC" = yes -a "$bk_use_pch" != no | |
7744 | then | |
7745 | AC_CACHE_CHECK( | |
7746 | [for gcc precompiled header bug], | |
7747 | [wx_cv_gcc_pch_bug], | |
7748 | [[ | |
7749 | echo '#include <stdio.h> | |
7750 | const wchar_t test_var[] = L"awidetest";' > conftest.h | |
7751 | ||
7752 | echo '#include "conftest.h" | |
7753 | int main() | |
7754 | { | |
7755 | printf("%ls", test_var); | |
7756 | return 0; | |
7757 | }' > conftest.cpp | |
7758 | ||
7759 | wx_cv_gcc_pch_bug="pch not supported" | |
7760 | ||
7761 | if $CXX conftest.h >/dev/null 2>&1 | |
7762 | then | |
7763 | wx_cv_gcc_pch_bug= | |
7764 | ||
7765 | if $CXX -o conftest$PROGRAM_EXT conftest.cpp >/dev/null 2>&1 | |
7766 | then | |
7767 | if tr -dc '[a-z]' < conftest$PROGRAM_EXT | | |
7768 | grep awidetest >/dev/null | |
7769 | then | |
7770 | wx_cv_gcc_pch_bug=no | |
7771 | else | |
7772 | wx_cv_gcc_pch_bug=yes | |
7773 | fi | |
7774 | fi | |
7775 | fi | |
7776 | ||
7777 | rm -f conftest.h conftest.gch conftest.cpp conftest$PROGRAM_EXT | |
7778 | ]]) | |
7779 | ||
7780 | if test "$wx_cv_gcc_pch_bug" = yes; then | |
7781 | dnl make the default for pch 'no' | |
7782 | dnl further below check whether the user overrode and warn them | |
7783 | bk_use_pch=no | |
7784 | fi | |
7785 | fi | |
7786 | ||
7787 | AC_BAKEFILE([m4_include(autoconf_inc.m4)]) | |
7788 | ||
7789 | dnl find out if the compiler supports PCH | |
7790 | dnl | |
7791 | dnl TODO: this should be in bakefile | |
7792 | if test $GCC_PCH = 1 | |
7793 | then | |
7794 | if test "$wx_cv_gcc_pch_bug" = yes; then | |
7795 | AC_MSG_WARN([*** Precompiled header support is broken on this compiler]) | |
7796 | AC_MSG_WARN([*** --enable-precomp-headers is not recommended]) | |
7797 | AC_MSG_WARN([*** see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13361]) | |
7798 | fi | |
7799 | ||
7800 | CPPFLAGS="-DWX_PRECOMP $CPPFLAGS" | |
7801 | fi | |
7802 | ||
7803 | dnl HACK ALERT!! | |
7804 | dnl For now, we need to alter bk-deps not to generate deps | |
7805 | dnl when we've configured a Universal binary build. | |
7806 | dnl The next version of Bakefile will have the correct fix for this | |
7807 | dnl at which time, this hack can be removed. | |
7808 | ||
7809 | if test "$wxUSE_MAC" = 1 ; then | |
7810 | if test "x$wxUSE_UNIVERSAL_BINARY" != "xno" ; then | |
7811 | sed "s/DEPSMODE=gcc/DEPSMODE=none/" < bk-deps > temp | |
7812 | mv temp bk-deps | |
7813 | chmod +x bk-deps | |
7814 | fi | |
7815 | fi | |
7816 | ||
7817 | if test "$wxUSE_SHARED" = "yes"; then | |
7818 | ||
7819 | dnl We get the shared build linker from bakefile, since it | |
7820 | dnl moved all the logic for this out of this file and into | |
7821 | dnl its own macro. But it can't decide on whether to return | |
7822 | dnl us $(VAR), ${VAR}, or the present expansion of VAR. | |
7823 | dnl So normalise and expand everything here now, because its | |
7824 | dnl not going to change inside wx-config anyway. | |
7825 | sanitised_bakefile_mess=`echo "$SHARED_LD_CXX" | tr -d '()'` | |
7826 | EXE_LINKER=`eval echo "$sanitised_bakefile_mess"` | |
7827 | ||
7828 | dnl Need addtional flag on OS/2, so override bakefiles value | |
7829 | dnl (there currently is no suitable variable to which the | |
7830 | dnl missing flags could be added, AFAICS. SN, 18.12.2004. ) | |
7831 | case "${host}" in | |
7832 | *-pc-os2_emx | *-pc-os2-emx ) | |
7833 | SHARED_LD_CC="`pwd`/dllar.sh -name-mangler-script ./dllnames.sh -libf INITINSTANCE -libf TERMINSTANCE -o" | |
7834 | SHARED_LD_CXX="`pwd`/dllar.sh -name-mangler-script ./dllnames.sh -libf INITINSTANCE -libf TERMINSTANCE -o" | |
7835 | cp -p ${srcdir}/src/os2/dllnames.sh . | |
7836 | cp -p ${srcdir}/src/os2/dllar.sh . | |
7837 | ;; | |
7838 | esac | |
7839 | else | |
7840 | ||
7841 | dnl No bakefile support for static builds, but this should be ok for most. | |
7842 | EXE_LINKER="$CXX -o" | |
7843 | ||
7844 | fi | |
7845 | if test "$wxUSE_OMF" = "yes"; then | |
7846 | case "${host}" in | |
7847 | *-pc-os2_emx | *-pc-os2-emx ) | |
7848 | LDFLAGS="$LDFLAGS -Zlinker /EXEPACK" | |
7849 | LDFLAGS_GUI="-Zlinker /PMTYPE:PM" | |
7850 | WXCONFIG_LDFLAGS_GUI="-Zlinker /PMTYPE:PM" | |
7851 | ;; | |
7852 | esac | |
7853 | fi | |
7854 | ||
7855 | dnl TOOLCHAIN_DEFS should be used for both wx and client code | |
7856 | WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS $TOOLCHAIN_DEFS" | |
7857 | ||
7858 | dnl for convenience, sort the samples in alphabetical order | |
7859 | dnl | |
7860 | dnl FIXME For some mysterious reasons, sometimes the directories are duplicated | |
7861 | dnl in this list - hence uniq. But normally, this shouldn't be needed! | |
7862 | dnl | |
7863 | dnl Unfortunately, there is a bug in OS/2's tr, such that | |
7864 | dnl tr ' ' '\n' introduces DOS-like line breaks, whereas tr '\n' ' ' | |
7865 | dnl only removes the Unix-like part of the introduced line break. | |
7866 | SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq | tr '\n' ' '| tr -d '\r'`" | |
7867 | ||
7868 | dnl subtle bakefile goop. | |
7869 | dnl Used in wx-config now too, as its STATIC_FLAG with different makeup. | |
7870 | dnl I wish we would have called it something less likely to clash with | |
7871 | dnl things though. | |
7872 | AC_SUBST(SHARED) | |
7873 | ||
7874 | dnl global options | |
7875 | AC_SUBST(WX_LIBRARY_BASENAME_NOGUI) | |
7876 | AC_SUBST(WX_LIBRARY_BASENAME_GUI) | |
7877 | ||
7878 | dnl toolkit options | |
7879 | AC_SUBST(USE_GUI) | |
7880 | AC_SUBST(AFMINSTALL) | |
7881 | AC_SUBST(WIN32INSTALL) | |
7882 | AC_SUBST(TOOLKIT) | |
7883 | AC_SUBST(TOOLKIT_DIR) | |
7884 | AC_SUBST(TOOLCHAIN_NAME) | |
7885 | AC_SUBST(TOOLCHAIN_FULLNAME) | |
7886 | ||
7887 | dnl wx-config options | |
7888 | AC_SUBST(host_alias) | |
7889 | AC_SUBST(cross_compiling) | |
7890 | AC_SUBST(WIDGET_SET) | |
7891 | AC_SUBST(WX_RELEASE) | |
7892 | AC_SUBST(WX_VERSION) | |
7893 | AC_SUBST(WX_SUBVERSION) | |
7894 | AC_SUBST(WX_CHARTYPE) | |
7895 | AC_SUBST(WX_DEBUGTYPE) | |
7896 | ||
7897 | dnl note that in addition to the usual CPP/C/CXXFLAGS which are used for | |
7898 | dnl building the library itself, we also have WXCONFIG_-prefixed variants which | |
7899 | dnl are used when building the libraries using the library | |
7900 | dnl | |
7901 | dnl so put anything which should be used only during the library build in, e.g. | |
7902 | dnl CXXFLAGS, but put everything else (by default) into WXCONFIG_CXXFLAGS | |
7903 | dnl | |
7904 | dnl and, finally, for some things which should be only used by wx-config but | |
7905 | dnl not during the library compilation, use WXCONFIG_ONLY_CPPFLAGS which is | |
7906 | dnl added to WXCONFIG_CPPFLAGS after adding the latter to CPPFLAGS | |
7907 | AC_SUBST(WXCONFIG_CPPFLAGS) | |
7908 | AC_SUBST(WXCONFIG_CFLAGS) | |
7909 | AC_SUBST(WXCONFIG_CXXFLAGS) | |
7910 | ||
7911 | AC_SUBST(WXCONFIG_LIBS) | |
7912 | AC_SUBST(WXCONFIG_RPATH) | |
7913 | AC_SUBST(WXCONFIG_LDFLAGS_GUI) | |
7914 | AC_SUBST(WXCONFIG_RESFLAGS) | |
7915 | AC_SUBST(EXE_LINKER) | |
7916 | ||
7917 | dnl distribution vars | |
7918 | AC_SUBST(GUIDIST) | |
7919 | AC_SUBST(DISTDIR) | |
7920 | ||
7921 | dnl additional subdirectories where we will build | |
7922 | AC_SUBST(SAMPLES_SUBDIRS) | |
7923 | ||
7924 | dnl additional libraries and linker settings | |
7925 | AC_SUBST(LDFLAGS) | |
7926 | AC_SUBST(LDFLAGS_GL) | |
7927 | AC_SUBST(OPENGL_LIBS) | |
7928 | AC_SUBST(DMALLOC_LIBS) | |
7929 | AC_SUBST(WX_VERSION_TAG) | |
7930 | ||
7931 | dnl additional resurces settings | |
7932 | AC_SUBST(RESCOMP) | |
7933 | AC_SUBST(WINDRES) | |
7934 | AC_SUBST(REZ) | |
7935 | AC_SUBST(RESFLAGS) | |
7936 | AC_SUBST(RESPROGRAMOBJ) | |
7937 | AC_SUBST(WX_RESOURCES_MACOSX_ASCII) | |
7938 | AC_SUBST(WX_RESOURCES_MACOSX_DATA) | |
7939 | ||
7940 | dnl additional for Mac OS X | |
7941 | AC_SUBST(DEREZ) | |
7942 | AC_SUBST(LIBWXMACRES) | |
7943 | AC_SUBST(POSTLINK_COMMAND) | |
7944 | AC_SUBST(MACSETFILE) | |
7945 | ||
7946 | dnl other tools | |
7947 | AC_SUBST(GCC) | |
7948 | AC_SUBST(DLLTOOL) | |
7949 | ||
7950 | ||
7951 | dnl MAKE_SET will be replaced with "MAKE=..." or nothing if make sets MAKE | |
7952 | dnl itself (this macro is required if SUBDIRS variable is used in Makefile.am | |
7953 | dnl - and we do use it) | |
7954 | AC_PROG_MAKE_SET | |
7955 | ||
7956 | ||
7957 | AC_CONFIG_HEADERS([lib/wx/include/${TOOLCHAIN_FULLNAME}/wx/setup.h:setup.h.in]) | |
7958 | ||
7959 | if test "$USE_WIN32" = 1; then | |
7960 | AC_CONFIG_COMMANDS( | |
7961 | [ | |
7962 | rcdefs.h | |
7963 | ], | |
7964 | [ | |
7965 | mkdir -p $outdir && | |
7966 | $CPP $infile | sed 's/^# *[1-9].*//;s/^ *//;/./,/^$/!d' > $outdir/rcdefs.h | |
7967 | ], | |
7968 | [ | |
7969 | CPP="$CPP" | |
7970 | infile="$srcdir/include/wx/msw/genrcdefs.h" | |
7971 | outdir="lib/wx/include/$TOOLCHAIN_FULLNAME/wx/msw" | |
7972 | ] | |
7973 | ) | |
7974 | fi | |
7975 | ||
7976 | AC_CONFIG_FILES([ lib/wx/config/${TOOLCHAIN_FULLNAME}:wx-config.in ], | |
7977 | [ chmod +x lib/wx/config/${TOOLCHAIN_FULLNAME} ], | |
7978 | [ TOOLCHAIN_FULLNAME="${TOOLCHAIN_FULLNAME}" ]) | |
7979 | ||
7980 | AC_CONFIG_FILES([ lib/wx/config/inplace-${TOOLCHAIN_FULLNAME}:wx-config-inplace.in ], | |
7981 | [ chmod +x lib/wx/config/inplace-${TOOLCHAIN_FULLNAME} ], | |
7982 | [ TOOLCHAIN_FULLNAME="${TOOLCHAIN_FULLNAME}" ]) | |
7983 | ||
7984 | if test "$wx_cv_version_script" = "yes"; then | |
7985 | AC_CONFIG_FILES(version-script) | |
7986 | fi | |
7987 | AC_CONFIG_FILES(Makefile) | |
7988 | ||
7989 | AC_CONFIG_COMMANDS([wx-config], | |
7990 | [ rm -f wx-config | |
7991 | ${LN_S} lib/wx/config/inplace-${TOOLCHAIN_FULLNAME} wx-config | |
7992 | ], | |
7993 | [ TOOLCHAIN_FULLNAME="${TOOLCHAIN_FULLNAME}" | |
7994 | LN_S="${LN_S}" | |
7995 | ]) | |
7996 | ||
7997 | dnl This would give us us build dir that in every significant way | |
7998 | dnl resembles an installed wx in prefix=$builddir. It is troublesome | |
7999 | dnl though in this form because AC_CONFIG_LINKS will fail for directories | |
8000 | dnl on platforms that do not have symlinks. | |
8001 | dnl AC_CONFIG_LINKS([ include/wx-$WX_RELEASE$WX_FLAVOUR:include ]) | |
8002 | dnl AC_CONFIG_LINKS([ contrib/include ]) | |
8003 | ||
8004 | if test "$wxWITH_SUBDIRS" != "no"; then | |
8005 | dnl Configure samples, contrib etc. directories, but only if they are present: | |
8006 | if test "$wxUSE_GUI" = "yes"; then | |
8007 | SUBDIRS="samples demos utils contrib" | |
8008 | else dnl we build wxBase only | |
8009 | dnl there are no wxBase programs in contrib nor demos | |
8010 | SUBDIRS="samples utils" | |
8011 | fi | |
8012 | dnl Add tests to the list of subdirs if cppunit 1.8.0+ is detected | |
8013 | AM_PATH_CPPUNIT(1.8.0, [SUBDIRS="$SUBDIRS tests"]) | |
8014 | ||
8015 | if test "$USE_UNIX" != "1" -a "$USE_WIN32" != "1"; then | |
8016 | DISABLED_CONTRIB="$DISABLED_CONTRIB net" | |
8017 | fi | |
8018 | ||
8019 | for subdir in `echo $SUBDIRS`; do | |
8020 | if test -d ${srcdir}/${subdir} ; then | |
8021 | if test "$wxUSE_GUI" = "yes"; then | |
8022 | if test ${subdir} = "samples"; then | |
8023 | dnl only take those samples which compile in the current | |
8024 | dnl configuration and which exist | |
8025 | makefiles="samples/Makefile.in $makefiles" | |
8026 | for sample in `echo $SAMPLES_SUBDIRS`; do | |
8027 | if test -d $srcdir/samples/$sample; then | |
8028 | makefiles="samples/$sample/Makefile.in $makefiles" | |
8029 | fi | |
8030 | done | |
8031 | else | |
8032 | dnl assume that everything compiles for utils &c | |
8033 | dnl any that shouldn't be built can be added to | |
8034 | dnl DISABLED_UTILS, DISABLED_CONTRIB or DISABLED_DEMOS | |
8035 | disabled_var=DISABLED_`echo $subdir | tr [[a-z]] [[A-Z]]`; | |
8036 | eval "disabled=\$$disabled_var" | |
8037 | disabled=/`echo X $disabled | sed 's@ @/|/@g'`/ | |
8038 | makefiles=`(cd $srcdir ; find $subdir -name Makefile.in) | $EGREP -v "$disabled"` | |
8039 | fi | |
8040 | else dnl we build wxBase only | |
8041 | dnl don't take all samples/utils, just those which build with | |
8042 | dnl wxBase | |
8043 | if test ${subdir} = "samples"; then | |
8044 | makefiles="samples/Makefile.in samples/console/Makefile.in" | |
8045 | elif test ${subdir} = "utils"; then | |
8046 | makefiles="" | |
8047 | for util in HelpGen tex2rtf ; do | |
8048 | if test -d $srcdir/utils/$util ; then | |
8049 | makefiles="utils/$util/Makefile.in \ | |
8050 | utils/$util/src/Makefile.in \ | |
8051 | $makefiles" | |
8052 | fi | |
8053 | done | |
8054 | else dnl assume that everything compiles for tests | |
8055 | makefiles=`(cd $srcdir ; find $subdir -name Makefile.in)` | |
8056 | fi | |
8057 | fi | |
8058 | ||
8059 | for mkin in $makefiles ; do | |
8060 | mk=`echo $mkin | sed 's/Makefile\.in/Makefile/g'` | |
8061 | AC_CONFIG_FILES([$mk]) | |
8062 | done | |
8063 | fi | |
8064 | done | |
8065 | fi dnl wxWITH_SUBDIRS | |
8066 | ||
8067 | AC_OUTPUT | |
8068 | ||
8069 | dnl report how we have been configured | |
8070 | echo | |
8071 | echo "Configured wxWidgets ${WX_VERSION} for \`${host}'" | |
8072 | echo "" | |
8073 | echo " Which GUI toolkit should wxWidgets use? ${TOOLKIT_DESC}" | |
8074 | echo " Should wxWidgets be compiled into single library? ${wxUSE_MONOLITHIC:-yes}" | |
8075 | ||
8076 | echo " Should wxWidgets be compiled in debug mode? ${wxUSE_DEBUG:-no}" | |
8077 | echo " Should wxWidgets be linked as a shared library? ${wxUSE_SHARED:-no}" | |
8078 | echo " Should wxWidgets be compiled in Unicode mode? ${wxUSE_UNICODE:-no}" | |
8079 | ||
8080 | echo " What level of wxWidgets compatibility should be enabled?" | |
8081 | echo " wxWidgets 2.4 ${WXWIN_COMPATIBILITY_2_4:-no}" | |
8082 | echo " wxWidgets 2.6 ${WXWIN_COMPATIBILITY_2_6:-yes}" | |
8083 | ||
8084 | echo " Which libraries should wxWidgets use?" | |
8085 | echo " jpeg ${wxUSE_LIBJPEG-none}" | |
8086 | echo " png ${wxUSE_LIBPNG-none}" | |
8087 | echo " regex ${wxUSE_REGEX}" | |
8088 | echo " tiff ${wxUSE_LIBTIFF-none}" | |
8089 | if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then | |
8090 | echo " xpm ${wxUSE_LIBXPM-none}" | |
8091 | fi | |
8092 | echo " zlib ${wxUSE_ZLIB}" | |
8093 | echo " odbc ${wxUSE_ODBC}" | |
8094 | echo " expat ${wxUSE_EXPAT}" | |
8095 | echo " libmspack ${wxUSE_LIBMSPACK}" | |
8096 | echo " sdl ${wxUSE_LIBSDL}" | |
8097 | ||
8098 | echo "" | |
8099 | ||
8100 | dnl vi: set et sts=4 sw=4 com=\:dnl: |