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