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