1 dnl ////////////////////////////////////////////////////////////////////////
3 dnl Top-level configure.in for wxWindows by Robert Roebling, Wolfram Gloger
6 dnl This script is under the wxWindows licence.
8 dnl ////////////////////////////////////////////////////////////////////////
10 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
11 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
15 dnl Get the cflags and libraries from the gtk-config script
17 AC_ARG_WITH(gtk-prefix,[**--with-gtk-prefix=PFX Prefix where GTK is installed],
18 gtk_config_prefix="$withval", gtk_config_prefix="")
19 AC_ARG_WITH(gtk-exec-prefix,[**--with-gtk-exec-prefix=PFX Exec prefix where GTK is installed],
20 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
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
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
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)
39 if test "$GTK_CONFIG" != "no" ; then
40 GTK_CFLAGS=`$GTK_CONFIG --cflags`
41 GTK_LIBS=`$GTK_CONFIG --libs`
42 ac_save_CFLAGS="$CFLAGS"
44 CFLAGS="$CFLAGS $GTK_CFLAGS"
45 LIBS="$LIBS $GTK_LIBS"
47 dnl Now check if the installed GTK is sufficiently new. (Also sanity
48 dnl checks the results of gtk-config to some extent
57 int major, minor, micro;
59 if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
60 printf("%s, bad version string\n", "$min_gtk_version");
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)));
68 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
69 CFLAGS="$ac_save_CFLAGS"
74 if test "x$no_gtk" = x ; then
76 ifelse([$2], , :, [$2])
81 ifelse([$3], , :, [$3])
87 dnl ------------------------------------------------------------------------
89 dnl ------------------------------------------------------------------------
91 AC_DEFUN(AC_OVERRIDES_PREPARE,
93 rm -f ${OSTYPE}.system.cache.tmp
94 touch ${OSTYPE}.system.cache.tmp
95 touch ${OSTYPE}.system.cache
98 AC_DEFUN(AC_OVERRIDES_DONE,
100 mv ${OSTYPE}.system.cache.tmp ${OSTYPE}.system.cache
103 dnl package,message,helpmessage,variable
104 AC_DEFUN(AC_OVERRIDES,
106 AC_MSG_CHECKING("for $2")
108 [if test "x$with_$1" = xyes; then
109 ac_cv_use_$1='$4="1"'
111 ac_cv_use_$1='$4="0"'
114 LINE=`grep "$4" ${OSTYPE}.system.cache`
115 if test "x$LINE" != x ; then
118 ac_cv_use_$1='$4='$DEFAULT_$4
121 echo $ac_cv_use_$1 >> ${OSTYPE}.system.cache.tmp
122 if test "$$4" = 1; then
129 dnl package,message,helpmessage,variable
130 AC_DEFUN(AC_OVERRIDES_OLD,
132 AC_MSG_CHECKING("for $2")
133 AC_CACHE_VAL(ac_cv_use_$1,
136 [if test "x$with_$1" = xyes; then
137 ac_cv_use_$1='$4="1"'
139 ac_cv_use_$1='$4="0"'
140 fi],[ac_cv_use_$1='$4=$DEFAULT_$4'])
144 if test "$$4" = 1; then
151 AC_DEFUN(AC_PATH_FIND_INCLUDES,
156 if test -f "$ac_dir/$2"; then
157 ac_find_includes=$ac_dir
163 AC_DEFUN(AC_PATH_FIND_LIBRARIES,
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
177 dnl Path to include, allready defined
178 AC_DEFUN(AC_INCLUDE_PATH_EXIST,
180 ac_path_to_include=$1
181 echo "$2" | grep "\-I$1" > /dev/null
183 if test $result = 0; then
184 ac_path_to_include=""
186 ac_path_to_include="-I$1"
190 dnl Path to link, allready defined
191 AC_DEFUN(AC_LINK_PATH_EXIST,
193 echo "$2" | grep "\-L$1" > /dev/null
195 if test $result = 0; then
198 ac_path_to_link="-L$1"
202 dnl ------------------------------------------------------------------------
203 dnl Process this file with autoconf to produce a configure script.
204 dnl ------------------------------------------------------------------------
206 AC_INIT(configure.in)
208 dnl ------------------------------------------------------------------------
210 dnl ------------------------------------------------------------------------
214 if test "x$OS" = "x"; then
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."
225 dnl ------------------------------------------------------------------------
226 dnl Set base directory
227 dnl ------------------------------------------------------------------------
232 dnl ------------------------------------------------------------------------
233 dnl search path for includes and libraries
234 dnl ------------------------------------------------------------------------
237 /usr/Motif1.2/include \
247 /usr/local/X11R6/include \
248 /usr/local/X11R5/include \
249 /usr/local/X11R4/include \
251 /usr/local/include/X11R6 \
252 /usr/local/include/X11R5 \
253 /usr/local/include/X11R4 \
257 /usr/local/X11/include \
258 /usr/local/include/X11 \
262 /usr/XFree86/include/X11 \
266 /usr/unsupported/include \
267 /usr/athena/include \
268 /usr/local/x11r5/include \
269 /usr/lpp/Xamples/include \
271 /usr/local/include/gtk \
272 /usr/X11R6/include/Xm \
273 /usr/X11/include/Xm \
276 /usr/openwin/include \
277 /usr/openwin/share/include \
280 SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s/include/lib/g` \
283 dnl ------------------------------------------------------------------------
285 dnl ------------------------------------------------------------------------
287 dnl ###################
288 dnl # checks programs #
289 dnl ###################
291 dnl C-compiler checks
292 dnl =================
293 dnl use what compiler
295 dnl defines CC with the compiler to use
296 dnl defines GCC with yes if using gcc
297 dnl defines GCC empty if not using gcc
300 CFLAGS=`echo "$CFLAGS" | sed 's/-g//g'`
302 dnl does compiler support -c and -o simultaniously
304 dnl defines NO_MINUS_C_MINUS_O if compiler does not accept
305 dnl both switches simultaniously
306 dnl what is the c-preprocessor
308 dnl defines CPP with the c-preprocessor
309 dnl is -traditional needed for correct compilations
310 AC_PROG_GCC_TRADITIONAL
311 dnl adds -traditional for gcc if needed
315 dnl C++-compiler checks
316 dnl ===================
317 dnl use what compiler
319 dnl defines CXX with the compiler to use
320 dnl defines GXX with yes if using gxx
321 dnl defines GXX empty if not using gxx
323 dnl what is the C++-preprocessor
325 dnl defines CXXCPP with the C++-preprocessor
327 CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-g//g'`
334 dnl defines RANLIB with the appropriate command
338 AC_CHECK_PROG(AR, ar, ar, ar)
339 dnl defines AR with the appropriate command
344 dnl defines INSTALL with the appropriate command
349 dnl defines LN_S with the appropriate command
354 dnl defines AWK with the appropriate command
359 dnl check if VPATH works
360 AC_MSG_CHECKING("make for VPATH support")
362 cat - << EOF > confMake
368 if test ! -d sub ; then
371 echo dummy > sub/file
372 ${MAKE-make} -f confMake VPATH=sub 2> config.log > /dev/null
374 rm -f sub/file check final_file confMake
376 if test "$RESULT" = 0; then
381 You need a make-utility that is able to use the variable
383 If your version of make does not support VPATH correctly,
384 please install GNU-make (possibly as gmake), and start
385 configure with the following command:
386 export MAKE=gmake; ./configure for sh-type shells
387 setenv MAKE gmake; ./configure for csh-type shells
388 Also please do remember to use gmake in this case every time
389 you are trying to compile.
393 dnl ####################
394 dnl # checks libraries #
395 dnl ####################
397 dnl find the X11 include and library files
399 dnl defines x_includes and x_libraries
401 dnl #######################
402 dnl # checks header files #
403 dnl #######################
406 dnl defines MACRO HAVE_DIRENT_H if dirent.h exists
407 dnl defines MACRO HAVE_SYS_NDIR_H if sys/ndir.h exists
408 dnl defines MACRO HAVE_SYS_DIR_H if sys/dir.h exists
409 dnl defines MACRO HAVE_NDIR_H if ndir.h exists
411 dnl defines STDC_HEADERS if ANSI-C header
413 dnl defines HAVE_SYS_WAIT_H if sys/wait.h exist and is POSIX.1
414 AC_CHECK_HEADERS(fcntl.h)
415 dnl defines HAVE_FCNTL_H
416 AC_CHECK_HEADERS(limits.h)
417 dnl defines HAVE_LIMITS_h
418 AC_CHECK_HEADERS(sys/file.h)
419 dnl defines HAVE_SYS_FILE_H
420 AC_CHECK_HEADERS(sys/time.h)
421 dnl defines HAVE_SYS_TIME_H
422 AC_CHECK_HEADERS(unistd.h)
423 dnl defines HAVE_UNISTD_H
424 AC_CHECK_HEADERS(fnmatch.h)
425 dnl defines HAVE_FNMATCH_H
426 dnl As it needs Linux 2.1.x for the moment: check whether the file exists (GL).
427 AC_CHECK_HEADERS(linux/joystick.h)
429 if test "$ac_cv_header_linux_joystick_h" = "yes"; then
430 GTK_JOYSTICK="gtk/joystick.cpp"
432 AC_SUBST(GTK_JOYSTICK)
434 dnl ###################
435 dnl # checks typedefs #
436 dnl ###################
438 dnl defines GETGROUPS_T
440 dnl defines mode_t if not already defined
442 dnl defines off_t if not already defined
444 dnl defines pid_t if not already defined
446 dnl defines RETSIGTYPE for the correct return type of signal
448 dnl defines size_t if not already defined
450 dnl defines uid_t and gid_t if not already defined
452 dnl #####################
453 dnl # checks structures #
454 dnl #####################
457 dnl defines STAT_MACROS_BROKEN if S_ISDIR and S_ISREG
458 dnl do not work properly
460 dnl defines TIME_WITH_SYS_TIME if time.h and sys/time.h can
463 dnl defines HAVE_ST_BLKSIZE if struct stat contains st_blksize
465 dnl defines HAVE_ST_BLOCKS if struct stat contains st_blocks
467 dnl defines HAVE_ST_RDEV if struct stat contains st_rdev
469 dnl defines TM_IN_SYS_TIME if struct tm is not in time.h
471 dnl defines HAVE_ST_BLKSIZE if struct tm contains tm_zone
473 dnl defines HAVE_TZNAME if external array tzname is found
475 dnl ###################################
476 dnl # checks compiler characteristics #
477 dnl ###################################
481 dnl defines const to be empty if c-compiler does not support const fully
483 dnl defines inline to a sensible value for the c-compiler
485 dnl defines __CHAR_UNSIGNED__ if char is unsigned
487 dnl defines HAVE_LONGDOUBLE if compiler supports long double
490 dnl defines WORDS_BIGENDIAN if system is big endian
492 AC_CHECK_SIZEOF(int *)
494 AC_CHECK_SIZEOF(long)
495 dnl defines the size of certain types of variables in SIZEOF_???
497 dnl ############################
498 dnl # checks library functions #
499 dnl ############################
501 dnl ##########################
502 dnl # checks system services #
503 dnl ##########################
506 AC_SYS_LONG_FILE_NAMES
507 dnl defines HAVE_LONG_FILENAMES if filenames longer then
508 dnl 14 chars are supported
510 dnl AC_SYS_RESTARTABLE_SYSCALLS
511 dnl defines HAVE_RESTARTABLE_SYSCALLS if the system restarts a
512 dnl system call that is interrupted
515 dnl #################
516 dnl # checks PARSER #
517 dnl #################
522 dnl defines YACC with the appropriate command
527 dnl defines LEX with the appropriate command
528 dnl defines LEXLIB with the appropriate library
529 dnl what type is yytext
531 dnl defines YYTEXT_POINTER if yytext is char*
532 dnl defines LEX_OUTPUT_ROOT as to the base of the
533 dnl filename output by the lexer
535 dnl ------------------------------------------------------------------------
537 dnl ------------------------------------------------------------------------
539 CHECK_INCLUDE="-I/usr/include $X_CFLAGS"
540 CHECK_LIB="-L/lib -L/usr/lib $X_LIBS"
542 dnl ------------------------------------------------------------------------
544 dnl ------------------------------------------------------------------------
548 configuration=$host_alias
550 dnl ------------------------------------------------------------------------
552 dnl ------------------------------------------------------------------------
574 case "${canonical}" in
583 *-*-irix5* | *-*-irix6* )
594 AC_DEFINE(__SOLARIS__)
605 *-*-freebsd* | *-*-netbsd*)
608 AC_DEFINE(__FREEBSD__)
638 AC_MSG_ERROR(I don't know your system type.)
641 dnl ------------------------------------------------------------------------
642 dnl defaults for command options
643 dnl ------------------------------------------------------------------------
649 DEFAULT_wxUSE_MOTIF=0
651 DEFAULT_wxUSE_THREADS=1
653 DEFAULT_wxUSE_SHARED=1
654 DEFAULT_wxUSE_OPTIMISE=1
655 DEFAULT_wxUSE_PROFILE=0
656 DEFAULT_wxUSE_DEBUG_FLAG=0
657 DEFAULT_wxUSE_DEBUG_INFO=0
658 DEFAULT_wxUSE_MEM_TRACING=0
659 DEFAULT_wxUSE_DMALLOC=0
660 DEFAULT_wxUSE_APPLE_IEEE=1
661 DEFAULT_wxUSE_IOSTREAMH=1
664 DEFAULT_wxUSE_GDK_IMLIB=1
665 DEFAULT_wxUSE_LIBPNG=1
668 DEFAULT_wxUSE_COMBOBOX=1
669 DEFAULT_wxUSE_GAUGE=1
670 DEFAULT_wxUSE_SCROLLBAR=1
671 DEFAULT_wxUSE_LISTCTRL=1
672 DEFAULT_wxUSE_TREECTRL=1
674 DEFAULT_wxUSE_TAB_DIALOG=1
675 DEFAULT_wxUSE_NOTEBOOK=1
677 DEFAULT_wxUSE_TIMEDATE=1
678 DEFAULT_wxUSE_FRACTION=1
681 DEFAULT_wxUSE_CONFIG=1
682 DEFAULT_wxUSE_STREAMS=1
683 DEFAULT_wxUSE_SERIAL=1
685 DEFAULT_wxUSE_TEXTFILE=1
687 DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=1
688 DEFAULT_WX_NORMALIZED_PS_FONTS=1
689 DEFAULT_wxUSE_POSTSCRIPT=1
692 DEFAULT_wxUSE_RESOURCES=1
693 DEFAULT_wxUSE_CONSTRAINTS=1
694 DEFAULT_wxUSE_CLIPBOARD=0
697 DEFAULT_wxUSE_MDI_ARCHITECTURE=1
698 DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=1
699 DEFAULT_wxUSE_PRINTING_ARCHITECTURE=1
701 DEFAULT_wxUSE_PROLOGIO=1
702 DEFAULT_wxUSE_WX_RESOURCES=1
705 DEFAULT_wxUSE_OPENGL=0
706 DEFAULT_wxUSE_METAFILE=0
707 DEFAULT_wxUSE_WXGRAPH=0
708 DEFAULT_wxUSE_WXTREE=0
711 DEFAULT_wxUSE_UNICODE=1
712 DEFAULT_wxUSE_WCSRTOMBS=0
714 dnl ----------------------------------------------------------------
716 dnl ----------------------------------------------------------------
718 AC_OVERRIDES(gtk,gtk,
719 **--with-gtk use GTK,
726 AC_OVERRIDES(motif,motif,
727 **--with-motif use Motif/Lesstif,
730 dnl ----------------------------------------------------------------
732 dnl ----------------------------------------------------------------
734 AC_OVERRIDES(shared,shared,
735 **--with-shared create shared libraries,
738 AC_OVERRIDES(optimise,optimise,
739 **--with-optimise create optimised code,
742 AC_OVERRIDES(debug_flag,debug_flag,
743 **--with-debug_flag create code with WXDEBUG define set to 1,
746 AC_OVERRIDES(debug_info,debug_info,
747 **--with-debug_info create code with debuging information,
750 AC_OVERRIDES(mem_tracing,mem_tracing,
751 **--with-mem_traing create code with memory tracing,
754 AC_OVERRIDES(dmalloc,dmalloc,
755 **--with-dmalloc use dmalloc memory debug library (www.letters.com/dmalloc/),
758 AC_OVERRIDES(profile,profile,
759 **--with-profile create code with profiling information,
762 AC_OVERRIDES(apple_ieee, apple_ieee,
763 **--with_apple_ieee use the Apple IEEE codec,
766 dnl ----------------------------------------------------------------
767 dnl user options for libraries
768 dnl ----------------------------------------------------------------
770 AC_OVERRIDES(zlib,zlib,
771 **--with-zlib use zlib for LZW comression,
774 AC_OVERRIDES(gdk_imlib,gdk_imlib,
775 **--with-gdk_imlib use Raster's gdk_imlib (Image library),
778 AC_OVERRIDES(libpng,libpng,
779 **--with-libpng use libpng (PNG image format),
782 AC_OVERRIDES(odbc,odbc,
783 **--with-odbc use iODBC and wxODBC classes,
786 AC_OVERRIDES(opengl,opengl,
787 **--with-opengl use OpenGL (or Mesa),
790 dnl ----------------------------------------------------------------
791 dnl user options for GUI control classes
792 dnl ----------------------------------------------------------------
794 AC_OVERRIDES(gauge,gauge,
795 **--with-gauge use wxGauge class,
798 AC_OVERRIDES(combobox,combobox,
799 **--with-combobox use wxComboBox class,
802 AC_OVERRIDES(scrollbar,scrollbar,
803 **--with-scrollbar use wxScrollbar class,
806 AC_OVERRIDES(listctrl,listctrl,
807 **--with-listctrl use wxListCtrl class,
810 AC_OVERRIDES(treectrl,treectrl,
811 **--with-treectrl use wxTreeCtrl class,
814 AC_OVERRIDES(grid,grid,
815 **--with-grid use wxGrid class,
818 AC_OVERRIDES(tab_dialog,tab_dialog,
819 **--with-tab_dialog use wxTabDia class,
822 AC_OVERRIDES(notebook,notebook,
823 **--with-notebook use wxNotebook class,
826 dnl ----------------------------------------------------------------
827 dnl user options for non-GUI classes
828 dnl ----------------------------------------------------------------
830 AC_OVERRIDES(timedate, timedate,
831 **--with-timedate use wxTime and wxDate classes,
834 AC_OVERRIDES(fraction,fraction,
835 **--with-fraction use wxFraction class,
838 AC_OVERRIDES(log,log,
839 **--with-log use logging system,
842 AC_OVERRIDES(intl,intl,
843 **--with-intl use internationalization system,
846 AC_OVERRIDES(config,config,
847 **--with-config use wxConfig class,
850 AC_OVERRIDES(streams,streams,
851 **--with-streams use wxStream etc classes,
854 AC_OVERRIDES(serial,serial,
855 **--with-serial use class serialization,
858 AC_OVERRIDES(file,file,
859 **--with-file use wxFile class,
862 AC_OVERRIDES(textfile,textfile,
863 **--with-textfile use wxTextFile class,
866 dnl ----------------------------------------------------------------
867 dnl user options for PostScript
868 dnl ----------------------------------------------------------------
870 AC_OVERRIDES(afmfonts,afmfonts,
871 **--with-afmfonts use Adobe Font Metric Font table,
872 wxUSE_AFM_FOR_POSTSCRIPT)
874 AC_OVERRIDES(normalized, normalized,
875 **--with-PS-normalized use normalized PS fonts,
876 WX_NORMALIZED_PS_FONTS)
878 AC_OVERRIDES(postscript, postscript,
879 **--with-postscript use wxPostscriptDC device context,
882 dnl ----------------------------------------------------------------
883 dnl user options for wxString and Unicode
884 dnl ----------------------------------------------------------------
886 AC_OVERRIDES(unicode,unicode,
887 **--with-unicode compile wxString with Unicode support,
890 AC_OVERRIDES(wcsrtombs,wcsrtombs,
891 **--with-wcsrtombs use wcsrtombs instead of (buggy in GNU libc5) wcstombs,
894 dnl ----------------------------------------------------------------
895 dnl user options for Prolog and Resources
896 dnl ----------------------------------------------------------------
898 AC_OVERRIDES(wxresources,wxresources,
899 **--with-wxresources use wxWindows's resources,
902 AC_OVERRIDES(prologio,prologio,
903 **--with-prologio use Prolog IO library,
906 AC_OVERRIDES(rpc,RPC,
907 **--with-rpc use Prolog's remote procedure calls,
910 dnl ----------------------------------------------------------------
911 dnl user options for misc stuff
912 dnl ----------------------------------------------------------------
914 AC_OVERRIDES(ipc,IPC,
915 **--with-ipc use interprocess communication (wxSocket etc.),
918 AC_OVERRIDES(resources,resources,
919 **--with-resources use X resources for saving information,
922 AC_OVERRIDES(clipboard,clipboard,
923 **--with-clipboard use wxClipboard classes,
926 AC_OVERRIDES(dnd,dnd,
927 **--with-dnd use Drag'n'Drop classes,
930 AC_OVERRIDES(constraints,constrains,
931 **--with-constraints use layout-constraints system,
934 dnl ----------------------------------------------------------------
935 dnl user options for architectures
936 dnl ----------------------------------------------------------------
938 AC_OVERRIDES(mdi,mdi,
939 **--with-mdi use multiple document interface architecture,
940 wxUSE_MDI_ARCHITECTURE)
942 AC_OVERRIDES(docview,docview,
943 **--with-docview use document view architecture,
944 wxUSE_DOC_VIEW_ARCHITECTURE)
946 AC_OVERRIDES(printarch,printarch,
947 **--with-printarch use printing architecture,
948 wxUSE_PRINTING_ARCHITECTURE)
950 dnl ----------------------------------------------------------------
951 dnl user options with no effect yet
952 dnl ----------------------------------------------------------------
954 dnl AC_OVERRIDES(metafile, metafile,
955 dnl **--with-metafile use metafile (no effect),
956 dnl wxwxUSE_METAFILE)
958 dnl AC_OVERRIDES(help,help,
959 dnl **--with-help use help (no effect),
962 dnl AC_OVERRIDES(wxgraph,wxgraph,
963 dnl **--with-wxgraph use wxgraph (no effect),
966 dnl AC_OVERRIDES(wxtree,wxtree,
967 dnl **--with-wxtree use wxtree (no effect),
970 dnl AC_OVERRIDES(package,message,helpmessage,variable)
972 dnl ----------------------------------------------------------------
974 dnl ----------------------------------------------------------------
976 if test "$wxUSE_UNIX" = 1 ; then
980 dnl ----------------------------------------------------------------
981 dnl search for toolkit (widget sets)
982 dnl ----------------------------------------------------------------
993 if test "$wxUSE_GTK" = 1; then
994 AM_PATH_GTK(0.99.7, [
995 GUI_TK_INCLUDE="$GTK_CFLAGS"
996 GUI_TK_LIBRARY="$GTK_LIBS"
997 ], AC_MSG_ERROR(Are gtk-config and the GTK in path and up-to-date?))
999 TOOLKIT_DEF=__WXGTK__
1000 MAKEINCLUDE=../gtk.inc
1003 if test "$wxUSE_QT" = 1; then
1004 AC_MSG_CHECKING(for Qt includes)
1005 AC_PATH_FIND_INCLUDES($SEARCH_INCLUDE,qapp.h)
1006 if test "$ac_find_includes" != "" ; then
1007 AC_MSG_RESULT(found $ac_find_includes)
1008 AC_MSG_CHECKING(for Qt library)
1009 AC_PATH_FIND_LIBRARIES($SEARCH_LIB,qt)
1010 if test "$ac_find_libraries" != "" ; then
1011 AC_INCLUDE_PATH_EXIST($ac_find_includes,$CHECK_INCLUDE)
1012 AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
1013 CHECK_LINK="$CHECK_INCLUDE $ac_path_to_link"
1014 CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include"
1015 AC_MSG_RESULT(found Qt at $ac_find_libraries)
1022 GUI_TK_LINK="-lXext -lX11 -lqt -lm"
1024 TOOLKIT_DEF=__WXQT__
1025 MAKEINCLUDE=../qt.inc
1028 if test "$wxUSE_MOTIF" = 1; then
1029 AC_MSG_CHECKING(for Motif/Lesstif includes)
1030 AC_PATH_FIND_INCLUDES($SEARCH_INCLUDE,Xm.h)
1031 if test "$ac_find_includes" != "" ; then
1032 AC_MSG_RESULT(found $ac_find_includes)
1033 AC_MSG_CHECKING(for Motif or Lesstif library)
1034 AC_PATH_FIND_LIBRARIES($SEARCH_LIB,Xm)
1035 if test "$ac_find_libraries" != "" ; then
1036 AC_INCLUDE_PATH_EXIST($ac_find_includes,$CHECK_INCLUDE)
1037 AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
1038 CHECK_LINK="$CHECK_INCLUDE $ac_path_to_link"
1039 CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include"
1040 AC_MSG_RESULT(found at $ac_find_libraries)
1047 GUI_TK_LINK="-lXext -lXt -lX11 -lXm -lm"
1049 TOOLKIT_DEF=__WXMOTIF__
1050 MAKEINCLUDE=../motif.inc
1053 if test "$TOOLKIT" = ""; then
1054 AC_MSG_ERROR(You must specify a toolkit: --with-gtk --with-qt --with-motif)
1057 AC_SUBST(GUI_TK_INCLUDE)
1058 AC_SUBST(GUI_TK_LIBRARY)
1059 AC_SUBST(GUI_TK_LINK)
1062 AC_SUBST(TOOLKIT_DEF)
1064 AC_SUBST(MAKEINCLUDE)
1066 dnl ----------------------------------------------------------------
1067 dnl Register compile options for makefiles and setup.h
1068 dnl ----------------------------------------------------------------
1071 if test "$wxUSE_DEBUG_INFO" = 1 ; then
1076 if test "$wxUSE_DEBUG_FLAG" = 1 ; then
1077 AC_DEFINE_UNQUOTED(WXDEBUG,$wxUSE_DEBUG_FLAG)
1078 WXDEBUG_DEFINE="-D__WXDEBUG__"
1079 AC_SUBST(WXDEBUG_DEFINE)
1082 if test "$wxUSE_MEM_TRACING" = 1 ; then
1083 AC_DEFINE_UNQUOTED(wxUSE_MEMORY_TRACING,$wxUSE_MEM_TRACING)
1084 AC_DEFINE_UNQUOTED(wxUSE_GLOBAL_MEMORY_OPERATORS,$wxUSE_MEM_TRACING)
1088 if test "$wxUSE_DMALLOC" = 1 ; then
1089 EXTRA_LINK="$EXTRA_LINK -ldmalloc"
1091 AC_SUBST(EXTRA_LINK)
1094 if test "$wxUSE_PROFILE" = 1 ; then
1099 CXXFLAGS=`echo "${CXXFLAGS}" | sed "s/\-O.//g" `
1100 CFLAGS=`echo "${CFLAGS}" | sed "s/\-O.//g" `
1101 if test "$wxUSE_OPTIMISE" = 0 ; then
1104 if test "$GCC" = yes ; then
1106 case "${canonical}" in
1108 OPTIMISE="${OPTIMISE} "
1118 if test "$wxUSE_APPLE_IEEE" = 1 ; then
1119 APPLE_IEEE="APPLE_IEEE"
1120 AC_DEFINE_UNQUOTED(wxUSE_APPLE_IEEE,$wxUSE_APPLE_IEEE)
1123 wxUSE_IOSTREAMH=$DEFAULT_wxUSE_IOSTREAMH
1124 AC_DEFINE_UNQUOTED(wxUSE_IOSTREAMH,$wxUSE_IOSTREAMH)
1126 dnl ----------------------------------------------------------------
1127 dnl Register library options for makefiles and setup.h
1128 dnl ----------------------------------------------------------------
1130 if test "$wxUSE_ZLIB" = 1 ; then
1131 AC_DEFINE_UNQUOTED(wxUSE_ZLIB,$wxUSE_ZLIB)
1134 if test "$wxUSE_GDK_IMLIB" = 1 ; then
1135 AC_DEFINE_UNQUOTED(wxUSE_GDK_IMLIB,$wxUSE_GDK_IMLIB)
1138 if test "$wxUSE_LIBPNG" = 1 ; then
1139 AC_DEFINE_UNQUOTED(wxUSE_LIBPNG,$wxUSE_LIBPNG)
1142 if test "$wxUSE_ODBC" = 1 ; then
1143 AC_DEFINE_UNQUOTED(wxUSE_ODBC,$wxUSE_ODBC)
1146 dnl ----------------------------------------------------------------
1147 dnl Register GUI-control options for makefiles and setup.h
1148 dnl ----------------------------------------------------------------
1150 if test "$wxUSE_GAUGE" = 1 ; then
1151 AC_DEFINE_UNQUOTED(wxUSE_GAUGE,$wxUSE_GAUGE)
1154 if test "$wxUSE_COMBOBOX" = 1 ; then
1155 AC_DEFINE_UNQUOTED(wxUSE_COMBOBOX,$wxUSE_COMBOBOX)
1158 if test "$wxUSE_SCROLLBAR" = 1 ; then
1159 AC_DEFINE_UNQUOTED(wxUSE_SCROLLBAR,$wxUSE_SCROLLBAR)
1162 if test "$wxUSE_LISTCTRL" = 1 ; then
1163 AC_DEFINE_UNQUOTED(wxUSE_LISTCTRL,$wxUSE_LISTCTRL)
1166 if test "$wxUSE_TREECTRL" = 1 ; then
1167 AC_DEFINE_UNQUOTED(wxUSE_TREECTRL,$wxUSE_TREECTRL)
1170 if test "$wxUSE_GRID" = 1 ; then
1171 AC_DEFINE_UNQUOTED(wxUSE_GRID,$wxUSE_GRID)
1174 if test "$wxUSE_TAB_DIALOG" = 1 ; then
1175 AC_DEFINE_UNQUOTED(wxUSE_TAB_DIALOG,$wxUSE_TAB_DIALOG)
1178 if test "$wxUSE_NOTEBOOK" = 1 ; then
1179 AC_DEFINE_UNQUOTED(wxUSE_NOTEBOOK,$wxUSE_NOTEBOOK)
1182 dnl ----------------------------------------------------------------
1183 dnl Register non-GUI class options for makefiles and setup.h
1184 dnl ----------------------------------------------------------------
1186 if test "$wxUSE_CONFIG" = 1 ; then
1187 AC_DEFINE_UNQUOTED(wxUSE_CONFIG,$wxUSE_CONFIG)
1190 if test "$wxUSE_TIMEDATE" = 1 ; then
1191 AC_DEFINE_UNQUOTED(wxUSE_TIMEDATE,$wxUSE_TIMEDATE)
1194 if test "$wxUSE_FRACTION" = 1 ; then
1195 AC_DEFINE_UNQUOTED(wxUSE_FRACTION,$wxUSE_FRACTION)
1198 if test "$wxUSE_LOG" = 1 ; then
1199 AC_DEFINE_UNQUOTED(wxUSE_LOG,$wxUSE_LOG)
1202 if test "$wxUSE_INTL" = 1 ; then
1203 AC_DEFINE_UNQUOTED(wxUSE_INTL,$wxUSE_INTL)
1206 if test "$wxUSE_STREAMS" = 1 ; then
1207 AC_DEFINE_UNQUOTED(wxUSE_STREAMS,$wxUSE_STREAMS)
1210 if test "$wxUSE_SERIAL" = 1 ; then
1211 AC_DEFINE_UNQUOTED(wxUSE_SERIAL,$wxUSE_SERIAL)
1214 if test "$wxUSE_FILE" = 1 ; then
1215 AC_DEFINE_UNQUOTED(wxUSE_FILE,$wxUSE_FILE)
1218 if test "$wxUSE_TEXTFILE" = 1 ; then
1219 AC_DEFINE_UNQUOTED(wxUSE_TEXTFILE,$wxUSE_TEXTFILE)
1222 dnl ----------------------------------------------------------------
1223 dnl Register Prolog and Resources options for makefiles and setup.h
1224 dnl ----------------------------------------------------------------
1226 if test "$wxUSE_RPC" = 1 ; then
1227 AC_DEFINE_UNQUOTED(wxUSE_RPC,$wxUSE_RPC)
1230 if test "$wxUSE_WX_RESOURCES" = 1 ; then
1231 AC_DEFINE_UNQUOTED(wxUSE_WX_RESOURCES,$wxUSE_WX_RESOURCES)
1234 if test "$wxUSE_PROLOGIO" = 1 ; then
1235 AC_DEFINE_UNQUOTED(wxUSE_PROLOGIO)
1238 dnl ----------------------------------------------------------------
1239 dnl Register PostScript options for makefiles and setup.h
1240 dnl ----------------------------------------------------------------
1242 if test "$wxUSE_POSTSCRIPT" = 1 ; then
1243 AC_DEFINE_UNQUOTED(wxUSE_POSTSCRIPT)
1246 AC_DEFINE_UNQUOTED(wxUSE_AFM_FOR_POSTSCRIPT,$wxUSE_AFM_FOR_POSTSCRIPT)
1248 AC_DEFINE_UNQUOTED(WX_NORMALIZED_PS_FONTS,$WX_NORMALIZED_PS_FONTS)
1250 dnl ----------------------------------------------------------------
1251 dnl Register architecture options for makefiles and setup.h
1252 dnl ----------------------------------------------------------------
1254 if test "$wxUSE_MDI_ARCHITECTURE" = 1 ; then
1255 AC_DEFINE_UNQUOTED(wxUSE_MDI_ARCHITECTURE,$wxUSE_MDI_ARCHITECTURE)
1258 if test "$wxUSE_DOC_VIEW_ARCHITECTURE" = 1 ; then
1259 AC_DEFINE_UNQUOTED(wxUSE_DOC_VIEW_ARCHITECTURE,$wxUSE_DOC_VIEW_ARCHITECTURE)
1262 if test "$wxUSE_PRINTING_ARCHITECTURE" = 1 ; then
1263 AC_DEFINE_UNQUOTED(wxUSE_PRINTING_ARCHITECTURE,$wxUSE_PRINTING_ARCHITECTURE)
1266 dnl ----------------------------------------------------------------
1267 dnl Register wxString options for makefiles and setup.h
1268 dnl ----------------------------------------------------------------
1270 if test "$wxUSE_UNICODE" = 1 ; then
1271 AC_DEFINE_UNQUOTED(wxUSE_UNICODE)
1274 if test "$wxUSE_WCSRTOMBS" = 1 ; then
1275 AC_DEFINE_UNQUOTED(wxUSE_WCSRTOMBS)
1278 dnl ----------------------------------------------------------------
1279 dnl Register misc options for makefiles and setup.h
1280 dnl ----------------------------------------------------------------
1282 if test "$wxUSE_IPC" = 1 ; then
1283 AC_DEFINE_UNQUOTED(wxUSE_IPC)
1286 if test "$wxUSE_RESOURCES" = 1 ; then
1287 AC_DEFINE_UNQUOTED(wxUSE_RESOURCES,$wxUSE_RESOURCES)
1290 if test "$wxUSE_CLIPBOARD" = 1 ; then
1291 AC_DEFINE_UNQUOTED(wxUSE_CLIPBOARD,$wxUSE_CLIPBOARD)
1294 if test "$wxUSE_DND" = 1 ; then
1295 AC_DEFINE_UNQUOTED(wxUSE_DND,$wxUSE_DND)
1298 if test "$wxUSE_CONSTRAINTS" = 1 ; then
1299 AC_DEFINE_UNQUOTED(wxUSE_CONSTRAINTS,$wxUSE_CONSTRAINTS)
1302 dnl ----------------------------------------------------------------
1304 dnl ----------------------------------------------------------------
1307 if test "$wxUSE_METAFILE" = 1 ; then
1309 AC_DEFINE_UNQUOTED(wxUSE_METAFILE,$wxUSE_METAFILE)
1314 if test "$wxUSE_HELP" = 1 ; then
1316 AC_DEFINE_UNQUOTED(wxUSE_HELP,$wxUSE_HELP)
1321 if test "$wxUSE_WXGRAPH" = 1 ; then
1323 AC_DEFINE_UNQUOTED(wxUSE_WXGRAPH,$wxUSE_WXGRAPH)
1328 if test "$wxUSE_WXTREE" = 1 ; then
1330 AC_DEFINE_UNQUOTED(wxUSE_WXTREE,$wxUSE_WXTREE)
1335 if test "$wxUSE_OPENGL" = 1 ; then
1339 dnl ----------------------------------------------------------------
1340 dnl select dynamic loader (used by iODBC to load drivers)
1341 dnl ----------------------------------------------------------------
1343 AC_CHECK_LIB(dl,main,[DL_LIBRARY=-ldl],[DL_LIBRARY=])
1344 AC_SUBST(DL_LIBRARY)
1346 dnl ----------------------------------------------------------------
1348 dnl ----------------------------------------------------------------
1352 UNIX_THREAD="gtk/threadno.cpp"
1354 AC_OVERRIDES(threads,threads,
1355 **--without-threads Force disabling threads,
1358 dnl AC_ARG_WITH(threads,
1359 dnl [**--without-threads Force disabling threads ],
1360 dnl [wxwxUSE_THREADS="$withval"])
1362 if test "$wxwxUSE_THREADS" = "1"; then
1363 UNIX_THREAD="gtk/threadno.cpp"
1365 dnl For glibc 2 users who have the old libc 5 too
1367 AC_CHECK_LIB(pthread-0.7, pthread_create, [
1368 UNIX_THREAD="gtk/threadpsx.cpp"
1369 THREADS_LINK="-lpthread-0.7"
1371 AC_CHECK_HEADER(sys/prctl.h, [
1372 UNIX_THREAD="gtk/threadsgi.cpp"
1375 dnl pthread_create is always available in pthread but it seems not to be
1376 dnl the case for pthread_setcanceltype.
1378 AC_CHECK_LIB(pthread, pthread_setcanceltype, [
1379 UNIX_THREAD="gtk/threadpsx.cpp"
1380 THREADS_LINK="-lpthread"
1383 AC_CHECK_LIB(pthreads, pthread_setcanceltype, [
1384 UNIX_THREAD="gtk/threadpsx.cpp"
1385 THREADS_LINK="-lpthreads"
1389 if test -z "$UNIX_THREAD"; then
1393 AC_SUBST(UNIX_THREAD)
1394 AC_SUBST(THREADS_LINK)
1395 AC_DEFINE(wxwxUSE_THREADS)
1397 dnl defines UNIX_THREAD it contains the source file to use for threads. (GL)
1398 dnl defines THREADS_LINK it contains the thread library to link with. (GL)
1399 dnl defines wxwxUSE_THREADS if thread support is activated. (GL)
1401 dnl ----------------------------------------------------------------
1402 dnl search for opengl
1403 dnl ----------------------------------------------------------------
1409 if test "$wxUSE_OPENGL" = 1; then
1410 dnl checking OPENGL includes
1411 AC_MSG_CHECKING(for OpenGL includes)
1412 AC_PATH_FIND_INCLUDES($SEARCH_INCLUDE,GL/gl.h)
1413 if test "$ac_find_includes" != "" ; then
1414 OPENGL_INCLUDE="-I$ac_find_includes"
1415 AC_MSG_RESULT(found $ac_find_includes)
1416 dnl checking OPENGL libraries
1417 AC_MSG_CHECKING(for OpenGL library)
1418 AC_PATH_FIND_LIBRARIES($SEARCH_LIB,GL)
1419 if test "$ac_find_libraries" != "" ; then
1420 AC_INCLUDE_PATH_EXIST($ac_find_includes,$CHECK_INCLUDE)
1421 AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
1422 CHECK_LINK="$CHECK_INCLUDE $ac_path_to_link"
1423 CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include"
1424 OPENGL_LIBRARY="$ac_path_to_link"
1425 OPENGL_INCLUDE="$ac_path_to_include"
1427 AC_MSG_RESULT(found OpenGL at $ac_find_libraries)
1429 AC_PATH_FIND_LIBRARIES($SEARCH_LIB,MesaGL)
1430 if test "$ac_find_libraries" != "" ; then
1431 AC_INCLUDE_PATH_EXIST($ac_find_includes,$CHECK_INCLUDE)
1432 AC_LINK_PATH_EXIST($ac_find_libraries,$CHECK_LIB)
1433 CHECK_LINK="$CHECK_INCLUDE $ac_path_to_link"
1434 CHECK_INCLUDE="$CHECK_INCLUDE $ac_path_to_include"
1435 OPENGL_LIBRARY="$ac_path_to_link"
1436 OPENGL_INCLUDE="$ac_path_to_include"
1437 OPENGL_LINK="-lMesaGL"
1438 AC_MSG_RESULT(found MESA at $ac_find_libraries)
1448 dnl ----------------------------------------------------------------
1450 dnl ----------------------------------------------------------------
1452 wxUSE_GLX=$wxUSE_OPENGL
1453 if test "$wxUSE_OPENGL" != 1; then
1460 AC_DEFINE_UNQUOTED(wxUSE_GLX,$wxUSE_GLX)
1461 AC_SUBST(OPENGL_INCLUDE)
1462 AC_SUBST(OPENGL_LIBRARY)
1463 AC_SUBST(OPENGL_LINK)
1466 dnl ------------------------------------------------------------------------
1467 dnl compiler options for shared libs
1468 dnl ------------------------------------------------------------------------
1472 case "${canonical}" in
1475 if test "${CC}" != "gcc" ; then
1476 CXXFLAGS="${CXXFLAGS} +a1 -z -Aa -D_HPUX_SOURCE"
1477 CFLAGS="${CFLAGS} -z -D_HPUX_SOURCE"
1483 CREATE_SHARED=sharedHpux
1488 CREATE_SHARED=sharedLinux
1491 *-*-irix5* | *-*-irix6* )
1492 # PICFLAGS can remain empty, as pic is the default
1494 CREATE_SHARED=sharedIrix
1499 if test "${CC}" != "gcc" ; then
1504 CREATE_SHARED=sharedSolaris2
1509 if test "${CC}" != "gcc" ; then
1515 CREATE_SHARED=sharedSunos4
1519 *-*-freebsd* | *-*-netbsd*)
1521 CREATE_SHARED=sharedBsd
1527 CREATE_SHARED=sharedOSF
1531 if test "${CC}" != "gcc" ; then
1536 CREATE_SHARED=sharedDgux
1541 if test "${CC}" != "gcc" ; then
1546 CREATE_SHARED=sharedSysV
1551 if test "${CC}" != "gcc" ; then
1556 CREATE_SHARED=sharedAIX
1565 if test "x$GCC" = xyes; then
1566 CFLAGS="${CFLAGS} -Wall"
1569 if test "x$GXX" = xyes; then
1570 CXXFLAGS="${CXXFLAGS} -Wall"
1573 if test "$wxUSE_SHARED" != 1; then
1580 AC_SUBST(CREATE_SHARED)
1582 dnl ------------------------------------------------------------------------
1583 dnl finish and clean-up
1584 dnl ------------------------------------------------------------------------
1586 dnl add OS to list of configured
1587 echo $OS >> system.list
1589 AC_CONFIG_HEADER(./include/wx/gtk/setup.h:./setup/setup.hin)
1590 AC_OUTPUT(./setup/substit ./wx-config:./wx-config.in,./setup/general/createall)