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