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