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