]> git.saurik.com Git - wxWidgets.git/blame - configure.in
started adding swigged sources
[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
664 DEFAULT_wxUSE_LIBGIF=no
665 DEFAULT_wxUSE_LIBJPEG=no
666 DEFAULT_wxUSE_ODBC=no
667
fd15d8f1 668 DEFAULT_wxUSE_STD_IOSTREAM=no
9a98a854
VZ
669 DEFAULT_wxUSE_FILE=no
670 DEFAULT_wxUSE_TEXTFILE=no
671 DEFAULT_wxUSE_TIMEDATE=no
2749089a 672 DEFAULT_wxUSE_WAVE=no
9a98a854
VZ
673 DEFAULT_wxUSE_INTL=no
674 DEFAULT_wxUSE_CONFIG=no
675 DEFAULT_wxUSE_STREAMS=no
676 DEFAULT_wxUSE_SOCKETS=no
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
747else
748 DEFAULT_wxUSE_THREADS=yes
749
2aa88730 750 DEFAULT_wxUSE_SHARED=yes
9a98a854
VZ
751 DEFAULT_wxUSE_OPTIMISE=yes
752 DEFAULT_wxUSE_PROFILE=no
5586805b 753 DEFAULT_wxUSE_NO_DEPS=no
f7bdcdd7
RR
754 DEFAULT_wxUSE_NO_RTTI=no
755 DEFAULT_wxUSE_NO_EXCEPTIONS=no
5586805b 756 DEFAULT_wxUSE_PERMISSIVE=no
9a98a854
VZ
757 DEFAULT_wxUSE_DEBUG_FLAG=no
758 DEFAULT_wxUSE_DEBUG_INFO=no
759 DEFAULT_wxUSE_DEBUG_GDB=no
760 DEFAULT_wxUSE_MEM_TRACING=no
143121c5 761 DEFAULT_wxUSE_DEBUG_CONTEXT=no
9a98a854
VZ
762 DEFAULT_wxUSE_DMALLOC=no
763 DEFAULT_wxUSE_APPLE_IEEE=yes
764
765 DEFAULT_wxUSE_LOG=yes
766
767 DEFAULT_wxUSE_GUI=yes
768
769 DEFAULT_wxUSE_ZLIB=yes
770 DEFAULT_wxUSE_LIBPNG=yes
771 DEFAULT_wxUSE_LIBGIF=yes
772 DEFAULT_wxUSE_LIBJPEG=yes
773 DEFAULT_wxUSE_ODBC=no
774
073478b3 775 DEFAULT_wxUSE_STD_IOSTREAM=no
9a98a854
VZ
776 DEFAULT_wxUSE_FILE=yes
777 DEFAULT_wxUSE_TEXTFILE=yes
778 DEFAULT_wxUSE_TIMEDATE=yes
2749089a 779 DEFAULT_wxUSE_WAVE=no
9a98a854
VZ
780 DEFAULT_wxUSE_INTL=yes
781 DEFAULT_wxUSE_CONFIG=yes
782 DEFAULT_wxUSE_STREAMS=yes
783 DEFAULT_wxUSE_SOCKETS=yes
784 DEFAULT_wxUSE_SERIAL=yes
785 DEFAULT_wxUSE_JOYSTICK=yes
786 DEFAULT_wxUSE_DYNLIB_CLASS=yes
787 DEFAULT_wxUSE_LONGLONG=no
788
789 DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=yes
790 DEFAULT_wxUSE_NORMALIZED_PS_FONTS=yes
791 DEFAULT_wxUSE_POSTSCRIPT=yes
792
793 DEFAULT_wxUSE_X_RESOURCES=no
794 DEFAULT_wxUSE_CLIPBOARD=yes
795 DEFAULT_wxUSE_TOOLTIPS=yes
796 DEFAULT_wxUSE_DRAG_AND_DROP=yes
797 DEFAULT_wxUSE_SPLINES=yes
798
799 DEFAULT_wxUSE_MDI_ARCHITECTURE=yes
800 DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=yes
801 DEFAULT_wxUSE_PRINTING_ARCHITECTURE=yes
802
803 DEFAULT_wxUSE_PROLOGIO=yes
804 DEFAULT_wxUSE_RESOURCES=yes
805 DEFAULT_wxUSE_CONSTRAINTS=yes
806 DEFAULT_wxUSE_IPC=yes
807 DEFAULT_wxUSE_HELP=yes
808 DEFAULT_wxUSE_WXTREE=yes
809 DEFAULT_wxUSE_METAFILE=yes
810
811 DEFAULT_wxUSE_COMMONDLGS=yes
ce4169a4 812 DEFAULT_wxUSE_DIRDLG=yes
c11584af 813 DEFAULT_wxUSE_TEXTDLG=yes
a641505f 814 DEFAULT_wxUSE_STARTUP_TIPS=yes
ce4169a4 815 DEFAULT_wxUSE_PROGRESSDLG=yes
9a98a854 816 DEFAULT_wxUSE_MINIFRAME=yes
d4c241b9
RR
817 DEFAULT_wxUSE_HTML=yes
818 DEFAULT_wxUSE_FS_INET=yes
819 DEFAULT_wxUSE_FS_ZIP=yes
820 DEFAULT_wxUSE_BUSYINFO=yes
821 DEFAULT_wxUSE_ZIPSTREAM=yes
9a98a854
VZ
822 DEFAULT_wxUSE_VALIDATORS=yes
823
824 DEFAULT_wxUSE_ACCEL=yes
825 DEFAULT_wxUSE_CARET=yes
826 DEFAULT_wxUSE_BMPBUTTON=yes
827 DEFAULT_wxUSE_CHECKBOX=yes
828 DEFAULT_wxUSE_CHECKLST=yes
ce4169a4 829 DEFAULT_wxUSE_CHOICE=yes
9a98a854
VZ
830 DEFAULT_wxUSE_COMBOBOX=yes
831 DEFAULT_wxUSE_GAUGE=yes
832 DEFAULT_wxUSE_GRID=yes
833 DEFAULT_wxUSE_IMAGLIST=yes
834 DEFAULT_wxUSE_LISTBOX=yes
835 DEFAULT_wxUSE_LISTCTRL=yes
836 DEFAULT_wxUSE_NOTEBOOK=yes
837 DEFAULT_wxUSE_RADIOBOX=yes
838 DEFAULT_wxUSE_RADIOBTN=yes
e602002e 839 DEFAULT_wxUSE_SASH=yes
9a98a854
VZ
840 DEFAULT_wxUSE_SCROLLBAR=yes
841 DEFAULT_wxUSE_SLIDER=yes
842 DEFAULT_wxUSE_SPINBTN=yes
843 DEFAULT_wxUSE_SPLITTER=yes
844 DEFAULT_wxUSE_STATBMP=yes
845 DEFAULT_wxUSE_STATBOX=yes
846 DEFAULT_wxUSE_STATLINE=yes
847 DEFAULT_wxUSE_STATUSBAR=yes
848 DEFAULT_wxUSE_TABDIALOG=no
849 DEFAULT_wxUSE_TOOLBAR=yes
850 DEFAULT_wxUSE_TREECTRL=yes
851
852 DEFAULT_wxUSE_UNICODE=no
853 DEFAULT_wxUSE_WCSRTOMBS=no
854fi
855
143121c5 856dnl WX_ARG_WITH should be used to select whether an external package will be
9a98a854 857dnl used or not, to configure compile-time features of this package itself,
143121c5 858dnl use WX_ARG_ENABLE instead
9a98a854
VZ
859
860dnl ============================
861dnl external package dependecies
862dnl ============================
863
143121c5
VZ
864dnl these options use AC_ARG_WITH and not WX_ARG_WITH on purpose - we cache
865dnl these values manually
ced859c3 866for toolkit in `echo $ALL_TOOLKITS`; do
143121c5
VZ
867 LINE=`grep "wxUSE_$toolkit" ${wx_arg_cache_file}`
868 if test "x$LINE" != x ; then
869 has_toolkit_in_cache=1
870 eval "DEFAULT_$LINE"
ced859c3 871 eval "CACHE_$toolkit=1"
143121c5
VZ
872 fi
873done
874
ced859c3
VZ
875AC_ARG_WITH(gtk, [ --with-gtk use GTK+], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1])
876AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1])
877AC_ARG_WITH(wine, [ --with-wine use WINE], [wxUSE_WINE="$withval" CACHE_WINE=1 TOOLKIT_GIVEN=1])
878AC_ARG_WITH(cygwin, [ --with-cygwin use Cygwin for MS-Windows], [wxUSE_CYGWIN="$withval" CACHE_CYGWIN=1 TOOLKIT_GIVEN=1])
879AC_ARG_WITH(mingw, [ --with-mingw use GCC Minimal MS-Windows], [wxUSE_MINGW="$withval" CACHE_MINGW=1 TOOLKIT_GIVEN=1])
143121c5 880
a9b5e89f
VZ
881AC_ARG_WITH(gtk-prefix, [ --with-gtk-prefix=PFX Prefix where GTK is installed],
882 gtk_config_prefix="$withval", gtk_config_prefix="")
883AC_ARG_WITH(gtk-exec-prefix, [ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed],
884 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
885
143121c5
VZ
886WX_ARG_WITH(dmalloc, [ --with-dmalloc use dmalloc library (www.letters.com/dmalloc)], wxUSE_DMALLOC)
887WX_ARG_WITH(zlib, [ --with-zlib use zlib for LZW compression], wxUSE_ZLIB)
888WX_ARG_WITH(libpng, [ --with-libpng use libpng (PNG image format)], wxUSE_LIBPNG)
889WX_ARG_WITH(libgif, [ --with-libgif use libgif (GIF file format)], wxUSE_LIBGIF)
890WX_ARG_WITH(libjpeg, [ --with-libjpeg use libjpeg (JPEG file format)], wxUSE_LIBJPEG)
891WX_ARG_WITH(opengl, [ --with-opengl use OpenGL (or Mesa)], wxUSE_OPENGL)
892WX_ARG_WITH(odbc, [ --with-odbc use the IODBC and wxODBC classes], wxUSE_ODBC)
9a98a854
VZ
893
894dnl ====================
895dnl compile-time options
896dnl ====================
897
898dnl ---------------------------------------------------------------------------
899dnl compile options
900dnl ---------------------------------------------------------------------------
901
2aa88730 902WX_ARG_ENABLE(shared, [ --enable-shared create shared library code], wxUSE_SHARED)
143121c5 903WX_ARG_ENABLE(optimise, [ --enable-optimise create optimised code], wxUSE_OPTIMISE)
143121c5 904WX_ARG_ENABLE(debug, [ --enable-debug same as debug_flag and debug_info], wxUSE_DEBUG)
70d1b3cf
VZ
905
906if test "$wxUSE_DEBUG" = "yes"; then
907 DEFAULT_wxUSE_DEBUG_FLAG=yes
908 DEFAULT_wxUSE_DEBUG_INFO=yes
909elif test "$wxUSE_DEBUG" = "no"; then
910 DEFAULT_wxUSE_DEBUG_FLAG=no
911 DEFAULT_wxUSE_DEBUG_INFO=no
912fi
913
f7bdcdd7
RR
914WX_ARG_ENABLE(debug_flag, [ --enable-debug_flag set __WXDEBUG__ flag (recommended for developers!)], wxUSE_DEBUG_FLAG)
915WX_ARG_ENABLE(debug_info, [ --enable-debug_info create code with debugging information], wxUSE_DEBUG_INFO)
916WX_ARG_ENABLE(debug_gdb, [ --enable-debug_gdb create code with extra GDB debugging information], wxUSE_DEBUG_GDB)
917WX_ARG_ENABLE(debug_cntxt, [ --enable-debug_cntxt use wxDebugContext], wxUSE_DEBUG_CONTEXT)
918WX_ARG_ENABLE(mem_tracing, [ --enable-mem_tracing create code with memory tracing], wxUSE_MEM_TRACING)
919WX_ARG_ENABLE(profile, [ --enable-profile create code with profiling information], wxUSE_PROFILE)
920WX_ARG_ENABLE(no_rtti, [ --enable-no_rtti create code without RTTI information], wxUSE_NO_RTTI)
921WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without exceptions information], wxUSE_NO_EXCEPTIONS)
5586805b
RR
922WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE)
923WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS)
9a98a854
VZ
924
925dnl ---------------------------------------------------------------------------
926dnl --disable-gui will build only non-GUI part of wxWindows
927dnl
928dnl NB: this is still in testing stage, don't use if you don't know what you're
929dnl doing
930dnl ---------------------------------------------------------------------------
931
143121c5 932WX_ARG_ENABLE(gui, [ --enable-gui use GUI classes], wxUSE_GUI)
9a98a854
VZ
933
934dnl ---------------------------------------------------------------------------
935dnl (small) optional non GUI classes
936dnl ---------------------------------------------------------------------------
937
fd15d8f1
RR
938WX_ARG_ENABLE(intl, [ --enable-intl use internationalization system], wxUSE_INTL)
939WX_ARG_ENABLE(config, [ --enable-config use wxConfig (and derived) classes], wxUSE_CONFIG)
940WX_ARG_ENABLE(sockets, [ --enable-sockets use socket/network classes], wxUSE_SOCKETS)
941WX_ARG_ENABLE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC)
942WX_ARG_ENABLE(apple_ieee, [ --enable-apple_ieee use the Apple IEEE codec], wxUSE_APPLE_IEEE)
943WX_ARG_ENABLE(timedate, [ --enable-timedate use date/time classes], wxUSE_TIMEDATE)
944WX_ARG_ENABLE(wave, [ --enable-wave use wxWave class], wxUSE_WAVE)
945WX_ARG_ENABLE(fraction, [ --enable-fraction use wxFraction class], wxUSE_FRACTION)
946WX_ARG_ENABLE(dynlib, [ --enable-dynlib use wxLibrary class for DLL loading], wxUSE_DYNLIB_CLASS)
947WX_ARG_ENABLE(longlong, [ --enable-longlong use wxLongLong class], wxUSE_LONGLONG)
948WX_ARG_ENABLE(log, [ --enable-log use logging system], wxUSE_LOG)
949WX_ARG_ENABLE(streams, [ --enable-streams use wxStream etc classes], wxUSE_STREAMS)
950WX_ARG_ENABLE(file, [ --enable-file use wxFile classes], wxUSE_FILE)
951WX_ARG_ENABLE(textfile, [ --enable-textfile use wxTextFile classes], wxUSE_TEXTFILE)
952WX_ARG_ENABLE(unicode, [ --enable-unicode compile wxString with Unicode support], wxUSE_UNICODE)
953WX_ARG_ENABLE(wcsrtombs, [ --enable-wcsrtombs use wcsrtombs instead of buggy (GNU libc1/Linux libc5) wcstombs], wxUSE_WCSRTOMBS)
954WX_ARG_ENABLE(wxprintfv, [ --enable-wxprintfv use wxWindows implementation of vprintf()], wxUSE_EXPERIMENTAL_PRINTF)
955WX_ARG_ENABLE(joystick, [ --enable-joystick compile in joystick support (Linux only)], wxUSE_JOYSTICK)
956WX_ARG_ENABLE(std_iostreams, [ --enable-std_iostreams use standard C++ stream classes], wxUSE_STD_IOSTREAM)
e3e717ec
VZ
957WX_ARG_ENABLE(fs_inet, [ --enable-fs_inet use virtual HTTP/FTP filesystems], wxUSE_FS_INET)
958WX_ARG_ENABLE(fs_zip, [ --enable-fs_zip use virtual ZIP filesystems], wxUSE_FS_ZIP)
d78b3d64 959WX_ARG_ENABLE(zipstream, [ --enable-zipstream use wxZipInputStream], wxUSE_ZIPSTREAM)
9a98a854
VZ
960
961dnl ---------------------------------------------------------------------------
962dnl "big" options (i.e. those which change a lot of things throughout the library)
963dnl ---------------------------------------------------------------------------
964
143121c5
VZ
965WX_ARG_ENABLE(threads, [ --enable-threads use threads], wxUSE_THREADS)
966WX_ARG_ENABLE(serial, [ --enable-serial use class serialization], wxUSE_SERIAL)
9a98a854
VZ
967
968dnl ---------------------------------------------------------------------------
969dnl "big" GUI options
970dnl ---------------------------------------------------------------------------
971
143121c5
VZ
972WX_ARG_ENABLE(docview, [ --enable-docview use document view architecture], wxUSE_DOC_VIEW_ARCHITECTURE)
973WX_ARG_ENABLE(help, [ --enable-help use help (using external browser at present)], wxUSE_HELP)
974WX_ARG_ENABLE(constraints, [ --enable-constraints use layout-constraints system], wxUSE_CONSTRAINTS)
975WX_ARG_ENABLE(printarch, [ --enable-printarch use printing architecture], wxUSE_PRINTING_ARCHITECTURE)
976WX_ARG_ENABLE(mdi, [ --enable-mdi use multiple document interface architecture], wxUSE_MDI_ARCHITECTURE)
9a98a854
VZ
977
978dnl ---------------------------------------------------------------------------
979dnl PostScript options
980dnl ---------------------------------------------------------------------------
143121c5 981WX_ARG_ENABLE(postscript, [ --enable-postscript use wxPostscriptDC device context (default for gtk+)], wxUSE_POSTSCRIPT)
9a98a854
VZ
982
983dnl VZ: these options seem to be always on, if someone wants to change it please do
143121c5
VZ
984dnl WX_ARG_ENABLE(PS-normalized, [ --enable-PS-normalized use normalized PS fonts], dnl wxUSE_NORMALIZED_PS_FONTS)
985dnl WX_ARG_ENABLE(afmfonts, [ --enable-afmfonts use Adobe Font Metric Font table], dnl wxUSE_AFM_FOR_POSTSCRIPT)
9a98a854
VZ
986
987dnl ---------------------------------------------------------------------------
988dnl resources
989dnl ---------------------------------------------------------------------------
143121c5
VZ
990WX_ARG_ENABLE(prologio, [ --enable-prologio use Prolog IO library], wxUSE_PROLOGIO)
991WX_ARG_ENABLE(resources, [ --enable-resources use wxWindows resources], wxUSE_RESOURCES)
992
993WX_ARG_ENABLE(xresources, [ --enable-xresources use X resources for save (default for gtk+)], wxUSE_X_RESOURCES)
9a98a854 994
9a98a854
VZ
995dnl ---------------------------------------------------------------------------
996dnl IPC &c
997dnl ---------------------------------------------------------------------------
9a98a854 998
143121c5
VZ
999WX_ARG_ENABLE(clipboard, [ --enable-clipboard use wxClipboard classes], wxUSE_CLIPBOARD)
1000WX_ARG_ENABLE(dnd, [ --enable-dnd use Drag'n'Drop classes], wxUSE_DRAG_AND_DROP)
1001
1002dnl TODO: doesn't work yet
1003WX_ARG_ENABLE(wxtree, [ --enable-wxtree make wxTree library], wxUSE_WXTREE)
9a98a854
VZ
1004
1005dnl ---------------------------------------------------------------------------
1006dnl optional GUI controls (in alphabetical order except the first one)
1007dnl ---------------------------------------------------------------------------
1008
143121c5 1009WX_ARG_ENABLE(controls, [ --enable-controls use all usual controls], wxUSE_CONTROLS)
9a98a854
VZ
1010
1011dnl even with --enable-controls, some may be disabled by giving
1012dnl --disable-<control> later on the command line - but by default all will be
1013dnl used (and vice versa)
1014if test "$wxUSE_CONTROLS" = "yes"; then
1015 DEFAULT_wxUSE_ACCEL=yes
1016 DEFAULT_wxUSE_CARET=yes
1017 DEFAULT_wxUSE_COMBOBOX=yes
1018 DEFAULT_wxUSE_BMPBUTTON=yes
1019 DEFAULT_wxUSE_CHECKBOX=yes
1020 DEFAULT_wxUSE_CHECKLISTBOX=yes
ce4169a4 1021 DEFAULT_wxUSE_CHOICE=yes
9a98a854
VZ
1022 DEFAULT_wxUSE_GAUGE=yes
1023 DEFAULT_wxUSE_GRID=yes
1024 DEFAULT_wxUSE_IMAGLIST=yes
1025 DEFAULT_wxUSE_LISTBOX=yes
1026 DEFAULT_wxUSE_LISTCTRL=yes
1027 DEFAULT_wxUSE_NOTEBOOK=yes
1028 DEFAULT_wxUSE_RADIOBOX=yes
1029 DEFAULT_wxUSE_RADIOBTN=yes
1030 DEFAULT_wxUSE_SASH=yes
1031 DEFAULT_wxUSE_SCROLLBAR=yes
1032 DEFAULT_wxUSE_SLIDER=yes
1033 DEFAULT_wxUSE_SPINBTN=yes
1034 DEFAULT_wxUSE_SPLITTER=yes
1035 DEFAULT_wxUSE_STATBMP=yes
1036 DEFAULT_wxUSE_STATBOX=yes
1037 DEFAULT_wxUSE_STATLINE=yes
1038 DEFAULT_wxUSE_STATUSBAR=yes
1039 DEFAULT_wxUSE_TAB_DIALOG=yes
1040 DEFAULT_wxUSE_TOOLBAR=yes
1041 DEFAULT_wxUSE_TOOLTIPS=yes
1042 DEFAULT_wxUSE_TREECTRL=yes
1043elif test "$wxUSE_CONTROLS" = "no"; then
1044 DEFAULT_wxUSE_ACCEL=no
1045 DEFAULT_wxUSE_CARET=no
1046 DEFAULT_wxUSE_COMBOBOX=no
1047 DEFAULT_wxUSE_BMPBUTTON=no
1048 DEFAULT_wxUSE_CHECKBOX=no
1049 DEFAULT_wxUSE_CHECKLISTBOX=no
ce4169a4 1050 DEFAULT_wxUSE_CHOICE=no
9a98a854
VZ
1051 DEFAULT_wxUSE_GAUGE=no
1052 DEFAULT_wxUSE_GRID=no
1053 DEFAULT_wxUSE_IMAGLIST=no
1054 DEFAULT_wxUSE_LISTBOX=no
1055 DEFAULT_wxUSE_LISTCTRL=no
1056 DEFAULT_wxUSE_NOTEBOOK=no
1057 DEFAULT_wxUSE_RADIOBOX=no
1058 DEFAULT_wxUSE_RADIOBTN=no
1059 DEFAULT_wxUSE_SASH=no
1060 DEFAULT_wxUSE_SCROLLBAR=no
1061 DEFAULT_wxUSE_SLIDER=no
1062 DEFAULT_wxUSE_SPINBTN=no
1063 DEFAULT_wxUSE_SPLITTER=no
1064 DEFAULT_wxUSE_STATBMP=no
1065 DEFAULT_wxUSE_STATBOX=no
1066 DEFAULT_wxUSE_STATLINE=no
1067 DEFAULT_wxUSE_STATUSBAR=no
1068 DEFAULT_wxUSE_TAB_DIALOG=no
1069 DEFAULT_wxUSE_TOOLBAR=no
1070 DEFAULT_wxUSE_TOOLTIPS=no
1071 DEFAULT_wxUSE_TREECTRL=no
1072fi
1073
143121c5
VZ
1074WX_ARG_ENABLE(accel, [ --enable-accel use accelerators], wxUSE_ACCEL)
1075WX_ARG_ENABLE(caret, [ --enable-caret use wxCaret class], wxUSE_CARET)
1076WX_ARG_ENABLE(bmpbutton, [ --enable-bmpbutton use wxBitmapButton class], wxUSE_BMPBUTTON)
1077WX_ARG_ENABLE(checkbox, [ --enable-checkbox use wxCheckBox class], wxUSE_CHECKBOX)
1078WX_ARG_ENABLE(checklst, [ --enable-checklst use wxCheckListBox (listbox with checkboxes) class], wxUSE_CHECKLST)
ce4169a4
RR
1079WX_ARG_ENABLE(choice, [ --enable-choice use wxChoice class], wxUSE_CHOICE)
1080WX_ARG_ENABLE(combobox, [ --enable-combobox use wxComboBox classes], wxUSE_COMBOBOX)
143121c5
VZ
1081WX_ARG_ENABLE(gauge, [ --enable-gauge use wxGauge class], wxUSE_GAUGE)
1082WX_ARG_ENABLE(grid, [ --enable-grid use wxGrid class], wxUSE_GRID)
1083WX_ARG_ENABLE(imaglist, [ --enable-imaglist use wxImageList class], wxUSE_IMAGLIST)
1084WX_ARG_ENABLE(listbox, [ --enable-listbox use wxListBox class], wxUSE_LISTBOX)
1085WX_ARG_ENABLE(listctrl, [ --enable-listctrl use wxListCtrl class], wxUSE_LISTCTRL)
1086WX_ARG_ENABLE(notebook, [ --enable-notebook use wxNotebook class], wxUSE_NOTEBOOK)
1087WX_ARG_ENABLE(radiobox, [ --enable-radiobox use wxRadioBox class], wxUSE_RADIOBOX)
1088WX_ARG_ENABLE(radiobtn, [ --enable-radiobtn use wxRadioButton class], wxUSE_RADIOBTN)
1089WX_ARG_ENABLE(sash, [ --enable-sash use wxSashWindow class], wxUSE_SASH)
1090WX_ARG_ENABLE(scrollbar, [ --enable-scrollbar use wxScrollBar class and scrollable windows], wxUSE_SCROLLBAR)
1091WX_ARG_ENABLE(slider, [ --enable-slider use wxSlider class], wxUSE_SLIDER)
1092WX_ARG_ENABLE(spinbtn, [ --enable-spinbtn use wxSpinButton class], wxUSE_SPINBTN)
1093WX_ARG_ENABLE(splitter, [ --enable-splitter use wxSplitterWindow class], wxUSE_SPLITTER)
1094WX_ARG_ENABLE(statbmp, [ --enable-statbmp use wxStaticBitmap class], wxUSE_STATBMP)
1095WX_ARG_ENABLE(statbox, [ --enable-statbox use wxStaticBox class], wxUSE_STATBOX)
1096WX_ARG_ENABLE(statline, [ --enable-statline use wxStaticLine class], wxUSE_STATLINE)
1097WX_ARG_ENABLE(statusbar, [ --enable-statusbar use wxStatusBar class], wxUSE_STATUSBAR)
1098WX_ARG_ENABLE(tabdialog, [ --enable-tabdialog use wxTabControl class], wxUSE_TABDIALOG)
1099WX_ARG_ENABLE(toolbar, [ --enable-toolbar use wxToolBar class], wxUSE_TOOLBAR)
1100WX_ARG_ENABLE(treectrl, [ --enable-treectrl use wxTreeCtrl class], wxUSE_TREECTRL)
9a98a854
VZ
1101
1102dnl ---------------------------------------------------------------------------
1103dnl misc GUI options
1104dnl ---------------------------------------------------------------------------
1105
143121c5 1106WX_ARG_ENABLE(commondlg, [ --enable-commondlg use common dialogs (wxDirDialog, wxProgressDialog, wxTextDialog, ...)], wxUSE_COMMONDLGS)
ce4169a4 1107WX_ARG_ENABLE(dirdlg, [ --enable-dirdlg use wxDirDialog], wxUSE_DIRDLG)
c11584af 1108WX_ARG_ENABLE(textdlg, [ --enable-textdlg use wxTextDialog], wxUSE_TEXTDLG)
a641505f 1109WX_ARG_ENABLE(tipdlg, [ --enable-tipdlg use startup tips], wxUSE_STARTUP_TIPS)
ce4169a4 1110WX_ARG_ENABLE(progressdlg, [ --enable-progressdlg use wxProgressDialog], wxUSE_PROGRESSDLG)
143121c5 1111WX_ARG_ENABLE(miniframe, [ --enable-miniframe use wxMiniFrame class], wxUSE_MINIFRAME)
5526e819 1112WX_ARG_ENABLE(html, [ --enable-html use wxHTML sub-library], wxUSE_HTML)
143121c5
VZ
1113WX_ARG_ENABLE(tooltips, [ --enable-tooltips use wxToolTip class], wxUSE_TOOLTIPS)
1114WX_ARG_ENABLE(splines, [ --enable-splines use spline drawing code], wxUSE_SPLINES)
1115WX_ARG_ENABLE(validators, [ --enable-validators use wxValidator and derived classes], wxUSE_VALIDATORS)
d78b3d64 1116WX_ARG_ENABLE(busyinfo, [ --enable-busyinfo use wxBusyInfo], wxUSE_BUSYINFO)
143121c5
VZ
1117
1118dnl cache the options values before (may be) aborting below
1119WX_ARG_CACHE_FLUSH
9a98a854
VZ
1120
1121dnl check that no more than one toolkit is given and that if none are given that
1122dnl we have a default one
efeb0365 1123
143121c5
VZ
1124AC_MSG_CHECKING(for toolkit)
1125
70d1b3cf
VZ
1126if test "$TOOLKIT_GIVEN" = 1; then
1127 dnl convert "yes" to 1 and "no" to 0
ced859c3 1128 for toolkit in `echo $ALL_TOOLKITS`; do
143121c5
VZ
1129 var=wxUSE_$toolkit
1130 eval "value=\$${var}"
1131 eval "$var=`echo \$value | sed -e "s/yes/1/" -e "s/no/0/"`"
1132 done
70d1b3cf
VZ
1133else
1134 dnl try to guess the most apropriate toolkit for this platform
ced859c3 1135 for toolkit in `echo $ALL_TOOLKITS`; do
143121c5
VZ
1136 if test "$has_toolkit_in_cache" != 1; then
1137 var=DEFAULT_DEFAULT_wxUSE_$toolkit
1138 else
1139 var=DEFAULT_wxUSE_$toolkit
1140 fi
1141 eval "wxUSE_$toolkit=\$${var}"
1142 done
70d1b3cf 1143fi
efeb0365 1144
ced859c3
VZ
1145dnl we suppose that expr exists...
1146NUM_TOOLKITS=`expr ${wxUSE_GTK:-0} + ${wxUSE_MOTIF:-0} + ${wxUSE_WINE:-0} + ${wxUSE_MINGW:-0} + ${wxUSE_CYGWIN:-0}`
9a98a854
VZ
1147
1148case "$NUM_TOOLKITS" in
1149 1)
1150 ;;
1151 0)
143121c5 1152 AC_MSG_ERROR(Please specify a toolkit - cannot determine the default for ${host})
9a98a854
VZ
1153 ;;
1154 *)
143121c5 1155 AC_MSG_ERROR(Please specify at most one toolkit (may be some are cached?))
9a98a854
VZ
1156esac
1157
143121c5 1158dnl cache the wxUSE_<TOOLKIT> values too
ced859c3 1159for toolkit in `echo $ALL_TOOLKITS`; do
143121c5
VZ
1160 var=wxUSE_$toolkit
1161 eval "value=\$${var}"
1162 if test "x$value" != x; then
ced859c3
VZ
1163 cache_var=CACHE_$toolkit
1164 eval "cache=\$${cache_var}"
1165 if test "$cache" = 1; then
1166 echo "$var=$value" >> ${wx_arg_cache_file}
1167 fi
143121c5
VZ
1168 if test "$value" = 1; then
1169 AC_MSG_RESULT(`echo $toolkit | tr [[A-Z]] [[a-z]]`)
1170 fi
1171 fi
1172done
1173
9a98a854
VZ
1174dnl ---------------------------------------------------------------------------
1175dnl Checks for programs
1176dnl ---------------------------------------------------------------------------
1177
1178dnl flush the cache because checking for programs might abort
1179AC_CACHE_SAVE
1180
1181dnl cross-compiling support: we're cross compiling if the build system is
1182dnl different from the target one (assume host and target be always the same)
1183if eval "test $host != $build"; then
214960fb
HH
1184 if eval "test $host_alias != NONE"; then
1185 CC=$host_alias-gcc
1186 CXX=$host_alias-c++
1187 AR=$host_alias-ar
1188 RANLIB=$host_alias-ranlib
1189 DLLTOOL=$host_alias-dlltool
1190 LD=$host_alias-ld
1191 NM=$host_alias-nm
1192 STRIP=$host_alias-strip
9a98a854
VZ
1193 fi
1194fi
1195
1196dnl C-compiler checks
1197dnl defines CC with the compiler to use
1198dnl defines GCC with yes if using gcc
1199dnl defines GCC empty if not using gcc
1200dnl defines CFLAGS
1201AC_PROG_CC
1202
1203CFLAGS=`echo "$CFLAGS" | sed 's/-g//g'`
1204
1205dnl what is the c-preprocessor
1206dnl defines CPP with the c-preprocessor
1207AC_PROG_CPP
1208
1209dnl is -traditional needed for correct compilations
1210dnl adds -traditional for gcc if needed
1211AC_PROG_GCC_TRADITIONAL
1212
1213AC_LANG_SAVE
1214AC_LANG_CPLUSPLUS
1215
1216dnl C++-compiler checks
1217dnl defines CXX with the compiler to use
1218dnl defines GXX with yes if using gxx
1219dnl defines GXX empty if not using gxx
1220dnl defines CXXFLAGS
1221AC_PROG_CXX
1222
1223dnl what is the C++-preprocessor
1224dnl defines CXXCPP with the C++-preprocessor
1225AC_PROG_CXXCPP
1226
1227CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-g//g'`
1228
1229AC_LANG_RESTORE
1230
1231dnl ranlib command
1232dnl defines RANLIB with the appropriate command
1233AC_PROG_RANLIB
1234
1235dnl ar command
1236dnl defines AR with the appropriate command
1237AC_CHECK_PROG(AR, ar, ar, ar)
1238
1239dnl install checks
1240dnl defines INSTALL with the appropriate command
1241AC_PROG_INSTALL
1242
9a98a854
VZ
1243dnl strip command
1244dnl defines STRIP as strip or nothing if not found
1245AC_CHECK_PROG(STRIP, strip, strip, true)
1246
1247dnl check if VPATH works
1248AC_MSG_CHECKING("make for VPATH support")
1249dnl create Makefile
1250cat - << EOF > confMake
1251check : file
1252 cp \$? \$@
1253 cp \$? final_file
1254EOF
1255
1256if test ! -d sub ; then
1257 mkdir sub
1258fi
1259echo dummy > sub/file
1260${MAKE-make} -f confMake VPATH=sub 2> config.log > /dev/null
1261RESULT=$?
1262rm -f sub/file check final_file confMake
1263rmdir sub
1264if test "$RESULT" = 0; then
1265 AC_MSG_RESULT(yes)
1266else
1267 AC_MSG_RESULT(no)
1268 AC_MSG_ERROR(
1269You need a make-utility that is able to use the variable
1270VPATH correctly.
1271If your version of make does not support VPATH correctly,
1272please install GNU-make (possibly as gmake), and start
1273configure with the following command:
1274export MAKE=gmake; ./configure for sh-type shells
1275setenv MAKE gmake; ./configure for csh-type shells
1276Also please do remember to use gmake in this case every time
1277you are trying to compile.
1278)
1279fi
1280
1281dnl YACC checks
1282dnl defines YACC with the appropriate command
1283AC_PROG_YACC
1284
1285dnl LEX checks
1286dnl defines LEX with the appropriate command
1287dnl defines LEXLIB with the appropriate library
2aa88730 1288AC_PROG_LEX
9a98a854 1289
c7114f59
VZ
1290dnl needed for making link to setup.h
1291AC_PROG_LN_S
1292
9a98a854
VZ
1293dnl ---------------------------------------------------------------------------
1294dnl Define search path for includes and libraries: all headers and libs will be
1295dnl looked for in all directories of this path
1296dnl ---------------------------------------------------------------------------
1297
1298SEARCH_INCLUDE="\
1299 /usr/Motif-1.2/include \
1300 /usr/Motif-2.1/include \
1301 \
1302 /usr/include/Motif1.2 \
1303 /opt/xpm/include/X11 \
1304 \
1305 /usr/Motif1.2/include \
1306 /usr/dt/include \
1307 /usr/include/Xm \
1308 \
1309 /usr/X11R6/include \
1310 /usr/X11R5/include \
1311 /usr/X11R4/include \
1312 \
1313 /usr/X11R6/lib \
1314 /usr/X11R5/lib \
1315 /usr/X11R4/lib \
1316 \
1317 /usr/include/X11R6 \
1318 /usr/include/X11R5 \
1319 /usr/include/X11R4 \
1320 \
1321 /usr/local/X11R6/include \
1322 /usr/local/X11R5/include \
1323 /usr/local/X11R4/include \
1324 \
1325 /usr/local/include/X11R6 \
1326 /usr/local/include/X11R5 \
1327 /usr/local/include/X11R4 \
1328 \
1329 /usr/X11/include \
1330 /usr/include/X11 \
1331 /usr/local/X11/include \
1332 /usr/local/include/X11 \
1333 \
1334 /usr/X386/include \
1335 /usr/x386/include \
1336 /usr/XFree86/include/X11 \
1337 \
1338 /usr/include \
5a92d200
RR
1339 /usr/local/include \
1340 \
9a98a854 1341 /usr/include/gtk \
5a92d200 1342 /usr/local/include/gtk \
9a98a854 1343 /usr/include/glib \
5a92d200
RR
1344 /usr/local/include/glib \
1345 \
1346 /usr/include/qt \
1347 /usr/local/include/qt \
1348 \
a9b5e89f 1349 /usr/include/windows \
5a92d200
RR
1350 /usr/include/wine \
1351 /usr/local/include/wine \
1352 \
9a98a854
VZ
1353 /usr/unsupported/include \
1354 /usr/athena/include \
1355 /usr/local/x11r5/include \
1356 /usr/lpp/Xamples/include \
1357 \
9a98a854
VZ
1358 /usr/openwin/include \
1359 /usr/openwin/share/include \
1360 "
1361
1362SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s/include/lib/g` "
1363
1364dnl ------------------------------------------------------------------------
1365dnl Check for libraries
1366dnl ------------------------------------------------------------------------
1367
143121c5 1368dnl flush the cache because checking for libraries below might abort
9a98a854
VZ
1369AC_CACHE_SAVE
1370
9a98a854
VZ
1371dnl ----------------------------------------------------------------
1372dnl search for toolkit (widget sets)
1373dnl ----------------------------------------------------------------
1374
1375TOOLKIT=
9a98a854
VZ
1376TOOLKIT_INCLUDE=
1377
073478b3
RR
1378GUIOBJS=
1379COMMONOBJS=
1380GENERICOBJS=
1381
9a98a854
VZ
1382GUI_TK_LIBRARY=
1383GUI_TK_LINK=
1384
1385WXGTK12=
1386
5a92d200
RR
1387WXWINE=
1388
80d895cd
HH
1389dnl Extension for programs; '.exe' for msw builds
1390PROGRAM_EXT=
1391
4d19d979 1392if test "$wxUSE_CYGWIN" = 1 || test "$wxUSE_MINGW" = 1 ; then
e4b4d60e
RR
1393 AC_MSG_CHECKING(for Windows headers)
1394 WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, windows.h)
1395 INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS msw"
bf86bd78 1396
e4b4d60e
RR
1397 dnl --- Quick & Dirty ; link against most/all libraries
1398 dnl --- This will bloat the executable, but it'll work for now...
1db46618 1399 LIBS="$LIBS -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -lcrtdll -ladvapi32 -lwsock32"
bf86bd78 1400
e4b4d60e
RR
1401 if test "$ac_find_includes" != "" ; then
1402 AC_MSG_RESULT(found $ac_find_includes)
1403 TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE -I$ac_find_includes"
1404 else
1405 AC_MSG_RESULT(no)
1406 if test "$cross_compiling" != "yes" ; then
1407 AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
1408 fi
1409 fi
a9b5e89f 1410
e4b4d60e
RR
1411 TOOLKIT=MSW
1412
1413 GUIOBJS=MSW_GUIOBJS
a4aad961 1414 GUIHEADERS=MSW_HEADERS
e4b4d60e
RR
1415 COMMONOBJS=MSW_COMMONOBJS
1416 GENERICOBJS=MSW_GENERICOBJS
1417 UNIXOBJS=
a4aad961 1418 GUIDIST=MSW_DIST
80d895cd 1419 PROGRAM_EXT=.exe
a9b5e89f
VZ
1420fi
1421
9a98a854 1422if test "$wxUSE_GTK" = 1; then
073478b3
RR
1423 dnl avoid calling AM_PATH_GTK twice, so check first for the newer version and
1424 dnl only then, if it wasn't found, for an older one
1425 AM_PATH_GTK(1.2.0, WXGTK12=1)
1426 if test "$WXGTK12" != 1; then
1427 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?))
1428 fi
9a98a854 1429
073478b3 1430 TOOLKIT_INCLUDE="$GTK_CFLAGS"
fd9811b1 1431 GUI_TK_LIBRARY="$GTK_LIBS -ldl"
073478b3
RR
1432 TOOLKIT=GTK
1433
2aa88730 1434 GUIHEADERS=GTK_HEADERS
5586805b 1435 GUIOBJS=GTK_GUIOBJS
073478b3
RR
1436 COMMONOBJS=GTK_COMMONOBJS
1437 GENERICOBJS=GTK_GENERICOBJS
5586805b
RR
1438 GUIDEPS=GTK_GUIDEPS
1439 COMMONDEPS=GTK_COMMONDEPS
1440 GENERICDEPS=GTK_GENERICDEPS
e4b4d60e 1441 UNIXOBJS=UNIXOBJS
a4aad961 1442 GUIDIST=GTK_DIST
9a98a854
VZ
1443fi
1444
5a92d200
RR
1445if test "$wxUSE_WINE" = 1; then
1446 AC_MSG_CHECKING(for WINE includes)
1447 WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, windows.h)
1448 if test "$ac_find_includes" != "" ; then
1449 AC_MSG_RESULT(found $ac_find_includes)
d1c7e624 1450 TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE -I$ac_find_includes"
5a92d200
RR
1451 else
1452 AC_MSG_RESULT(no)
1453 AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
1454 fi
1455
1456 XPM_LINK=""
1457 AC_MSG_CHECKING(for Xpm library)
1458 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
1459 if test "$ac_find_libraries" != "" ; then
4286a5b5
RR
1460 GUI_TK_LIBRARY="-L$ac_find_libraries"
1461 XPM_LINK="-lXpm"
5a92d200
RR
1462 AC_DEFINE(wxHAVE_LIB_XPM)
1463 AC_MSG_RESULT(found at $ac_find_libraries)
1464 else
1465 AC_MSG_RESULT(no)
1466 AC_MSG_WARN(library will be compiled without support for images in XPM format)
1467 fi
4286a5b5
RR
1468
1469 MESA_LINK=""
1470 AC_MSG_CHECKING(for Mesa library)
1471 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,MesaGL)
1472 if test "$ac_find_libraries" != "" ; then
1473 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -L$ac_find_libraries"
1474 MESA_LINK="-lMesaGL"
1475 AC_MSG_RESULT(found at $ac_find_libraries)
1476 else
1477 AC_MSG_ERROR(no)
1478 fi
5a92d200 1479
4286a5b5 1480 GUI_TK_LINK="-lwine $MESA_LINK $XPM_LINK -lXxf86dga -lXxf86vm -lSM -lICE -lXext -lXmu -lX11 -lncurses -ldl -lm"
5a92d200
RR
1481 GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GUI_TK_LINK"
1482 WXWINE=1
1483 TOOLKIT=MSW
e4b4d60e 1484
a4aad961 1485 GUIHEADERS=MSW_HEADERS
5586805b 1486 GUIOBJS=MSW_GUIOBJS
e4b4d60e
RR
1487 COMMONOBJS=MSW_COMMONOBJS
1488 GENERICOBJS=MSW_GENERICOBJS
5586805b
RR
1489 GUIDEPS=MSW_GUIDEPS
1490 COMMONDEPS=MSW_COMMONDEPS
1491 GENERICDEPS=MSW_GENERICDEPS
e4b4d60e 1492 UNIXOBJS=UNIXOBJS
a4aad961 1493 GUIDIST=MSW_DIST
5a92d200
RR
1494fi
1495
9a98a854 1496if test "$wxUSE_MOTIF" = 1; then
143121c5
VZ
1497 dnl find the X11 include and library files
1498 dnl defines x_includes and x_libraries
1499 AC_PATH_XTRA
1500
1501 if test "$no_x" = "yes"; then
1502 AC_MSG_ERROR(X11 libraries not found, aborting)
1503 fi
1504
1505 TOOLKIT_INCLUDE="$X_CFLAGS"
1506 GUI_TK_LIBRARY="$X_LIBS"
1507
9a98a854 1508 AC_MSG_CHECKING(for Motif/Lesstif includes)
143121c5 1509 WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h)
9a98a854
VZ
1510 if test "$ac_find_includes" != "" ; then
1511 AC_MSG_RESULT(found $ac_find_includes)
1512 else
1513 AC_MSG_RESULT(no)
1514 AC_MSG_ERROR(please set CFLAGS to contain the location of Xm/Xm.h)
1515 fi
1516
1517 AC_MSG_CHECKING(for Motif/Lesstif library)
143121c5 1518 WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm)
9a98a854 1519 if test "$ac_find_libraries" != "" ; then
143121c5
VZ
1520 WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE)
1521 WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY)
9a98a854 1522
143121c5
VZ
1523 CHECK_LINK="$GUI_TK_LIBRARY $ac_path_to_link"
1524 TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE $ac_path_to_include"
9a98a854
VZ
1525 AC_MSG_RESULT(found at $ac_find_libraries)
1526 else
1527 AC_MSG_RESULT(no)
1528 AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm)
1529 fi
1530
1531 AC_MSG_CHECKING(for Xt library)
143121c5 1532 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xt)
9a98a854 1533 if test "$ac_find_libraries" != "" ; then
143121c5
VZ
1534 WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
1535 CHECK_LINK="$GUI_TK_LIBRARY $ac_path_to_link"
9a98a854
VZ
1536 AC_MSG_RESULT(found at $ac_find_libraries)
1537 else
1538 AC_MSG_RESULT(no)
1539 AC_MSG_ERROR(please set LDFLAGS to contain the location of libXt)
1540 fi
1541
1542 XPM_LINK=""
1543 AC_MSG_CHECKING(for Xpm library)
143121c5 1544 WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
9a98a854 1545 if test "$ac_find_libraries" != "" ; then
143121c5
VZ
1546 WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
1547 CHECK_LINK="$GUI_TK_LIBRARY $ac_path_to_link"
9a98a854
VZ
1548 XPM_LINK="-lXpm "
1549 AC_DEFINE(wxHAVE_LIB_XPM)
1550 AC_MSG_RESULT(found at $ac_find_libraries)
1551 else
1552 AC_MSG_RESULT(no)
1553 AC_MSG_WARN(library will be compiled without support for images in XPM format)
1554 fi
1555
96f201da 1556 GUI_TK_LINK="-lXm $XPM_LINK -lXmu -lXt -lX11 -ldl -lm"
143121c5 1557 GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GUI_TK_LINK"
9a98a854 1558 TOOLKIT=MOTIF
073478b3 1559
2aa88730 1560 GUIHEADERS=MOTIF_HEADERS
5586805b 1561 GUIOBJS=MOTIF_GUIOBJS
073478b3
RR
1562 COMMONOBJS=MOTIF_COMMONOBJS
1563 GENERICOBJS=MOTIF_GENERICOBJS
5586805b
RR
1564 GUIDEPS=MOTIF_GUIDEPS
1565 COMMONDEPS=MOTIF_COMMONDEPS
1566 GENERICDEPS=MOTIF_GENERICDEPS
e4b4d60e 1567 UNIXOBJS=UNIXOBJS
a4aad961 1568 GUIDIST=MOTIF_DIST
9a98a854
VZ
1569fi
1570
1571dnl the name of the directory where the files for this toolkit live
1572TOOLKIT_DIR=`echo ${TOOLKIT} | tr "A-Z" "a-z"`
1573
1574dnl the symbol which allows conditional compilation for the given toolkit
48b1d0ff 1575TOOLKIT_DEF="-D__WX${TOOLKIT}__"
9a98a854 1576
517a619d
RR
1577dnl the name of the (libtool) library
1578WX_LIBRARY="wx_${TOOLKIT_DIR}"
1579
70d1b3cf 1580dnl the name of the (libtool) library
2b6f061f
RR
1581WX_LIBRARY_NAME="libwx_${TOOLKIT_DIR}.la"
1582
8e877c19
RR
1583dnl the name of the static library
1584WX_LIBRARY_NAME_STATIC="libwx_${TOOLKIT_DIR}.a"
1585
48b1d0ff 1586dnl the name of the shared library
2aa88730 1587WX_LIBRARY_NAME_SHARED="libwx_${TOOLKIT_DIR}-${WX_RELEASE}.so.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}"
48b1d0ff 1588
48b1d0ff 1589dnl the name of the links to the shared library
2aa88730
RR
1590WX_LIBRARY_LINK1="libwx_${TOOLKIT_DIR}-${WX_RELEASE}.so.${WX_CURRENT}"
1591WX_LIBRARY_LINK2="libwx_${TOOLKIT_DIR}-${WX_RELEASE}.so"
48b1d0ff
RR
1592WX_LIBRARY_LINK3="libwx_${TOOLKIT_DIR}.so"
1593
1594dnl shared library settings
1595SHARED_LD=
1596PIC_FLAG=
1597WX_CREATE_LINKS=
1598
517a619d
RR
1599if test "$wxUSE_SHARED" = "yes"; then
1600 dnl set target to shared
1601 WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_SHARED}"
1602
48b1d0ff
RR
1603case "${host}" in
1604 *-hp-hpux* )
1605 WX_LIBRARY_NAME_SHARED="libwx_${TOOLKIT_DIR}.sl"
1606 SHARED_LD="${CXX} -b -o"
1607 PIC_FLAG="+Z"
1608 ;;
1609 *-*-linux* )
1610 SHARED_LD="${CC} -shared -o"
1611 PIC_FLAG="-fPIC"
517a619d 1612 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1613 WX_CREATE_LINKS="CREATE_LINKS"
1614 ;;
1615 *-*-irix5* | *-*-irix6* )
9c884972
RR
1616 if test "$GCC" = yes ; then
1617 SHARED_LD="${CC} -shared -o"
1618 PIC_FLAG="-fPIC"
1619 else
1620 SHARED_LD="${CXX} -shared -o"
1621 fi
517a619d 1622 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1623 WX_CREATE_LINKS="CREATE_LINKS"
1624 ;;
1625 *-*-solaris2* )
9c884972
RR
1626 if test "$GCC" = yes ; then
1627 SHARED_LD="${CC} -shared -o"
1628 PIC_FLAG="-fPIC"
1629 else
1630 SHARED_LD="${CXX} -G -o"
1631 PIC_FLAG="PIC"
1632 fi
517a619d 1633 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1634 WX_CREATE_LINKS="CREATE_LINKS"
1635 ;;
1636 *-*-sunos4* )
9c884972 1637 SHARED_LD="${CC} -shared -o"
48b1d0ff 1638 PIC_FLAG="-fPIC"
517a619d 1639 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1640 WX_CREATE_LINKS="CREATE_LINKS"
1641 ;;
1642 *-*-freebsd* | *-*-netbsd*)
9c884972 1643 SHARED_LD="${CC} -shared -o"
48b1d0ff 1644 PIC_FLAG="-fPIC"
517a619d 1645 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1646 WX_CREATE_LINKS="CREATE_LINKS"
1647 ;;
1648 *-*-osf* )
1649 SHARED_LD="${CXX} -shared -o"
1650 PIC_FLAG="-fPIC"
517a619d 1651 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1652 WX_CREATE_LINKS="CREATE_LINKS"
1653 ;;
1654 *-*-dgux5* )
1655 SHARED_LD="${CXX} -shared -o"
1656 PIC_FLAG="-fPIC"
517a619d 1657 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1658 WX_CREATE_LINKS="CREATE_LINKS"
1659 ;;
1660 *-*-sysv5* )
9c884972 1661 SHARED_LD="${CC} -shared -o"
48b1d0ff 1662 PIC_FLAG="-fPIC"
517a619d 1663 WX_CREATE_INSTALLED_LINKS="CREATE_INSTALLED_LINKS"
48b1d0ff
RR
1664 WX_CREATE_LINKS="CREATE_LINKS"
1665 ;;
1666 *-*-aix* )
1667 SHARED_LD="/usr/lpp/xlC/bin/makeC++SharedLib -p 0 -o"
1668 ;;
1669 *-*-cygwin32* )
e4b4d60e
RR
1670 dnl only static for now
1671 WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}"
48b1d0ff
RR
1672 ;;
1673 *-*-mingw32* )
e4b4d60e
RR
1674 dnl only static for now
1675 WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}"
48b1d0ff
RR
1676 ;;
1677 *-pc-os2_emx )
1678 ;;
1679 *)
1680 AC_MSG_ERROR(unknown system type ${host}.)
1681esac
9a98a854 1682
517a619d
RR
1683else
1684 dnl set target to static
1685 WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}"
1686fi
1687
9a98a854
VZ
1688dnl ------------------------------------------------------------------------
1689dnl Check for headers
1690dnl ------------------------------------------------------------------------
1691
1692dnl defines HAVE_STRINGS_H (where some string functions live on AIX for example)
1693AC_CHECK_HEADERS(strings.h)
1694dnl defines HAVE_UNISTD_H
1695AC_CHECK_HEADERS(unistd.h)
1696dnl defines HAVE_WCHAR_H
1697AC_CHECK_HEADERS(wchar.h)
1698dnl defines HAVE_WCSTR_H
1699AC_CHECK_HEADERS(wcstr.h)
1700dnl defines HAVE_FNMATCH_H
1701AC_CHECK_HEADERS(fnmatch.h)
2b6f061f 1702dnl defines HAVE_X11_XKBLIB_H
27933891 1703AC_CHECK_HEADERS(X11/XKBlib.h)
9a98a854
VZ
1704
1705dnl ---------------------------------------------------------------------------
1706dnl Checks for typedefs
1707dnl ---------------------------------------------------------------------------
1708
1709dnl defines mode_t if not already defined
1710AC_TYPE_MODE_T
1711dnl defines off_t if not already defined
1712AC_TYPE_OFF_T
1713dnl defines pid_t if not already defined
1714AC_TYPE_PID_T
1715dnl defines size_t if not already defined
1716AC_TYPE_SIZE_T
1717dnl defines uid_t and gid_t if not already defined
1718AC_TYPE_UID_T
1719
1720dnl ---------------------------------------------------------------------------
1721dnl Checks for structures
1722dnl ---------------------------------------------------------------------------
1723
1724dnl ---------------------------------------------------------------------------
1725dnl Checks for compiler characteristics
1726dnl ---------------------------------------------------------------------------
1727
1728dnl defines const to be empty if c-compiler does not support const fully
1729AC_C_CONST
1730dnl defines inline to a sensible value for the c-compiler
1731AC_C_INLINE
1732
1733dnl check the sizes of integral types (give some reasonable default values for
1734dnl cross-compiling)
1735dnl defines the size of certain types of variables in SIZEOF_<TYPE>
d716d967
RR
1736AC_CHECK_SIZEOF(char, 1)
1737AC_CHECK_SIZEOF(short, 2)
9a98a854
VZ
1738AC_CHECK_SIZEOF(int *, 4)
1739AC_CHECK_SIZEOF(int, 4)
1740AC_CHECK_SIZEOF(long, 4)
1741AC_CHECK_SIZEOF(long long, 0)
1742
bcd2b961
VZ
1743dnl for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling)
1744WX_C_BIGENDIAN
239bca2e 1745
9a98a854
VZ
1746dnl check for iostream (as opposed to iostream.h) standard header
1747WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH))
1748
1749dnl check whether C++ compiler supports bool built-in type
1750WX_CPP_BOOL
1751
1752dnl check whether overloading on size_t/int parameter works
1753WX_CPP_SIZE_T_IS_NOT_INT
1754
60b6c062
GL
1755dnl check whether we should define _GNU_SOURCE
1756WX_GNU_EXTENSIONS
1757
9a98a854
VZ
1758dnl ---------------------------------------------------------------------------
1759dnl Check for functions
1760dnl ---------------------------------------------------------------------------
1761
1762dnl check for wcslen
1763AC_CHECK_LIB(c, wcslen, [
1764 AC_DEFINE(HAVE_WCSLEN)
1765 WCHAR_LINK=""
1766 ], [
1767 AC_CHECK_LIB(w, wcslen, [
1768 AC_DEFINE(HAVE_WCSLEN)
1769 WCHAR_LINK="-lw"
1770 ])
1771 ])
1772
1773dnl check for vprintf/vsprintf() which are GNU extensions
1774AC_FUNC_VPRINTF
1775
1776dnl check for vsnprintf() - a safe version of vsprintf()
1777AC_CHECK_FUNCS(vsnprintf,
1778 AC_DEFINE(HAVE_VSNPRINTF),
1779 AC_MSG_WARN(unsafe function sprintf will be used instead of snprintf)
1780 )
1781
aea02638
VZ
1782dnl check for vsscanf() - on some platforms (Linux, glibc 2.1.1) it's
1783dnl available in the library but the prototype is missing, so we can't use
1784dnl AC_CHECK_FUNCS here, do it manually
1785AC_LANG_SAVE
1786AC_LANG_CPLUSPLUS
1787
1788AC_CACHE_CHECK([for vsscanf], wx_cv_func_vsscanf,
1789[
3a3eed31 1790 AC_TRY_RUN(
aea02638
VZ
1791 [
1792 #include <stdio.h>
1793 #include <stdarg.h>
3a3eed31
VZ
1794
1795 int try_vsscanf(const char *format, ...)
1796 {
1797 va_list ap;
1798 va_start(ap, format);
1799
1800 vsscanf("17", format, ap);
1801
1802 va_end(ap);
1803 }
1804
1805 int main()
1806 {
1807 int i;
1808 try_vsscanf("%d", &i);
1809 return i == 17 ? 0 : 1;
1810 }
aea02638 1811 ], [
aea02638 1812 AC_DEFINE(HAVE_VSSCANF)
3a3eed31
VZ
1813 wx_cv_func_vsscanf=yes
1814 ],
1815 wx_cv_func_vsscanf=no,
1816 wx_cv_func_vsscanf=no
1817 )
aea02638
VZ
1818])
1819
1820AC_LANG_RESTORE
1821
9a98a854
VZ
1822dnl check for vfork() (even if it's the same as fork() in modern Unices)
1823AC_CHECK_FUNCS(vfork)
1824
1825POSIX4_LINK=
1826AC_CHECK_FUNCS(nanosleep, AC_DEFINE(HAVE_NANOSLEEP), [
1827 AC_CHECK_LIB(posix4, nanosleep, [
1828 AC_DEFINE(HAVE_NANOSLEEP)
1829 POSIX4_LINK="-lposix4"
1830 ], [
1831 AC_CHECK_FUNCS(usleep,
1832 AC_DEFINE(HAVE_USLEEP),
1833 AC_MSG_WARN([wxSleep() function will not work]))
1834 ])
1835])
1836
1837dnl check for uname (POSIX) and gethostname (BSD)
1838AC_CHECK_FUNCS(uname gethostname, break)
1839
e96ac54e
GL
1840dnl check for inet_addr, inet_aton, ...
1841AC_CHECK_FUNCS(inet_addr)
1842AC_CHECK_FUNCS(inet_aton)
eb4642a9 1843AC_CHECK_LIB(resolv, inet_aton)
e96ac54e 1844
9a98a854
VZ
1845dnl ===========================================================================
1846dnl Now we have all the info we need - use it!
1847dnl ===========================================================================
1848
1849dnl flush the cache
1850AC_CACHE_SAVE
1851
1852dnl ---------------------------------------------------------------------------
a9b5e89f 1853dnl thread support for Unix (always available under Win32)
9a98a854
VZ
1854dnl ---------------------------------------------------------------------------
1855
77c85c2b 1856if test "$USE_UNIX" = 1; then
a9b5e89f 1857
9a98a854
VZ
1858dnl the code below:
1859dnl defines THREADS_OBJ which contains the object files to build
1860dnl defines THREADS_LINK which contains the thread library to link with
1861dnl defines wxUSE_THREADS=1 if thread support is activated
1862
1863THREADS_LINK=""
1864THREADS_OBJ=""
1865
77c85c2b
RR
1866if test "$wxUSE_THREADS" = "yes" ; then
1867 if test "$wxUSE_WINE" = 1 ; then
1868 AC_MSG_WARN([Threads are not supported under WINE])
1869 wxUSE_THREADS="no"
1870 fi
39c9d5ac
RR
1871fi
1872
77c85c2b 1873if test "$wxUSE_THREADS" = "yes" ; then
9a98a854 1874 dnl find if POSIX threads are available
77c85c2b 1875
9a98a854
VZ
1876 dnl standard lib name is pthread
1877 dnl We no longer test for pthread-0.7 as it breaks compilation on some
1878 dnl glibc2 systems, especially for static linkage.
1879 AC_CHECK_LIB(pthread, pthread_create, [
1880 THREADS_OBJ="threadpsx.lo"
1881 THREADS_LINK="pthread"
1882 ], [
1883 dnl thread functions are in libc_r under FreeBSD
1884 AC_CHECK_LIB(c_r, pthread_create, [
1885 THREADS_OBJ="threadpsx.lo"
1886 THREADS_LINK="c_r"
1887 ], [
1888 dnl VZ: SGI threads are not supported currently
1889 AC_CHECK_HEADER(sys/prctl.h, [
1890 THREADS_OBJ="threadsgi.lo"
1891 ])
1892 ])
1893 ])
9a98a854 1894
aea02638
VZ
1895 if test -z "$THREADS_OBJ" ; then
1896 wxUSE_THREADS=no
1897 AC_MSG_WARN(No thread support on this system)
1898 fi
9a98a854
VZ
1899fi
1900
1901dnl do other tests only if we are using threads
77c85c2b 1902if test "$wxUSE_THREADS" = "yes" ; then
9a98a854
VZ
1903 dnl define autoconf macro to check for given function in both pthread and
1904 dnl posix4 libraries
1905 dnl usage: AC_FUNC_THREAD(FUNCTION_NAME)
1906 dnl VZ: TODO
1907 dnl AC_DEFUN(AC_FUNC_THREAD,
1908 dnl [
1909 dnl AC_CHECK_LIB($THREADS_LINK, $1,
1910 dnl AC_DEFINE(HAVE_`'translit($1, `A-Z', 'a-z'),
1911 dnl [AC_CHECK_LIB("posix4", $1,
1912 dnl [AC_DEFINE(HAVE_`'translit($1, `A-Z', 'a-z'))
1913 dnl POSIX4_LINK="-lposix4"
1914 dnl ])
1915 dnl ])
1916 dnl ])
1917
1918 AC_CHECK_HEADERS(sched.h)
1919
1920 AC_CHECK_LIB($THREADS_LINK, sched_yield,
1921 AC_DEFINE(HAVE_SCHED_YIELD),
1922 [AC_CHECK_LIB("posix4", sched_yield,
1923 [AC_DEFINE(HAVE_SCHED_YIELD) POSIX4_LINK="-lposix4"],
1924 AC_MSG_WARN(wxThread::Yield will not work properly)
1925 )]
1926 )
1927
1928 dnl VZ: we should be checking for all of the following functions instead:
1929 dnl 1. pthread_attr_getschedpolicy
1930 dnl 2. sched_get_priority_min and sched_get_priority_max
1931 dnl 3. pthread_attr_getschedparam and pthread_attr_setschedparam
1932 dnl but it seems that if the first one is there, the other ones are too (of
1933 dnl course the proper solution would be to implement AC_FUNC_THREAD above
1934 dnl and do test for them all - anyone?)
1935 AC_CHECK_LIB($THREADS_LINK, pthread_attr_getschedpolicy,
1936 AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS),
1937 [AC_CHECK_LIB("posix4", pthread_attr_getschedpolicy,
1938 [AC_DEFINE(HAVE_THREAD_PRIORITY_FUNCTIONS) POSIX4_LINK="-lposix4"],
1939 AC_MSG_WARN(Setting thread priority will not work)
1940 )]
1941 )
1942
1943 AC_CHECK_LIB($THREADS_LINK, pthread_cancel,
1944 AC_DEFINE(HAVE_PTHREAD_CANCEL),
1945 AC_MSG_WARN([wxThread::Kill() will not work properly]))
1946
1947 AC_CACHE_CHECK([for pthread_cleanup_push/pop], wx_cv_func_pthread_cleanup_push,
1948 [
1949 AC_TRY_COMPILE([#include <pthread.h>],
1950 [
1951 pthread_cleanup_push(NULL, NULL);
1952 pthread_cleanup_pop(0);
1953 ], [
1954 wx_cv_func_pthread_cleanup_push=yes
1955 AC_DEFINE(HAVE_THREAD_CLEANUP_FUNCTIONS)
1956 ], [
1957 wx_cv_func_pthread_cleanup_push=no
1958 ])
1959 ])
1960
1961 THREADS_LINK="-l$THREADS_LINK"
1962fi
1963
77c85c2b 1964dnl from if USE_UNIX
a9b5e89f
VZ
1965fi
1966
1967if test "$wxUSE_THREADS" = "yes"; then
1968 AC_DEFINE(wxUSE_THREADS)
1969
1970 dnl must define _REENTRANT for multithreaded code
1971 CFLAGS="${CFLAGS} -D_REENTRANT"
1972 CXXFLAGS="${CXXFLAGS} -D_REENTRANT"
1973
1974 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
1975fi
1976
9a98a854
VZ
1977if test "$WXGTK12" = 1 ; then
1978 AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12)
1979fi
1980
5a92d200
RR
1981if test "$WXWINE" = 1 ; then
1982 TOOLKIT_DEF="${TOOLKIT_DEF} -D__WXWINE__"
1983fi
1984
a9b5e89f
VZ
1985if test "$wxUSE_CYGWIN" = 1 ; then
1986 TOOLKIT_DEF="${TOOLKIT_DEF} -D__WIN95__"
1987fi
1988
9a98a854 1989WXDEBUG=
9a98a854
VZ
1990
1991if test "$wxUSE_DEBUG_INFO" = "yes" ; then
1992 WXDEBUG="-g"
1993 wxUSE_OPTIMISE=no
1994fi
1995
5586805b
RR
1996if test "$wxUSE_DEBUG_GDB" = "yes" ; then
1997 wxUSE_DEBUG_INFO=yes
1998 WXDEBUG="-ggdb"
1999fi
2000
9a98a854 2001if test "$wxUSE_DEBUG_FLAG" = "yes" ; then
77c85c2b
RR
2002 AC_DEFINE(WXDEBUG)
2003 WXDEBUG_DEFINE="-D__WXDEBUG__"
9a98a854 2004else
04338f96
RR
2005 if test "$wxUSE_GTK" = 1 ; then
2006 WXDEBUG_DEFINE="-DGTK_NO_CHECK_CASTS"
2007 fi
9a98a854
VZ
2008fi
2009
2010if test "$wxUSE_MEM_TRACING" = "yes" ; then
77c85c2b
RR
2011 AC_DEFINE(wxUSE_MEMORY_TRACING)
2012 AC_DEFINE(wxUSE_GLOBAL_MEMORY_OPERATORS)
2013 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS memcheck"
9a98a854
VZ
2014fi
2015
2016if test "$wxUSE_DMALLOC" = "yes" ; then
77c85c2b 2017 DMALLOC_LINK="-ldmalloc"
9a98a854
VZ
2018fi
2019
2020PROFILE=
2021if test "$wxUSE_PROFILE" = "yes" ; then
77c85c2b 2022 PROFILE="-pg"
9a98a854
VZ
2023fi
2024
5586805b 2025DEP_INFO_FLAGS=
f7bdcdd7
RR
2026if test "$GCC" = yes ; then
2027 if test "$wxUSE_NO_RTTI" = "yes" ; then
2028 WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-rtti"
2029 fi
2030 if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
2031 WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-exceptions"
2032 fi
5586805b
RR
2033 if test "$wxUSE_PERMISSIVE" = "yes" ; then
2034 CFLAGS="${CFLAGS} -fpermissive"
2035 CXXFLAGS="${CXXFLAGS} -fpermissive"
2036 fi
2037 if test "$wxUSE_NO_DEPS" = "no" ; then
2038 DEP_INFO_FLAGS="-MMD"
2039 fi
f7bdcdd7
RR
2040fi
2041
2042
9a98a854
VZ
2043CXXFLAGS=`echo "${CXXFLAGS}" | sed "s/\-O.//g" `
2044CFLAGS=`echo "${CFLAGS}" | sed "s/\-O.//g" `
2045if test "$wxUSE_OPTIMISE" = "no" ; then
77c85c2b 2046 OPTIMISE=
9a98a854 2047else
77c85c2b 2048 if test "$GCC" = yes ; then
04338f96 2049 OPTIMISE="-O2"
77c85c2b
RR
2050 case "${host}" in
2051 i586-*-*|i686-*-* )
2052 OPTIMISE="${OPTIMISE} "
2053 ;;
2054 esac
2055 else
2056 OPTIMISE="-O"
2057 fi
9a98a854
VZ
2058fi
2059
2060dnl ---------------------------------------------------------------------------
2061dnl Optional libraries
2062dnl ---------------------------------------------------------------------------
2063
7fbdec7b 2064ZLIB_INCLUDE=
9a98a854
VZ
2065if test "$wxUSE_ZLIB" = "yes" ; then
2066 AC_DEFINE(wxUSE_ZLIB)
583a6578 2067 ZLIB_INCLUDE="-I\${top_srcdir}/src/zlib"
9a98a854
VZ
2068fi
2069
7fbdec7b 2070PNG_INCLUDE=
9a98a854
VZ
2071if test "$wxUSE_LIBPNG" = "yes" ; then
2072 AC_DEFINE(wxUSE_LIBPNG)
583a6578 2073 PNG_INCLUDE="-I\${top_srcdir}/src/png"
9a98a854
VZ
2074 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS png"
2075fi
2076
2077if test "$wxUSE_LIBGIF" = "yes" ; then
2078 AC_DEFINE(wxUSE_LIBGIF)
9a98a854
VZ
2079fi
2080
7fbdec7b 2081JPEG_INCLUDE=
9a98a854
VZ
2082if test "$wxUSE_LIBJPEG" = "yes" ; then
2083 AC_DEFINE(wxUSE_LIBJPEG)
583a6578 2084 JPEG_INCLUDE="-I\${top_srcdir}/src/jpeg"
9a98a854
VZ
2085fi
2086
2087if test "$wxUSE_OPENGL" = "yes"; then
2088 AC_CHECK_HEADER(GL/gl.h, [
2089 AC_CHECK_LIB(GL, glInitNames, [
2090 OPENGL_LINK="-lGL"
2091 AC_DEFINE(wxUSE_OPENGL)
2092 UTILS_SUBDIRS="$UTILS_SUBDIRS glcanvas/src"
2093 ],[
2094 AC_CHECK_LIB(MesaGL, glInitNames, [
2095 OPENGL_LINK="-lMesaGL"
2096 AC_DEFINE(wxUSE_OPENGL)
2097 UTILS_SUBDIRS="$UTILS_SUBDIRS glcanvas/src"
2098 ],wxUSE_OPENGL=0)
2099 ],wxUSE_OPENGL=0)
2100 ],wxUSE_OPENGL=0)
2101fi
2102
2103dnl ---------------------------------------------------------------------------
2104dnl the library may be built without GUI classes at all
2105dnl ---------------------------------------------------------------------------
2106
2107if test "$wxUSE_GUI" = "yes"; then
2108 AC_DEFINE(wxUSE_GUI)
2109
2110 dnl the things we always pull in the GUI version of the library:
2111 dnl 1. basic things like wxApp, wxWindow, wxControl, wxFrame, wxDialog (the
2112 dnl library really can't be built without those)
2113 dnl 2. basic controls: wxButton, wxStaticText, wxTextCtrl (these are used in
2114 dnl almost any program and the first 2 are needed to show a message box
2115 dnl which want to be always able to do)
2116 dnl 3. GDI stuff: icon, cursors and all that. Although it would be very nice
2117 dnl to compile without them (if the app doesn't do any drawing, it doesn't
2118 dnl need the dcs, pens, brushes, ...), this just can't be done now
2119 dnl 4. menu stuff: wxMenu, wxMenuBar, wxMenuItem
2120 dnl 5. misc stuff: timers, settings, message box
9a98a854
VZ
2121else
2122 AC_DEFINE(wxUSE_NOGUI)
2123fi
2124
2125dnl ---------------------------------------------------------------------------
2126dnl Unix/Windows
2127dnl ---------------------------------------------------------------------------
2128
2129if test "$wxUSE_UNIX" = "yes"; then
2130 AC_DEFINE(wxUSE_UNIX)
9a98a854
VZ
2131fi
2132
2133dnl ---------------------------------------------------------------------------
2134dnl Register non-GUI class options for makefiles and setup.h
2135dnl ---------------------------------------------------------------------------
2136
2137if test "$wxUSE_APPLE_IEEE" = "yes"; then
2138 AC_DEFINE(wxUSE_APPLE_IEEE)
9a98a854
VZ
2139fi
2140
2141if test "$wxUSE_TIMEDATE" = "yes"; then
2142 AC_DEFINE(wxUSE_TIMEDATE)
9a98a854
VZ
2143 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS typetest"
2144fi
2145
2749089a
KB
2146if test "$wxUSE_WAVE" = "yes"; then
2147 AC_DEFINE(wxUSE_WAVE)
2148fi
2149
9a98a854
VZ
2150if test "$wxUSE_FILE" = "yes"; then
2151 AC_DEFINE(wxUSE_FILE)
9a98a854
VZ
2152fi
2153
e3e717ec
VZ
2154if test "$wxUSE_FS_INET" = "yes"; then
2155 AC_DEFINE(wxUSE_FS_INET)
2156fi
2157
2158if test "$wxUSE_FS_ZIP" = "yes"; then
2159 AC_DEFINE(wxUSE_FS_ZIP)
2160fi
2161
d78b3d64
VS
2162if test "$wxUSE_ZIPSTREAM" = "yes"; then
2163 AC_DEFINE(wxUSE_ZIPSTREAM)
2164fi
2165
2166if test "$wxUSE_BUSYINFO" = "yes"; then
2167 AC_DEFINE(wxUSE_BUSYINFO)
2168fi
2169
fd15d8f1
RR
2170if test "$wxUSE_STD_IOSTREAM" = "yes"; then
2171 AC_DEFINE(wxUSE_STD_IOSTREAM)
2172fi
2173
9a98a854
VZ
2174if test "$wxUSE_TEXTFILE" = "yes"; then
2175 if test "$wxUSE_FILE" != "yes"; then
2176 AC_MSG_WARN(wxTextFile requires wxFile and it won't be compiled without it)
2177 else
2178 AC_DEFINE(wxUSE_TEXTFILE)
9a98a854
VZ
2179 fi
2180fi
2181
2182if test "$wxUSE_CONFIG" = "yes" ; then
2183 if test "$wxUSE_TEXTFILE" != "yes"; then
2184 AC_MSG_WARN(wxConfig requires wxTextFile and it won't be compiled without it)
2185 else
2186 AC_DEFINE(wxUSE_CONFIG)
9a98a854
VZ
2187 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS config"
2188 fi
2189fi
2190
2191if test "$wxUSE_INTL" = "yes" ; then
2192 if test "$wxUSE_FILE" != "yes"; then
2193 AC_MSG_WARN(I18n code requires wxFile and it won't be compiled without it)
2194 else
2195 AC_DEFINE(wxUSE_INTL)
9a98a854
VZ
2196 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS internat"
2197 fi
2198fi
2199
2200if test "$wxUSE_LOG" = "yes"; then
2201 AC_DEFINE(wxUSE_LOG)
9a98a854
VZ
2202fi
2203
2204if test "$wxUSE_LONGLONG" = "yes"; then
2205 AC_DEFINE(wxUSE_LONGLONG)
9a98a854
VZ
2206fi
2207
2208if test "$wxUSE_SOCKETS" = "yes" ; then
2209 if test "$wxUSE_THREADS" = "yes" ; then
2210 AC_DEFINE(wxUSE_SOCKETS)
9a98a854 2211 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS wxsocket"
ff684c98 2212 INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS protocol"
9a98a854 2213 else
39c9d5ac 2214 AC_MSG_WARN(Socket classes require --with-threads and won't be compiled without it)
9a98a854
VZ
2215 wxUSE_SOCKETS=0
2216 fi
2217fi
2218
2219if test "$wxUSE_STREAMS" = "yes" ; then
2220 AC_DEFINE(wxUSE_STREAMS)
9a98a854
VZ
2221fi
2222
2223if test "$wxUSE_SERIAL" = "yes" ; then
2224 AC_DEFINE(wxUSE_SERIAL)
2225fi
2226
2227dnl ------------------------------------------------------------------------
2228dnl wxSocket
2229dnl ------------------------------------------------------------------------
2230
2231if test "$wxUSE_SOCKETS" = "yes"; then
2232 AC_LANG_SAVE
2233 AC_LANG_CPLUSPLUS
2234 dnl determine the type of third argument for getsockname
2235 AC_MSG_CHECKING(the type of the third argument of getsockname)
2236 AC_TRY_COMPILE(
2237 [#include <sys/socket.h>],
2238 [socklen_t len; getsockname(0, NULL, &len);],
2239 AC_DEFINE(SOCKLEN_T, socklen_t) AC_MSG_RESULT(socklen_t),
2240 AC_TRY_COMPILE(
2241 [#include <sys/socket.h>],
2242 [size_t len; getsockname(0, NULL, &len);],
2243 AC_DEFINE(SOCKLEN_T, size_t) AC_MSG_RESULT(size_t),
2244 AC_TRY_COMPILE(
2245 [#include <sys/socket.h>],
2246 [int len; getsockname(0, NULL, &len);],
2247 AC_DEFINE(SOCKLEN_T, int) AC_MSG_RESULT(int),
2248 AC_MSG_RESULT(unknown)
2249 )
2250 )
2251 )
2252 AC_LANG_RESTORE
2253fi
2254
2255dnl ---------------------------------------------------------------------------
2256dnl Joystick support
2257dnl ---------------------------------------------------------------------------
2258
2259if test "$wxUSE_JOYSTICK" = 1; then
2260 dnl joystick support is only for Linux 2.1.x or greater
2261 AC_CHECK_HEADERS(linux/joystick.h)
2262 if test "$ac_cv_header_linux_joystick_h" = "yes"; then
2263 AC_DEFINE(wxUSE_JOYSTICK)
9a98a854
VZ
2264 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS joytest"
2265 fi
2266fi
2267
2268dnl ------------------------------------------------------------------------
2269dnl DLL support
2270dnl ------------------------------------------------------------------------
2271
2272HAVE_DL_FUNCS=0
2273HAVE_SHL_FUNCS=0
2274if test "$wxUSE_DYNLIB_CLASS" = "yes"; then
2275 dnl the test is a bit complicated because we check for dlopen() both with
2276 dnl and without -ldl
2277 AC_CHECK_FUNCS(dlopen,
2278 [AC_DEFINE(HAVE_DLOPEN) HAVE_DL_FUNCS=1],
2279 [AC_CHECK_LIB(dl, dlopen,
2280 [AC_DEFINE(HAVE_DLOPEN) HAVE_DL_FUNCS=1])])
2281 AC_CHECK_FUNCS( shl_load,
2282 [AC_DEFINE(HAVE_SHL_LOAD) HAVE_DL_FUNCS=1 HAVE_SHL_FUNCS=1])
2283
2284 if test "$HAVE_DL_FUNCS" = 0; then
c637d461
HH
2285 if test "$USE_UNIX" = 1; then
2286 AC_MSG_WARN("--with-dynlib and --with-odbc will be disabled due to missing shared library support")
2287 wxUSE_ODBC=no
2288 wxUSE_DYNLIB_CLASS=no
2289 else
2290 AC_MSG_WARN("Cannot check dynlib requirements on non-Unix platforms. dynlib remains enabled.")
2291 fi
9a98a854
VZ
2292 fi
2293fi
2294
2295if test "$wxUSE_DYNLIB_CLASS" = "yes" ; then
2296 AC_DEFINE(wxUSE_DYNLIB_CLASS)
9a98a854
VZ
2297fi
2298
2299dnl ---------------------------------------------------------------------------
ced859c3 2300dnl String stuff
9a98a854
VZ
2301dnl ---------------------------------------------------------------------------
2302
2303if test "$wxUSE_UNICODE" = "yes" ; then
2304 AC_DEFINE(wxUSE_UNICODE)
2305fi
2306
2307if test "$wxUSE_WCSRTOMBS" = "yes" ; then
2308 AC_DEFINE(wxUSE_WCSRTOMBS)
2309fi
2310
ced859c3
VZ
2311if test "$wxUSE_wxUSE_EXPERIMENTAL_PRINTF" = "yes"; then
2312 AC_DEFINE(wxUSE_EXPERIMENTAL_PRINTF)
2313fi
2314
9a98a854
VZ
2315dnl ----------------------------------------------------------------
2316dnl iODBC support
2317dnl ----------------------------------------------------------------
2318
2319IODBC_C_SRC=""
2320if test "$wxUSE_ODBC" = "yes" ; then
2321 AC_DEFINE(wxUSE_ODBC)
9a98a854
VZ
2322 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS db"
2323fi
2324
2325dnl ----------------------------------------------------------------
2326dnl Register PostScript options for makefiles and setup.h
2327dnl ----------------------------------------------------------------
2328
2329if test "$wxUSE_POSTSCRIPT" = "yes" ; then
2330 AC_DEFINE(wxUSE_POSTSCRIPT)
9a98a854
VZ
2331fi
2332
2333AC_DEFINE(wxUSE_AFM_FOR_POSTSCRIPT)
2334
2335AC_DEFINE(wxUSE_NORMALIZED_PS_FONTS)
2336
2337dnl ---------------------------------------------------------------------------
2338dnl big GUI components: MDI, doc/view, printing, help, ...
2339dnl ---------------------------------------------------------------------------
2340
2341if test "$wxUSE_CONSTRAINTS" = "yes"; then
ce4169a4
RR
2342 AC_DEFINE(wxUSE_CONSTRAINTS)
2343 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS layout"
9a98a854
VZ
2344fi
2345
2346if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
ce4169a4
RR
2347 AC_DEFINE(wxUSE_MDI_ARCHITECTURE)
2348 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mdi"
9a98a854
VZ
2349fi
2350
2351if test "$wxUSE_DOC_VIEW_ARCHITECTURE" = "yes" ; then
ce4169a4
RR
2352 AC_DEFINE(wxUSE_DOC_VIEW_ARCHITECTURE)
2353 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docview"
2354 if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
2355 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS docvwmdi"
2356 fi
9a98a854
VZ
2357fi
2358
2359if test "$wxUSE_HELP" = "yes"; then
ce4169a4
RR
2360 AC_DEFINE(wxUSE_HELP)
2361 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS help"
9a98a854
VZ
2362fi
2363
2364if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then
ce4169a4
RR
2365 if test "$wxUSE_CONSTRAINTS" != "yes"; then
2366 AC_MSG_WARN(Printing support cannot be used without constraints so it won't be compiled without it)
2367 else
2368 AC_DEFINE(wxUSE_PRINTING_ARCHITECTURE)
2369 fi
2370 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS printing"
9a98a854
VZ
2371fi
2372
2373if test "$wxUSE_PROLOGIO" = "yes" ; then
ce4169a4 2374 AC_DEFINE(wxUSE_PROLOGIO)
9a98a854
VZ
2375fi
2376
2377if test "$wxUSE_RESOURCES" = "yes" ; then
ce4169a4
RR
2378 if test "$wxUSE_PROLOGIO" = "yes" ; then
2379 AC_DEFINE(wxUSE_RESOURCES)
2380 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS resource"
2381 else
2382 AC_MSG_WARN([wxWindows ressource system requires PrologIO and can't be compiled without it.])
2383 fi
9a98a854
VZ
2384fi
2385
2386if test "$wxUSE_X_RESOURCES" = "yes"; then
ce4169a4 2387 AC_DEFINE(wxUSE_X_RESOURCES)
9a98a854
VZ
2388fi
2389
2390dnl ---------------------------------------------------------------------------
77c85c2b 2391dnl IPC: IPC, Drag'n'Drop, Clipboard, ...
9a98a854
VZ
2392dnl ---------------------------------------------------------------------------
2393
2394if test "$wxUSE_IPC" = "yes"; then
ce4169a4 2395 AC_DEFINE(wxUSE_IPC)
9a98a854
VZ
2396fi
2397
2398if test "$wxUSE_CLIPBOARD" = "yes"; then
ce4169a4 2399 AC_DEFINE(wxUSE_CLIPBOARD)
9a98a854
VZ
2400fi
2401
39c9d5ac 2402if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
ce4169a4
RR
2403 if test "$wxUSE_GTK" = 1; then
2404 if test "$WXGTK12" != 1; then
fd9811b1 2405 AC_MSG_WARN([Drag and drop is only supported under GTK+ 1.2])
bea74fbb 2406 wxUSE_DRAG_AND_DROP=no
ce4169a4 2407 fi
a9b5e89f 2408 fi
a9b5e89f 2409
ce4169a4
RR
2410 if test "$wxUSE_MOTIF" = 1; then
2411 AC_MSG_WARN([Drag and drop is not yet supported under Motif])
bea74fbb 2412 wxUSE_DRAG_AND_DROP=no
ce4169a4 2413 fi
a9b5e89f 2414
ce4169a4
RR
2415 if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
2416 AC_DEFINE(wxUSE_DRAG_AND_DROP)
2417 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd"
2418 fi
9a98a854
VZ
2419fi
2420
2421if test "$wxUSE_SPLINES" = "yes" ; then
2422 AC_DEFINE(wxUSE_SPLINES)
2423fi
2424
2425dnl ---------------------------------------------------------------------------
2426dnl GUI controls
2427dnl ---------------------------------------------------------------------------
2428
2429if test "$wxUSE_ACCEL" = "yes"; then
2430 AC_DEFINE(wxUSE_ACCEL)
9a98a854
VZ
2431fi
2432
2433if test "$wxUSE_CARET" = "yes"; then
2434 AC_DEFINE(wxUSE_CARET)
9a98a854
VZ
2435 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS caret"
2436fi
2437
2438if test "$wxUSE_COMBOBOX" = "yes"; then
2439 AC_DEFINE(wxUSE_COMBOBOX)
9a98a854
VZ
2440fi
2441
ce4169a4
RR
2442if test "$wxUSE_CHOICE" = "yes"; then
2443 AC_DEFINE(wxUSE_CHOICE)
2444fi
2445
9a98a854
VZ
2446if test "$wxUSE_BMPBUTTON" = "yes"; then
2447 AC_DEFINE(wxUSE_BMPBUTTON)
9a98a854
VZ
2448fi
2449
2450if test "$wxUSE_CHECKBOX" = "yes"; then
2451 AC_DEFINE(wxUSE_CHECKBOX)
9a98a854
VZ
2452fi
2453
2454if test "$wxUSE_CHECKLST" = "yes"; then
2455 AC_DEFINE(wxUSE_CHECKLISTBOX)
9a98a854
VZ
2456 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS checklst"
2457fi
2458
2459if test "$wxUSE_GAUGE" = "yes"; then
2460 AC_DEFINE(wxUSE_GAUGE)
9a98a854
VZ
2461fi
2462
2463if test "$wxUSE_GRID" = "yes"; then
2464 AC_DEFINE(wxUSE_GRID)
9a98a854
VZ
2465 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS grid"
2466fi
2467
2468if test "$wxUSE_IMAGLIST" = "yes"; then
ce4169a4 2469 AC_DEFINE(wxUSE_IMAGLIST)
9a98a854
VZ
2470fi
2471
2472if test "$wxUSE_LISTBOX" = "yes"; then
ce4169a4 2473 AC_DEFINE(wxUSE_LISTBOX)
9a98a854
VZ
2474fi
2475
2476if test "$wxUSE_LISTCTRL" = "yes"; then
ce4169a4
RR
2477 if test "$wxUSE_IMAGLIST" = "yes"; then
2478 AC_DEFINE(wxUSE_LISTCTRL)
2479 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS listctrl"
2480 else
2481 AC_MSG_WARN([wxListCtrl requires wxImageList and won't be compiled without it])
2482 fi
9a98a854
VZ
2483fi
2484
2485if test "$wxUSE_NOTEBOOK" = "yes"; then
ce4169a4
RR
2486 AC_DEFINE(wxUSE_NOTEBOOK)
2487 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS notebook"
9a98a854
VZ
2488fi
2489
2490if test "$wxUSE_RADIOBOX" = "yes"; then
ce4169a4 2491 AC_DEFINE(wxUSE_RADIOBOX)
9a98a854
VZ
2492fi
2493
2494if test "$wxUSE_RADIOBTN" = "yes"; then
ce4169a4 2495 AC_DEFINE(wxUSE_RADIOBTN)
9a98a854
VZ
2496fi
2497
79b00c62 2498if test "$wxUSE_SASH" = "yes"; then
ce4169a4
RR
2499 AC_DEFINE(wxUSE_SASH)
2500 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sashtest"
9a98a854
VZ
2501fi
2502
2503if test "$wxUSE_SCROLLBAR" = "yes"; then
ce4169a4
RR
2504 AC_DEFINE(wxUSE_SCROLLBAR)
2505 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS scroll"
9a98a854
VZ
2506fi
2507
2508if test "$wxUSE_SLIDER" = "yes"; then
ce4169a4 2509 AC_DEFINE(wxUSE_SLIDER)
9a98a854
VZ
2510fi
2511
2512if test "$wxUSE_SPINBTN" = "yes"; then
ce4169a4 2513 AC_DEFINE(wxUSE_SPINBTN)
9a98a854
VZ
2514fi
2515
2516if test "$wxUSE_SPLITTER" = "yes"; then
ce4169a4
RR
2517 AC_DEFINE(wxUSE_SPLITTER)
2518 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS splitter"
9a98a854
VZ
2519fi
2520
2521if test "$wxUSE_STATBMP" = "yes"; then
ce4169a4 2522 AC_DEFINE(wxUSE_STATBMP)
9a98a854
VZ
2523fi
2524
2525if test "$wxUSE_STATBOX" = "yes"; then
ce4169a4 2526 AC_DEFINE(wxUSE_STATBOX)
9a98a854
VZ
2527fi
2528
2529if test "$wxUSE_STATLINE" = "yes"; then
f53561f1
RR
2530 if test "$wxUSE_WINE" = 1 ; then
2531 AC_MSG_WARN([wxStaticLine is not supported under WINE])
2532 else
bea74fbb
RR
2533 if test "$wxUSE_MOTIF" = 1 ; then
2534 AC_MSG_WARN([wxStaticLine is not supported under Motif])
2535 else
2536 AC_DEFINE(wxUSE_STATLINE)
2537 fi
f53561f1 2538 fi
9a98a854
VZ
2539fi
2540
2541if test "$wxUSE_STATUSBAR" = "yes"; then
ce4169a4 2542 AC_DEFINE(wxUSE_STATUSBAR)
9a98a854
VZ
2543fi
2544
2545if test "$wxUSE_TABDIALOG" = "yes"; then
ce4169a4
RR
2546 AC_DEFINE(wxUSE_TAB_DIALOG)
2547 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS tab"
9a98a854
VZ
2548fi
2549
2550if test "$wxUSE_TOOLBAR" = "yes"; then
ce4169a4
RR
2551 AC_DEFINE(wxUSE_TOOLBAR)
2552 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS toolbar"
9a98a854
VZ
2553fi
2554
39c9d5ac 2555if test "$wxUSE_TOOLTIPS" = "yes"; then
ced859c3 2556 if test "$wxUSE_MOTIF" = 1; then
bea74fbb 2557 AC_MSG_WARN(wxTooltip not supported yet under Motif)
9a98a854 2558 else
ce4169a4 2559 if test "$wxUSE_WINE" = 1; then
bea74fbb 2560 AC_MSG_WARN(wxTooltip not supported under WINE)
ce4169a4
RR
2561 else
2562 AC_DEFINE(wxUSE_TOOLTIPS)
2563 fi
9a98a854
VZ
2564 fi
2565fi
2566
2567if test "$wxUSE_TREECTRL" = "yes"; then
ce4169a4
RR
2568 if test "$wxUSE_IMAGLIST" = "yes"; then
2569 AC_DEFINE(wxUSE_TREECTRL)
2570 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treectrl"
2571 else
2572 AC_MSG_WARN([wxTreeCtrl requires wxImageList and won't be compiled without it])
2573 fi
9a98a854
VZ
2574fi
2575
2576dnl ---------------------------------------------------------------------------
2577dnl misc options
2578dnl ---------------------------------------------------------------------------
2579
ff684c98
VZ
2580dnl TODO this is unused for now...
2581dnl if test "$wxUSE_WXTREE" = "yes"; then
2582dnl AC_DEFINE(wxUSE_WXTREE)
2583dnl fi
9a98a854
VZ
2584
2585if test "$wxUSE_METAFILE" = "yes"; then
ce4169a4 2586 AC_DEFINE(wxUSE_METAFILE)
9a98a854
VZ
2587fi
2588
ce4169a4
RR
2589if test "$wxUSE_DIRDLG" = "yes"; then
2590 if test "$wxUSE_CONSTRAINTS" != "yes"; then
2591 AC_MSG_WARN(wxDirDialog requires constraints so it won't be compiled without them)
9a98a854 2592 else
ce4169a4
RR
2593 if test "$wxUSE_TREECTRL" != "yes"; then
2594 AC_MSG_WARN(wxDirDialog requires wxTreeCtrl so it won't be compiled without it)
2595 else
2596 AC_DEFINE(wxUSE_DIRDLG)
2597 fi
9a98a854 2598 fi
ce4169a4 2599fi
9a98a854 2600
c11584af
RR
2601if test "$wxUSE_TEXTDLG" = "yes"; then
2602 AC_DEFINE(wxUSE_TEXTDLG)
2603fi
2604
a641505f
VZ
2605if test "$wxUSE_STARTUP_TIPS" = "yes"; then
2606 if test "$wxUSE_CONSTRAINTS" != "yes"; then
2607 AC_MSG_WARN(Startup tips requires constraints and won't be compiled without them)
2608 else
2609 AC_DEFINE(wxUSE_STARTUP_TIPS)
2610 fi
2611fi
2612
ce4169a4
RR
2613if test "$wxUSE_PROGRESSDLG" = "yes"; then
2614 if test "$wxUSE_CONSTRAINTS" != "yes"; then
2615 AC_MSG_WARN(wxProgressDialog requires constraints so it won't be compiled without them)
2616 else
2617 AC_DEFINE(wxUSE_PROGRESSDLG)
2618 fi
9a98a854
VZ
2619fi
2620
2621if test "$wxUSE_MINIFRAME" = "yes"; then
ce4169a4
RR
2622 AC_DEFINE(wxUSE_MINIFRAME)
2623 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS minifram"
9a98a854
VZ
2624fi
2625
5526e819
VS
2626if test "$wxUSE_HTML" = "yes"; then
2627 AC_DEFINE(wxUSE_HTML)
2628 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS html"
77133f2d 2629 INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS html"
5526e819
VS
2630fi
2631
9a98a854 2632if test "$wxUSE_VALIDATORS" = "yes"; then
ce4169a4
RR
2633 AC_DEFINE(wxUSE_VALIDATORS)
2634 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS validate"
9a98a854
VZ
2635fi
2636
2637dnl ---------------------------------------------------------------------------
2638dnl Output the makefiles and such from the results found above
2639dnl ---------------------------------------------------------------------------
2640
2641dnl if we add wxUSE_GUI in the future, it might be handy to separate the libs
2642dnl into GUI and non-GUI parts
2643GUILIBS="$GUI_TK_LIBRARY $OPENGL_LINK $LIBPNG_LINK $ZLIB_LINK $TOOLKIT_LINK"
2644
2645dnl all additional libraries (except wxWindows itself) we link with
2646EXTRA_LIBS="$LIBS $POSIX4_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK $GUILIBS"
2647
2648dnl all the libraries needed to link wxWindows programs (when the library is not
2649dnl yet installed)
47b61a78 2650LIBS="\${top_builddir}/src/${TOOLKIT_DIR}/${WX_LIBRARY_NAME} $EXTRA_LIBS"
9a98a854 2651
8e877c19
RR
2652dnl all the libraries needed to link wxWindows programs when using the
2653dnl makefile system without libtool
2654LD_LIBS="\${top_builddir}/lib/${WX_LIBRARY_NAME_STATIC} $EXTRA_LIBS"
2655
9a98a854 2656dnl all -I options we must pass to the compiler
7fbdec7b 2657INCLUDES="-I. -I\${top_builddir}/include -I\${top_srcdir}/include $ZLIB_INCLUDE $PNG_INCLUDE $JPEG_INCLUDE $TOOLKIT_INCLUDE"
9a98a854
VZ
2658
2659dnl C/C++ compiler options used to compile wxWindows
bea74fbb 2660if test "$GXX" = yes ; then
ce4169a4
RR
2661 dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror"
2662 CXXWARNINGS="-Wall"
2663 dnl there is one weird warning in docview.h:71 which prevents me from doing
2664 dnl this...
2665 dnl CXXWARNINGS="-Wall -Werror"
9a98a854
VZ
2666fi
2667EXTRA_CFLAGS="$WXDEBUG $PROFILE $OPTIMISE $INCLUDES"
2668
0f5f43ac 2669CPPFLAGS="-I\${top_srcdir}/include $CPPFLAGS"
9a98a854
VZ
2670CFLAGS="$CFLAGS $EXTRA_CFLAGS"
2671CXXFLAGS="$CXXFLAGS $EXTRA_CFLAGS $CXXWARNINGS"
2672
2673if test "$wxUSE_GUI" = "yes"; then
ce4169a4
RR
2674 dnl TODO add checks that these samples will really compile (i.e. all the
2675 dnl library features they need are present)
9a98a854 2676
ce4169a4
RR
2677 dnl TODO some samples are never built so far:
2678 dnl mfc, nativdlg, oleauto, ownerdrw, proplist
2679 SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS bombs controls dialogs drawing dynamic \
e4628635 2680 forty fractal image wxpoem"
9a98a854
VZ
2681fi
2682
70d1b3cf
VZ
2683dnl for convenience, sort the samples in alphabetical order
2684dnl
2685dnl FIXME For some mysterious reasons, sometimes the directories are duplicated
2686dnl in this list - hence uniq. But normally, this shouldn't be needed!
2687SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq | tr '\n' ' '`"
2688
9a98a854
VZ
2689dnl global options
2690AC_SUBST(WX_MAJOR_VERSION_NUMBER)
2691AC_SUBST(WX_MINOR_VERSION_NUMBER)
2692AC_SUBST(WX_RELEASE_NUMBER)
70d1b3cf 2693AC_SUBST(WX_LIBRARY_NAME)
48b1d0ff
RR
2694AC_SUBST(WX_LIBRARY_NAME_STATIC)
2695AC_SUBST(WX_LIBRARY_NAME_SHARED)
2b6f061f 2696AC_SUBST(WX_LIBRARY)
48b1d0ff
RR
2697AC_SUBST(WX_TARGET_LIBRARY)
2698AC_SUBST(WX_LIBRARY_LINK1)
2699AC_SUBST(WX_LIBRARY_LINK2)
2700AC_SUBST(WX_LIBRARY_LINK3)
80d895cd 2701AC_SUBST(PROGRAM_EXT)
48b1d0ff
RR
2702
2703dnl are we supposed to create the links?
2704AC_SUBST(WX_CREATE_LINKS)
517a619d 2705AC_SUBST(WX_CREATE_INSTALLED_LINKS)
9a98a854 2706
48b1d0ff
RR
2707AC_SUBST(SHARED_LD)
2708AC_SUBST(PIC_FLAG)
5586805b 2709AC_SUBST(DEP_INFO_FLAGS)
48b1d0ff 2710
9a98a854
VZ
2711dnl debugging options
2712AC_SUBST(WXDEBUG_DEFINE)
2713
2714dnl toolkit options
2715AC_SUBST(TOOLKIT)
2716AC_SUBST(TOOLKIT_DEF)
2717AC_SUBST(TOOLKIT_DIR)
2718AC_SUBST(TOOLKIT_INCLUDE)
2719
073478b3 2720dnl what to compile
2aa88730 2721AC_SUBST(GUIHEADERS)
5586805b 2722AC_SUBST(GUIOBJS)
073478b3
RR
2723AC_SUBST(COMMONOBJS)
2724AC_SUBST(GENERICOBJS)
5586805b
RR
2725AC_SUBST(GUIDEPS)
2726AC_SUBST(COMMONDEPS)
2727AC_SUBST(GENERICDEPS)
e4b4d60e 2728AC_SUBST(UNIXOBJS)
a4aad961 2729AC_SUBST(GUIDIST)
073478b3 2730
9a98a854 2731dnl additional subdirectories where we will build
bcd2b961 2732AC_SUBST(SRC_SUBDIRS)
ff684c98 2733AC_SUBST(INCLUDE_SUBDIRS)
9a98a854
VZ
2734AC_SUBST(UTILS_SUBDIRS)
2735AC_SUBST(DOCS_SUBDIRS)
2736AC_SUBST(SAMPLES_SUBDIRS)
2737AC_SUBST(USER_SUBDIRS)
2738
2739dnl additional libraries
2740AC_SUBST(EXTRA_LIBS)
2741AC_SUBST(LIBS)
8e877c19 2742AC_SUBST(LD_LIBS)
9a98a854 2743
9a98a854
VZ
2744dnl MAKE_SET will be replaced with "MAKE=..." or nothing if make sets MAKE
2745dnl itself (this is macro is required if SUBDIRS variable is used in Makefile.am
2746dnl - and we do use it)
2747AC_PROG_MAKE_SET
2748
2aa88730
RR
2749AC_CONFIG_HEADER(setup.h:setup.h.in)
2750
2751
9a98a854
VZ
2752dnl create each of the files in the space separated list from the file.in
2753dnl (the original file name may be overriden by appending another name after a
2754dnl colon)
2755AC_OUTPUT([
ff684c98 2756 wx-config
8e877c19
RR
2757 src/make.env
2758 src/makeprog.env
2759 src/makelib.env
bcd2b961 2760 Makefile
ad9edf45
RR
2761 samples/Makefile
2762 samples/bombs/Makefile
2763 samples/caret/Makefile
2764 samples/checklst/Makefile
2765 samples/config/Makefile
2766 samples/controls/Makefile
a8efa9e3
RR
2767 samples/dialogs/Makefile
2768 samples/docview/Makefile
2769 samples/docvwmdi/Makefile
2770 samples/dnd/Makefile
2771 samples/drawing/Makefile
2772 samples/dynamic/Makefile
2773 samples/image/Makefile
2774 samples/layout/Makefile
2775 samples/listctrl/Makefile
2776 samples/mdi/Makefile
2777 samples/minifram/Makefile
2778 samples/minimal/Makefile
2779 samples/notebook/Makefile
27ea1d8a 2780 samples/printing/Makefile
42b4e99e 2781 samples/proplist/Makefile
8a5137d7
RR
2782 samples/sashtest/Makefile
2783 samples/scroll/Makefile
2784 samples/splitter/Makefile
2785 samples/text/Makefile
2786 samples/thread/Makefile
2787 samples/toolbar/Makefile
2788 samples/treectrl/Makefile
2789 samples/typetest/Makefile
549c6f67
RR
2790 samples/validate/Makefile
2791 samples/wxpoem/Makefile
2792 samples/wxsocket/Makefile
7750247f 2793 samples/wizard/Makefile
b1683d38 2794 samples/html/Makefile
549c6f67 2795 samples/html/about/Makefile
b1683d38
RR
2796 samples/html/help/Makefile
2797 samples/html/printing/Makefile
2798 samples/html/test/Makefile
dc6c62a9
RR
2799 samples/html/zip/Makefile
2800 samples/html/virtual/Makefile
2801 samples/html/widget/Makefile
622e48cb 2802 utils/Makefile
526ddb13
GL
2803 utils/wxMMedia2/Makefile
2804 utils/wxMMedia2/lib/Makefile
2805 utils/wxMMedia2/sample/Makefile
9a98a854 2806 ],
a2cddd63
VZ
2807 [
2808 chmod +x wx-config
583a6578
RR
2809 if test ! -d include; then
2810 mkdir include
2811 fi
2812 if test ! -d include/wx; then
2813 mkdir include/wx
2814 fi
2815 if test ! -d include/wx/${TOOLKIT_DIR}; then
2816 mkdir include/wx/${TOOLKIT_DIR}
2817 fi
2818 cp -f setup.h include/wx/${TOOLKIT_DIR}/setup.h
a2cddd63
VZ
2819 ],
2820 [
c7114f59
VZ
2821 LN_S="${ac_cv_prog_LN_S}"
2822 TOOLKIT_DIR="${TOOLKIT_DIR}"
a2cddd63
VZ
2823 ]
2824 )
9a98a854 2825