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