]> Pileus Git - ~andy/gtk/blobdiff - configure.in
Fix up linker flags
[~andy/gtk] / configure.in
index c23e7eec9ddbd8a7202a9bde9c2bce75e543740c..d5a83b0e9e6bfb8793840fb0f3ab3f368258a787 100644 (file)
@@ -1,6 +1,6 @@
 # Process this file with autoconf to produce a configure script.
 # require autoconf 2.54
-AC_PREREQ(2.54)
+AC_PREREQ(2.62)
 
 # Making releases:
 #   GTK_MICRO_VERSION += 1;
@@ -11,9 +11,9 @@ AC_PREREQ(2.54)
 # set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
 
 m4_define([gtk_major_version], [2])
-m4_define([gtk_minor_version], [14])
+m4_define([gtk_minor_version], [19])
 m4_define([gtk_micro_version], [2])
-m4_define([gtk_interface_age], [2])
+m4_define([gtk_interface_age], [0])
 m4_define([gtk_binary_age],
           [m4_eval(100 * gtk_minor_version + gtk_micro_version)])
 m4_define([gtk_version],
@@ -31,9 +31,9 @@ m4_define([gtk_api_version], [2.0])
 m4_define([gtk_binary_version], [2.10.0])
 
 # required versions of other packages
-m4_define([glib_required_version], [2.17.6])
+m4_define([glib_required_version], [2.21.3])
 m4_define([pango_required_version], [1.20])
-m4_define([atk_required_version], [1.13.0])
+m4_define([atk_required_version], [1.29.2])
 m4_define([cairo_required_version], [1.6])
 
 
@@ -43,12 +43,19 @@ AC_INIT([gtk+], [gtk_version],
 
 AC_CONFIG_SRCDIR([gdk/gdktypes.h])
 
+AC_CONFIG_MACRO_DIR([m4])
+
 # Save this value here, since automake will set cflags later
 cflags_set=${CFLAGS+set}
 
-AM_INIT_AUTOMAKE(no-define)
+AM_INIT_AUTOMAKE([no-define -Wno-portability])
 AM_CONFIG_HEADER(config.h)
 
+# Support silent build rules, requires at least automake-1.11. Enable
+# by either passing --enable-silent-rules to configure or passing V=0
+# to make
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
+
 #
 # For each of the libraries we build, we define the following
  
@@ -184,6 +191,9 @@ fi
 
 AC_LIBTOOL_WIN32_DLL
 AM_PROG_LIBTOOL
+dnl when using libtool 2.x create libtool early, because it's used in configure
+m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
+
 
 # Make sure we use 64-bit versions of various file stuff.
 AC_SYS_LARGEFILE
@@ -299,6 +309,7 @@ AM_SANITY_CHECK
 # Checks for programs.
 AC_ISC_POSIX
 AM_PROG_CC_STDC
+AM_PROG_CC_C_O
 AC_PROG_INSTALL
 AC_PROG_MAKE_SET
 
@@ -375,6 +386,19 @@ PKG_CHECK_MODULES(BASE_DEPENDENCIES,
    pango >= pango_required_version dnl
    cairo >= cairo_required_version])
 
+## In addition to checking that cairo is present, we also need to
+## check that the correct cairo backend is there. E.g. if the GDK
+## target is win32 we need the cairo-win32 backend and so on.
+cairo_backend=$gdktarget
+
+# GDK calls the xlib backend "x11," cairo calls it "xlib." Other
+# backend names are identical.
+if test "x$cairo_backend" = "xx11"; then
+   cairo_backend=xlib
+fi
+PKG_CHECK_MODULES(CAIRO_BACKEND,
+  [cairo-$cairo_backend >= cairo_required_version])
+
 if test "$os_win32" != yes; then
     # libtool option to control which symbols are exported
     # right now, symbols starting with _ are not exported
@@ -398,7 +422,7 @@ AC_MSG_CHECKING([Whether to write dependencies into .pc files])
 case $enable_explicit_deps in
   auto)
     export SED
-    deplibs_check_method=`(./libtool --config; echo 'eval echo $deplibs_check_method') | sh`
+    deplibs_check_method=`(./libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
     if test "x$deplibs_check_method" '!=' xpass_all || test "x$enable_static" = xyes ; then
       enable_explicit_deps=yes  
     else
@@ -501,6 +525,26 @@ AC_OUTPUT_COMMANDS([case "$CONFIG_FILES" in *po-properties/Makefile.in*)
         sed -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
       esac])
 
+dnl Snippet below is copied from AM_GLIB_GNU_GETTEXT to generate a first
+dnl po-properties/POTFILES during configure; see GNOME #573515.
+dnl
+dnl Generate list of files to be processed by xgettext which will
+dnl be included in po-properties/Makefile.
+test -d po-properties || mkdir po-properties
+if test "x$srcdir" != "x."; then
+  if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+    popropsrcprefix="$srcdir/"
+  else
+    popropsrcprefix="../$srcdir/"
+  fi
+else
+  popropsrcprefix="../"
+fi
+rm -f po-properties/POTFILES
+sed -e "/^#/d" -e "/^\$/d" -e "s,.*,   $popropsrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+< $srcdir/po-properties/POTFILES.in > po-properties/POTFILES
+dnl (End of adapted AM_GLIB_GNU_GETTEXT snippet.)
+
 AM_GLIB_DEFINE_LOCALEDIR(GTK_LOCALEDIR)
 
 dnl The DU4 header files don't provide library prototypes unless 
@@ -538,6 +582,7 @@ case $host in
   ;;
 esac
 
+AC_SUBST(MATH_LIB)
 #
 # see bug 162979
 #
@@ -789,12 +834,13 @@ AC_ARG_WITH(libtiff,
             [AC_HELP_STRING([--without-libtiff],
                             [disable TIFF loader for gdk-pixbuf])])
 AC_ARG_WITH(libjasper,
-            [AC_HELP_STRING([--without-libjasper],
-                            [disable JPEG2000 loader for gdk-pixbuf])])
+            [AC_HELP_STRING([--with-libjasper],
+                            [enable JPEG2000 loader for gdk-pixbuf])])
 
 AC_ARG_ENABLE(gdiplus,
-            [AC_HELP_STRING([--disable-gdiplus-loaders],
-                            [disable GDI+ loaders for gdk-pixbuf])])
+            [AC_HELP_STRING([--enable-gdiplus],
+                            [enble GDI+ loaders for gdk-pixbuf (currently known to be broken)])],,
+           [enable_gdiplus=no])
 
 AM_CONDITIONAL(BUILD_GDIPLUS_LOADERS, [ test x$os_win32 = xyes && test x$enable_gdiplus != xno ])
 
@@ -904,11 +950,11 @@ dnl Test for libpng
   fi
 
 dnl Test for libjasper
-  if test x$with_libjasper != xno && test -z "$LIBJASPER"; then
+  if test x$with_libjasper = xyes && test -z "$LIBJASPER"; then
     AC_CHECK_LIB(jasper, jas_init, LIBJASPER=-ljasper, [], -ljpeg)
   fi
 
-  if test x$with_libjasper != xno && test -z "$LIBJASPER"; then
+  if test x$with_libjasper = xyes && test -z "$LIBJASPER"; then
      AC_MSG_ERROR([
 *** Checks for JPEG2000 loader failed. You can build without it by passing 
 *** --without-libjasper to configure])
@@ -947,7 +993,7 @@ fi
 # because some important apps like GIMP need to read and write
 # arbitrary tEXt chunks which doesn't seem to be possible through GDI+
 
-all_loaders="ani,icns,pcx,ras,tga,png,pnm,wbmp,xbm,xpm"
+all_loaders="ani,icns,pcx,ras,tga,png,pnm,wbmp,xbm,xpm,qtif"
 if test x$with_libjasper != xno; then
   all_loaders="$all_loaders,jasper"
 fi
@@ -1018,6 +1064,7 @@ AM_CONDITIONAL(INCLUDE_TGA, [test x"$INCLUDE_tga" = xyes])
 AM_CONDITIONAL(INCLUDE_PCX, [test x"$INCLUDE_pcx" = xyes])
 AM_CONDITIONAL(INCLUDE_ICNS, [test x"$INCLUDE_icns" = xyes])
 AM_CONDITIONAL(INCLUDE_JASPER, [test x"$INCLUDE_jasper" = xyes])
+AM_CONDITIONAL(INCLUDE_QTIF, [test x"$INCLUDE_qtif" = xyes])
 # As all GDI+ loaders are either built-in or not, arbitrarily just
 # check one of the variables here
 AM_CONDITIONAL(INCLUDE_GDIPLUS, [test x"$INCLUDE_gdip_ico" = xyes])
@@ -1160,8 +1207,11 @@ if $dynworks ; then
   if echo "$included_loaders" | egrep '(^|,)png($|,)' > /dev/null; then
     STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBPNG"
   fi
+  if echo "$included_loaders" | egrep '(^|,)jasper($|,)' > /dev/null; then
+    STATIC_LIB_DEPS="$STATIC_LIB_DEPS $LIBJASPER"
+  fi
 else
-  STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG"
+  STATIC_LIB_DEPS="$LIBTIFF $LIBJPEG $LIBPNG $LIBJASPER"
 fi
 
 # Checks to see whether we should include mediaLib
@@ -1278,7 +1328,6 @@ GDK_PIXBUF_XLIB_PACKAGES=
 GDK_PIXBUF_XLIB_EXTRA_CFLAGS=
 GDK_PIXBUF_XLIB_EXTRA_LIBS=
        
-X_PACKAGES=fontconfig
 GDK_EXTRA_LIBS="$GDK_WLIBS"
 GDK_EXTRA_CFLAGS=
        
@@ -1287,6 +1336,8 @@ GTK_DEP_PACKAGES_FOR_X=
 GTK_DEP_LIBS_FOR_X=
 
 if test "x$gdktarget" = "xx11"; then
+  X_PACKAGES=fontconfig
+
   #
   # We use fontconfig very peripherally when decoding the default
   # settings.
@@ -1398,9 +1449,8 @@ if test "x$gdktarget" = "xx11"; then
 
   # Check for shaped window extension
 
-  AC_CHECK_FUNC(XShapeCombineMask,
-      AC_DEFINE(HAVE_SHAPE_EXT, 1,
-                [Define to 1 if the XShape extension is available]))
+  AC_CHECK_FUNC(XShapeCombineMask, :,
+     [AC_MSG_ERROR([Shape extension not found, check your development headers])])
 
   # X SYNC check
   gtk_save_CFLAGS="$CFLAGS"
@@ -1466,54 +1516,55 @@ if test "x$gdktarget" = "xx11"; then
     gtk_save_cppflags="$CPPFLAGS"
     CPPFLAGS="$CPPFLAGS $x_cflags"
   
-    case "$host" in
-      *-*-solaris*)
-          # Check for solaris
-         AC_MSG_CHECKING(for Xinerama support on Solaris)
+    # Check for XFree
+    AC_MSG_CHECKING(for Xinerama support on XFree86)
          
-         have_solaris_xinerama=false
-         AC_CHECK_FUNC(XineramaGetInfo,
-             [AC_CHECK_HEADER(X11/extensions/xinerama.h,
-                 [have_solaris_xinerama=true], :,
-                 [#include <X11/Xlib.h>])])
-               
-          if $have_solaris_xinerama ; then
-            AC_DEFINE(HAVE_SOLARIS_XINERAMA, 1,
-                      [Define to 1 if solaris xinerama is available])
-           AC_DEFINE(HAVE_XINERAMA, 1,
-                      [Define to 1 if xinerama is available])
-            AC_MSG_RESULT(yes)
-          else
-            AC_MSG_RESULT(no)
-          fi
-          ;;
-      *)
-         # Check for XFree
-          AC_MSG_CHECKING(for Xinerama support on XFree86)
+    have_xfree_xinerama=false
+    if $PKG_CONFIG --exists xinerama ; then
+       have_xfree_xinerama=true
+       X_PACKAGES="$X_PACKAGES xinerama"
+    else    
+       AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
+          [AC_CHECK_HEADER(X11/extensions/Xinerama.h, 
+          [GTK_ADD_LIB(x_extra_libs,Xinerama)
+          have_xfree_xinerama=true], :,
+           [#include <X11/Xlib.h>])])
+    fi
+
+    if $have_xfree_xinerama ; then
+      AC_DEFINE(HAVE_XFREE_XINERAMA, 1,
+                [Define to 1 if XFree Xinerama is available])
+      AC_DEFINE(HAVE_XINERAMA, 1,
+                [Define to 1 is Xinerama is available])
+      AC_MSG_RESULT(yes)
+    else
+      AC_MSG_RESULT(no)
+
+      case "$host" in
+        *-*-solaris*)
+            # Check for solaris
+           AC_MSG_CHECKING(for Xinerama support on Solaris)
          
-          have_xfree_xinerama=false
-          if $PKG_CONFIG --exists xinerama ; then
-             have_xfree_xinerama=true
-             X_PACKAGES="$X_PACKAGES xinerama"
-          else    
-             AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
-                 [AC_CHECK_HEADER(X11/extensions/Xinerama.h, 
-                     [GTK_ADD_LIB(x_extra_libs,Xinerama)
-                     have_xfree_xinerama=true], :,
-                      [#include <X11/Xlib.h>])])
-          fi
-
-          if $have_xfree_xinerama ; then
-            AC_DEFINE(HAVE_XFREE_XINERAMA, 1,
-                      [Define to 1 if XFree Xinerama is available])
-           AC_DEFINE(HAVE_XINERAMA, 1,
-                      [Define to 1 is Xinerama is available])
-            AC_MSG_RESULT(yes)
-         else
-            AC_MSG_RESULT(no)
-         fi
-         ;;
-    esac
+           have_solaris_xinerama=false
+           AC_CHECK_FUNC(XineramaGetInfo,
+               [AC_CHECK_HEADER(X11/extensions/xinerama.h,
+                   [have_solaris_xinerama=true], :,
+                   [#include <X11/Xlib.h>])])
+               
+            if $have_solaris_xinerama ; then
+              AC_DEFINE(HAVE_SOLARIS_XINERAMA, 1,
+                        [Define to 1 if solaris xinerama is available])
+             AC_DEFINE(HAVE_XINERAMA, 1,
+                        [Define to 1 if xinerama is available])
+              AC_MSG_RESULT(yes)
+            else
+              AC_MSG_RESULT(no)
+            fi
+            ;;
+        *)
+            ;;
+      esac
+    fi
   fi
   
   # set up things for XInput
@@ -1535,7 +1586,7 @@ if test "x$gdktarget" = "xx11"; then
   AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree || test x$with_xinput = xyes)
 
   # Check for the RANDR extension
-  if $PKG_CONFIG --exists "xrandr >= 1.2" ; then
+  if $PKG_CONFIG --exists "xrandr >= 1.2.99" ; then
      AC_DEFINE(HAVE_RANDR, 1, [Have the Xrandr extension library])
 
      X_PACKAGES="$X_PACKAGES xrandr"
@@ -1587,6 +1638,8 @@ if test "x$gdktarget" = "xx11"; then
 
   AM_CONDITIONAL(USE_X11, true)
 else
+  XPACKAGES=
+
   AM_CONDITIONAL(XINPUT_XFREE, false)
   AM_CONDITIONAL(USE_X11, false)
   AM_CONDITIONAL(HAVE_X11R6, false)
@@ -1616,21 +1669,10 @@ AC_SUBST(GDK_PIXBUF_XLIB_DEP_LIBS)
 AC_SUBST(GDK_PIXBUF_XLIB_DEP_CFLAGS)
 
 if test "x$gdktarget" = "xdirectfb"; then
-  DIRECTFB_REQUIRED_VERSION=0.9.24
+  DIRECTFB_REQUIRED_VERSION=1.0.0
   AC_MSG_CHECKING(for DirectFB)
 
-  if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb && $PKG_CONFIG --exists cairo-directfb ; then
-      AC_MSG_RESULT(found)
-      GDK_EXTRA_CFLAGS="`$PKG_CONFIG --cflags cairo-directfb` $GDK_EXTRA_CFLAGS"
-      GDK_EXTRA_LIBS="`$PKG_CONFIG --libs cairo-directfb` $GDK_EXTRA_LIBS"
-  else
-      AC_MSG_ERROR([
-*** DirectFB $DIRECTFB_REQUIRED_VERSION or newer and the cairo backend 
-*** are required. The latest version of DirectFB is always available 
-*** from http://www.directfb.org/.
-  ])
-  fi
-
+  PKG_CHECK_MODULES(DIRECTFB, [directfb >= $DIRECTFB_REQUIRED_VERSION])
   AM_CONDITIONAL(USE_DIRECTFB, true)
 else
   AM_CONDITIONAL(USE_DIRECTFB, false)
@@ -1674,13 +1716,9 @@ fi
 CFLAGS="$saved_cflags"
 LDFLAGS="$saved_ldflags"
 
-GDK_PACKAGES="$PANGO_PACKAGES gio-2.0"
-if test "x$gdktarget" = "xx11"; then
-  GDK_PACKAGES="$GDK_PACKAGES $X_PACKAGES"
-fi
+GDK_PACKAGES="$PANGO_PACKAGES gio-2.0 $X_PACKAGES cairo-$cairo_backend"
 GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
 GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags  gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS"
-
 #
 # If we aren't writing explicit dependencies, then don't put the extra libraries we need
 # into the pkg-config files
@@ -1808,10 +1846,19 @@ AC_ARG_ENABLE(cups,
                               [disable cups print backend])],,
               [enable_cups=auto])
 
-if test "x$enable_cups" = "xauto"
-then
+if test "x$enable_cups" = "xno"; then
+  AM_CONDITIONAL(HAVE_CUPS, false)
+else
   AC_PATH_PROG(CUPS_CONFIG, cups-config, no)
-  if test "x$CUPS_CONFIG" != "xno"; then
+  if test "x$CUPS_CONFIG" = "xno"; then
+    if test "x$enable_cups" = "xauto"; then
+      AM_CONDITIONAL(HAVE_CUPS, false)
+    else
+      AC_MSG_ERROR([
+*** cups not found.
+])
+    fi
+  else
     CUPS_CFLAGS=`$CUPS_CONFIG --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'`
     CUPS_LIBS=`$CUPS_CONFIG --libs`
 
@@ -1831,31 +1878,55 @@ then
     AC_SUBST(CUPS_LIBS)
 
     AC_CHECK_HEADER(cups/cups.h,,AC_MSG_ERROR([[*** Sorry, cups-config present but cups/cups.h missing.]]))
-  fi
-  AM_CONDITIONAL(HAVE_CUPS, test "x$CUPS_CONFIG" != "xno")
 
-  gtk_save_cflags="$CFLAGS"
-  CFLAGS="$CUPS_CFLAGS"
-  AC_TRY_COMPILE([#include <cups/http.h>],
-                 [http_t http; char *s = http.authstring;],
-                 [AC_DEFINE(HAVE_HTTP_AUTHSTRING, [],
-                            [Define if cups http_t authstring field is accessible])],)
-  CFLAGS="$gtk_save_cflags"
+    AM_CONDITIONAL(HAVE_CUPS, true)
 
-  AC_SUBST(HAVE_HTTP_AUTHSTRING)
+    gtk_save_cflags="$CFLAGS"
+    CFLAGS="$CUPS_CFLAGS"
+    AC_TRY_COMPILE([#include <cups/http.h>],
+                   [http_t http; char *s = http.authstring;],
+                   [AC_DEFINE(HAVE_HTTP_AUTHSTRING, [],
+                              [Define if cups http_t authstring field is accessible])],)
+    CFLAGS="$gtk_save_cflags"
 
-  gtk_save_libs="$LIBS"
-  LIBS="$CUPS_LIBS"
-  AC_CHECK_FUNCS(httpGetAuthString)
-  LIBS="$gtk_save_libs"
+    AC_SUBST(HAVE_HTTP_AUTHSTRING)
+
+    gtk_save_libs="$LIBS"
+    LIBS="$CUPS_LIBS"
+    AC_CHECK_FUNCS(httpGetAuthString)
+    LIBS="$gtk_save_libs"
+  fi
+fi
+
+# Checks to see if we should compile with PAPI backend for GTK+
+#
+
+AC_ARG_ENABLE(papi,
+              [AC_HELP_STRING([--disable-papi]
+                              [disable papi print backend])],,
+             [enable_papi=auto])
 
+if test "x$enable_papi" = "xno"; then
+  AM_CONDITIONAL(HAVE_PAPI, false)
 else
-  AM_CONDITIONAL(HAVE_CUPS, false)
+  AC_MSG_CHECKING(libpapi)
+  AC_CHECK_LIB(papi, papiServiceCreate, have_papi=yes, have_papi=no)
+  if test $have_papi = yes; then
+    AC_DEFINE([HAVE_PAPI], [], [Define to 1 if libpapi available])
+  fi
+  AM_CONDITIONAL(HAVE_PAPI, test $have_papi = yes)
+  if test "x$enable_papi" = "xyes" -a "x$have_papi" = "xno"; then
+    AC_MSG_ERROR([
+*** papi not found.
+])
+  fi
 fi
 
+AM_CONDITIONAL(HAVE_PAPI_CUPS, test "x$have_papi" = "xyes" -a "x$CUPS_CONFIG" != "xno")
+
 gtk_save_cppflags="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS"
-                         
+CPPFLAGS="$CPPFLAGS $GTK_DEP_CFLAGS $GDK_DEP_CFLAGS"
+
 AC_CHECK_HEADER(cairo-pdf.h,,AC_MSG_ERROR([
 *** Can't find cairo-pdf.h. You must build Cairo with the pdf
 *** backend enabled.]))
@@ -1864,6 +1935,10 @@ if test "$os_win32" != "yes"; then
   AC_CHECK_HEADER(cairo-ps.h,,AC_MSG_ERROR([
 *** Can't find cairo-ps.h. You must build Cairo with the 
 *** postscript backend enabled.]))
+
+  AC_CHECK_HEADER(cairo-svg.h,,AC_MSG_ERROR([
+*** Can't find cairo-svg.h. You must build Cairo with the
+*** svg backend enabled.]))
 fi   
 
 CPPFLAGS="$gtk_save_cppflags"
@@ -1898,12 +1973,17 @@ if test -n "$export_dynamic"; then
   GTK_DEP_LIBS=`echo $GTK_DEP_LIBS | sed -e "s/$export_dynamic//"`
 fi
 
+##################################################
+# GObject introspection
+##################################################
+
+GOBJECT_INTROSPECTION_CHECK([0.6.7])
 
 ##################################################
 # Checks for gtk-doc and docbook-tools
 ##################################################
 
-GTK_DOC_CHECK([1.8])
+GTK_DOC_CHECK([1.11])
 
 AC_CHECK_PROG(DB2HTML, db2html, true, false)
 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
@@ -2081,6 +2161,7 @@ modules/printbackends/Makefile
 modules/printbackends/cups/Makefile
 modules/printbackends/lpr/Makefile
 modules/printbackends/file/Makefile
+modules/printbackends/papi/Makefile
 modules/printbackends/test/Makefile
 perf/Makefile
 contrib/Makefile