]> git.saurik.com Git - wxWidgets.git/blame - configure.in
Added facenames support to wxFont
[wxWidgets.git] / configure.in
CommitLineData
bcf1fa6b
RR
1dnl ////////////////////////////////////////////////////////////////////////
2dnl
3dnl Top-level configure.in for wxWindows by Robert Roebling, Wolfram Gloger
4dnl and Martin Sperl.
5dnl
6dnl This script is under the wxWindows licence.
2904eefd 7dnl $Id$
bcf1fa6b
RR
8dnl ////////////////////////////////////////////////////////////////////////
9
10dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
11dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
12dnl
13AC_DEFUN(AM_PATH_GTK,
14[dnl
15dnl Get the cflags and libraries from the gtk-config script
16dnl
f3cb6592 17AC_ARG_WITH(gtk-prefix,[**--with-gtk-prefix=PFX Prefix where GTK is installed],
bcf1fa6b 18 gtk_config_prefix="$withval", gtk_config_prefix="")
f3cb6592 19AC_ARG_WITH(gtk-exec-prefix,[**--with-gtk-exec-prefix=PFX Exec prefix where GTK is installed],
bcf1fa6b
RR
20 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
21
22 if test x$gtk_config_exec_prefix != x ; then
23 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
24 if test x${GTK_CONFIG+set} != xset ; then
25 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
26 fi
27 fi
28 if test x$gtk_config_prefix != x ; then
29 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
30 if test x${GTK_CONFIG+set} != xset ; then
31 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
32 fi
33 fi
34
35 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
36 min_gtk_version=ifelse([$1], ,0.99.7,$1)
37 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
38 no_gtk=""
39 if test "$GTK_CONFIG" != "no" ; then
40 GTK_CFLAGS=`$GTK_CONFIG --cflags`
41 GTK_LIBS=`$GTK_CONFIG --libs`
42 ac_save_CFLAGS="$CFLAGS"
43 ac_save_LIBS="$LIBS"
44 CFLAGS="$CFLAGS $GTK_CFLAGS"
45 LIBS="$LIBS $GTK_LIBS"
46dnl
47dnl Now check if the installed GTK is sufficiently new. (Also sanity
48dnl checks the results of gtk-config to some extent
49dnl
50 AC_TRY_RUN([
51#include <gtk/gtk.h>
52#include <stdio.h>
53
54int
55main ()
56{
57 int major, minor, micro;
58
59 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, &micro) != 3) {
60 printf("%s, bad version string\n", "$min_gtk_version");
61 exit(1);
62 }
63
f3855ef0
RR
64 if (gtk_minor_version > 0) return FALSE;
65
bcf1fa6b
RR
66 return !((gtk_major_version > major) ||
67 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
68 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
69}
70],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
71 CFLAGS="$ac_save_CFLAGS"
72 LIBS="$ac_save_LIBS"
73 else
74 no_gtk=yes
75 fi
76 if test "x$no_gtk" = x ; then
77 AC_MSG_RESULT(yes)
78 ifelse([$2], , :, [$2])
79 else
80 AC_MSG_RESULT(no)
81 GTK_CFLAGS=""
82 GTK_LIBS=""
83 ifelse([$3], , :, [$3])
84 fi
85 AC_SUBST(GTK_CFLAGS)
86 AC_SUBST(GTK_LIBS)
87])
88
89dnl ------------------------------------------------------------------------
90dnl custom macros
91dnl ------------------------------------------------------------------------
92
93AC_DEFUN(AC_OVERRIDES_PREPARE,
94[
95rm -f ${OSTYPE}.system.cache.tmp
96touch ${OSTYPE}.system.cache.tmp
97touch ${OSTYPE}.system.cache
98])
99
100AC_DEFUN(AC_OVERRIDES_DONE,
101[
102mv ${OSTYPE}.system.cache.tmp ${OSTYPE}.system.cache
103])
104
105dnl package,message,helpmessage,variable
106AC_DEFUN(AC_OVERRIDES,
107[
108AC_MSG_CHECKING("for $2")
109AC_ARG_WITH($1,$3,
110[if test "x$with_$1" = xyes; then
111 ac_cv_use_$1='$4="1"'
112else
113 ac_cv_use_$1='$4="0"'
114fi],
115[
116 LINE=`grep "$4" ${OSTYPE}.system.cache`
117 if test "x$LINE" != x ; then
118 eval "DEFAULT_$LINE"
119 fi
120 ac_cv_use_$1='$4='$DEFAULT_$4
121])
122eval "$ac_cv_use_$1"
123echo $ac_cv_use_$1 >> ${OSTYPE}.system.cache.tmp
124if test "$$4" = 1; then
125 AC_MSG_RESULT(yes)
126else
127 AC_MSG_RESULT(no)
128fi
129])
130
131dnl package,message,helpmessage,variable
132AC_DEFUN(AC_OVERRIDES_OLD,
133[
134AC_MSG_CHECKING("for $2")
135AC_CACHE_VAL(ac_cv_use_$1,
136[
137AC_ARG_WITH($1,$3,
138[if test "x$with_$1" = xyes; then
139 ac_cv_use_$1='$4="1"'
140else
141 ac_cv_use_$1='$4="0"'
142fi],[ac_cv_use_$1='$4=$DEFAULT_$4'])
143])
144eval "$ac_cv_use_$1"
145
146if test "$$4" = 1; then
147 AC_MSG_RESULT(yes)
148else
149 AC_MSG_RESULT(no)
150fi
151])
152
153AC_DEFUN(AC_PATH_FIND_INCLUDES,
154[
155ac_find_includes=
156for ac_dir in $1;
157 do
158 if test -f "$ac_dir/$2"; then
159 ac_find_includes=$ac_dir
160 break
161 fi
162 done
163])
164
165AC_DEFUN(AC_PATH_FIND_LIBRARIES,
166[
167ac_find_libraries=
168for ac_dir in $1;
169 do
170 for ac_extension in a so sl; do
171 if test -f "$ac_dir/lib$2.$ac_extension"; then
172 ac_find_libraries=$ac_dir
173 break 2
174 fi
175 done
176 done
177])
178
179dnl Path to include, allready defined
180AC_DEFUN(AC_INCLUDE_PATH_EXIST,
181[
182 ac_path_to_include=$1
183 echo "$2" | grep "\-I$1" > /dev/null
184 result=$?
185 if test $result = 0; then
186 ac_path_to_include=""
187 else
188 ac_path_to_include="-I$1"
189 fi
190])
191
192dnl Path to link, allready defined
193AC_DEFUN(AC_LINK_PATH_EXIST,
194[
195 echo "$2" | grep "\-L$1" > /dev/null
196 result=$?
197 if test $result = 0; then
198 ac_path_to_link=""
199 else
200 ac_path_to_link="-L$1"
201 fi
202])
203
204dnl ------------------------------------------------------------------------
205dnl Process this file with autoconf to produce a configure script.
206dnl ------------------------------------------------------------------------
207
208AC_INIT(configure.in)
209
210dnl ------------------------------------------------------------------------
211dnl Check platform
212dnl ------------------------------------------------------------------------
213
214OS="${OSTYPE}"
215
216if test "x$OS" = "x"; then
217 UNAME=`uname`
218 AC_MSG_ERROR("The system variable OS has not been set"
219 "please set is everytime befor compiling on this system"
220 "A good example for this system would be:"
221 "setenv OSTYPE $UNAME for csh as a SHELL"
222 "EXPORT OSTYPE=$UNAME for sh as SHELL"
223 "please set this and restart again."
224 )
225fi
226
227dnl ------------------------------------------------------------------------
228dnl Set base directory
229dnl ------------------------------------------------------------------------
230
231WXBASEDIR=`pwd`
232AC_SUBST(WXBASEDIR)
233
234dnl ------------------------------------------------------------------------
235dnl search path for includes and libraries
236dnl ------------------------------------------------------------------------
237
238SEARCH_INCLUDE="\
239 /usr/Motif1.2/include \
240 \
241 /usr/X11R6/include \
242 /usr/X11R5/include \
243 /usr/X11R4/include \
244 \
76153302
RR
245 /usr/X11R6/lib \
246 /usr/X11R5/lib \
247 /usr/X11R4/lib \
248 \
bcf1fa6b
RR
249 /usr/include/X11R6 \
250 /usr/include/X11R5 \
251 /usr/include/X11R4 \
252 \
253 /usr/local/X11R6/include \
254 /usr/local/X11R5/include \
255 /usr/local/X11R4/include \
256 \
257 /usr/local/include/X11R6 \
258 /usr/local/include/X11R5 \
259 /usr/local/include/X11R4 \
260 \
261 /usr/X11/include \
262 /usr/include/X11 \
263 /usr/local/X11/include \
264 /usr/local/include/X11 \
265 \
266 /usr/X386/include \
267 /usr/x386/include \
268 /usr/XFree86/include/X11 \
269 \
270 /usr/include \
f3855ef0
RR
271 /usr/include/gtk \
272 /usr/include/gdk \
273 /usr/include/glib \
bcf1fa6b
RR
274 /usr/local/include \
275 /usr/unsupported/include \
276 /usr/athena/include \
277 /usr/local/x11r5/include \
278 /usr/lpp/Xamples/include \
279 \
280 /usr/local/include/gtk \
d18ed59a
RR
281 /usr/local/include/Xm \
282 /usr/local/include/qt \
bcf1fa6b
RR
283 /usr/X11R6/include/Xm \
284 /usr/X11/include/Xm \
285 /usr/include/qt \
286 \
287 /usr/openwin/include \
288 /usr/openwin/share/include \
289 "
290
291SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s/include/lib/g` \
292 "
293
294dnl ------------------------------------------------------------------------
295dnl standard checks
296dnl ------------------------------------------------------------------------
297
298dnl ###################
299dnl # checks programs #
300dnl ###################
301
302dnl C-compiler checks
303dnl =================
304dnl use what compiler
305AC_PROG_CC
306dnl defines CC with the compiler to use
307dnl defines GCC with yes if using gcc
308dnl defines GCC empty if not using gcc
309dnl defines CFLAGS
310
311CFLAGS=`echo "$CFLAGS" | sed 's/-g//g'`
312
313dnl does compiler support -c and -o simultaniously
314AC_PROG_CC_C_O
315dnl defines NO_MINUS_C_MINUS_O if compiler does not accept
316dnl both switches simultaniously
317dnl what is the c-preprocessor
318AC_PROG_CPP
319dnl defines CPP with the c-preprocessor
320dnl is -traditional needed for correct compilations
321AC_PROG_GCC_TRADITIONAL
322dnl adds -traditional for gcc if needed
323
324AC_LANG_SAVE
325
326dnl C++-compiler checks
327dnl ===================
328dnl use what compiler
329AC_PROG_CXX
330dnl defines CXX with the compiler to use
331dnl defines GXX with yes if using gxx
332dnl defines GXX empty if not using gxx
333dnl defines CXXFLAGS
334dnl what is the C++-preprocessor
335AC_PROG_CXXCPP
336dnl defines CXXCPP with the C++-preprocessor
337
338CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-g//g'`
339
340AC_LANG_RESTORE
341
342dnl ranlib command
343dnl ==============
344AC_PROG_RANLIB
345dnl defines RANLIB with the appropriate command
346
347dnl ar command
348dnl ==========
349AC_CHECK_PROG(AR, ar, ar, ar)
350dnl defines AR with the appropriate command
351
352dnl install checks
353dnl ==============
354AC_PROG_INSTALL
355dnl defines INSTALL with the appropriate command
356
357dnl does ln -s works
358dnl ================
359AC_PROG_LN_S
360dnl defines LN_S with the appropriate command
361
362dnl awk command
363dnl ===========
364AC_PROG_AWK
365dnl defines AWK with the appropriate command
366
367dnl ###############
368dnl # make checks #
369dnl ###############
370dnl check if VPATH works
371AC_MSG_CHECKING("make for VPATH support")
372dnl create Makefile
373cat - << EOF > confMake
374check : file
375 cp \$? \$@
376 cp \$? final_file
377EOF
378
379if test ! -d sub ; then
380 mkdir sub
381fi
382echo dummy > sub/file
383${MAKE-make} -f confMake VPATH=sub 2> config.log > /dev/null
384RESULT=$?
851b9459 385rm -f sub/file check final_file confMake
bcf1fa6b
RR
386rmdir sub
387if test "$RESULT" = 0; then
388 AC_MSG_RESULT(yes)
389else
390 AC_MSG_RESULT(no)
391 AC_MSG_ERROR(
392You need a make-utility that is able to use the variable
393VPATH correctly.
394If your version of make does not support VPATH correctly,
395please install GNU-make (possibly as gmake), and start
396configure with the following command:
397export MAKE=gmake; ./configure for sh-type shells
398setenv MAKE gmake; ./configure for csh-type shells
399Also please do remember to use gmake in this case every time
400you are trying to compile.
401)
402fi
403
404dnl ####################
405dnl # checks libraries #
406dnl ####################
407
408dnl find the X11 include and library files
409AC_PATH_XTRA
410dnl defines x_includes and x_libraries
411
412dnl #######################
413dnl # checks header files #
414dnl #######################
415AC_HEADER_DIRENT
416dnl defines DIR
417dnl defines MACRO HAVE_DIRENT_H if dirent.h exists
418dnl defines MACRO HAVE_SYS_NDIR_H if sys/ndir.h exists
419dnl defines MACRO HAVE_SYS_DIR_H if sys/dir.h exists
420dnl defines MACRO HAVE_NDIR_H if ndir.h exists
421AC_HEADER_STDC
422dnl defines STDC_HEADERS if ANSI-C header
423AC_HEADER_SYS_WAIT
424dnl defines HAVE_SYS_WAIT_H if sys/wait.h exist and is POSIX.1
a4876ea4 425AC_CHECK_HEADERS(fcntl.h)
bcf1fa6b 426dnl defines HAVE_FCNTL_H
a4876ea4 427AC_CHECK_HEADERS(limits.h)
bcf1fa6b 428dnl defines HAVE_LIMITS_h
a4876ea4 429AC_CHECK_HEADERS(sys/file.h)
bcf1fa6b 430dnl defines HAVE_SYS_FILE_H
a4876ea4 431AC_CHECK_HEADERS(sys/time.h)
bcf1fa6b 432dnl defines HAVE_SYS_TIME_H
a4876ea4 433AC_CHECK_HEADERS(unistd.h)
bcf1fa6b 434dnl defines HAVE_UNISTD_H
a4876ea4
KB
435AC_CHECK_HEADERS(fnmatch.h)
436dnl defines HAVE_FNMATCH_H
bcf1fa6b 437dnl As it needs Linux 2.1.x for the moment: check whether the file exists (GL).
a4876ea4 438AC_CHECK_HEADERS(linux/joystick.h)
bcf1fa6b
RR
439GTK_JOYSTICK=""
440if test "$ac_cv_header_linux_joystick_h" = "yes"; then
441 GTK_JOYSTICK="gtk/joystick.cpp"
442fi
443AC_SUBST(GTK_JOYSTICK)
444
35c9d958
KB
445dnl check for vprintf/vsprintf() which are GNU extensions
446AC_FUNC_VPRINTF
447dnl check for vsnprintf() which is another GNU extension
448AC_CHECK_FUNC(vsnprintf)
449
32cbeff4
KB
450AC_LANG_SAVE
451AC_LANG_CPLUSPLUS
452AC_CHECK_HEADERS(iostream)
453if test "x$HAVE_IOSTREAM" = "x" ; then
454 AC_DEFINE(wxUSE_IOSTREAMH)
455fi
456AC_LANG_RESTORE
457
458dnl defines HAVE_IOSTREAM
bcf1fa6b
RR
459dnl ###################
460dnl # checks typedefs #
461dnl ###################
462AC_TYPE_GETGROUPS
463dnl defines GETGROUPS_T
464AC_TYPE_MODE_T
465dnl defines mode_t if not already defined
466AC_TYPE_OFF_T
467dnl defines off_t if not already defined
468AC_TYPE_PID_T
469dnl defines pid_t if not already defined
470AC_TYPE_SIGNAL
471dnl defines RETSIGTYPE for the correct return type of signal
472AC_TYPE_SIZE_T
473dnl defines size_t if not already defined
474AC_TYPE_UID_T
475dnl defines uid_t and gid_t if not already defined
476
477dnl #####################
478dnl # checks structures #
479dnl #####################
480
481AC_HEADER_STAT
482dnl defines STAT_MACROS_BROKEN if S_ISDIR and S_ISREG
483dnl do not work properly
484AC_HEADER_TIME
485dnl defines TIME_WITH_SYS_TIME if time.h and sys/time.h can
486dnl both be included
487AC_STRUCT_ST_BLKSIZE
488dnl defines HAVE_ST_BLKSIZE if struct stat contains st_blksize
489AC_STRUCT_ST_BLOCKS
490dnl defines HAVE_ST_BLOCKS if struct stat contains st_blocks
491AC_STRUCT_ST_RDEV
492dnl defines HAVE_ST_RDEV if struct stat contains st_rdev
493AC_STRUCT_TM
494dnl defines TM_IN_SYS_TIME if struct tm is not in time.h
495AC_STRUCT_TIMEZONE
496dnl defines HAVE_ST_BLKSIZE if struct tm contains tm_zone
497dnl otherwise
498dnl defines HAVE_TZNAME if external array tzname is found
499
500dnl ###################################
501dnl # checks compiler characteristics #
502dnl ###################################
503dnl AC_C_CROSS
504
505AC_C_CONST
506dnl defines const to be empty if c-compiler does not support const fully
507AC_C_INLINE
508dnl defines inline to a sensible value for the c-compiler
509AC_C_CHAR_UNSIGNED
510dnl defines __CHAR_UNSIGNED__ if char is unsigned
511AC_C_LONG_DOUBLE
512dnl defines HAVE_LONGDOUBLE if compiler supports long double
513
514AC_C_BIGENDIAN
515dnl defines WORDS_BIGENDIAN if system is big endian
516
517AC_CHECK_SIZEOF(int *)
518AC_CHECK_SIZEOF(int)
519AC_CHECK_SIZEOF(long)
520dnl defines the size of certain types of variables in SIZEOF_???
521
522dnl ############################
523dnl # checks library functions #
524dnl ############################
525
526dnl ##########################
527dnl # checks system services #
528dnl ##########################
529
530
531AC_SYS_LONG_FILE_NAMES
532dnl defines HAVE_LONG_FILENAMES if filenames longer then
533dnl 14 chars are supported
534
535dnl AC_SYS_RESTARTABLE_SYSCALLS
536dnl defines HAVE_RESTARTABLE_SYSCALLS if the system restarts a
537dnl system call that is interrupted
538dnl by a signal
539
540dnl #################
541dnl # checks PARSER #
542dnl #################
543
544dnl YACC checks
545dnl ===========
546AC_PROG_YACC
547dnl defines YACC with the appropriate command
548
549dnl LEX checks
550dnl ==========
551AC_PROG_LEX
552dnl defines LEX with the appropriate command
553dnl defines LEXLIB with the appropriate library
554dnl what type is yytext
555AC_DECL_YYTEXT
556dnl defines YYTEXT_POINTER if yytext is char*
557dnl defines LEX_OUTPUT_ROOT as to the base of the
558dnl filename output by the lexer
559
560dnl ------------------------------------------------------------------------
561dnl main includes
562dnl ------------------------------------------------------------------------
563
564CHECK_INCLUDE="-I/usr/include $X_CFLAGS"
565CHECK_LIB="-L/lib -L/usr/lib $X_LIBS"
566
567dnl ------------------------------------------------------------------------
568dnl host system
569dnl ------------------------------------------------------------------------
570
571AC_CANONICAL_HOST
572canonical=$host
573configuration=$host_alias
574
575dnl ------------------------------------------------------------------------
576dnl system settings
577dnl ------------------------------------------------------------------------
578
579USE_UNIX=1
580
581
582USE_LINUX=
583USE_SGI=
584USE_HPUX=
585USE_SYSV=
586USE_SVR4=
587USE_AIX=
588USE_SUN=
589USE_SOLARIS=
590USE_SUNOS=
591USE_ALPHA=
592USE_OSF=
593USE_BSD=
594USE_FREEBSD=
595USE_VMS=
596USE_ULTRIX=
597USE_DATA_GENERAL=
598
f780dc86 599AC_DEFINE(__UNIX__)
bcf1fa6b
RR
600case "${canonical}" in
601 *-hp-hpux* )
602 USE_HPUX=1
603 AC_DEFINE(__HPUX__)
604 ;;
605 *-*-linux* )
606 USE_LINUX=1
607 AC_DEFINE(__LINUX__)
e0e680d2
KB
608 TMP=`uname -m`
609 if test "x$TMP" = "xalpha"
610 then
611 USE_ALPHA=1
612 AC_DEFINE(__ALPHA__)
613 fi
bcf1fa6b
RR
614 ;;
615 *-*-irix5* | *-*-irix6* )
616 USE_SGI=1
617 USE_SVR4=1
618 AC_DEFINE(__SGI__)
619 AC_DEFINE(__SVR4__)
620 ;;
621 *-*-solaris2* )
622 USE_SUN=1
623 USE_SOLARIS=1
624 USE_SVR4=1
625 AC_DEFINE(__SUN__)
626 AC_DEFINE(__SOLARIS__)
627 AC_DEFINE(__SVR4__)
628 ;;
629 *-*-sunos4* )
630 USE_SUN=1
631 USE_SUNOS=1
632 USE_BSD=1
633 AC_DEFINE(__SUN__)
634 AC_DEFINE(__SUNOS__)
635 AC_DEFINE(__BSD__)
636 ;;
637 *-*-freebsd* | *-*-netbsd*)
638 USE_BSD=1
639 USE_FREEBSD=1
640 AC_DEFINE(__FREEBSD__)
641 AC_DEFINE(__BSD__)
642 ;;
643 *-*-osf* )
644 USE_ALPHA=1
645 USE_OSF=1
646 AC_DEFINE(__ALPHA__)
647 AC_DEFINE(__OSF__)
648 ;;
649 *-*-dgux5* )
650 USE_ALPHA=1
651 USE_SVR4=1
652 AC_DEFINE(__ALPHA__)
653 AC_DEFINE(__SVR4__)
654 ;;
655 *-*-sysv5* )
656 USE_SYSV=1
657 USE_SVR4=1
658 AC_DEFINE(__SYSV__)
659 AC_DEFINE(__SVR4__)
660 ;;
661 *-*-aix* )
662 USE_AIX=1
663 USE_SYSV=1
664 USE_SVR4=1
665 AC_DEFINE(__AIX__)
666 AC_DEFINE(__SYSV__)
667 AC_DEFINE(__SVR4__)
668 ;;
669 *)
670 AC_MSG_ERROR(I don't know your system type.)
671esac
672
673dnl ------------------------------------------------------------------------
674dnl defaults for command options
675dnl ------------------------------------------------------------------------
676
677AC_OVERRIDES_PREPARE
678
6fbf0513 679DEFAULT_wxUSE_GTK=1
8248314d
VZ
680DEFAULT_wxUSE_QT=0
681DEFAULT_wxUSE_MOTIF=0
bcf1fa6b 682
27fc802d 683DEFAULT_wxUSE_THREADS=1
cb43b372 684
8248314d
VZ
685DEFAULT_wxUSE_SHARED=1
686DEFAULT_wxUSE_OPTIMISE=1
687DEFAULT_wxUSE_PROFILE=0
688DEFAULT_wxUSE_DEBUG_FLAG=0
689DEFAULT_wxUSE_DEBUG_INFO=0
690DEFAULT_wxUSE_MEM_TRACING=0
691DEFAULT_wxUSE_DMALLOC=0
692DEFAULT_wxUSE_APPLE_IEEE=1
693DEFAULT_wxUSE_IOSTREAMH=1
694
695DEFAULT_wxUSE_ZLIB=1
8248314d 696DEFAULT_wxUSE_LIBPNG=1
a65f3e54 697DEFAULT_wxUSE_ODBC=0
8248314d
VZ
698
699DEFAULT_wxUSE_COMBOBOX=1
700DEFAULT_wxUSE_GAUGE=1
701DEFAULT_wxUSE_SCROLLBAR=1
702DEFAULT_wxUSE_LISTCTRL=1
703DEFAULT_wxUSE_TREECTRL=1
704DEFAULT_wxUSE_GRID=1
705DEFAULT_wxUSE_TAB_DIALOG=1
706DEFAULT_wxUSE_NOTEBOOK=1
707
708DEFAULT_wxUSE_TIMEDATE=1
709DEFAULT_wxUSE_FRACTION=1
710DEFAULT_wxUSE_LOG=1
711DEFAULT_wxUSE_INTL=1
712DEFAULT_wxUSE_CONFIG=1
713DEFAULT_wxUSE_STREAMS=1
714DEFAULT_wxUSE_SERIAL=1
715DEFAULT_wxUSE_FILE=1
716DEFAULT_wxUSE_TEXTFILE=1
717
718DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=1
bcf1fa6b 719DEFAULT_WX_NORMALIZED_PS_FONTS=1
8248314d 720DEFAULT_wxUSE_POSTSCRIPT=1
bcf1fa6b 721
8248314d
VZ
722DEFAULT_wxUSE_IPC=1
723DEFAULT_wxUSE_RESOURCES=1
724DEFAULT_wxUSE_CONSTRAINTS=1
8b53e5a2 725DEFAULT_wxUSE_CLIPBOARD=1
8248314d 726DEFAULT_wxUSE_DND=1
bcf1fa6b 727
8248314d
VZ
728DEFAULT_wxUSE_MDI_ARCHITECTURE=1
729DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=1
730DEFAULT_wxUSE_PRINTING_ARCHITECTURE=1
bcf1fa6b 731
8248314d
VZ
732DEFAULT_wxUSE_PROLOGIO=1
733DEFAULT_wxUSE_WX_RESOURCES=1
734DEFAULT_wxUSE_RPC=0
bcf1fa6b 735
8248314d
VZ
736DEFAULT_wxUSE_OPENGL=0
737DEFAULT_wxUSE_METAFILE=0
738DEFAULT_wxUSE_WXGRAPH=0
739DEFAULT_wxUSE_WXTREE=0
e9aad10a 740DEFAULT_wxUSE_HELP=1
bcf1fa6b 741
fb4e5803
VZ
742DEFAULT_wxUSE_UNICODE=1
743DEFAULT_wxUSE_WCSRTOMBS=0
744
bcf1fa6b
RR
745dnl ----------------------------------------------------------------
746dnl toolkit options
747dnl ----------------------------------------------------------------
748
749AC_OVERRIDES(gtk,gtk,
750**--with-gtk use GTK,
8248314d 751wxUSE_GTK)
bcf1fa6b
RR
752
753AC_OVERRIDES(qt,qt,
754**--with-qt use Qt,
8248314d 755wxUSE_QT)
bcf1fa6b
RR
756
757AC_OVERRIDES(motif,motif,
758**--with-motif use Motif/Lesstif,
8248314d 759wxUSE_MOTIF)
bcf1fa6b
RR
760
761dnl ----------------------------------------------------------------
762dnl compile options
763dnl ----------------------------------------------------------------
764
765AC_OVERRIDES(shared,shared,
766**--with-shared create shared libraries,
8248314d 767wxUSE_SHARED)
bcf1fa6b
RR
768
769AC_OVERRIDES(optimise,optimise,
770**--with-optimise create optimised code,
8248314d 771wxUSE_OPTIMISE)
bcf1fa6b
RR
772
773AC_OVERRIDES(debug_flag,debug_flag,
774**--with-debug_flag create code with WXDEBUG define set to 1,
8248314d 775wxUSE_DEBUG_FLAG)
bcf1fa6b
RR
776
777AC_OVERRIDES(debug_info,debug_info,
778**--with-debug_info create code with debuging information,
8248314d 779wxUSE_DEBUG_INFO)
bcf1fa6b 780
2904eefd
KB
781AC_OVERRIDES(debug_gdb,debug_gdb,
782**--with-debug_gdb create code with extra GDB debuging information,
783wxUSE_DEBUG_GDB)
784
bcf1fa6b
RR
785AC_OVERRIDES(mem_tracing,mem_tracing,
786**--with-mem_traing create code with memory tracing,
8248314d 787wxUSE_MEM_TRACING)
bcf1fa6b
RR
788
789AC_OVERRIDES(dmalloc,dmalloc,
790**--with-dmalloc use dmalloc memory debug library (www.letters.com/dmalloc/),
8248314d 791wxUSE_DMALLOC)
bcf1fa6b
RR
792
793AC_OVERRIDES(profile,profile,
794**--with-profile create code with profiling information,
8248314d 795wxUSE_PROFILE)
bcf1fa6b
RR
796
797AC_OVERRIDES(apple_ieee, apple_ieee,
798**--with_apple_ieee use the Apple IEEE codec,
8248314d 799wxUSE_APPLE_IEEE)
bcf1fa6b
RR
800
801dnl ----------------------------------------------------------------
802dnl user options for libraries
803dnl ----------------------------------------------------------------
804
805AC_OVERRIDES(zlib,zlib,
806**--with-zlib use zlib for LZW comression,
8248314d 807wxUSE_ZLIB)
bcf1fa6b 808
bcf1fa6b
RR
809AC_OVERRIDES(libpng,libpng,
810**--with-libpng use libpng (PNG image format),
8248314d 811wxUSE_LIBPNG)
bcf1fa6b
RR
812
813AC_OVERRIDES(odbc,odbc,
814**--with-odbc use iODBC and wxODBC classes,
8248314d 815wxUSE_ODBC)
bcf1fa6b
RR
816
817AC_OVERRIDES(opengl,opengl,
818**--with-opengl use OpenGL (or Mesa),
8248314d 819wxUSE_OPENGL)
bcf1fa6b
RR
820
821dnl ----------------------------------------------------------------
822dnl user options for GUI control classes
823dnl ----------------------------------------------------------------
824
825AC_OVERRIDES(gauge,gauge,
826**--with-gauge use wxGauge class,
8248314d 827wxUSE_GAUGE)
bcf1fa6b 828
a60c99e6
RR
829AC_OVERRIDES(combobox,combobox,
830**--with-combobox use wxComboBox class,
8248314d 831wxUSE_COMBOBOX)
a60c99e6 832
bcf1fa6b
RR
833AC_OVERRIDES(scrollbar,scrollbar,
834**--with-scrollbar use wxScrollbar class,
8248314d 835wxUSE_SCROLLBAR)
bcf1fa6b
RR
836
837AC_OVERRIDES(listctrl,listctrl,
838**--with-listctrl use wxListCtrl class,
8248314d 839wxUSE_LISTCTRL)
bcf1fa6b
RR
840
841AC_OVERRIDES(treectrl,treectrl,
842**--with-treectrl use wxTreeCtrl class,
8248314d 843wxUSE_TREECTRL)
bcf1fa6b
RR
844
845AC_OVERRIDES(grid,grid,
846**--with-grid use wxGrid class,
8248314d 847wxUSE_GRID)
bcf1fa6b
RR
848
849AC_OVERRIDES(tab_dialog,tab_dialog,
850**--with-tab_dialog use wxTabDia class,
8248314d 851wxUSE_TAB_DIALOG)
bcf1fa6b
RR
852
853AC_OVERRIDES(notebook,notebook,
854**--with-notebook use wxNotebook class,
8248314d 855wxUSE_NOTEBOOK)
bcf1fa6b
RR
856
857dnl ----------------------------------------------------------------
858dnl user options for non-GUI classes
859dnl ----------------------------------------------------------------
860
861AC_OVERRIDES(timedate, timedate,
862**--with-timedate use wxTime and wxDate classes,
8248314d 863wxUSE_TIMEDATE)
bcf1fa6b
RR
864
865AC_OVERRIDES(fraction,fraction,
866**--with-fraction use wxFraction class,
8248314d 867wxUSE_FRACTION)
bcf1fa6b
RR
868
869AC_OVERRIDES(log,log,
870**--with-log use logging system,
8248314d 871wxUSE_LOG)
bcf1fa6b
RR
872
873AC_OVERRIDES(intl,intl,
874**--with-intl use internationalization system,
8248314d 875wxUSE_INTL)
bcf1fa6b
RR
876
877AC_OVERRIDES(config,config,
878**--with-config use wxConfig class,
8248314d 879wxUSE_CONFIG)
bcf1fa6b
RR
880
881AC_OVERRIDES(streams,streams,
882**--with-streams use wxStream etc classes,
8248314d 883wxUSE_STREAMS)
bcf1fa6b
RR
884
885AC_OVERRIDES(serial,serial,
886**--with-serial use class serialization,
8248314d 887wxUSE_SERIAL)
bcf1fa6b
RR
888
889AC_OVERRIDES(file,file,
890**--with-file use wxFile class,
8248314d 891wxUSE_FILE)
bcf1fa6b
RR
892
893AC_OVERRIDES(textfile,textfile,
894**--with-textfile use wxTextFile class,
8248314d 895wxUSE_TEXTFILE)
bcf1fa6b
RR
896
897dnl ----------------------------------------------------------------
898dnl user options for PostScript
899dnl ----------------------------------------------------------------
900
901AC_OVERRIDES(afmfonts,afmfonts,
902**--with-afmfonts use Adobe Font Metric Font table,
8248314d 903wxUSE_AFM_FOR_POSTSCRIPT)
bcf1fa6b
RR
904
905AC_OVERRIDES(normalized, normalized,
906**--with-PS-normalized use normalized PS fonts,
907WX_NORMALIZED_PS_FONTS)
908
909AC_OVERRIDES(postscript, postscript,
910**--with-postscript use wxPostscriptDC device context,
8248314d 911wxUSE_POSTSCRIPT)
bcf1fa6b 912
fb4e5803
VZ
913dnl ----------------------------------------------------------------
914dnl user options for wxString and Unicode
915dnl ----------------------------------------------------------------
916
917AC_OVERRIDES(unicode,unicode,
918**--with-unicode compile wxString with Unicode support,
919wxUSE_UNICODE)
920
921AC_OVERRIDES(wcsrtombs,wcsrtombs,
922**--with-wcsrtombs use wcsrtombs instead of (buggy in GNU libc5) wcstombs,
923wxUSE_WCSRTOMBS)
924
bcf1fa6b
RR
925dnl ----------------------------------------------------------------
926dnl user options for Prolog and Resources
927dnl ----------------------------------------------------------------
928
929AC_OVERRIDES(wxresources,wxresources,
930**--with-wxresources use wxWindows's resources,
8248314d 931wxUSE_WX_RESOURCES)
bcf1fa6b
RR
932
933AC_OVERRIDES(prologio,prologio,
934**--with-prologio use Prolog IO library,
8248314d 935wxUSE_PROLOGIO)
bcf1fa6b
RR
936
937AC_OVERRIDES(rpc,RPC,
938**--with-rpc use Prolog's remote procedure calls,
8248314d 939wxUSE_RPC)
bcf1fa6b
RR
940
941dnl ----------------------------------------------------------------
942dnl user options for misc stuff
943dnl ----------------------------------------------------------------
944
945AC_OVERRIDES(ipc,IPC,
946**--with-ipc use interprocess communication (wxSocket etc.),
8248314d 947wxUSE_IPC)
bcf1fa6b
RR
948
949AC_OVERRIDES(resources,resources,
950**--with-resources use X resources for saving information,
8248314d 951wxUSE_RESOURCES)
bcf1fa6b
RR
952
953AC_OVERRIDES(clipboard,clipboard,
954**--with-clipboard use wxClipboard classes,
8248314d 955wxUSE_CLIPBOARD)
bcf1fa6b
RR
956
957AC_OVERRIDES(dnd,dnd,
958**--with-dnd use Drag'n'Drop classes,
8248314d 959wxUSE_DND)
bcf1fa6b
RR
960
961AC_OVERRIDES(constraints,constrains,
962**--with-constraints use layout-constraints system,
8248314d 963wxUSE_CONSTRAINTS)
bcf1fa6b
RR
964
965dnl ----------------------------------------------------------------
966dnl user options for architectures
967dnl ----------------------------------------------------------------
968
969AC_OVERRIDES(mdi,mdi,
970**--with-mdi use multiple document interface architecture,
8248314d 971wxUSE_MDI_ARCHITECTURE)
bcf1fa6b
RR
972
973AC_OVERRIDES(docview,docview,
974**--with-docview use document view architecture,
8248314d 975wxUSE_DOC_VIEW_ARCHITECTURE)
bcf1fa6b
RR
976
977AC_OVERRIDES(printarch,printarch,
978**--with-printarch use printing architecture,
8248314d 979wxUSE_PRINTING_ARCHITECTURE)
bcf1fa6b 980
e9aad10a
KB
981AC_OVERRIDES(help,help,
982**--with-help use help (using external browser at present),
983wxUSE_HELP)
984
bcf1fa6b
RR
985dnl ----------------------------------------------------------------
986dnl user options with no effect yet
987dnl ----------------------------------------------------------------
988dnl
989dnl AC_OVERRIDES(metafile, metafile,
990dnl **--with-metafile use metafile (no effect),
d18ed59a 991dnl wxUSE_METAFILE)
bcf1fa6b 992dnl
bcf1fa6b
RR
993dnl AC_OVERRIDES(wxgraph,wxgraph,
994dnl **--with-wxgraph use wxgraph (no effect),
d18ed59a 995dnl wxUSE_WXGRAPH)
bcf1fa6b
RR
996dnl
997dnl AC_OVERRIDES(wxtree,wxtree,
998dnl **--with-wxtree use wxtree (no effect),
d18ed59a 999dnl wxUSE_WXTREE)
bcf1fa6b
RR
1000dnl
1001dnl AC_OVERRIDES(package,message,helpmessage,variable)
1002dnl
1003dnl ----------------------------------------------------------------
1004dnl Unix, obviously
1005dnl ----------------------------------------------------------------
1006
8248314d 1007if test "$wxUSE_UNIX" = 1 ; then
bcf1fa6b
RR
1008 AC_DEFINE(__UNIX__)
1009fi
1010
1011dnl ----------------------------------------------------------------
1012dnl search for toolkit (widget sets)
1013dnl ----------------------------------------------------------------
1014
1015TOOLKIT=
1016TOOLKIT_DEF=
1017
1018GUI_TK_INCLUDE=
1019GUI_TK_LIBRARY=
1020GUI_TK_LINK=
1021
76153302
RR
1022WX_LINK=
1023
bcf1fa6b
RR
1024MAKEINCLUDE=
1025
8248314d 1026if test "$wxUSE_GTK" = 1; then
fee04295 1027 AM_PATH_GTK(1.0.4, [
bcf1fa6b
RR
1028 GUI_TK_INCLUDE="$GTK_CFLAGS"
1029 GUI_TK_LIBRARY="$GTK_LIBS"
f3855ef0 1030 ], AC_MSG_ERROR(Is gtk-config in path and GTK+ is version 1.0.4 up-to 1.0.6?))
bcf1fa6b
RR
1031 TOOLKIT=GTK
1032 TOOLKIT_DEF=__WXGTK__
d669c241 1033 WX_LINK=-lwx_gtk_1_0
bcf1fa6b
RR
1034 MAKEINCLUDE=../gtk.inc
1035fi
1036
8248314d 1037if test "$wxUSE_QT" = 1; then
bcf1fa6b
RR
1038 AC_MSG_CHECKING(for Qt includes)
1039 AC_PATH_FIND_INCLUDES($SEARCH_INCLUDE,qapp.h)
1040 if test "$ac_find_includes" != "" ; then
1041 AC_MSG_RESULT(found $ac_find_includes)
1042 AC_MSG_CHECKING(for Qt library)
1043 AC_PATH_FIND_LIBRARIES($SEARCH_LIB,qt)
1044 if test "$ac_find_libraries" != "" ; then
1045 AC_INCLUDE_PATH_EXIST($ac_find_includes,$CHECK_INCLUDE)
1046 AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
1047 CHECK_LINK="$CHECK_INCLUDE $ac_path_to_link"
1048 CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include"
1049 AC_MSG_RESULT(found Qt at $ac_find_libraries)
1050 else
1051 AC_MSG_ERROR(no)
1052 fi
1053 else
1054 AC_MSG_ERROR(no)
1055 fi
76153302 1056 GUI_TK_LINK="-lX11 -lqt -lm"
bcf1fa6b
RR
1057 TOOLKIT=QT
1058 TOOLKIT_DEF=__WXQT__
76153302 1059 WX_LINK=-lwx_qt
bcf1fa6b
RR
1060 MAKEINCLUDE=../qt.inc
1061fi
1062
8248314d 1063if test "$wxUSE_MOTIF" = 1; then
bcf1fa6b
RR
1064 AC_MSG_CHECKING(for Motif/Lesstif includes)
1065 AC_PATH_FIND_INCLUDES($SEARCH_INCLUDE,Xm.h)
1066 if test "$ac_find_includes" != "" ; then
1067 AC_MSG_RESULT(found $ac_find_includes)
76153302 1068 AC_MSG_CHECKING(for Motif/Lesstif library)
bcf1fa6b
RR
1069 AC_PATH_FIND_LIBRARIES($SEARCH_LIB,Xm)
1070 if test "$ac_find_libraries" != "" ; then
1071 AC_INCLUDE_PATH_EXIST($ac_find_includes,$CHECK_INCLUDE)
1072 AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
76153302 1073 CHECK_LINK="$CHECK_LIB $ac_path_to_link"
bcf1fa6b
RR
1074 CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include"
1075 AC_MSG_RESULT(found at $ac_find_libraries)
76153302
RR
1076 AC_MSG_CHECKING(for Xt library)
1077 AC_PATH_FIND_LIBRARIES($SEARCH_LIB,Xt)
1078 if test "$ac_find_libraries" != "" ; then
1079 AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
1080 CHECK_LINK="$CHECK_LIB $ac_path_to_link"
1081 AC_MSG_RESULT(found at $ac_find_libraries)
892dbe99
RR
1082 AC_MSG_CHECKING(for Xpm library)
1083 AC_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm)
1084 if test "$ac_find_libraries" != "" ; then
1085 AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
1086 CHECK_LINK="$CHECK_LIB $ac_path_to_link"
1087 AC_MSG_RESULT(found at $ac_find_libraries)
1088 else
1089 AC_MSG_ERROR(no)
1090 fi
76153302
RR
1091 else
1092 AC_MSG_ERROR(no)
1093 fi
bcf1fa6b
RR
1094 else
1095 AC_MSG_ERROR(no)
1096 fi
1097 else
1098 AC_MSG_ERROR(no)
1099 fi
f6c6dd8c
RR
1100
1101 GUI_TK_LINK="-lXm -lXmu -lXt -lXpm -lX11 -lm"
76153302 1102 GUI_TK_LINK="$CHECK_LINK $GUI_TK_LINK"
bcf1fa6b 1103 TOOLKIT=MOTIF
f6c6dd8c 1104 TOOLKIT_DEF="__WXMOTIF__ -D__LINUX__ -D__UNIX__"
76153302 1105 WX_LINK=-lwx_motif
bcf1fa6b
RR
1106 MAKEINCLUDE=../motif.inc
1107fi
1108
1109if test "$TOOLKIT" = ""; then
1110 AC_MSG_ERROR(You must specify a toolkit: --with-gtk --with-qt --with-motif)
1111fi
1112
1113AC_SUBST(GUI_TK_INCLUDE)
1114AC_SUBST(GUI_TK_LIBRARY)
1115AC_SUBST(GUI_TK_LINK)
1116
76153302
RR
1117AC_SUBST(WX_LINK)
1118
bcf1fa6b
RR
1119AC_SUBST(TOOLKIT)
1120AC_SUBST(TOOLKIT_DEF)
1121
1122AC_SUBST(MAKEINCLUDE)
1123
1124dnl ----------------------------------------------------------------
1125dnl Register compile options for makefiles and setup.h
1126dnl ----------------------------------------------------------------
1127
1128WXDEBUG=
2904eefd
KB
1129if test "$wxUSE_DEBUG_GDB" = 1 ; then
1130 wxUSE_DEBUG_INFO=1
f6c6dd8c
RR
1131 WXDEBUG="-ggdb"
1132 wxUSE_OPTIMISE=0
2904eefd
KB
1133else
1134 if test "$wxUSE_DEBUG_INFO" = 1 ; then
1135 WXDEBUG="-g"
1136 wxUSE_OPTIMISE=0
f0bec3de 1137 fi
bcf1fa6b
RR
1138fi
1139AC_SUBST(WXDEBUG)
1140
8248314d
VZ
1141if test "$wxUSE_DEBUG_FLAG" = 1 ; then
1142 AC_DEFINE_UNQUOTED(WXDEBUG,$wxUSE_DEBUG_FLAG)
bcf1fa6b
RR
1143 WXDEBUG_DEFINE="-D__WXDEBUG__"
1144 AC_SUBST(WXDEBUG_DEFINE)
f96aa4d9
RR
1145else
1146 WXDEBUG_DEFINE="-DGTK_NO_CHECK_CASTS"
1147 AC_SUBST(WXDEBUG_DEFINE)
bcf1fa6b
RR
1148fi
1149
8248314d
VZ
1150if test "$wxUSE_MEM_TRACING" = 1 ; then
1151 AC_DEFINE_UNQUOTED(wxUSE_MEMORY_TRACING,$wxUSE_MEM_TRACING)
1152 AC_DEFINE_UNQUOTED(wxUSE_GLOBAL_MEMORY_OPERATORS,$wxUSE_MEM_TRACING)
bcf1fa6b
RR
1153fi
1154
1155EXTRA_LINK=
8248314d 1156if test "$wxUSE_DMALLOC" = 1 ; then
bcf1fa6b
RR
1157 EXTRA_LINK="$EXTRA_LINK -ldmalloc"
1158fi
1159AC_SUBST(EXTRA_LINK)
1160
1161PROFILE=
8248314d 1162if test "$wxUSE_PROFILE" = 1 ; then
bcf1fa6b
RR
1163 PROFILE="-pg"
1164fi
1165AC_SUBST(PROFILE)
1166
1167CXXFLAGS=`echo "${CXXFLAGS}" | sed "s/\-O.//g" `
1168CFLAGS=`echo "${CFLAGS}" | sed "s/\-O.//g" `
8248314d 1169if test "$wxUSE_OPTIMISE" = 0 ; then
bcf1fa6b
RR
1170 OPTIMISE=
1171else
1172 if test "$GCC" = yes ; then
1173 OPTIMISE="-O2"
1174 case "${canonical}" in
1175 i586-*-*|i686-*-* )
1176 OPTIMISE="${OPTIMISE} "
1177 ;;
1178 esac
1179 else
1180 OPTIMISE="-O"
1181 fi
1182fi
1183AC_SUBST(OPTIMISE)
1184
1185APPLE_IEEE=NONE
8248314d 1186if test "$wxUSE_APPLE_IEEE" = 1 ; then
bcf1fa6b 1187 APPLE_IEEE="APPLE_IEEE"
8248314d 1188 AC_DEFINE_UNQUOTED(wxUSE_APPLE_IEEE,$wxUSE_APPLE_IEEE)
bcf1fa6b
RR
1189fi
1190
8248314d
VZ
1191wxUSE_IOSTREAMH=$DEFAULT_wxUSE_IOSTREAMH
1192AC_DEFINE_UNQUOTED(wxUSE_IOSTREAMH,$wxUSE_IOSTREAMH)
bcf1fa6b
RR
1193
1194dnl ----------------------------------------------------------------
1195dnl Register library options for makefiles and setup.h
1196dnl ----------------------------------------------------------------
1197
8248314d
VZ
1198if test "$wxUSE_ZLIB" = 1 ; then
1199 AC_DEFINE_UNQUOTED(wxUSE_ZLIB,$wxUSE_ZLIB)
bcf1fa6b
RR
1200fi
1201
8248314d
VZ
1202if test "$wxUSE_LIBPNG" = 1 ; then
1203 AC_DEFINE_UNQUOTED(wxUSE_LIBPNG,$wxUSE_LIBPNG)
bcf1fa6b
RR
1204fi
1205
84b46c35 1206IODBC_C_SRC=""
8248314d
VZ
1207if test "$wxUSE_ODBC" = 1 ; then
1208 AC_DEFINE_UNQUOTED(wxUSE_ODBC,$wxUSE_ODBC)
84b46c35 1209 IODBC_C_SRC="\$(IODBC_C_SRC)"
bcf1fa6b 1210fi
84b46c35 1211AC_SUBST(IODBC_C_SRC)
bcf1fa6b
RR
1212
1213dnl ----------------------------------------------------------------
1214dnl Register GUI-control options for makefiles and setup.h
1215dnl ----------------------------------------------------------------
1216
8248314d
VZ
1217if test "$wxUSE_GAUGE" = 1 ; then
1218 AC_DEFINE_UNQUOTED(wxUSE_GAUGE,$wxUSE_GAUGE)
bcf1fa6b
RR
1219fi
1220
8248314d
VZ
1221if test "$wxUSE_COMBOBOX" = 1 ; then
1222 AC_DEFINE_UNQUOTED(wxUSE_COMBOBOX,$wxUSE_COMBOBOX)
a60c99e6
RR
1223fi
1224
8248314d
VZ
1225if test "$wxUSE_SCROLLBAR" = 1 ; then
1226 AC_DEFINE_UNQUOTED(wxUSE_SCROLLBAR,$wxUSE_SCROLLBAR)
bcf1fa6b
RR
1227fi
1228
8248314d
VZ
1229if test "$wxUSE_LISTCTRL" = 1 ; then
1230 AC_DEFINE_UNQUOTED(wxUSE_LISTCTRL,$wxUSE_LISTCTRL)
bcf1fa6b
RR
1231fi
1232
8248314d
VZ
1233if test "$wxUSE_TREECTRL" = 1 ; then
1234 AC_DEFINE_UNQUOTED(wxUSE_TREECTRL,$wxUSE_TREECTRL)
bcf1fa6b
RR
1235fi
1236
8248314d
VZ
1237if test "$wxUSE_GRID" = 1 ; then
1238 AC_DEFINE_UNQUOTED(wxUSE_GRID,$wxUSE_GRID)
bcf1fa6b
RR
1239fi
1240
8248314d
VZ
1241if test "$wxUSE_TAB_DIALOG" = 1 ; then
1242 AC_DEFINE_UNQUOTED(wxUSE_TAB_DIALOG,$wxUSE_TAB_DIALOG)
bcf1fa6b
RR
1243fi
1244
8248314d
VZ
1245if test "$wxUSE_NOTEBOOK" = 1 ; then
1246 AC_DEFINE_UNQUOTED(wxUSE_NOTEBOOK,$wxUSE_NOTEBOOK)
bcf1fa6b
RR
1247fi
1248
1249dnl ----------------------------------------------------------------
1250dnl Register non-GUI class options for makefiles and setup.h
1251dnl ----------------------------------------------------------------
1252
8248314d
VZ
1253if test "$wxUSE_CONFIG" = 1 ; then
1254 AC_DEFINE_UNQUOTED(wxUSE_CONFIG,$wxUSE_CONFIG)
bcf1fa6b
RR
1255fi
1256
8248314d
VZ
1257if test "$wxUSE_TIMEDATE" = 1 ; then
1258 AC_DEFINE_UNQUOTED(wxUSE_TIMEDATE,$wxUSE_TIMEDATE)
bcf1fa6b
RR
1259fi
1260
8248314d
VZ
1261if test "$wxUSE_FRACTION" = 1 ; then
1262 AC_DEFINE_UNQUOTED(wxUSE_FRACTION,$wxUSE_FRACTION)
bcf1fa6b
RR
1263fi
1264
8248314d
VZ
1265if test "$wxUSE_LOG" = 1 ; then
1266 AC_DEFINE_UNQUOTED(wxUSE_LOG,$wxUSE_LOG)
bcf1fa6b
RR
1267fi
1268
8248314d
VZ
1269if test "$wxUSE_INTL" = 1 ; then
1270 AC_DEFINE_UNQUOTED(wxUSE_INTL,$wxUSE_INTL)
bcf1fa6b
RR
1271fi
1272
8248314d
VZ
1273if test "$wxUSE_STREAMS" = 1 ; then
1274 AC_DEFINE_UNQUOTED(wxUSE_STREAMS,$wxUSE_STREAMS)
bcf1fa6b
RR
1275fi
1276
8248314d
VZ
1277if test "$wxUSE_SERIAL" = 1 ; then
1278 AC_DEFINE_UNQUOTED(wxUSE_SERIAL,$wxUSE_SERIAL)
bcf1fa6b
RR
1279fi
1280
8248314d
VZ
1281if test "$wxUSE_FILE" = 1 ; then
1282 AC_DEFINE_UNQUOTED(wxUSE_FILE,$wxUSE_FILE)
bcf1fa6b
RR
1283fi
1284
8248314d
VZ
1285if test "$wxUSE_TEXTFILE" = 1 ; then
1286 AC_DEFINE_UNQUOTED(wxUSE_TEXTFILE,$wxUSE_TEXTFILE)
bcf1fa6b
RR
1287fi
1288
1289dnl ----------------------------------------------------------------
1290dnl Register Prolog and Resources options for makefiles and setup.h
1291dnl ----------------------------------------------------------------
1292
8248314d
VZ
1293if test "$wxUSE_RPC" = 1 ; then
1294 AC_DEFINE_UNQUOTED(wxUSE_RPC,$wxUSE_RPC)
bcf1fa6b
RR
1295fi
1296
8248314d
VZ
1297if test "$wxUSE_WX_RESOURCES" = 1 ; then
1298 AC_DEFINE_UNQUOTED(wxUSE_WX_RESOURCES,$wxUSE_WX_RESOURCES)
bcf1fa6b
RR
1299fi
1300
8248314d
VZ
1301if test "$wxUSE_PROLOGIO" = 1 ; then
1302 AC_DEFINE_UNQUOTED(wxUSE_PROLOGIO)
bcf1fa6b
RR
1303fi
1304
1305dnl ----------------------------------------------------------------
1306dnl Register PostScript options for makefiles and setup.h
1307dnl ----------------------------------------------------------------
1308
8248314d
VZ
1309if test "$wxUSE_POSTSCRIPT" = 1 ; then
1310 AC_DEFINE_UNQUOTED(wxUSE_POSTSCRIPT)
bcf1fa6b
RR
1311fi
1312
8248314d 1313AC_DEFINE_UNQUOTED(wxUSE_AFM_FOR_POSTSCRIPT,$wxUSE_AFM_FOR_POSTSCRIPT)
bcf1fa6b
RR
1314
1315AC_DEFINE_UNQUOTED(WX_NORMALIZED_PS_FONTS,$WX_NORMALIZED_PS_FONTS)
1316
1317dnl ----------------------------------------------------------------
1318dnl Register architecture options for makefiles and setup.h
1319dnl ----------------------------------------------------------------
1320
8248314d
VZ
1321if test "$wxUSE_MDI_ARCHITECTURE" = 1 ; then
1322 AC_DEFINE_UNQUOTED(wxUSE_MDI_ARCHITECTURE,$wxUSE_MDI_ARCHITECTURE)
bcf1fa6b
RR
1323fi
1324
8248314d
VZ
1325if test "$wxUSE_DOC_VIEW_ARCHITECTURE" = 1 ; then
1326 AC_DEFINE_UNQUOTED(wxUSE_DOC_VIEW_ARCHITECTURE,$wxUSE_DOC_VIEW_ARCHITECTURE)
bcf1fa6b
RR
1327fi
1328
8248314d
VZ
1329if test "$wxUSE_PRINTING_ARCHITECTURE" = 1 ; then
1330 AC_DEFINE_UNQUOTED(wxUSE_PRINTING_ARCHITECTURE,$wxUSE_PRINTING_ARCHITECTURE)
bcf1fa6b
RR
1331fi
1332
fb4e5803
VZ
1333dnl ----------------------------------------------------------------
1334dnl Register wxString options for makefiles and setup.h
1335dnl ----------------------------------------------------------------
1336
1337if test "$wxUSE_UNICODE" = 1 ; then
1338 AC_DEFINE_UNQUOTED(wxUSE_UNICODE)
1339fi
1340
1341if test "$wxUSE_WCSRTOMBS" = 1 ; then
1342 AC_DEFINE_UNQUOTED(wxUSE_WCSRTOMBS)
1343fi
1344
bcf1fa6b
RR
1345dnl ----------------------------------------------------------------
1346dnl Register misc options for makefiles and setup.h
1347dnl ----------------------------------------------------------------
1348
8248314d
VZ
1349if test "$wxUSE_IPC" = 1 ; then
1350 AC_DEFINE_UNQUOTED(wxUSE_IPC)
bcf1fa6b
RR
1351fi
1352
8248314d
VZ
1353if test "$wxUSE_RESOURCES" = 1 ; then
1354 AC_DEFINE_UNQUOTED(wxUSE_RESOURCES,$wxUSE_RESOURCES)
bcf1fa6b
RR
1355fi
1356
8248314d
VZ
1357if test "$wxUSE_CLIPBOARD" = 1 ; then
1358 AC_DEFINE_UNQUOTED(wxUSE_CLIPBOARD,$wxUSE_CLIPBOARD)
bcf1fa6b
RR
1359fi
1360
8248314d
VZ
1361if test "$wxUSE_DND" = 1 ; then
1362 AC_DEFINE_UNQUOTED(wxUSE_DND,$wxUSE_DND)
bcf1fa6b
RR
1363fi
1364
8248314d
VZ
1365if test "$wxUSE_CONSTRAINTS" = 1 ; then
1366 AC_DEFINE_UNQUOTED(wxUSE_CONSTRAINTS,$wxUSE_CONSTRAINTS)
bcf1fa6b
RR
1367fi
1368
1369dnl ----------------------------------------------------------------
1370dnl No effect
1371dnl ----------------------------------------------------------------
1372
1373METAFILE=NONE
8248314d 1374if test "$wxUSE_METAFILE" = 1 ; then
bcf1fa6b 1375 METAFILE="METAFILE"
8248314d 1376 AC_DEFINE_UNQUOTED(wxUSE_METAFILE,$wxUSE_METAFILE)
bcf1fa6b
RR
1377fi
1378AC_SUBST(METAFILE)
1379
1380HELP=NONE
8248314d 1381if test "$wxUSE_HELP" = 1 ; then
bcf1fa6b 1382 HELP="HELP"
8248314d 1383 AC_DEFINE_UNQUOTED(wxUSE_HELP,$wxUSE_HELP)
bcf1fa6b
RR
1384fi
1385AC_SUBST(HELP)
1386
1387WXGRAPH=NONE
8248314d 1388if test "$wxUSE_WXGRAPH" = 1 ; then
bcf1fa6b 1389 WXGRAPH="WXGRAPH"
8248314d 1390 AC_DEFINE_UNQUOTED(wxUSE_WXGRAPH,$wxUSE_WXGRAPH)
bcf1fa6b
RR
1391fi
1392AC_SUBST(WXGRAPH)
1393
1394WXTREE=NONE
8248314d 1395if test "$wxUSE_WXTREE" = 1 ; then
bcf1fa6b 1396 WXTREE="WXTREE"
8248314d 1397 AC_DEFINE_UNQUOTED(wxUSE_WXTREE,$wxUSE_WXTREE)
bcf1fa6b
RR
1398fi
1399AC_SUBST(WXTREE)
1400
1401GLCANVAS=NONE
8248314d 1402if test "$wxUSE_OPENGL" = 1 ; then
bcf1fa6b
RR
1403 GLCANVAS="GLCANVAS"
1404fi
1405
1406dnl ----------------------------------------------------------------
1407dnl select dynamic loader (used by iODBC to load drivers)
1408dnl ----------------------------------------------------------------
1409
cb17fe41 1410AC_CHECK_LIB(dl,main,[DL_LIBRARY=-ldl],[DL_LIBRARY=])
bcf1fa6b
RR
1411AC_SUBST(DL_LIBRARY)
1412
1413dnl ----------------------------------------------------------------
1414dnl thread support
1415dnl ----------------------------------------------------------------
1416
d18ed59a 1417wxUSE_THREADS=1
bcf1fa6b 1418THREADS_LINK=""
cb43b372
RR
1419UNIX_THREAD="gtk/threadno.cpp"
1420
1421AC_OVERRIDES(threads,threads,
1422**--without-threads Force disabling threads,
d18ed59a 1423wxUSE_THREADS)
bcf1fa6b 1424
d18ed59a 1425if test "$wxUSE_THREADS" = "1"; then
bcf1fa6b 1426
926c550d
GL
1427 case "$os" in
1428 solaris*)
bcf1fa6b 1429
926c550d
GL
1430 AC_CHECK_LIB(thread, thr_create, [
1431 UNIX_THREAD="gtk/threadsol.cpp"
1432 THREADS_LINK="-lthread"
1433 ])
1434 ;;
1435
1436 *)
1437
1438 UNIX_THREAD="gtk/threadno.cpp"
1439
1440 dnl For glibc 2 users who have the old libc 5 too
bcf1fa6b 1441
926c550d
GL
1442 AC_CHECK_LIB(pthread-0.7, pthread_create, [
1443 UNIX_THREAD="gtk/threadpsx.cpp"
1444 THREADS_LINK="-lpthread-0.7"
1445 ],[
1446 AC_CHECK_HEADER(sys/prctl.h, [
1447 UNIX_THREAD="gtk/threadsgi.cpp"
1448 ])
1449
1450 dnl pthread_create is always available in pthread but it seems not to be
1451 dnl the case for pthread_setcanceltype.
bcf1fa6b 1452
926c550d 1453 AC_CHECK_LIB(pthread, pthread_setcanceltype, [
bcf1fa6b
RR
1454 UNIX_THREAD="gtk/threadpsx.cpp"
1455 THREADS_LINK="-lpthread"
926c550d
GL
1456 ])
1457 ])
f3855ef0
RR
1458
1459 dnl -lposix4 seems to be required on Solaris
926c550d
GL
1460
1461 AC_CHECK_LIB(posix4, printf, [
1462 THREADS_LINK="$THREADS_LINK -lposix4"
1463 ]);;
1464
1465 esac
bcf1fa6b
RR
1466fi
1467
d18ed59a
RR
1468if test "$wxUSE_MOTIF" = "1"; then
1469 UNIX_THREAD="motif/thread.cpp"
1470fi
1471
bcf1fa6b 1472if test -z "$UNIX_THREAD"; then
d18ed59a 1473 wxUSE_THREADS=0
bcf1fa6b
RR
1474fi
1475
1476AC_SUBST(UNIX_THREAD)
1477AC_SUBST(THREADS_LINK)
d18ed59a 1478AC_DEFINE(wxUSE_THREADS)
bcf1fa6b
RR
1479
1480dnl defines UNIX_THREAD it contains the source file to use for threads. (GL)
1481dnl defines THREADS_LINK it contains the thread library to link with. (GL)
d18ed59a 1482dnl defines wxUSE_THREADS if thread support is activated. (GL)
bcf1fa6b
RR
1483
1484dnl ----------------------------------------------------------------
1485dnl search for opengl
1486dnl ----------------------------------------------------------------
1487
1488OPENGL_INCLUDE=
1489OPENGL_LIBRARY=
1490OPENGL_LINK=
1491
8248314d 1492if test "$wxUSE_OPENGL" = 1; then
bcf1fa6b
RR
1493 dnl checking OPENGL includes
1494 AC_MSG_CHECKING(for OpenGL includes)
1495 AC_PATH_FIND_INCLUDES($SEARCH_INCLUDE,GL/gl.h)
1496 if test "$ac_find_includes" != "" ; then
1497 OPENGL_INCLUDE="-I$ac_find_includes"
1498 AC_MSG_RESULT(found $ac_find_includes)
1499 dnl checking OPENGL libraries
1500 AC_MSG_CHECKING(for OpenGL library)
1501 AC_PATH_FIND_LIBRARIES($SEARCH_LIB,GL)
1502 if test "$ac_find_libraries" != "" ; then
1503 AC_INCLUDE_PATH_EXIST($ac_find_includes,$CHECK_INCLUDE)
1504 AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
1505 CHECK_LINK="$CHECK_INCLUDE $ac_path_to_link"
1506 CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include"
1507 OPENGL_LIBRARY="$ac_path_to_link"
1508 OPENGL_INCLUDE="$ac_path_to_include"
1509 OPENGL_LINK="-lGL"
1510 AC_MSG_RESULT(found OpenGL at $ac_find_libraries)
1511 else
1512 AC_PATH_FIND_LIBRARIES($SEARCH_LIB,MesaGL)
1513 if test "$ac_find_libraries" != "" ; then
1514 AC_INCLUDE_PATH_EXIST($ac_find_includes,$CHECK_INCLUDE)
1515 AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
1516 CHECK_LINK="$CHECK_INCLUDE $ac_path_to_link"
1517 CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include"
1518 OPENGL_LIBRARY="$ac_path_to_link"
1519 OPENGL_INCLUDE="$ac_path_to_include"
1520 OPENGL_LINK="-lMesaGL"
1521 AC_MSG_RESULT(found MESA at $ac_find_libraries)
1522 else
1523 AC_MSG_ERROR(no)
1524 fi
1525 fi
1526 else
1527 AC_MSG_ERROR(no)
1528 fi
1529fi
1530
1531dnl ----------------------------------------------------------------
1532dnl left-over
1533dnl ----------------------------------------------------------------
1534
8248314d
VZ
1535wxUSE_GLX=$wxUSE_OPENGL
1536if test "$wxUSE_OPENGL" != 1; then
bcf1fa6b
RR
1537 OPENGL_LIBRARIES=
1538 OPENGL_INCLUDE=
1539 OPENGL_LINK=
1540 GLCANVAS=NONE
1541fi
1542
8248314d 1543AC_DEFINE_UNQUOTED(wxUSE_GLX,$wxUSE_GLX)
bcf1fa6b
RR
1544AC_SUBST(OPENGL_INCLUDE)
1545AC_SUBST(OPENGL_LIBRARY)
1546AC_SUBST(OPENGL_LINK)
1547AC_SUBST(GLCANVAS)
1548
1549dnl ------------------------------------------------------------------------
1550dnl compiler options for shared libs
1551dnl ------------------------------------------------------------------------
1552
1553PICFLAGS=
1554CREATE_SHARED=
1555case "${canonical}" in
1556
1557 *-hp-hpux* )
7cacdad3 1558 if test "$GCC" != "yes" ; then
bcf1fa6b
RR
1559 CXXFLAGS="${CXXFLAGS} +a1 -z -Aa -D_HPUX_SOURCE"
1560 CFLAGS="${CFLAGS} -z -D_HPUX_SOURCE"
1561 PICFLAGS="+z"
1562 else
1563 PICFLAGS="-fPIC"
1564 fi
1565 LDFLAGS="-Wl,+s"
1566 CREATE_SHARED=sharedHpux
1567 ;;
1568
1569 *-*-linux* )
1570 PICFLAGS=-fPIC
1571 CREATE_SHARED=sharedLinux
1572 ;;
1573
1574 *-*-irix5* | *-*-irix6* )
1575 # PICFLAGS can remain empty, as pic is the default
1576 LDFLAGS="-Wl,+s"
1577 CREATE_SHARED=sharedIrix
1578 AC_DEFINE(SVR4)
1579 ;;
1580
1581 *-*-solaris2* )
7cacdad3 1582 if test "$GCC" != "yes" ; then
bcf1fa6b
RR
1583 PICFLAGS="-KPIC"
1584 else
1585 PICFLAGS="-fPIC"
1586 fi
1587 CREATE_SHARED=sharedSolaris2
1588 AC_DEFINE(SVR4)
1589 ;;
1590
1591 *-*-sunos4* )
7cacdad3 1592 if test "$GCC" != "yes" ; then
bcf1fa6b
RR
1593 PICFLAGS="-PIC"
1594 else
1595 PICFLAGS="-fPIC"
1596 fi
1597 LDFLAGS="-Wl,+s"
1598 CREATE_SHARED=sharedSunos4
1599 AC_DEFINE(BSD)
1600 ;;
1601
1602 *-*-freebsd* | *-*-netbsd*)
1603 PICFLAGS=-fPIC
1604 CREATE_SHARED=sharedBsd
1605 AC_DEFINE(BSD)
1606 ;;
1607
1608 *-*-osf* )
1609 PICFLAGS="-fPIC"
1610 CREATE_SHARED=sharedOSF
1611 ;;
1612
1613 *-*-dgux5* )
7cacdad3 1614 if test "$GCC" != "yes" ; then
bcf1fa6b
RR
1615 PICFLAGS="-K PIC"
1616 else
1617 PICFLAGS="-fPIC"
1618 fi
1619 CREATE_SHARED=sharedDgux
1620 AC_DEFINE(SVR4)
1621 ;;
1622
1623 *-*-sysv5* )
7cacdad3 1624 if test "$GCC" != "yes" ; then
bcf1fa6b
RR
1625 PICFLAGS="-K PIC"
1626 else
1627 PICFLAGS="-fPIC"
1628 fi
1629 CREATE_SHARED=sharedSysV
1630 AC_DEFINE(SVR4)
1631 ;;
1632
1633 *-*-aix* )
7cacdad3 1634 if test "$GCC" != "yes" ; then
bcf1fa6b
RR
1635 PICFLAGS="-bM\:SRE"
1636 else
1637 PICFLAGS="-fPIC"
1638 fi
1639 CREATE_SHARED=sharedAIX
1640 AC_DEFINE(SYSV)
1641 ;;
1642
1643 *)
1644 CREATE_SHARED=
1645 PICFLAGS=
1646esac
1647
1648if test "x$GCC" = xyes; then
1649 CFLAGS="${CFLAGS} -Wall"
1650fi
1651
1652if test "x$GXX" = xyes; then
f6c6dd8c
RR
1653 if test "$wxUSE_MOTIF" = 1; then
1654 CXXFLAGS="${CXXFLAGS} -Wall -Wno-unused"
1655 else
1656 CXXFLAGS="${CXXFLAGS} -Wall"
1657 fi
bcf1fa6b
RR
1658fi
1659
8248314d 1660if test "$wxUSE_SHARED" != 1; then
bcf1fa6b
RR
1661 CREATE_SHARED=
1662 PICFLAGS=
1663fi
1664
1665AC_SUBST(OS)
1666AC_SUBST(PICFLAGS)
1667AC_SUBST(CREATE_SHARED)
1668
1669dnl ------------------------------------------------------------------------
1670dnl finish and clean-up
1671dnl ------------------------------------------------------------------------
1672
1673dnl add OS to list of configured
1674echo $OS >> system.list
1675
c98f0421 1676AC_CONFIG_HEADER(./include/wx/gtk/setup.h:./setup/setup.hin)
f3cb6592 1677AC_OUTPUT(./setup/substit ./wx-config:./wx-config.in,./setup/general/createall)
bcf1fa6b
RR
1678
1679AC_OVERRIDES_DONE