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