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