]> git.saurik.com Git - wxWidgets.git/blobdiff - configure.in
make prefix /usr by default, not /opt/gnome
[wxWidgets.git] / configure.in
index c062c92a7031e8cfce97efb81405aa9c2da4a68e..f61bb4d2064452b2375cfe75faa7c40482d826c9 100644 (file)
@@ -191,7 +191,7 @@ case "${host}" in
     AC_DEFINE(__BSD__)
     DEFAULT_DEFAULT_wxUSE_GTK=1
   ;;
-  *-*-openbsd*)
+  *-*-openbsd*|*-*-mirbsd*)
     USE_BSD=1
     USE_OPENBSD=1
     AC_DEFINE(__OPENBSD__)
@@ -338,7 +338,8 @@ case "${host}" in
   ;;
 
   *)
-    AC_MSG_ERROR(unknown system type ${host}.)
+    AC_MSG_WARN([*** System type ${host} is unknown, assuming generic Unix and continuing nevertheless.])
+    AC_MSG_WARN([*** Please report the build results to wx-dev@lists.wxwidgets.org.])
 esac
 
 dnl ---------------------------------------------------------------------------
@@ -424,6 +425,7 @@ if test $DEBUG_CONFIGURE = 1; then
   DEFAULT_wxUSE_SOUND=no
   DEFAULT_wxUSE_MEDIACTRL=no
   DEFAULT_wxUSE_GSTREAMER8=no
+  DEFAULT_wxUSE_PRINTF_POS_PARAM=no
   DEFAULT_wxUSE_INTL=no
   DEFAULT_wxUSE_CONFIG=no
   DEFAULT_wxUSE_FONTMAP=no
@@ -636,6 +638,7 @@ else
   DEFAULT_wxUSE_SOUND=yes
   DEFAULT_wxUSE_MEDIACTRL=no
   DEFAULT_wxUSE_GSTREAMER8=no
+  DEFAULT_wxUSE_PRINTF_POS_PARAM=yes
   DEFAULT_wxUSE_INTL=yes
   DEFAULT_wxUSE_CONFIG=yes
   DEFAULT_wxUSE_FONTMAP=yes
@@ -782,7 +785,7 @@ else
   DEFAULT_wxUSE_PLUGINS=no
   DEFAULT_wxUSE_OFFICIAL_BUILD=no
 
-  dnl Appliable only when --with-gtk was used:
+  dnl Applicable only when --with-gtk was used:
   DEFAULT_wxUSE_GTK2=yes
 fi
 
@@ -957,7 +960,7 @@ WX_ARG_ENABLE(unicode,       [  --enable-unicode        compile wxString with Un
 WX_ARG_ENABLE(sound,         [  --enable-sound          use wxSound class], wxUSE_SOUND)
 WX_ARG_ENABLE(mediactrl,     [  --enable-mediactrl      use wxMediaCtrl class], wxUSE_MEDIACTRL)
 WX_ARG_ENABLE(gstreamer8,     [  --enable-gstreamer8      force GStreamer 0.8 instead of 0.10 with the wxMediaCtrl class on unix], wxUSE_GSTREAMER8)
-WX_ARG_ENABLE(wxprintfv,     [  --enable-wxprintfv      use wxWidgets implementation of vprintf()], wxUSE_EXPERIMENTAL_PRINTF)
+WX_ARG_ENABLE(printfposparam,[  --enable-printfposparam use wxVsnprintf() which supports positional parameters], wxUSE_PRINTF_POS_PARAMS)
 WX_ARG_ENABLE(zipstream,     [  --enable-zipstream      use wxZip streams], wxUSE_ZIPSTREAM)
 
 WX_ARG_ENABLE(url,           [  --enable-url            use wxURL class], wxUSE_URL)
@@ -4320,8 +4323,41 @@ if test "$ac_cv_func_snprintf" = "yes"; then
             AC_DEFINE(HAVE_BROKEN_SNPRINTF_DECL)
         fi
     fi
+
+    if test "$wxUSE_PRINTF_POS_PARAMS" = "yes"; then
+
+        dnl check if snprintf() has support for positional arguments
+        dnl NB: if snprintf() has positional support we can safely suppose that also
+        dnl     other *printf() functions support them as they all belong to the same
+        dnl     family and they all fallback to the same implementation
+        AC_CACHE_CHECK([if snprintf supports positional arguments], wx_cv_func_snprintf_pos_params,
+            [
+                AC_TRY_RUN(
+                    [
+                        #include <stdio.h>
+
+                        int main (void)
+                        {
+                            char buffer[128];
+                            snprintf (buffer, 128, "%2\$d %3\$d %1\$d", 1, 2, 3);
+                            if (strcmp ("2 3 1", buffer) == 0)
+                                exit (0);
+                            exit (1);
+                        }
+                    ],
+                    wx_cv_func_snprintf_pos_params=no,
+                    wx_cv_func_snprintf_pos_params=yes
+                )
+            ]
+        )
+
+        if test "$wx_cv_func_snprintf_pos_params" = "yes"; then
+            AC_DEFINE(HAVE_UNIX98_PRINTF)
+        fi
+    fi
 fi
 
+
 if test "$wxUSE_UNICODE" = yes; then
     dnl also look if we have wide char IO functions
     AC_CHECK_FUNCS(wputc wputchar putws fputws wprintf vswprintf)
@@ -5648,6 +5684,11 @@ if test "$wxUSE_STREAMS" = "yes" ; then
   AC_DEFINE(wxUSE_STREAMS)
 fi
 
+if test "$wxUSE_PRINTF_POS_PARAMS" = "yes"; then
+  AC_DEFINE(wxUSE_PRINTF_POS_PARAMS)
+fi
+
+
 dnl ---------------------------------------------------------------------------
 dnl time/date functions
 dnl ---------------------------------------------------------------------------
@@ -6875,11 +6916,13 @@ dnl ---------------------------------------------------------------------------
 USE_MEDIA=0
 
 if test "$wxUSE_MEDIACTRL" = "yes"; then
+    USE_MEDIA=1
+
     dnl -----------------------------------------------------------------------
     dnl GStreamer
     dnl -----------------------------------------------------------------------
     if test "$wxUSE_GTK" = 1; then
-        wxUSE_GSTREAMER="yes"
+        wxUSE_GSTREAMER="no"
 
         dnl -------------------------------------------------------------------
         dnl Test for at least 0.8 gstreamer module from pkg-config
@@ -6890,51 +6933,60 @@ if test "$wxUSE_MEDIACTRL" = "yes"; then
         dnl -------------------------------------------------------------------
         GST_VERSION_MAJOR=0
         GST_VERSION_MINOR=10
-        GST_VERSION_RELEASE=0
-        GSTREAMER_REQ=$GST_VERSION_MAJOR.$GST_VERSION_MINOR.$GST_VERSION_RELEASE
-        GST_MAJORMINOR=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
+        GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
 
         if test "$wxUSE_GSTREAMER8" = "no"; then
-            PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR
-                               gstreamer-plugins-base-$GST_MAJORMINOR
-                               gconf-2.0,
-        [
-                    CPPFLAGS="$GST_CFLAGS $CPPFLAGS"
-                    LIBS="$LIBS $GST_LIBS -lgstinterfaces-$GST_MAJORMINOR"
-        ],
-        [
+            PKG_CHECK_MODULES(GST,
+                [gstreamer-$GST_VERSION gstreamer-plugins-base-$GST_VERSION gconf-2.0],
+                [
+                    wxUSE_GSTREAMER="yes"
+                    GST_LIBS="$GST_LIBS -lgstinterfaces-$GST_VERSION"
+                ],
+                [
+                    AC_MSG_WARN([GStreamer 0.10 not available, falling back to 0.8])
                     GST_VERSION_MINOR=8
-        ])
-            else
+                ]
+            )
+        else
+            dnl check only for 0.8
             GST_VERSION_MINOR=8
         fi
 
-        GSTREAMER_REQ=$GST_VERSION_MAJOR.$GST_VERSION_MINOR.$GST_VERSION_RELEASE
-        GST_MAJORMINOR=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
-
-        if test x$GST_VERSION_MINOR = x8; then
-            PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR
-                gstreamer-interfaces-$GST_MAJORMINOR
-                gstreamer-gconf-$GST_MAJORMINOR,
-                        [
-                    CPPFLAGS="$GST_CFLAGS $CPPFLAGS"
-                    LIBS="$LIBS $GST_LIBS"
-                        ],
+        if test $GST_VERSION_MINOR = "8"; then
+            GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
+            PKG_CHECK_MODULES(GST,
+                [gstreamer-$GST_VERSION gstreamer-interfaces-$GST_VERSION gstreamer-gconf-$GST_VERSION],
+                wxUSE_GSTREAMER="yes",
                 [
-                    AC_MSG_WARN([Proper GStreamer .8/.10 installation not found])
-            wxUSE_GSTREAMER="no"
+                    AC_MSG_WARN([GStreamer 0.8/0.10 not available.])
                 ])
         fi
 
 
         if test "$wxUSE_GSTREAMER" = "yes"; then
+            dnl system gstreamer package is compiled with Sun CC and outputs
+            dnl CC-specific "-mt" in its flags, remove it for gcc compilation
+            case "${host}" in
+                *-*-solaris2* )
+                    if "$GCC" = yes; then
+                        GST_CFLAGS=`echo $GST_CFLAGS | sed 's/-mt//'`
+                        GST_LIBS=`echo $GST_LIBS | sed 's/-mt//'`
+                    fi
+            esac
+
+            CPPFLAGS="$GST_CFLAGS $CPPFLAGS"
+            LIBS="$GST_LIBS $LIBS"
+
             AC_DEFINE(wxUSE_GSTREAMER)
-            AC_MSG_RESULT([GStreamer detection successful])
+        else
+            USE_MEDIA=0
         fi
     fi
-    USE_MEDIA=1
-    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mediaplayer"
-    AC_DEFINE(wxUSE_MEDIACTRL)
+
+    if test $USE_MEDIA = 1; then
+        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mediaplayer"
+        AC_DEFINE(wxUSE_MEDIACTRL)
+    fi
 fi
 
 dnl ---------------------------------------------------------------------------