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