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