]> git.saurik.com Git - wxWidgets.git/blame - configure.in
Unix implementation of wxDialUpManager.
[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`
41 GTK_LIBS=`$GTK_CONFIG --libs`
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>
52#include <stdio.h>
53
54int
55main ()
56{
57 int major, minor, micro;
58
59 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, &micro) != 3) {
60 printf("%s, bad version string\n", "$min_gtk_version");
61 exit(1);
62 }
63
64 if (gtk_minor_version == 1) return FALSE;
65
66 return !((gtk_major_version > major) ||
67 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
68 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
69}
70],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
71 CFLAGS="$ac_save_CFLAGS"
72 LIBS="$ac_save_LIBS"
73 else
74 no_gtk=yes
75 fi
76 if test "x$no_gtk" = x ; then
77 AC_MSG_RESULT(yes)
78 ifelse([$2], , :, [$2])
79 else
80 AC_MSG_RESULT(no)
81 GTK_CFLAGS=""
82 GTK_LIBS=""
83 ifelse([$3], , :, [$3])
84 fi
85 AC_SUBST(GTK_CFLAGS)
86 AC_SUBST(GTK_LIBS)
87])
88
89dnl ===========================================================================
90dnl macros to find the a file in the list of include/lib paths
91dnl ===========================================================================
92
93dnl ---------------------------------------------------------------------------
94dnl call WX_PATH_FIND_INCLUDES(search path, header name), sets ac_find_includes
95dnl to the full name of the file that was found or leaves it empty if not found
96dnl ---------------------------------------------------------------------------
97AC_DEFUN(WX_PATH_FIND_INCLUDES,
98[
99ac_find_includes=
100for ac_dir in $1;
101 do
102 if test -f "$ac_dir/$2"; then
103 ac_find_includes=$ac_dir
104 break
105 fi
106 done
107])
108
109dnl ---------------------------------------------------------------------------
110dnl call WX_PATH_FIND_LIBRARIES(search path, header name), sets ac_find_includes
111dnl to the full name of the file that was found or leaves it empty if not found
112dnl ---------------------------------------------------------------------------
113AC_DEFUN(WX_PATH_FIND_LIBRARIES,
114[
115ac_find_libraries=
116for ac_dir in $1;
117 do
118 for ac_extension in a so sl; do
119 if test -f "$ac_dir/lib$2.$ac_extension"; then
120 ac_find_libraries=$ac_dir
121 break 2
122 fi
123 done
124 done
125])
126
127dnl ---------------------------------------------------------------------------
128dnl Path to include, already defined
129dnl ---------------------------------------------------------------------------
130AC_DEFUN(WX_INCLUDE_PATH_EXIST,
131[
132 ac_path_to_include=$1
133 echo "$2" | grep "\-I$1" > /dev/null
134 result=$?
135 if test $result = 0; then
136 ac_path_to_include=""
137 else
138 ac_path_to_include="-I$1"
139 fi
140])
141
142dnl ---------------------------------------------------------------------------
143dnl Path to link, already defined
144dnl ---------------------------------------------------------------------------
145AC_DEFUN(WX_LINK_PATH_EXIST,
146[
147 echo "$2" | grep "\-L$1" > /dev/null
148 result=$?
149 if test $result = 0; then
150 ac_path_to_link=""
151 else
152 ac_path_to_link="-L$1"
153 fi
154])
155
156dnl ===========================================================================
157dnl C++ features test
158dnl ===========================================================================
159
160dnl ---------------------------------------------------------------------------
161dnl WX_CPP_NEW_HEADERS checks whether the compiler has "new" <iostream> header
162dnl or only the old <iostream.h> one - it may be generally assumed that if
163dnl <iostream> exists, the other "new" headers (without .h) exist too.
164dnl
165dnl call WX_CPP_NEW_HEADERS(actiof-if-true, action-if-false-or-cross-compiling)
166dnl ---------------------------------------------------------------------------
167
168AC_DEFUN(WX_CPP_NEW_HEADERS,
169[
170 if test "$cross_compiling" = "yes"; then
171 ifelse([$2], , :, [$2])
172 else
173 AC_LANG_SAVE
174 AC_LANG_CPLUSPLUS
175
176 AC_CHECK_HEADERS(iostream)
177
178 if test "x$HAVE_IOSTREAM" = x ; then
179 ifelse([$2], , :, [$2])
180 else
181 ifelse([$1], , :, [$1])
182 fi
183
184 AC_LANG_RESTORE
185 fi
186])
187
188dnl ---------------------------------------------------------------------------
189dnl WX_CPP_BOOL checks whether the C++ compiler has a built in bool type
190dnl
191dnl call WX_CPP_BOOL - will define HAVE_BOOL if the compiler supports bool
192dnl ---------------------------------------------------------------------------
193
194AC_DEFUN(WX_CPP_BOOL,
195[
196 AC_CACHE_CHECK([if C++ compiler supports bool], wx_cv_cpp_bool,
197 [
198 AC_LANG_SAVE
199 AC_LANG_CPLUSPLUS
200
3a3eed31
VZ
201 AC_TRY_COMPILE(
202 [
203 ],
204 [
205 bool b = true;
2aa88730 206
3a3eed31 207 return 0;
2aa88730
RR
208 ],
209 [
210 AC_DEFINE(HAVE_BOOL)
211 wx_cv_cpp_bool=yes
212 ],
3a3eed31
VZ
213 [
214 wx_cv_cpp_bool=no
215 ]
2aa88730
RR
216 )
217
218 AC_LANG_RESTORE
219 ])
220
221 if test "$wx_cv_cpp_bool" = "yes"; then
222 AC_DEFINE(HAVE_BOOL)
223 fi
224])
225
226dnl ---------------------------------------------------------------------------
227dnl WX_CPP_SIZE_T_IS_NOT_INT checks whether size_t and int are different types,
228dnl i.e. whether we may overload operator[] on its argument type
229dnl ---------------------------------------------------------------------------
230
231AC_DEFUN(WX_CPP_SIZE_T_IS_NOT_INT,
232[
233 AC_CACHE_CHECK([if size_t and int are different types], wx_cv_cpp_sizet_not_int,
234 [
235 AC_LANG_SAVE
236 AC_LANG_CPLUSPLUS
237
238 AC_TRY_RUN([
239 #include <stdlib.h>
240
241 class S
242 {
243 public:
244 S(char *s) { m_s = s; }
245
246 char operator[](size_t n) const { return m_s[n]; }
247 char operator[](int n) const { return m_s[n]; }
248
249 private:
250 char *m_s;
251 };
252
253 int main()
254 {
255 S s("dummy");
256 size_t n1 = 2;
257 int n2 = 3;
258
259 return s[n1] == s[n2];
260 }
261 ],
262 AC_DEFINE(wxUSE_SIZE_T_STRING_OPERATOR) wx_cv_cpp_sizet_not_int=yes,
263 wx_cv_cpp_sizet_not_int=no,
264 wx_cv_cpp_sizet_not_int=no
265 )
266
267 AC_LANG_RESTORE
268 ])
269])
270
271dnl ---------------------------------------------------------------------------
272dnl a slightly better AC_C_BIGENDIAN macro which allows cross-compiling
273dnl ---------------------------------------------------------------------------
274
275AC_DEFUN(WX_C_BIGENDIAN,
276[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
277[ac_cv_c_bigendian=unknown
278# See if sys/param.h defines the BYTE_ORDER macro.
279AC_TRY_COMPILE([#include <sys/types.h>
280#include <sys/param.h>], [
281#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
282 bogus endian macros
283#endif], [# It does; now see whether it defined to BIG_ENDIAN or not.
284AC_TRY_COMPILE([#include <sys/types.h>
285#include <sys/param.h>], [
286#if BYTE_ORDER != BIG_ENDIAN
287 not big endian
288#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)])
289if test $ac_cv_c_bigendian = unknown; then
290AC_TRY_RUN([main () {
291 /* Are we little or big endian? From Harbison&Steele. */
292 union
293 {
294 long l;
295 char c[sizeof (long)];
296 } u;
297 u.l = 1;
298 exit (u.c[sizeof (long) - 1] == 1);
299}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes, ac_cv_c_bigendian=unknown)
300fi])
301if test $ac_cv_c_bigendian = unknown; then
302 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])
303fi
304if test $ac_cv_c_bigendian = yes; then
305 AC_DEFINE(WORDS_BIGENDIAN)
306fi
307])
308
309dnl ---------------------------------------------------------------------------
310dnl override AC_ARG_ENABLE/WITH to cache the results in .cache file
311dnl ---------------------------------------------------------------------------
312
313AC_DEFUN(WX_ARG_CACHE_INIT,
314 [
315 wx_arg_cache_file="configarg.cache"
316 echo "loading argument cache $wx_arg_cache_file"
317 rm -f ${wx_arg_cache_file}.tmp
318 touch ${wx_arg_cache_file}.tmp
319 touch ${wx_arg_cache_file}
320 ])
321
322AC_DEFUN(WX_ARG_CACHE_FLUSH,
323 [
324 echo "saving argument cache $wx_arg_cache_file"
325 mv ${wx_arg_cache_file}.tmp ${wx_arg_cache_file}
326 ])
327
328dnl this macro checks for a command line argument and caches the result
329dnl usage: WX_ARG_WITH(option, helpmessage, variable-name)
330AC_DEFUN(WX_ARG_WITH,
331 [
332 AC_MSG_CHECKING("for --with-$1")
333 no_cache=0
334 AC_ARG_WITH($1, $2,
335 [
336 if test "$withval" = yes; then
337 ac_cv_use_$1='$3=yes'
338 else
339 ac_cv_use_$1='$3=no'
340 fi
341 ],
342 [
343 LINE=`grep "$3" ${wx_arg_cache_file}`
344 if test "x$LINE" != x ; then
345 eval "DEFAULT_$LINE"
346 else
347 no_cache=1
348 fi
349
350 ac_cv_use_$1='$3='$DEFAULT_$3
351 ])
352
353 eval "$ac_cv_use_$1"
354 if test "$no_cache" != 1; then
355 echo $ac_cv_use_$1 >> ${wx_arg_cache_file}.tmp
356 fi
357
358 if test "$$3" = yes; then
359 AC_MSG_RESULT(yes)
360 else
361 AC_MSG_RESULT(no)
362 fi
363 ])
364
365dnl like WX_ARG_WITH but uses AC_ARG_ENABLE instead of AC_ARG_WITH
366dnl usage: WX_ARG_ENABLE(option, helpmessage, variable-name)
367AC_DEFUN(WX_ARG_ENABLE,
368 [
369 AC_MSG_CHECKING("for --enable-$1")
370 no_cache=0
371 AC_ARG_ENABLE($1, $2,
372 [
373 if test "$enableval" = yes; then
374 ac_cv_use_$1='$3=yes'
375 else
376 ac_cv_use_$1='$3=no'
377 fi
378 ],
379 [
380 LINE=`grep "$3" ${wx_arg_cache_file}`
381 if test "x$LINE" != x ; then
382 eval "DEFAULT_$LINE"
383 else
384 no_cache=1
385 fi
386
387 ac_cv_use_$1='$3='$DEFAULT_$3
388 ])
389
390 eval "$ac_cv_use_$1"
391 if test "$no_cache" != 1; then
392 echo $ac_cv_use_$1 >> ${wx_arg_cache_file}.tmp
393 fi
394
395 if test "$$3" = yes; then
396 AC_MSG_RESULT(yes)
397 else
398 AC_MSG_RESULT(no)
399 fi
400 ])
401
402dnl -
403dnl - GNU libc extension (added by GL)
404dnl -
405
406AC_DEFUN(WX_GNU_EXTENSIONS,
407[
408AC_MSG_CHECKING([if you need GNU extensions])
409AC_CACHE_VAL(wx_cv_gnu_extensions,[
410 AC_TRY_COMPILE([#include <features.h>],[
411
412#ifndef __GNU_LIBRARY__
413 Compile error wanted
414#endif
415
416],
417 [wx_cv_gnu_extensions=yes],
418 [wx_cv_gnu_extensions=no])
419])
420
421AC_MSG_RESULT($wx_cv_gnu_extensions)
422if test "$wx_cv_gnu_extensions" = "yes"; then
423 AC_DEFINE_UNQUOTED(_GNU_SOURCE)
424fi
425])
426
427
9a98a854
VZ
428dnl ---------------------------------------------------------------------------
429dnl initialization
430dnl ---------------------------------------------------------------------------
431
a9b5e89f 432dnl the file passed to AC_INIT should be specific to our package
9a98a854
VZ
433AC_INIT(wx-config.in)
434
214960fb 435AC_CANONICAL_SYSTEM
2b6f061f
RR
436
437dnl When making releases do:
438dnl
439dnl WX_RELEASE_NUMBER += 1
440dnl WX_INTERFACE_AGE += 1
441dnl WX_BINARY_AGE += 1
442dnl
443dnl if any functions have been added, do:
444dnl
0180dad6 445dnl WX_INTERFACE_AGE = 0
9a98a854
VZ
446
447WX_MAJOR_VERSION_NUMBER=2
448WX_MINOR_VERSION_NUMBER=1
449WX_RELEASE_NUMBER=0
450
2b6f061f
RR
451WX_INTERFACE_AGE=0
452WX_BINARY_AGE=0
453
454WX_VERSION=$WX_MAJOR_VERSION_NUMBER.$WX_MINOR_VERSION_NUMBER.$WX_RELEASE_NUMBER
455
2aa88730
RR
456dnl wxWindows shared library versioning
457WX_RELEASE=$WX_MAJOR_VERSION_NUMBER.$WX_MINOR_VERSION_NUMBER
458WX_CURRENT=`expr $WX_RELEASE_NUMBER - $WX_INTERFACE_AGE`
459WX_REVISION=$WX_INTERFACE_AGE
460WX_AGE=`expr $WX_BINARY_AGE - $WX_INTERFACE_AGE`
9a98a854
VZ
461
462dnl ------------------------------------------------------------------------
463dnl Check platform (host system)
464dnl ------------------------------------------------------------------------
465
466dnl assume Unix
467USE_UNIX=1
468USE_LINUX=
469USE_SGI=
470USE_HPUX=
471USE_SYSV=
472USE_SVR4=
473USE_AIX=
474USE_SUN=
475USE_SOLARIS=
476USE_SUNOS=
477USE_ALPHA=
478USE_OSF=
479USE_BSD=
480USE_FREEBSD=
481USE_VMS=
482USE_ULTRIX=
483USE_CYGWIN=
4d19d979 484USE_MINGW=
9a98a854
VZ
485USE_DATA_GENERAL=
486
ced859c3
VZ
487dnl the list of all available toolkits
488ALL_TOOLKITS="CYGWIN GTK MINGW MOTIF WINE"
489
9a98a854
VZ
490dnl NB: these wxUSE_XXX constants have value of 0 or 1 unlike all the other ones
491dnl which are either yes or no
492DEFAULT_wxUSE_GTK=0
493DEFAULT_wxUSE_MOTIF=0
494DEFAULT_wxUSE_MSW=0
5a92d200 495DEFAULT_wxUSE_WINE=0
9a98a854 496
143121c5
VZ
497dnl these are the values which are really default for the given platform -
498dnl they're not cached and are only used if no --with-toolkit was given *and*
499dnl nothing was found in the cache
500DEFAULT_DEFAULT_wxUSE_GTK=0
501DEFAULT_DEFAULT_wxUSE_MOTIF=0
502DEFAULT_DEFAULT_wxUSE_MSW=0
5a92d200 503DEFAULT_DEFAULT_wxUSE_WINE=0
143121c5 504
9a98a854
VZ
505case "${host}" in
506 *-hp-hpux* )
507 USE_HPUX=1
143121c5 508 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854
VZ
509 AC_DEFINE(__HPUX__)
510 ;;
511 *-*-linux* )
512 USE_LINUX=1
513 AC_DEFINE(__LINUX__)
514 TMP=`uname -m`
515 if test "x$TMP" = "xalpha"; then
516 USE_ALPHA=1
517 AC_DEFINE(__ALPHA__)
518 fi
143121c5 519 DEFAULT_DEFAULT_wxUSE_GTK=1
9a98a854
VZ
520 ;;
521 *-*-irix5* | *-*-irix6* )
522 USE_SGI=1
523 USE_SVR4=1
524 AC_DEFINE(__SGI__)
525 AC_DEFINE(__SVR4__)
143121c5 526 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854
VZ
527 ;;
528 *-*-solaris2* )
529 USE_SUN=1
530 USE_SOLARIS=1
531 USE_SVR4=1
532 AC_DEFINE(__SUN__)
533 AC_DEFINE(__SOLARIS__)
534 AC_DEFINE(__SVR4__)
143121c5 535 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854
VZ
536 ;;
537 *-*-sunos4* )
538 USE_SUN=1
539 USE_SUNOS=1
540 USE_BSD=1
541 AC_DEFINE(__SUN__)
542 AC_DEFINE(__SUNOS__)
543 AC_DEFINE(__BSD__)
143121c5 544 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854
VZ
545 ;;
546 *-*-freebsd* | *-*-netbsd*)
547 USE_BSD=1
548 USE_FREEBSD=1
549 AC_DEFINE(__FREEBSD__)
550 AC_DEFINE(__BSD__)
143121c5 551 DEFAULT_DEFAULT_wxUSE_GTK=1
9a98a854
VZ
552 ;;
553 *-*-osf* )
554 USE_ALPHA=1
555 USE_OSF=1
556 AC_DEFINE(__ALPHA__)
557 AC_DEFINE(__OSF__)
143121c5 558 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854
VZ
559 ;;
560 *-*-dgux5* )
561 USE_ALPHA=1
562 USE_SVR4=1
563 AC_DEFINE(__ALPHA__)
564 AC_DEFINE(__SVR4__)
143121c5 565 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854
VZ
566 ;;
567 *-*-sysv5* )
568 USE_SYSV=1
569 USE_SVR4=1
570 AC_DEFINE(__SYSV__)
571 AC_DEFINE(__SVR4__)
143121c5 572 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854
VZ
573 ;;
574 *-*-aix* )
575 USE_AIX=1
576 USE_SYSV=1
577 USE_SVR4=1
578 AC_DEFINE(__AIX__)
579 AC_DEFINE(__SYSV__)
580 AC_DEFINE(__SVR4__)
143121c5 581 DEFAULT_DEFAULT_wxUSE_MOTIF=1
9a98a854 582 ;;
a9b5e89f
VZ
583
584 *-*-cygwin32* )
585 USE_UNIX=0
586 AC_DEFINE(__WIN32__)
587 AC_DEFINE(__WIN95__)
588 AC_DEFINE(__WINDOWS__)
589 AC_DEFINE(__GNUWIN32__)
1db46618 590 AC_DEFINE(STRICT)
4d19d979
HH
591 AC_DEFINE(WINVER, 0x0400)
592 DEFAULT_DEFAULT_wxUSE_MSW=1
593 ;;
594 *-*-mingw32* )
595 USE_UNIX=0
596 AC_DEFINE(__WIN32__)
597 AC_DEFINE(__WIN95__)
598 AC_DEFINE(__WINDOWS__)
599 AC_DEFINE(__GNUWIN32__)
1db46618 600 AC_DEFINE(STRICT)
4d19d979 601 AC_DEFINE(WINVER, 0x0400)
a9b5e89f
VZ
602 DEFAULT_DEFAULT_wxUSE_MSW=1
603 ;;
604
91b8de8d
RR
605 *-pc-os2_emx )
606 AC_DEFINE(__EMX__)
607 ;;
a9b5e89f 608
9a98a854 609 *)
a9b5e89f 610 AC_MSG_ERROR(unknown system type ${host}.)
9a98a854
VZ
611esac
612
613if test "$USE_UNIX" = 1 ; then
614 wxUSE_UNIX=yes
615 AC_DEFINE(__UNIX__)
bcd2b961 616 SRC_SUBDIRS="$SRC_SUBDIRS unix"
ff684c98 617 INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS unix"
9a98a854
VZ
618fi
619
620dnl Linux: test for libc5/glibc2: glibc2 has gettext() included
621if test "$USE_LINUX" = 1; then
622 AC_CHECK_LIB(c,gettext,AC_DEFINE(wxHAVE_GLIBC2))
623fi
624
9a98a854
VZ
625dnl ---------------------------------------------------------------------------
626dnl command line options for configure
627dnl ---------------------------------------------------------------------------
628
629dnl the default values for all options - we collect them all here to simplify
630dnl modification of the default values (for example, if the defaults for some
631dnl platform should be changed, it can be done here too)
632dnl
633dnl NB: see also DEFAULT_wxUSE<toolkit> variables defined above
634
143121c5
VZ
635WX_ARG_CACHE_INIT
636
9a98a854
VZ
637dnl useful to test the compilation with minimum options, define as 0 for normal
638dnl usage
639DEBUG_CONFIGURE=0
640if test $DEBUG_CONFIGURE = 1; then
641 DEFAULT_wxUSE_THREADS=yes
642
2aa88730
RR
643 DEFAULT_wxUSE_SHARED=yes
644 DEFAULT_wxUSE_OPTIMISE=yes
9a98a854 645 DEFAULT_wxUSE_PROFILE=no
5586805b 646 DEFAULT_wxUSE_NO_DEPS=no
f7bdcdd7
RR
647 DEFAULT_wxUSE_NO_RTTI=no
648 DEFAULT_wxUSE_NO_EXCEPTIONS=no
5586805b 649 DEFAULT_wxUSE_PERMISSIVE=no
9a98a854
VZ
650 DEFAULT_wxUSE_DEBUG_FLAG=yes
651 DEFAULT_wxUSE_DEBUG_INFO=yes
652 DEFAULT_wxUSE_DEBUG_GDB=yes
653 DEFAULT_wxUSE_MEM_TRACING=no
143121c5 654 DEFAULT_wxUSE_DEBUG_CONTEXT=no
9a98a854
VZ
655 DEFAULT_wxUSE_DMALLOC=no
656 DEFAULT_wxUSE_APPLE_IEEE=no
657
658 DEFAULT_wxUSE_LOG=yes
659
660 DEFAULT_wxUSE_GUI=yes
661
662 DEFAULT_wxUSE_ZLIB=no
663 DEFAULT_wxUSE_LIBPNG=no
9a98a854
VZ
664 DEFAULT_wxUSE_LIBJPEG=no
665 DEFAULT_wxUSE_ODBC=no
666
fd15d8f1 667 DEFAULT_wxUSE_STD_IOSTREAM=no
9a98a854
VZ
668 DEFAULT_wxUSE_FILE=no
669 DEFAULT_wxUSE_TEXTFILE=no
670 DEFAULT_wxUSE_TIMEDATE=no
2749089a 671 DEFAULT_wxUSE_WAVE=no
9a98a854
VZ
672 DEFAULT_wxUSE_INTL=no
673 DEFAULT_wxUSE_CONFIG=no
674 DEFAULT_wxUSE_STREAMS=no
675 DEFAULT_wxUSE_SOCKETS=no
1c8515f9 676 DEFAULT_wxUSE_DIALUP_MANAGER=no
9a98a854
VZ
677 DEFAULT_wxUSE_SERIAL=no
678 DEFAULT_wxUSE_JOYSTICK=no
679 DEFAULT_wxUSE_DYNLIB_CLASS=no
680 DEFAULT_wxUSE_LONGLONG=no
681
682 DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=no
683 DEFAULT_wxUSE_NORMALIZED_PS_FONTS=no
684 DEFAULT_wxUSE_POSTSCRIPT=no
685
686 DEFAULT_wxUSE_X_RESOURCES=no
687 DEFAULT_wxUSE_CLIPBOARD=no
688 DEFAULT_wxUSE_TOOLTIPS=no
689 DEFAULT_wxUSE_DRAG_AND_DROP=no
690 DEFAULT_wxUSE_SPLINES=no
691
692 DEFAULT_wxUSE_MDI_ARCHITECTURE=no
693 DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=no
694 DEFAULT_wxUSE_PRINTING_ARCHITECTURE=no
695
696 DEFAULT_wxUSE_PROLOGIO=no
697 DEFAULT_wxUSE_RESOURCES=no
698 DEFAULT_wxUSE_CONSTRAINTS=no
699 DEFAULT_wxUSE_IPC=no
700 DEFAULT_wxUSE_HELP=no
701 DEFAULT_wxUSE_WXTREE=no
702 DEFAULT_wxUSE_METAFILE=no
703
704 DEFAULT_wxUSE_COMMONDLGS=no
ce4169a4 705 DEFAULT_wxUSE_DIRDLG=no
c11584af 706 DEFAULT_wxUSE_TEXTDLG=no
a641505f 707 DEFAULT_wxUSE_STARTUP_TIPS=no
ce4169a4 708 DEFAULT_wxUSE_PROGRESSDLG=no
9a98a854 709 DEFAULT_wxUSE_MINIFRAME=no
5526e819 710 DEFAULT_wxUSE_HTML=no
e3e717ec
VZ
711 DEFAULT_wxUSE_FS_INET=no
712 DEFAULT_wxUSE_FS_ZIP=no
d78b3d64
VS
713 DEFAULT_wxUSE_BUSYINFO=no
714 DEFAULT_wxUSE_ZIPSTREAM=no
9a98a854
VZ
715 DEFAULT_wxUSE_VALIDATORS=yes
716
717 DEFAULT_wxUSE_ACCEL=no
718 DEFAULT_wxUSE_CARET=no
719 DEFAULT_wxUSE_BMPBUTTON=no
720 DEFAULT_wxUSE_CHECKBOX=no
721 DEFAULT_wxUSE_CHECKLST=no
40dac23a 722 DEFAULT_wxUSE_CHOICE=yes
9a98a854
VZ
723 DEFAULT_wxUSE_COMBOBOX=no
724 DEFAULT_wxUSE_GAUGE=no
725 DEFAULT_wxUSE_GRID=no
726 DEFAULT_wxUSE_IMAGLIST=no
727 DEFAULT_wxUSE_LISTBOX=no
728 DEFAULT_wxUSE_LISTCTRL=no
729 DEFAULT_wxUSE_NOTEBOOK=no
730 DEFAULT_wxUSE_RADIOBOX=no
731 DEFAULT_wxUSE_RADIOBTN=no
e602002e 732 DEFAULT_wxUSE_SASH=no
9a98a854
VZ
733 DEFAULT_wxUSE_SCROLLBAR=no
734 DEFAULT_wxUSE_SLIDER=no
735 DEFAULT_wxUSE_SPINBTN=no
736 DEFAULT_wxUSE_SPLITTER=no
737 DEFAULT_wxUSE_STATBMP=no
738 DEFAULT_wxUSE_STATBOX=no
739 DEFAULT_wxUSE_STATLINE=no
740 DEFAULT_wxUSE_STATUSBAR=yes
741 DEFAULT_wxUSE_TABDIALOG=no
742 DEFAULT_wxUSE_TOOLBAR=no
743 DEFAULT_wxUSE_TREECTRL=no
744
745 DEFAULT_wxUSE_UNICODE=no
746 DEFAULT_wxUSE_WCSRTOMBS=no
0940bcf7
HH
747
748 DEFAULT_wxUSE_GIF=no
749 DEFAULT_wxUSE_PCX=no
750 DEFAULT_wxUSE_PNM=no
9a98a854
VZ
751else
752 DEFAULT_wxUSE_THREADS=yes
753
2aa88730 754 DEFAULT_wxUSE_SHARED=yes
9a98a854
VZ
755 DEFAULT_wxUSE_OPTIMISE=yes
756 DEFAULT_wxUSE_PROFILE=no
5586805b 757 DEFAULT_wxUSE_NO_DEPS=no
f7bdcdd7
RR
758 DEFAULT_wxUSE_NO_RTTI=no
759 DEFAULT_wxUSE_NO_EXCEPTIONS=no
5586805b 760 DEFAULT_wxUSE_PERMISSIVE=no
9a98a854
VZ
761 DEFAULT_wxUSE_DEBUG_FLAG=no
762 DEFAULT_wxUSE_DEBUG_INFO=no
763 DEFAULT_wxUSE_DEBUG_GDB=no
764 DEFAULT_wxUSE_MEM_TRACING=no
143121c5 765 DEFAULT_wxUSE_DEBUG_CONTEXT=no
9a98a854
VZ
766 DEFAULT_wxUSE_DMALLOC=no
767 DEFAULT_wxUSE_APPLE_IEEE=yes
768
769 DEFAULT_wxUSE_LOG=yes
770
771 DEFAULT_wxUSE_GUI=yes
772
773 DEFAULT_wxUSE_ZLIB=yes
774 DEFAULT_wxUSE_LIBPNG=yes
9a98a854
VZ
775 DEFAULT_wxUSE_LIBJPEG=yes
776 DEFAULT_wxUSE_ODBC=no
777
073478b3 778 DEFAULT_wxUSE_STD_IOSTREAM=no
9a98a854
VZ
779 DEFAULT_wxUSE_FILE=yes
780 DEFAULT_wxUSE_TEXTFILE=yes
781 DEFAULT_wxUSE_TIMEDATE=yes
2749089a 782 DEFAULT_wxUSE_WAVE=no
9a98a854
VZ
783 DEFAULT_wxUSE_INTL=yes
784 DEFAULT_wxUSE_CONFIG=yes
785 DEFAULT_wxUSE_STREAMS=yes
786 DEFAULT_wxUSE_SOCKETS=yes
1c8515f9 787 DEFAULT_wxUSE_DIALUP_MANAGER=yes
9a98a854
VZ
788 DEFAULT_wxUSE_SERIAL=yes
789 DEFAULT_wxUSE_JOYSTICK=yes
790 DEFAULT_wxUSE_DYNLIB_CLASS=yes
791 DEFAULT_wxUSE_LONGLONG=no
792
793 DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=yes
794 DEFAULT_wxUSE_NORMALIZED_PS_FONTS=yes
795 DEFAULT_wxUSE_POSTSCRIPT=yes
796
797 DEFAULT_wxUSE_X_RESOURCES=no
798 DEFAULT_wxUSE_CLIPBOARD=yes
799 DEFAULT_wxUSE_TOOLTIPS=yes
800 DEFAULT_wxUSE_DRAG_AND_DROP=yes
801 DEFAULT_wxUSE_SPLINES=yes
802
803 DEFAULT_wxUSE_MDI_ARCHITECTURE=yes
804 DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=yes
805 DEFAULT_wxUSE_PRINTING_ARCHITECTURE=yes
806
807 DEFAULT_wxUSE_PROLOGIO=yes
808 DEFAULT_wxUSE_RESOURCES=yes
809 DEFAULT_wxUSE_CONSTRAINTS=yes
810 DEFAULT_wxUSE_IPC=yes
811 DEFAULT_wxUSE_HELP=yes
812 DEFAULT_wxUSE_WXTREE=yes
813 DEFAULT_wxUSE_METAFILE=yes
814
815 DEFAULT_wxUSE_COMMONDLGS=yes
ce4169a4 816 DEFAULT_wxUSE_DIRDLG=yes
c11584af 817 DEFAULT_wxUSE_TEXTDLG=yes
a641505f 818 DEFAULT_wxUSE_STARTUP_TIPS=yes
ce4169a4 819 DEFAULT_wxUSE_PROGRESSDLG=yes
9a98a854 820 DEFAULT_wxUSE_MINIFRAME=yes
d4c241b9
RR
821 DEFAULT_wxUSE_HTML=yes
822 DEFAULT_wxUSE_FS_INET=yes
823 DEFAULT_wxUSE_FS_ZIP=yes
824 DEFAULT_wxUSE_BUSYINFO=yes
825 DEFAULT_wxUSE_ZIPSTREAM=yes
9a98a854
VZ
826 DEFAULT_wxUSE_VALIDATORS=yes
827
828 DEFAULT_wxUSE_ACCEL=yes
829 DEFAULT_wxUSE_CARET=yes
830 DEFAULT_wxUSE_BMPBUTTON=yes
831 DEFAULT_wxUSE_CHECKBOX=yes
832 DEFAULT_wxUSE_CHECKLST=yes
ce4169a4 833 DEFAULT_wxUSE_CHOICE=yes
9a98a854
VZ
834 DEFAULT_wxUSE_COMBOBOX=yes
835 DEFAULT_wxUSE_GAUGE=yes
836 DEFAULT_wxUSE_GRID=yes
837 DEFAULT_wxUSE_IMAGLIST=yes
838 DEFAULT_wxUSE_LISTBOX=yes
839 DEFAULT_wxUSE_LISTCTRL=yes
840 DEFAULT_wxUSE_NOTEBOOK=yes
841 DEFAULT_wxUSE_RADIOBOX=yes
842 DEFAULT_wxUSE_RADIOBTN=yes
e602002e 843 DEFAULT_wxUSE_SASH=yes
9a98a854
VZ
844 DEFAULT_wxUSE_SCROLLBAR=yes
845 DEFAULT_wxUSE_SLIDER=yes
846 DEFAULT_wxUSE_SPINBTN=yes
847 DEFAULT_wxUSE_SPLITTER=yes
848 DEFAULT_wxUSE_STATBMP=yes
849 DEFAULT_wxUSE_STATBOX=yes
850 DEFAULT_wxUSE_STATLINE=yes
851 DEFAULT_wxUSE_STATUSBAR=yes
852 DEFAULT_wxUSE_TABDIALOG=no
853 DEFAULT_wxUSE_TOOLBAR=yes
854 DEFAULT_wxUSE_TREECTRL=yes
855
856 DEFAULT_wxUSE_UNICODE=no
857 DEFAULT_wxUSE_WCSRTOMBS=no
0940bcf7
HH
858
859 DEFAULT_wxUSE_GIF=yes
860 DEFAULT_wxUSE_PCX=yes
861 DEFAULT_wxUSE_PNM=yes
9a98a854
VZ
862fi
863
143121c5 864dnl WX_ARG_WITH should be used to select whether an external package will be
9a98a854 865dnl used or not, to configure compile-time features of this package itself,
143121c5 866dnl use WX_ARG_ENABLE instead
9a98a854
VZ
867
868dnl ============================
869dnl external package dependecies
870dnl ============================
871
143121c5
VZ
872dnl these options use AC_ARG_WITH and not WX_ARG_WITH on purpose - we cache
873dnl these values manually
ced859c3 874for toolkit in `echo $ALL_TOOLKITS`; do
143121c5
VZ
875 LINE=`grep "wxUSE_$toolkit" ${wx_arg_cache_file}`
876 if test "x$LINE" != x ; then
877 has_toolkit_in_cache=1
878 eval "DEFAULT_$LINE"
ced859c3 879 eval "CACHE_$toolkit=1"
143121c5
VZ
880 fi
881done
882
ced859c3
VZ
883AC_ARG_WITH(gtk, [ --with-gtk use GTK+], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1])
884AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1])
885AC_ARG_WITH(wine, [ --with-wine use WINE], [wxUSE_WINE="$withval" CACHE_WINE=1 TOOLKIT_GIVEN=1])
886AC_ARG_WITH(cygwin, [ --with-cygwin use Cygwin for MS-Windows], [wxUSE_CYGWIN="$withval" CACHE_CYGWIN=1 TOOLKIT_GIVEN=1])
887AC_ARG_WITH(mingw, [ --with-mingw use GCC Minimal MS-Windows], [wxUSE_MINGW="$withval" CACHE_MINGW=1 TOOLKIT_GIVEN=1])
143121c5 888
a9b5e89f
VZ
889AC_ARG_WITH(gtk-prefix, [ --with-gtk-prefix=PFX Prefix where GTK is installed],
890 gtk_config_prefix="$withval", gtk_config_prefix="")
891AC_ARG_WITH(gtk-exec-prefix, [ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed],
892 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
893
143121c5
VZ
894WX_ARG_WITH(dmalloc, [ --with-dmalloc use dmalloc library (www.letters.com/dmalloc)], wxUSE_DMALLOC)
895WX_ARG_WITH(zlib, [ --with-zlib use zlib for LZW compression], wxUSE_ZLIB)
896WX_ARG_WITH(libpng, [ --with-libpng use libpng (PNG image format)], wxUSE_LIBPNG)
143121c5
VZ
897WX_ARG_WITH(libjpeg, [ --with-libjpeg use libjpeg (JPEG file format)], wxUSE_LIBJPEG)
898WX_ARG_WITH(opengl, [ --with-opengl use OpenGL (or Mesa)], wxUSE_OPENGL)
899WX_ARG_WITH(odbc, [ --with-odbc use the IODBC and wxODBC classes], wxUSE_ODBC)
9a98a854
VZ
900
901dnl ====================
902dnl compile-time options
903dnl ====================
904
905dnl ---------------------------------------------------------------------------
906dnl compile options
907dnl ---------------------------------------------------------------------------
908
2aa88730 909WX_ARG_ENABLE(shared, [ --enable-shared create shared library code], wxUSE_SHARED)
143121c5 910WX_ARG_ENABLE(optimise, [ --enable-optimise create optimised code], wxUSE_OPTIMISE)
143121c5 911WX_ARG_ENABLE(debug, [ --enable-debug same as debug_flag and debug_info], wxUSE_DEBUG)
70d1b3cf
VZ
912
913if test "$wxUSE_DEBUG" = "yes"; then
914 DEFAULT_wxUSE_DEBUG_FLAG=yes
915 DEFAULT_wxUSE_DEBUG_INFO=yes
916elif test "$wxUSE_DEBUG" = "no"; then
917 DEFAULT_wxUSE_DEBUG_FLAG=no
918 DEFAULT_wxUSE_DEBUG_INFO=no
919fi
920
f7bdcdd7
RR
921WX_ARG_ENABLE(debug_flag, [ --enable-debug_flag set __WXDEBUG__ flag (recommended for developers!)], wxUSE_DEBUG_FLAG)
922WX_ARG_ENABLE(debug_info, [ --enable-debug_info create code with debugging information], wxUSE_DEBUG_INFO)
923WX_ARG_ENABLE(debug_gdb, [ --enable-debug_gdb create code with extra GDB debugging information], wxUSE_DEBUG_GDB)
924WX_ARG_ENABLE(debug_cntxt, [ --enable-debug_cntxt use wxDebugContext], wxUSE_DEBUG_CONTEXT)
925WX_ARG_ENABLE(mem_tracing, [ --enable-mem_tracing create code with memory tracing], wxUSE_MEM_TRACING)
926WX_ARG_ENABLE(profile, [ --enable-profile create code with profiling information], wxUSE_PROFILE)
927WX_ARG_ENABLE(no_rtti, [ --enable-no_rtti create code without RTTI information], wxUSE_NO_RTTI)
928WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without exceptions information], wxUSE_NO_EXCEPTIONS)
5586805b
RR
929WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE)
930WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS)
9a98a854
VZ
931
932dnl ---------------------------------------------------------------------------
933dnl --disable-gui will build only non-GUI part of wxWindows
934dnl
935dnl NB: this is still in testing stage, don't use if you don't know what you're
936dnl doing
937dnl ---------------------------------------------------------------------------
938
143121c5 939WX_ARG_ENABLE(gui, [ --enable-gui use GUI classes], wxUSE_GUI)
9a98a854
VZ
940
941dnl ---------------------------------------------------------------------------
942dnl (small) optional non GUI classes
943dnl ---------------------------------------------------------------------------
944
fd15d8f1
RR
945WX_ARG_ENABLE(intl, [ --enable-intl use internationalization system], wxUSE_INTL)
946WX_ARG_ENABLE(config, [ --enable-config use wxConfig (and derived) classes], wxUSE_CONFIG)
947WX_ARG_ENABLE(sockets, [ --enable-sockets use socket/network classes], wxUSE_SOCKETS)
1c8515f9 948WX_ARG_ENABLE(dialupman, [ --enable-dialupman use dialup network classes], wxUSE_DIALUP_MANAGER)
fd15d8f1
RR
949WX_ARG_ENABLE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC)
950WX_ARG_ENABLE(apple_ieee, [ --enable-apple_ieee use the Apple IEEE codec], wxUSE_APPLE_IEEE)
951WX_ARG_ENABLE(timedate, [ --enable-timedate use date/time classes], wxUSE_TIMEDATE)
952WX_ARG_ENABLE(wave, [ --enable-wave use wxWave class], wxUSE_WAVE)
953WX_ARG_ENABLE(fraction, [ --enable-fraction use wxFraction class], wxUSE_FRACTION)
954WX_ARG_ENABLE(dynlib, [ --enable-dynlib use wxLibrary class for DLL loading], wxUSE_DYNLIB_CLASS)
955WX_ARG_ENABLE(longlong, [ --enable-longlong use wxLongLong class], wxUSE_LONGLONG)
956WX_ARG_ENABLE(log, [ --enable-log use logging system], wxUSE_LOG)
957WX_ARG_ENABLE(streams, [ --enable-streams use wxStream etc classes], wxUSE_STREAMS)
958WX_ARG_ENABLE(file, [ --enable-file use wxFile classes], wxUSE_FILE)
959WX_ARG_ENABLE(textfile, [ --enable-textfile use wxTextFile classes], wxUSE_TEXTFILE)
960WX_ARG_ENABLE(unicode, [ --enable-unicode compile wxString with Unicode support], wxUSE_UNICODE)
961WX_ARG_ENABLE(wcsrtombs, [ --enable-wcsrtombs use wcsrtombs instead of buggy (GNU libc1/Linux libc5) wcstombs], wxUSE_WCSRTOMBS)
962WX_ARG_ENABLE(wxprintfv, [ --enable-wxprintfv use wxWindows implementation of vprintf()], wxUSE_EXPERIMENTAL_PRINTF)
963WX_ARG_ENABLE(joystick, [ --enable-joystick compile in joystick support (Linux only)], wxUSE_JOYSTICK)
964WX_ARG_ENABLE(std_iostreams, [ --enable-std_iostreams use standard C++ stream classes], wxUSE_STD_IOSTREAM)
e3e717ec
VZ
965WX_ARG_ENABLE(fs_inet, [ --enable-fs_inet use virtual HTTP/FTP filesystems], wxUSE_FS_INET)
966WX_ARG_ENABLE(fs_zip, [ --enable-fs_zip use virtual ZIP filesystems], wxUSE_FS_ZIP)
d78b3d64 967WX_ARG_ENABLE(zipstream, [ --enable-zipstream use wxZipInputStream], wxUSE_ZIPSTREAM)
9a98a854
VZ
968
969dnl ---------------------------------------------------------------------------
970dnl "big" options (i.e. those which change a lot of things throughout the library)
971dnl ---------------------------------------------------------------------------
972
143121c5
VZ
973WX_ARG_ENABLE(threads, [ --enable-threads use threads], wxUSE_THREADS)
974WX_ARG_ENABLE(serial, [ --enable-serial use class serialization], wxUSE_SERIAL)
9a98a854
VZ
975
976dnl ---------------------------------------------------------------------------
977dnl "big" GUI options
978dnl ---------------------------------------------------------------------------
979
143121c5
VZ
980WX_ARG_ENABLE(docview, [ --enable-docview use document view architecture], wxUSE_DOC_VIEW_ARCHITECTURE)
981WX_ARG_ENABLE(help, [ --enable-help use help (using external browser at present)], wxUSE_HELP)
982WX_ARG_ENABLE(constraints, [ --enable-constraints use layout-constraints system], wxUSE_CONSTRAINTS)
983WX_ARG_ENABLE(printarch, [ --enable-printarch use printing architecture], wxUSE_PRINTING_ARCHITECTURE)
984WX_ARG_ENABLE(mdi, [ --enable-mdi use multiple document interface architecture], wxUSE_MDI_ARCHITECTURE)
9a98a854
VZ
985
986dnl ---------------------------------------------------------------------------
987dnl PostScript options
988dnl ---------------------------------------------------------------------------
143121c5 989WX_ARG_ENABLE(postscript, [ --enable-postscript use wxPostscriptDC device context (default for gtk+)], wxUSE_POSTSCRIPT)
9a98a854
VZ
990
991dnl VZ: these options seem to be always on, if someone wants to change it please do
143121c5
VZ
992dnl WX_ARG_ENABLE(PS-normalized, [ --enable-PS-normalized use normalized PS fonts], dnl wxUSE_NORMALIZED_PS_FONTS)
993dnl WX_ARG_ENABLE(afmfonts, [ --enable-afmfonts use Adobe Font Metric Font table], dnl wxUSE_AFM_FOR_POSTSCRIPT)
9a98a854
VZ
994
995dnl ---------------------------------------------------------------------------
996dnl resources
997dnl ---------------------------------------------------------------------------
143121c5
VZ
998WX_ARG_ENABLE(prologio, [ --enable-prologio use Prolog IO library], wxUSE_PROLOGIO)
999WX_ARG_ENABLE(resources, [ --enable-resources use wxWindows resources], wxUSE_RESOURCES)
1000
1001WX_ARG_ENABLE(xresources, [ --enable-xresources use X resources for save (default for gtk+)], wxUSE_X_RESOURCES)
9a98a854 1002
9a98a854
VZ
1003dnl ---------------------------------------------------------------------------
1004dnl IPC &c
1005dnl ---------------------------------------------------------------------------
9a98a854 1006
143121c5
VZ
1007WX_ARG_ENABLE(clipboard, [ --enable-clipboard use wxClipboard classes], wxUSE_CLIPBOARD)
1008WX_ARG_ENABLE(dnd, [ --enable-dnd use Drag'n'Drop classes], wxUSE_DRAG_AND_DROP)
1009
1010dnl TODO: doesn't work yet
1011WX_ARG_ENABLE(wxtree, [ --enable-wxtree make wxTree library], wxUSE_WXTREE)
9a98a854
VZ
1012
1013dnl ---------------------------------------------------------------------------
1014dnl optional GUI controls (in alphabetical order except the first one)
1015dnl ---------------------------------------------------------------------------
1016
143121c5 1017WX_ARG_ENABLE(controls, [ --enable-controls use all usual controls], wxUSE_CONTROLS)
9a98a854
VZ
1018
1019dnl even with --enable-controls, some may be disabled by giving
1020dnl --disable-<control> later on the command line - but by default all will be
1021dnl used (and vice versa)
1022if test "$wxUSE_CONTROLS" = "yes"; then
1023 DEFAULT_wxUSE_ACCEL=yes
1024 DEFAULT_wxUSE_CARET=yes
1025 DEFAULT_wxUSE_COMBOBOX=yes
1026 DEFAULT_wxUSE_BMPBUTTON=yes
1027 DEFAULT_wxUSE_CHECKBOX=yes
1028 DEFAULT_wxUSE_CHECKLISTBOX=yes
ce4169a4 1029 DEFAULT_wxUSE_CHOICE=yes
9a98a854
VZ
1030 DEFAULT_wxUSE_GAUGE=yes
1031 DEFAULT_wxUSE_GRID=yes
1032 DEFAULT_wxUSE_IMAGLIST=yes
1033 DEFAULT_wxUSE_LISTBOX=yes
1034 DEFAULT_wxUSE_LISTCTRL=yes
1035 DEFAULT_wxUSE_NOTEBOOK=yes
1036 DEFAULT_wxUSE_RADIOBOX=yes
1037 DEFAULT_wxUSE_RADIOBTN=yes
1038 DEFAULT_wxUSE_SASH=yes
1039 DEFAULT_wxUSE_SCROLLBAR=yes
1040 DEFAULT_wxUSE_SLIDER=yes
1041 DEFAULT_wxUSE_SPINBTN=yes
1042 DEFAULT_wxUSE_SPLITTER=yes
1043 DEFAULT_wxUSE_STATBMP=yes
1044 DEFAULT_wxUSE_STATBOX=yes
1045 DEFAULT_wxUSE_STATLINE=yes
1046 DEFAULT_wxUSE_STATUSBAR=yes
1047 DEFAULT_wxUSE_TAB_DIALOG=yes
1048 DEFAULT_wxUSE_TOOLBAR=yes
1049 DEFAULT_wxUSE_TOOLTIPS=yes
1050 DEFAULT_wxUSE_TREECTRL=yes
1051elif test "$wxUSE_CONTROLS" = "no"; then
1052 DEFAULT_wxUSE_ACCEL=no
1053 DEFAULT_wxUSE_CARET=no
1054 DEFAULT_wxUSE_COMBOBOX=no
1055 DEFAULT_wxUSE_BMPBUTTON=no
1056 DEFAULT_wxUSE_CHECKBOX=no
1057 DEFAULT_wxUSE_CHECKLISTBOX=no
ce4169a4 1058 DEFAULT_wxUSE_CHOICE=no
9a98a854
VZ
1059 DEFAULT_wxUSE_GAUGE=no
1060 DEFAULT_wxUSE_GRID=no
1061 DEFAULT_wxUSE_IMAGLIST=no
1062 DEFAULT_wxUSE_LISTBOX=no
1063 DEFAULT_wxUSE_LISTCTRL=no
1064 DEFAULT_wxUSE_NOTEBOOK=no
1065 DEFAULT_wxUSE_RADIOBOX=no
1066 DEFAULT_wxUSE_RADIOBTN=no
1067 DEFAULT_wxUSE_SASH=no
1068 DEFAULT_wxUSE_SCROLLBAR=no
1069 DEFAULT_wxUSE_SLIDER=no
1070 DEFAULT_wxUSE_SPINBTN=no
1071 DEFAULT_wxUSE_SPLITTER=no
1072 DEFAULT_wxUSE_STATBMP=no
1073 DEFAULT_wxUSE_STATBOX=no
1074 DEFAULT_wxUSE_STATLINE=no
1075 DEFAULT_wxUSE_STATUSBAR=no
1076 DEFAULT_wxUSE_TAB_DIALOG=no
1077 DEFAULT_wxUSE_TOOLBAR=no
1078 DEFAULT_wxUSE_TOOLTIPS=no
1079 DEFAULT_wxUSE_TREECTRL=no
1080fi
1081
143121c5
VZ
1082WX_ARG_ENABLE(accel, [ --enable-accel use accelerators], wxUSE_ACCEL)
1083WX_ARG_ENABLE(caret, [ --enable-caret use wxCaret class], wxUSE_CARET)
1084WX_ARG_ENABLE(bmpbutton, [ --enable-bmpbutton use wxBitmapButton class], wxUSE_BMPBUTTON)
1085WX_ARG_ENABLE(checkbox, [ --enable-checkbox use wxCheckBox class], wxUSE_CHECKBOX)
1086WX_ARG_ENABLE(checklst, [ --enable-checklst use wxCheckListBox (listbox with checkboxes) class], wxUSE_CHECKLST)
ce4169a4
RR
1087WX_ARG_ENABLE(choice, [ --enable-choice use wxChoice class], wxUSE_CHOICE)
1088WX_ARG_ENABLE(combobox, [ --enable-combobox use wxComboBox classes], wxUSE_COMBOBOX)
143121c5
VZ
1089WX_ARG_ENABLE(gauge, [ --enable-gauge use wxGauge class], wxUSE_GAUGE)
1090WX_ARG_ENABLE(grid, [ --enable-grid use wxGrid class], wxUSE_GRID)
1091WX_ARG_ENABLE(imaglist, [ --enable-imaglist use wxImageList class], wxUSE_IMAGLIST)
1092WX_ARG_ENABLE(listbox, [ --enable-listbox use wxListBox class], wxUSE_LISTBOX)
1093WX_ARG_ENABLE(listctrl, [ --enable-listctrl use wxListCtrl class], wxUSE_LISTCTRL)
1094WX_ARG_ENABLE(notebook, [ --enable-notebook use wxNotebook class], wxUSE_NOTEBOOK)
1095WX_ARG_ENABLE(radiobox, [ --enable-radiobox use wxRadioBox class], wxUSE_RADIOBOX)
1096WX_ARG_ENABLE(radiobtn, [ --enable-radiobtn use wxRadioButton class], wxUSE_RADIOBTN)
1097WX_ARG_ENABLE(sash, [ --enable-sash use wxSashWindow class], wxUSE_SASH)
1098WX_ARG_ENABLE(scrollbar, [ --enable-scrollbar use wxScrollBar class and scrollable windows], wxUSE_SCROLLBAR)
1099WX_ARG_ENABLE(slider, [ --enable-slider use wxSlider class], wxUSE_SLIDER)
1100WX_ARG_ENABLE(spinbtn, [ --enable-spinbtn use wxSpinButton class], wxUSE_SPINBTN)
1101WX_ARG_ENABLE(splitter, [ --enable-splitter use wxSplitterWindow class], wxUSE_SPLITTER)
1102WX_ARG_ENABLE(statbmp, [ --enable-statbmp use wxStaticBitmap class], wxUSE_STATBMP)
1103WX_ARG_ENABLE(statbox, [ --enable-statbox use wxStaticBox class], wxUSE_STATBOX)
1104WX_ARG_ENABLE(statline, [ --enable-statline use wxStaticLine class], wxUSE_STATLINE)
1105WX_ARG_ENABLE(statusbar, [ --enable-statusbar use wxStatusBar class], wxUSE_STATUSBAR)
1106WX_ARG_ENABLE(tabdialog, [ --enable-tabdialog use wxTabControl class], wxUSE_TABDIALOG)
1107WX_ARG_ENABLE(toolbar, [ --enable-toolbar use wxToolBar class], wxUSE_TOOLBAR)
1108WX_ARG_ENABLE(treectrl, [ --enable-treectrl use wxTreeCtrl class], wxUSE_TREECTRL)
9a98a854
VZ
1109
1110dnl ---------------------------------------------------------------------------
1111dnl misc GUI options
1112dnl ---------------------------------------------------------------------------
1113
143121c5 1114WX_ARG_ENABLE(commondlg, [ --enable-commondlg use common dialogs (wxDirDialog, wxProgressDialog, wxTextDialog, ...)], wxUSE_COMMONDLGS)
ce4169a4 1115WX_ARG_ENABLE(dirdlg, [ --enable-dirdlg use wxDirDialog], wxUSE_DIRDLG)
c11584af 1116WX_ARG_ENABLE(textdlg, [ --enable-textdlg use wxTextDialog], wxUSE_TEXTDLG)
a641505f 1117WX_ARG_ENABLE(tipdlg, [ --enable-tipdlg use startup tips], wxUSE_STARTUP_TIPS)
ce4169a4 1118WX_ARG_ENABLE(progressdlg, [ --enable-progressdlg use wxProgressDialog], wxUSE_PROGRESSDLG)
143121c5 1119WX_ARG_ENABLE(miniframe, [ --enable-miniframe use wxMiniFrame class], wxUSE_MINIFRAME)
5526e819 1120WX_ARG_ENABLE(html, [ --enable-html use wxHTML sub-library], wxUSE_HTML)
143121c5
VZ
1121WX_ARG_ENABLE(tooltips, [ --enable-tooltips use wxToolTip class], wxUSE_TOOLTIPS)
1122WX_ARG_ENABLE(splines, [ --enable-splines use spline drawing code], wxUSE_SPLINES)
1123WX_ARG_ENABLE(validators, [ --enable-validators use wxValidator and derived classes], wxUSE_VALIDATORS)
d78b3d64 1124WX_ARG_ENABLE(busyinfo, [ --enable-busyinfo use wxBusyInfo], wxUSE_BUSYINFO)
143121c5 1125
0940bcf7
HH
1126dnl ---------------------------------------------------------------------------
1127dnl support for image formats that do not rely on external library
1128dnl ---------------------------------------------------------------------------
1129
6b5286d1
HH
1130WX_ARG_ENABLE(gif, [ --enable-gif use gif images (GIF file format)], wxUSE_GIF)
1131WX_ARG_ENABLE(pcx, [ --enable-pcx use pcx images (PCX file format)], wxUSE_PCX)
1132WX_ARG_ENABLE(pnm, [ --enable-pnm use pnm images (PNM file format)], wxUSE_PNM)
0940bcf7 1133
143121c5
VZ
1134dnl cache the options values before (may be) aborting below
1135WX_ARG_CACHE_FLUSH
9a98a854
VZ
1136
1137dnl check that no more than one toolkit is given and that if none are given that
1138dnl we have a default one
efeb0365 1139
143121c5
VZ
1140AC_MSG_CHECKING(for toolkit)
1141
70d1b3cf
VZ
1142if test "$TOOLKIT_GIVEN" = 1; then
1143 dnl convert "yes" to 1 and "no" to 0
ced859c3 1144 for toolkit in `echo $ALL_TOOLKITS`; do
143121c5
VZ
1145 var=wxUSE_$toolkit
1146 eval "value=\$${var}"
1147 eval "$var=`echo \$value | sed -e "s/yes/1/" -e "s/no/0/"`"
1148 done
70d1b3cf
VZ
1149else
1150 dnl try to guess the most apropriate toolkit for this platform
ced859c3 1151 for toolkit in `echo $ALL_TOOLKITS`; do
143121c5
VZ
1152 if test "$has_toolkit_in_cache" != 1; then
1153 var=DEFAULT_DEFAULT_wxUSE_$toolkit
1154 else
1155 var=DEFAULT_wxUSE_$toolkit
1156 fi
1157 eval "wxUSE_$toolkit=\$${var}"
1158 done
70d1b3cf 1159fi
efeb0365 1160
ced859c3
VZ
1161dnl we suppose that expr exists...
1162NUM_TOOLKITS=`expr ${wxUSE_GTK:-0} + ${wxUSE_MOTIF:-0} + ${wxUSE_WINE:-0} + ${wxUSE_MINGW:-0} + ${wxUSE_CYGWIN:-0}`
9a98a854
VZ
1163
1164case "$NUM_TOOLKITS" in
1165 1)
1166 ;;
1167 0)
143121c5 1168 AC_MSG_ERROR(Please specify a toolkit - cannot determine the default for ${host})
9a98a854
VZ
1169 ;;
1170 *)
143121c5 1171 AC_MSG_ERROR(Please specify at most one toolkit (may be some are cached?))
9a98a854
VZ
1172esac
1173
143121c5 1174dnl cache the wxUSE_<TOOLKIT> values too
ced859c3 1175for toolkit in `echo $ALL_TOOLKITS`; do
143121c5
VZ
1176 var=wxUSE_$toolkit
1177 eval "value=\$${var}"
1178 if test "x$value" != x; then
ced859c3
VZ
1179 cache_var=CACHE_$toolkit
1180 eval "cache=\$${cache_var}"
1181 if test "$cache" = 1; then
1182 echo "$var=$value" >> ${wx_arg_cache_file}
1183 fi
143121c5
VZ
1184 if test "$value" = 1; then
1185 AC_MSG_RESULT(`echo $toolkit | tr [[A-Z]] [[a-z]]`)
1186 fi
1187 fi
1188done
1189
9a98a854
VZ
1190dnl ---------------------------------------------------------------------------
1191dnl Checks for programs
1192dnl ---------------------------------------------------------------------------
1193
1194dnl flush the cache because checking for programs might abort
1195AC_CACHE_SAVE
1196
1197dnl cross-compiling support: we're cross compiling if the build system is
1198dnl different from the target one (assume host and target be always the same)
1199if eval "test $host != $build"; then
214960fb 1200 if eval "test $host_alias != NONE"; then
c596875e
RD
1201 CC=$host_alias-gcc
1202 CXX=$host_alias-c++
214960fb
HH
1203 AR=$host_alias-ar
1204 RANLIB=$host_alias-ranlib
c596875e
RD
1205 DLLTOOL=$host_alias-dlltool
1206 LD=$host_alias-ld
214960fb
HH
1207 NM=$host_alias-nm
1208 STRIP=$host_alias-strip
9a98a854
VZ
1209 fi
1210fi
1211
1212dnl C-compiler checks
1213dnl defines CC with the compiler to use
1214dnl defines GCC with yes if using gcc
1215dnl defines GCC empty if not using gcc
1216dnl defines CFLAGS
1217AC_PROG_CC
1218
1219CFLAGS=`echo "$CFLAGS" | sed 's/-g//g'`
1220
1221dnl what is the c-preprocessor
1222dnl defines CPP with the c-preprocessor
1223AC_PROG_CPP
1224
1225dnl is -traditional needed for correct compilations
1226dnl adds -traditional for gcc if needed
1227AC_PROG_GCC_TRADITIONAL
1228
1229AC_LANG_SAVE
1230AC_LANG_CPLUSPLUS
1231
1232dnl C++-compiler checks
1233dnl defines CXX with the compiler to use
1234dnl defines GXX with yes if using gxx
1235dnl defines GXX empty if not using gxx
1236dnl defines CXXFLAGS
1237AC_PROG_CXX
1238
1239dnl what is the C++-preprocessor
1240dnl defines CXXCPP with the C++-preprocessor
1241AC_PROG_CXXCPP
1242
1243CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-g//g'`
1244
1245AC_LANG_RESTORE
1246
1247dnl ranlib command
1248dnl defines RANLIB with the appropriate command
1249AC_PROG_RANLIB
1250
1251dnl ar command
1252dnl defines AR with the appropriate command
1253AC_CHECK_PROG(AR, ar, ar, ar)
1254
1255dnl install checks
1256dnl defines INSTALL with the appropriate command
1257AC_PROG_INSTALL
1258
9a98a854
VZ
1259dnl strip command
1260dnl defines STRIP as strip or nothing if not found
1261AC_CHECK_PROG(STRIP, strip, strip, true)
1262
1263dnl check if VPATH works
1264AC_MSG_CHECKING("make for VPATH support")
1265dnl create Makefile
1266cat - << EOF > confMake
1267check : file
1268 cp \$? \$@
1269 cp \$? final_file
1270EOF
1271
1272if test ! -d sub ; then
1273 mkdir sub
1274fi
1275echo dummy > sub/file
1276${MAKE-make} -f confMake VPATH=sub 2> config.log > /dev/null
1277RESULT=$?
1278rm -f sub/file check final_file confMake
1279rmdir sub
1280if test "$RESULT" = 0; then
1281 AC_MSG_RESULT(yes)
1282else
1283 AC_MSG_RESULT(no)
1284 AC_MSG_ERROR(
1285You need a make-utility that is able to use the variable
1286VPATH correctly.
1287If your version of make does not support VPATH correctly,
1288please install GNU-make (possibly as gmake), and start
1289configure with the following command:
1290export MAKE=gmake; ./configure for sh-type shells
1291setenv MAKE gmake; ./configure for csh-type shells
1292Also please do remember to use gmake in this case every time
1293you are trying to compile.
1294)
1295fi
1296
1297dnl YACC checks
1298dnl defines YACC with the appropriate command
1299AC_PROG_YACC
1300
1301dnl LEX checks
1302dnl defines LEX with the appropriate command
1303dnl defines LEXLIB with the appropriate library
2aa88730 1304AC_PROG_LEX
9a98a854 1305
c7114f59
VZ
1306dnl needed for making link to setup.h
1307AC_PROG_LN_S
1308
9a98a854
VZ
1309dnl ---------------------------------------------------------------------------
1310dnl Define search path for includes and libraries: all headers and libs will be
1311dnl looked for in all directories of this path
1312dnl ---------------------------------------------------------------------------
1313
1314SEARCH_INCLUDE="\
1315 /usr/Motif-1.2/include \
1316 /usr/Motif-2.1/include \
1317 \
1318 /usr/include/Motif1.2 \
1319 /opt/xpm/include/X11 \
8636aed8
RR
1320 /opt/GBxpm/include/ \
1321 /opt/GBxpm/X11/include/ \
9a98a854
VZ
1322 \
1323 /usr/Motif1.2/include \
1324 /usr/dt/include \
1325 /usr/include/Xm \
1326 \
1327 /usr/X11R6/include \
1328 /usr/X11R5/include \
1329 /usr/X11R4/include \
1330 \
1331 /usr/X11R6/lib \
1332 /usr/X11R5/lib \
1333 /usr/X11R4/lib \
1334 \
1335 /usr/include/X11R6 \
1336 /usr/include/X11R5 \
1337 /usr/include/X11R4 \
1338 \
1339 /usr/local/X11R6/include \
1340 /usr/local/X11R5/include \
1341 /usr/local/X11R4/include \
1342 \
1343 /usr/local/include/X11R6 \
1344 /usr/local/include/X11R5 \
1345 /usr/local/include/X11R4 \
1346 \
1347 /usr/X11/include \
1348 /usr/include/X11 \
1349 /usr/local/X11/include \
1350 /usr/local/include/X11 \
1351 \
1352 /usr/X386/include \
1353 /usr/x386/include \
1354 /usr/XFree86/include/X11 \
1355 \
1356 /usr/include \
5a92d200
RR
1357 /usr/local/include \
1358 \
9a98a854 1359 /usr/include/gtk \
5a92d200 1360 /usr/local/include/gtk \
9a98a854 1361 /usr/include/glib \
5a92d200
RR
1362 /usr/local/include/glib \
1363 \
1364 /usr/include/qt \
1365 /usr/local/include/qt \
1366 \
a9b5e89f 1367 /usr/include/windows \
5a92d200
RR
1368 /usr/include/wine \
1369 /usr/local/include/wine \
1370 \
9a98a854
VZ
1371 /usr/unsupported/include \
1372 /usr/athena/include \
1373 /usr/local/x11r5/include \
1374 /usr/lpp/Xamples/include \
1375 \
9a98a854
VZ
1376 /usr/openwin/include \
1377 /usr/openwin/share/include \
1378 "
1379
1380SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s/include/lib/g` "
1381
1382dnl ------------------------------------------------------------------------
1383dnl Check for libraries
1384dnl ------------------------------------------------------------------------
1385
143121c5 1386dnl flush the cache because checking for libraries below might abort
9a98a854
VZ
1387AC_CACHE_SAVE
1388
9a98a854
VZ
1389dnl ----------------------------------------------------------------
1390dnl search for toolkit (widget sets)
1391dnl ----------------------------------------------------------------
1392
1393TOOLKIT=
9a98a854
VZ
1394TOOLKIT_INCLUDE=
1395
073478b3
RR
1396GUIOBJS=
1397COMMONOBJS=
1398GENERICOBJS=
1399
9a98a854
VZ
1400GUI_TK_LIBRARY=
1401GUI_TK_LINK=
1402
1403WXGTK12=
1404
5a92d200
RR
1405WXWINE=
1406
80d895cd 1407dnl Extension for programs; '.exe' for msw builds
c596875e 1408PROGRAM_EXT=
80d895cd 1409
4d19d979 1410if test "$wxUSE_CYGWIN" = 1 || test "$wxUSE_MINGW" = 1 ; then
3e0de8a5
HH
1411 if test "$cross_compiling" = "yes" ; then
1412 AC_MSG_WARN(Cross compiling --- skipping windows.h check)
e4b4d60e 1413 else
3e0de8a5
HH
1414 AC_MSG_CHECKING(for Windows headers)
1415 WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, windows.h)
1416 if test "$ac_find_includes" != "" ; then
1417 AC_MSG_RESULT(found $ac_find_includes)
1418 TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE -I$ac_find_includes"
1419 else
1420 AC_MSG_RESULT(no)
e4b4d60e 1421 AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
c596875e 1422 fi
e4b4d60e 1423 fi
c596875e 1424
3e0de8a5
HH
1425 INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS msw"
1426 dnl --- Quick & Dirty ; link against most/all libraries
1427 dnl --- This will bloat the executable, but it'll work for now...
1428 LIBS="$LIBS -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -lcrtdll -ladvapi32 -lwsock32"
a9b5e89f 1429
e4b4d60e 1430 TOOLKIT=MSW
c596875e 1431
e4b4d60e 1432 GUIOBJS=MSW_GUIOBJS
a4aad961 1433 GUIHEADERS=MSW_HEADERS
e4b4d60e
RR
1434 COMMONOBJS=MSW_COMMONOBJS
1435 GENERICOBJS=MSW_GENERICOBJS
1436 UNIXOBJS=
a4aad961 1437 GUIDIST=MSW_DIST
80d895cd 1438 PROGRAM_EXT=.exe
a9b5e89f
VZ
1439fi
1440
9a98a854 1441if test "$wxUSE_GTK" = 1; then
073478b3
RR
1442 dnl avoid calling AM_PATH_GTK twice, so check first for the newer version and
1443 dnl only then, if it wasn't found, for an older one
1444 AM_PATH_GTK(1.2.0, WXGTK12=1)
1445 if test "$WXGTK12" != 1; then
1446 AM_PATH_GTK(1.0.0, , AC_MSG_ERROR(Is gtk-config in path and GTK+ is version 1.2.X or 1.0.X?))
1447 fi
9a98a854 1448
073478b3 1449 TOOLKIT_INCLUDE="$GTK_CFLAGS"
fd9811b1 1450 GUI_TK_LIBRARY="$GTK_LIBS -ldl"
073478b3 1451 TOOLKIT=GTK
c596875e 1452
2aa88730 1453 GUIHEADERS=GTK_HEADERS
5586805b 1454 GUIOBJS=GTK_GUIOBJS
073478b3
RR
1455 COMMONOBJS=GTK_COMMONOBJS
1456 GENERICOBJS=GTK_GENERICOBJS
5586805b
RR
1457 GUIDEPS=GTK_GUIDEPS
1458 COMMONDEPS=GTK_COMMONDEPS
1459 GENERICDEPS=GTK_GENERICDEPS
e4b4d60e 1460 UNIXOBJS=UNIXOBJS
a4aad961 1461 GUIDIST=GTK_DIST
9a98a854
VZ
1462fi
1463
5a92d200
RR
1464if test "$wxUSE_WINE" = 1; then
1465 AC_MSG_CHECKING(for WINE includes)
1466 WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, windows.h)
1467 if test "$ac_find_includes" != "" ; then
1468 AC_MSG_RESULT(found $ac_find_includes)
d1c7e624 1469 TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE -I$ac_find_includes"
5a92d200
RR
1470 else
1471 AC_MSG_RESULT(no)
1472 AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
1473 fi
1474
1475 XPM_LINK=""
1476 AC_MSG_CHECKING(for Xpm library)
1477 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
1478 if test "$ac_find_libraries" != "" ; then
4286a5b5
RR
1479 GUI_TK_LIBRARY="-L$ac_find_libraries"
1480 XPM_LINK="-lXpm"
5a92d200
RR
1481 AC_DEFINE(wxHAVE_LIB_XPM)
1482 AC_MSG_RESULT(found at $ac_find_libraries)
1483 else
1484 AC_MSG_RESULT(no)
1485 AC_MSG_WARN(library will be compiled without support for images in XPM format)
1486 fi
c596875e 1487
4286a5b5
RR
1488 MESA_LINK=""
1489 AC_MSG_CHECKING(for Mesa library)
1490 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,MesaGL)
1491 if test "$ac_find_libraries" != "" ; then
1492 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -L$ac_find_libraries"
1493 MESA_LINK="-lMesaGL"
1494 AC_MSG_RESULT(found at $ac_find_libraries)
1495 else
1496 AC_MSG_ERROR(no)
1497 fi
5a92d200 1498
4286a5b5 1499 GUI_TK_LINK="-lwine $MESA_LINK $XPM_LINK -lXxf86dga -lXxf86vm -lSM -lICE -lXext -lXmu -lX11 -lncurses -ldl -lm"
5a92d200
RR
1500 GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GUI_TK_LINK"
1501 WXWINE=1
1502 TOOLKIT=MSW
c596875e 1503
a4aad961 1504 GUIHEADERS=MSW_HEADERS
5586805b 1505 GUIOBJS=MSW_GUIOBJS
e4b4d60e
RR
1506 COMMONOBJS=MSW_COMMONOBJS
1507 GENERICOBJS=MSW_GENERICOBJS
5586805b
RR
1508 GUIDEPS=MSW_GUIDEPS
1509 COMMONDEPS=MSW_COMMONDEPS
1510 GENERICDEPS=MSW_GENERICDEPS
e4b4d60e 1511 UNIXOBJS=UNIXOBJS
a4aad961 1512 GUIDIST=MSW_DIST
5a92d200
RR
1513fi
1514
9a98a854 1515if test "$wxUSE_MOTIF" = 1; then
143121c5
VZ
1516 dnl find the X11 include and library files
1517 dnl defines x_includes and x_libraries
1518 AC_PATH_XTRA
1519
1520 if test "$no_x" = "yes"; then
1521 AC_MSG_ERROR(X11 libraries not found, aborting)
1522 fi
1523
1524 TOOLKIT_INCLUDE="$X_CFLAGS"
1525 GUI_TK_LIBRARY="$X_LIBS"
1526
9a98a854 1527 AC_MSG_CHECKING(for Motif/Lesstif includes)
143121c5 1528 WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h)
9a98a854
VZ
1529 if test "$ac_find_includes" != "" ; then
1530 AC_MSG_RESULT(found $ac_find_includes)
1531 else
1532 AC_MSG_RESULT(no)
1533 AC_MSG_ERROR(please set CFLAGS to contain the location of Xm/Xm.h)
1534 fi
1535
1536 AC_MSG_CHECKING(for Motif/Lesstif library)
143121c5 1537 WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm)
9a98a854 1538 if test "$ac_find_libraries" != "" ; then
143121c5
VZ
1539 WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE)
1540 WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY)
9a98a854 1541
143121c5
VZ
1542 CHECK_LINK="$GUI_TK_LIBRARY $ac_path_to_link"
1543 TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE $ac_path_to_include"
9a98a854
VZ
1544 AC_MSG_RESULT(found at $ac_find_libraries)
1545 else
1546 AC_MSG_RESULT(no)
1547 AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm)
1548 fi
1549
1550 AC_MSG_CHECKING(for Xt library)
143121c5 1551 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xt)
9a98a854 1552 if test "$ac_find_libraries" != "" ; then
143121c5
VZ
1553 WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
1554 CHECK_LINK="$GUI_TK_LIBRARY $ac_path_to_link"
9a98a854
VZ
1555 AC_MSG_RESULT(found at $ac_find_libraries)
1556 else
1557 AC_MSG_RESULT(no)
1558 AC_MSG_ERROR(please set LDFLAGS to contain the location of libXt)
1559 fi
1560
1561 XPM_LINK=""
1562 AC_MSG_CHECKING(for Xpm library)
143121c5 1563 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
9a98a854 1564 if test "$ac_find_libraries" != "" ; then
143121c5
VZ
1565 WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
1566 CHECK_LINK="$GUI_TK_LIBRARY $ac_path_to_link"
9a98a854
VZ
1567 XPM_LINK="-lXpm "
1568 AC_DEFINE(wxHAVE_LIB_XPM)
1569 AC_MSG_RESULT(found at $ac_find_libraries)
1570 else
1571 AC_MSG_RESULT(no)
1572 AC_MSG_WARN(library will be compiled without support for images in XPM format)
1573 fi
1574
96f201da 1575 GUI_TK_LINK="-lXm $XPM_LINK -lXmu -lXt -lX11 -ldl -lm"
143121c5 1576 GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GUI_TK_LINK"
9a98a854 1577 TOOLKIT=MOTIF
c596875e 1578
2aa88730 1579 GUIHEADERS=MOTIF_HEADERS
5586805b 1580 GUIOBJS=MOTIF_GUIOBJS
073478b3
RR
1581 COMMONOBJS=MOTIF_COMMONOBJS
1582 GENERICOBJS=MOTIF_GENERICOBJS
5586805b
RR
1583 GUIDEPS=MOTIF_GUIDEPS
1584 COMMONDEPS=MOTIF_COMMONDEPS
1585 GENERICDEPS=MOTIF_GENERICDEPS
e4b4d60e 1586 UNIXOBJS=UNIXOBJS
a4aad961 1587 GUIDIST=MOTIF_DIST
9a98a854
VZ
1588fi
1589
1590dnl the name of the directory where the files for this toolkit live
1591TOOLKIT_DIR=`echo ${TOOLKIT} | tr "A-Z" "a-z"`
1592
1593dnl the symbol which allows conditional compilation for the given toolkit
48b1d0ff 1594TOOLKIT_DEF="-D__WX${TOOLKIT}__"
9a98a854 1595
517a619d
RR
1596dnl the name of the (libtool) library
1597WX_LIBRARY="wx_${TOOLKIT_DIR}"
1598
70d1b3cf 1599dnl the name of the (libtool) library
2b6f061f
RR
1600WX_LIBRARY_NAME="libwx_${TOOLKIT_DIR}.la"
1601
8e877c19
RR
1602dnl the name of the static library
1603WX_LIBRARY_NAME_STATIC="libwx_${TOOLKIT_DIR}.a"
1604
48b1d0ff 1605dnl the name of the shared library
2aa88730 1606WX_LIBRARY_NAME_SHARED="libwx_${TOOLKIT_DIR}-${WX_RELEASE}.so.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}"
48b1d0ff 1607
48b1d0ff 1608dnl the name of the links to the shared library
2aa88730
RR
1609WX_LIBRARY_LINK1="libwx_${TOOLKIT_DIR}-${WX_RELEASE}.so.${WX_CURRENT}"
1610WX_LIBRARY_LINK2="libwx_${TOOLKIT_DIR}-${WX_RELEASE}.so"
48b1d0ff
RR
1611WX_LIBRARY_LINK3="libwx_${TOOLKIT_DIR}.so"
1612
1613dnl shared library settings
1614SHARED_LD=
1615PIC_FLAG=
1616WX_CREATE_LINKS=
1617
517a619d
RR
1618if test "$wxUSE_SHARED" = "yes"; then
1619 dnl set target to shared
1620 WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_SHARED}"
1621
48b1d0ff
RR
1622case "${host}" in
1623 *-hp-hpux* )
1624 WX_LIBRARY_NAME_SHARED="libwx_${TOOLKIT_DIR}.sl"
1625 SHARED_LD="${CXX} -b -o"
1626 PIC_FLAG="+Z"
1627 ;;
1628 *-*-linux* )
1629 SHARED_LD="${CC} -shared -o"
1630 PIC_FLAG="-fPIC"
517a619d 1631 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1632 WX_CREATE_LINKS="CREATE_LINKS"
1633 ;;
1634 *-*-irix5* | *-*-irix6* )
9c884972
RR
1635 if test "$GCC" = yes ; then
1636 SHARED_LD="${CC} -shared -o"
1637 PIC_FLAG="-fPIC"
1638 else
1639 SHARED_LD="${CXX} -shared -o"
1640 fi
517a619d 1641 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1642 WX_CREATE_LINKS="CREATE_LINKS"
1643 ;;
1644 *-*-solaris2* )
9c884972
RR
1645 if test "$GCC" = yes ; then
1646 SHARED_LD="${CC} -shared -o"
1647 PIC_FLAG="-fPIC"
1648 else
1649 SHARED_LD="${CXX} -G -o"
1650 PIC_FLAG="PIC"
1651 fi
517a619d 1652 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1653 WX_CREATE_LINKS="CREATE_LINKS"
1654 ;;
1655 *-*-sunos4* )
9c884972 1656 SHARED_LD="${CC} -shared -o"
48b1d0ff 1657 PIC_FLAG="-fPIC"
517a619d 1658 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1659 WX_CREATE_LINKS="CREATE_LINKS"
1660 ;;
1661 *-*-freebsd* | *-*-netbsd*)
9c884972 1662 SHARED_LD="${CC} -shared -o"
48b1d0ff 1663 PIC_FLAG="-fPIC"
517a619d 1664 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1665 WX_CREATE_LINKS="CREATE_LINKS"
1666 ;;
1667 *-*-osf* )
1668 SHARED_LD="${CXX} -shared -o"
1669 PIC_FLAG="-fPIC"
517a619d 1670 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1671 WX_CREATE_LINKS="CREATE_LINKS"
1672 ;;
1673 *-*-dgux5* )
1674 SHARED_LD="${CXX} -shared -o"
1675 PIC_FLAG="-fPIC"
517a619d 1676 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1677 WX_CREATE_LINKS="CREATE_LINKS"
1678 ;;
1679 *-*-sysv5* )
9c884972 1680 SHARED_LD="${CC} -shared -o"
48b1d0ff 1681 PIC_FLAG="-fPIC"
517a619d 1682 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1683 WX_CREATE_LINKS="CREATE_LINKS"
1684 ;;
1685 *-*-aix* )
1686 SHARED_LD="/usr/lpp/xlC/bin/makeC++SharedLib -p 0 -o"
1687 ;;
1688 *-*-cygwin32* )
e4b4d60e
RR
1689 dnl only static for now
1690 WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}"
48b1d0ff
RR
1691 ;;
1692 *-*-mingw32* )
e4b4d60e
RR
1693 dnl only static for now
1694 WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}"
48b1d0ff
RR
1695 ;;
1696 *-pc-os2_emx )
1697 ;;
1698 *)
1699 AC_MSG_ERROR(unknown system type ${host}.)
1700esac
9a98a854 1701
517a619d
RR
1702else
1703 dnl set target to static
1704 WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}"
1705fi
1706
9a98a854
VZ
1707dnl ------------------------------------------------------------------------
1708dnl Check for headers
1709dnl ------------------------------------------------------------------------
1710
1711dnl defines HAVE_STRINGS_H (where some string functions live on AIX for example)
1712AC_CHECK_HEADERS(strings.h)
1713dnl defines HAVE_UNISTD_H
1714AC_CHECK_HEADERS(unistd.h)
1715dnl defines HAVE_WCHAR_H
1716AC_CHECK_HEADERS(wchar.h)
1717dnl defines HAVE_WCSTR_H
1718AC_CHECK_HEADERS(wcstr.h)
1719dnl defines HAVE_FNMATCH_H
1720AC_CHECK_HEADERS(fnmatch.h)
2b6f061f 1721dnl defines HAVE_X11_XKBLIB_H
27933891 1722AC_CHECK_HEADERS(X11/XKBlib.h)
9a98a854
VZ
1723
1724dnl ---------------------------------------------------------------------------
1725dnl Checks for typedefs
1726dnl ---------------------------------------------------------------------------
1727
1728dnl defines mode_t if not already defined
1729AC_TYPE_MODE_T
1730dnl defines off_t if not already defined
1731AC_TYPE_OFF_T
1732dnl defines pid_t if not already defined
1733AC_TYPE_PID_T
1734dnl defines size_t if not already defined
1735AC_TYPE_SIZE_T
1736dnl defines uid_t and gid_t if not already defined
1737AC_TYPE_UID_T
1738
1739dnl ---------------------------------------------------------------------------
1740dnl Checks for structures
1741dnl ---------------------------------------------------------------------------
1742
1743dnl ---------------------------------------------------------------------------
1744dnl Checks for compiler characteristics
1745dnl ---------------------------------------------------------------------------
1746
1747dnl defines const to be empty if c-compiler does not support const fully
1748AC_C_CONST
1749dnl defines inline to a sensible value for the c-compiler
1750AC_C_INLINE
1751
1752dnl check the sizes of integral types (give some reasonable default values for
1753dnl cross-compiling)
1754dnl defines the size of certain types of variables in SIZEOF_<TYPE>
d716d967
RR
1755AC_CHECK_SIZEOF(char, 1)
1756AC_CHECK_SIZEOF(short, 2)
9a98a854
VZ
1757AC_CHECK_SIZEOF(int *, 4)
1758AC_CHECK_SIZEOF(int, 4)
1759AC_CHECK_SIZEOF(long, 4)
1760AC_CHECK_SIZEOF(long long, 0)
1761
bcd2b961
VZ
1762dnl for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling)
1763WX_C_BIGENDIAN
239bca2e 1764
9a98a854
VZ
1765dnl check for iostream (as opposed to iostream.h) standard header
1766WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH))
1767
1768dnl check whether C++ compiler supports bool built-in type
1769WX_CPP_BOOL
1770
1771dnl check whether overloading on size_t/int parameter works
1772WX_CPP_SIZE_T_IS_NOT_INT
1773
60b6c062
GL
1774dnl check whether we should define _GNU_SOURCE
1775WX_GNU_EXTENSIONS
1776
9a98a854
VZ
1777dnl ---------------------------------------------------------------------------
1778dnl Check for functions
1779dnl ---------------------------------------------------------------------------
1780
1781dnl check for wcslen
1782AC_CHECK_LIB(c, wcslen, [
1783 AC_DEFINE(HAVE_WCSLEN)
1784 WCHAR_LINK=""
1785 ], [
1786 AC_CHECK_LIB(w, wcslen, [
1787 AC_DEFINE(HAVE_WCSLEN)
1788 WCHAR_LINK="-lw"
1789 ])
1790 ])
1791
1792dnl check for vprintf/vsprintf() which are GNU extensions
1793AC_FUNC_VPRINTF
1794
1795dnl check for vsnprintf() - a safe version of vsprintf()
1796AC_CHECK_FUNCS(vsnprintf,
1797 AC_DEFINE(HAVE_VSNPRINTF),
1798 AC_MSG_WARN(unsafe function sprintf will be used instead of snprintf)
1799 )
1800
aea02638
VZ
1801dnl check for vsscanf() - on some platforms (Linux, glibc 2.1.1) it's
1802dnl available in the library but the prototype is missing, so we can't use
1803dnl AC_CHECK_FUNCS here, do it manually
1804AC_LANG_SAVE
1805AC_LANG_CPLUSPLUS
1806
1807AC_CACHE_CHECK([for vsscanf], wx_cv_func_vsscanf,
1808[
3a3eed31 1809 AC_TRY_RUN(
aea02638
VZ
1810 [
1811 #include <stdio.h>
1812 #include <stdarg.h>
3a3eed31
VZ
1813
1814 int try_vsscanf(const char *format, ...)
1815 {
1816 va_list ap;
1817 va_start(ap, format);
1818
1819 vsscanf("17", format, ap);
1820
1821 va_end(ap);
1822 }
1823
1824 int main()
1825 {
1826 int i;
1827 try_vsscanf("%d", &i);
1828 return i == 17 ? 0 : 1;
1829 }
aea02638 1830 ], [
aea02638 1831 AC_DEFINE(HAVE_VSSCANF)
3a3eed31
VZ
1832 wx_cv_func_vsscanf=yes
1833 ],
1834 wx_cv_func_vsscanf=no,
1835 wx_cv_func_vsscanf=no
1836 )
aea02638
VZ
1837])
1838
1839AC_LANG_RESTORE
1840
9a98a854
VZ
1841dnl check for vfork() (even if it's the same as fork() in modern Unices)
1842AC_CHECK_FUNCS(vfork)
1843
1844POSIX4_LINK=
1845AC_CHECK_FUNCS(nanosleep, AC_DEFINE(HAVE_NANOSLEEP), [
1846 AC_CHECK_LIB(posix4, nanosleep, [
1847 AC_DEFINE(HAVE_NANOSLEEP)
1848 POSIX4_LINK="-lposix4"
1849 ], [
1850 AC_CHECK_FUNCS(usleep,
1851 AC_DEFINE(HAVE_USLEEP),
1852 AC_MSG_WARN([wxSleep() function will not work]))
1853 ])
1854])
1855
1856dnl check for uname (POSIX) and gethostname (BSD)
1857AC_CHECK_FUNCS(uname gethostname, break)
1858
e96ac54e
GL
1859dnl check for inet_addr, inet_aton, ...
1860AC_CHECK_FUNCS(inet_addr)
1861AC_CHECK_FUNCS(inet_aton)
eb4642a9 1862AC_CHECK_LIB(resolv, inet_aton)
e96ac54e 1863
9a98a854
VZ
1864dnl ===========================================================================
1865dnl Now we have all the info we need - use it!
1866dnl ===========================================================================
1867
1868dnl flush the cache
1869AC_CACHE_SAVE
1870
1871dnl ---------------------------------------------------------------------------
a9b5e89f 1872dnl thread support for Unix (always available under Win32)
9a98a854
VZ
1873dnl ---------------------------------------------------------------------------
1874
77c85c2b 1875if test "$USE_UNIX" = 1; then
a9b5e89f 1876
9a98a854
VZ
1877dnl the code below:
1878dnl defines THREADS_OBJ which contains the object files to build
1879dnl defines THREADS_LINK which contains the thread library to link with
1880dnl defines wxUSE_THREADS=1 if thread support is activated
1881
1882THREADS_LINK=""
1883THREADS_OBJ=""
1884
77c85c2b
RR
1885if test "$wxUSE_THREADS" = "yes" ; then
1886 if test "$wxUSE_WINE" = 1 ; then
1887 AC_MSG_WARN([Threads are not supported under WINE])
1888 wxUSE_THREADS="no"
1889 fi
39c9d5ac
RR
1890fi
1891
77c85c2b 1892if test "$wxUSE_THREADS" = "yes" ; then
9a98a854 1893 dnl find if POSIX threads are available
c596875e 1894
9a98a854
VZ
1895 dnl standard lib name is pthread
1896 dnl We no longer test for pthread-0.7 as it breaks compilation on some
1897 dnl glibc2 systems, especially for static linkage.
1898 AC_CHECK_LIB(pthread, pthread_create, [
1899 THREADS_OBJ="threadpsx.lo"
1900 THREADS_LINK="pthread"
1901 ], [
1902 dnl thread functions are in libc_r under FreeBSD
1903 AC_CHECK_LIB(c_r, pthread_create, [
1904 THREADS_OBJ="threadpsx.lo"
1905 THREADS_LINK="c_r"
1906 ], [
1907 dnl VZ: SGI threads are not supported currently
1908 AC_CHECK_HEADER(sys/prctl.h, [
1909 THREADS_OBJ="threadsgi.lo"
1910 ])
1911 ])
1912 ])
9a98a854 1913
aea02638
VZ
1914 if test -z "$THREADS_OBJ" ; then
1915 wxUSE_THREADS=no
1916 AC_MSG_WARN(No thread support on this system)
1917 fi
9a98a854
VZ
1918fi
1919
1920dnl do other tests only if we are using threads
77c85c2b 1921if test "$wxUSE_THREADS" = "yes" ; then
9a98a854
VZ
1922 dnl define autoconf macro to check for given function in both pthread and
1923 dnl posix4 libraries
1924 dnl usage: AC_FUNC_THREAD(FUNCTION_NAME)
1925 dnl VZ: TODO
1926 dnl AC_DEFUN(AC_FUNC_THREAD,
1927 dnl [
1928 dnl AC_CHECK_LIB($THREADS_LINK, $1,
1929 dnl AC_DEFINE(HAVE_`'translit($1, `A-Z', 'a-z'),
1930 dnl [AC_CHECK_LIB("posix4", $1,
1931 dnl [AC_DEFINE(HAVE_`'translit($1, `A-Z', 'a-z'))
1932 dnl POSIX4_LINK="-lposix4"
1933 dnl ])
1934 dnl ])
1935 dnl ])
1936
1937 AC_CHECK_HEADERS(sched.h)
1938
1939 AC_CHECK_LIB($THREADS_LINK, sched_yield,
1940 AC_DEFINE(HAVE_SCHED_YIELD),
1941 [AC_CHECK_LIB("posix4", sched_yield,
1942 [AC_DEFINE(HAVE_SCHED_YIELD) POSIX4_LINK="-lposix4"],
1943 AC_MSG_WARN(wxThread::Yield will not work properly)
1944 )]
1945 )
1946
1947 dnl VZ: we should be checking for all of the following functions instead:
1948 dnl 1. pthread_attr_getschedpolicy
1949 dnl 2. sched_get_priority_min and sched_get_priority_max
1950 dnl 3. pthread_attr_getschedparam and pthread_attr_setschedparam
1951 dnl but it seems that if the first one is there, the other ones are too (of
1952 dnl course the proper solution would be to implement AC_FUNC_THREAD above
1953 dnl and do test for them all - anyone?)
1954 AC_CHECK_LIB($THREADS_LINK, pthread_attr_getschedpolicy,
1955 AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS),
1956 [AC_CHECK_LIB("posix4", pthread_attr_getschedpolicy,
1957 [AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS) POSIX4_LINK="-lposix4"],
1958 AC_MSG_WARN(Setting thread priority will not work)
1959 )]
1960 )
1961
1962 AC_CHECK_LIB($THREADS_LINK, pthread_cancel,
1963 AC_DEFINE(HAVE_PTHREAD_CANCEL),
1964 AC_MSG_WARN([wxThread::Kill() will not work properly]))
1965
1966 AC_CACHE_CHECK([for pthread_cleanup_push/pop], wx_cv_func_pthread_cleanup_push,
1967 [
1968 AC_TRY_COMPILE([#include <pthread.h>],
1969 [
1970 pthread_cleanup_push(NULL, NULL);
1971 pthread_cleanup_pop(0);
1972 ], [
1973 wx_cv_func_pthread_cleanup_push=yes
1974 AC_DEFINE(HAVE_THREAD_CLEANUP_FUNCTIONS)
1975 ], [
1976 wx_cv_func_pthread_cleanup_push=no
1977 ])
1978 ])
1979
1980 THREADS_LINK="-l$THREADS_LINK"
1981fi
1982
77c85c2b 1983dnl from if USE_UNIX
a9b5e89f
VZ
1984fi
1985
1986if test "$wxUSE_THREADS" = "yes"; then
1987 AC_DEFINE(wxUSE_THREADS)
1988
1989 dnl must define _REENTRANT for multithreaded code
1990 CFLAGS="${CFLAGS} -D_REENTRANT"
1991 CXXFLAGS="${CXXFLAGS} -D_REENTRANT"
1992
1993 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
1994fi
1995
9a98a854
VZ
1996if test "$WXGTK12" = 1 ; then
1997 AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12)
1998fi
1999
5a92d200
RR
2000if test "$WXWINE" = 1 ; then
2001 TOOLKIT_DEF="${TOOLKIT_DEF} -D__WXWINE__"
2002fi
2003
a9b5e89f
VZ
2004if test "$wxUSE_CYGWIN" = 1 ; then
2005 TOOLKIT_DEF="${TOOLKIT_DEF} -D__WIN95__"
2006fi
2007
9a98a854 2008WXDEBUG=
9a98a854
VZ
2009
2010if test "$wxUSE_DEBUG_INFO" = "yes" ; then
2011 WXDEBUG="-g"
2012 wxUSE_OPTIMISE=no
2013fi
2014
5586805b
RR
2015if test "$wxUSE_DEBUG_GDB" = "yes" ; then
2016 wxUSE_DEBUG_INFO=yes
2017 WXDEBUG="-ggdb"
2018fi
2019
9a98a854 2020if test "$wxUSE_DEBUG_FLAG" = "yes" ; then
77c85c2b
RR
2021 AC_DEFINE(WXDEBUG)
2022 WXDEBUG_DEFINE="-D__WXDEBUG__"
9a98a854 2023else
04338f96
RR
2024 if test "$wxUSE_GTK" = 1 ; then
2025 WXDEBUG_DEFINE="-DGTK_NO_CHECK_CASTS"
2026 fi
9a98a854
VZ
2027fi
2028
2029if test "$wxUSE_MEM_TRACING" = "yes" ; then
77c85c2b
RR
2030 AC_DEFINE(wxUSE_MEMORY_TRACING)
2031 AC_DEFINE(wxUSE_GLOBAL_MEMORY_OPERATORS)
2032 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS memcheck"
9a98a854
VZ
2033fi
2034
2035if test "$wxUSE_DMALLOC" = "yes" ; then
77c85c2b 2036 DMALLOC_LINK="-ldmalloc"
9a98a854
VZ
2037fi
2038
2039PROFILE=
2040if test "$wxUSE_PROFILE" = "yes" ; then
77c85c2b 2041 PROFILE="-pg"
9a98a854
VZ
2042fi
2043
5586805b 2044DEP_INFO_FLAGS=
f7bdcdd7
RR
2045if test "$GCC" = yes ; then
2046 if test "$wxUSE_NO_RTTI" = "yes" ; then
2047 WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-rtti"
2048 fi
2049 if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
2050 WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-exceptions"
2051 fi
5586805b
RR
2052 if test "$wxUSE_PERMISSIVE" = "yes" ; then
2053 CFLAGS="${CFLAGS} -fpermissive"
2054 CXXFLAGS="${CXXFLAGS} -fpermissive"
2055 fi
2056 if test "$wxUSE_NO_DEPS" = "no" ; then
2057 DEP_INFO_FLAGS="-MMD"
2058 fi
c596875e
RD
2059fi
2060
2061
9a98a854
VZ
2062CXXFLAGS=`echo "${CXXFLAGS}" | sed "s/\-O.//g" `
2063CFLAGS=`echo "${CFLAGS}" | sed "s/\-O.//g" `
2064if test "$wxUSE_OPTIMISE" = "no" ; then
77c85c2b 2065 OPTIMISE=
9a98a854 2066else
77c85c2b 2067 if test "$GCC" = yes ; then
04338f96 2068 OPTIMISE="-O2"
77c85c2b
RR
2069 case "${host}" in
2070 i586-*-*|i686-*-* )
2071 OPTIMISE="${OPTIMISE} "
2072 ;;
2073 esac
2074 else
2075 OPTIMISE="-O"
2076 fi
9a98a854
VZ
2077fi
2078
2079dnl ---------------------------------------------------------------------------
2080dnl Optional libraries
2081dnl ---------------------------------------------------------------------------
2082
7fbdec7b 2083ZLIB_INCLUDE=
9a98a854
VZ
2084if test "$wxUSE_ZLIB" = "yes" ; then
2085 AC_DEFINE(wxUSE_ZLIB)
583a6578 2086 ZLIB_INCLUDE="-I\${top_srcdir}/src/zlib"
9a98a854
VZ
2087fi
2088
7fbdec7b 2089PNG_INCLUDE=
9a98a854
VZ
2090if test "$wxUSE_LIBPNG" = "yes" ; then
2091 AC_DEFINE(wxUSE_LIBPNG)
583a6578 2092 PNG_INCLUDE="-I\${top_srcdir}/src/png"
9a98a854
VZ
2093 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS png"
2094fi
2095
7fbdec7b 2096JPEG_INCLUDE=
9a98a854
VZ
2097if test "$wxUSE_LIBJPEG" = "yes" ; then
2098 AC_DEFINE(wxUSE_LIBJPEG)
583a6578 2099 JPEG_INCLUDE="-I\${top_srcdir}/src/jpeg"
9a98a854
VZ
2100fi
2101
2102if test "$wxUSE_OPENGL" = "yes"; then
2103 AC_CHECK_HEADER(GL/gl.h, [
2104 AC_CHECK_LIB(GL, glInitNames, [
2105 OPENGL_LINK="-lGL"
2106 AC_DEFINE(wxUSE_OPENGL)
2107 UTILS_SUBDIRS="$UTILS_SUBDIRS glcanvas/src"
2108 ],[
2109 AC_CHECK_LIB(MesaGL, glInitNames, [
2110 OPENGL_LINK="-lMesaGL"
2111 AC_DEFINE(wxUSE_OPENGL)
2112 UTILS_SUBDIRS="$UTILS_SUBDIRS glcanvas/src"
2113 ],wxUSE_OPENGL=0)
2114 ],wxUSE_OPENGL=0)
2115 ],wxUSE_OPENGL=0)
2116fi
2117
2118dnl ---------------------------------------------------------------------------
2119dnl the library may be built without GUI classes at all
2120dnl ---------------------------------------------------------------------------
2121
2122if test "$wxUSE_GUI" = "yes"; then
2123 AC_DEFINE(wxUSE_GUI)
2124
2125 dnl the things we always pull in the GUI version of the library:
2126 dnl 1. basic things like wxApp, wxWindow, wxControl, wxFrame, wxDialog (the
2127 dnl library really can't be built without those)
2128 dnl 2. basic controls: wxButton, wxStaticText, wxTextCtrl (these are used in
2129 dnl almost any program and the first 2 are needed to show a message box
2130 dnl which want to be always able to do)
2131 dnl 3. GDI stuff: icon, cursors and all that. Although it would be very nice
2132 dnl to compile without them (if the app doesn't do any drawing, it doesn't
2133 dnl need the dcs, pens, brushes, ...), this just can't be done now
2134 dnl 4. menu stuff: wxMenu, wxMenuBar, wxMenuItem
2135 dnl 5. misc stuff: timers, settings, message box
9a98a854
VZ
2136else
2137 AC_DEFINE(wxUSE_NOGUI)
2138fi
2139
2140dnl ---------------------------------------------------------------------------
2141dnl Unix/Windows
2142dnl ---------------------------------------------------------------------------
2143
2144if test "$wxUSE_UNIX" = "yes"; then
2145 AC_DEFINE(wxUSE_UNIX)
9a98a854
VZ
2146fi
2147
2148dnl ---------------------------------------------------------------------------
2149dnl Register non-GUI class options for makefiles and setup.h
2150dnl ---------------------------------------------------------------------------
2151
2152if test "$wxUSE_APPLE_IEEE" = "yes"; then
2153 AC_DEFINE(wxUSE_APPLE_IEEE)
9a98a854
VZ
2154fi
2155
2156if test "$wxUSE_TIMEDATE" = "yes"; then
2157 AC_DEFINE(wxUSE_TIMEDATE)
9a98a854
VZ
2158 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest"
2159fi
2160
2749089a
KB
2161if test "$wxUSE_WAVE" = "yes"; then
2162 AC_DEFINE(wxUSE_WAVE)
2163fi
2164
9a98a854
VZ
2165if test "$wxUSE_FILE" = "yes"; then
2166 AC_DEFINE(wxUSE_FILE)
9a98a854
VZ
2167fi
2168
e3e717ec
VZ
2169if test "$wxUSE_FS_INET" = "yes"; then
2170 AC_DEFINE(wxUSE_FS_INET)
2171fi
2172
2173if test "$wxUSE_FS_ZIP" = "yes"; then
2174 AC_DEFINE(wxUSE_FS_ZIP)
2175fi
2176
d78b3d64
VS
2177if test "$wxUSE_ZIPSTREAM" = "yes"; then
2178 AC_DEFINE(wxUSE_ZIPSTREAM)
2179fi
2180
2181if test "$wxUSE_BUSYINFO" = "yes"; then
2182 AC_DEFINE(wxUSE_BUSYINFO)
2183fi
2184
fd15d8f1
RR
2185if test "$wxUSE_STD_IOSTREAM" = "yes"; then
2186 AC_DEFINE(wxUSE_STD_IOSTREAM)
2187fi
2188
9a98a854
VZ
2189if test "$wxUSE_TEXTFILE" = "yes"; then
2190 if test "$wxUSE_FILE" != "yes"; then
2191 AC_MSG_WARN(wxTextFile requires wxFile and it won't be compiled without it)
2192 else
2193 AC_DEFINE(wxUSE_TEXTFILE)
9a98a854
VZ
2194 fi
2195fi
2196
2197if test "$wxUSE_CONFIG" = "yes" ; then
2198 if test "$wxUSE_TEXTFILE" != "yes"; then
2199 AC_MSG_WARN(wxConfig requires wxTextFile and it won't be compiled without it)
2200 else
2201 AC_DEFINE(wxUSE_CONFIG)
9a98a854
VZ
2202 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS config"
2203 fi
2204fi
2205
2206if test "$wxUSE_INTL" = "yes" ; then
2207 if test "$wxUSE_FILE" != "yes"; then
2208 AC_MSG_WARN(I18n code requires wxFile and it won't be compiled without it)
2209 else
2210 AC_DEFINE(wxUSE_INTL)
9a98a854
VZ
2211 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS internat"
2212 fi
2213fi
2214
2215if test "$wxUSE_LOG" = "yes"; then
2216 AC_DEFINE(wxUSE_LOG)
9a98a854
VZ
2217fi
2218
2219if test "$wxUSE_LONGLONG" = "yes"; then
2220 AC_DEFINE(wxUSE_LONGLONG)
9a98a854
VZ
2221fi
2222
2223if test "$wxUSE_SOCKETS" = "yes" ; then
2224 if test "$wxUSE_THREADS" = "yes" ; then
2225 AC_DEFINE(wxUSE_SOCKETS)
9a98a854 2226 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS wxsocket"
ff684c98 2227 INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS protocol"
9a98a854 2228 else
39c9d5ac 2229 AC_MSG_WARN(Socket classes require --with-threads and won't be compiled without it)
9a98a854
VZ
2230 wxUSE_SOCKETS=0
2231 fi
2232fi
2233
1c8515f9
KB
2234if test "$wxUSE_DIALUP_MANAGER" = "yes" ; then
2235 AC_DEFINE(wxUSE_DIALUP_MANAGER)
2236fi
2237
9a98a854
VZ
2238if test "$wxUSE_STREAMS" = "yes" ; then
2239 AC_DEFINE(wxUSE_STREAMS)
9a98a854
VZ
2240fi
2241
2242if test "$wxUSE_SERIAL" = "yes" ; then
2243 AC_DEFINE(wxUSE_SERIAL)
2244fi
2245
2246dnl ------------------------------------------------------------------------
2247dnl wxSocket
2248dnl ------------------------------------------------------------------------
2249
2250if test "$wxUSE_SOCKETS" = "yes"; then
2251 AC_LANG_SAVE
2252 AC_LANG_CPLUSPLUS
2253 dnl determine the type of third argument for getsockname
2254 AC_MSG_CHECKING(the type of the third argument of getsockname)
2255 AC_TRY_COMPILE(
2256 [#include <sys/socket.h>],
2257 [socklen_t len; getsockname(0, NULL, &len);],
2258 AC_DEFINE(SOCKLEN_T, socklen_t) AC_MSG_RESULT(socklen_t),
2259 AC_TRY_COMPILE(
2260 [#include <sys/socket.h>],
2261 [size_t len; getsockname(0, NULL, &len);],
2262 AC_DEFINE(SOCKLEN_T, size_t) AC_MSG_RESULT(size_t),
2263 AC_TRY_COMPILE(
2264 [#include <sys/socket.h>],
2265 [int len; getsockname(0, NULL, &len);],
2266 AC_DEFINE(SOCKLEN_T, int) AC_MSG_RESULT(int),
2267 AC_MSG_RESULT(unknown)
2268 )
2269 )
2270 )
2271 AC_LANG_RESTORE
2272fi
2273
2274dnl ---------------------------------------------------------------------------
2275dnl Joystick support
2276dnl ---------------------------------------------------------------------------
2277
2278if test "$wxUSE_JOYSTICK" = 1; then
2279 dnl joystick support is only for Linux 2.1.x or greater
2280 AC_CHECK_HEADERS(linux/joystick.h)
2281 if test "$ac_cv_header_linux_joystick_h" = "yes"; then
2282 AC_DEFINE(wxUSE_JOYSTICK)
9a98a854
VZ
2283 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest"
2284 fi
2285fi
2286
2287dnl ------------------------------------------------------------------------
2288dnl DLL support
2289dnl ------------------------------------------------------------------------
2290
2291HAVE_DL_FUNCS=0
2292HAVE_SHL_FUNCS=0
2293if test "$wxUSE_DYNLIB_CLASS" = "yes"; then
2294 dnl the test is a bit complicated because we check for dlopen() both with
2295 dnl and without -ldl
2296 AC_CHECK_FUNCS(dlopen,
2297 [AC_DEFINE(HAVE_DLOPEN) HAVE_DL_FUNCS=1],
2298 [AC_CHECK_LIB(dl, dlopen,
2299 [AC_DEFINE(HAVE_DLOPEN) HAVE_DL_FUNCS=1])])
2300 AC_CHECK_FUNCS( shl_load,
2301 [AC_DEFINE(HAVE_SHL_LOAD) HAVE_DL_FUNCS=1 HAVE_SHL_FUNCS=1])
2302
2303 if test "$HAVE_DL_FUNCS" = 0; then
c596875e 2304 if test "$USE_UNIX" = 1; then
c637d461
HH
2305 AC_MSG_WARN("--with-dynlib and --with-odbc will be disabled due to missing shared library support")
2306 wxUSE_ODBC=no
2307 wxUSE_DYNLIB_CLASS=no
2308 else
2309 AC_MSG_WARN("Cannot check dynlib requirements on non-Unix platforms. dynlib remains enabled.")
c596875e 2310 fi
9a98a854
VZ
2311 fi
2312fi
2313
2314if test "$wxUSE_DYNLIB_CLASS" = "yes" ; then
2315 AC_DEFINE(wxUSE_DYNLIB_CLASS)
9a98a854
VZ
2316fi
2317
2318dnl ---------------------------------------------------------------------------
ced859c3 2319dnl String stuff
9a98a854
VZ
2320dnl ---------------------------------------------------------------------------
2321
2322if test "$wxUSE_UNICODE" = "yes" ; then
2323 AC_DEFINE(wxUSE_UNICODE)
2324fi
2325
2326if test "$wxUSE_WCSRTOMBS" = "yes" ; then
2327 AC_DEFINE(wxUSE_WCSRTOMBS)
2328fi
2329
ced859c3
VZ
2330if test "$wxUSE_wxUSE_EXPERIMENTAL_PRINTF" = "yes"; then
2331 AC_DEFINE(wxUSE_EXPERIMENTAL_PRINTF)
2332fi
2333
9a98a854
VZ
2334dnl ----------------------------------------------------------------
2335dnl iODBC support
2336dnl ----------------------------------------------------------------
2337
2338IODBC_C_SRC=""
2339if test "$wxUSE_ODBC" = "yes" ; then
2340 AC_DEFINE(wxUSE_ODBC)
9a98a854
VZ
2341 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS db"
2342fi
2343
2344dnl ----------------------------------------------------------------
2345dnl Register PostScript options for makefiles and setup.h
2346dnl ----------------------------------------------------------------
2347
2348if test "$wxUSE_POSTSCRIPT" = "yes" ; then
2349 AC_DEFINE(wxUSE_POSTSCRIPT)
9a98a854
VZ
2350fi
2351
2352AC_DEFINE(wxUSE_AFM_FOR_POSTSCRIPT)
2353
2354AC_DEFINE(wxUSE_NORMALIZED_PS_FONTS)
2355
2356dnl ---------------------------------------------------------------------------
2357dnl big GUI components: MDI, doc/view, printing, help, ...
2358dnl ---------------------------------------------------------------------------
2359
2360if test "$wxUSE_CONSTRAINTS" = "yes"; then
ce4169a4
RR
2361 AC_DEFINE(wxUSE_CONSTRAINTS)
2362 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS layout"
9a98a854
VZ
2363fi
2364
2365if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
ce4169a4
RR
2366 AC_DEFINE(wxUSE_MDI_ARCHITECTURE)
2367 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mdi"
9a98a854
VZ
2368fi
2369
2370if test "$wxUSE_DOC_VIEW_ARCHITECTURE" = "yes" ; then
ce4169a4
RR
2371 AC_DEFINE(wxUSE_DOC_VIEW_ARCHITECTURE)
2372 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docview"
2373 if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
2374 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docvwmdi"
2375 fi
9a98a854
VZ
2376fi
2377
2378if test "$wxUSE_HELP" = "yes"; then
ce4169a4
RR
2379 AC_DEFINE(wxUSE_HELP)
2380 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS help"
9a98a854
VZ
2381fi
2382
2383if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then
ce4169a4
RR
2384 if test "$wxUSE_CONSTRAINTS" != "yes"; then
2385 AC_MSG_WARN(Printing support cannot be used without constraints so it won't be compiled without it)
2386 else
2387 AC_DEFINE(wxUSE_PRINTING_ARCHITECTURE)
2388 fi
2389 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS printing"
9a98a854
VZ
2390fi
2391
2392if test "$wxUSE_PROLOGIO" = "yes" ; then
ce4169a4 2393 AC_DEFINE(wxUSE_PROLOGIO)
9a98a854
VZ
2394fi
2395
2396if test "$wxUSE_RESOURCES" = "yes" ; then
ce4169a4
RR
2397 if test "$wxUSE_PROLOGIO" = "yes" ; then
2398 AC_DEFINE(wxUSE_RESOURCES)
2399 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS resource"
2400 else
2401 AC_MSG_WARN([wxWindows ressource system requires PrologIO and can't be compiled without it.])
2402 fi
9a98a854
VZ
2403fi
2404
2405if test "$wxUSE_X_RESOURCES" = "yes"; then
ce4169a4 2406 AC_DEFINE(wxUSE_X_RESOURCES)
9a98a854
VZ
2407fi
2408
2409dnl ---------------------------------------------------------------------------
77c85c2b 2410dnl IPC: IPC, Drag'n'Drop, Clipboard, ...
9a98a854
VZ
2411dnl ---------------------------------------------------------------------------
2412
2413if test "$wxUSE_IPC" = "yes"; then
ce4169a4 2414 AC_DEFINE(wxUSE_IPC)
9a98a854
VZ
2415fi
2416
2417if test "$wxUSE_CLIPBOARD" = "yes"; then
ce4169a4 2418 AC_DEFINE(wxUSE_CLIPBOARD)
9a98a854
VZ
2419fi
2420
39c9d5ac 2421if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
ce4169a4
RR
2422 if test "$wxUSE_GTK" = 1; then
2423 if test "$WXGTK12" != 1; then
fd9811b1 2424 AC_MSG_WARN([Drag and drop is only supported under GTK+ 1.2])
bea74fbb 2425 wxUSE_DRAG_AND_DROP=no
ce4169a4 2426 fi
a9b5e89f 2427 fi
a9b5e89f 2428
ce4169a4
RR
2429 if test "$wxUSE_MOTIF" = 1; then
2430 AC_MSG_WARN([Drag and drop is not yet supported under Motif])
bea74fbb 2431 wxUSE_DRAG_AND_DROP=no
ce4169a4 2432 fi
a9b5e89f 2433
ce4169a4
RR
2434 if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
2435 AC_DEFINE(wxUSE_DRAG_AND_DROP)
2436 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd"
2437 fi
9a98a854
VZ
2438fi
2439
2440if test "$wxUSE_SPLINES" = "yes" ; then
2441 AC_DEFINE(wxUSE_SPLINES)
2442fi
2443
2444dnl ---------------------------------------------------------------------------
2445dnl GUI controls
2446dnl ---------------------------------------------------------------------------
2447
2448if test "$wxUSE_ACCEL" = "yes"; then
2449 AC_DEFINE(wxUSE_ACCEL)
9a98a854
VZ
2450fi
2451
2452if test "$wxUSE_CARET" = "yes"; then
2453 AC_DEFINE(wxUSE_CARET)
9a98a854
VZ
2454 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS caret"
2455fi
2456
2457if test "$wxUSE_COMBOBOX" = "yes"; then
2458 AC_DEFINE(wxUSE_COMBOBOX)
9a98a854
VZ
2459fi
2460
ce4169a4
RR
2461if test "$wxUSE_CHOICE" = "yes"; then
2462 AC_DEFINE(wxUSE_CHOICE)
2463fi
2464
9a98a854
VZ
2465if test "$wxUSE_BMPBUTTON" = "yes"; then
2466 AC_DEFINE(wxUSE_BMPBUTTON)
9a98a854
VZ
2467fi
2468
2469if test "$wxUSE_CHECKBOX" = "yes"; then
2470 AC_DEFINE(wxUSE_CHECKBOX)
9a98a854
VZ
2471fi
2472
2473if test "$wxUSE_CHECKLST" = "yes"; then
2474 AC_DEFINE(wxUSE_CHECKLISTBOX)
9a98a854
VZ
2475 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS checklst"
2476fi
2477
2478if test "$wxUSE_GAUGE" = "yes"; then
2479 AC_DEFINE(wxUSE_GAUGE)
9a98a854
VZ
2480fi
2481
2482if test "$wxUSE_GRID" = "yes"; then
2483 AC_DEFINE(wxUSE_GRID)
9a98a854
VZ
2484 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS grid"
2485fi
2486
2487if test "$wxUSE_IMAGLIST" = "yes"; then
ce4169a4 2488 AC_DEFINE(wxUSE_IMAGLIST)
9a98a854
VZ
2489fi
2490
2491if test "$wxUSE_LISTBOX" = "yes"; then
ce4169a4 2492 AC_DEFINE(wxUSE_LISTBOX)
9a98a854
VZ
2493fi
2494
2495if test "$wxUSE_LISTCTRL" = "yes"; then
ce4169a4
RR
2496 if test "$wxUSE_IMAGLIST" = "yes"; then
2497 AC_DEFINE(wxUSE_LISTCTRL)
2498 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS listctrl"
2499 else
2500 AC_MSG_WARN([wxListCtrl requires wxImageList and won't be compiled without it])
2501 fi
9a98a854
VZ
2502fi
2503
2504if test "$wxUSE_NOTEBOOK" = "yes"; then
ce4169a4
RR
2505 AC_DEFINE(wxUSE_NOTEBOOK)
2506 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS notebook"
9a98a854
VZ
2507fi
2508
2509if test "$wxUSE_RADIOBOX" = "yes"; then
ce4169a4 2510 AC_DEFINE(wxUSE_RADIOBOX)
9a98a854
VZ
2511fi
2512
2513if test "$wxUSE_RADIOBTN" = "yes"; then
ce4169a4 2514 AC_DEFINE(wxUSE_RADIOBTN)
9a98a854
VZ
2515fi
2516
79b00c62 2517if test "$wxUSE_SASH" = "yes"; then
ce4169a4
RR
2518 AC_DEFINE(wxUSE_SASH)
2519 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sashtest"
9a98a854
VZ
2520fi
2521
2522if test "$wxUSE_SCROLLBAR" = "yes"; then
ce4169a4
RR
2523 AC_DEFINE(wxUSE_SCROLLBAR)
2524 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS scroll"
9a98a854
VZ
2525fi
2526
2527if test "$wxUSE_SLIDER" = "yes"; then
ce4169a4 2528 AC_DEFINE(wxUSE_SLIDER)
9a98a854
VZ
2529fi
2530
2531if test "$wxUSE_SPINBTN" = "yes"; then
ce4169a4 2532 AC_DEFINE(wxUSE_SPINBTN)
9a98a854
VZ
2533fi
2534
2535if test "$wxUSE_SPLITTER" = "yes"; then
ce4169a4
RR
2536 AC_DEFINE(wxUSE_SPLITTER)
2537 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splitter"
9a98a854
VZ
2538fi
2539
2540if test "$wxUSE_STATBMP" = "yes"; then
ce4169a4 2541 AC_DEFINE(wxUSE_STATBMP)
9a98a854
VZ
2542fi
2543
2544if test "$wxUSE_STATBOX" = "yes"; then
ce4169a4 2545 AC_DEFINE(wxUSE_STATBOX)
9a98a854
VZ
2546fi
2547
2548if test "$wxUSE_STATLINE" = "yes"; then
f53561f1
RR
2549 if test "$wxUSE_WINE" = 1 ; then
2550 AC_MSG_WARN([wxStaticLine is not supported under WINE])
2551 else
d84b1219 2552 AC_DEFINE(wxUSE_STATLINE)
f53561f1 2553 fi
9a98a854
VZ
2554fi
2555
2556if test "$wxUSE_STATUSBAR" = "yes"; then
ce4169a4 2557 AC_DEFINE(wxUSE_STATUSBAR)
9a98a854
VZ
2558fi
2559
2560if test "$wxUSE_TABDIALOG" = "yes"; then
ce4169a4
RR
2561 AC_DEFINE(wxUSE_TAB_DIALOG)
2562 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS tab"
9a98a854
VZ
2563fi
2564
2565if test "$wxUSE_TOOLBAR" = "yes"; then
ce4169a4
RR
2566 AC_DEFINE(wxUSE_TOOLBAR)
2567 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS toolbar"
9a98a854
VZ
2568fi
2569
39c9d5ac 2570if test "$wxUSE_TOOLTIPS" = "yes"; then
ced859c3 2571 if test "$wxUSE_MOTIF" = 1; then
bea74fbb 2572 AC_MSG_WARN(wxTooltip not supported yet under Motif)
9a98a854 2573 else
ce4169a4 2574 if test "$wxUSE_WINE" = 1; then
bea74fbb 2575 AC_MSG_WARN(wxTooltip not supported under WINE)
ce4169a4
RR
2576 else
2577 AC_DEFINE(wxUSE_TOOLTIPS)
2578 fi
9a98a854
VZ
2579 fi
2580fi
2581
2582if test "$wxUSE_TREECTRL" = "yes"; then
ce4169a4
RR
2583 if test "$wxUSE_IMAGLIST" = "yes"; then
2584 AC_DEFINE(wxUSE_TREECTRL)
2585 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treectrl"
2586 else
2587 AC_MSG_WARN([wxTreeCtrl requires wxImageList and won't be compiled without it])
2588 fi
9a98a854
VZ
2589fi
2590
2591dnl ---------------------------------------------------------------------------
2592dnl misc options
2593dnl ---------------------------------------------------------------------------
2594
ff684c98
VZ
2595dnl TODO this is unused for now...
2596dnl if test "$wxUSE_WXTREE" = "yes"; then
2597dnl AC_DEFINE(wxUSE_WXTREE)
2598dnl fi
9a98a854
VZ
2599
2600if test "$wxUSE_METAFILE" = "yes"; then
ce4169a4 2601 AC_DEFINE(wxUSE_METAFILE)
9a98a854
VZ
2602fi
2603
ce4169a4
RR
2604if test "$wxUSE_DIRDLG" = "yes"; then
2605 if test "$wxUSE_CONSTRAINTS" != "yes"; then
2606 AC_MSG_WARN(wxDirDialog requires constraints so it won't be compiled without them)
9a98a854 2607 else
ce4169a4
RR
2608 if test "$wxUSE_TREECTRL" != "yes"; then
2609 AC_MSG_WARN(wxDirDialog requires wxTreeCtrl so it won't be compiled without it)
2610 else
2611 AC_DEFINE(wxUSE_DIRDLG)
2612 fi
9a98a854 2613 fi
ce4169a4 2614fi
9a98a854 2615
c11584af
RR
2616if test "$wxUSE_TEXTDLG" = "yes"; then
2617 AC_DEFINE(wxUSE_TEXTDLG)
2618fi
2619
a641505f
VZ
2620if test "$wxUSE_STARTUP_TIPS" = "yes"; then
2621 if test "$wxUSE_CONSTRAINTS" != "yes"; then
2622 AC_MSG_WARN(Startup tips requires constraints and won't be compiled without them)
2623 else
2624 AC_DEFINE(wxUSE_STARTUP_TIPS)
2625 fi
2626fi
2627
ce4169a4
RR
2628if test "$wxUSE_PROGRESSDLG" = "yes"; then
2629 if test "$wxUSE_CONSTRAINTS" != "yes"; then
2630 AC_MSG_WARN(wxProgressDialog requires constraints so it won't be compiled without them)
2631 else
2632 AC_DEFINE(wxUSE_PROGRESSDLG)
2633 fi
9a98a854
VZ
2634fi
2635
2636if test "$wxUSE_MINIFRAME" = "yes"; then
ce4169a4
RR
2637 AC_DEFINE(wxUSE_MINIFRAME)
2638 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS minifram"
9a98a854
VZ
2639fi
2640
5526e819
VS
2641if test "$wxUSE_HTML" = "yes"; then
2642 AC_DEFINE(wxUSE_HTML)
2643 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html"
77133f2d 2644 INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS html"
5526e819
VS
2645fi
2646
9a98a854 2647if test "$wxUSE_VALIDATORS" = "yes"; then
ce4169a4
RR
2648 AC_DEFINE(wxUSE_VALIDATORS)
2649 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS validate"
9a98a854
VZ
2650fi
2651
0940bcf7
HH
2652if test "$wxUSE_GIF" = "yes" ; then
2653 AC_DEFINE(wxUSE_GIF)
2654fi
2655
2656if test "$wxUSE_PCX" = "yes" ; then
2657 AC_DEFINE(wxUSE_PCX)
2658fi
2659
2660if test "$wxUSE_PNM" = "yes" ; then
2661 AC_DEFINE(wxUSE_PNM)
2662fi
2663
9a98a854
VZ
2664dnl ---------------------------------------------------------------------------
2665dnl Output the makefiles and such from the results found above
2666dnl ---------------------------------------------------------------------------
2667
2668dnl if we add wxUSE_GUI in the future, it might be handy to separate the libs
2669dnl into GUI and non-GUI parts
2670GUILIBS="$GUI_TK_LIBRARY $OPENGL_LINK $LIBPNG_LINK $ZLIB_LINK $TOOLKIT_LINK"
2671
2672dnl all additional libraries (except wxWindows itself) we link with
2673EXTRA_LIBS="$LIBS $POSIX4_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK $GUILIBS"
2674
2675dnl all the libraries needed to link wxWindows programs (when the library is not
2676dnl yet installed)
47b61a78 2677LIBS="\${top_builddir}/src/${TOOLKIT_DIR}/${WX_LIBRARY_NAME} $EXTRA_LIBS"
9a98a854 2678
8e877c19
RR
2679dnl all the libraries needed to link wxWindows programs when using the
2680dnl makefile system without libtool
2681LD_LIBS="\${top_builddir}/lib/${WX_LIBRARY_NAME_STATIC} $EXTRA_LIBS"
2682
9a98a854 2683dnl all -I options we must pass to the compiler
7fbdec7b 2684INCLUDES="-I. -I\${top_builddir}/include -I\${top_srcdir}/include $ZLIB_INCLUDE $PNG_INCLUDE $JPEG_INCLUDE $TOOLKIT_INCLUDE"
9a98a854
VZ
2685
2686dnl C/C++ compiler options used to compile wxWindows
bea74fbb 2687if test "$GXX" = yes ; then
ce4169a4
RR
2688 dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror"
2689 CXXWARNINGS="-Wall"
2690 dnl there is one weird warning in docview.h:71 which prevents me from doing
2691 dnl this...
2692 dnl CXXWARNINGS="-Wall -Werror"
9a98a854
VZ
2693fi
2694EXTRA_CFLAGS="$WXDEBUG $PROFILE $OPTIMISE $INCLUDES"
2695
0f5f43ac 2696CPPFLAGS="-I\${top_srcdir}/include $CPPFLAGS"
9a98a854
VZ
2697CFLAGS="$CFLAGS $EXTRA_CFLAGS"
2698CXXFLAGS="$CXXFLAGS $EXTRA_CFLAGS $CXXWARNINGS"
2699
2700if test "$wxUSE_GUI" = "yes"; then
ce4169a4
RR
2701 dnl TODO add checks that these samples will really compile (i.e. all the
2702 dnl library features they need are present)
9a98a854 2703
ce4169a4
RR
2704 dnl TODO some samples are never built so far:
2705 dnl mfc, nativdlg, oleauto, ownerdrw, proplist
2706 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS bombs controls dialogs drawing dynamic \
e4628635 2707 forty fractal image wxpoem"
9a98a854
VZ
2708fi
2709
70d1b3cf
VZ
2710dnl for convenience, sort the samples in alphabetical order
2711dnl
2712dnl FIXME For some mysterious reasons, sometimes the directories are duplicated
2713dnl in this list - hence uniq. But normally, this shouldn't be needed!
2714SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq | tr '\n' ' '`"
2715
9a98a854
VZ
2716dnl global options
2717AC_SUBST(WX_MAJOR_VERSION_NUMBER)
2718AC_SUBST(WX_MINOR_VERSION_NUMBER)
2719AC_SUBST(WX_RELEASE_NUMBER)
70d1b3cf 2720AC_SUBST(WX_LIBRARY_NAME)
48b1d0ff
RR
2721AC_SUBST(WX_LIBRARY_NAME_STATIC)
2722AC_SUBST(WX_LIBRARY_NAME_SHARED)
2b6f061f 2723AC_SUBST(WX_LIBRARY)
48b1d0ff
RR
2724AC_SUBST(WX_TARGET_LIBRARY)
2725AC_SUBST(WX_LIBRARY_LINK1)
2726AC_SUBST(WX_LIBRARY_LINK2)
2727AC_SUBST(WX_LIBRARY_LINK3)
80d895cd 2728AC_SUBST(PROGRAM_EXT)
48b1d0ff
RR
2729
2730dnl are we supposed to create the links?
2731AC_SUBST(WX_CREATE_LINKS)
517a619d 2732AC_SUBST(WX_CREATE_INSTALLED_LINKS)
9a98a854 2733
48b1d0ff
RR
2734AC_SUBST(SHARED_LD)
2735AC_SUBST(PIC_FLAG)
5586805b 2736AC_SUBST(DEP_INFO_FLAGS)
48b1d0ff 2737
9a98a854
VZ
2738dnl debugging options
2739AC_SUBST(WXDEBUG_DEFINE)
2740
2741dnl toolkit options
2742AC_SUBST(TOOLKIT)
2743AC_SUBST(TOOLKIT_DEF)
2744AC_SUBST(TOOLKIT_DIR)
2745AC_SUBST(TOOLKIT_INCLUDE)
2746
073478b3 2747dnl what to compile
2aa88730 2748AC_SUBST(GUIHEADERS)
5586805b 2749AC_SUBST(GUIOBJS)
073478b3
RR
2750AC_SUBST(COMMONOBJS)
2751AC_SUBST(GENERICOBJS)
5586805b
RR
2752AC_SUBST(GUIDEPS)
2753AC_SUBST(COMMONDEPS)
2754AC_SUBST(GENERICDEPS)
e4b4d60e 2755AC_SUBST(UNIXOBJS)
a4aad961 2756AC_SUBST(GUIDIST)
073478b3 2757
9a98a854 2758dnl additional subdirectories where we will build
bcd2b961 2759AC_SUBST(SRC_SUBDIRS)
ff684c98 2760AC_SUBST(INCLUDE_SUBDIRS)
9a98a854
VZ
2761AC_SUBST(UTILS_SUBDIRS)
2762AC_SUBST(DOCS_SUBDIRS)
2763AC_SUBST(SAMPLES_SUBDIRS)
2764AC_SUBST(USER_SUBDIRS)
2765
2766dnl additional libraries
2767AC_SUBST(EXTRA_LIBS)
2768AC_SUBST(LIBS)
8e877c19 2769AC_SUBST(LD_LIBS)
9a98a854 2770
9a98a854
VZ
2771dnl MAKE_SET will be replaced with "MAKE=..." or nothing if make sets MAKE
2772dnl itself (this is macro is required if SUBDIRS variable is used in Makefile.am
2773dnl - and we do use it)
2774AC_PROG_MAKE_SET
2775
2aa88730
RR
2776AC_CONFIG_HEADER(setup.h:setup.h.in)
2777
d39356d5
HH
2778dnl Duh! glcanvas/$(TOOLKIT_DIR) doesn't work for msw because some
2779dnl genius called it "win"
2780if test "${TOOLKIT_DIR}" = "msw" ; then
2781 GL_TOOLKIT_DIR="win"
2782else
2783 GL_TOOLKIT_DIR="${TOOLKIT_DIR}"
2784fi
2785dnl It's needed in glcanvas/Makefile.in so we even have to subst this hack!
2786AC_SUBST(GL_TOOLKIT_DIR)
2aa88730 2787
9a98a854
VZ
2788dnl create each of the files in the space separated list from the file.in
2789dnl (the original file name may be overriden by appending another name after a
2790dnl colon)
2791AC_OUTPUT([
ff684c98 2792 wx-config
8e877c19
RR
2793 src/make.env
2794 src/makeprog.env
2795 src/makelib.env
bcd2b961 2796 Makefile
ad9edf45
RR
2797 samples/Makefile
2798 samples/bombs/Makefile
2799 samples/caret/Makefile
2800 samples/checklst/Makefile
2801 samples/config/Makefile
2802 samples/controls/Makefile
a8efa9e3
RR
2803 samples/dialogs/Makefile
2804 samples/docview/Makefile
2805 samples/docvwmdi/Makefile
2806 samples/dnd/Makefile
2807 samples/drawing/Makefile
2808 samples/dynamic/Makefile
2809 samples/image/Makefile
6a2a235b 2810 samples/internat/Makefile
a8efa9e3
RR
2811 samples/layout/Makefile
2812 samples/listctrl/Makefile
2813 samples/mdi/Makefile
2814 samples/minifram/Makefile
2815 samples/minimal/Makefile
2816 samples/notebook/Makefile
27ea1d8a 2817 samples/printing/Makefile
42b4e99e 2818 samples/proplist/Makefile
8a5137d7
RR
2819 samples/sashtest/Makefile
2820 samples/scroll/Makefile
2821 samples/splitter/Makefile
2822 samples/text/Makefile
2823 samples/thread/Makefile
2824 samples/toolbar/Makefile
2825 samples/treectrl/Makefile
2826 samples/typetest/Makefile
549c6f67
RR
2827 samples/validate/Makefile
2828 samples/wxpoem/Makefile
2829 samples/wxsocket/Makefile
7750247f 2830 samples/wizard/Makefile
b1683d38 2831 samples/html/Makefile
549c6f67 2832 samples/html/about/Makefile
b1683d38
RR
2833 samples/html/help/Makefile
2834 samples/html/printing/Makefile
2835 samples/html/test/Makefile
dc6c62a9
RR
2836 samples/html/zip/Makefile
2837 samples/html/virtual/Makefile
2838 samples/html/widget/Makefile
622e48cb 2839 utils/Makefile
526ddb13
GL
2840 utils/wxMMedia2/Makefile
2841 utils/wxMMedia2/lib/Makefile
2842 utils/wxMMedia2/sample/Makefile
641d87d8 2843 utils/glcanvas/Makefile
d39356d5 2844 utils/glcanvas/${GL_TOOLKIT_DIR}/Makefile
c596875e
RD
2845 utils/ogl/Makefile
2846 utils/ogl/src/Makefile
9a98a854 2847 ],
a2cddd63
VZ
2848 [
2849 chmod +x wx-config
c596875e
RD
2850 if test ! -d include; then
2851 mkdir include
583a6578 2852 fi
c596875e
RD
2853 if test ! -d include/wx; then
2854 mkdir include/wx
583a6578 2855 fi
c596875e
RD
2856 if test ! -d include/wx/${TOOLKIT_DIR}; then
2857 mkdir include/wx/${TOOLKIT_DIR}
583a6578
RR
2858 fi
2859 cp -f setup.h include/wx/${TOOLKIT_DIR}/setup.h
a2cddd63
VZ
2860 ],
2861 [
c7114f59
VZ
2862 LN_S="${ac_cv_prog_LN_S}"
2863 TOOLKIT_DIR="${TOOLKIT_DIR}"
a2cddd63
VZ
2864 ]
2865 )
9a98a854 2866