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