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