]> git.saurik.com Git - wxWidgets.git/blobdiff - configure.in
work around probable bug in GTK+ 2.18 when calling WriteText on a new, empty control...
[wxWidgets.git] / configure.in
index 7d7c54f7549605ba857539de35ec4d914ebc8511..5c7b65eeab4156d7b26fbe345100be154a8218eb 100644 (file)
@@ -750,6 +750,7 @@ WX_ARG_FEATURE(fontmap,       [  --enable-fontmap        use font encodings conv
 WX_ARG_FEATURE(fs_archive,    [  --enable-fs_archive     use virtual archive filesystems], wxUSE_FS_ARCHIVE)
 WX_ARG_FEATURE(fs_inet,       [  --enable-fs_inet        use virtual HTTP/FTP filesystems], wxUSE_FS_INET)
 WX_ARG_FEATURE(fs_zip,        [  --enable-fs_zip         now replaced by fs_archive], wxUSE_FS_ZIP)
 WX_ARG_FEATURE(fs_archive,    [  --enable-fs_archive     use virtual archive filesystems], wxUSE_FS_ARCHIVE)
 WX_ARG_FEATURE(fs_inet,       [  --enable-fs_inet        use virtual HTTP/FTP filesystems], wxUSE_FS_INET)
 WX_ARG_FEATURE(fs_zip,        [  --enable-fs_zip         now replaced by fs_archive], wxUSE_FS_ZIP)
+WX_ARG_FEATURE(fswatcher,     [  --enable-fswatcher      use wxFileSystemWatcher class], wxUSE_FSWATCHER)
 WX_ARG_FEATURE(geometry,      [  --enable-geometry       use geometry class], wxUSE_GEOMETRY)
 WX_ARG_FEATURE(log,           [  --enable-log            use logging system], wxUSE_LOG)
 WX_ARG_FEATURE(longlong,      [  --enable-longlong       use wxLongLong class], wxUSE_LONGLONG)
 WX_ARG_FEATURE(geometry,      [  --enable-geometry       use geometry class], wxUSE_GEOMETRY)
 WX_ARG_FEATURE(log,           [  --enable-log            use logging system], wxUSE_LOG)
 WX_ARG_FEATURE(longlong,      [  --enable-longlong       use wxLongLong class], wxUSE_LONGLONG)
@@ -760,7 +761,7 @@ WX_ARG_FEATURE(sound,         [  --enable-sound          use wxSound class], wxU
 WX_ARG_FEATURE(stdpaths,      [  --enable-stdpaths       use wxStandardPaths class], wxUSE_STDPATHS)
 WX_ARG_FEATURE(stopwatch,     [  --enable-stopwatch      use wxStopWatch class], wxUSE_STOPWATCH)
 WX_ARG_FEATURE(streams,       [  --enable-streams        use wxStream etc classes], wxUSE_STREAMS)
 WX_ARG_FEATURE(stdpaths,      [  --enable-stdpaths       use wxStandardPaths class], wxUSE_STDPATHS)
 WX_ARG_FEATURE(stopwatch,     [  --enable-stopwatch      use wxStopWatch class], wxUSE_STOPWATCH)
 WX_ARG_FEATURE(streams,       [  --enable-streams        use wxStream etc classes], wxUSE_STREAMS)
-WX_ARG_FEATURE(system_options,[  --enable-sysoptions     use wxSystemOptions], wxUSE_SYSTEM_OPTIONS)
+WX_ARG_FEATURE(sysoptions,    [  --enable-sysoptions     use wxSystemOptions], wxUSE_SYSTEM_OPTIONS)
 WX_ARG_FEATURE(tarstream,     [  --enable-tarstream      use wxTar streams], wxUSE_TARSTREAM)
 WX_ARG_FEATURE(textbuf,       [  --enable-textbuf        use wxTextBuffer class], wxUSE_TEXTBUFFER)
 WX_ARG_FEATURE(textfile,      [  --enable-textfile       use wxTextFile class], wxUSE_TEXTFILE)
 WX_ARG_FEATURE(tarstream,     [  --enable-tarstream      use wxTar streams], wxUSE_TARSTREAM)
 WX_ARG_FEATURE(textbuf,       [  --enable-textbuf        use wxTextBuffer class], wxUSE_TEXTBUFFER)
 WX_ARG_FEATURE(textfile,      [  --enable-textfile       use wxTextFile class], wxUSE_TEXTFILE)
@@ -2737,6 +2738,11 @@ if test "$USE_WIN32" = 1 ; then
        x86_64-*-mingw32* )
             dnl --- For mingw-w64 lctl3d32's name has changed
             LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lwctl3d32 -ladvapi32 -lwsock32 -lgdi32"
        x86_64-*-mingw32* )
             dnl --- For mingw-w64 lctl3d32's name has changed
             LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lwctl3d32 -ladvapi32 -lwsock32 -lgdi32"
+
+            dnl we need to define this to embed the manifest for correct
+            dnl platform from wx/msw/wx.rc (this is not needed for x86 which is
+            dnl the default in wx/msw/rcdefs.h)
+            WINDRES_CPU_DEFINE="--define WX_CPU_AMD64"
         ;;
         * )
             LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32"
         ;;
         * )
             LIBS="$LIBS -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32"
@@ -2903,47 +2909,71 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
             CFLAGS="$wx_cv_cflags_gtk $CFLAGS"
             LIBS="$LIBS $wx_cv_libs_gtk"
 
             CFLAGS="$wx_cv_cflags_gtk $CFLAGS"
             LIBS="$LIBS $wx_cv_libs_gtk"
 
-            dnl test if we have at least GTK+ 2.10:
-            AC_MSG_CHECKING([if GTK+ is version >= 2.10])
+            dnl test if we have at least GTK+ 2.18:
+            AC_MSG_CHECKING([if GTK+ is version >= 2.18])
             AC_TRY_COMPILE([
                             #include <gtk/gtk.h>
                            ],
                            [
             AC_TRY_COMPILE([
                             #include <gtk/gtk.h>
                            ],
                            [
-                            #if !GTK_CHECK_VERSION(2,10,0)
-                            Not GTK+ 2.10
+                            #if !GTK_CHECK_VERSION(2,18,0)
+                            Not GTK+ 2.18
                             #endif
                            ],
                            [
                             #endif
                            ],
                            [
+                            AC_DEFINE(__WXGTK218__)
                             AC_DEFINE(__WXGTK210__)
                             AC_DEFINE(__WXGTK26__)
                             AC_MSG_RESULT([yes])
                             AC_DEFINE(__WXGTK210__)
                             AC_DEFINE(__WXGTK26__)
                             AC_MSG_RESULT([yes])
-                            ac_wxgtk210=1
+                            ac_wxgtk218=1
                            ],
                            [
                             AC_MSG_RESULT([no])
                            ],
                            [
                             AC_MSG_RESULT([no])
-                            ac_wxgtk210=0
+                            ac_wxgtk218=0
                            ])
 
                            ])
 
-            if test "$ac_wxgtk210" = 0; then
-                dnl test if we have at least GTK+ 2.6:
-                AC_MSG_CHECKING([if GTK+ is version >= 2.6])
+            if test "$ac_wxgtk218" = 0; then
+                dnl test if we have at least GTK+ 2.10:
+                AC_MSG_CHECKING([if GTK+ is version >= 2.10])
                 AC_TRY_COMPILE([
                                 #include <gtk/gtk.h>
                 AC_TRY_COMPILE([
                                 #include <gtk/gtk.h>
-                            ],
-                            [
-                                #if !GTK_CHECK_VERSION(2,6,0)
-                                Not GTK+ 2.6
+                               ],
+                               [
+                                #if !GTK_CHECK_VERSION(2,10,0)
+                                Not GTK+ 2.10
                                 #endif
                                 #endif
-                            ],
-                            [
+                               ],
+                               [
+                                AC_DEFINE(__WXGTK210__)
                                 AC_DEFINE(__WXGTK26__)
                                 AC_MSG_RESULT([yes])
                                 AC_DEFINE(__WXGTK26__)
                                 AC_MSG_RESULT([yes])
-                                ac_wxgtk26=1
-                            ],
-                            [
+                                ac_wxgtk210=1
+                               ],
+                               [
                                 AC_MSG_RESULT([no])
                                 AC_MSG_RESULT([no])
-                                ac_wxgtk26=0
-                            ])
+                                ac_wxgtk210=0
+                               ])
+
+                if test "$ac_wxgtk210" = 0; then
+                    dnl test if we have at least GTK+ 2.6:
+                    AC_MSG_CHECKING([if GTK+ is version >= 2.6])
+                    AC_TRY_COMPILE([
+                                    #include <gtk/gtk.h>
+                                ],
+                                [
+                                    #if !GTK_CHECK_VERSION(2,6,0)
+                                    Not GTK+ 2.6
+                                    #endif
+                                ],
+                                [
+                                    AC_DEFINE(__WXGTK26__)
+                                    AC_MSG_RESULT([yes])
+                                    ac_wxgtk26=1
+                                ],
+                                [
+                                    AC_MSG_RESULT([no])
+                                    ac_wxgtk26=0
+                                ])
+                fi
             fi
 
             CFLAGS="$save_CFLAGS"
             fi
 
             CFLAGS="$save_CFLAGS"
@@ -3469,11 +3499,20 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
         dnl wxMac version of wxBase and wxCocoa or wxBase-only built on Darwin
         dnl are different, so they need different names:
         WXBASEPORT="_carbon"
         dnl wxMac version of wxBase and wxCocoa or wxBase-only built on Darwin
         dnl are different, so they need different names:
         WXBASEPORT="_carbon"
+
+        dnl in addition to defining __WXOSX_CARBON__ for this toolkit we want
+        dnl to also define these extra symbols to make it possible to test for
+        dnl any Mac port (__WXMAC__ is for backwards compatibility, __WXOSX__
+        dnl is a new name)
+        TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMAC__ -D__WXOSX__"
     fi
 
     if test "$wxUSE_OSX_COCOA" = 1; then
         TOOLKIT=OSX_COCOA
         GUIDIST=OSX_COCOA_DIST
     fi
 
     if test "$wxUSE_OSX_COCOA" = 1; then
         TOOLKIT=OSX_COCOA
         GUIDIST=OSX_COCOA_DIST
+
+        dnl see the comment above in wxUSE_OSX_CARBON branch
+        TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMAC__ -D__WXOSX__"
     fi
 
     if test "$wxUSE_COCOA" = 1; then
     fi
 
     if test "$wxUSE_COCOA" = 1; then
@@ -4856,7 +4895,14 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
       else
           dnl yes, these special compiler flags should be used with the
           dnl linker as well
       else
           dnl yes, these special compiler flags should be used with the
           dnl linker as well
+          dnl
+          dnl NB: add them to LDFLAGS immediately because we need them to be
+          dnl     used for the subsequent tests some of which can fail without
+          dnl     MT support, hence the reason for the duplication below:
+          dnl     adding them just to WXCONFIG_LDFLAGS and adding the entire
+          dnl     contents of the latter to LDFLAGS in the end is not enough.
           LDFLAGS="$THREADS_CFLAGS $LDFLAGS"
           LDFLAGS="$THREADS_CFLAGS $LDFLAGS"
+          WXCONFIG_LDFLAGS="$THREADS_CFLAGS $WXCONFIG_LDFLAGS"
           LIBS="$THREADS_LINK $LIBS"
 
           AC_MSG_CHECKING([if more special flags are required for pthreads])
           LIBS="$THREADS_LINK $LIBS"
 
           AC_MSG_CHECKING([if more special flags are required for pthreads])
@@ -4870,6 +4916,7 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
                 dnl     search path should include -L/usr/lib/threads at the
                 dnl     beginning of the path.
                 LDFLAGS="-L/usr/lib/threads $LDFLAGS"
                 dnl     search path should include -L/usr/lib/threads at the
                 dnl     beginning of the path.
                 LDFLAGS="-L/usr/lib/threads $LDFLAGS"
+                WXCONFIG_LDFLAGS="-L/usr/lib/threads $WXCONFIG_LDFLAGS"
                 flag="-D_THREAD_SAFE"
                 ;;
             *-freebsd*)
                 flag="-D_THREAD_SAFE"
                 ;;
             *-freebsd*)
@@ -5464,6 +5511,29 @@ if test "$wxUSE_PLUGINS" = "yes" ; then
     fi
 fi
 
     fi
 fi
 
+dnl ---------------------------------------------------------------------------
+dnl File system watcher checks
+dnl ---------------------------------------------------------------------------
+
+if test "$wxUSE_FSWATCHER" = "yes"; then
+    AC_DEFINE(wxUSE_FSWATCHER)
+    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS fswatcher"
+
+    if test "$wxUSE_UNIX" = "yes"; then
+        AC_CHECK_HEADERS(sys/inotify.h,,, [AC_INCLUDES_DEFAULT()])
+        if test "$ac_cv_header_sys_inotify_h" = "yes"; then
+            AC_DEFINE(wxHAS_INOTIFY)
+        else
+            AC_CHECK_HEADERS(sys/event.h,,, [AC_INCLUDES_DEFAULT()])
+            if test "$ac_cv_header_sys_event_h" = "yes"; then
+                AC_DEFINE(wxHAS_KQUEUE)
+            else
+                AC_MSG_WARN([No native wxFileSystemWatcher implementation available for on this platform])
+            fi
+        fi
+    fi
+fi
+
 dnl ---------------------------------------------------------------------------
 dnl Register non-GUI class options for makefiles and setup.h
 dnl ---------------------------------------------------------------------------
 dnl ---------------------------------------------------------------------------
 dnl Register non-GUI class options for makefiles and setup.h
 dnl ---------------------------------------------------------------------------
@@ -7423,22 +7493,25 @@ dnl Output the makefiles and such from the results found above
 dnl ---------------------------------------------------------------------------
 
 dnl all additional libraries (except wxWidgets itself) we link with
 dnl ---------------------------------------------------------------------------
 
 dnl all additional libraries (except wxWidgets itself) we link with
-
+EXTRA_FRAMEWORKS=
 if test "$wxUSE_MAC" = 1 ; then
     if test "$USE_DARWIN" = 1; then
 if test "$wxUSE_MAC" = 1 ; then
     if test "$USE_DARWIN" = 1; then
-        LDFLAGS="$LDFLAGS -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -framework QuickTime"
+        EXTRA_FRAMEWORKS="-framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -framework QuickTime"
     fi
 fi
 if test "$wxUSE_COCOA" = 1 ; then
     fi
 fi
 if test "$wxUSE_COCOA" = 1 ; then
-    LDFLAGS="$LDFLAGS -framework IOKit -framework Cocoa"
+    EXTRA_FRAMEWORKS="-framework IOKit -framework Cocoa"
     if test "$wxUSE_MEDIACTRL" = "yes"; then
     if test "$wxUSE_MEDIACTRL" = "yes"; then
-        LDFLAGS="$LDFLAGS -framework QuickTime"
+        EXTRA_FRAMEWORKS="$EXTRA_FRAMEWORKS -framework QuickTime"
     fi
 fi
 if test "$USE_DARWIN" = 1 -a "$wxUSE_MAC" != 1 -a "$wxUSE_COCOA" != 1 ; then
     fi
 fi
 if test "$USE_DARWIN" = 1 -a "$wxUSE_MAC" != 1 -a "$wxUSE_COCOA" != 1 ; then
-    LDFLAGS="$LDFLAGS -framework IOKit -framework CoreServices -framework System -framework ApplicationServices"
+    EXTRA_FRAMEWORKS="$EXTRA_FRAMEWORKS -framework IOKit -framework CoreServices -framework System -framework ApplicationServices"
 fi
 
 fi
 
+LDFLAGS="$LDFLAGS $EXTRA_FRAMEWORKS"
+WXCONFIG_LDFLAGS="$WXCONFIG_LDFLAGS $EXTRA_FRAMEWORKS"
+
 LIBS="$ZLIB_LINK $POSIX4_LINK $INET_LINK $WCHAR_LINK $DL_LINK $LIBS"
 
 if test "$wxUSE_GUI" = "yes"; then
 LIBS="$ZLIB_LINK $POSIX4_LINK $INET_LINK $WCHAR_LINK $DL_LINK $LIBS"
 
 if test "$wxUSE_GUI" = "yes"; then
@@ -7812,7 +7885,7 @@ if test "$wxUSE_MSW" = 1 ; then
         AC_MSG_ERROR([Required windres program not found])
     fi
 
         AC_MSG_ERROR([Required windres program not found])
     fi
 
-    RESCOMP="$WINDRES"
+    RESCOMP="$WINDRES $WINDRES_CPU_DEFINE"
 fi
 
 if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1; then
 fi
 
 if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1; then
@@ -8010,6 +8083,7 @@ AC_SUBST(WXCONFIG_CXXFLAGS)
 
 AC_SUBST(WXCONFIG_LIBS)
 AC_SUBST(WXCONFIG_RPATH)
 
 AC_SUBST(WXCONFIG_LIBS)
 AC_SUBST(WXCONFIG_RPATH)
+AC_SUBST(WXCONFIG_LDFLAGS)
 AC_SUBST(WXCONFIG_LDFLAGS_GUI)
 AC_SUBST(WXCONFIG_RESFLAGS)
 
 AC_SUBST(WXCONFIG_LDFLAGS_GUI)
 AC_SUBST(WXCONFIG_RESFLAGS)