]> git.saurik.com Git - wxWidgets.git/blobdiff - configure.in
Fixed some line breaks.
[wxWidgets.git] / configure.in
index bdbb0a656c49bb9cced4bdb5e098d1de04dda679..0bf2f2b30ef5f1783bee11570486f4936afef47c 100644 (file)
@@ -1740,7 +1740,8 @@ AC_CACHE_CHECK([for va_copy],
             }
             int main()
             {
-                return foo("hi", 17);
+                foo("hi", 17);
+                return 0;
             }],
             wx_cv_func_va_copy=yes,
             wx_cv_func_va_copy=no
@@ -1801,6 +1802,11 @@ if test "x$wx_largefile" = "xyes"; then
     else
         WX_LARGEFILE_FLAGS="-D_LARGE_FILES"
     fi
+    dnl AC_FUNC_FSEEKO sets HAVE_FSEEKO and $ac_cv_sys_largefile_source
+    AC_FUNC_FSEEKO
+    if test "$ac_cv_sys_largefile_source" != no; then
+        WX_LARGEFILE_FLAGS="$WX_LARGEFILE_FLAGS -D_LARGEFILE_SOURCE=$ac_cv_sys_largefile_source"
+    fi
     CPPFLAGS="$CPPFLAGS $WX_LARGEFILE_FLAGS"
 fi
 
@@ -2369,7 +2375,6 @@ dnl Check for libmspack
 dnl ------------------------------------------------------------------------
 
 if test "$wxUSE_LIBMSPACK" != "no"; then
-    
     AC_CHECK_HEADER([mspack.h], [found_mspack_h=1])
     if test "x$found_mspack_h" = "x1"; then
         AC_CHECK_LIB(mspack, mspack_create_chm_decompressor,
@@ -2377,11 +2382,13 @@ if test "$wxUSE_LIBMSPACK" != "no"; then
     fi
     if test "x$MSPACK_LINK" = "x" ; then
         wxUSE_LIBMSPACK=no
-    else
-        AC_DEFINE(wxUSE_LIBMSPACK)
     fi
 fi
 
+if test "$wxUSE_LIBMSPACK" != "no"; then
+    AC_DEFINE(wxUSE_LIBMSPACK)
+fi
+
 
 dnl ----------------------------------------------------------------
 dnl search for toolkit (widget sets)
@@ -2543,7 +2550,27 @@ equivalent variable and GTK+ is version 1.2.3 or above.
             save_LIBS="$LIBS"
             CFLAGS="$CFLAGS $GTK_CFLAGS"
             LIBS="$LIBS $GTK_LIBS"
+            
             AC_CHECK_FUNCS([pango_font_family_is_monospace])
+            
+            dnl test if we have at least GTK+ 2.4:
+            AC_MSG_CHECKING([if GTK+ is version >= 2.4])
+            AC_TRY_COMPILE([
+                            #include <gtk/gtk.h>
+                           ],
+                           [
+                            #if !GTK_CHECK_VERSION(2,4,0)
+                            #error "Not GTK+ 2.4"
+                            #endif
+                           ],
+                           [
+                            AC_DEFINE(__WXGTK24__)
+                            AC_MSG_RESULT([yes])
+                           ],
+                           [
+                            AC_MSG_RESULT([no])
+                           ])
+            
             CFLAGS="$save_CFLAGS"
             LIBS="$save_LIBS"
         else
@@ -2747,6 +2774,7 @@ equivalent variable and GTK+ is version 1.2.3 or above.
                 )
                 PKG_CHECK_MODULES(PANGOXFT, pangoxft,
                     [
+                        AC_DEFINE(HAVE_PANGO_XFT)
                         CXXFLAGS="$CXXFLAGS $PANGOXFT_CFLAGS"
                         GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOXFT_LIBS"
                     ],
@@ -3180,10 +3208,12 @@ dnl ---------------------------------------------------------------------------
 dnl ---------------------------------------------------------------------------
 dnl DirectDraw  / Multimon for MSW
 dnl ---------------------------------------------------------------------------
-        AC_CHECK_HEADERS([multimon.h ddraw.h], [], [
-            wxUSE_DISPLAY="no"
-            AC_MSG_WARN([ddraw.h or multimon.h not found; disabling wxDisplay])
-          ] )
+        AC_CHECK_HEADERS([multimon.h ddraw.h], [],
+            [
+                wxUSE_DISPLAY="no"
+                AC_MSG_WARN([ddraw.h or multimon.h not found; disabling wxDisplay])
+            ],
+            [#include <windows.h>])
     fi
 fi
 
@@ -3197,17 +3227,19 @@ dnl ---------------------------------------------------------------------------
 dnl DirectShow MSW
 dnl ---------------------------------------------------------------------------
         wxUSE_DIRECTSHOW="yes"
-        AC_CHECK_HEADERS([dshow.h], [], [
-            wxUSE_DIRECTSHOW="no"
-            AC_MSG_WARN([DirectShow not installed; consider installing the DirectX7 SDK or higher])
-          ] )
+        AC_CHECK_HEADERS([dshow.h], [],
+            [
+                wxUSE_DIRECTSHOW="no"
+                AC_MSG_WARN([DirectShow not installed; consider installing the DirectX7 SDK or higher])
+            ],
+            [#include <windows.h>])
 
        if test "$wxUSE_DIRECTSHOW" = "yes"; then
-          AC_DEFINE(wxUSE_DIRECTSHOW)
-           LIBS="$LIBS -lstrmiids"          
+            AC_DEFINE(wxUSE_DIRECTSHOW)
+            LIBS="$LIBS -lstrmiids"
        fi
     fi
-    
+
     SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mediaplayer"
     AC_DEFINE(wxUSE_MEDIACTRL)
 fi
@@ -4143,10 +4175,6 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
                 if test "x$GCC" != "xyes"; then
                     dnl see http://docs.hp.com/hpux/onlinedocs/2213/threads.htm
                     flag="$flag -D_RWSTD_MULTI_THREAD"
-
-                    dnl we also need -lcma for user threads (-lpthread is for
-                    dnl kernel threads only) according to Ian Brown
-                    LIBS="$LIBS -lcma"
                 fi
                 ;;
             *solaris* | alpha*-osf*)
@@ -4469,21 +4497,19 @@ dnl the library may be built without GUI classes at all
 dnl ---------------------------------------------------------------------------
 
 if test "$wxUSE_GUI" = "yes"; then
-  AC_DEFINE(wxUSE_GUI)
-
-  dnl the things we always pull in the GUI version of the library:
-  dnl 1. basic things like wxApp, wxWindow, wxControl, wxFrame, wxDialog (the
-  dnl    library really can't be built without those)
-  dnl 2. basic controls: wxButton, wxStaticText, wxTextCtrl (these are used in
-  dnl    almost any program and the first 2 are needed to show a message box
-  dnl    which want to be always able to do)
-  dnl 3. GDI stuff: icon, cursors and all that. Although it would be very nice
-  dnl    to compile without them (if the app doesn't do any drawing, it doesn't
-  dnl    need the dcs, pens, brushes, ...), this just can't be done now
-  dnl 4. menu stuff: wxMenu, wxMenuBar, wxMenuItem
-  dnl 5. misc stuff: timers, settings, message box
-else
-  AC_DEFINE(wxUSE_NOGUI)
+    AC_DEFINE(wxUSE_GUI)
+
+    dnl the things we always pull in the GUI version of the library:
+    dnl 1. basic things like wxApp, wxWindow, wxControl, wxFrame, wxDialog (the
+    dnl    library really can't be built without those)
+    dnl 2. basic controls: wxButton, wxStaticText, wxTextCtrl (these are used in
+    dnl    almost any program and the first 2 are needed to show a message box
+    dnl    which want to be always able to do)
+    dnl 3. GDI stuff: icon, cursors and all that. Although it would be very nice
+    dnl    to compile without them (if the app doesn't do any drawing, it doesn't
+    dnl    need the dcs, pens, brushes, ...), this just can't be done now
+    dnl 4. menu stuff: wxMenu, wxMenuBar, wxMenuItem
+    dnl 5. misc stuff: timers, settings, message box
 fi
 
 dnl ---------------------------------------------------------------------------
@@ -4642,7 +4668,7 @@ if test "$WXGTK20" = 1; then
                 PKG_CHECK_MODULES(LIBGNOMEPRINTUI, 
                                   [libgnomeprintui-2.2 >= 2.8],
                     [
-                        EXTRALIBS_GNOMEPRINT="$LIBGNOMEPRINTUI_LIBS"
+dnl                     EXTRALIBS_GNOMEPRINT="$LIBGNOMEPRINTUI_LIBS"
                         CXXFLAGS="$CXXFLAGS $LIBGNOMEPRINTUI_CFLAGS"
                         AC_DEFINE(wxUSE_LIBGNOMEPRINT)
                     ],
@@ -5012,6 +5038,67 @@ if test "$wxUSE_SOCKETS" = "yes" ; then
         else
             AC_DEFINE_UNQUOTED(SOCKLEN_T, $wx_cv_type_getsockname3)
         fi
+        dnl Do this again for getsockopt as it may be different
+        AC_CACHE_CHECK([what is the type of the fifth argument of getsockopt],
+                       wx_cv_type_getsockopt5,
+            [
+                AC_TRY_COMPILE(
+                    [
+                        #include <sys/types.h>
+                        #include <sys/socket.h>
+                    ],
+                    [
+                        socklen_t len;
+                        getsockopt(0, 0, 0, 0, &len);
+                    ],
+                    wx_cv_type_getsockopt5=socklen_t,
+                    [
+                        dnl the compiler will compile the version with size_t
+                        dnl even if the real type of the last parameter is int
+                        dnl but it should give at least a warning about
+                        dnl converting between incompatible pointer types, so
+                        dnl try to use it to get the correct behaviour at
+                        dnl least with gcc (otherwise we'd always use size_t)
+                        CFLAGS_OLD="$CFLAGS"
+                        if test "$GCC" = yes ; then
+                            CFLAGS="$CFLAGS -Werror"
+                        fi
+
+                        AC_TRY_COMPILE(
+                            [
+                                #include <sys/types.h>
+                                #include <sys/socket.h>
+                            ],
+                            [
+                                size_t len;
+                                getsockopt(0, 0, 0, 0, &len);
+                            ],
+                            wx_cv_type_getsockopt5=size_t,
+                            AC_TRY_COMPILE(
+                                [
+                                    #include <sys/types.h>
+                                    #include <sys/socket.h>
+                                ],
+                                [
+                                    int len;
+                                    getsockopt(0, 0, 0, 0, &len);
+                                ],
+                                wx_cv_type_getsockopt5=int,
+                                wx_cv_type_getsockopt5=unknown
+                            )
+                        )
+
+                        CFLAGS="$CFLAGS_OLD"
+                    ]
+                )
+            ])
+
+        if test "$wx_cv_type_getsockopt5" = "unknown"; then
+            wxUSE_SOCKETS=no
+            AC_MSG_WARN([Couldn't find socklen_t synonym for this system])
+        else
+            AC_DEFINE_UNQUOTED(SOCKOPTLEN_T, $wx_cv_type_getsockopt5)
+        fi
         AC_LANG_POP
     fi
 fi
@@ -5962,7 +6049,8 @@ INCLUDES="-I\${top_builddir}lib/wx/include/${TOOLCHAIN_FULLNAME} \
 dnl C/C++ compiler options used to compile wxWidgets
 if test "$GXX" = yes ; then
     dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror"
-    CXXWARNINGS="-Wall"
+    CWARNINGS="-Wall" 
+    CXXWARNINGS="$CWARNINGS -Wno-ctor-dtor-privacy" 
     dnl should enable this one day...
     dnl CXXWARNINGS="-Wall -Werror"
 fi
@@ -5971,7 +6059,7 @@ EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE"
 
 dnl remove the extra white space from the cc/c++/ld options
 CPPFLAGS=`echo $WXDEBUG_DEFINE $INCLUDES $CPPFLAGS`
-CFLAGS=`echo $CODE_GEN_FLAGS $EXTRA_CFLAGS $CFLAGS $CXXWARNINGS`
+CFLAGS=`echo $CODE_GEN_FLAGS $EXTRA_CFLAGS $CFLAGS $CWARNINGS`
 CXXFLAGS=`echo $CODE_GEN_FLAGS $CODE_GEN_FLAGS_CXX $EXTRA_CFLAGS $CXXFLAGS $CXXWARNINGS`
     
 
@@ -6124,6 +6212,17 @@ if test "$wxUSE_SHARED" = "yes"; then
     sanitised_bakefile_mess=`echo "$SHARED_LD_CXX" | tr -d '()'`
     EXE_LINKER=`eval echo "$sanitised_bakefile_mess"`
 
+    dnl Need addtional flag on OS/2, so override bakefiles value
+    dnl (there currently is no suitable variable to which the
+    dnl  missing flags could be added, AFAICS. SN, 18.12.2004. )
+    case "${host}" in
+      *-pc-os2_emx | *-pc-os2-emx )
+        SHARED_LD_CC="`pwd`/dllar.sh -name-mangler-script ./dllnames.sh -libf INITINSTANCE -libf TERMINSTANCE -o"
+        SHARED_LD_CXX="`pwd`/dllar.sh -name-mangler-script ./dllnames.sh -libf INITINSTANCE -libf TERMINSTANCE -o"
+       cp -p ${srcdir}/src/os2/dllnames.sh .
+       cp -p ${srcdir}/src/os2/dllar.sh .
+      ;;
+    esac
 else
 
     dnl No bakefile support for static builds, but this should be ok for most.
@@ -6131,11 +6230,8 @@ else
 
 fi
 
+dnl Check to see if the platform always requires NO_GCC_PRAGMA
 GCC_PRAGMA_FLAGS=""
-dnl Find out if we have to define NO_GCC_PRAGMA and WX_PRECOMP:
-if test $GCC_PCH = 1 ; then
-    GCC_PRAGMA_FLAGS="-DWX_PRECOMP -DNO_GCC_PRAGMA"
-else
     case "${host}" in
         powerpc-*-darwin* )
             dnl Some Apple's GCC version are broken and can't handle the
@@ -6163,9 +6259,35 @@ else
                               [AC_MSG_RESULT([no])])
             fi
             ;;
+       *-pc-os2_emx | *-pc-os2-emx )
+            dnl GCC versions ported to OS/2 have similar problems with
+            dnl static member of classes in combination with STL and
+            dnl pragma interface/implementation
+            if test "$wxUSE_STL" = "yes"; then
+               AC_MSG_CHECKING([if this gcc version needs -DNO_GCC_PRAGMA])
+               AC_TRY_COMPILE([],
+                              [#if !(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2))
+                               #error "Not GCC 3.2 or greater"
+                               #endif
+                               ],
+                              [GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA"
+                               AC_MSG_RESULT([yes])],
+                              [AC_MSG_RESULT([no])])
+            fi
+            ;;
     esac
+
+dnl Find out if we have to define NO_GCC_PRAGMA and WX_PRECOMP:
+PCH_FLAGS=""
+if test $GCC_PCH = 1 ; then
+    if test "x$GCC_PRAGMA_FLAGS" = "x"; then
+        PCH_FLAGS="-DWX_PRECOMP -DNO_GCC_PRAGMA"
+    else
+        PCH_FLAGS="-DWX_PRECOMP"
+    fi
 fi
-CPPFLAGS="$GCC_PRAGMA_FLAGS $CPPFLAGS"
+
+CPPFLAGS="$PCH_FLAGS $GCC_PRAGMA_FLAGS $CPPFLAGS"
 
 
 dnl for convenience, sort the samples in alphabetical order
@@ -6371,7 +6493,7 @@ echo "                                       odbc               ${wxUSE_ODBC}"
 echo "                                       expat              ${wxUSE_EXPAT}"
 echo "                                       libmspack          ${wxUSE_LIBMSPACK}"
 echo "                                       sdl                ${wxUSE_LIBSDL}"
-echo "                                       gnomeprint         ${wxUSE_LIBGNOMEPRINT}"
+echo "                                       gnomeprint         ${wxUSE_LIBGNOMEPRINT-none}"
 
 echo ""