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