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