]> git.saurik.com Git - wxWidgets.git/blob - configure.in
Allow compiling wxMotif/GTK/X11 for Cygwin/XFree
[wxWidgets.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION($Id$)dnl
3
4 dnl ---------------------------------------------------------------------------
5 dnl
6 dnl Top-level configure.in for wxWindows by Robert Roebling, Phil Blecker,
7 dnl Vadim Zeitlin and Ron Lee
8 dnl
9 dnl This script is under the wxWindows licence.
10 dnl
11 dnl Version: $Id$
12 dnl ---------------------------------------------------------------------------
13
14 dnl ---------------------------------------------------------------------------
15 dnl initialization
16 dnl ---------------------------------------------------------------------------
17
18 dnl the file passed to AC_INIT should be specific to our package
19 AC_INIT([wx-config.in])
20
21 dnl sets build, host, target variables and the same with _alias
22 AC_CANONICAL_SYSTEM
23
24 dnl When making releases do:
25 dnl
26 dnl WX_RELEASE_NUMBER += 1
27 dnl
28 dnl ..and update WX_CURRENT, WX_RELEASE and WX_AGE according to the
29 dnl following rules:
30 dnl
31 dnl If any changes have been made to the public interface, that is if any
32 dnl exported class, method, global or global type has been added, removed
33 dnl or changed in any way, then do: WX_CURRENT += 1
34 dnl
35 dnl If source changes have been made that *do not* alter the public
36 dnl interface then do: WX_REVISION += 1
37 dnl If WX_CURRENT was incremented (as above) instead do: WX_REVISION = 0
38 dnl
39 dnl If any public interface was added, do: WX_AGE += 1
40 dnl If any public interface was removed (or altered in a way effectively
41 dnl removing the previous definition), instead do: WX_AGE = 0
42 dnl
43 dnl When the major or minor version numbers are incremented, all the above
44 dnl variables should be reset to 0.
45 dnl
46 dnl The resulting library name will be of the form:
47 dnl libwx_$(TOOLKIT)-$(WX_RELEASE).so.$(WX_CURRENT).$(WX_REVISION).$(WX_AGE)
48
49 WX_MAJOR_VERSION_NUMBER=2
50 WX_MINOR_VERSION_NUMBER=3
51 WX_RELEASE_NUMBER=3
52
53 WX_VERSION=$WX_MAJOR_VERSION_NUMBER.$WX_MINOR_VERSION_NUMBER.$WX_RELEASE_NUMBER
54 WX_RELEASE=$WX_MAJOR_VERSION_NUMBER.$WX_MINOR_VERSION_NUMBER
55
56 WX_MSW_VERSION=$WX_MAJOR_VERSION_NUMBER$WX_MINOR_VERSION_NUMBER$WX_RELEASE_NUMBER
57
58 WX_CURRENT=2
59 WX_REVISION=0
60 WX_AGE=0
61
62
63 dnl ------------------------------------------------------------------------
64 dnl Check platform (host system)
65 dnl ------------------------------------------------------------------------
66
67 dnl assume Unix
68 USE_UNIX=1
69 USE_WIN32=0
70 USE_DOS=0
71 USE_BEOS=0
72 USE_MAC=0
73
74 USE_LINUX=
75 USE_SGI=
76 USE_HPUX=
77 USE_SYSV=
78 USE_SVR4=
79 USE_AIX=
80 USE_SUN=
81 USE_SOLARIS=
82 USE_SUNOS=
83 USE_ALPHA=
84 USE_OSF=
85 USE_BSD=
86 USE_DARWIN=
87 USE_FREEBSD=
88 USE_OPENBSD=
89 USE_NETBSD=
90 USE_VMS=
91 USE_ULTRIX=
92 USE_DATA_GENERAL=
93
94 dnl on some platforms xxx_r() functions are declared inside "#ifdef
95 dnl _REENTRANT" and it's easier to just define this symbol for these platforms
96 dnl than checking it during run-time
97 NEEDS_D_REENTRANT_FOR_R_FUNCS=0
98
99 dnl the list of all available toolkits
100 dnl
101 dnl update NUM_TOOLKITS calculation below when adding a new toolkit here!
102 ALL_TOOLKITS="GTK MAC MGL MICROWIN MOTIF MSW PM WINE X11"
103
104 dnl NB: these wxUSE_XXX constants have value of 0 or 1 unlike all the other ones
105 dnl which are either yes or no
106 DEFAULT_wxUSE_GTK=0
107 DEFAULT_wxUSE_MAC=0
108 DEFAULT_wxUSE_MGL=0
109 DEFAULT_wxUSE_MICROWIN=0
110 DEFAULT_wxUSE_MOTIF=0
111 DEFAULT_wxUSE_MSW=0
112 DEFAULT_wxUSE_PM=0
113 DEFAULT_wxUSE_WINE=0
114 DEFAULT_wxUSE_X11=0
115
116 dnl these are the values which are really default for the given platform -
117 dnl they're not cached and are only used if no --with-toolkit was given *and*
118 dnl nothing was found in the cache
119 DEFAULT_DEFAULT_wxUSE_GTK=0
120 DEFAULT_DEFAULT_wxUSE_MAC=0
121 DEFAULT_DEFAULT_wxUSE_MGL=0
122 DEFAULT_DEFAULT_wxUSE_MICROWIN=0
123 DEFAULT_DEFAULT_wxUSE_MOTIF=0
124 DEFAULT_DEFAULT_wxUSE_MSW=0
125 DEFAULT_DEFAULT_wxUSE_PM=0
126 DEFAULT_DEFAULT_wxUSE_WINE=0
127 DEFAULT_DEFAULT_wxUSE_X11=0
128
129 PROGRAM_EXT=
130 SO_SUFFIX=so
131
132 dnl to support a new system, you need to add its canonical name (as determined
133 dnl by config.sub or specified by the configure command line) to this "case"
134 dnl and also define the shared library flags below - search for
135 dnl SHARED_LIB_SETUP to find the exact place
136 case "${host}" in
137 *-hp-hpux* )
138 USE_HPUX=1
139 DEFAULT_DEFAULT_wxUSE_MOTIF=1
140 NEEDS_D_REENTRANT_FOR_R_FUNCS=1
141 SO_SUFFIX=sl
142 AC_DEFINE(__HPUX__)
143 ;;
144 *-*-linux* )
145 USE_LINUX=1
146 AC_DEFINE(__LINUX__)
147 TMP=`uname -m`
148 if test "x$TMP" = "xalpha"; then
149 USE_ALPHA=1
150 AC_DEFINE(__ALPHA__)
151 fi
152 DEFAULT_DEFAULT_wxUSE_GTK=1
153 ;;
154 *-*-irix5* | *-*-irix6* )
155 USE_SGI=1
156 USE_SVR4=1
157 AC_DEFINE(__SGI__)
158 AC_DEFINE(__SVR4__)
159 DEFAULT_DEFAULT_wxUSE_MOTIF=1
160 ;;
161 *-*-solaris2* )
162 USE_SUN=1
163 USE_SOLARIS=1
164 USE_SVR4=1
165 AC_DEFINE(__SUN__)
166 AC_DEFINE(__SOLARIS__)
167 AC_DEFINE(__SVR4__)
168 DEFAULT_DEFAULT_wxUSE_MOTIF=1
169 NEEDS_D_REENTRANT_FOR_R_FUNCS=1
170 ;;
171 *-*-sunos4* )
172 USE_SUN=1
173 USE_SUNOS=1
174 USE_BSD=1
175 AC_DEFINE(__SUN__)
176 AC_DEFINE(__SUNOS__)
177 AC_DEFINE(__BSD__)
178 DEFAULT_DEFAULT_wxUSE_MOTIF=1
179 ;;
180 *-*-freebsd*)
181 USE_BSD=1
182 USE_FREEBSD=1
183 AC_DEFINE(__FREEBSD__)
184 AC_DEFINE(__BSD__)
185 DEFAULT_DEFAULT_wxUSE_GTK=1
186 ;;
187 *-*-openbsd*)
188 USE_BSD=1
189 USE_OPENBSD=1
190 AC_DEFINE(__FREEBSD__)
191 AC_DEFINE(__OPENBSD__)
192 DEFAULT_DEFAULT_wxUSE_GTK=1
193 ;;
194 *-*-netbsd*)
195 USE_BSD=1
196 USE_NETBSD=1
197 AC_DEFINE(__FREEBSD__)
198 AC_DEFINE(__NETBSD__)
199 DEFAULT_DEFAULT_wxUSE_GTK=1
200 ;;
201 *-*-osf* )
202 USE_ALPHA=1
203 USE_OSF=1
204 AC_DEFINE(__ALPHA__)
205 AC_DEFINE(__OSF__)
206 DEFAULT_DEFAULT_wxUSE_MOTIF=1
207 NEEDS_D_REENTRANT_FOR_R_FUNCS=1
208 ;;
209 *-*-dgux5* )
210 USE_ALPHA=1
211 USE_SVR4=1
212 AC_DEFINE(__ALPHA__)
213 AC_DEFINE(__SVR4__)
214 DEFAULT_DEFAULT_wxUSE_MOTIF=1
215 ;;
216 *-*-sysv5* )
217 USE_SYSV=1
218 USE_SVR4=1
219 AC_DEFINE(__SYSV__)
220 AC_DEFINE(__SVR4__)
221 DEFAULT_DEFAULT_wxUSE_MOTIF=1
222 ;;
223 *-*-aix* )
224 USE_AIX=1
225 USE_SYSV=1
226 USE_SVR4=1
227 dnl Irvin Probst <irvin.probst@fr.thalesgroup.com> reports that the shared
228 dnl libraries under AIX have the same suffix as the normal ones
229 SO_SUFFIX=a
230 AC_DEFINE(__AIX__)
231 AC_DEFINE(__SYSV__)
232 AC_DEFINE(__SVR4__)
233 DEFAULT_DEFAULT_wxUSE_MOTIF=1
234 ;;
235
236 *-*-cygwin* | *-*-mingw32* )
237 dnl MBN: some of the defines have been moved after toolkit detection
238 dnl because for wxMotif/wxGTK/wxX11 to build on Cygwin
239 dnl USE_UNIX must be set and not USE_WIN32
240 SO_SUFFIX=dll
241 PROGRAM_EXT=".exe"
242 RESCOMP=windres
243 DEFAULT_DEFAULT_wxUSE_MSW=1
244 ;;
245
246 *-pc-msdosdjgpp )
247 USE_UNIX=0
248 USE_DOS=1
249 AC_DEFINE(__DOS__)
250 PROGRAM_EXT=".exe"
251 DEFAULT_DEFAULT_wxUSE_MGL=1
252 ;;
253
254 *-pc-os2_emx | *-pc-os2-emx )
255 AC_DEFINE(__EMX__)
256 PROGRAM_EXT=".exe"
257 DEFAULT_DEFAULT_wxUSE_PM=1
258 LIBS="$LIBS -lstdcpp"
259 ;;
260
261 powerpc-*-darwin* )
262 dnl PowerPC Darwin based distributions (including Mac OS X)
263 USE_BSD=1
264 USE_DARWIN=1
265 SO_SUFFIX=dylib
266 AC_DEFINE(__BSD__)
267 AC_DEFINE(__DARWIN__)
268 AC_DEFINE(__POWERPC__)
269 DEFAULT_DEFAULT_wxUSE_MAC=1
270 ;;
271
272 *-*-beos* )
273 dnl leave USE_UNIX on - BeOS is sufficiently Unix-like for this
274 USE_BEOS=1
275 AC_DEFINE(__BEOS__)
276 ;;
277
278 *)
279 AC_MSG_ERROR(unknown system type ${host}.)
280 esac
281
282 dnl ---------------------------------------------------------------------------
283 dnl command line options for configure
284 dnl ---------------------------------------------------------------------------
285
286 dnl the default values for all options - we collect them all here to simplify
287 dnl modification of the default values (for example, if the defaults for some
288 dnl platform should be changed, it can be done here too)
289 dnl
290 dnl NB: see also DEFAULT_wxUSE<toolkit> variables defined above
291
292 WX_ARG_CACHE_INIT
293
294 dnl useful to test the compilation with minimum options, define as 0 for normal
295 dnl usage
296 DEBUG_CONFIGURE=0
297 if test $DEBUG_CONFIGURE = 1; then
298 DEFAULT_wxUSE_UNIVERSAL=no
299
300 DEFAULT_wxUSE_NANOX=no
301
302 DEFAULT_wxUSE_THREADS=yes
303
304 DEFAULT_wxUSE_SHARED=yes
305 DEFAULT_wxUSE_SONAME=no
306 DEFAULT_wxUSE_OPTIMISE=no
307 DEFAULT_wxUSE_PROFILE=no
308 DEFAULT_wxUSE_NO_DEPS=no
309 DEFAULT_wxUSE_NO_RTTI=no
310 DEFAULT_wxUSE_NO_EXCEPTIONS=no
311 DEFAULT_wxUSE_PERMISSIVE=no
312 DEFAULT_wxUSE_DEBUG_FLAG=yes
313 DEFAULT_wxUSE_DEBUG_INFO=yes
314 DEFAULT_wxUSE_DEBUG_GDB=yes
315 DEFAULT_wxUSE_MEM_TRACING=no
316 DEFAULT_wxUSE_DEBUG_CONTEXT=no
317 DEFAULT_wxUSE_DMALLOC=no
318 DEFAULT_wxUSE_PRECOMP=no
319 DEFAULT_wxUSE_APPLE_IEEE=no
320
321 DEFAULT_wxUSE_LOG=yes
322 DEFAULT_wxUSE_LOGWINDOW=no
323 DEFAULT_wxUSE_LOGGUI=no
324 DEFAULT_wxUSE_LOGDIALOG=no
325
326 DEFAULT_wxUSE_GUI=yes
327 DEFAULT_wxUSE_CONTROLS=no
328
329 DEFAULT_wxUSE_REGEX=no
330 DEFAULT_wxUSE_ZLIB=no
331 DEFAULT_wxUSE_LIBPNG=no
332 DEFAULT_wxUSE_LIBJPEG=no
333 DEFAULT_wxUSE_LIBTIFF=no
334 DEFAULT_wxUSE_ODBC=no
335 DEFAULT_wxUSE_OPENGL=no
336
337 DEFAULT_wxUSE_ON_FATAL_EXCEPTION=no
338 DEFAULT_wxUSE_SNGLINST_CHECKER=no
339 DEFAULT_wxUSE_STD_IOSTREAM=no
340 DEFAULT_wxUSE_CMDLINE_PARSER=no
341 DEFAULT_wxUSE_DATETIME=no
342 DEFAULT_wxUSE_TIMEDATE=no
343 DEFAULT_wxUSE_TIMER=no
344 DEFAULT_wxUSE_STOPWATCH=no
345 DEFAULT_wxUSE_FILE=no
346 DEFAULT_wxUSE_FFILE=no
347 DEFAULT_wxUSE_TEXTBUFFER=no
348 DEFAULT_wxUSE_TEXTFILE=no
349 DEFAULT_wxUSE_WAVE=no
350 DEFAULT_wxUSE_INTL=no
351 DEFAULT_wxUSE_CONFIG=no
352 DEFAULT_wxUSE_FONTMAP=no
353 DEFAULT_wxUSE_STREAMS=no
354 DEFAULT_wxUSE_SOCKETS=no
355 DEFAULT_wxUSE_DIALUP_MANAGER=no
356 DEFAULT_wxUSE_JOYSTICK=no
357 DEFAULT_wxUSE_DYNLIB_CLASS=no
358 DEFAULT_wxUSE_DYNAMIC_LOADER=no
359 DEFAULT_wxUSE_LONGLONG=no
360 DEFAULT_wxUSE_GEOMETRY=no
361
362 DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=no
363 DEFAULT_wxUSE_NORMALIZED_PS_FONTS=no
364 DEFAULT_wxUSE_POSTSCRIPT=no
365
366 DEFAULT_wxUSE_X_RESOURCES=no
367 DEFAULT_wxUSE_CLIPBOARD=no
368 DEFAULT_wxUSE_TOOLTIPS=no
369 DEFAULT_wxUSE_DRAG_AND_DROP=no
370 DEFAULT_wxUSE_DRAGIMAGE=no
371 DEFAULT_wxUSE_SPLINES=no
372
373 DEFAULT_wxUSE_MDI_ARCHITECTURE=no
374 DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=no
375 DEFAULT_wxUSE_PRINTING_ARCHITECTURE=no
376
377 DEFAULT_wxUSE_PROLOGIO=no
378 DEFAULT_wxUSE_RESOURCES=no
379 DEFAULT_wxUSE_CONSTRAINTS=no
380 DEFAULT_wxUSE_IPC=no
381 DEFAULT_wxUSE_HELP=no
382 DEFAULT_wxUSE_MS_HTML_HELP=no
383 DEFAULT_wxUSE_WXHTML_HELP=no
384 DEFAULT_wxUSE_TREELAYOUT=no
385 DEFAULT_wxUSE_METAFILE=no
386 DEFAULT_wxUSE_MIMETYPE=no
387 DEFAULT_wxUSE_SYSTEM_OPTIONS=no
388 DEFAULT_wxUSE_PROTOCOL=no
389 DEFAULT_wxUSE_PROTOCOL_HTTP=no
390 DEFAULT_wxUSE_PROTOCOL_FTP=no
391 DEFAULT_wxUSE_PROTOCOL_FILE=no
392 DEFAULT_wxUSE_URL=no
393
394 DEFAULT_wxUSE_COMMONDLGS=no
395 DEFAULT_wxUSE_CHOICEDLG=no
396 DEFAULT_wxUSE_COLOURDLG=no
397 DEFAULT_wxUSE_DIRDLG=no
398 DEFAULT_wxUSE_FILEDLG=no
399 DEFAULT_wxUSE_FINDREPLDLG=no
400 DEFAULT_wxUSE_FONTDLG=no
401 DEFAULT_wxUSE_MSGDLG=no
402 DEFAULT_wxUSE_NUMBERDLG=no
403 DEFAULT_wxUSE_TEXTDLG=no
404 DEFAULT_wxUSE_SPLASH=no
405 DEFAULT_wxUSE_STARTUP_TIPS=no
406 DEFAULT_wxUSE_PROGRESSDLG=no
407 DEFAULT_wxUSE_WIZARDDLG=no
408
409 DEFAULT_wxUSE_MENUS=no
410 DEFAULT_wxUSE_MINIFRAME=no
411 DEFAULT_wxUSE_HTML=no
412 DEFAULT_wxUSE_FILESYSTEM=no
413 DEFAULT_wxUSE_FS_INET=no
414 DEFAULT_wxUSE_FS_ZIP=no
415 DEFAULT_wxUSE_BUSYINFO=no
416 DEFAULT_wxUSE_ZIPSTREAM=no
417 DEFAULT_wxUSE_VALIDATORS=no
418
419 DEFAULT_wxUSE_ACCEL=no
420 DEFAULT_wxUSE_BUTTON=no
421 DEFAULT_wxUSE_BMPBUTTON=no
422 DEFAULT_wxUSE_CALCTRL=no
423 DEFAULT_wxUSE_CARET=no
424 DEFAULT_wxUSE_CHECKBOX=no
425 DEFAULT_wxUSE_CHECKLST=no
426 DEFAULT_wxUSE_CHOICE=no
427 DEFAULT_wxUSE_COMBOBOX=no
428 DEFAULT_wxUSE_GAUGE=no
429 DEFAULT_wxUSE_GRID=no
430 DEFAULT_wxUSE_NEW_GRID=no
431 DEFAULT_wxUSE_IMAGLIST=no
432 DEFAULT_wxUSE_LISTBOX=no
433 DEFAULT_wxUSE_LISTCTRL=no
434 DEFAULT_wxUSE_NOTEBOOK=no
435 DEFAULT_wxUSE_PROPSHEET=no
436 DEFAULT_wxUSE_RADIOBOX=no
437 DEFAULT_wxUSE_RADIOBTN=no
438 DEFAULT_wxUSE_SASH=no
439 DEFAULT_wxUSE_SCROLLBAR=no
440 DEFAULT_wxUSE_SLIDER=no
441 DEFAULT_wxUSE_SPINBTN=no
442 DEFAULT_wxUSE_SPINCTRL=no
443 DEFAULT_wxUSE_SPLITTER=no
444 DEFAULT_wxUSE_STATBMP=no
445 DEFAULT_wxUSE_STATBOX=no
446 DEFAULT_wxUSE_STATLINE=no
447 DEFAULT_wxUSE_STATTEXT=no
448 DEFAULT_wxUSE_STATUSBAR=yes
449 DEFAULT_wxUSE_TABDIALOG=no
450 DEFAULT_wxUSE_TEXTCTRL=no
451 DEFAULT_wxUSE_TOGGLEBTN=no
452 DEFAULT_wxUSE_TOOLBAR=no
453 DEFAULT_wxUSE_TOOLBAR_NATIVE=no
454 DEFAULT_wxUSE_TOOLBAR_SIMPLE=no
455 DEFAULT_wxUSE_TREECTRL=no
456 DEFAULT_wxUSE_POPUPWIN=no
457 DEFAULT_wxUSE_TIPWINDOW=no
458
459 DEFAULT_wxUSE_UNICODE=no
460 DEFAULT_wxUSE_UNICODE_MSLU=no
461 DEFAULT_wxUSE_WCSRTOMBS=no
462
463 DEFAULT_wxUSE_PALETTE=no
464 DEFAULT_wxUSE_IMAGE=no
465 DEFAULT_wxUSE_GIF=no
466 DEFAULT_wxUSE_PCX=no
467 DEFAULT_wxUSE_PNM=no
468 DEFAULT_wxUSE_IFF=no
469 DEFAULT_wxUSE_XPM=no
470 DEFAULT_wxUSE_ICO_CUR=no
471 else
472 DEFAULT_wxUSE_UNIVERSAL=no
473
474 DEFAULT_wxUSE_NANOX=no
475
476 DEFAULT_wxUSE_THREADS=yes
477
478 DEFAULT_wxUSE_SHARED=yes
479 DEFAULT_wxUSE_SONAME=no
480 DEFAULT_wxUSE_OPTIMISE=yes
481 DEFAULT_wxUSE_PROFILE=no
482 DEFAULT_wxUSE_NO_DEPS=no
483 DEFAULT_wxUSE_NO_RTTI=no
484 DEFAULT_wxUSE_NO_EXCEPTIONS=no
485 DEFAULT_wxUSE_PERMISSIVE=no
486 DEFAULT_wxUSE_DEBUG_FLAG=no
487 DEFAULT_wxUSE_DEBUG_INFO=no
488 DEFAULT_wxUSE_DEBUG_GDB=no
489 DEFAULT_wxUSE_MEM_TRACING=no
490 DEFAULT_wxUSE_DEBUG_CONTEXT=no
491 DEFAULT_wxUSE_DMALLOC=no
492 DEFAULT_wxUSE_PRECOMP=no
493 DEFAULT_wxUSE_APPLE_IEEE=yes
494
495 DEFAULT_wxUSE_LOG=yes
496 DEFAULT_wxUSE_LOGWINDOW=yes
497 DEFAULT_wxUSE_LOGGUI=yes
498 DEFAULT_wxUSE_LOGDIALOG=yes
499
500 DEFAULT_wxUSE_GUI=yes
501
502 DEFAULT_wxUSE_REGEX=yes
503 DEFAULT_wxUSE_ZLIB=yes
504 DEFAULT_wxUSE_LIBPNG=yes
505 DEFAULT_wxUSE_LIBJPEG=yes
506 DEFAULT_wxUSE_LIBTIFF=yes
507 DEFAULT_wxUSE_ODBC=no
508 DEFAULT_wxUSE_OPENGL=no
509
510 DEFAULT_wxUSE_ON_FATAL_EXCEPTION=yes
511 DEFAULT_wxUSE_SNGLINST_CHECKER=yes
512 DEFAULT_wxUSE_STD_IOSTREAM=no
513 DEFAULT_wxUSE_CMDLINE_PARSER=yes
514 DEFAULT_wxUSE_DATETIME=yes
515 DEFAULT_wxUSE_TIMEDATE=no
516 DEFAULT_wxUSE_TIMER=yes
517 DEFAULT_wxUSE_STOPWATCH=yes
518 DEFAULT_wxUSE_FILE=yes
519 DEFAULT_wxUSE_FFILE=yes
520 DEFAULT_wxUSE_TEXTBUFFER=yes
521 DEFAULT_wxUSE_TEXTFILE=yes
522 DEFAULT_wxUSE_WAVE=no
523 DEFAULT_wxUSE_INTL=yes
524 DEFAULT_wxUSE_CONFIG=yes
525 DEFAULT_wxUSE_FONTMAP=yes
526 DEFAULT_wxUSE_STREAMS=yes
527 DEFAULT_wxUSE_SOCKETS=yes
528 DEFAULT_wxUSE_DIALUP_MANAGER=yes
529 DEFAULT_wxUSE_JOYSTICK=yes
530 DEFAULT_wxUSE_DYNLIB_CLASS=yes
531 DEFAULT_wxUSE_DYNAMIC_LOADER=yes
532 DEFAULT_wxUSE_LONGLONG=yes
533 DEFAULT_wxUSE_GEOMETRY=yes
534
535 DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=yes
536 DEFAULT_wxUSE_NORMALIZED_PS_FONTS=yes
537 DEFAULT_wxUSE_POSTSCRIPT=yes
538
539 DEFAULT_wxUSE_X_RESOURCES=no
540 DEFAULT_wxUSE_CLIPBOARD=yes
541 DEFAULT_wxUSE_TOOLTIPS=yes
542 DEFAULT_wxUSE_DRAG_AND_DROP=yes
543 DEFAULT_wxUSE_DRAGIMAGE=yes
544 DEFAULT_wxUSE_SPLINES=yes
545
546 DEFAULT_wxUSE_MDI_ARCHITECTURE=yes
547 DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=yes
548 DEFAULT_wxUSE_PRINTING_ARCHITECTURE=yes
549
550 DEFAULT_wxUSE_PROLOGIO=yes
551 DEFAULT_wxUSE_RESOURCES=yes
552 DEFAULT_wxUSE_CONSTRAINTS=yes
553 DEFAULT_wxUSE_IPC=yes
554 DEFAULT_wxUSE_HELP=yes
555 DEFAULT_wxUSE_MS_HTML_HELP=yes
556 DEFAULT_wxUSE_WXHTML_HELP=yes
557 DEFAULT_wxUSE_TREELAYOUT=yes
558 DEFAULT_wxUSE_METAFILE=yes
559 DEFAULT_wxUSE_MIMETYPE=yes
560 DEFAULT_wxUSE_SYSTEM_OPTIONS=yes
561 DEFAULT_wxUSE_PROTOCOL=yes
562 DEFAULT_wxUSE_PROTOCOL_HTTP=yes
563 DEFAULT_wxUSE_PROTOCOL_FTP=yes
564 DEFAULT_wxUSE_PROTOCOL_FILE=yes
565 DEFAULT_wxUSE_URL=yes
566
567 DEFAULT_wxUSE_COMMONDLGS=yes
568 DEFAULT_wxUSE_CHOICEDLG=yes
569 DEFAULT_wxUSE_COLOURDLG=yes
570 DEFAULT_wxUSE_DIRDLG=yes
571 DEFAULT_wxUSE_FILEDLG=yes
572 DEFAULT_wxUSE_FINDREPLDLG=yes
573 DEFAULT_wxUSE_FONTDLG=yes
574 DEFAULT_wxUSE_MSGDLG=yes
575 DEFAULT_wxUSE_NUMBERDLG=yes
576 DEFAULT_wxUSE_TEXTDLG=yes
577 DEFAULT_wxUSE_SPLASH=yes
578 DEFAULT_wxUSE_STARTUP_TIPS=yes
579 DEFAULT_wxUSE_PROGRESSDLG=yes
580 DEFAULT_wxUSE_WIZARDDLG=yes
581
582 DEFAULT_wxUSE_MENUS=yes
583 DEFAULT_wxUSE_MINIFRAME=yes
584 DEFAULT_wxUSE_HTML=yes
585 DEFAULT_wxUSE_FILESYSTEM=yes
586 DEFAULT_wxUSE_FS_INET=yes
587 DEFAULT_wxUSE_FS_ZIP=yes
588 DEFAULT_wxUSE_BUSYINFO=yes
589 DEFAULT_wxUSE_ZIPSTREAM=yes
590 DEFAULT_wxUSE_VALIDATORS=yes
591
592 DEFAULT_wxUSE_ACCEL=yes
593 DEFAULT_wxUSE_BUTTON=yes
594 DEFAULT_wxUSE_BMPBUTTON=yes
595 DEFAULT_wxUSE_CALCTRL=yes
596 DEFAULT_wxUSE_CARET=yes
597 DEFAULT_wxUSE_CHECKBOX=yes
598 DEFAULT_wxUSE_CHECKLST=yes
599 DEFAULT_wxUSE_CHOICE=yes
600 DEFAULT_wxUSE_COMBOBOX=yes
601 DEFAULT_wxUSE_GAUGE=yes
602 DEFAULT_wxUSE_GRID=yes
603 DEFAULT_wxUSE_NEW_GRID=yes
604 DEFAULT_wxUSE_IMAGLIST=yes
605 DEFAULT_wxUSE_LISTBOX=yes
606 DEFAULT_wxUSE_LISTCTRL=yes
607 DEFAULT_wxUSE_NOTEBOOK=yes
608 DEFAULT_wxUSE_PROPSHEET=yes
609 DEFAULT_wxUSE_RADIOBOX=yes
610 DEFAULT_wxUSE_RADIOBTN=yes
611 DEFAULT_wxUSE_SASH=yes
612 DEFAULT_wxUSE_SCROLLBAR=yes
613 DEFAULT_wxUSE_SLIDER=yes
614 DEFAULT_wxUSE_SPINBTN=yes
615 DEFAULT_wxUSE_SPINCTRL=yes
616 DEFAULT_wxUSE_SPLITTER=yes
617 DEFAULT_wxUSE_STATBMP=yes
618 DEFAULT_wxUSE_STATBOX=yes
619 DEFAULT_wxUSE_STATLINE=yes
620 DEFAULT_wxUSE_STATTEXT=yes
621 DEFAULT_wxUSE_STATUSBAR=yes
622 DEFAULT_wxUSE_TABDIALOG=no
623 DEFAULT_wxUSE_TEXTCTRL=yes
624 DEFAULT_wxUSE_TOGGLEBTN=yes
625 DEFAULT_wxUSE_TOOLBAR=yes
626 DEFAULT_wxUSE_TOOLBAR_NATIVE=yes
627 DEFAULT_wxUSE_TOOLBAR_SIMPLE=yes
628 DEFAULT_wxUSE_TREECTRL=yes
629 DEFAULT_wxUSE_POPUPWIN=yes
630 DEFAULT_wxUSE_TIPWINDOW=yes
631
632 DEFAULT_wxUSE_UNICODE=no
633 DEFAULT_wxUSE_UNICODE_MSLU=yes
634 DEFAULT_wxUSE_WCSRTOMBS=no
635
636 DEFAULT_wxUSE_PALETTE=yes
637 DEFAULT_wxUSE_IMAGE=yes
638 DEFAULT_wxUSE_GIF=yes
639 DEFAULT_wxUSE_PCX=yes
640 DEFAULT_wxUSE_IFF=no
641 DEFAULT_wxUSE_PNM=yes
642 DEFAULT_wxUSE_XPM=yes
643 DEFAULT_wxUSE_ICO_CUR=yes
644 fi
645
646 dnl WX_ARG_WITH should be used to select whether an external package will be
647 dnl used or not, to configure compile-time features of this package itself,
648 dnl use WX_ARG_ENABLE instead
649
650 dnl ============================
651 dnl external package dependecies
652 dnl ============================
653
654 dnl these options use AC_ARG_WITH and not WX_ARG_WITH on purpose - we cache
655 dnl these values manually
656 for toolkit in `echo $ALL_TOOLKITS`; do
657 LINE=`grep "wxUSE_$toolkit" ${wx_arg_cache_file}`
658 if test "x$LINE" != x ; then
659 has_toolkit_in_cache=1
660 eval "DEFAULT_$LINE"
661 eval "CACHE_$toolkit=1"
662 fi
663 done
664
665 dnl ---------------------------------------------------------------------------
666 dnl --disable-gui will build only non-GUI part of wxWindows: check for this
667 dnl first to disable many other switches if it's given
668 dnl
669 dnl NB: this is still in testing stage, don't use if you don't know what you're
670 dnl doing
671 dnl ---------------------------------------------------------------------------
672
673 WX_ARG_ENABLE(gui, [ --enable-gui use GUI classes], wxUSE_GUI)
674
675 if test "$wxUSE_GUI" = "yes"; then
676
677 WX_ARG_ENABLE(universal, [ --enable-universal use wxWindows GUI controls instead of native ones], wxUSE_UNIVERSAL)
678 AC_ARG_WITH(gtk, [ --with-gtk use GTK+], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1])
679 AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1])
680 AC_ARG_WITH(mac, [ --with-mac use Mac OS X], [wxUSE_MAC="$withval" TOOLKIT_GIVEN=1])
681 AC_ARG_WITH(wine, [ --with-wine use WINE], [wxUSE_WINE="$withval" CACHE_WINE=1 TOOLKIT_GIVEN=1])
682 AC_ARG_WITH(msw, [ --with-msw use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1])
683 AC_ARG_WITH(pm, [ --with-pm use OS/2 Presentation Manager], [wxUSE_PM="$withval" CACHE_PM=1 TOOLKIT_GIVEN=1])
684 AC_ARG_WITH(mgl, [ --with-mgl use SciTech MGL], [wxUSE_MGL="$withval" wxUSE_UNIVERSAL="yes" CACHE_MGL=1 TOOLKIT_GIVEN=1])
685 AC_ARG_WITH(microwin, [ --with-microwin use MicroWindows], [wxUSE_MICROWIN="$withval" CACHE_MICROWIN=1 TOOLKIT_GIVEN=1])
686 AC_ARG_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1])
687 WX_ARG_ENABLE(nanox, [ --enable-nanox use NanoX], wxUSE_NANOX)
688
689 AC_ARG_ENABLE(gtk2, [ --enable-gtk2 use GTK+ 2.0 if available (EXPERIMENTAL)],wxUSE_GTK2="yes",wxUSE_GTK2="no")
690
691 WX_ARG_SYS_WITH(libpng, [ --with-libpng use libpng (PNG image format)], wxUSE_LIBPNG)
692 WX_ARG_SYS_WITH(libjpeg, [ --with-libjpeg use libjpeg (JPEG file format)], wxUSE_LIBJPEG)
693 WX_ARG_SYS_WITH(libtiff, [ --with-libtiff use libtiff (TIFF file format)], wxUSE_LIBTIFF)
694 WX_ARG_WITH(opengl, [ --with-opengl use OpenGL (or Mesa)], wxUSE_OPENGL)
695
696 fi
697 dnl for GUI only
698
699 WX_ARG_WITH(dmalloc, [ --with-dmalloc use dmalloc library (http://dmalloc.com/)], wxUSE_DMALLOC)
700 WX_ARG_SYS_WITH(regex, [ --with-regex enable support for wxRegEx class], wxUSE_REGEX)
701 WX_ARG_SYS_WITH(zlib, [ --with-zlib use zlib for LZW compression], wxUSE_ZLIB)
702 WX_ARG_WITH(odbc, [ --with-odbc use the IODBC and wxODBC classes], wxUSE_ODBC)
703
704 dnl ---------------------------------------------------------------------------
705 dnl compile options
706 dnl ---------------------------------------------------------------------------
707
708 WX_ARG_ENABLE(shared, [ --enable-shared create shared library code], wxUSE_SHARED)
709 WX_ARG_ENABLE(soname, [ --enable-soname set the DT_SONAME field in ELF shared libraries], wxUSE_SONAME)
710 WX_ARG_ENABLE(optimise, [ --enable-optimise create optimised code], wxUSE_OPTIMISE)
711 WX_ARG_ENABLE(debug, [ --enable-debug same as debug_flag and debug_info], wxUSE_DEBUG)
712
713 dnl allow the precompiled header option to be disabled under Mac OS X
714 WX_ARG_ENABLE(precomp, [ --enable-precomp enable use of precompiled headers (Mac OS X)], wxUSE_PRECOMP)
715
716 if test "$wxUSE_DEBUG" = "yes"; then
717 DEFAULT_wxUSE_DEBUG_FLAG=yes
718 DEFAULT_wxUSE_DEBUG_INFO=yes
719 elif test "$wxUSE_DEBUG" = "no"; then
720 DEFAULT_wxUSE_DEBUG_FLAG=no
721 DEFAULT_wxUSE_DEBUG_INFO=no
722 fi
723
724 WX_ARG_ENABLE(debug_flag, [ --enable-debug_flag set __WXDEBUG__ flag (recommended for developers!)], wxUSE_DEBUG_FLAG)
725 WX_ARG_ENABLE(debug_info, [ --enable-debug_info create code with debugging information], wxUSE_DEBUG_INFO)
726 WX_ARG_ENABLE(debug_gdb, [ --enable-debug_gdb create code with extra GDB debugging information], wxUSE_DEBUG_GDB)
727 WX_ARG_ENABLE(debug_cntxt, [ --enable-debug_cntxt use wxDebugContext], wxUSE_DEBUG_CONTEXT)
728 WX_ARG_ENABLE(mem_tracing, [ --enable-mem_tracing create code with memory tracing], wxUSE_MEM_TRACING)
729 WX_ARG_ENABLE(profile, [ --enable-profile create code with profiling information], wxUSE_PROFILE)
730 WX_ARG_ENABLE(no_rtti, [ --enable-no_rtti create code without RTTI information], wxUSE_NO_RTTI)
731 WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without C++ exceptions handling], wxUSE_NO_EXCEPTIONS)
732 WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE)
733 WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS)
734
735 WX_ARG_ENABLE(compat20, [ --enable-compat20 enable wxWindows 2.0 compatibility], WXWIN_COMPATIBILITY_2)
736 WX_ARG_ENABLE(compat22, [ --disable-compat22 disable wxWindows 2.2 compatibility], WXWIN_COMPATIBILITY_2_2)
737
738 dnl ---------------------------------------------------------------------------
739 dnl (small) optional non GUI classes
740 dnl ---------------------------------------------------------------------------
741
742 WX_ARG_ENABLE(intl, [ --enable-intl use internationalization system], wxUSE_INTL)
743 WX_ARG_ENABLE(config, [ --enable-config use wxConfig (and derived) classes], wxUSE_CONFIG)
744
745 WX_ARG_ENABLE(protocols, [ --enable-protocols use wxProtocol and derived classes], wxUSE_PROTOCOL)
746 WX_ARG_ENABLE(ftp, [ --enable-ftp use wxFTP (requires wxProtocol], wxUSE_PROTOCOL_FTP)
747 WX_ARG_ENABLE(http, [ --enable-http use wxHTTP (requires wxProtocol], wxUSE_PROTOCOL_HTTP)
748 WX_ARG_ENABLE(fileproto, [ --enable-fileproto use wxFileProto class (requires wxProtocol], wxUSE_PROTOCOL_FILE)
749 WX_ARG_ENABLE(sockets, [ --enable-sockets use socket/network classes], wxUSE_SOCKETS)
750
751 WX_ARG_ENABLE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC)
752
753 WX_ARG_ENABLE(cmdline, [ --enable-cmdline use wxCmdLineParser class], wxUSE_CMDLINE_PARSER)
754 WX_ARG_ENABLE(datetime, [ --enable-datetime use wxDateTime class], wxUSE_DATETIME)
755 WX_ARG_ENABLE(timedate, [ --enable-timedate use obsolete wxDate/wxTime classes], wxUSE_TIMEDATE)
756 WX_ARG_ENABLE(stopwatch, [ --enable-stopwatch use wxStopWatch class], wxUSE_STOPWATCH)
757 WX_ARG_ENABLE(dialupman, [ --enable-dialupman use dialup network classes], wxUSE_DIALUP_MANAGER)
758 WX_ARG_ENABLE(apple_ieee, [ --enable-apple_ieee use the Apple IEEE codec], wxUSE_APPLE_IEEE)
759 WX_ARG_ENABLE(timer, [ --enable-timer use wxTimer class], wxUSE_TIMER)
760 WX_ARG_ENABLE(wave, [ --enable-wave use wxWave class], wxUSE_WAVE)
761 WX_ARG_ENABLE(fraction, [ --enable-fraction use wxFraction class], wxUSE_FRACTION)
762 WX_ARG_ENABLE(dynlib, [ --enable-dynlib use wxLibrary class for DLL loading], wxUSE_DYNLIB_CLASS)
763 WX_ARG_ENABLE(dynamicloader, [ --enable-dynamicloader use (new) wxDynamicLibrary class], wxUSE_DYNAMIC_LOADER)
764 WX_ARG_ENABLE(longlong, [ --enable-longlong use wxLongLong class], wxUSE_LONGLONG)
765 WX_ARG_ENABLE(geometry, [ --enable-geometry use geometry class], wxUSE_GEOMETRY)
766 WX_ARG_ENABLE(log, [ --enable-log use logging system], wxUSE_LOG)
767 WX_ARG_ENABLE(streams, [ --enable-streams use wxStream etc classes], wxUSE_STREAMS)
768 WX_ARG_ENABLE(file, [ --enable-file use wxFile classes], wxUSE_FILE)
769 WX_ARG_ENABLE(ffile, [ --enable-ffile use wxFFile classes], wxUSE_FFILE)
770 WX_ARG_ENABLE(textbuf, [ --enable-textbuf use wxTextBuffer class], wxUSE_TEXTBUFFER)
771 WX_ARG_ENABLE(textfile, [ --enable-textfile use wxTextFile class], wxUSE_TEXTFILE)
772 WX_ARG_ENABLE(fontmap, [ --enable-fontmap use font encodings conversion classes], wxUSE_FONTMAP)
773 WX_ARG_ENABLE(unicode, [ --enable-unicode compile wxString with Unicode support], wxUSE_UNICODE)
774 WX_ARG_ENABLE(mslu, [ --enable-mslu use MS Layer for Unicode on Windows 9x (win32 only)], wxUSE_UNICODE_MSLU)
775 WX_ARG_ENABLE(wxprintfv, [ --enable-wxprintfv use wxWindows implementation of vprintf()], wxUSE_EXPERIMENTAL_PRINTF)
776 WX_ARG_ENABLE(std_iostreams, [ --enable-std_iostreams use standard C++ stream classes], wxUSE_STD_IOSTREAM)
777 WX_ARG_ENABLE(filesystem, [ --enable-filesystem use virtual file systems classes], wxUSE_FILESYSTEM)
778 WX_ARG_ENABLE(fs_inet, [ --enable-fs_inet use virtual HTTP/FTP filesystems], wxUSE_FS_INET)
779 WX_ARG_ENABLE(fs_zip, [ --enable-fs_zip use virtual ZIP filesystems], wxUSE_FS_ZIP)
780 WX_ARG_ENABLE(zipstream, [ --enable-zipstream use wxZipInputStream], wxUSE_ZIPSTREAM)
781
782 WX_ARG_ENABLE(catch_segvs, [ --enable-catch_segvs catch signals and pass them to wxApp::OnFatalException], wxUSE_ON_FATAL_EXCEPTION)
783 WX_ARG_ENABLE(snglinst, [ --enable-snglinst use wxSingleInstanceChecker class], wxUSE_SNGLINST_CHECKER)
784
785 WX_ARG_ENABLE(mimetype, [ --enable-mimetype use wxMimeTypesManager], wxUSE_MIMETYPE)
786 WX_ARG_ENABLE(system_options,[ --enable-sysoptions use wxSystemOptions], wxUSE_SYSTEM_OPTIONS)
787
788 WX_ARG_ENABLE(url, [ --enable-url use wxURL class], wxUSE_URL)
789 WX_ARG_ENABLE(protocol, [ --enable-protocol use wxProtocol class], wxUSE_PROTOCOL)
790 WX_ARG_ENABLE(protocol_http, [ --enable-protocol-http HTTP support in wxProtocol], wxUSE_PROTOCOL_HTTP)
791 WX_ARG_ENABLE(protocol_ftp, [ --enable-protocol-ftp FTP support in wxProtocol], wxUSE_PROTOCOL_FTP)
792 WX_ARG_ENABLE(protocol_file, [ --enable-protocol-file FILE support in wxProtocol], wxUSE_PROTOCOL_FILE)
793
794
795 dnl ---------------------------------------------------------------------------
796 dnl "big" options (i.e. those which change a lot of things throughout the library)
797 dnl ---------------------------------------------------------------------------
798
799 WX_ARG_ENABLE(threads, [ --enable-threads use threads], wxUSE_THREADS)
800
801 if test "$wxUSE_GUI" = "yes"; then
802
803 dnl ---------------------------------------------------------------------------
804 dnl "big" GUI options
805 dnl ---------------------------------------------------------------------------
806
807 WX_ARG_ENABLE(docview, [ --enable-docview use document view architecture], wxUSE_DOC_VIEW_ARCHITECTURE)
808 WX_ARG_ENABLE(help, [ --enable-help use help subsystem], wxUSE_HELP)
809 WX_ARG_ENABLE(mshtmlhelp, [ --enable-mshtmlhelp use MS HTML Help (win32)], wxUSE_MS_HTML_HELP)
810 WX_ARG_ENABLE(html, [ --enable-html use wxHTML sub-library], wxUSE_HTML)
811 WX_ARG_ENABLE(htmlhelp, [ --enable-htmlhelp use wxHTML-based help], wxUSE_WXHTML_HELP)
812 WX_ARG_ENABLE(constraints, [ --enable-constraints use layout-constraints system], wxUSE_CONSTRAINTS)
813 WX_ARG_ENABLE(printarch, [ --enable-printarch use printing architecture], wxUSE_PRINTING_ARCHITECTURE)
814 WX_ARG_ENABLE(mdi, [ --enable-mdi use multiple document interface architecture], wxUSE_MDI_ARCHITECTURE)
815 WX_ARG_ENABLE(loggui, [ --enable-loggui use standard GUI logger], wxUSE_LOGGUI)
816 WX_ARG_ENABLE(logwin, [ --enable-logwin use wxLogWindow], wxUSE_LOGWINDOW)
817 WX_ARG_ENABLE(logdialog, [ --enable-logdialog use wxLogDialog], wxUSE_LOGDIALOG)
818
819 dnl ---------------------------------------------------------------------------
820 dnl PostScript options
821 dnl ---------------------------------------------------------------------------
822 WX_ARG_ENABLE(postscript, [ --enable-postscript use wxPostscriptDC device context (default for gtk+)], wxUSE_POSTSCRIPT)
823
824 dnl VZ: these options seem to be always on, if someone wants to change it please do
825 dnl WX_ARG_ENABLE(PS-normalized, [ --enable-PS-normalized use normalized PS fonts], dnl wxUSE_NORMALIZED_PS_FONTS)
826 dnl WX_ARG_ENABLE(afmfonts, [ --enable-afmfonts use Adobe Font Metric Font table], dnl wxUSE_AFM_FOR_POSTSCRIPT)
827
828 dnl ---------------------------------------------------------------------------
829 dnl resources
830 dnl ---------------------------------------------------------------------------
831
832 WX_ARG_ENABLE(prologio, [ --enable-prologio use Prolog IO library], wxUSE_PROLOGIO)
833 WX_ARG_ENABLE(resources, [ --enable-resources use wxWindows resources], wxUSE_RESOURCES)
834
835 WX_ARG_ENABLE(xresources, [ --enable-xresources use X resources for save (default for gtk+)], wxUSE_X_RESOURCES)
836
837 dnl ---------------------------------------------------------------------------
838 dnl IPC &c
839 dnl ---------------------------------------------------------------------------
840
841 WX_ARG_ENABLE(clipboard, [ --enable-clipboard use wxClipboard classes], wxUSE_CLIPBOARD)
842 WX_ARG_ENABLE(dnd, [ --enable-dnd use Drag'n'Drop classes], wxUSE_DRAG_AND_DROP)
843 WX_ARG_ENABLE(metafile, [ --enable-metafile use win32 metafiles], wxUSE_METAFILE)
844
845 WX_ARG_ENABLE(treelayout, [ --enable-treelayout use wxTreeLayout classes], wxUSE_TREELAYOUT)
846
847 dnl ---------------------------------------------------------------------------
848 dnl optional GUI controls (in alphabetical order except the first one)
849 dnl ---------------------------------------------------------------------------
850
851 WX_ARG_ENABLE(controls, [ --enable-controls use all usual controls], wxUSE_CONTROLS)
852
853 dnl even with --enable-controls, some may be disabled by giving
854 dnl --disable-<control> later on the command line - but by default all will be
855 dnl used (and vice versa)
856 if test "$wxUSE_CONTROLS" = "yes"; then
857 DEFAULT_wxUSE_ACCEL=yes
858 DEFAULT_wxUSE_BMPBUTTON=yes
859 DEFAULT_wxUSE_BUTTON=yes
860 DEFAULT_wxUSE_CALCTRL=no
861 DEFAULT_wxUSE_CARET=yes
862 DEFAULT_wxUSE_COMBOBOX=yes
863 DEFAULT_wxUSE_CHECKBOX=yes
864 DEFAULT_wxUSE_CHECKLISTBOX=yes
865 DEFAULT_wxUSE_CHOICE=yes
866 DEFAULT_wxUSE_GAUGE=yes
867 DEFAULT_wxUSE_GRID=yes
868 DEFAULT_wxUSE_NEW_GRID=yes
869 DEFAULT_wxUSE_IMAGLIST=yes
870 DEFAULT_wxUSE_LISTBOX=yes
871 DEFAULT_wxUSE_LISTCTRL=yes
872 DEFAULT_wxUSE_NOTEBOOK=yes
873 DEFAULT_wxUSE_PROPSHEET=yes
874 DEFAULT_wxUSE_RADIOBOX=yes
875 DEFAULT_wxUSE_RADIOBTN=yes
876 DEFAULT_wxUSE_SASH=yes
877 DEFAULT_wxUSE_SCROLLBAR=yes
878 DEFAULT_wxUSE_SLIDER=yes
879 DEFAULT_wxUSE_SPINBTN=yes
880 DEFAULT_wxUSE_SPINCTRL=yes
881 DEFAULT_wxUSE_SPLITTER=yes
882 DEFAULT_wxUSE_STATBMP=yes
883 DEFAULT_wxUSE_STATBOX=yes
884 DEFAULT_wxUSE_STATLINE=yes
885 DEFAULT_wxUSE_STATUSBAR=yes
886 DEFAULT_wxUSE_TAB_DIALOG=yes
887 DEFAULT_wxUSE_TOGGLEBTN=yes
888 DEFAULT_wxUSE_TOOLBAR=yes
889 DEFAULT_wxUSE_TOOLBAR_NATIVE=yes
890 DEFAULT_wxUSE_TOOLBAR_SIMPLE=yes
891 DEFAULT_wxUSE_TOOLTIPS=yes
892 DEFAULT_wxUSE_TREECTRL=yes
893 DEFAULT_wxUSE_POPUPWIN=yes
894 DEFAULT_wxUSE_TIPWINDOW=yes
895 elif test "$wxUSE_CONTROLS" = "no"; then
896 DEFAULT_wxUSE_ACCEL=no
897 DEFAULT_wxUSE_BMPBUTTON=no
898 DEFAULT_wxUSE_BUTTON=no
899 DEFAULT_wxUSE_CALCTRL=no
900 DEFAULT_wxUSE_CARET=no
901 DEFAULT_wxUSE_COMBOBOX=no
902 DEFAULT_wxUSE_CHECKBOX=no
903 DEFAULT_wxUSE_CHECKLISTBOX=no
904 DEFAULT_wxUSE_CHOICE=no
905 DEFAULT_wxUSE_GAUGE=no
906 DEFAULT_wxUSE_GRID=no
907 DEFAULT_wxUSE_NEW_GRID=no
908 DEFAULT_wxUSE_IMAGLIST=no
909 DEFAULT_wxUSE_LISTBOX=no
910 DEFAULT_wxUSE_LISTCTRL=no
911 DEFAULT_wxUSE_NOTEBOOK=no
912 DEFAULT_wxUSE_PROPSHEET=no
913 DEFAULT_wxUSE_RADIOBOX=no
914 DEFAULT_wxUSE_RADIOBTN=no
915 DEFAULT_wxUSE_SASH=no
916 DEFAULT_wxUSE_SCROLLBAR=no
917 DEFAULT_wxUSE_SLIDER=no
918 DEFAULT_wxUSE_SPINBTN=no
919 DEFAULT_wxUSE_SPINCTRL=no
920 DEFAULT_wxUSE_SPLITTER=no
921 DEFAULT_wxUSE_STATBMP=no
922 DEFAULT_wxUSE_STATBOX=no
923 DEFAULT_wxUSE_STATLINE=no
924 DEFAULT_wxUSE_STATUSBAR=no
925 DEFAULT_wxUSE_TAB_DIALOG=no
926 DEFAULT_wxUSE_TOGGLEBTN=no
927 DEFAULT_wxUSE_TOOLBAR=no
928 DEFAULT_wxUSE_TOOLBAR_NATIVE=no
929 DEFAULT_wxUSE_TOOLBAR_SIMPLE=no
930 DEFAULT_wxUSE_TOOLTIPS=no
931 DEFAULT_wxUSE_TREECTRL=no
932 DEFAULT_wxUSE_POPUPWIN=no
933 DEFAULT_wxUSE_TIPWINDOW=no
934 fi
935
936 WX_ARG_ENABLE(accel, [ --enable-accel use accelerators], wxUSE_ACCEL)
937 WX_ARG_ENABLE(button, [ --enable-button use wxButton class], wxUSE_BUTTON)
938 WX_ARG_ENABLE(bmpbutton, [ --enable-bmpbutton use wxBitmapButton class], wxUSE_BMPBUTTON)
939 WX_ARG_ENABLE(calendar, [ --enable-calendar use wxCalendarCtrl class], wxUSE_CALCTRL)
940 WX_ARG_ENABLE(caret, [ --enable-caret use wxCaret class], wxUSE_CARET)
941 WX_ARG_ENABLE(checkbox, [ --enable-checkbox use wxCheckBox class], wxUSE_CHECKBOX)
942 WX_ARG_ENABLE(checklst, [ --enable-checklst use wxCheckListBox (listbox with checkboxes) class], wxUSE_CHECKLST)
943 WX_ARG_ENABLE(choice, [ --enable-choice use wxChoice class], wxUSE_CHOICE)
944 WX_ARG_ENABLE(combobox, [ --enable-combobox use wxComboBox classes], wxUSE_COMBOBOX)
945 WX_ARG_ENABLE(gauge, [ --enable-gauge use wxGauge class], wxUSE_GAUGE)
946 WX_ARG_ENABLE(grid, [ --enable-grid use wxGrid class], wxUSE_GRID)
947 WX_ARG_ENABLE(newgrid, [ --enable-newgrid use new wxGrid class], wxUSE_NEW_GRID)
948 WX_ARG_ENABLE(imaglist, [ --enable-imaglist use wxImageList class], wxUSE_IMAGLIST)
949 WX_ARG_ENABLE(listbox, [ --enable-listbox use wxListBox class], wxUSE_LISTBOX)
950 WX_ARG_ENABLE(listctrl, [ --enable-listctrl use wxListCtrl class], wxUSE_LISTCTRL)
951 WX_ARG_ENABLE(notebook, [ --enable-notebook use wxNotebook class], wxUSE_NOTEBOOK)
952 WX_ARG_ENABLE(propsheet, [ --enable-propsheet use wxPropertySheet class], wxUSE_PROPSHEET)
953 WX_ARG_ENABLE(radiobox, [ --enable-radiobox use wxRadioBox class], wxUSE_RADIOBOX)
954 WX_ARG_ENABLE(radiobtn, [ --enable-radiobtn use wxRadioButton class], wxUSE_RADIOBTN)
955 WX_ARG_ENABLE(sash, [ --enable-sash use wxSashWindow class], wxUSE_SASH)
956 WX_ARG_ENABLE(scrollbar, [ --enable-scrollbar use wxScrollBar class and scrollable windows], wxUSE_SCROLLBAR)
957 WX_ARG_ENABLE(slider, [ --enable-slider use wxSlider class], wxUSE_SLIDER)
958 WX_ARG_ENABLE(spinbtn, [ --enable-spinbtn use wxSpinButton class], wxUSE_SPINBTN)
959 WX_ARG_ENABLE(spinctrl, [ --enable-spinctrl use wxSpinCtrl class], wxUSE_SPINCTRL)
960 WX_ARG_ENABLE(splitter, [ --enable-splitter use wxSplitterWindow class], wxUSE_SPLITTER)
961 WX_ARG_ENABLE(statbmp, [ --enable-statbmp use wxStaticBitmap class], wxUSE_STATBMP)
962 WX_ARG_ENABLE(statbox, [ --enable-statbox use wxStaticBox class], wxUSE_STATBOX)
963 WX_ARG_ENABLE(statline, [ --enable-statline use wxStaticLine class], wxUSE_STATLINE)
964 WX_ARG_ENABLE(stattext, [ --enable-stattext use wxStaticText class], wxUSE_STATTEXT)
965 WX_ARG_ENABLE(statusbar, [ --enable-statusbar use wxStatusBar class], wxUSE_STATUSBAR)
966 WX_ARG_ENABLE(tabdialog, [ --enable-tabdialog use wxTabControl class], wxUSE_TABDIALOG)
967 WX_ARG_ENABLE(textctrl, [ --enable-textctrl use wxTextCtrl class], wxUSE_TEXTCTRL)
968 WX_ARG_ENABLE(togglebtn, [ --enable-togglebtn use wxToggleButton class], wxUSE_TOGGLEBTN)
969 WX_ARG_ENABLE(toolbar, [ --enable-toolbar use wxToolBar class], wxUSE_TOOLBAR)
970 WX_ARG_ENABLE(tbarnative, [ --enable-tbarnative use native wxToolBar class], wxUSE_TOOLBAR_NATIVE)
971 WX_ARG_ENABLE(tbarsmpl, [ --enable-tbarsmpl use wxToolBarSimple class], wxUSE_TOOLBAR_SIMPLE)
972 WX_ARG_ENABLE(treectrl, [ --enable-treectrl use wxTreeCtrl class], wxUSE_TREECTRL)
973 WX_ARG_ENABLE(tipwindow, [ --enable-tipwindow use wxTipWindow class], wxUSE_TIPWINDOW)
974 WX_ARG_ENABLE(popupwin, [ --enable-popupwin use wxPopUpWindow class], wxUSE_POPUPWIN)
975
976 dnl ---------------------------------------------------------------------------
977 dnl common dialogs
978 dnl ---------------------------------------------------------------------------
979
980 WX_ARG_ENABLE(commondlg, [ --enable-commondlg use all common dialogs], wxUSE_COMMONDLGS)
981 WX_ARG_ENABLE(choicedlg, [ --enable-choicedlg use wxChoiceDialog], wxUSE_CHOICEDLG)
982 WX_ARG_ENABLE(coldlg, [ --enable-coldlg use wxColourDialog], wxUSE_COLOURDLG)
983 WX_ARG_ENABLE(filedlg, [ --enable-filedlg use wxFileDialog], wxUSE_FILEDLG)
984 WX_ARG_ENABLE(finddlg, [ --enable-finddlg use wxFindReplaceDialog], wxUSE_FINDREPLDLG)
985 WX_ARG_ENABLE(fontdlg, [ --enable-fontdlg use wxFontDialog], wxUSE_FONTDLG)
986 WX_ARG_ENABLE(dirdlg, [ --enable-dirdlg use wxDirDialog], wxUSE_DIRDLG)
987 WX_ARG_ENABLE(msgdlg, [ --enable-msgdlg use wxMessageDialog], wxUSE_MSGDLG)
988 WX_ARG_ENABLE(numberdlg, [ --enable-numberdlg use wxNumberEntryDialog], wxUSE_NUMBERDLG)
989 WX_ARG_ENABLE(splash, [ --enable-splash use wxSplashScreen], wxUSE_SPLASH)
990 WX_ARG_ENABLE(textdlg, [ --enable-textdlg use wxTextDialog], wxUSE_TEXTDLG)
991 WX_ARG_ENABLE(tipdlg, [ --enable-tipdlg use startup tips], wxUSE_STARTUP_TIPS)
992 WX_ARG_ENABLE(progressdlg, [ --enable-progressdlg use wxProgressDialog], wxUSE_PROGRESSDLG)
993 WX_ARG_ENABLE(wizarddlg, [ --enable-wizarddlg use wxWizard], wxUSE_WIZARDDLG)
994
995 dnl ---------------------------------------------------------------------------
996 dnl misc GUI options
997 dnl ---------------------------------------------------------------------------
998
999 WX_ARG_ENABLE(menus, [ --enable-menus use wxMenu/wxMenuBar/wxMenuItem classes], wxUSE_MENUS)
1000 WX_ARG_ENABLE(miniframe, [ --enable-miniframe use wxMiniFrame class], wxUSE_MINIFRAME)
1001 WX_ARG_ENABLE(tooltips, [ --enable-tooltips use wxToolTip class], wxUSE_TOOLTIPS)
1002 WX_ARG_ENABLE(splines, [ --enable-splines use spline drawing code], wxUSE_SPLINES)
1003 WX_ARG_ENABLE(validators, [ --enable-validators use wxValidator and derived classes], wxUSE_VALIDATORS)
1004 WX_ARG_ENABLE(busyinfo, [ --enable-busyinfo use wxBusyInfo], wxUSE_BUSYINFO)
1005 WX_ARG_ENABLE(joystick, [ --enable-joystick use wxJoystick (Linux only)], wxUSE_JOYSTICK)
1006 WX_ARG_ENABLE(metafile, [ --enable-metafiles use wxMetaFile (Windows only)], wxUSE_METAFILE)
1007 WX_ARG_ENABLE(dragimage, [ --enable-dragimage use wxDragImage], wxUSE_DRAGIMAGE)
1008
1009 dnl ---------------------------------------------------------------------------
1010 dnl support for image formats that do not rely on external library
1011 dnl ---------------------------------------------------------------------------
1012
1013 WX_ARG_ENABLE(palette, [ --enable-palette use wxPalette class], wxUSE_PALETTE)
1014 WX_ARG_ENABLE(image, [ --enable-image use wxImage class], wxUSE_IMAGE)
1015 WX_ARG_ENABLE(gif, [ --enable-gif use gif images (GIF file format)], wxUSE_GIF)
1016 WX_ARG_ENABLE(pcx, [ --enable-pcx use pcx images (PCX file format)], wxUSE_PCX)
1017 WX_ARG_ENABLE(iff, [ --enable-iff use iff images (IFF file format)], wxUSE_IFF)
1018 WX_ARG_ENABLE(pnm, [ --enable-pnm use pnm images (PNM file format)], wxUSE_PNM)
1019 WX_ARG_ENABLE(xpm, [ --enable-xpm use xpm images (XPM file format)], wxUSE_XPM)
1020 WX_ARG_ENABLE(ico_cur, [ --enable-icocur use Windows ICO and CUR formats], wxUSE_ICO_CUR)
1021
1022 fi
1023
1024 dnl General settings (needed for GUI and non-GUI compilations alike).
1025 dnl Path separator; ':' for unix, ';' for OS/2
1026 dnl Stem for flex output; lexyy for OS/2, lex.yy otherwise
1027 case "${host}" in
1028 *-pc-os2_emx | *-pc-os2-emx )
1029 dnl PATH_IFS is autodetected by OS/2's configure (usually ';')
1030 LEX_STEM="lexyy"
1031 ;;
1032 *)
1033 PATH_IFS=':'
1034 LEX_STEM="lex.yy"
1035 ;;
1036 esac
1037
1038 dnl for GUI only
1039
1040 dnl cache the options values before (may be) aborting below
1041 WX_ARG_CACHE_FLUSH
1042
1043 dnl check that no more than one toolkit is given and that if none are given that
1044 dnl we have a default one
1045
1046 AC_MSG_CHECKING(for toolkit)
1047
1048 if test "$wxUSE_GUI" = "yes"; then
1049
1050 if test "$USE_BEOS" = 1; then
1051 AC_MSG_ERROR([BeOS GUI is not supported yet, use --disable-gui])
1052 fi
1053
1054 if test "$TOOLKIT_GIVEN" = 1; then
1055 dnl convert "yes" to 1 and "no" to 0
1056 for toolkit in `echo $ALL_TOOLKITS`; do
1057 var=wxUSE_$toolkit
1058 eval "value=\$${var}"
1059 eval "$var=`echo \$value | sed -e "s/yes/1/" -e "s/no/0/"`"
1060 done
1061 else
1062 dnl try to guess the most apropriate toolkit for this platform
1063 for toolkit in `echo $ALL_TOOLKITS`; do
1064 if test "$has_toolkit_in_cache" != 1; then
1065 var=DEFAULT_DEFAULT_wxUSE_$toolkit
1066 else
1067 var=DEFAULT_wxUSE_$toolkit
1068 fi
1069 eval "wxUSE_$toolkit=\$${var}"
1070 done
1071 fi
1072
1073 dnl we suppose that expr is available (maybe there is a better way to do
1074 dnl this? what about using ALL_TOOLKITS? TODO)
1075 NUM_TOOLKITS=`expr ${wxUSE_GTK:-0} + ${wxUSE_MOTIF:-0} + ${wxUSE_MAC:-0} \
1076 + ${wxUSE_WINE:-0} + ${wxUSE_MSW:-0} + ${wxUSE_MGL:-0} + ${wxUSE_MICROWIN:-0} + ${wxUSE_X11:-0}`
1077
1078 dnl Allow wxUSE_PM only for OS/2 with EMX.
1079 case "${host}" in
1080 *-pc-os2_emx | *-pc-os2-emx )
1081 NUM_TOOLKITS=`expr ${NUM_TOOLKITS} + ${wxUSE_PM:-0}`
1082 esac
1083
1084 case "$NUM_TOOLKITS" in
1085 1)
1086 ;;
1087 0)
1088 AC_MSG_ERROR(Please specify a toolkit - cannot determine the default for ${host})
1089 ;;
1090 *)
1091 AC_MSG_ERROR(Please specify at most one toolkit (may be some are cached?))
1092 esac
1093
1094 dnl cache the wxUSE_<TOOLKIT> values too
1095 for toolkit in `echo $ALL_TOOLKITS`; do
1096 var=wxUSE_$toolkit
1097 eval "value=\$${var}"
1098 if test "x$value" != x; then
1099 cache_var=CACHE_$toolkit
1100 eval "cache=\$${cache_var}"
1101 if test "$cache" = 1; then
1102 echo "$var=$value" >> ${wx_arg_cache_file}
1103 fi
1104 if test "$value" = 1; then
1105 toolkit_echo=`echo $toolkit | tr [[A-Z]] [[a-z]]`
1106 AC_MSG_RESULT($toolkit_echo)
1107 fi
1108 fi
1109 done
1110 else
1111 AC_MSG_RESULT(base ($host_alias hosted) only)
1112 fi
1113
1114 dnl ---------------------------------------------------------------------------
1115 dnl When we are using Cygwin with Motif/GTK+, we want it to appear like
1116 dnl 'just' a POSIX platform, so the Win32 API must not be available
1117 dnl ---------------------------------------------------------------------------
1118
1119 define_win32=0
1120 case "${host}" in
1121 *-*-cygwin*)
1122 if test "$wxUSE_MSW" = 1 ; then
1123 define_win32=1
1124 fi
1125 ;;
1126 *-*-mingw*)
1127 define_win32=1
1128 ;;
1129 esac
1130
1131 if test "$define_win32" = 1 ; then
1132 USE_UNIX=0
1133 USE_WIN32=1
1134 AC_DEFINE(__WIN32__)
1135 AC_DEFINE(__WIN95__)
1136 AC_DEFINE(__WINDOWS__)
1137 AC_DEFINE(__GNUWIN32__)
1138 AC_DEFINE(STRICT)
1139 AC_DEFINE(WINVER, 0x0400)
1140 else
1141 USE_UNIX=1
1142 USE_WIN32=0
1143 fi
1144
1145 if test "$USE_UNIX" = 1 ; then
1146 wxUSE_UNIX=yes
1147 AC_DEFINE(__UNIX__)
1148 fi
1149
1150 dnl ---------------------------------------------------------------------------
1151 dnl Checks for programs
1152 dnl ---------------------------------------------------------------------------
1153
1154 dnl flush the cache because checking for programs might abort
1155 AC_CACHE_SAVE
1156
1157 dnl cross-compiling support: we're cross compiling if the build system is
1158 dnl different from the target one (assume host and target be always the same)
1159 if test "$build" != "$host" ; then
1160 if test "$USE_WIN32" = 1 -o "$USE_DOS" = 1 -o "$USE_UNIX"; then
1161 CC=$host_alias-gcc
1162 CXX=$host_alias-c++
1163 AR=$host_alias-ar
1164 RANLIB=$host_alias-ranlib
1165 DLLTOOL=$host_alias-dlltool
1166 RESCOMP=$host_alias-windres
1167 LD=$host_alias-ld
1168 NM=$host_alias-nm
1169 STRIP=$host_alias-strip
1170 else
1171 AC_MSG_ERROR($build_alias -> $host_alias cross compilation not supported yet.)
1172 fi
1173 fi
1174
1175 dnl C-compiler checks
1176 dnl defines CC with the compiler to use
1177 dnl defines GCC with yes if using gcc
1178 dnl defines GCC empty if not using gcc
1179 dnl defines CFLAGS
1180 dnl
1181 dnl this magic incantation is needed to prevent AC_PROG_CC from setting the
1182 dnl default CFLAGS (something like "-g -O2") - we don't need this as add
1183 dnl -g and -O flags ourselves below
1184 CFLAGS=${CFLAGS:=}
1185 AC_PROG_CC
1186
1187 dnl is -traditional needed for correct compilations
1188 dnl adds -traditional for gcc if needed
1189 AC_PROG_GCC_TRADITIONAL
1190
1191 AC_LANG_SAVE
1192 AC_LANG_CPLUSPLUS
1193
1194 dnl C++-compiler checks
1195 dnl defines CXX with the compiler to use
1196 dnl defines GXX with yes if using gxx
1197 dnl defines GXX empty if not using gxx
1198 dnl defines CXXFLAGS
1199 dnl
1200 dnl see CFLAGS line above
1201 CXXFLAGS=${CXXFLAGS:=}
1202 AC_PROG_CXX
1203
1204 AC_LANG_RESTORE
1205
1206 dnl ranlib command
1207 dnl defines RANLIB with the appropriate command
1208 AC_PROG_RANLIB
1209
1210 dnl ar command
1211 dnl defines AR with the appropriate command
1212 AC_CHECK_PROG(AR, ar, ar, ar)
1213
1214 dnl install checks
1215 dnl defines INSTALL with the appropriate command
1216 AC_PROG_INSTALL
1217
1218 dnl make install path absolute (if not already); will fail with MSDOS paths
1219 case ${INSTALL} in
1220 /* ) # Absolute
1221 ;;
1222 *)
1223 INSTALL=`pwd`/${INSTALL} ;;
1224 esac
1225
1226
1227 case "${host}" in
1228
1229 dnl The other BSD's should probably go in here too, since this is
1230 dnl to workaround a strange static lib BSDism.
1231 dnl Mac OS X install seems to ignore -p option...
1232 powerpc-*-darwin* )
1233 INSTALL_PROGRAM="cp -fp"
1234 INSTALL_DATA="cp -fp"
1235 ;;
1236 *)
1237 ;;
1238 esac
1239
1240 dnl strip command
1241 dnl defines STRIP as strip or nothing if not found
1242 AC_CHECK_PROG(STRIP, strip, strip, true)
1243
1244 dnl does make support "-include" (only GNU make does AFAIK)?
1245 AC_CACHE_CHECK([if make is GNU make], wx_cv_prog_makeisgnu,
1246 [
1247 if ( ${SHELL-sh} -c "${MAKE-make} --version" 2> /dev/null |
1248 egrep -s GNU > /dev/null); then
1249 wx_cv_prog_makeisgnu="yes"
1250 else
1251 wx_cv_prog_makeisgnu="no"
1252 fi
1253 ])
1254
1255 if test "x$wx_cv_prog_makeisgnu" = "xyes"; then
1256 IF_GNU_MAKE=""
1257 else
1258 IF_GNU_MAKE="#"
1259 fi
1260
1261 AC_SUBST(IF_GNU_MAKE)
1262
1263 dnl we don't need to check for VPATH support in GNU make - it does have it
1264 if test "x$wx_cv_prog_makeisgnu" != "xyes"; then
1265 dnl check if VPATH works
1266 AC_CACHE_CHECK([if make supports VPATH], wx_cv_prog_makevpath, [
1267 dnl create Makefile
1268 cat - << EOF > confMake
1269 check : file
1270 cp \$? \$@
1271 cp \$? final_file
1272 EOF
1273
1274 if test ! -d sub ; then
1275 mkdir sub
1276 fi
1277 echo dummy > sub/file
1278 ${MAKE-make} -f confMake VPATH=sub 2>&5 > /dev/null
1279 RESULT=$?
1280 rm -f sub/file check final_file confMake
1281 rmdir sub
1282 if test "$RESULT" = 0; then
1283 wx_cv_prog_makevpath="yes"
1284 else
1285 wx_cv_prog_makevpath="no"
1286 fi
1287 ])
1288
1289 if test "x$wx_cv_prog_makevpath" != "xyes"; then
1290 AC_MSG_ERROR([
1291 You need a make-utility that is able to use the variable
1292 VPATH correctly.
1293 If your version of make does not support VPATH correctly,
1294 please install GNU-make (possibly as gmake), and start
1295 configure with the following command:
1296 export MAKE=gmake; ./configure for sh-type shells
1297 setenv MAKE gmake; ./configure for csh-type shells
1298 Also please do remember to use gmake in this case every time
1299 you are trying to compile.
1300 ])
1301 fi dnl make without VPATH
1302 fi dnl not GNU make
1303
1304 dnl YACC checks
1305 dnl defines YACC with the appropriate command
1306 AC_PROG_YACC
1307
1308 dnl LEX checks
1309 dnl defines LEX with the appropriate command
1310 dnl defines LEXLIB with the appropriate library
1311 AC_PROG_LEX
1312
1313 dnl needed for making link to setup.h
1314 AC_PROG_LN_S
1315
1316 dnl ------------------------------------------------------------------------
1317 dnl Check for headers
1318 dnl ------------------------------------------------------------------------
1319
1320 dnl test for strings.h needed under AIX, but do not check for it wxMac as
1321 dnl it exists but is only a simple redirection to string.h and it is in
1322 dnl conflict with Strings.h in FlatCarbon headers
1323 if test "$wxUSE_MAC" != 1; then
1324 dnl defines HAVE_STRINGS_H
1325 AC_CHECK_HEADERS(strings.h)
1326 fi
1327
1328 dnl defines HAVE_STDLIB_H
1329 AC_CHECK_HEADERS(stdlib.h)
1330 dnl defines HAVE_MALLOC_H
1331 AC_CHECK_HEADERS(malloc.h)
1332 dnl defines HAVE_UNISTD_H
1333 AC_CHECK_HEADERS(unistd.h)
1334 dnl defines HAVE_WCHAR_H
1335 AC_CHECK_HEADERS(wchar.h)
1336
1337 dnl maybe wchar_t is in wcstr.h if we don't have wchar.h?
1338 if test "$ac_cv_header_wchar_h" != "yes"; then
1339 dnl defines HAVE_WCSTR_H
1340 AC_CHECK_HEADERS(wcstr.h)
1341 fi
1342
1343 dnl checking for wctype.h is useless as we need wcslen(), not just wchar_t and
1344 dnl this function is never provided by it
1345 dnl AC_CHECK_HEADERS(wctype.h)
1346
1347 dnl defines HAVE_FNMATCH_H
1348 AC_CHECK_HEADERS(fnmatch.h)
1349
1350 if test "x$ac_cv_header_fnmatch_h" = "xyes"; then
1351 AC_CHECK_FUNCS(fnmatch)
1352 fi
1353
1354 dnl defines HAVE_LANGINFO_H (GNU libc locale parameters)
1355 AC_CHECK_HEADERS(langinfo.h)
1356
1357 if test "$wxUSE_GUI" = "yes"; then
1358 if test "$wxUSE_UNIX" = "yes"; then
1359 dnl defines HAVE_X11_XKBLIB_H
1360 AC_CHECK_HEADERS(X11/XKBlib.h)
1361 fi
1362 fi
1363
1364 dnl ---------------------------------------------------------------------------
1365 dnl Checks for compiler characteristics
1366 dnl ---------------------------------------------------------------------------
1367
1368 dnl defines const to be empty if c-compiler does not support const fully
1369 AC_C_CONST
1370 dnl defines inline to a sensible value for the c-compiler
1371 AC_C_INLINE
1372
1373 dnl check the sizes of integral types (give some reasonable default values for
1374 dnl cross-compiling)
1375 dnl defines the size of certain types of variables in SIZEOF_<TYPE>
1376 AC_CHECK_SIZEOF(char, 1)
1377 AC_CHECK_SIZEOF(short, 2)
1378 AC_CHECK_SIZEOF(void *, 4)
1379 AC_CHECK_SIZEOF(int, 4)
1380 AC_CHECK_SIZEOF(long, 4)
1381
1382 case "${host}" in
1383 arm-*-linux* )
1384 AC_CHECK_SIZEOF(long long, 8)
1385 ;;
1386 * )
1387 AC_CHECK_SIZEOF(long long, 0)
1388 esac
1389
1390 dnl we have to do it ourselves because SGI/Irix's stdio.h does not include
1391 dnl wchar_t and AC_CHECK_SIZEOF only includes stdio.h
1392 dnl Mac OS X does not provide wchar.h and wchar_t is defined by stdlib.h (GD)
1393 AC_CACHE_CHECK([size of wchar_t], wx_cv_sizeof_wchar_t,
1394 [
1395 AC_TRY_RUN(
1396 [
1397 #ifdef HAVE_WCHAR_H
1398 # ifdef __CYGWIN__
1399 # include <stddef.h>
1400 # endif
1401 # include <wchar.h>
1402 #endif
1403 #ifdef HAVE_STDLIB_H
1404 # include <stdlib.h>
1405 #endif
1406 #include <stdio.h>
1407 int main()
1408 {
1409 FILE *f=fopen("conftestval", "w");
1410 if (!f) exit(1);
1411 fprintf(f, "%i", sizeof(wchar_t));
1412 exit(0);
1413 }
1414 ],
1415 wx_cv_sizeof_wchar_t=`cat conftestval`,
1416 wx_cv_sizeof_wchar_t=0,
1417 wx_cv_sizeof_wchar_t=4
1418 )
1419 ])
1420
1421 AC_DEFINE_UNQUOTED(SIZEOF_WCHAR_T, $wx_cv_sizeof_wchar_t)
1422
1423 dnl check for large file support
1424 AC_SYS_LARGEFILE
1425
1426 dnl check for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling)
1427 WX_C_BIGENDIAN
1428
1429 dnl check for iostream (as opposed to iostream.h) standard header
1430 WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH))
1431
1432 dnl check whether C++ compiler supports bool built-in type
1433 WX_CPP_BOOL
1434
1435 dnl check whether C++ compiler supports explicit keyword
1436 WX_CPP_EXPLICIT
1437
1438 dnl ---------------------------------------------------------------------------
1439 dnl Define search path for includes and libraries: all headers and libs will be
1440 dnl looked for in all directories of this path
1441 dnl ---------------------------------------------------------------------------
1442
1443 dnl notice that /usr/include should not be in this list, otherwise it breaks
1444 dnl compilation on Solaris/gcc because standard headers are included instead
1445 dnl of the gcc ones (correction: it *is* needed for broken AIX compiler - but
1446 dnl do put it last!)
1447 dnl
1448 dnl Also try to put all directories which may contain X11R6 before those which
1449 dnl may contain X11R5/4 - we want to use R6 on machines which have both!
1450 SEARCH_INCLUDE="\
1451 /usr/local/include \
1452 \
1453 /usr/Motif-1.2/include \
1454 /usr/Motif-2.1/include \
1455 \
1456 /usr/include/Motif1.2 \
1457 /opt/xpm/include/X11 \
1458 /opt/GBxpm/include/ \
1459 /opt/GBxpm/X11/include/ \
1460 \
1461 /usr/Motif1.2/include \
1462 /usr/dt/include \
1463 /usr/openwin/include \
1464 \
1465 /usr/include/Xm \
1466 \
1467 /usr/X11R6/include \
1468 /usr/X11R6.4/include \
1469 /usr/X11R5/include \
1470 /usr/X11R4/include \
1471 \
1472 /usr/include/X11R6 \
1473 /usr/include/X11R5 \
1474 /usr/include/X11R4 \
1475 \
1476 /usr/local/X11R6/include \
1477 /usr/local/X11R5/include \
1478 /usr/local/X11R4/include \
1479 \
1480 /usr/local/include/X11R6 \
1481 /usr/local/include/X11R5 \
1482 /usr/local/include/X11R4 \
1483 \
1484 /usr/X11/include \
1485 /usr/include/X11 \
1486 /usr/local/X11/include \
1487 /usr/local/include/X11 \
1488 \
1489 /usr/X386/include \
1490 /usr/x386/include \
1491 /usr/XFree86/include/X11 \
1492 \
1493 X:/XFree86/include \
1494 X:/XFree86/include/X11 \
1495 \
1496 /usr/include/gtk \
1497 /usr/local/include/gtk \
1498 /usr/include/glib \
1499 /usr/local/include/glib \
1500 \
1501 /usr/include/qt \
1502 /usr/local/include/qt \
1503 \
1504 /usr/include/windows \
1505 /usr/include/wine \
1506 /usr/local/include/wine \
1507 \
1508 /usr/unsupported/include \
1509 /usr/athena/include \
1510 /usr/local/x11r5/include \
1511 /usr/lpp/Xamples/include \
1512 \
1513 /usr/openwin/share/include \
1514 \
1515 /usr/include"
1516
1517 SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s/include/lib/g` "
1518
1519 dnl ------------------------------------------------------------------------
1520 dnl Check for libraries
1521 dnl ------------------------------------------------------------------------
1522
1523 dnl flush the cache because checking for libraries below might abort
1524 AC_CACHE_SAVE
1525
1526 dnl check for glibc version
1527 dnl
1528 dnl VZ: I have no idea why had this check been there originally, but now
1529 dnl it is only used to get the recursive mutexes under Linux
1530 if test "$USE_LINUX" = 1; then
1531 AC_CACHE_CHECK([for glibc 2.1 or later], wx_cv_lib_glibc21,[
1532 AC_TRY_COMPILE([#include <features.h>],
1533 [
1534 #if (__GLIBC__ < 2) || (__GLIBC_MINOR__ < 1)
1535 #error not glibc2.1
1536 #endif
1537 ],
1538 [
1539 wx_cv_lib_glibc21=yes
1540 ],
1541 [
1542 wx_cv_lib_glibc21=no
1543 ]
1544 )
1545 ])
1546 if test "$wx_cv_lib_glibc21" = "yes"; then
1547 AC_DEFINE(wxHAVE_GLIBC2)
1548 fi
1549 fi
1550
1551 dnl ---------------------------------------------------------------------------
1552 dnl Optional libraries
1553 dnl
1554 dnl --with-<lib>=sys
1555 dnl looks for system library and fails if not found
1556 dnl
1557 dnl --with-<lib>
1558 dnl --with-<lib>=yes
1559 dnl looks for system library and, if not found, prints a warning,
1560 dnl falls back to the builtin wx version, and continues configuration
1561 dnl
1562 dnl --with-<lib>=builtin
1563 dnl uses builtin wx version without searching for system library
1564 dnl
1565 dnl --with-<lib>=no
1566 dnl --without-<lib>
1567 dnl do not use library (neither system nor builtin wx version)
1568 dnl
1569 dnl ---------------------------------------------------------------------------
1570
1571 dnl ------------------------------------------------------------------------
1572 dnl Check for regex libraries
1573 dnl ------------------------------------------------------------------------
1574
1575 REGEX_INCLUDE=
1576 if test "$wxUSE_REGEX" != "no"; then
1577 AC_DEFINE(wxUSE_REGEX)
1578
1579 if test "$wxUSE_REGEX" = "sys" -o "$wxUSE_REGEX" = "yes" ; then
1580 dnl according to Unix 98 specs, regcomp() is in libc but I believe that
1581 dnl on some old systems it may be in libregex - check for it too?
1582 AC_CHECK_HEADER(regex.h, AC_CHECK_FUNCS(regcomp))
1583
1584 if test "x$ac_cv_func_regcomp" != "xyes"; then
1585 if test "$wxUSE_REGEX" = "sys" ; then
1586 AC_MSG_ERROR([system regex library not found! Use --with-regex to use built-in version])
1587 else
1588 AC_MSG_WARN([system regex library not found, will use built-in instead])
1589 wxUSE_REGEX=builtin
1590 fi
1591 else
1592 dnl we are using the system library
1593 wxUSE_REGEX=sys
1594 fi
1595 fi
1596
1597 if test "$wxUSE_REGEX" = "builtin" ; then
1598 REGEX_INCLUDE="-I\${top_srcdir}/src/regex"
1599 fi
1600 fi
1601
1602 dnl ------------------------------------------------------------------------
1603 dnl Check for zlib compression library
1604 dnl ------------------------------------------------------------------------
1605
1606 ZLIB_INCLUDE=
1607 ZLIB_LINK=
1608 if test "$wxUSE_ZLIB" != "no" ; then
1609 AC_DEFINE(wxUSE_ZLIB)
1610
1611 if test "$wxUSE_ZLIB" = "sys" -o "$wxUSE_ZLIB" = "yes" ; then
1612 AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, deflate, ZLIB_LINK=" -lz"))
1613
1614 if test "x$ZLIB_LINK" = "x" ; then
1615 if test "$wxUSE_ZLIB" = "sys" ; then
1616 AC_MSG_ERROR([system zlib compression library not found! Use --with-zlib=builtin to use built-in version])
1617 else
1618 AC_MSG_WARN([system zlib compression library not found, will use built-in instead])
1619 wxUSE_ZLIB=builtin
1620 fi
1621 else
1622 dnl we are using the system library
1623 wxUSE_ZLIB=sys
1624 fi
1625 fi
1626
1627 if test "$wxUSE_ZLIB" = "builtin" ; then
1628 ZLIB_INCLUDE="-I\${top_srcdir}/src/zlib"
1629 fi
1630 fi
1631
1632 dnl ------------------------------------------------------------------------
1633 dnl Check for png library
1634 dnl ------------------------------------------------------------------------
1635
1636 PNG_INCLUDE=
1637 PNG_LINK=
1638 if test "$wxUSE_LIBPNG" != "no" ; then
1639 AC_DEFINE(wxUSE_LIBPNG)
1640
1641 if test "$wxUSE_MGL" = 1 -a "$wxUSE_LIBPNG" = "builtin" ; then
1642 AC_MSG_WARN([wxMGL doesn't work with builtin png library, will use MGL one instead])
1643 wxUSE_LIBPNG=sys
1644 fi
1645
1646 dnl for the check below to have a chance to succeed, we must already have
1647 dnl libz somewhere (don't do this when bulding wxMGL since its libpng
1648 dnl doesn't depend on zlib)
1649 if test "$wxUSE_MGL" != 1 -a "$wxUSE_LIBPNG" = "sys" -a "$wxUSE_ZLIB" != "sys" ; then
1650 AC_MSG_WARN([system png library doesn't work without system zlib, will use built-in instead])
1651 wxUSE_LIBPNG=builtin
1652 fi
1653
1654 if test "$wxUSE_MGL" != 1 ; then
1655 dnl Don't check for libpng when building wxMGL, libmgl contains it
1656 if test "$wxUSE_LIBPNG" = "sys" -o "$wxUSE_LIBPNG" = "yes" ; then
1657 AC_CHECK_HEADER(png.h,
1658 AC_CHECK_LIB(png, png_check_sig,
1659 PNG_LINK=" -lpng",
1660 ,
1661 [-lz -lm])
1662 )
1663
1664 if test "x$PNG_LINK" = "x" ; then
1665 if test "$wxUSE_LIBPNG" = "sys" ; then
1666 AC_MSG_ERROR([system png library not found! Use --with-libpng=builtin to use built-in version])
1667 else
1668 AC_MSG_WARN([system png library not found, will use built-in instead])
1669 wxUSE_LIBPNG=builtin
1670 fi
1671 else
1672 dnl we are using the system library
1673 wxUSE_LIBPNG=yes
1674 fi
1675 fi
1676 fi
1677
1678 if test "$wxUSE_LIBPNG" = "builtin" ; then
1679 PNG_INCLUDE="-I\${top_srcdir}/src/png"
1680 fi
1681
1682 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS png"
1683 fi
1684
1685 dnl ------------------------------------------------------------------------
1686 dnl Check for jpeg library
1687 dnl ------------------------------------------------------------------------
1688
1689 JPEG_INCLUDE=
1690 JPEG_LINK=
1691 if test "$wxUSE_LIBJPEG" != "no" ; then
1692 AC_DEFINE(wxUSE_LIBJPEG)
1693
1694 if test "$wxUSE_MGL" = 1 -a "$wxUSE_LIBJPEG" = "builtin" ; then
1695 AC_MSG_WARN([wxMGL doesn't work with builtin jpeg library, will use MGL one instead])
1696 wxUSE_LIBJPEG=sys
1697 fi
1698
1699 if test "$wxUSE_MGL" != 1 ; then
1700 dnl Don't check for libjpeg when building wxMGL, libmgl contains it
1701 if test "$wxUSE_LIBJPEG" = "sys" -o "$wxUSE_LIBJPEG" = "yes" ; then
1702 dnl can't use AC_CHECK_HEADER as jconfig.h defines things like
1703 dnl HAVE_STDLIB_H which are already defined and this provokes
1704 dnl a compiler warning which configure considers as an error...
1705 AC_MSG_CHECKING(for jpeglib.h)
1706 AC_CACHE_VAL(ac_cv_header_jpeglib_h,
1707 AC_TRY_COMPILE(
1708 [
1709 #undef HAVE_STDLIB_H
1710 #include <stdio.h>
1711 #include <jpeglib.h>
1712 ],
1713 [
1714 ],
1715 ac_cv_header_jpeglib_h=yes,
1716 ac_cv_header_jpeglib_h=no
1717 )
1718 )
1719 AC_MSG_RESULT($ac_cv_header_jpeglib_h)
1720
1721 if test "$ac_cv_header_jpeglib_h" = "yes"; then
1722 AC_CHECK_LIB(jpeg, jpeg_read_header, JPEG_LINK=" -ljpeg")
1723 fi
1724
1725 if test "x$JPEG_LINK" = "x" ; then
1726 if test "$wxUSE_LIBJPEG" = "sys" ; then
1727 AC_MSG_ERROR([system jpeg library not found! Use --with-libjpeg=builtin to use built-in version])
1728 else
1729 AC_MSG_WARN([system jpeg library not found, will use built-in instead])
1730 wxUSE_LIBJPEG=builtin
1731 fi
1732 else
1733 dnl we are using the system library
1734 wxUSE_LIBJPEG=sys
1735 fi
1736 fi
1737 fi
1738
1739 if test "$wxUSE_LIBJPEG" = "builtin" ; then
1740 JPEG_INCLUDE="-I\${top_srcdir}/src/jpeg"
1741 fi
1742 fi
1743
1744 dnl ------------------------------------------------------------------------
1745 dnl Check for tiff library
1746 dnl ------------------------------------------------------------------------
1747
1748 TIFF_INCLUDE=
1749 TIFF_LINK=
1750 if test "$wxUSE_LIBTIFF" != "no" ; then
1751 AC_DEFINE(wxUSE_LIBTIFF)
1752
1753 if test "$wxUSE_LIBTIFF" = "sys" -o "$wxUSE_LIBTIFF" = "yes" ; then
1754 AC_CHECK_HEADER(tiffio.h,
1755 AC_CHECK_LIB(tiff, TIFFError,
1756 TIFF_LINK=" -ltiff",
1757 ,
1758 -lm)
1759 )
1760
1761 if test "x$TIFF_LINK" = "x" ; then
1762 if test "$wxUSE_LIBTIFF" = "sys" ; then
1763 AC_MSG_ERROR([system tiff library not found! Use --with-libtiff=builtin to use built-in version])
1764 else
1765 AC_MSG_WARN([system tiff library not found, will use built-in instead])
1766 wxUSE_LIBTIFF=builtin
1767 fi
1768 else
1769 dnl we are using the system library
1770 wxUSE_LIBTIFF=sys
1771 fi
1772 fi
1773
1774 if test "$wxUSE_LIBTIFF" = "builtin" ; then
1775 TIFF_INCLUDE="-I\${top_srcdir}/src/tiff"
1776 fi
1777 fi
1778
1779 dnl ----------------------------------------------------------------
1780 dnl search for toolkit (widget sets)
1781 dnl ----------------------------------------------------------------
1782
1783 AFMINSTALL=
1784
1785 TOOLKIT=
1786 TOOLKIT_INCLUDE=
1787 WIDGET_SET=
1788
1789 dnl are we building for a win32 target environment?
1790 dnl If so, setup common stuff needed for both GUI and Base libs.
1791 if test "$USE_WIN32" = 1 ; then
1792 AC_CHECK_HEADERS(w32api.h)
1793 AC_CHECK_HEADER(windows.h, [],
1794 [
1795 AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
1796 ])
1797
1798 dnl check if can use _WIN32_IE macro
1799 AC_CACHE_CHECK([if w32api has good enough MSIE support], wx_cv_w32api_win32_ie,
1800 [
1801 AC_TRY_COMPILE([#include <w32api.h>],
1802 [
1803 #define wxCHECK_W32API_VERSION( major, minor ) \
1804 ( defined( __W32API_MAJOR_VERSION ) && defined( __W32API_MINOR_VERSION ) \
1805 && ( ( __W32API_MAJOR_VERSION > (major) ) \
1806 || ( __W32API_MAJOR_VERSION == (major) && __W32API_MINOR_VERSION >= (minor))))
1807
1808 #if !wxCHECK_W32API_VERSION(1,1)
1809 #error You need w32api 1.1 or newer
1810 #endif
1811 ], [
1812 wx_cv_w32api_win32_ie=yes
1813 ], [
1814 wx_cv_w32api_win32_ie=no
1815 ])
1816 ])
1817 if test "$wx_cv_w32api_win32_ie" = "yes" ; then
1818 CPPFLAGS="$CPPFLAGS -D_WIN32_IE=0x400"
1819 fi
1820
1821 dnl --- FIXME: This is still a somewhat random list of libs,
1822 dnl --- some of them should probably be included conditionally.
1823 LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lwsock32"
1824
1825 case "${host}" in
1826 *-*-cygwin* )
1827 dnl Cygwin doesn't include these by default
1828 LIBS="$LIBS -lkernel32 -luser32 -lgdi32 -lcomdlg32"
1829 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WIN95__"
1830 esac
1831
1832 dnl add extra odbc libs if we have compiled in odbc
1833 if test "$wxUSE_ODBC" = "yes" ; then
1834 LIBS=" -lodbc32 -lole32 -loleaut32 $LIBS"
1835 fi
1836
1837 RESFLAGS="--include-dir \$(top_srcdir)/include --include-dir \$(top_srcdir)/\$(program_dir) --define __WIN32__ --define __WIN95__ --define __GNUWIN32__"
1838 RESPROGRAMOBJ="\$(PROGRAM)_resources.o"
1839 fi
1840
1841 if test "$wxUSE_GUI" = "yes"; then
1842 USE_GUI=1
1843
1844 GUI_TK_LIBRARY=
1845
1846 WXGTK12=
1847 WXGTK127=
1848 WXGTK20=
1849
1850 if test "$wxUSE_MSW" = 1 ; then
1851 TOOLKIT=MSW
1852 GUIDIST=MSW_DIST
1853
1854 dnl -mwindows causes a heap of other default gui libs to be linked in.
1855 dnl FIXME: If cygwin needs this, please push it above, if not, please
1856 dnl remove this comment :-)
1857 case "${host}" in
1858 *-*-mingw32* )
1859 LDFLAGS="$LDFLAGS -Wl,--subsystem,windows -mwindows"
1860 esac
1861 fi
1862
1863 if test "$wxUSE_GTK" = 1; then
1864 AC_MSG_CHECKING([for GTK+ version])
1865
1866 gtk_version_cached=1
1867 AC_CACHE_VAL(wx_cv_lib_gtk,
1868 [
1869 dnl stupid GTK+ AM macros produce their own messages, so we
1870 dnl have to pass to the next line
1871 gtk_version_cached=0
1872 AC_MSG_RESULT()
1873
1874 dnl we must link against lgthread unless the user
1875 dnl used --disable-threads
1876 GTK_MODULES=
1877 if test "$wxUSE_THREADS" = "yes"; then
1878 GTK_MODULES=gthread
1879 fi
1880
1881 wx_cv_lib_gtk=
1882 if test "x$wxUSE_GTK2" = "xyes"; then
1883 AM_PATH_GTK_2_0(2.0.0, wx_cv_lib_gtk=2.0, , $GTK_MODULES)
1884 fi
1885
1886 if test -z "$wx_cv_lib_gtk"; then
1887 AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7, , $GTK_MODULES)
1888 fi
1889
1890 if test -z "$wx_cv_lib_gtk"; then
1891 AM_PATH_GTK(1.2.3, wx_cv_lib_gtk=1.2.3, , $GTK_MODULES)
1892 fi
1893
1894 if test -z "$wx_cv_lib_gtk"; then
1895 dnl looks better in AC_MSG_RESULT
1896 wx_cv_lib_gtk=none
1897 else
1898 dnl we need to cache GTK_CFLAGS and GTK_LIBS for the
1899 dnl subsequent runs
1900 wx_cv_cflags_gtk=$GTK_CFLAGS
1901 wx_cv_libs_gtk=$GTK_LIBS
1902 fi
1903 ]
1904 )
1905
1906 dnl if it wasn't cached, the messages from AM_PATH_GTK() above are
1907 dnl enough
1908 if test "$gtk_version_cached" = 1; then
1909 AC_MSG_RESULT($wx_cv_lib_gtk)
1910 fi
1911
1912 case "$wx_cv_lib_gtk" in
1913 2.0) WXGTK20=1
1914 ;;
1915 1.2.7) WXGTK127=1
1916 WXGTK12=1
1917 ;;
1918 1.2.3) WXGTK12=1
1919 ;;
1920 *) AC_MSG_ERROR([
1921 Please check that gtk-config is in path, the directory
1922 where GTK+ libraries are installed (returned by
1923 'gtk-config --libs' command) is in LD_LIBRARY_PATH or
1924 equivalent variable and GTK+ is version 1.2.3 or above.
1925 ])
1926 ;;
1927 esac
1928
1929 TOOLKIT_INCLUDE="$wx_cv_cflags_gtk"
1930 GUI_TK_LIBRARY="$wx_cv_libs_gtk"
1931
1932 AFMINSTALL=afminstall
1933 TOOLKIT=GTK
1934 GUIDIST=GTK_DIST
1935
1936 dnl test for XIM support in libgdk
1937 AC_CHECK_LIB(gdk, gdk_im_open, AC_DEFINE(HAVE_XIM))
1938 fi
1939
1940 if test "$wxUSE_MGL" = 1; then
1941 AC_MSG_CHECKING(for SciTech MGL library)
1942 if test "x$MGL_ROOT" = x ; then
1943 AC_MSG_RESULT(not found)
1944 AC_MSG_ERROR([Cannot find MGL library. Make sure MGL_ROOT is set.])
1945 else
1946 AC_MSG_RESULT($MGL_ROOT)
1947 fi
1948
1949 dnl Find MGL library that we want
1950 dnl FIXME_MGL - test for MGL variants for freebsd etc.
1951 case "${host}" in
1952 *-*-linux* )
1953 mgl_os=linux/gcc/glibc
1954 ;;
1955 *-pc-msdosdjgpp )
1956 mgl_os=dos32/dj2
1957 ;;
1958 *)
1959 AC_MSG_ERROR(This system type ${host} is not yet supported by wxMGL.)
1960 esac
1961
1962 mgl_lib_type=""
1963
1964 if test "$wxUSE_DEBUG_FLAG" = yes ; then
1965 if test -f $MGL_ROOT/lib/debug/$mgl_os/libmgl.a -o \
1966 -f $MGL_ROOT/lib/debug/$mgl_os/libmgl.so; then
1967 mgl_lib_type=debug
1968 fi
1969 fi
1970 if test "x$mgl_lib_type" = x ; then
1971 if test -f $MGL_ROOT/lib/release/$mgl_os/libmgl.a -o \
1972 -f $MGL_ROOT/lib/release/$mgl_os/libmgl.so; then
1973 mgl_lib_type=release
1974 else
1975 AC_MSG_ERROR([Cannot find MGL libraries, make sure they are compiled.])
1976 fi
1977 fi
1978
1979 wxUSE_UNIVERSAL="yes"
1980
1981 TOOLKIT_INCLUDE="-I$MGL_ROOT/include"
1982 GUI_TK_LIBRARY="-L$MGL_ROOT/lib/$mgl_lib_type/$mgl_os -lmgl -lmglcpp -lpm"
1983
1984 AFMINSTALL=afminstall
1985 TOOLKIT=MGL
1986 GUIDIST=MGL_DIST
1987 fi
1988
1989 if test "$wxUSE_MICROWIN" = 1; then
1990 AC_MSG_CHECKING(for MicroWindows)
1991 if test "x$MICROWINDOWS" = x ; then
1992 AC_MSG_RESULT(not found)
1993 AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWINDOWS is set.])
1994 else
1995 AC_MSG_RESULT($MICROWINDOWS)
1996 fi
1997
1998 if test -f $MICROWINDOWS/lib/libmwin.a; then
1999 AC_MSG_RESULT(MicroWindows' libraries found.)
2000 else
2001 AC_MSG_ERROR([Cannot find MicroWindows libraries, make sure they are compiled.])
2002 fi
2003
2004 TOOLKIT_INCLUDE="-I$MICROWINDOWS/include"
2005 GUI_TK_LIBRARY="-L$MICROWINDOWS/lib -lmwin -lmwengine -mwfonts -mwdrivers -mwinlib"
2006
2007 wxUSE_UNIVERSAL="yes"
2008
2009 AFMINSTALL=afminstall
2010 TOOLKIT=MICROWIN
2011 GUIDIST=MICROWIN_DIST
2012
2013 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1"
2014 fi
2015
2016 if test "$wxUSE_X11" = 1; then
2017 dnl use standard macros to check for X headers/libs, this brings support
2018 dnl for the standard configure options --x-includes and --x-libraries
2019 AC_PATH_XTRA
2020
2021 if test "$no_x" = "yes"; then
2022 AC_MSG_ERROR(X11 not found, please use --x-includes and/or --x-libraries options)
2023 fi
2024
2025 GUI_TK_LIBRARY="$X_LIBS"
2026 TOOLKIT_INCLUDE="$X_CFLAGS"
2027 AFMINSTALL=afminstall
2028 COMPILED_X_PROGRAM=0
2029
2030 if test "$wxUSE_NANOX" = "yes"; then
2031 AC_MSG_CHECKING(for MicroWindows/NanoX distribution)
2032 if test "x$MICROWIN" = x ; then
2033 AC_MSG_RESULT(not found)
2034 AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWIN is set.])
2035 else
2036 AC_MSG_RESULT($MICROWIN)
2037 AC_DEFINE(wxUSE_NANOX)
2038 fi
2039 fi
2040
2041 xpm_link=
2042 AC_MSG_CHECKING(for Xpm library)
2043 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
2044 if test "$ac_find_libraries" != "" ; then
2045 WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
2046 GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
2047 xpm_link=" -lXpm"
2048 AC_DEFINE(wxHAVE_LIB_XPM)
2049 AC_MSG_RESULT(found at $ac_find_libraries)
2050 else
2051 AC_TRY_COMPILE(
2052 [
2053 #include <X11/xpm.h>
2054 ],
2055 [
2056 int version;
2057 version = XpmLibraryVersion();
2058 ],
2059 [
2060 xpm_link=" -lXpm"
2061 AC_DEFINE(wxHAVE_LIB_XPM)
2062 AC_MSG_RESULT(found in default search path)
2063 COMPILED_X_PROGRAM=0
2064 ],
2065 [
2066 AC_MSG_RESULT(no)
2067 AC_MSG_WARN(library will be compiled without support for images in XPM format)
2068 ]
2069 )
2070 fi
2071
2072 wxUSE_UNIVERSAL="yes"
2073
2074 if test "$wxUSE_NANOX" = "yes"; then
2075 TOOLKIT_INCLUDE="-I\$(top_srcdir)/include/wx/x11/nanox -I\$(MICROWIN)/src/include $TOOLKIT_INCLUDE"
2076 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 -DLINUX=1 -DUNIX=1 -DUSE_EXPOSURE -DSCREEN_HEIGHT=480 -DSCREEN_WIDTH=640 -DSCREEN_DEPTH=4 -DX11=1"
2077 GUI_TK_LIBRARY="$GUI_TK_LIBRARY \$(MICROWIN)/src/lib/libnano-X.a"
2078 else
2079 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lX11$xpm_link"
2080 fi
2081
2082 TOOLKIT_VPATH="\${top_srcdir}/src/x11"
2083 TOOLKIT=X11
2084 GUIDIST=X11_DIST
2085 fi
2086
2087 if test "$wxUSE_WINE" = 1; then
2088 AC_CHECK_HEADER(windows.h, [],
2089 [
2090 AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
2091 ])
2092
2093 xpm_link=
2094 AC_MSG_CHECKING(for Xpm library)
2095 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
2096 if test "$ac_find_libraries" != "" ; then
2097 GUI_TK_LIBRARY="-L$ac_find_libraries"
2098 xpm_link=" -lXpm"
2099 AC_DEFINE(wxHAVE_LIB_XPM)
2100 AC_MSG_RESULT(found at $ac_find_libraries)
2101 else
2102 AC_MSG_RESULT(no)
2103 AC_MSG_WARN(library will be compiled without support for images in XPM format)
2104 fi
2105
2106 mesa_link=
2107 AC_MSG_CHECKING(for Mesa library)
2108 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,MesaGL)
2109 if test "$ac_find_libraries" != "" ; then
2110 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -L$ac_find_libraries"
2111 mesa_link=" -lMesaGL"
2112 AC_MSG_RESULT(found at $ac_find_libraries)
2113 else
2114 AC_MSG_ERROR(no)
2115 fi
2116
2117 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lwine$mesa_link$xpm_link -lXxf86dga -lXxf86vm -lSM -lICE -lXext -lXmu -lX11 -lncurses"
2118 TOOLKIT=MSW
2119 GUIDIST=MSW_DIST
2120 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXWINE__"
2121 fi
2122
2123 if test "$wxUSE_MOTIF" = 1; then
2124 dnl use standard macros to check for X headers/libs, this brings support
2125 dnl for the standard configure options --x-includes and --x-libraries
2126 AC_PATH_XTRA
2127
2128 if test "$no_x" = "yes"; then
2129 AC_MSG_ERROR(X11 not found, please use --x-includes and/or --x-libraries options)
2130 fi
2131
2132 GUI_TK_LIBRARY="$X_LIBS"
2133 TOOLKIT_INCLUDE="$X_CFLAGS"
2134 AFMINSTALL=afminstall
2135 COMPILED_X_PROGRAM=0
2136
2137 AC_MSG_CHECKING(for Motif/Lesstif headers)
2138 WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h)
2139 if test "$ac_find_includes" != "" ; then
2140 AC_MSG_RESULT(found $ac_find_includes)
2141 else
2142 AC_TRY_COMPILE(
2143 [
2144 #include <Xm/Xm.h>
2145 ],
2146 [
2147 int version;
2148 version = xmUseVersion;
2149 ],
2150 [
2151 AC_MSG_RESULT(found in default search path)
2152 COMPILED_X_PROGRAM=1
2153 ],
2154 [
2155 AC_MSG_RESULT(no)
2156 AC_MSG_ERROR(please set CFLAGS to contain the location of Xm/Xm.h)
2157 ]
2158 )
2159 fi
2160
2161 if test "$COMPILED_X_PROGRAM" = 0; then
2162 AC_MSG_CHECKING(for Motif/Lesstif library)
2163 WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm)
2164 if test "$ac_find_libraries" != "" ; then
2165 WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE)
2166 WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY)
2167
2168 GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
2169 TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE$ac_path_to_include"
2170 AC_MSG_RESULT(found at $ac_find_libraries)
2171 else
2172 dnl it might happen that we found headers in one of the standard
2173 dnl paths but the libs are elsewhere - we do need to try to
2174 dnl compile a sample program then here
2175 AC_TRY_COMPILE(
2176 [
2177 #include <Xm/Xm.h>
2178 ],
2179 [
2180 int version;
2181 version = xmUseVersion;
2182 ],
2183 [
2184 AC_MSG_RESULT(found in default search path)
2185 COMPILED_X_PROGRAM=1
2186 ],
2187 [
2188 AC_MSG_RESULT(no)
2189 AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm)
2190 ]
2191 )
2192 fi
2193 fi
2194
2195 xpm_link=
2196 AC_MSG_CHECKING(for Xpm library)
2197 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
2198 if test "$ac_find_libraries" != "" ; then
2199 WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
2200 GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
2201 xpm_link=" -lXpm"
2202 AC_DEFINE(wxHAVE_LIB_XPM)
2203 AC_MSG_RESULT(found at $ac_find_libraries)
2204 else
2205 AC_TRY_COMPILE(
2206 [
2207 #include <X11/xpm.h>
2208 ],
2209 [
2210 int version;
2211 version = XpmLibraryVersion();
2212 ],
2213 [
2214 xpm_link=" -lXpm"
2215 AC_DEFINE(wxHAVE_LIB_XPM)
2216 AC_MSG_RESULT(found in default search path)
2217 COMPILED_X_PROGRAM=0
2218 ],
2219 [
2220 AC_MSG_RESULT(no)
2221 AC_MSG_WARN(library will be compiled without support for images in XPM format)
2222 ]
2223 )
2224 fi
2225
2226 dnl MBN: this should really be an AC_TRY_LINK, but it is faster
2227 dnl to special case it
2228 xt_needs_sm_ice=
2229 case "${host}" in
2230 *-*-cygwin* )
2231 xt_needs_sm_ice=" -lSM -lICE"
2232 ;;
2233 esac
2234
2235 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXm$xpm_link -lXmu -lXext -lXt${xt_needs_sm_ice} -lX11"
2236 TOOLKIT_VPATH="\${top_srcdir}/src/motif${PATH_IFS}\${top_srcdir}/src/motif/xmcombo"
2237 TOOLKIT=MOTIF
2238 GUIDIST=MOTIF_DIST
2239 fi
2240
2241 if test "$wxUSE_MAC" = 1; then
2242 if test "$wxUSE_PRECOMP" = "yes"; then
2243 CPPFLAGS="$CPPFLAGS -cpp-precomp"
2244 else
2245 CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
2246 fi
2247 CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon -I\${top_srcdir}/src/mac/morefile"
2248 CFLAGS="$CFLAGS -fpascal-strings"
2249 CXXFLAGS="$CXXFLAGS -fpascal-strings"
2250
2251 TOOLKIT_VPATH="\${top_srcdir}/src/mac${PATH_IFS}\${top_srcdir}/src/mac/morefile"
2252 TOOLKIT=MAC
2253 dnl we can't call this MAC_DIST or autoconf thinks its a macro
2254 GUIDIST=MACX_DIST
2255 fi
2256
2257 if test "$wxUSE_PM" = 1; then
2258 TOOLKIT=PM
2259 GUIDIST=GTK_DIST
2260 fi
2261
2262 dnl the name of the directory where the files for this toolkit live
2263 if test "$TOOLKIT" = "PM" ; then
2264 TOOLKIT_DIR="os2"
2265 else
2266 TOOLKIT_DIR=`echo ${TOOLKIT} | tr "[[A-Z]]" "[[a-z]]"`
2267 fi
2268
2269 dnl misc other files depending on the port
2270 PORT_FILES="\${top_srcdir}/src/\$(TOOLKITDIR)/files.lst"
2271
2272 if test "$wxUSE_UNIVERSAL" = "yes"; then
2273 ALL_OBJECTS="\$(GUI_LOWLEVEL_OBJS) \${UNIVOBJS}"
2274
2275 dnl ALL_SOURCES and ALL_HEADERS shouldn't include really all sources
2276 dnl and headers as some/most are not needed for wxUniv but I don't
2277 dnl have time to add GUI_LOWLEVEL_SOURCES/HEADERS stuff now (TODO!)
2278 ALL_SOURCES="\$(ALL_SOURCES) \${UNIV_SOURCES}"
2279 ALL_HEADERS="\$(ALL_HEADERS) \${UNIV_HEADERS}"
2280
2281 PORT_FILES="${PORT_FILES} \${top_srcdir}/src/univ/files.lst"
2282 if test "$wxUSE_X11" = 1; then
2283 TOOLKIT_VPATH="\${top_srcdir}/src/${TOOLKIT_DIR}${PATH_IFS}\${top_srcdir}/src/univ${PATH_IFS}\${top_srcdir}/src/univ/themes"
2284 else
2285 TOOLKIT_VPATH="\${top_srcdir}/src/univ${PATH_IFS}\${top_srcdir}/src/univ/themes${PATH_IFS}\${top_srcdir}/src/${TOOLKIT_DIR}"
2286 fi
2287 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXUNIVERSAL__"
2288 WIDGET_SET=univ
2289 else
2290 ALL_OBJECTS="\$(GUIOBJS)"
2291 ALL_SOURCES="\$(ALL_SOURCES)"
2292 ALL_HEADERS="\$(ALL_HEADERS)"
2293 fi
2294
2295 ALL_OBJECTS="${ALL_OBJECTS} \$(COMMONOBJS) \$(GENERICOBJS)"
2296
2297 if test "$TOOLKIT" != "MSW" -a "$USE_DOS" != 1; then
2298 ALL_OBJECTS="${ALL_OBJECTS} \$(UNIXOBJS)"
2299 fi
2300
2301 if test "$wxUSE_HTML" = "yes"; then
2302 ALL_OBJECTS="${ALL_OBJECTS} \$(HTMLOBJS)"
2303 fi
2304
2305 if test "$wxUSE_LIBJPEG" = "builtin" ; then
2306 ALL_OBJECTS="${ALL_OBJECTS} \$(JPEGOBJS)"
2307 fi
2308 if test "$wxUSE_LIBTIFF" = "builtin" ; then
2309 ALL_OBJECTS="${ALL_OBJECTS} \$(TIFFOBJS)"
2310 fi
2311 if test "$wxUSE_LIBPNG" = "builtin" ; then
2312 ALL_OBJECTS="${ALL_OBJECTS} \$(PNGOBJS)"
2313 fi
2314
2315 dnl distribute samples/demos/utils with GUI versions
2316 GUIDIST="${GUIDIST} SAMPLES_DIST DEMOS_DIST UTILS_DIST MISC_DIST"
2317 DISTDIR="wx\$(TOOLKIT)"
2318 else
2319 USE_GUI=0
2320
2321 dnl this doesn't quite work right for wxBase, but the places
2322 dnl where it is wrong aren't fatal (yet) though.
2323 TOOLKIT_DIR="base"
2324
2325 dnl the sources, their dependenices and the headers
2326 if test "$USE_WIN32" = 1 ; then
2327 ALL_OBJECTS="\${BASE_OBJS} \${BASE_MSW_OBJS}"
2328 TOOLKIT_VPATH="\${top_srcdir}/src/msw"
2329
2330 dnl yes, the toolkit for wxBase on win32 is actually MSW
2331 dnl wxBase on unix does not need a 'TOOLKIT' defined.
2332 TOOLKIT="MSW"
2333 else
2334 ALL_OBJECTS="\${BASE_OBJS} \${BASE_UNIX_OBJS}"
2335 TOOLKIT_VPATH="\${top_srcdir}/src/unix"
2336 fi
2337
2338 ALL_SOURCES="\$(ALL_SOURCES)"
2339 ALL_HEADERS="\$(ALL_HEADERS)"
2340
2341 PORT_FILES="\${top_srcdir}/src/files.lst"
2342
2343 dnl distribute only wxBase sources/headers
2344 GUIDIST="BASE_DIST"
2345 DISTDIR="wxBase"
2346 fi
2347
2348 dnl ---------------------------------------------------------------------------
2349 dnl Optional libraries included when system library is not used
2350 dnl ---------------------------------------------------------------------------
2351
2352 dnl ODBC objects are Unix only
2353 if test "$TOOLKIT" != "MSW" -a "$wxUSE_ODBC" = "yes" ; then
2354 ALL_OBJECTS="${ALL_OBJECTS} \$(IODBCOBJS)"
2355 fi
2356
2357 if test "$wxUSE_REGEX" = "builtin" ; then
2358 ALL_OBJECTS="${ALL_OBJECTS} \$(REGEXOBJS)"
2359 fi
2360 if test "$wxUSE_ZLIB" = "builtin" ; then
2361 ALL_OBJECTS="${ALL_OBJECTS} \$(ZLIBOBJS)"
2362 fi
2363
2364 dnl ---------------------------------------------------------------------------
2365 dnl OpenGL libraries
2366 dnl ---------------------------------------------------------------------------
2367
2368 if test "$wxUSE_OPENGL" = "yes"; then
2369 if test "$wxUSE_MAC" = 1; then
2370 OPENGL_LIBS="-framework OpenGL -framework AGL"
2371 elif test "$wxUSE_MSW" = 1; then
2372 OPENGL_LIBS="-lopengl32 -lglu32"
2373 else
2374 AC_CHECK_HEADER(GL/gl.h,
2375 [
2376 AC_MSG_CHECKING([for -lGL])
2377 WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],[GL])
2378 if test "$ac_find_libraries" != "" ; then
2379 WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
2380 if test "$ac_path_to_link" = " -L/usr/lib" ; then
2381 LDFLAGS_GL="$LDFLAGS"
2382 else
2383 LDFLAGS_GL="$LDFLAGS$ac_path_to_link"
2384 fi
2385 OPENGL_LIBS="-lGL -lGLU"
2386 AC_MSG_RESULT([yes])
2387 else
2388 AC_MSG_RESULT([no])
2389 AC_MSG_CHECKING([for -lMesaGL])
2390 WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],[MesaGL])
2391 if test "$ac_find_libraries" != "" ; then
2392 WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
2393 LDFLAGS_GL="$LDFLAGS$ac_path_to_link"
2394 OPENGL_LIBS="-lMesaGL -lMesaGLU"
2395 AC_MSG_RESULT([yes])
2396 else
2397 AC_MSG_RESULT([no])
2398 fi
2399 fi
2400 ])
2401
2402 if test "x$OPENGL_LIBS" = "x"; then
2403 dnl it should be an error and not a warning because OpenGL is not on
2404 dnl by default and so if it had been explicitely requested, we
2405 dnl shouldn't just fall back to compiling the library without it
2406 AC_MSG_ERROR(OpenGL libraries not available)
2407 fi
2408 fi
2409
2410 if test "$wxUSE_OPENGL" = "yes"; then
2411 AC_DEFINE(wxUSE_OPENGL)
2412 AC_DEFINE(wxUSE_GLCANVAS)
2413 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl"
2414 fi
2415 fi
2416
2417 if test -z "$TOOLKIT_VPATH" ; then
2418 TOOLKIT_VPATH="\${top_srcdir}/src/${TOOLKIT_DIR}"
2419 fi
2420
2421 dnl the symbol which allows conditional compilation for the given toolkit
2422 if test -n "$TOOLKIT" ; then
2423 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WX${TOOLKIT}__"
2424 fi
2425
2426 lib_unicode_suffix=
2427 if test "$wxUSE_UNICODE" = "yes"; then
2428 lib_unicode_suffix=u
2429 fi
2430
2431 lib_debug_suffix=
2432 if test "$wxUSE_DEBUG_FLAG" = "yes"; then
2433 lib_debug_suffix=d
2434 fi
2435
2436 TOOLCHAIN_NAME="${TOOLKIT_DIR}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}-${WX_RELEASE}"
2437 TOOLCHAIN_NAME_GL="${TOOLKIT_DIR}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}_gl-${WX_RELEASE}"
2438
2439 if test "$cross_compiling" = "yes"; then
2440 TOOLCHAIN_NAME="${TOOLCHAIN_NAME}-${host_alias}"
2441 TOOLCHAIN_NAME_GL="${TOOLCHAIN_NAME_GL}-${host_alias}"
2442 fi
2443
2444 dnl library link name
2445 WX_LIBRARY="wx_${TOOLCHAIN_NAME}"
2446 WX_LIBRARY_GL="wx_${TOOLCHAIN_NAME_GL}"
2447
2448 dnl the name of the shared library
2449 WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}.${SO_SUFFIX}.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}"
2450 WX_LIBRARY_NAME_SHARED_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}"
2451
2452 dnl the name of the links to the shared library
2453 WX_LIBRARY_LINK1="lib${WX_LIBRARY}.${SO_SUFFIX}.${WX_CURRENT}"
2454 WX_LIBRARY_LINK2="lib${WX_LIBRARY}.${SO_SUFFIX}"
2455 WX_LIBRARY_LINK1_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}.${WX_CURRENT}"
2456 WX_LIBRARY_LINK2_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}"
2457
2458 case "${host}" in
2459 *-*-cygwin* | *-*-mingw32* )
2460
2461 dnl If we are cross compiling we want to use the 'full' unix type name for the
2462 dnl lib, but for a native install use the windows style naming convention.
2463 dnl (excepting again that we strip the ELF style version numbers off it).
2464
2465 dnl FIXME: is this GL stuff actually even used for wxMSW? should it be??
2466
2467 if test "$cross_compiling" != "yes" -a "$TOOLKIT_DIR" = "msw"; then
2468 WX_LIBRARY="wxmsw${WX_MSW_VERSION}${lib_unicode_suffix}${lib_debug_suffix}"
2469 WX_LIBRARY_GL="wxmsw_gl${WX_MSW_VERSION}${lib_unicode_suffix}${lib_debug_suffix}"
2470 WX_LIBRARY_NAME_SHARED="${WX_LIBRARY}.${SO_SUFFIX}"
2471 WX_LIBRARY_NAME_SHARED_GL="${WX_LIBRARY_GL}.${SO_SUFFIX}"
2472 else
2473 WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}.${SO_SUFFIX}"
2474 WX_LIBRARY_NAME_SHARED_GL="lib${WX_LIBRARY_GL}.${SO_SUFFIX}"
2475 fi
2476 ;;
2477
2478 *-*-darwin* )
2479 dnl Under Mac OS X, we should build real frameworks instead of simple
2480 dnl dynamic shared libraries (in order to embed the resources)
2481 if test "$wxUSE_MAC" = 1; then
2482 dnl the name of the resources file for wxMac
2483 WX_RESOURCES_MACOSX_ASCII="lib${WX_LIBRARY}.r"
2484 WX_RESOURCES_MACOSX_DATA="lib${WX_LIBRARY}.rsrc"
2485 fi
2486 ;;
2487 esac
2488
2489 dnl the name of the static library
2490 WX_LIBRARY_NAME_STATIC="lib${WX_LIBRARY}.a"
2491 WX_LIBRARY_NAME_STATIC_GL="lib${WX_LIBRARY_GL}.a"
2492
2493 dnl define which libs wx-config should link.
2494 WXCONFIG_LIBS="-l${WX_LIBRARY}"
2495 WXCONFIG_LIBS_STATIC="lib${WX_LIBRARY}.a"
2496
2497 if test "$wxUSE_OPENGL" = "yes"; then
2498 WXCONFIG_LIBS_GL="-l${WX_LIBRARY_GL} ${OPENGL_LIBS}"
2499 WXCONFIG_LIBS_STATIC_GL="lib${WX_LIBRARY_GL}.a ${OPENGL_LIBS}"
2500 fi
2501
2502
2503 dnl --- the marker for quick search, leave it here: SHARED_LIB_SETUP ---
2504
2505 if test "$wxUSE_SHARED" = "yes"; then
2506 case "${host}" in
2507 *-pc-os2_emx | *-pc-os2-emx | \
2508 *-pc-msdosdjgpp )
2509 dnl only static for now
2510 wxUSE_SHARED=no
2511 AC_MSG_WARN([Host system doesn't support shared libraries, disabling])
2512 ;;
2513 esac
2514 fi
2515
2516 if test "$wxUSE_SHARED" = "yes"; then
2517
2518 dnl install targets
2519 if test "$wxUSE_OPENGL" = "yes"; then
2520 WX_ALL_INSTALLED="CREATE_INSTALLED_LINKS CREATE_INSTALLED_LINKS_GL"
2521 WX_ALL="\$(build_libdir)/${WX_LIBRARY_LINK1} \$(build_libdir)/${WX_LIBRARY_LINK1_GL}"
2522 else
2523 WX_ALL_INSTALLED="CREATE_INSTALLED_LINKS"
2524 WX_ALL="\$(build_libdir)/${WX_LIBRARY_LINK1}"
2525 fi
2526
2527 dnl the extra compiler flags needed for compilation of shared library
2528 if test "$GCC" = "yes"; then
2529 dnl the switch for gcc is the same under all platforms
2530 PIC_FLAG="-fPIC"
2531 fi
2532
2533 dnl the command to use for creating the shared library
2534 SHARED_LD="${CXX} -shared -o"
2535
2536 case "${host}" in
2537 *-hp-hpux* )
2538 dnl default settings are good for gcc but not for the native HP-UX
2539 if test "$GCC" == "yes"; then
2540 SHARED_LD="${SHARED_LD} ${PIC_FLAG}"
2541 else
2542 dnl no idea why it wants it, but it does
2543 LDFLAGS="$LDFLAGS -L/usr/lib"
2544
2545 SHARED_LD="${CXX} -b -o"
2546 PIC_FLAG="+Z"
2547 fi
2548
2549 dnl install shared libs without symlinks
2550 if test "$wxUSE_OPENGL" = "yes"; then
2551 WX_ALL_INSTALLED="preinstall_gl"
2552 WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_SHARED} \$(build_libdir)/${WX_LIBRARY_NAME_SHARED_GL}"
2553 else
2554 WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_SHARED}"
2555 fi
2556 ;;
2557
2558 *-*-linux* )
2559 if test "$GCC" != "yes"; then
2560 AC_CACHE_CHECK([for Intel compiler], wx_cv_prog_icc,
2561 [
2562 AC_TRY_COMPILE([],
2563 [
2564 #ifndef __INTEL_COMPILER
2565 #error Not icc
2566 #endif
2567 ],
2568 wx_cv_prog_icc=yes,
2569 wx_cv_prog_icc=no
2570 )
2571 ])
2572 if test "$wx_cv_prog_icc" = "yes"; then
2573 PIC_FLAG="-KPIC"
2574 fi
2575 fi
2576
2577 if test "$wxUSE_SONAME" = "yes" ; then
2578 SONAME_FLAGS="-Wl,-soname,${WX_LIBRARY_LINK1}"
2579 SONAME_FLAGS_GL="-Wl,-soname,${WX_LIBRARY_LINK1_GL}"
2580 dnl substitute this in makelib.env for the contrib libs
2581 WX_TARGET_LIBRARY_SONAME="-Wl,-soname,\$(TARGETLIB_LINK1)"
2582 fi
2583 ;;
2584
2585 *-*-solaris2* )
2586 if test "$GCC" = yes ; then
2587 dnl newer versions of gcc need -isystem to compile X headers on
2588 dnl Solaris (which use old style C syntax)
2589 CPPFLAGS="$CPPFLAGS -isystem /usr/openwin/include"
2590 else
2591 SHARED_LD="${CXX} -G -o"
2592 PIC_FLAG="-KPIC"
2593 SONAME_FLAGS="-h ${WX_LIBRARY_NAME_SHARED}"
2594 SONAME_FLAGS_GL="-h ${WX_LIBRARY_NAME_SHARED_GL}"
2595 fi
2596 ;;
2597
2598 *-*-darwin* )
2599 dnl For Unix to MacOS X porting instructions, see:
2600 dnl http://fink.sourceforge.net/doc/porting/porting.html
2601 CFLAGS="$CFLAGS -fno-common -DWXMAKINGDLL"
2602 CXXFLAGS="$CXXFLAGS -fno-common -DWXMAKINGDLL"
2603 dnl wxWindows must be fully binded (lazy binding breaks RTTI classinfo)
2604 dnl this can be done either with the exe linker flag -Wl,-bind_at_load
2605 dnl or with a double stage link in order to create a single module
2606 dnl "-init _wxWindowsDylibInit" not useful with lazy linking solved
2607 SHARED_LD="\${top_srcdir}/distrib/mac/shared-ld-sh -undefined suppress -flat_namespace -o"
2608 PIC_FLAG="-dynamic -fPIC"
2609 SONAME_FLAGS="-compatibility_version ${WX_RELEASE} -current_version ${WX_VERSION}"
2610 SONAME_FLAGS_GL=${SONAME_FLAGS}
2611 ;;
2612
2613 *-*-aix* )
2614 dnl the abs path below used to be hardcoded here so I guess it must
2615 dnl be some sort of standard location under AIX?
2616 AC_CHECK_PROG(AIX_CXX_LD, makeC++SharedLib,
2617 makeC++SharedLib, /usr/lpp/xlC/bin/makeC++SharedLib)
2618
2619 SHARED_LD="$(AIX_CXX_LD) -p 0 -o"
2620 ;;
2621
2622 *-*-cygwin* | *-*-mingw32* )
2623
2624 WX_LIBRARY_IMPORTLIB="${WX_LIBRARY_NAME_SHARED}.a"
2625
2626 SHARED_LD="${CXX} -shared -Wl,--out-implib,lib/${WX_LIBRARY_IMPORTLIB} -o"
2627 TOOLCHAIN_DLL_DEFS="${TOOLCHAIN_DLL_DEFS} -DWXUSINGDLL=1"
2628
2629 PIC_FLAG="-UWXUSINGDLL -DWXMAKINGDLL=1 -D_DLL=1 -D_WINDLL=1"
2630
2631 dnl install shared libs without symlinks
2632 if test "$wxUSE_OPENGL" = "yes"; then
2633 WX_ALL_INSTALLED="preinstall_gl"
2634 WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_SHARED} \$(build_libdir)/${WX_LIBRARY_NAME_SHARED_GL}"
2635 else
2636 WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_SHARED}"
2637 fi
2638 ;;
2639
2640 *-*-beos* )
2641 dnl can't use gcc under BeOS for shared library creation because it
2642 dnl complains about missing 'main'
2643 SHARED_LD="${LD} -shared -o"
2644 ;;
2645
2646 *-*-freebsd* | *-*-openbsd* | *-*-netbsd* | \
2647 *-*-sunos4* | \
2648 *-*-irix5* | *-*-irix6* | \
2649 *-*-osf* | \
2650 *-*-dgux5* | \
2651 *-*-sysv5* )
2652 dnl defaults are ok
2653 ;;
2654
2655 *)
2656 AC_MSG_ERROR(unknown system type $host.)
2657 esac
2658
2659 dnl set target to shared if not explicitly chose static before
2660 if test "x$WX_TARGET_LIBRARY" = "x"; then
2661 WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_SHARED}"
2662 WX_TARGET_LIBRARY_GL="${WX_LIBRARY_NAME_SHARED_GL}"
2663 fi
2664
2665 dnl do not alter the LIBRARY_TYPE strings "so" and "a", they are magic
2666 WX_TARGET_LIBRARY_TYPE="so"
2667 INSTALL_LIBRARY='$(INSTALL_PROGRAM)'
2668 fi
2669
2670 dnl do not 'else' this, it may be changed in the above conditional.
2671 if test "$wxUSE_SHARED" = "no"; then
2672
2673 dnl give static wxBase and wxMSW build a working install target
2674 if test "$wxUSE_GUI" = "no" -o "$USE_WIN32" = 1 ; then
2675 dnl we're here because WX_ALL_INSTALLED is empty, but play safe anyway
2676 WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall"
2677 fi
2678
2679 if test "$wxUSE_MAC" = 1; then
2680 WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall"
2681 fi
2682
2683 if test "$wxUSE_OPENGL" = "yes"; then
2684 WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall_gl"
2685 WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_STATIC} \$(build_libdir)/${WX_LIBRARY_NAME_STATIC_GL}"
2686 else
2687 WX_ALL="\$(build_libdir)/${WX_LIBRARY_NAME_STATIC}"
2688 fi
2689
2690 WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}"
2691 WX_TARGET_LIBRARY_GL="${WX_LIBRARY_NAME_STATIC_GL}"
2692
2693 WX_TARGET_LIBRARY_TYPE="a"
2694 INSTALL_LIBRARY='$(INSTALL_DATA)'
2695 fi
2696
2697 if test "$wxUSE_MAC" = 1; then
2698 dnl add the resources target for wxMac
2699 LIBWXMACRES="\$(top_builddir)/lib/${WX_RESOURCES_MACOSX_ASCII}"
2700 WX_ALL="${WX_ALL} ${LIBWXMACRES}"
2701 WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall_res"
2702 AC_CHECK_PROG(RESCOMP, Rez, Rez, /Developer/Tools/Rez)
2703 AC_CHECK_PROG(DEREZ, DeRez, DeRez, /Developer/Tools/DeRez)
2704 MACOSX_BUNDLE="bundle"
2705 if test "$wxUSE_SHARED" = "yes"; then
2706 dnl resources are bundled with shared library, not with applications
2707 LIBWXMACRESCOMP="\$(RESCOMP) -t APPL Carbon.r -o \$(BIN_PROGRAM)"
2708 LIBWXMACRESWXCONFIG="${RESCOMP} -t APPL Carbon.r -o"
2709 else
2710 dnl resources are bundled with applications, not with static library
2711 LIBWXMACRESCOMP="\$(RESCOMP) -t APPL Carbon.r ${LIBWXMACRES} -o \$(BIN_PROGRAM)"
2712 LIBWXMACRESWXCONFIG="${RESCOMP} -t APPL Carbon.r \${prefix}/lib/${WX_RESOURCES_MACOSX_ASCII} -o"
2713 fi
2714 else
2715 if test "$wxUSE_PM" = 1; then
2716 LIBWXMACRESCOMP="emxbind -ep \$(BIN_PROGRAM)"
2717 fi
2718 fi
2719
2720 dnl ---------------------------------------------------------------------------
2721 dnl Checks for typedefs
2722 dnl ---------------------------------------------------------------------------
2723
2724 dnl defines mode_t if not already defined
2725 AC_TYPE_MODE_T
2726 dnl defines off_t if not already defined
2727 AC_TYPE_OFF_T
2728 dnl defines pid_t if not already defined
2729 AC_TYPE_PID_T
2730 dnl defines size_t if not already defined
2731 AC_TYPE_SIZE_T
2732 dnl defines uid_t and gid_t if not already defined
2733 AC_TYPE_UID_T
2734
2735 dnl check what exactly size_t is on this machine - this is necessary to avoid
2736 dnl ambiguos overloads in several places, notably wx/string.h and wx/array.h
2737 AC_LANG_SAVE
2738 AC_LANG_CPLUSPLUS
2739 AC_CACHE_CHECK([if size_t is unsigned int],
2740 wx_cv_size_t_is_uint,
2741 dnl an obvious check like AC_TRY_COMPILE[struct Foo { ... };] doesn't work
2742 dnl with egcs (at least) up to 1.1.1 as it allows you to compile duplicate
2743 dnl methods in a local class (i.e. class inside a function) declaration
2744 dnl without any objections!!
2745 dnl
2746 dnl hence the hack below: we must have Foo at global scope!
2747 AC_TRY_COMPILE([#include <stddef.h>],
2748 [
2749 return 0; }
2750
2751 struct Foo { void foo(size_t); void foo(unsigned int); };
2752
2753 int bar() {
2754 ],
2755 wx_cv_size_t_is_uint=no,
2756 wx_cv_size_t_is_uint=yes
2757 )
2758 )
2759
2760 if test "$wx_cv_size_t_is_uint" = "yes"; then
2761 AC_DEFINE(wxSIZE_T_IS_UINT)
2762 else
2763 AC_CACHE_CHECK([if size_t is unsigned long],
2764 wx_cv_size_t_is_ulong,
2765 AC_TRY_COMPILE([#include <stddef.h>],
2766 [
2767 return 0; }
2768
2769 struct Foo { void foo(size_t); void foo(unsigned long); };
2770
2771 int bar() {
2772 ],
2773 wx_cv_size_t_is_ulong=no,
2774 wx_cv_size_t_is_ulong=yes
2775 )
2776 )
2777
2778 if test "$wx_cv_size_t_is_ulong" = "yes"; then
2779 AC_DEFINE(wxSIZE_T_IS_ULONG)
2780 fi
2781 fi
2782
2783 AC_LANG_RESTORE
2784
2785 dnl ---------------------------------------------------------------------------
2786 dnl Checks for structures
2787 dnl ---------------------------------------------------------------------------
2788
2789 dnl does passwd struct has the pw_gecos field?
2790 AC_CACHE_CHECK([for pw_gecos in struct passwd], wx_cv_struct_pw_gecos,
2791 [
2792 AC_TRY_COMPILE([#include <pwd.h>],
2793 [
2794 char *p;
2795 struct passwd *pw;
2796 p = pw->pw_gecos;
2797 ],
2798 [
2799 wx_cv_struct_pw_gecos=yes
2800 ],
2801 [
2802 wx_cv_struct_pw_gecos=no
2803 ]
2804 )
2805 ]
2806 )
2807
2808 if test "$wx_cv_struct_pw_gecos" = "yes"; then
2809 AC_DEFINE(HAVE_PW_GECOS)
2810 fi
2811
2812 dnl ---------------------------------------------------------------------------
2813 dnl Check for functions
2814 dnl ---------------------------------------------------------------------------
2815
2816 dnl don't check for wchar_t functions if we haven't got wchar_t itself
2817 WCHAR_OK=0
2818 if test "$wx_cv_sizeof_wchar_t" != "0"; then
2819 dnl check for wcslen
2820 WCHAR_LINK=
2821 AC_CHECK_FUNCS(wcslen, [
2822 AC_DEFINE(HAVE_WCSLEN)
2823 WCHAR_OK=1
2824 ])
2825
2826 if test "$WCHAR_OK" = 0; then
2827 if test "$TOOLKIT" = "MSW"; then
2828 AC_CHECK_LIB(msvcrt, wcslen, [
2829 AC_DEFINE(HAVE_WCSLEN)
2830 WCHAR_OK=1
2831 ])
2832 else
2833 AC_CHECK_LIB(w, wcslen, [
2834 AC_DEFINE(HAVE_WCSLEN)
2835 WCHAR_LINK=" -lw"
2836 WCHAR_OK=1
2837 ])
2838 fi
2839 fi
2840 fi
2841
2842 dnl we need at least the definition of wchar_t itself and wcslen() to compile
2843 dnl with wchar_t support -- turn it off if we don't have this
2844 if test "$WCHAR_OK" = 1; then
2845 AC_DEFINE(wxUSE_WCHAR_T)
2846
2847 dnl also try to use wcsrtombs instead of wcstombs which is buggy in old GNU
2848 dnl libc versions if possible
2849 AC_CHECK_FUNCS(wcsrtombs)
2850 else
2851 dnl use built-in wcslen for Darwin (what about other BSD based systems?)
2852 if test "$USE_DARWIN" = 1; then
2853 AC_DEFINE(wxUSE_WCHAR_T)
2854 else
2855 AC_MSG_WARN([Wide character support is unavailable])
2856 fi
2857 fi
2858
2859 dnl check for vprintf/vsprintf() which are GNU extensions
2860 AC_FUNC_VPRINTF
2861
2862 dnl check for vsscanf() and vsnprintf() - on some platforms (Linux, glibc
2863 dnl 2.1.1 for the first one, HP-UX for the second) it's available in the
2864 dnl library but the prototype is missing, so we can't use AC_CHECK_FUNCS() here,
2865 dnl do it manually. We can't use AC_TRY_COMPILE(), either, because it doesn't
2866 dnl check if the symbol is available at linking time
2867
2868 dnl we use AC_TRY_LINK() here instead of AC_TRY_RUN() to make the checks
2869 dnl work for cross-compilation, but AC_TRY_LINK() normally only compiles
2870 dnl one function while we need at least 2 - hence the ugly hack below. To
2871 dnl understand why it works, remember that AC_TRY_LINK() just prepends
2872 dnl "int main() {" in the beginning of the code and "; return 0; }" at the
2873 dnl end...
2874
2875 dnl if we fail to find vsnprintf, also try for _vsnprintf as that is what
2876 dnl we'll find under MSW if it exists.
2877
2878 dnl final note: AC_TRY_LINK will only be executed if there is nothing in
2879 dnl the cache so we have to do AC_DEFINE(HAVE_VSNPRINTF) below and not inside
2880 dnl it or the symbol wouldn't be defined for the 2nd and subsequent configure
2881 dnl runs
2882
2883 dnl check for vsnprintf() - a safe version of vsprintf()
2884 AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
2885 [
2886 AC_TRY_LINK([
2887 #include <stdio.h>
2888 #include <stdarg.h>
2889 ], [
2890 int wx_test_vsnprintf(const char *, ...);
2891
2892 wx_test_vsnprintf("%s");
2893 return 0;
2894 }
2895
2896 int wx_test_vsnprintf(const char *fmt, ...)
2897 {
2898 char *s;
2899
2900 va_list argp;
2901 va_start(argp, fmt);
2902 vsnprintf(s, 42, fmt, argp);
2903 va_end(argp);
2904 ], [
2905 wx_cv_func_vsnprintf=yes
2906 ], [
2907 AC_TRY_LINK([
2908 #include <stdio.h>
2909 #include <stdarg.h>
2910 ], [
2911 int wx_test_vsnprintf(const char *, ...);
2912
2913 wx_test_vsnprintf("%s");
2914 return 0;
2915 }
2916
2917 int wx_test_vsnprintf(const char *fmt, ...)
2918 {
2919 char *s;
2920
2921 va_list argp;
2922 va_start(argp, fmt);
2923 _vsnprintf(s, 42, fmt, argp);
2924 va_end(argp);
2925 ], [
2926 wx_cv_func_vsnprintf=yes
2927 ], [
2928 wx_cv_func_vsnprintf=no
2929 ])
2930 ])
2931 ])
2932
2933 if test "$wx_cv_func_vsnprintf" = yes; then
2934 AC_DEFINE(HAVE_VSNPRINTF)
2935 else
2936 AC_MSG_WARN(unsafe function vsprintf will be used instead of vsnprintf)
2937 fi
2938
2939 dnl check for vsscanf()
2940 AC_CACHE_CHECK([for vsscanf], wx_cv_func_vsscanf,
2941 [
2942 AC_TRY_COMPILE([
2943 #include <stdio.h>
2944 #include <stdarg.h>
2945 ], [
2946 int wx_test_vsscanf(const char *, ...);
2947
2948 wx_test_vsscanf("%d");
2949 return 0;
2950 }
2951
2952 int wx_test_vsscanf(const char *fmt, ...)
2953 {
2954 va_list argp;
2955 va_start(argp, fmt);
2956 vsscanf("42", fmt, argp);
2957 va_end(argp);
2958 ], [
2959 wx_cv_func_vsscanf=yes
2960 ], [
2961 wx_cv_func_vsscanf=no
2962 ])
2963 ])
2964
2965 if test "$wx_cv_func_vsscanf" = yes; then
2966 AC_DEFINE(HAVE_VSSCANF)
2967 fi
2968
2969 dnl the following tests are for Unix(like) systems only
2970 if test "$TOOLKIT" != "MSW"; then
2971
2972 dnl check for available version of iconv()
2973
2974 AC_LANG_SAVE
2975 AC_LANG_CPLUSPLUS
2976 AM_ICONV
2977 LIBS="$LIBICONV $LIBS"
2978 AC_LANG_RESTORE
2979
2980 dnl check for POSIX signals if we need them
2981 if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes" -a "$wxUSE_UNIX" = "yes"; then
2982 AC_CHECK_FUNCS(sigaction)
2983
2984 if test "$ac_cv_func_sigaction" = "no"; then
2985 AC_MSG_WARN([No POSIX signal functions on this system, wxApp::OnFatalException will not be called])
2986 wxUSE_ON_FATAL_EXCEPTION=no
2987 fi
2988
2989 if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
2990 AC_LANG_SAVE
2991 AC_LANG_CPLUSPLUS
2992
2993 AC_CACHE_CHECK([for sa_handler type], wx_cv_type_sa_handler,
2994 [
2995 AC_TRY_COMPILE([#include <signal.h>],
2996 [
2997 extern void testSigHandler(int);
2998
2999 struct sigaction sa;
3000 sa.sa_handler = testSigHandler;
3001 ], [
3002 wx_cv_type_sa_handler=int
3003 ], [
3004 wx_cv_type_sa_handler=void
3005 ])
3006 ])
3007
3008 AC_LANG_RESTORE
3009
3010 AC_DEFINE_UNQUOTED(wxTYPE_SA_HANDLER, $wx_cv_type_sa_handler)
3011 fi
3012 fi
3013
3014 dnl check for vfork() (even if it's the same as fork() in modern Unices)
3015 AC_CHECK_FUNCS(vfork)
3016
3017 dnl check for the function for temp files creation
3018 AC_CHECK_FUNCS(mkstemp mktemp, break)
3019
3020 dnl get the library function to use for wxGetDiskSpace(): it is statfs() under
3021 dnl Linux and *BSD and statvfs() under Solaris
3022 AC_CACHE_CHECK(for statfs, wx_cv_func_statfs,
3023 AC_TRY_COMPILE(
3024 [
3025 #if defined(__BSD__)
3026 #include <sys/param.h>
3027 #include <sys/mount.h>
3028 #else
3029 #include <sys/vfs.h>
3030 #endif
3031 ],
3032 [
3033 long l;
3034 struct statfs fs;
3035 statfs("/", &fs);
3036 l = fs.f_bsize;
3037 l += fs.f_blocks;
3038 l += fs.f_bavail;
3039 ],
3040 [
3041 wx_cv_func_statfs=yes
3042 ],
3043 [
3044 wx_cv_func_statfs=no
3045 ]
3046 )
3047 )
3048
3049 if test "$wx_cv_func_statfs" = "yes"; then
3050 AC_DEFINE(HAVE_STATFS)
3051 else
3052 AC_CACHE_CHECK(for statvfs, wx_cv_func_statvfs,
3053 AC_TRY_COMPILE(
3054 [
3055 #include <sys/statvfs.h>
3056 ],
3057 [
3058 long l;
3059 struct statvfs fs;
3060 statvfs("/", &fs);
3061 l = fs.f_bsize;
3062 l += fs.f_blocks;
3063 l += fs.f_bavail;
3064 ],
3065 [
3066 wx_cv_func_statvfs=yes
3067 ],
3068 [
3069 wx_cv_func_statvfs=no
3070 ]
3071 )
3072 )
3073
3074 if test "$wx_cv_func_statvfs" = "yes"; then
3075 AC_DEFINE(HAVE_STATVFS)
3076 else
3077 AC_MSG_WARN([wxGetDiskSpace() function won't work without statfs()])
3078 fi
3079 fi
3080
3081 dnl check for fcntl() or at least flock() needed by Unix implementation of
3082 dnl wxSingleInstanceChecker
3083 if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then
3084 AC_CHECK_FUNCS(fcntl flock, break)
3085
3086 if test "$ac_cv_func_fcntl" != "yes" -a "$ac_cv_func_flock" != "yes"; then
3087 AC_MSG_WARN(wxSingleInstanceChecker not available)
3088 wxUSE_SNGLINST_CHECKER=no
3089 fi
3090 fi
3091
3092 dnl check for timegm() used by datetime.cpp
3093 AC_CHECK_FUNCS(timegm)
3094
3095 dnl look for a function to modify the environment
3096 AC_CHECK_FUNCS(putenv setenv, break)
3097
3098 HAVE_SOME_SLEEP_FUNC=0
3099 if test "$USE_BEOS" = 1; then
3100 dnl BeOS has its own (wonder where did they get it from) sleep() function
3101 dnl in unistd.h
3102 AC_DEFINE(HAVE_SLEEP)
3103 HAVE_SOME_SLEEP_FUNC=1
3104 fi
3105
3106 if test "$USE_DARWIN" = 1; then
3107 dnl Mac OS X has both nanosleep and usleep
3108 dnl but only usleep is defined in unistd.h
3109 AC_DEFINE(HAVE_USLEEP)
3110 HAVE_SOME_SLEEP_FUNC=1
3111 fi
3112
3113 if test "$HAVE_SOME_SLEEP_FUNC" != 1; then
3114 dnl try nanosleep() in libc and libposix4, if this fails - usleep()
3115 POSIX4_LINK=
3116 AC_CHECK_FUNCS(nanosleep,
3117 AC_DEFINE(HAVE_NANOSLEEP),
3118 [
3119 AC_CHECK_LIB(posix4, nanosleep,
3120 [
3121 AC_DEFINE(HAVE_NANOSLEEP)
3122 POSIX4_LINK=" -lposix4"
3123 ],
3124 [
3125 AC_CHECK_FUNCS(usleep,
3126 AC_DEFINE(HAVE_USLEEP),
3127 AC_MSG_WARN([wxSleep() function will not work])
3128 )
3129 ]
3130 )
3131 ]
3132 )
3133 fi
3134
3135 dnl check for uname (POSIX) and gethostname (BSD)
3136 AC_CHECK_FUNCS(uname gethostname, break)
3137
3138 dnl check for MT-safe version of strtok (on DEC Alpha, it's ok for C compiler
3139 dnl but not for C++ one - hence change language)
3140 AC_LANG_SAVE
3141 AC_LANG_CPLUSPLUS
3142
3143 AC_CHECK_FUNCS(strtok_r)
3144
3145 AC_LANG_RESTORE
3146
3147 dnl check for inet_addr and inet_aton (these may live either in libc, or in
3148 dnl libnsl or libresolv or libsocket)
3149 INET_LINK=
3150 AC_CHECK_FUNCS(inet_addr,
3151 AC_DEFINE(HAVE_INET_ADDR),
3152 [
3153 AC_CHECK_LIB(nsl, inet_addr,
3154 INET_LINK="nsl",
3155 AC_CHECK_LIB(resolv, inet_addr,
3156 INET_LINK="resolv",
3157 AC_CHECK_LIB(socket, inet_addr,
3158 INET_LINK="socket"
3159 )
3160 )
3161 )
3162 ]
3163 )
3164
3165 AC_CHECK_FUNCS(inet_aton,
3166 AC_DEFINE(HAVE_INET_ATON),
3167 [
3168 dnl only check it in the same lib
3169 AC_CHECK_LIB($INET_LINK, inet_aton, AC_DEFINE(HAVE_INET_ATON))
3170 ])
3171
3172 if test "x$INET_LINK" != "x"; then
3173 AC_DEFINE(HAVE_INET_ADDR)
3174 INET_LINK=" -l$INET_LINK"
3175 fi
3176
3177 fi
3178 dnl if !MSW
3179
3180 dnl ===========================================================================
3181 dnl Now we have all the info we need - use it!
3182 dnl ===========================================================================
3183
3184 dnl flush the cache
3185 AC_CACHE_SAVE
3186
3187 dnl ---------------------------------------------------------------------------
3188 dnl thread support for Unix (always available under Win32)
3189 dnl ---------------------------------------------------------------------------
3190
3191 dnl under MSW we always have thread support
3192 CPP_MT_FLAG=
3193 if test "$TOOLKIT" != "MSW"; then
3194
3195 dnl the code below:
3196 dnl
3197 dnl defines THREADS_LINK and THREADS_CFLAGS which are the options
3198 dnl necessary to build the MT programs for the linker and compiler
3199 dnl respectively
3200 dnl
3201 dnl sets wxUSE_THREADS=1 if thread support is activated
3202
3203 THREADS_LINK=
3204 THREADS_CFLAGS=
3205
3206 if test "$wxUSE_THREADS" = "yes" ; then
3207 if test "$wxUSE_WINE" = 1 ; then
3208 AC_MSG_WARN([Threads are not supported under WINE... disabled])
3209 wxUSE_THREADS="no"
3210 elif test "$USE_BEOS" = 1; then
3211 AC_MSG_WARN([BeOS threads are not yet supported... disabled])
3212 wxUSE_THREADS="no"
3213 fi
3214 fi
3215
3216 if test "$wxUSE_THREADS" = "yes" ; then
3217 dnl find if POSIX threads are available
3218 dnl
3219 dnl the tests here are based on ACX_PTHREAD macro from autoconf macro
3220 dnl archive from http://ac-archive.sourceforge.net/
3221 dnl
3222 dnl thanks to Steven G. Johnson <stevenj@alum.mit.edu> and Alejandro
3223 dnl Forero Cuervo <bachue@bachue.com> for the original code
3224
3225 dnl TODO: cache the result
3226
3227 dnl define the list of the thread options to try in the loop below
3228 dnl with the convention that anything starting with '-' is a cpp flag
3229 dnl while anything else is a library (i.e. there is an implicit "-l")
3230 THREAD_OPTS="-pthread"
3231 case "${host}" in
3232 *-*-solaris2* | *-*-sunos4* )
3233 if test "x$GCC" = "xyes"; then
3234 dnl Solaris/gcc combination use this one for some reason
3235 THREAD_OPTS="-pthreads $THREAD_OPTS"
3236 else
3237 THREAD_OPTS="-mt $THREAD_OPTS"
3238 fi
3239 ;;
3240 *-*-freebsd*)
3241 dnl look, in order, for the kernel threads, then Linux threads
3242 dnl and finally the userland threads
3243 THREAD_OPTS="-kthread lthread $THREAD_OPTS c_r"
3244 ;;
3245 *-*-darwin* | *-*-cygwin* )
3246 dnl Darwin / Mac OS X just uses -lpthread tested below
3247 dnl and so does Cygwin
3248 THREAD_OPTS=""
3249 ;;
3250 *-*-aix*)
3251 dnl AIX calls the library libpthreads - thanks IBM!
3252 THREAD_OPTS="pthreads"
3253 ;;
3254 esac
3255
3256 dnl simply linking with libpthread should make the test below work but
3257 dnl it's far from certain that the threaded programs compiled without
3258 dnl any special switches actually work, so try it after all the others
3259 THREAD_OPTS="$THREAD_OPTS pthread none"
3260
3261 dnl now test for all possibilities
3262 THREADS_OK=no
3263 for flag in $THREAD_OPTS; do
3264 case $flag in
3265 none)
3266 AC_MSG_CHECKING([whether pthreads work without any flags])
3267 ;;
3268
3269 -*)
3270 AC_MSG_CHECKING([whether pthreads work with $flag])
3271 THREADS_CFLAGS="$flag"
3272 ;;
3273
3274 *)
3275 AC_MSG_CHECKING([for the pthreads library -l$flag])
3276 THREADS_LINK="-l$flag"
3277 ;;
3278 esac
3279
3280 save_LIBS="$LIBS"
3281 save_CFLAGS="$CFLAGS"
3282 LIBS="$THREADS_LINK $LIBS"
3283 CFLAGS="$THREADS_CFLAGS $CFLAGS"
3284
3285 AC_TRY_LINK([#include <pthread.h>],
3286 [pthread_create(0,0,0,0);],
3287 THREADS_OK=yes)
3288
3289 LIBS="$save_LIBS"
3290 CFLAGS="$save_CFLAGS"
3291
3292 AC_MSG_RESULT($THREADS_OK)
3293 if test "x$THREADS_OK" = "xyes"; then
3294 break;
3295 fi
3296
3297 THREADS_LINK=""
3298 THREADS_CFLAGS=""
3299 done
3300
3301 if test "x$THREADS_OK" != "xyes"; then
3302 wxUSE_THREADS=no
3303 AC_MSG_WARN([No thread support on this system... disabled])
3304 else
3305 dnl yes, these special compiler flags should be used with the
3306 dnl linker as well
3307 LIBS="$THREADS_LINK $THREADS_CFLAGS $LIBS"
3308
3309 AC_MSG_CHECKING([if more special flags are required for pthreads])
3310 flag=no
3311 case "${host}" in
3312 *-aix* | *-freebsd*)
3313 flag="-D_THREAD_SAFE"
3314 ;;
3315 *solaris* | alpha*-osf*)
3316 flag="-D_REENTRANT"
3317 ;;
3318 esac
3319 AC_MSG_RESULT(${flag})
3320 if test "x$flag" != xno; then
3321 THREADS_CFLAGS="$THREADS_CFLAGS $flag"
3322 fi
3323
3324 if test "x$THREADS_CFLAGS" != "x"; then
3325 dnl don't add these options to CPPFLAGS as cpp might not know them
3326 CFLAGS="$CFLAGS $THREADS_CFLAGS"
3327 CXXFLAGS="$CXXFLAGS $THREADS_CFLAGS"
3328 fi
3329 fi
3330 fi
3331
3332 dnl do other tests only if we are using threads
3333 if test "$wxUSE_THREADS" = "yes" ; then
3334 AC_CHECK_FUNCS(thr_setconcurrency)
3335
3336 AC_CHECK_HEADERS(sched.h)
3337 if test "$ac_cv_header_sched_h" = "yes"; then
3338 AC_CHECK_FUNC(sched_yield,
3339 AC_DEFINE(HAVE_SCHED_YIELD),
3340 [
3341 AC_CHECK_LIB(posix4,
3342 sched_yield,
3343 [AC_DEFINE(HAVE_SCHED_YIELD) POSIX4_LINK=" -lposix4"],
3344 AC_MSG_WARN(wxThread::Yield will not work properly)
3345 )
3346 ]
3347 )
3348 fi
3349
3350 dnl to be able to set the thread priority, we need to have all of the
3351 dnl following functions:
3352 dnl 1. pthread_attr_getschedpolicy
3353 dnl 2. sched_get_priority_min and sched_get_priority_max
3354 dnl (this one can be in either libpthread or libposix4 (under Solaris))
3355 dnl 3. pthread_attr_getschedparam and pthread_attr_setschedparam
3356 HAVE_PRIOR_FUNCS=0
3357 AC_CHECK_FUNC(pthread_attr_getschedpolicy,
3358 AC_CHECK_FUNC(pthread_attr_setschedparam,
3359 AC_CHECK_FUNC(sched_get_priority_max,
3360 HAVE_PRIOR_FUNCS=1,
3361 AC_CHECK_LIB([posix4], sched_get_priority_max,
3362 [
3363 HAVE_PRIOR_FUNCS=1
3364 POSIX4_LINK=" -lposix4"
3365 ],
3366 )
3367 )
3368 )
3369 )
3370
3371 if test "$HAVE_PRIOR_FUNCS" = 1; then
3372 AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS)
3373 else
3374 AC_MSG_WARN(Setting thread priority will not work)
3375 fi
3376
3377 AC_CHECK_FUNC(pthread_cancel,
3378 AC_DEFINE(HAVE_PTHREAD_CANCEL),
3379 AC_MSG_WARN([wxThread::Kill() will not work properly]))
3380
3381 AC_CACHE_CHECK([for pthread_cleanup_push/pop], wx_cv_func_pthread_cleanup_push,
3382 [
3383 AC_TRY_COMPILE([#include <pthread.h>],
3384 [
3385 pthread_cleanup_push(NULL, NULL);
3386 pthread_cleanup_pop(0);
3387 ], [
3388 wx_cv_func_pthread_cleanup_push=yes
3389 ], [
3390 wx_cv_func_pthread_cleanup_push=no
3391 ])
3392 ])
3393
3394 if test "$wx_cv_func_pthread_cleanup_push" = "yes"; then
3395 AC_DEFINE(HAVE_THREAD_CLEANUP_FUNCTIONS)
3396 fi
3397
3398 dnl mutexattr_t initialization is done in quite different ways on different
3399 dnl platforms, so check for a few things:
3400 dnl
3401 dnl HAVE_MUTEX_RECURSIVE means that we can create recursive mutexes
3402 dnl HAVE_MUTEXATTR_SETTYPE means that we do it using
3403 dnl pthread_mutexattr_settype(PTHREAD_MUTEX_RECURSIVE) and if it is not
3404 dnl defined, we do it by directly assigned
3405 dnl PTHREAD_MUTEX_RECURSIVE_MUTEX_INITIALIZER_NP to attr
3406
3407 dnl we need _GNU_SOURCE to get PTHREAD_MUTEX_RECURSIVE with glibc 2.1+
3408 dnl (strictly speaking we only need _XOPEN_SOURCE=500 but just defining
3409 dnl this disables _BSD_SOURCE which breaks libtiff compilation, so it is
3410 dnl simpler to just define _GNU_SOURCE to get everything)
3411 if test "x$wx_cv_lib_glibc21" = "xyes"; then
3412 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3413 fi
3414
3415 AC_CACHE_CHECK([for pthread_mutexattr_t], wx_cv_type_pthread_mutexattr_t,
3416 [
3417 AC_TRY_COMPILE([#include <pthread.h>],
3418 [
3419 pthread_mutexattr_t attr;
3420 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
3421 ], [
3422 wx_cv_type_pthread_mutexattr_t=yes
3423 ], [
3424 wx_cv_type_pthread_mutexattr_t=no
3425 ]
3426 )
3427 ])
3428
3429 if test "$wx_cv_type_pthread_mutexattr_t" = "yes"; then
3430 AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_T)
3431 else
3432 dnl don't despair, there may be another way to do it
3433 AC_CACHE_CHECK([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER],
3434 wx_cv_type_pthread_rec_mutex_init,
3435 [
3436 AC_TRY_COMPILE([#include <pthread.h>],
3437 [
3438 pthread_mutex_t attr = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
3439 ], [
3440 wx_cv_type_pthread_rec_mutex_init=yes
3441 ], [
3442 wx_cv_type_pthread_rec_mutex_init=no
3443 ]
3444 )
3445 ])
3446 if test "$wx_cv_type_pthread_rec_mutex_init" = "yes"; then
3447 AC_DEFINE(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
3448 else
3449 dnl this may break code working elsewhere, so at least warn about it
3450 AC_MSG_WARN([wxMutex won't be recursive on this platform])
3451 fi
3452 fi
3453 fi
3454
3455 dnl from if !MSW
3456 fi
3457
3458 if test "$wxUSE_THREADS" = "yes"; then
3459 AC_DEFINE(wxUSE_THREADS)
3460
3461 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
3462 else
3463 dnl on some systems, _REENTRANT should be defined if we want to use any _r()
3464 dnl functions - add tests for other functions here as well
3465 if test "$ac_cv_func_strtok_r" = "yes"; then
3466 AC_MSG_CHECKING(if -D_REENTRANT is needed)
3467 if test "$NEEDS_D_REENTRANT_FOR_R_FUNCS" = 1; then
3468 TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D_REENTRANT"
3469 AC_MSG_RESULT(yes)
3470 else
3471 AC_MSG_RESULT(no)
3472 fi
3473 fi
3474 fi
3475
3476 if test "$WXGTK20" = 1 ; then
3477 AC_DEFINE_UNQUOTED(__WXGTK20__,$WXGTK20)
3478 WXGTK12=1
3479 fi
3480
3481 if test "$WXGTK12" = 1 ; then
3482 AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12)
3483 fi
3484
3485 if test "$WXGTK127" = 1 ; then
3486 AC_DEFINE_UNQUOTED(__WXGTK127__,$WXGTK127)
3487 fi
3488
3489 WXDEBUG=
3490
3491 if test "$wxUSE_DEBUG_INFO" = "yes" ; then
3492 WXDEBUG="-g"
3493 wxUSE_OPTIMISE=no
3494 fi
3495
3496 if test "$wxUSE_DEBUG_GDB" = "yes" ; then
3497 wxUSE_DEBUG_INFO=yes
3498 WXDEBUG="-ggdb"
3499 fi
3500
3501 if test "$wxUSE_DEBUG_FLAG" = "yes" ; then
3502 AC_DEFINE(WXDEBUG)
3503 WXDEBUG_DEFINE="-D__WXDEBUG__"
3504 else
3505 if test "$wxUSE_GTK" = 1 ; then
3506 WXDEBUG_DEFINE="-DGTK_NO_CHECK_CASTS"
3507 fi
3508 fi
3509
3510 if test "$wxUSE_MEM_TRACING" = "yes" ; then
3511 AC_DEFINE(wxUSE_MEMORY_TRACING)
3512 AC_DEFINE(wxUSE_GLOBAL_MEMORY_OPERATORS)
3513 AC_DEFINE(wxUSE_DEBUG_NEW_ALWAYS)
3514 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS memcheck"
3515 fi
3516
3517 if test "$wxUSE_DMALLOC" = "yes" ; then
3518 DMALLOC_LIBS="-ldmalloc"
3519 fi
3520
3521 PROFILE=
3522 if test "$wxUSE_PROFILE" = "yes" ; then
3523 PROFILE=" -pg"
3524 fi
3525
3526 CODE_GEN_FLAGS=
3527 CODE_GEN_FLAGS_CXX=
3528 if test "$GCC" = "yes" ; then
3529 if test "$wxUSE_NO_RTTI" = "yes" ; then
3530 CODE_GEN_FLAGS_CXX="$CODE_GEN_FLAGS_CXX -fno-rtti"
3531 fi
3532 if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
3533 CODE_GEN_FLAGS_CXX="$CODE_GEN_FLAGS_CXX -fno-exceptions"
3534 fi
3535 if test "$wxUSE_PERMISSIVE" = "yes" ; then
3536 CODE_GEN_FLAGS="$CODE_GEN_FLAGS -fpermissive"
3537 fi
3538 if test "$USE_WIN32" = 1 ; then
3539 # I'm not even really sure what this was ever added to solve,
3540 # but someone added it for mingw native builds, so I guess
3541 # they had a reason, right??
3542 CODE_GEN_FLAGS="$CODE_GEN_FLAGS -fno-pcc-struct-return"
3543 fi
3544
3545 dnl Ian Brown <ian.brown@printsoft.de> reports that versions of gcc before
3546 dnl 3.0 overflow the table of contents on rs6000 as they create an entry
3547 dnl for each subroutine by default -- using the switch below only creates
3548 dnl one entry per file instead at the price of minor performance penalty
3549 dnl
3550 dnl TODO: test for the gcc version here (how?)
3551 case "${host}" in
3552 powerpc*-*-aix* )
3553 CODE_GEN_FLAGS="$CODE_GEN_FLAGS -mminimal-toc"
3554 ;;
3555 esac
3556 fi
3557
3558 if test "$wxUSE_OPTIMISE" = "no" ; then
3559 OPTIMISE=
3560 else
3561 if test "$GCC" = yes ; then
3562 OPTIMISE="-O2"
3563 case "${host}" in
3564 i586-*-*|i686-*-* )
3565 OPTIMISE="${OPTIMISE} "
3566 ;;
3567 esac
3568 else
3569 OPTIMISE="-O"
3570 fi
3571 fi
3572
3573 if test "$WXWIN_COMPATIBILITY_2" = "yes"; then
3574 AC_DEFINE(WXWIN_COMPATIBILITY_2)
3575
3576 WXWIN_COMPATIBILITY_2_2="yes"
3577 fi
3578
3579 if test "x$WXWIN_COMPATIBILITY_2_2" != "xno"; then
3580 AC_DEFINE(WXWIN_COMPATIBILITY_2_2)
3581 fi
3582
3583 dnl ---------------------------------------------------------------------------
3584 dnl the library may be built without GUI classes at all
3585 dnl ---------------------------------------------------------------------------
3586
3587 if test "$wxUSE_GUI" = "yes"; then
3588 AC_DEFINE(wxUSE_GUI)
3589
3590 dnl the things we always pull in the GUI version of the library:
3591 dnl 1. basic things like wxApp, wxWindow, wxControl, wxFrame, wxDialog (the
3592 dnl library really can't be built without those)
3593 dnl 2. basic controls: wxButton, wxStaticText, wxTextCtrl (these are used in
3594 dnl almost any program and the first 2 are needed to show a message box
3595 dnl which want to be always able to do)
3596 dnl 3. GDI stuff: icon, cursors and all that. Although it would be very nice
3597 dnl to compile without them (if the app doesn't do any drawing, it doesn't
3598 dnl need the dcs, pens, brushes, ...), this just can't be done now
3599 dnl 4. menu stuff: wxMenu, wxMenuBar, wxMenuItem
3600 dnl 5. misc stuff: timers, settings, message box
3601 else
3602 AC_DEFINE(wxUSE_NOGUI)
3603 fi
3604
3605 dnl ---------------------------------------------------------------------------
3606 dnl Unix/Windows
3607 dnl ---------------------------------------------------------------------------
3608
3609 if test "$wxUSE_UNIX" = "yes"; then
3610 AC_DEFINE(wxUSE_UNIX)
3611 fi
3612
3613 dnl ---------------------------------------------------------------------------
3614 dnl Register non-GUI class options for makefiles and setup.h
3615 dnl ---------------------------------------------------------------------------
3616
3617 if test "$wxUSE_APPLE_IEEE" = "yes"; then
3618 AC_DEFINE(wxUSE_APPLE_IEEE)
3619 fi
3620
3621 if test "$wxUSE_TIMER" = "yes"; then
3622 AC_DEFINE(wxUSE_TIMER)
3623 fi
3624
3625 if test "$wxUSE_WAVE" = "yes"; then
3626 AC_DEFINE(wxUSE_WAVE)
3627 fi
3628
3629 if test "$wxUSE_CMDLINE_PARSER" = "yes"; then
3630 AC_DEFINE(wxUSE_CMDLINE_PARSER)
3631 fi
3632
3633 if test "$wxUSE_STOPWATCH" = "yes"; then
3634 AC_DEFINE(wxUSE_STOPWATCH)
3635 fi
3636
3637 if test "$wxUSE_DATETIME" = "yes"; then
3638 AC_DEFINE(wxUSE_DATETIME)
3639 fi
3640
3641 if test "$wxUSE_TIMEDATE" = "yes"; then
3642 AC_DEFINE(wxUSE_TIMEDATE)
3643 fi
3644
3645 if test "$wxUSE_FILE" = "yes"; then
3646 AC_DEFINE(wxUSE_FILE)
3647 fi
3648
3649 if test "$wxUSE_FFILE" = "yes"; then
3650 AC_DEFINE(wxUSE_FFILE)
3651 fi
3652
3653 if test "$wxUSE_FILESYSTEM" = "yes"; then
3654 AC_DEFINE(wxUSE_FILESYSTEM)
3655 fi
3656
3657 if test "$wxUSE_FS_INET" = "yes"; then
3658 AC_DEFINE(wxUSE_FS_INET)
3659 fi
3660
3661 if test "$wxUSE_FS_ZIP" = "yes"; then
3662 AC_DEFINE(wxUSE_FS_ZIP)
3663 fi
3664
3665 if test "$wxUSE_ZIPSTREAM" = "yes"; then
3666 AC_DEFINE(wxUSE_ZIPSTREAM)
3667 fi
3668
3669 if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes"; then
3670 AC_DEFINE(wxUSE_ON_FATAL_EXCEPTION)
3671 fi
3672
3673 if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then
3674 AC_DEFINE(wxUSE_SNGLINST_CHECKER)
3675 fi
3676
3677 if test "$wxUSE_BUSYINFO" = "yes"; then
3678 AC_DEFINE(wxUSE_BUSYINFO)
3679 fi
3680
3681 if test "$wxUSE_STD_IOSTREAM" = "yes"; then
3682 AC_DEFINE(wxUSE_STD_IOSTREAM)
3683 fi
3684
3685 if test "$wxUSE_TEXTBUFFER" = "yes"; then
3686 AC_DEFINE(wxUSE_TEXTBUFFER)
3687 fi
3688
3689 if test "$wxUSE_TEXTFILE" = "yes"; then
3690 if test "$wxUSE_FILE" != "yes" -o "$wxUSE_TEXTBUFFER" != "yes" ; then
3691 AC_MSG_WARN(wxTextFile requires wxFile and wxTextBuffer... disabled)
3692 else
3693 AC_DEFINE(wxUSE_TEXTFILE)
3694 fi
3695 fi
3696
3697 if test "$wxUSE_CONFIG" = "yes" ; then
3698 if test "$wxUSE_TEXTFILE" != "yes"; then
3699 AC_MSG_WARN(wxConfig requires wxTextFile... disabled)
3700 else
3701 AC_DEFINE(wxUSE_CONFIG)
3702 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS config"
3703 fi
3704 fi
3705
3706 if test "$wxUSE_INTL" = "yes" ; then
3707 if test "$wxUSE_FILE" != "yes"; then
3708 AC_MSG_WARN(I18n code requires wxFile... disabled)
3709 else
3710 AC_DEFINE(wxUSE_INTL)
3711 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS internat"
3712 GUIDIST="$GUIDIST INTL_DIST"
3713 fi
3714 fi
3715
3716 if test "$wxUSE_LOG" = "yes"; then
3717 AC_DEFINE(wxUSE_LOG)
3718
3719 if test "$wxUSE_LOGGUI" = "yes"; then
3720 AC_DEFINE(wxUSE_LOGGUI)
3721 fi
3722
3723 if test "$wxUSE_LOGWINDOW" = "yes"; then
3724 AC_DEFINE(wxUSE_LOGWINDOW)
3725 fi
3726
3727 if test "$wxUSE_LOGDIALOG" = "yes"; then
3728 AC_DEFINE(wxUSE_LOG_DIALOG)
3729 fi
3730 fi
3731
3732 if test "$wxUSE_LONGLONG" = "yes"; then
3733 AC_DEFINE(wxUSE_LONGLONG)
3734 fi
3735
3736 if test "$wxUSE_GEOMETRY" = "yes"; then
3737 AC_DEFINE(wxUSE_GEOMETRY)
3738 fi
3739
3740 if test "$wxUSE_DIALUP_MANAGER" = "yes" ; then
3741 AC_DEFINE(wxUSE_DIALUP_MANAGER)
3742 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dialup"
3743 fi
3744
3745 if test "$wxUSE_STREAMS" = "yes" ; then
3746 AC_DEFINE(wxUSE_STREAMS)
3747 fi
3748
3749 dnl ---------------------------------------------------------------------------
3750 dnl time/date functions
3751 dnl ------------------------------------------------------------------------
3752
3753 if test "$wxUSE_DATETIME" = "yes"; then
3754 dnl check for strptime
3755 AC_CHECK_FUNCS(strptime)
3756
3757 dnl check for timezone variable
3758 dnl doesn't exist under Darwin / Mac OS X which uses tm_gmtoff instead
3759 AC_CACHE_CHECK(for timezone variable in <time.h>,
3760 wx_cv_var_timezone,
3761 [
3762 AC_TRY_COMPILE(
3763 [
3764 #include <time.h>
3765 ],
3766 [
3767 int tz;
3768 tz = timezone;
3769 ],
3770 [
3771 wx_cv_var_timezone=timezone
3772 ],
3773 [
3774 AC_TRY_COMPILE(
3775 [
3776 #include <time.h>
3777 ],
3778 [
3779 int tz;
3780 tz = _timezone;
3781 ],
3782 [
3783 wx_cv_var_timezone=_timezone
3784 ],
3785 [
3786 AC_TRY_COMPILE(
3787 [
3788 #include <time.h>
3789 ],
3790 [
3791 int tz;
3792 tz = __timezone;
3793 ],
3794 [
3795 wx_cv_var_timezone=__timezone
3796 ],
3797 [
3798 if test "$USE_DOS" = 0 ; then
3799 AC_MSG_WARN(no timezone variable, will use tm_gmtoff instead)
3800 fi
3801 ]
3802 )
3803 ]
3804 )
3805 ]
3806 )
3807 ]
3808 )
3809
3810 dnl as we want $wx_cv_var_timezone to be expanded, use AC_DEFINE_UNQUOTED
3811 if test "x$wx_cv_var_timezone" != x ; then
3812 AC_DEFINE_UNQUOTED(WX_TIMEZONE, $wx_cv_var_timezone)
3813 fi
3814
3815 dnl check for localtime (it's POSIX, but the check can do no harm...)
3816 AC_CHECK_FUNCS(localtime)
3817
3818 if test "$ac_cv_func_localtime" = "yes"; then
3819 AC_CACHE_CHECK(for tm_gmtoff in struct tm,
3820 wx_cv_struct_tm_has_gmtoff,
3821 [
3822 AC_TRY_COMPILE(
3823 [
3824 #include <time.h>
3825 ],
3826 [
3827 struct tm tm;
3828 tm.tm_gmtoff++;
3829 ],
3830 [
3831 wx_cv_struct_tm_has_gmtoff=yes
3832 ],
3833 wx_cv_struct_tm_has_gmtoff=no
3834 )
3835 ])
3836 fi
3837
3838 if test "$wx_cv_struct_tm_has_gmtoff" = "yes"; then
3839 AC_DEFINE(WX_GMTOFF_IN_TM)
3840 fi
3841
3842 dnl check for gettimeofday (SVr4, BSD 4.3) and ftime (V7, BSD 4.3) for the
3843 dnl function to be used for high resolution timers
3844 AC_CHECK_FUNCS(gettimeofday ftime, break)
3845
3846 if test "$ac_cv_func_gettimeofday" = "yes"; then
3847 AC_CACHE_CHECK([whether gettimeofday takes two arguments],
3848 wx_cv_func_gettimeofday_has_2_args,
3849 [
3850 dnl on some _really_ old systems it takes only 1 argument
3851 AC_LANG_SAVE
3852 AC_LANG_CPLUSPLUS
3853
3854 AC_TRY_COMPILE(
3855 [
3856 #include <sys/time.h>
3857 #include <unistd.h>
3858 ],
3859 [
3860 struct timeval tv;
3861 gettimeofday(&tv, NULL);
3862 ],
3863 wx_cv_func_gettimeofday_has_2_args=yes,
3864 AC_TRY_COMPILE(
3865 [
3866 #include <sys/time.h>
3867 #include <unistd.h>
3868 ],
3869 [
3870 struct timeval tv;
3871 gettimeofday(&tv);
3872 ],
3873 wx_cv_func_gettimeofday_has_2_args=no,
3874 [
3875 AC_MSG_WARN([failed to determine number of gettimeofday() arguments])
3876 wx_cv_func_gettimeofday_has_2_args=unknown
3877 ]
3878 )
3879 )
3880 AC_LANG_RESTORE
3881 ])
3882
3883 if test "$wx_cv_func_gettimeofday_has_2_args" != "yes"; then
3884 AC_DEFINE(WX_GETTIMEOFDAY_NO_TZ)
3885 fi
3886 fi
3887
3888 AC_DEFINE(wxUSE_TIMEDATE)
3889 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest"
3890 fi
3891
3892 dnl ------------------------------------------------------------------------
3893 dnl wxSocket
3894 dnl ------------------------------------------------------------------------
3895
3896 dnl VZ: the GUI hooks wxSocket needs are not implemented yet in wxX11
3897 if test "$wxUSE_SOCKETS" = "yes"; then
3898 if test "$wxUSE_X11" = "1"; then
3899 AC_MSG_WARN([wxSocket not yet supported under X11... disabled])
3900 wxUSE_SOCKETS="no"
3901 fi
3902
3903 if test "$wxUSE_MGL" = "1"; then
3904 AC_MSG_WARN([wxSocket not yet supported under MGL... disabled])
3905 wxUSE_SOCKETS="no"
3906 fi
3907 fi
3908
3909 if test "$wxUSE_SOCKETS" = "yes"; then
3910 dnl under MSW we always have sockets
3911 if test "$TOOLKIT" != "MSW"; then
3912 dnl under Solaris and OS/2, socket functions live in -lsocket
3913 AC_CHECK_FUNC(socket,,
3914 AC_CHECK_LIB(socket, socket,
3915 if test "$INET_LINK" != " -lsocket"; then
3916 INET_LINK="$INET_LINK -lsocket"
3917 fi,
3918 [
3919 AC_MSG_WARN([socket library not found - sockets will be disabled])
3920 wxUSE_SOCKETS=no
3921 ]
3922 )
3923 )
3924 fi
3925 fi
3926
3927 if test "$wxUSE_SOCKETS" = "yes" ; then
3928 dnl this test may be appropriate if building under cygwin
3929 dnl right now I'm assuming it also uses the winsock stuff
3930 dnl like mingw does.. -- RL
3931 if test "$TOOLKIT" != "MSW"; then
3932 dnl determine the type of third argument for getsockname
3933 AC_CACHE_CHECK([what is the type of the third argument of getsockname],
3934 wx_cv_type_getsockname3,
3935 [
3936 AC_LANG_SAVE
3937 AC_LANG_CPLUSPLUS
3938
3939 AC_TRY_COMPILE(
3940 [
3941 #include <sys/types.h>
3942 #include <sys/socket.h>
3943 ],
3944 [
3945 socklen_t len;
3946 getsockname(0, 0, &len);
3947 ],
3948 wx_cv_type_getsockname3=socklen_t,
3949 AC_TRY_COMPILE(
3950 [
3951 #include <sys/types.h>
3952 #include <sys/socket.h>
3953 ],
3954 [
3955 size_t len;
3956 getsockname(0, 0, &len);
3957 ],
3958 wx_cv_type_getsockname3=size_t,
3959 AC_TRY_COMPILE(
3960 [
3961 #include <sys/types.h>
3962 #include <sys/socket.h>
3963 ],
3964 [
3965 int len;
3966 getsockname(0, 0, &len);
3967 ],
3968 wx_cv_type_getsockname3=int,
3969 wx_cv_type_getsockname3=unknown
3970 )
3971 )
3972 )
3973
3974 AC_LANG_RESTORE
3975 ])
3976
3977 if test "$wx_cv_type_getsockname3" = "unknown"; then
3978 wxUSE_SOCKETS=no
3979 AC_MSG_WARN([Couldn't find socklen_t synonym for this system])
3980 else
3981 AC_DEFINE_UNQUOTED(SOCKLEN_T, $wx_cv_type_getsockname3)
3982 fi
3983 fi
3984 fi
3985
3986 if test "$wxUSE_SOCKETS" = "yes" ; then
3987 AC_DEFINE(wxUSE_SOCKETS)
3988 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sockets"
3989 fi
3990
3991 dnl ---------------------------------------------------------------------------
3992 dnl Joystick support
3993 dnl ---------------------------------------------------------------------------
3994
3995 if test "$wxUSE_GUI" = "yes"; then
3996
3997 if test "$TOOLKIT" = "MAC"; then
3998 AC_MSG_WARN([Joystick not yet supported under Mac OS X... disabled])
3999 wxUSE_JOYSTICK=no
4000 fi
4001 if test "$TOOLKIT" = "MOTIF"; then
4002 AC_MSG_WARN([Joystick not yet supported under Motif... disabled])
4003 wxUSE_JOYSTICK=no
4004 fi
4005 if test "$TOOLKIT" = "X11"; then
4006 AC_MSG_WARN([Joystick not yet supported under X11... disabled])
4007 wxUSE_JOYSTICK=no
4008 fi
4009
4010 dnl under MSW we always have joystick support
4011 if test "$TOOLKIT" != "MSW"; then
4012 if test "$wxUSE_JOYSTICK" = "yes"; then
4013 dnl joystick support is only for Linux 2.1.x or greater
4014 AC_CHECK_HEADERS(linux/joystick.h)
4015 if test "$ac_cv_header_linux_joystick_h" != "yes"; then
4016 wxUSE_JOYSTICK=no
4017 AC_MSG_WARN(Joystick not supported by this system... disabled)
4018 fi
4019 fi
4020 fi
4021
4022 if test "$wxUSE_JOYSTICK" = "yes"; then
4023 AC_DEFINE(wxUSE_JOYSTICK)
4024 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest"
4025 fi
4026 fi
4027
4028 dnl ------------------------------------------------------------------------
4029 dnl DLL support
4030 dnl ------------------------------------------------------------------------
4031
4032 dnl under MSW we always have LoadLibrary/GetProcAddress
4033 if test "$TOOLKIT" != "MSW"; then
4034
4035 HAVE_DL_FUNCS=0
4036 HAVE_SHL_FUNCS=0
4037 if test "$wxUSE_DYNAMIC_LOADER" = "yes" -o "$wxUSE_DYNLIB_CLASS" = "yes" ; then
4038 if test "$USE_DARWIN" = 1; then
4039 dnl dlopen/dlerror is implemented in dynlib.cpp for Darwin/Mac OS X
4040 HAVE_DL_FUNCS=1
4041 else
4042 dnl the test is a bit complicated because we check for dlopen() both with
4043 dnl and without -ldl and we also try to find shl_load() if there is no
4044 dnl dlopen() on this system
4045 AC_CHECK_FUNCS(dlopen,
4046 [
4047 AC_DEFINE(HAVE_DLOPEN)
4048 HAVE_DL_FUNCS=1
4049 ],
4050 [
4051 AC_CHECK_LIB(dl, dlopen,
4052 [
4053 AC_DEFINE(HAVE_DLOPEN)
4054 HAVE_DL_FUNCS=1
4055 DL_LINK=" -ldl$DL_LINK"
4056 ],
4057 [
4058 AC_CHECK_FUNCS(shl_load,
4059 [
4060 AC_DEFINE(HAVE_SHL_LOAD)
4061 HAVE_SHL_FUNCS=1
4062 ],
4063 [
4064 AC_CHECK_LIB(shl_load, dld,
4065 [
4066 HAVE_SHL_FUNCS=1
4067 DL_LINK=" -ldld$DL_LINK"
4068 ])
4069 ])
4070 ])
4071 ])
4072
4073 dnl check also for dlerror()
4074 if test "$HAVE_DL_FUNCS" = 1; then
4075 AC_CHECK_FUNCS(dlerror,
4076 AC_DEFINE(HAVE_DLERROR),
4077 AC_CHECK_LIB(dl, dlerror, AC_DEFINE(HAVE_DLERROR)))
4078 fi
4079 fi
4080
4081 if test "$HAVE_DL_FUNCS" = 0; then
4082 if test "$HAVE_SHL_FUNCS" = 0; then
4083 if test "$USE_UNIX" = 1; then
4084 AC_MSG_WARN([Missing dynamic loading support, several features will be disabled])
4085 wxUSE_DYNAMIC_LOADER=no
4086 wxUSE_DYNLIB_CLASS=no
4087 else
4088 AC_MSG_WARN([Assuming wxLibrary class works on this platform])
4089 fi
4090 fi
4091 fi
4092 fi
4093 fi
4094
4095 if test "$wxUSE_DYNAMIC_LOADER" = "yes" ; then
4096 AC_DEFINE(wxUSE_DYNAMIC_LOADER)
4097 elif test "$wxUSE_DYNLIB_CLASS" = "yes" ; then
4098 AC_DEFINE(wxUSE_DYNLIB_CLASS)
4099 fi
4100
4101 dnl ---------------------------------------------------------------------------
4102 dnl String stuff
4103 dnl ---------------------------------------------------------------------------
4104
4105 if test "$wxUSE_FONTMAP" = "yes" ; then
4106 AC_DEFINE(wxUSE_FONTMAP)
4107 fi
4108
4109 if test "$wxUSE_UNICODE" = "yes" ; then
4110 AC_DEFINE(wxUSE_UNICODE)
4111
4112 if test "$wxUSE_MSW" != 1; then
4113 wxUSE_UNICODE_MSLU=no
4114 fi
4115
4116 if test "$wxUSE_MSW" = 1 -a "$wxUSE_UNICODE_MSLU" = "yes"; then
4117 AC_CHECK_LIB(unicows,main,
4118 [
4119 AC_DEFINE(wxUSE_UNICODE_MSLU)
4120 ],
4121 [
4122 AC_MSG_WARN([Compiler doesn't support MSLU (libunicows.a), disabled.
4123 Applications will only run on Windows NT/2000/XP!])
4124 wxUSE_UNICODE_MSLU=no
4125 ])
4126 fi
4127 fi
4128
4129 if test "$wxUSE_wxUSE_EXPERIMENTAL_PRINTF" = "yes"; then
4130 AC_DEFINE(wxUSE_EXPERIMENTAL_PRINTF)
4131 fi
4132
4133
4134 dnl ----------------------------------------------------------------
4135 dnl iODBC support
4136 dnl ----------------------------------------------------------------
4137
4138 IODBC_C_SRC=""
4139 if test "$wxUSE_ODBC" = "yes" ; then
4140 AC_DEFINE(wxUSE_ODBC)
4141 WXODBCFLAG="-D_IODBC_"
4142 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS db"
4143 fi
4144
4145 dnl ----------------------------------------------------------------
4146 dnl Register PostScript options for makefiles and setup.h
4147 dnl ----------------------------------------------------------------
4148
4149 if test "$wxUSE_POSTSCRIPT" = "yes" ; then
4150 AC_DEFINE(wxUSE_POSTSCRIPT)
4151 fi
4152
4153 AC_DEFINE(wxUSE_AFM_FOR_POSTSCRIPT)
4154
4155 AC_DEFINE(wxUSE_NORMALIZED_PS_FONTS)
4156
4157 dnl ---------------------------------------------------------------------------
4158 dnl big GUI components: MDI, doc/view, printing, help, ...
4159 dnl ---------------------------------------------------------------------------
4160
4161 if test "$wxUSE_CONSTRAINTS" = "yes"; then
4162 AC_DEFINE(wxUSE_CONSTRAINTS)
4163 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS layout"
4164 fi
4165
4166 if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
4167 if test "$wxUSE_UNIVERSAL" = "yes"; then
4168 AC_MSG_WARN(MDI not yet supported for wxUniversal... disabled)
4169 wxUSE_MDI_ARCHITECTURE=no
4170 fi
4171
4172 if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
4173 AC_DEFINE(wxUSE_MDI_ARCHITECTURE)
4174 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mdi"
4175 fi
4176 fi
4177
4178 if test "$wxUSE_DOC_VIEW_ARCHITECTURE" = "yes" ; then
4179 AC_DEFINE(wxUSE_DOC_VIEW_ARCHITECTURE)
4180 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docview"
4181 if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
4182 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docvwmdi"
4183 fi
4184 fi
4185
4186 if test "$wxUSE_HELP" = "yes"; then
4187 AC_DEFINE(wxUSE_HELP)
4188 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS help"
4189
4190 if test "$wxUSE_MSW" = 1; then
4191 if test "$wxUSE_MS_HTML_HELP" = "yes"; then
4192 AC_DEFINE(wxUSE_MS_HTML_HELP)
4193 fi
4194 fi
4195
4196 if test "$wxUSE_WXHTML_HELP" = "yes"; then
4197 if test "$wxUSE_HTML" = "yes"; then
4198 AC_DEFINE(wxUSE_WXHTML_HELP)
4199 else
4200 AC_MSG_WARN(Cannot use wxHTML-based help without wxHTML so it won't be compiled)
4201 wxUSE_WXHTML_HELP=no
4202 fi
4203 fi
4204 fi
4205
4206 if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then
4207 if test "$wxUSE_CONSTRAINTS" != "yes"; then
4208 AC_MSG_WARN(Printing support cannot be used without constraints so it won't be compiled without it)
4209 else
4210 AC_DEFINE(wxUSE_PRINTING_ARCHITECTURE)
4211 fi
4212 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS printing"
4213 fi
4214
4215 if test "$wxUSE_PROLOGIO" = "yes" ; then
4216 AC_DEFINE(wxUSE_PROLOGIO)
4217 fi
4218
4219 if test "$wxUSE_RESOURCES" = "yes" ; then
4220 if test "$wxUSE_NANOX" = "yes"; then
4221 AC_MSG_WARN([Cannot use resource database functions in NanoX])
4222 else
4223 AC_DEFINE(wxUSE_RESOURCES)
4224 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS resource"
4225 fi
4226 fi
4227
4228 if test "$wxUSE_X_RESOURCES" = "yes"; then
4229 AC_DEFINE(wxUSE_X_RESOURCES)
4230 fi
4231
4232 dnl ---------------------------------------------------------------------------
4233 dnl IPC: IPC, Drag'n'Drop, Clipboard, ...
4234 dnl ---------------------------------------------------------------------------
4235
4236 dnl check for ole headers and disable a few features requiring it if not
4237 dnl present (earlier versions of mingw32 don't have ole2.h)
4238 if test "$wxUSE_MSW" = 1 -a \( "$wxUSE_DATAOBJ" = "yes" \
4239 -o "$wxUSE_CLIPBOARD" = "yes" \
4240 -o "$wxUSE_DRAG_AND_DROP" = "yes" \) ; then
4241 AC_CHECK_HEADERS(ole2.h)
4242
4243 if test "$ac_cv_header_ole2_h" = "yes" ; then
4244 if test "$GCC" = yes ; then
4245 ALL_OBJECTS="$ALL_OBJECTS \$(OLEOBJS)"
4246 CODE_GEN_FLAGS_CXX="$CODE_GEN_FLAGS_CXX -fvtable-thunks"
4247 LIBS=" -lrpcrt4 -loleaut32 -lole32 -luuid$LIBS"
4248 AC_DEFINE(wxUSE_OLE)
4249
4250 fi
4251
4252 dnl for OLE clipboard and dnd
4253 AC_DEFINE(wxUSE_DATAOBJ)
4254 else
4255 AC_MSG_WARN([Some features disabled because OLE headers not found])
4256
4257 wxUSE_CLIPBOARD=no
4258 wxUSE_DRAG_AND_DROP=no
4259 wxUSE_DATAOBJ=no
4260 fi
4261
4262 if test "$wxUSE_METAFILE" = "yes"; then
4263 AC_DEFINE(wxUSE_METAFILE)
4264
4265 dnl this one should probably be made separately configurable
4266 AC_DEFINE(wxUSE_ENH_METAFILE)
4267 fi
4268 fi
4269
4270 if test "$wxUSE_IPC" = "yes"; then
4271 if test "$wxUSE_SOCKETS" != "yes"; then
4272 AC_MSG_WARN(wxWindows IPC classes require sockets... disabled)
4273 fi
4274
4275 AC_DEFINE(wxUSE_IPC)
4276 fi
4277
4278 if test "$wxUSE_CLIPBOARD" = "yes"; then
4279 if test "$wxUSE_MGL" = 1; then
4280 AC_MSG_WARN([Clipboard not yet supported under MGL... disabled])
4281 wxUSE_CLIPBOARD=no
4282 fi
4283
4284 if test "$wxUSE_CLIPBOARD" = "yes"; then
4285 AC_DEFINE(wxUSE_CLIPBOARD)
4286
4287 dnl required by clipboard code in configuration check
4288 AC_DEFINE(wxUSE_DATAOBJ)
4289 fi
4290 fi
4291
4292 if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
4293 if test "$wxUSE_GTK" = 1; then
4294 if test "$WXGTK12" != 1; then
4295 AC_MSG_WARN([Drag and drop is only supported under GTK+ 1.2... disabled])
4296 wxUSE_DRAG_AND_DROP=no
4297 fi
4298 fi
4299
4300 if test "$wxUSE_MOTIF" = 1; then
4301 AC_MSG_WARN([Drag and drop not yet supported under Motif... disabled])
4302 wxUSE_DRAG_AND_DROP=no
4303 fi
4304
4305 if test "$wxUSE_X11" = 1; then
4306 AC_MSG_WARN([Drag and drop not yet supported under X11... disabled])
4307 wxUSE_DRAG_AND_DROP=no
4308 fi
4309
4310 if test "$wxUSE_MGL" = 1; then
4311 AC_MSG_WARN([Drag and drop not yet supported under MGL... disabled])
4312 wxUSE_DRAG_AND_DROP=no
4313 fi
4314
4315 if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
4316 AC_DEFINE(wxUSE_DRAG_AND_DROP)
4317 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd"
4318 fi
4319
4320 fi
4321
4322 if test "$wxUSE_SPLINES" = "yes" ; then
4323 AC_DEFINE(wxUSE_SPLINES)
4324 fi
4325
4326 dnl ---------------------------------------------------------------------------
4327 dnl GUI controls
4328 dnl ---------------------------------------------------------------------------
4329
4330 USES_CONTROLS=0
4331 if test "$wxUSE_CONTROLS" = "yes"; then
4332 USES_CONTROLS=1
4333 fi
4334
4335 if test "$wxUSE_ACCEL" = "yes"; then
4336 AC_DEFINE(wxUSE_ACCEL)
4337 USES_CONTROLS=1
4338 fi
4339
4340 if test "$wxUSE_BUTTON" = "yes"; then
4341 AC_DEFINE(wxUSE_BUTTON)
4342 USES_CONTROLS=1
4343 fi
4344
4345 if test "$wxUSE_BMPBUTTON" = "yes"; then
4346 AC_DEFINE(wxUSE_BMPBUTTON)
4347 USES_CONTROLS=1
4348 fi
4349
4350 if test "$wxUSE_CALCTRL" = "yes"; then
4351 AC_DEFINE(wxUSE_CALENDARCTRL)
4352 USES_CONTROLS=1
4353 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS calendar"
4354 fi
4355
4356 if test "$wxUSE_CARET" = "yes"; then
4357 AC_DEFINE(wxUSE_CARET)
4358 USES_CONTROLS=1
4359 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS caret"
4360 fi
4361
4362 if test "$wxUSE_COMBOBOX" = "yes"; then
4363 AC_DEFINE(wxUSE_COMBOBOX)
4364 USES_CONTROLS=1
4365 fi
4366
4367 if test "$wxUSE_CHOICE" = "yes"; then
4368 AC_DEFINE(wxUSE_CHOICE)
4369 USES_CONTROLS=1
4370 fi
4371
4372 if test "$wxUSE_CHECKBOX" = "yes"; then
4373 AC_DEFINE(wxUSE_CHECKBOX)
4374 USES_CONTROLS=1
4375 fi
4376
4377 if test "$wxUSE_CHECKLST" = "yes"; then
4378 AC_DEFINE(wxUSE_CHECKLISTBOX)
4379 USES_CONTROLS=1
4380 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS checklst"
4381 fi
4382
4383 if test "$wxUSE_GAUGE" = "yes"; then
4384 AC_DEFINE(wxUSE_GAUGE)
4385 USES_CONTROLS=1
4386 fi
4387
4388 if test "$wxUSE_NEW_GRID" = "yes"; then
4389 wxUSE_GRID="yes"
4390 AC_DEFINE(wxUSE_NEW_GRID)
4391 USES_CONTROLS=1
4392 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS newgrid"
4393 fi
4394
4395 if test "$wxUSE_GRID" = "yes"; then
4396 AC_DEFINE(wxUSE_GRID)
4397 USES_CONTROLS=1
4398 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS grid"
4399 fi
4400
4401 if test "$wxUSE_IMAGLIST" = "yes"; then
4402 AC_DEFINE(wxUSE_IMAGLIST)
4403 fi
4404
4405 if test "$wxUSE_LISTBOX" = "yes"; then
4406 AC_DEFINE(wxUSE_LISTBOX)
4407 USES_CONTROLS=1
4408 fi
4409
4410 if test "$wxUSE_LISTCTRL" = "yes"; then
4411 if test "$wxUSE_IMAGLIST" = "yes"; then
4412 AC_DEFINE(wxUSE_LISTCTRL)
4413 USES_CONTROLS=1
4414 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS listctrl"
4415 else
4416 AC_MSG_WARN([wxListCtrl requires wxImageList and won't be compiled without it])
4417 fi
4418 fi
4419
4420 if test "$wxUSE_NOTEBOOK" = "yes"; then
4421 AC_DEFINE(wxUSE_NOTEBOOK)
4422 USES_CONTROLS=1
4423 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS notebook"
4424 fi
4425
4426 if test "$wxUSE_PROPSHEET" = "yes"; then
4427 AC_DEFINE(wxUSE_PROPSHEET)
4428 USES_CONTROLS=1
4429 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS proplist"
4430 fi
4431
4432 if test "$wxUSE_RADIOBOX" = "yes"; then
4433 AC_DEFINE(wxUSE_RADIOBOX)
4434 USES_CONTROLS=1
4435 fi
4436
4437 if test "$wxUSE_RADIOBTN" = "yes"; then
4438 AC_DEFINE(wxUSE_RADIOBTN)
4439 USES_CONTROLS=1
4440 fi
4441
4442 if test "$wxUSE_SASH" = "yes"; then
4443 AC_DEFINE(wxUSE_SASH)
4444 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sashtest"
4445 fi
4446
4447 if test "$wxUSE_SCROLLBAR" = "yes"; then
4448 AC_DEFINE(wxUSE_SCROLLBAR)
4449 USES_CONTROLS=1
4450 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS scroll scrollsub"
4451 fi
4452
4453 if test "$wxUSE_SLIDER" = "yes"; then
4454 AC_DEFINE(wxUSE_SLIDER)
4455 USES_CONTROLS=1
4456 fi
4457
4458 if test "$wxUSE_SPINBTN" = "yes"; then
4459 AC_DEFINE(wxUSE_SPINBTN)
4460 USES_CONTROLS=1
4461 fi
4462
4463 if test "$wxUSE_SPINCTRL" = "yes"; then
4464 AC_DEFINE(wxUSE_SPINCTRL)
4465 USES_CONTROLS=1
4466 fi
4467
4468 if test "$wxUSE_SPLITTER" = "yes"; then
4469 AC_DEFINE(wxUSE_SPLITTER)
4470 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splitter"
4471 fi
4472
4473 if test "$wxUSE_STATBMP" = "yes"; then
4474 AC_DEFINE(wxUSE_STATBMP)
4475 USES_CONTROLS=1
4476 fi
4477
4478 if test "$wxUSE_STATBOX" = "yes"; then
4479 AC_DEFINE(wxUSE_STATBOX)
4480 USES_CONTROLS=1
4481 fi
4482
4483 if test "$wxUSE_STATTEXT" = "yes"; then
4484 AC_DEFINE(wxUSE_STATTEXT)
4485 USES_CONTROLS=1
4486 fi
4487
4488 if test "$wxUSE_STATLINE" = "yes"; then
4489 if test "$wxUSE_WINE" = 1 ; then
4490 AC_MSG_WARN([wxStaticLine is not supported under WINE])
4491 else
4492 AC_DEFINE(wxUSE_STATLINE)
4493 USES_CONTROLS=1
4494 fi
4495 fi
4496
4497 if test "$wxUSE_STATUSBAR" = "yes"; then
4498 AC_DEFINE(wxUSE_STATUSBAR)
4499 USES_CONTROLS=1
4500
4501 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS statbar"
4502 fi
4503
4504 if test "$wxUSE_TABDIALOG" = "yes"; then
4505 AC_DEFINE(wxUSE_TAB_DIALOG)
4506 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS tab"
4507 fi
4508
4509 if test "$wxUSE_TEXTCTRL" = "yes"; then
4510 AC_DEFINE(wxUSE_TEXTCTRL)
4511 USES_CONTROLS=1
4512 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS text"
4513 fi
4514
4515 if test "$wxUSE_TOGGLEBTN" = "yes"; then
4516 if test "$wxUSE_MAC" = 1; then
4517 AC_MSG_WARN([Toggle button not yet supported under Mac OS X... disabled])
4518 wxUSE_TOGGLEBTN=no
4519 fi
4520 if test "$wxUSE_UNIVERSAL" = "yes"; then
4521 AC_MSG_WARN([Toggle button not yet supported under wxUniversal... disabled])
4522 wxUSE_TOGGLEBTN=no
4523 fi
4524
4525 if test "$wxUSE_TOGGLEBTN" = "yes"; then
4526 AC_DEFINE(wxUSE_TOGGLEBTN)
4527 USES_CONTROLS=1
4528 fi
4529 fi
4530
4531 if test "$wxUSE_TOOLBAR_SIMPLE" = "yes"; then
4532 AC_DEFINE(wxUSE_TOOLBAR_SIMPLE)
4533 wxUSE_TOOLBAR="yes"
4534 USES_CONTROLS=1
4535 fi
4536
4537 if test "$wxUSE_TOOLBAR" = "yes"; then
4538 AC_DEFINE(wxUSE_TOOLBAR)
4539 USES_CONTROLS=1
4540
4541 dnl if wxUSE_TOOLBAR and !wxUSE_TOOLBAR_SIMPLE => wxUSE_TOOLBAR_NATIVE
4542 if test "$wxUSE_TOOLBAR_SIMPLE" != "yes"; then
4543 wxUSE_TOOLBAR_NATIVE="yes"
4544 fi
4545
4546 if test "$wxUSE_TOOLBAR_NATIVE" = "yes"; then
4547 AC_DEFINE(wxUSE_TOOLBAR_NATIVE)
4548 USES_CONTROLS=1
4549 fi
4550
4551 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS toolbar"
4552 fi
4553
4554 if test "$wxUSE_TOOLTIPS" = "yes"; then
4555 if test "$wxUSE_MOTIF" = 1; then
4556 AC_MSG_WARN([wxTooltip not supported yet under Motif... disabled])
4557 else
4558 if test "$wxUSE_WINE" = 1; then
4559 AC_MSG_WARN([wxTooltip not supported under WINE... disabled])
4560 else
4561 if test "$wxUSE_UNIVERSAL" = "yes"; then
4562 AC_MSG_WARN([wxTooltip not supported yet in wxUniversal... disabled])
4563 else
4564 AC_DEFINE(wxUSE_TOOLTIPS)
4565 fi
4566 fi
4567 fi
4568 fi
4569
4570 if test "$wxUSE_TREECTRL" = "yes"; then
4571 if test "$wxUSE_IMAGLIST" = "yes"; then
4572 AC_DEFINE(wxUSE_TREECTRL)
4573 USES_CONTROLS=1
4574 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treectrl"
4575 else
4576 AC_MSG_WARN([wxTreeCtrl requires wxImageList and won't be compiled without it])
4577 fi
4578 fi
4579
4580 if test "$wxUSE_POPUPWIN" = "yes"; then
4581 if test "$wxUSE_MAC" = 1; then
4582 AC_MSG_WARN([Popup window not yet supported under Mac OS X... disabled])
4583 else
4584 if test "$wxUSE_MOTIF" = 1; then
4585 AC_MSG_WARN([wxPopupWindow not yet supported under Motif... disabled])
4586 else
4587 if test "$wxUSE_PM" = 1; then
4588 AC_MSG_WARN([wxPopupWindow not yet supported under PM... disabled])
4589 else
4590 AC_DEFINE(wxUSE_POPUPWIN)
4591
4592 USES_CONTROLS=1
4593 fi
4594 fi
4595 fi
4596 fi
4597
4598 if test "$wxUSE_TIPWINDOW" = "yes"; then
4599 if test "$wxUSE_PM" = 1; then
4600 AC_MSG_WARN([wxTipWindow not yet supported under PM... disabled])
4601 else
4602 AC_DEFINE(wxUSE_TIPWINDOW)
4603 fi
4604 fi
4605
4606 if test "$USES_CONTROLS" = 1; then
4607 AC_DEFINE(wxUSE_CONTROLS)
4608 fi
4609
4610 dnl ---------------------------------------------------------------------------
4611 dnl misc options
4612 dnl ---------------------------------------------------------------------------
4613
4614 if test "$wxUSE_TREELAYOUT" = "yes"; then
4615 AC_DEFINE(wxUSE_TREELAYOUT)
4616 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treelay"
4617 fi
4618
4619 if test "$wxUSE_DRAGIMAGE" = "yes"; then
4620 AC_DEFINE(wxUSE_DRAGIMAGE)
4621 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dragimag"
4622 fi
4623
4624 if test "$wxUSE_MENUS" = "yes"; then
4625 AC_DEFINE(wxUSE_MENUS)
4626 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS menu"
4627 fi
4628
4629 if test "$wxUSE_METAFILE" = "yes"; then
4630 AC_DEFINE(wxUSE_METAFILE)
4631 fi
4632
4633 if test "$wxUSE_MIMETYPE" = "yes"; then
4634 AC_DEFINE(wxUSE_MIMETYPE)
4635 fi
4636
4637 if test "$wxUSE_SYSTEM_OPTIONS" = "yes"; then
4638 AC_DEFINE(wxUSE_SYSTEM_OPTIONS)
4639 if test "$TOOLKIT" = "MSW"; then
4640 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS taskbar"
4641 fi
4642
4643 fi
4644
4645 if test "$wxUSE_PROTOCOL" = "yes"; then
4646 if test "$wxUSE_SOCKETS" != "yes"; then
4647 AC_MSG_WARN(Protocol classes require sockets... disabled)
4648 wxUSE_PROTOCOL=no
4649 fi
4650
4651 if test "$wxUSE_PROTOCOL" = "yes"; then
4652 AC_DEFINE(wxUSE_PROTOCOL)
4653
4654 if test "$wxUSE_PROTOCOL_HTTP" = "yes"; then
4655 AC_DEFINE(wxUSE_PROTOCOL_HTTP)
4656 fi
4657 if test "$wxUSE_PROTOCOL_FTP" = "yes"; then
4658 AC_DEFINE(wxUSE_PROTOCOL_FTP)
4659 fi
4660 if test "$wxUSE_PROTOCOL_FILE" = "yes"; then
4661 AC_DEFINE(wxUSE_PROTOCOL_FILE)
4662 fi
4663 fi
4664 fi
4665
4666 if test "$wxUSE_URL" = "yes"; then
4667 if test "$wxUSE_PROTOCOL" != "yes"; then
4668 AC_MSG_WARN(wxURL class requires wxProtocol... disabled)
4669 wxUSE_URL=no
4670 fi
4671 if test "$wxUSE_URL" = "yes"; then
4672 AC_DEFINE(wxUSE_URL)
4673 fi
4674 fi
4675
4676 if test "$wxUSE_MINIFRAME" = "yes"; then
4677 AC_DEFINE(wxUSE_MINIFRAME)
4678 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS minifram"
4679 fi
4680
4681 if test "$wxUSE_HTML" = "yes"; then
4682 AC_DEFINE(wxUSE_HTML)
4683 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html"
4684 fi
4685
4686 if test "$wxUSE_VALIDATORS" = "yes"; then
4687 AC_DEFINE(wxUSE_VALIDATORS)
4688 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS validate"
4689 fi
4690
4691 if test "$wxUSE_PALETTE" = "yes" ; then
4692 AC_DEFINE(wxUSE_PALETTE)
4693 fi
4694
4695 if test "$wxUSE_IMAGE" = "yes" ; then
4696 AC_DEFINE(wxUSE_IMAGE)
4697 fi
4698
4699 if test "$wxUSE_GIF" = "yes" ; then
4700 AC_DEFINE(wxUSE_GIF)
4701 fi
4702
4703 if test "$wxUSE_PCX" = "yes" ; then
4704 AC_DEFINE(wxUSE_PCX)
4705 fi
4706
4707 if test "$wxUSE_IFF" = "yes" ; then
4708 AC_DEFINE(wxUSE_IFF)
4709 fi
4710
4711 if test "$wxUSE_PNM" = "yes" ; then
4712 AC_DEFINE(wxUSE_PNM)
4713 fi
4714
4715 if test "$wxUSE_XPM" = "yes" ; then
4716 AC_DEFINE(wxUSE_XPM)
4717 fi
4718
4719 if test "$wxUSE_ICO_CUR" = "yes" ; then
4720 AC_DEFINE(wxUSE_ICO_CUR)
4721 fi
4722
4723 if test "$wxUSE_UNICODE" = "yes" -a "$wxUSE_UNICODE_MSLU" = "yes" ; then
4724 dnl Must be done this late because -lunicows must be before all the other libs
4725 LIBS=" -lunicows $LIBS"
4726 fi
4727
4728 dnl ---------------------------------------------------------------------------
4729 dnl common dialog
4730 dnl ---------------------------------------------------------------------------
4731
4732 if test "$wxUSE_CHOICEDLG" = "yes"; then
4733 AC_DEFINE(wxUSE_CHOICEDLG)
4734 fi
4735
4736 if test "$wxUSE_COLOURDLG" = "yes"; then
4737 AC_DEFINE(wxUSE_COLOURDLG)
4738 fi
4739
4740 if test "$wxUSE_FILEDLG" = "yes"; then
4741 AC_DEFINE(wxUSE_FILEDLG)
4742 fi
4743
4744 if test "$wxUSE_FINDREPLDLG" = "yes"; then
4745 AC_DEFINE(wxUSE_FINDREPLDLG)
4746 fi
4747
4748 if test "$wxUSE_FONTDLG" = "yes"; then
4749 AC_DEFINE(wxUSE_FONTDLG)
4750 fi
4751
4752 if test "$wxUSE_DIRDLG" = "yes"; then
4753 if test "$wxUSE_TREECTRL" != "yes"; then
4754 AC_MSG_WARN(wxDirDialog requires wxTreeCtrl so it won't be compiled without it)
4755 else
4756 AC_DEFINE(wxUSE_DIRDLG)
4757 fi
4758 fi
4759
4760 if test "$wxUSE_MSGDLG" = "yes"; then
4761 AC_DEFINE(wxUSE_MSGDLG)
4762 fi
4763
4764 if test "$wxUSE_NUMBERDLG" = "yes"; then
4765 AC_DEFINE(wxUSE_NUMBERDLG)
4766 fi
4767
4768 if test "$wxUSE_PROGRESSDLG" = "yes"; then
4769 if test "$wxUSE_CONSTRAINTS" != "yes"; then
4770 AC_MSG_WARN(wxProgressDialog requires constraints so it won't be compiled without them)
4771 else
4772 AC_DEFINE(wxUSE_PROGRESSDLG)
4773 fi
4774 fi
4775
4776 if test "$wxUSE_SPLASH" = "yes"; then
4777 AC_DEFINE(wxUSE_SPLASH)
4778 fi
4779
4780 if test "$wxUSE_STARTUP_TIPS" = "yes"; then
4781 if test "$wxUSE_CONSTRAINTS" != "yes"; then
4782 AC_MSG_WARN(Startup tips requires constraints and won't be compiled without them)
4783 else
4784 AC_DEFINE(wxUSE_STARTUP_TIPS)
4785 fi
4786 fi
4787
4788 if test "$wxUSE_TEXTDLG" = "yes"; then
4789 AC_DEFINE(wxUSE_TEXTDLG)
4790 fi
4791
4792 if test "$wxUSE_WIZARDDLG" = "yes"; then
4793 AC_DEFINE(wxUSE_WIZARDDLG)
4794 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS wizard"
4795 fi
4796
4797 dnl ---------------------------------------------------------------------------
4798 dnl get the string with OS info - used by wxGetOsDescription()
4799 dnl ---------------------------------------------------------------------------
4800
4801 if test "$cross_compiling" = "yes"; then
4802 dnl Use best guess from host as we can't use uname when cross compiling
4803 OSINFO="\"$host\""
4804 else
4805 dnl attualy work out OS version
4806 OSINFO=`uname -s -r -m`
4807 OSINFO="\"$OSINFO\""
4808 fi
4809
4810 AC_DEFINE_UNQUOTED(WXWIN_OS_DESCRIPTION, $OSINFO)
4811
4812 dnl ---------------------------------------------------------------------------
4813 dnl define the variable containing the installation prefix (used in dcpsg.cpp)
4814 dnl ---------------------------------------------------------------------------
4815
4816 if test "x$prefix" != "xNONE"; then
4817 wxPREFIX=$prefix
4818 else
4819 wxPREFIX=$ac_default_prefix
4820 fi
4821
4822 AC_DEFINE_UNQUOTED(wxINSTALL_PREFIX, "$wxPREFIX")
4823
4824 dnl ---------------------------------------------------------------------------
4825 dnl Output the makefiles and such from the results found above
4826 dnl ---------------------------------------------------------------------------
4827
4828 dnl all additional libraries (except wxWindows itself) we link with
4829
4830 dnl note that we always link with -lm except for Mac OS X
4831 dnl extended.c uses floor() and is always linked in
4832
4833 if test "$wxUSE_MAC" = 1 ; then
4834 LDFLAGS="$LDFLAGS -framework Carbon -framework System"
4835 fi
4836
4837 dnl FIXME: should this be covered by the conditional above
4838 dnl given the -lm comment there? Or should that comment (and
4839 dnl this one) be removed.. [ 7 Nov 2001 ]
4840
4841 LIBS="$ZLIB_LINK $POSIX4_LINK $INET_LINK $WCHAR_LINK $DL_LINK -lm $LIBS"
4842
4843 if test "$wxUSE_GUI" = "yes"; then
4844
4845 LIBS="$GUI_TK_LIBRARY $PNG_LINK $JPEG_LINK $TIFF_LINK $LIBS"
4846
4847 dnl TODO add checks that these samples will really compile (i.e. all the
4848 dnl library features they need are present)
4849
4850 dnl TODO some samples are never built so far:
4851 dnl ipc, mfc, nativdlg, oleauto, ownerdrw
4852 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS artprov controls dialogs \
4853 drawing dynamic erase event exec font image \
4854 minimal richedit rotate widgets"
4855
4856 dnl this is needed to be able to find AFM files
4857 CPPFLAGS="$CPPFLAGS \$(EXTRADEFS) \$(APPEXTRADEFS)"
4858 else
4859 SAMPLES_SUBDIRS="console"
4860 fi
4861
4862
4863 dnl all -I options we must pass to the compiler
4864 dnl
4865 dnl note that the order is somewhat important, in particular the ZLIB_INCLUDE
4866 dnl and other stuff for the built in libraries should come first to avoid
4867 dnl including the system headers with the same name (it is particularly
4868 dnl important for zlib because XFree 4.2.0 has its own, horribly old and
4869 dnl incompatible, zlib.h) and the wxWindows headers should come first anyhow
4870 INCLUDES="-I\${top_builddir}/lib/wx/include/${TOOLCHAIN_NAME} \
4871 -I\${top_srcdir}/include \
4872 $REGEX_INCLUDE $ZLIB_INCLUDE $PNG_INCLUDE $JPEG_INCLUDE $TIFF_INCLUDE \
4873 $TOOLKIT_INCLUDE"
4874
4875 dnl wxGTK does not need TOOLKIT includes in wx-config
4876 if test "$wxUSE_GTK" = 1; then
4877 WXCONFIG_INCLUDE=
4878 else
4879 WXCONFIG_INCLUDE="$TOOLKIT_INCLUDE"
4880 fi
4881
4882 dnl C/C++ compiler options used to compile wxWindows
4883 if test "$GXX" = yes ; then
4884 dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror"
4885 CXXWARNINGS="-Wall"
4886 dnl should enable this one day...
4887 dnl CXXWARNINGS="-Wall -Werror"
4888
4889 dnl Add this *after* all compile tests, we don't need or want generated
4890 dnl depfiles until actually building the lib
4891 if test "$wxUSE_NO_DEPS" = "no" ; then
4892 CFLAGS="-MMD $CFLAGS"
4893 CXXFLAGS="-MMD $CXXFLAGS"
4894 fi
4895 fi
4896
4897 EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE $INCLUDES"
4898
4899 dnl remove the extra white space from the cc/c++/ld options
4900 CFLAGS=`echo $CFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \\+/ /g'`
4901 CXXFLAGS=`echo $CXXFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \+/ /g'`
4902 LIBS=`echo $LIBS | sed 's/ \+/ /g'`
4903
4904 LDFLAGS="$LDFLAGS $PROFILE"
4905
4906 dnl for convenience, sort the samples in alphabetical order
4907 dnl
4908 dnl FIXME For some mysterious reasons, sometimes the directories are duplicated
4909 dnl in this list - hence uniq. But normally, this shouldn't be needed!
4910 dnl
4911 dnl Unfortunately, there is a bug in OS/2's tr, such that
4912 dnl tr ' ' '\n' introduces DOS-like line breaks, whereas tr '\n' ' '
4913 dnl only removes the Unix-like part of the introduced line break.
4914 SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq | tr '\n' ' '| tr -d '\r'`"
4915
4916 dnl makefile variables
4917 AC_SUBST(LEX_STEM)
4918 AC_SUBST(PATH_IFS)
4919
4920 dnl global options
4921 AC_SUBST(WX_MAJOR_VERSION_NUMBER)
4922 AC_SUBST(WX_MINOR_VERSION_NUMBER)
4923 AC_SUBST(WX_RELEASE_NUMBER)
4924 AC_SUBST(WX_LIBRARY_NAME_STATIC)
4925 AC_SUBST(WX_LIBRARY_NAME_SHARED)
4926 AC_SUBST(WX_LIBRARY_IMPORTLIB)
4927 AC_SUBST(WX_TARGET_LIBRARY)
4928 AC_SUBST(WX_LIBRARY_LINK1)
4929 AC_SUBST(WX_LIBRARY_LINK2)
4930 AC_SUBST(PROGRAM_EXT)
4931
4932 dnl global gl options
4933 AC_SUBST(WX_LIBRARY_NAME_STATIC_GL)
4934 AC_SUBST(WX_LIBRARY_NAME_SHARED_GL)
4935 AC_SUBST(WX_TARGET_LIBRARY_GL)
4936 AC_SUBST(WX_LIBRARY_LINK1_GL)
4937 AC_SUBST(WX_LIBRARY_LINK2_GL)
4938
4939 dnl are we supposed to create the links?
4940 AC_SUBST(WX_ALL)
4941 AC_SUBST(WX_ALL_INSTALLED)
4942
4943 AC_SUBST(SHARED_LD)
4944 AC_SUBST(PIC_FLAG)
4945 AC_SUBST(CODE_GEN_FLAGS)
4946 AC_SUBST(CODE_GEN_FLAGS_CXX)
4947
4948 AC_SUBST(SONAME_FLAGS)
4949 AC_SUBST(SONAME_FLAGS_GL)
4950 AC_SUBST(WX_TARGET_LIBRARY_SONAME)
4951 AC_SUBST(WX_TARGET_LIBRARY_TYPE)
4952
4953 dnl debugging options
4954 AC_SUBST(WXDEBUG_DEFINE)
4955
4956 dnl toolkit options
4957 AC_SUBST(USE_GUI)
4958 AC_SUBST(AFMINSTALL)
4959 AC_SUBST(TOOLKIT)
4960 AC_SUBST(TOOLKIT_DIR)
4961 AC_SUBST(TOOLKIT_VPATH)
4962 AC_SUBST(TOOLCHAIN_NAME)
4963 AC_SUBST(TOOLCHAIN_DEFS)
4964 AC_SUBST(TOOLCHAIN_DLL_DEFS)
4965
4966 dnl wx-config options
4967 AC_SUBST(host_alias)
4968 AC_SUBST(cross_compiling)
4969 AC_SUBST(WXCONFIG_LIBS)
4970 AC_SUBST(WXCONFIG_LIBS_GL)
4971 AC_SUBST(WXCONFIG_LIBS_STATIC)
4972 AC_SUBST(WXCONFIG_LIBS_STATIC_GL)
4973 AC_SUBST(WXCONFIG_INCLUDE)
4974
4975 dnl the list of files to compile/install
4976 AC_SUBST(ALL_OBJECTS)
4977 AC_SUBST(ALL_HEADERS)
4978 AC_SUBST(ALL_SOURCES)
4979
4980 dnl distribution vars
4981 AC_SUBST(GUIDIST)
4982 AC_SUBST(PORT_FILES)
4983 AC_SUBST(DISTDIR)
4984
4985 dnl additional subdirectories where we will build
4986 AC_SUBST(SAMPLES_SUBDIRS)
4987
4988 dnl additional libraries and linker settings
4989 AC_SUBST(LDFLAGS)
4990 AC_SUBST(LDFLAGS_GL)
4991 AC_SUBST(LDFLAGS_EXE)
4992 AC_SUBST(OPENGL_LIBS)
4993 AC_SUBST(DMALLOC_LIBS)
4994 AC_SUBST(EXTRADEFS)
4995
4996 dnl additional resurces settings
4997 AC_SUBST(RESCOMP)
4998 AC_SUBST(RESFLAGS)
4999 AC_SUBST(RESPROGRAMOBJ)
5000 AC_SUBST(WX_RESOURCES_MACOSX_ASCII)
5001 AC_SUBST(WX_RESOURCES_MACOSX_DATA)
5002
5003 dnl additional for Mac OS X
5004 AC_SUBST(DEREZ)
5005 AC_SUBST(MACOSX_BUNDLE)
5006 AC_SUBST(LIBWXMACRES)
5007 AC_SUBST(LIBWXMACRESCOMP)
5008 AC_SUBST(LIBWXMACRESWXCONFIG)
5009
5010 dnl These seem to be missing
5011 AC_SUBST(DLLTOOL)
5012 AC_SUBST(AS)
5013 AC_SUBST(NM)
5014 AC_SUBST(LD)
5015 AC_SUBST(MAKEINFO)
5016 AC_SUBST(INSTALL_LIBRARY)
5017
5018 dnl MAKE_SET will be replaced with "MAKE=..." or nothing if make sets MAKE
5019 dnl itself (this macro is required if SUBDIRS variable is used in Makefile.am
5020 dnl - and we do use it)
5021 AC_PROG_MAKE_SET
5022
5023 dnl move setup.h back if available
5024 if test -f lib/wx/include/${TOOLCHAIN_NAME}/wx/setup.h; then
5025 mv -f lib/wx/include/${TOOLCHAIN_NAME}/wx/setup.h setup.h
5026 fi
5027
5028 AC_CONFIG_HEADER(setup.h:setup.h.in)
5029
5030 dnl we need to pass SAMPLES_SUBDIRS (and some other) to the configure in
5031 dnl samples and the only way to do it is to use the environment (another
5032 dnl idea could have been to use the cache but this wouldn't work when
5033 dnl configure doesn't use cache at all which is the default with autoconf 2.50)
5034 wx_cv_path_samplesubdirs=$SAMPLES_SUBDIRS
5035 wx_cv_if_gnu_make=$IF_GNU_MAKE
5036 wx_cv_path_ifs=$PATH_IFS
5037 wx_cv_program_ext=$PROGRAM_EXT
5038 wx_cv_target_library=$WX_TARGET_LIBRARY
5039 wx_cv_target_library_gl=$WX_TARGET_LIBRARY_GL
5040 wx_cv_target_libtype=$WX_TARGET_LIBRARY_TYPE
5041 export wx_cv_path_samplesubdirs wx_cv_if_gnu_make \
5042 wx_cv_path_ifs wx_cv_program_ext \
5043 wx_cv_target_library wx_cv_target_library_gl wx_cv_target_libtype
5044
5045 AC_CONFIG_SUBDIRS(demos samples utils contrib)
5046
5047 dnl create each of the files in the space separated list from the file.in
5048 dnl (the original file name may be overriden by appending another name after a
5049 dnl colon)
5050 AC_OUTPUT([
5051 wx-config
5052 src/make.env
5053 src/makeprog.env
5054 src/makelib.env
5055 Makefile
5056 ],
5057 [
5058 dnl This test is required to make the following idempotent.
5059 dnl Otherwise running config.status or rerunning configure
5060 dnl would stomp the wx-config link or try to move it onto
5061 dnl itself.
5062 dnl Use -h instead of -L to test for link (GD)
5063 dnl -h is documented as obsolete under Mac OS X but works
5064 dnl -L is obsolete under Solaris8
5065 if test ! -h wx-config; then
5066 chmod +x wx-config
5067 mv wx-config wx${TOOLCHAIN_NAME}-config
5068 ${LN_S} wx${TOOLCHAIN_NAME}-config wx-config
5069 fi
5070
5071 if test ! -d lib; then
5072 mkdir lib
5073 fi
5074 if test ! -d lib/wx; then
5075 mkdir lib/wx
5076 fi
5077 if test ! -d lib/wx/include; then
5078 mkdir lib/wx/include
5079 fi
5080 if test ! -d lib/wx/include/${TOOLCHAIN_NAME}; then
5081 mkdir lib/wx/include/${TOOLCHAIN_NAME}
5082 fi
5083 if test ! -d lib/wx/include/${TOOLCHAIN_NAME}/wx; then
5084 mkdir lib/wx/include/${TOOLCHAIN_NAME}/wx
5085 fi
5086 if test -f setup.h; then
5087 mv -f setup.h lib/wx/include/${TOOLCHAIN_NAME}/wx/setup.h
5088 fi
5089 ],
5090 [
5091 TOOLCHAIN_NAME="${TOOLCHAIN_NAME}"
5092 LN_S="${LN_S}"
5093 ]
5094 )
5095
5096 dnl vi: set et sts=4 sw=4: