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