]> Pileus Git - ~andy/gtk/blobdiff - configure.in
Update version to 2.0.0
[~andy/gtk] / configure.in
index ec5a8ce06fa2435b5a27b016f3d3c3fc33a0fa9f..7e9b0601a110ee813823b1db1d042af6b0233ace 100644 (file)
@@ -12,11 +12,6 @@ AC_INIT(gdk/gdktypes.h)
 # foo_DEP_CFLAGS:   All cflags this module requires
 
 
-## We could have pkg-config uniquify the ldflags and cflags by calling
-## it once with both the GLib and Pango package names, but we don't,
-## someone should fix that.
-
-
 # Save this value here, since automake will set cflags later
 cflags_set=${CFLAGS+set}
 
@@ -32,13 +27,14 @@ GLIB_AC_DIVERT_BEFORE_HELP([
 # if backwards compatibility has been broken,
 # set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
 #
-GTK_MAJOR_VERSION=1
-GTK_MINOR_VERSION=3
-GTK_MICRO_VERSION=10
+GTK_MAJOR_VERSION=2
+GTK_MINOR_VERSION=0
+GTK_MICRO_VERSION=0
 GTK_INTERFACE_AGE=0
 GTK_BINARY_AGE=0
 GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
-dnl
+dnl This is the X.Y used in -lgtk-FOO-X.Y
+GTK_API_VERSION=2.0
 ])dnl
 
 AC_SUBST(GTK_MAJOR_VERSION)
@@ -46,6 +42,7 @@ AC_SUBST(GTK_MINOR_VERSION)
 AC_SUBST(GTK_MICRO_VERSION)
 AC_SUBST(GTK_INTERFACE_AGE)
 AC_SUBST(GTK_BINARY_AGE)
+AC_SUBST(GTK_API_VERSION)
 AC_SUBST(GTK_VERSION)
 
 # libtool versioning
@@ -80,9 +77,9 @@ AC_SUBST(GDK_PIXBUF_MICRO)
 AC_SUBST(GDK_PIXBUF_VERSION)
 
 ## Versions of dependencies
-GLIB_REQUIRED_VERSION=1.3.10
-PANGO_REQUIRED_VERSION=0.20
-ATK_REQUIRED_VERSION=0.5
+GLIB_REQUIRED_VERSION=2.0.0
+PANGO_REQUIRED_VERSION=1.0.0
+ATK_REQUIRED_VERSION=1.0.0
 
 # For automake.
 VERSION=$GTK_VERSION
@@ -103,6 +100,7 @@ AM_CONFIG_HEADER(config.h)
 
 dnl Initialize libtool
 AC_PROG_CC
+AM_DISABLE_STATIC
 AC_LIBTOOL_WIN32_DLL
 AM_PROG_LIBTOOL
 
@@ -192,8 +190,8 @@ case $gdktarget in
   *) AC_MSG_ERROR([Invalid target for GDK: use x11, linux-fb or win32.]);;
 esac
 
-gdktargetlib=libgdk-$gdktarget-1.3.la
-gtktargetlib=libgtk-$gdktarget-1.3.la
+gdktargetlib=libgdk-$gdktarget-$GTK_API_VERSION.la
+gtktargetlib=libgtk-$gdktarget-$GTK_API_VERSION.la
 
 AC_SUBST(gdktargetlib)
 AC_SUBST(gtktargetlib)
@@ -274,10 +272,37 @@ else
 fi
 AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
 
+dnl ******************************************************
+dnl * See whether to include shared library dependencies *
+dnl ******************************************************
+
+AC_ARG_ENABLE(explicit-deps, 
+              [  --enable-explicit-deps=[yes/no/auto]    use explicit dependencies in .pc files [default=auto]],
+              enable_explicit_deps="$enableval", 
+              enable_explicit_deps=auto)
+
+AC_MSG_CHECKING([Whether to write dependencies into .pc files])
+case $enable_explicit_deps in
+  auto)
+    deplib_check_method=`(./libtool --config; echo eval echo \\$deplib_check_method) | sh`
+    if test "X$deplib_check_method" == Xnone || test "x$enable_static" = xyes ; then
+      enable_explicit_deps=yes  
+    else
+      enable_explicit_deps=no  
+    fi
+  ;;
+  yes|no) 
+  ;;
+  *) AC_MSG_ERROR([Value given to --enable-explicit-deps must be one of yes, no or auto])
+  ;;
+esac
+AC_MSG_RESULT($enable_explicit_deps)
+
+AM_CONDITIONAL(DISABLE_EXPLICIT_DEPS, test $enable_explicit_deps = no)
+
 # define a MAINT-like variable REBUILD which is set if Perl
 # and awk are found, so autogenerated sources can be rebuilt
 
-AC_PROG_AWK
 AC_CHECK_PROGS(PERL, perl5 perl)
 
 # We would like indent, but don't require it.
@@ -286,8 +311,7 @@ AC_CHECK_PROG(INDENT, indent, indent)
 REBUILD=\#
 if test "x$enable_rebuilds" = "xyes" && \
      test -n "$PERL" && \
-     $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
-     test -n "$AWK" ; then
+     $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then
   REBUILD=
 fi
 AC_SUBST(REBUILD)
@@ -321,7 +345,7 @@ AC_SUBST(STRIP_BEGIN)
 AC_SUBST(STRIP_END)
 
 # i18n stuff
-ALL_LINGUAS="az ca cs da de el en_GB en@IPA es et eu fa fi fr ga gl he hr hu ia it ja ko lt nl nn no pl pt pt_BR ro ru sk sl sp sr sv tr uk vi wa zh_TW zh_CN"
+ALL_LINGUAS="az ca cs cy da de el en_GB en@IPA es et eu fa fi fr ga gl he hr hu ia it ja ko lt ms nl nn no pl pt pt_BR ro ru sk sl sp sr sv tr uk vi wa zh_TW zh_CN"
 AM_GLIB_GNU_GETTEXT
 LIBS="$LIBS $INTLLIBS"
 
@@ -390,7 +414,6 @@ AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :,
 *** GLIB is always available from ftp://ftp.gtk.org/.]),
   gobject gmodule gthread)
 
-AC_CHECK_HEADERS(dirent.h, AC_DEFINE(HAVE_DIRENT_H))
 AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
 AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
 AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
@@ -549,7 +572,7 @@ AC_SUBST(GDK_WLIBS)
 
 AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf)
 
-AC_ARG_ENABLE(modules, [  --disable-modules       Disables dynamic module loading],[
+AC_ARG_ENABLE(modules, [  --disable-modules       disable dynamic module loading],[
        if test x$withval = xyes; then 
            with_modules=yes
         else
@@ -574,7 +597,7 @@ fi
 dnl Now we check to see if our libtool supports shared lib deps
 dnl (in a rather ugly way even)
 if $dynworks; then
-   pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} libtool --config"
+   pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config"
    pixbuf_deplibs_check=`$pixbuf_libtool_config | \
       grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
       sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
@@ -592,8 +615,15 @@ else
    AC_MSG_RESULT(no)
 fi
 
+dnl We allow people to disable image loaders explicitely, but if they don't we error
+dnl out so that people don't accidentally build without them.
+
+AC_ARG_WITH(libpng,  [  --without-libpng         disable PNG loader for gdk-pixbuf])
+AC_ARG_WITH(libjpeg, [  --without-libjpeg        disable JPEG loader for gdk-pixbuf])
+AC_ARG_WITH(libtiff, [  --without-libtiff        disable TIFF loader for gdk-pixbuf])
+
 dnl Test for libtiff
-  if test -z "$LIBTIFF"; then
+  if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
     AC_CHECK_LIB(tiff, TIFFReadScanline,
       [AC_CHECK_HEADER(tiffio.h,
         TIFF='tiff'; LIBTIFF='-ltiff',
@@ -609,8 +639,15 @@ dnl Test for libtiff
         AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -ljpeg -lz -lm)], -ljpeg -lz -lm)], -lm)
   fi
 
+  if test x$with_libtiff != xno && test -z "$LIBTIFF"; then
+     AC_MSG_ERROR([
+*** Checks for TIFF loader failed. You can build without it by passing 
+*** --without-libtiff to configure but some programs using GTK+ may
+*** not work properly])
+  fi
+
 dnl Test for libjpeg
-  if test -z "$LIBJPEG"; then
+  if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
     AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
       jpeg_ok=yes,
       jpeg_ok=no
@@ -621,6 +658,7 @@ dnl Test for libjpeg
 [#include <stdio.h>
 #undef PACKAGE
 #undef VERSION
+#undef HAVE_STDLIB_H
 #include <jpeglib.h>],
         jpeg_ok=yes,
         jpeg_ok=no)
@@ -636,8 +674,15 @@ dnl Test for libjpeg
     fi
   fi
 
+  if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then
+     AC_MSG_ERROR([
+*** Checks for JPEG loader failed. You can build without it by passing 
+*** --without-libjpeg to configure but some programs using GTK+ may
+*** not work properly])
+  fi
+
 dnl Test for libpng
-  if test -z "$LIBPNG"; then
+  if test x$with_libpng != xno && test -z "$LIBPNG"; then
     AC_CHECK_LIB(png, png_read_info,
       [AC_CHECK_HEADER(png.h,
         png_ok=yes,
@@ -660,6 +705,14 @@ dnl Test for libpng
     fi
   fi
 
+  if test x$with_libpng != xno && test -z "$LIBPNG"; then
+     AC_MSG_ERROR([
+*** Checks for PNG loader failed. You can build without it by passing 
+*** --without-libpng to configure but many programs using GTK+ will
+*** not work properly. The PNG loader is also needed if you are compiling
+*** from CVS.])
+  fi
+
 AC_SUBST(LIBTIFF)
 AC_SUBST(LIBJPEG)
 AC_SUBST(LIBPNG)
@@ -671,7 +724,7 @@ AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
 #
 AC_MSG_CHECKING(pixbuf loaders to build)
 
-AC_ARG_WITH(included_loaders, [  --with-included-loaders=LOADER1,LOADER2,... Build the specified loaders into gdk-pixbuf (only used if module loading disabled)])
+AC_ARG_WITH(included_loaders, [  --with-included-loaders=LOADER1,LOADER2,...  build the specified loaders into gdk-pixbuf (only used if module loading disabled)])
 
 if $dynworks; then 
         :
@@ -711,7 +764,6 @@ IFS="$gtk_save_ifs"
 AC_SUBST(INCLUDED_LOADER_OBJ)
 AC_SUBST(INCLUDED_LOADER_DEFINE)
 
-AC_HEADER_DIRENT
 AC_HEADER_SYS_WAIT
 
 AC_TYPE_SIGNAL
@@ -796,14 +848,59 @@ AC_SUBST(GDK_PIXBUF_DEP_CFLAGS)
 GDK_EXTRA_LIBS=$GDK_WLIBS
 GDK_EXTRA_CFLAGS= 
 
+FREETYPE_LIBS=
+FREETYPE_CFLAGS=
+if test "x$gdktarget" = "xlinux-fb" || test "x$gdktarget" = "x11" ; then
+  #
+  # Checks for FreeType
+  #
+  have_freetype=false
+  AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
+  if test "x$FREETYPE_CONFIG" != "xno" ; then
+    FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
+    FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
+
+    AC_CHECK_LIB(freetype, FT_New_Face, have_freetype=true
+                ,:,$FREETYPE_LIBS)
+
+    if $have_freetype ; then
+      gtk_save_cppflags="$CPPFLAGS"
+      CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
+
+      AC_MSG_CHECKING([For sufficiently new FreeType (at least 2.0.1)])
+      AC_TRY_COMPILE([
+#include <freetype/freetype.h>
+#include FT_ERRORS_H
+    ],
+                    [(void)1;],:,have_freetype=yes)
+      if test x$have_freetype = xyes ; then
+        AC_MSG_RESULT(yes)
+      else
+        AC_MSG_RESULT(no)
+      fi
+
+      CPPFLAGS="$gtk_save_cppflags"
+    fi
+  fi
+  AC_SUBST(FREETYPE_LIBS)
+  AC_SUBST(FREETYPE_CFLAGS)
+fi
+
 if test "x$gdktarget" = "xx11"; then
   # We start off with the libraries from Pango
 
+  if $PKG_CONFIG --exists pangox ; then : ; else
+    AC_MSG_ERROR([pangox Pango backend is required for x11 target])
+  fi
+    
   ## be sure we also have Pango built with xft support
   if $PKG_CONFIG --exists pangoxft ; then
     PANGO_PACKAGES="pangox pangoxft"
     have_xft=true
     AC_DEFINE(HAVE_XFT)
+    if x$have_freetype != xyes ; then
+      AC_MSG_ERROR([pangoxft Pango backend found but did not find freetype libraries])
+    fi
   else
     PANGO_PACKAGES="pangox"
     have_xft=false
@@ -811,10 +908,57 @@ if test "x$gdktarget" = "xx11"; then
 
   AM_CONDITIONAL(HAVE_XFT, $have_xft)
 
+  #
+  # If Pango included the shared library dependencies from X11 in
+  # the pkg-config output, then we use that (to avoid duplicates).
+  # but if they were omitted to avoid binary compatibility problems
+  # then we need to repeat the checks.
+  #
   x_libs="`$PKG_CONFIG --libs $PANGO_PACKAGES`"
+  case x_libs in
+    *-lX11*) pango_omitted_x_deps=no ;;
+    *)       pango_omitted_x_deps=yes ;;
+  esac
+
   x_cflags="`$PKG_CONFIG --cflags $PANGO_PACKAGES`"
   x_extra_libs=
 
+  if test $pango_omitted_x_deps = yes ; then
+    AC_PATH_XTRA
+
+    if test x$no_x = xyes ; then
+      AC_MSG_ERROR([X development libraries not found])
+    fi
+
+    x_libs="$X_LIBS -lX11 $X_EXTRA_LIBS"
+
+    #
+    # Checks for Xft/XRender
+    #
+    XFT_LIBS=""
+    XFT_CFLAGS=""
+    if test $have_xft = true ; then
+      gtk_save_cppflags="$CPPFLAGS"
+      CPPFLAGS="$CPPFLAGS $x_cflags"
+      have_xft=false
+
+      AC_CHECK_LIB(Xrender, XRenderFindFormat, 
+        [AC_CHECK_LIB(Xft, XftFontOpen,
+          [AC_CHECK_HEADER(X11/Xft/XftFreetype.h,
+            have_xft=true,:)],
+         :,-lXrender -lXext $x_libs $FREETYPE_LIBS)]
+      ,:,-lXext $x_libs)
+
+      CPPFLAGS="$gtk_save_cppflags"
+
+      if $have_xft ; then
+        x_libs="$X_LIBS -lXft -lXrender -lXext -lX11 $FREETYPE_LIBS $X_EXTRA_LIBS"
+      else
+        AC_MSG_ERROR([pangoxft Pango backend found, but Xft not found])
+      fi
+    fi
+  fi           
+
   ## Strip the .la files
  
   x_libs_for_checks=""
@@ -960,7 +1104,11 @@ if test "x$gdktarget" = "xx11"; then
   fi
 
   GDK_EXTRA_CFLAGS=
-  GDK_EXTRA_LIBS="$x_extra_libs"
+  if test $pango_omitted_x_deps = yes ; then
+    GDK_EXTRA_LIBS="$x_extra_libs $x_libs $GDK_EXTRA_LIBS"
+  else
+    GDK_EXTRA_LIBS="$x_extra_libs $GDK_EXTRA_LIBS"
+  fi
 
   AM_CONDITIONAL(USE_X11, true)
 else
@@ -997,13 +1145,16 @@ AC_SUBST(GDK_PIXBUF_XLIB_DEP_LIBS)
 AC_SUBST(GDK_PIXBUF_XLIB_DEP_CFLAGS)
 
 if test "x$gdktarget" = "xlinux-fb"; then
-  AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
-  if test x$FREETYPE_CONFIG = xno ; then
-    AC_MSG_ERROR([*** freetype-config not found])
+  if test x$have_freetype != xyes ; then
+    AC_MSG_ERROR([Using linux-fb backend but freetype was not found])
   fi
 
-  FREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
-  FREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
+  ft2_libs="`$PKG_CONFIG --libs pangoft2`"
+  case ft2_libs in
+    *-lfreetype*) pango_omitted_ft2_deps=no ;;
+    *)            pango_omitted_ft2_deps=yes ;;
+  esac
+
   CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
 
   if test x$enable_shadowfb = xyes ; then
@@ -1017,8 +1168,10 @@ if test "x$gdktarget" = "xlinux-fb"; then
     AM_CONDITIONAL(ENABLE_FB_MANAGER, false)
   fi
   
-  GDK_EXTRA_CFLAGS="$FREETYPE_CFLAGS"
-  GDK_EXTRA_LIBS="$FREETYPE_LIBS $GDK_EXTRA_LIBS"
+  GDK_EXTRA_CFLAGS=""
+  if test $pango_omitted_ft2_deps = yes ; then
+    GDK_EXTRA_LIBS="$FREETYPE_LIBS $GDK_EXTRA_LIBS"
+  fi
 
   AM_CONDITIONAL(USE_LINUX_FB, true)
 else
@@ -1078,6 +1231,14 @@ GDK_PACKAGES=$PANGO_PACKAGES
 GDK_DEP_LIBS="$GDK_EXTRA_LIBS `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $GDK_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS"
 GDK_DEP_CFLAGS="`$PKG_CONFIG --cflags $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
+#
+if test $enable_explicit_deps != yes ; then
+  GDK_EXTRA_LIBS=
+fi
+
 AC_SUBST(GDK_PACKAGES)
 AC_SUBST(GDK_EXTRA_LIBS)
 AC_SUBST(GDK_EXTRA_CFLAGS)
@@ -1106,7 +1267,7 @@ fi
 if $PKG_CONFIG --uninstalled $ATK_PACKAGES; then
         :
 else
-        AC_CHECK_LIB(atk, atk_object_get_type, : , AC_MSG_ERROR([
+        AC_CHECK_LIB(atk-1.0, atk_object_get_type, : , AC_MSG_ERROR([
                 *** Cannot link to Accessibility Toolkit. Accessibility Toolkit is required
                 *** to build GTK+]), $ATK_LIBS $GLIB_LIBS)
 fi
@@ -1143,7 +1304,7 @@ AC_SUBST(HTML_DIR)
 
 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
 
-gtk_doc_min_version=0.6
+gtk_doc_min_version=0.9
 if $GTKDOC ; then 
     gtk_doc_version=`gtkdoc-mkdb --version`
     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
@@ -1161,13 +1322,11 @@ fi
 AC_CHECK_PROG(DB2HTML, db2html, true, false)
 AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
 
-dnl Let people disable the gtk-doc stuff.
-AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc        Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
+dnl Make people enable the gtk-doc stuff explicitely.
+AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc        use gtk-doc to build documentation [default=no]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
 
-if test x$enable_gtk_doc = xauto ; then
-  if test x$GTKDOC = xtrue ; then
-    enable_gtk_doc=yes
-  else
+if test x$enable_gtk_doc = xyes ; then
+  if test x$GTKDOC != xtrue ; then
     enable_gtk_doc=no 
   fi
 fi
@@ -1268,7 +1427,7 @@ fi
 ])
 
 AC_PATH_PROG(SGML2HTML, sgml2html, no)
-AM_CONDITIONAL(HAVE_SGML2HTML, ! test x$SGML2HTML = xno)
+AM_CONDITIONAL(HAVE_SGML2HTML, test x$SGML2HTML != xno)
 
 AC_OUTPUT([
 config.h.win32
@@ -1298,6 +1457,7 @@ docs/faq/Makefile
 docs/tutorial/Makefile
 gdk-pixbuf/Makefile
 gdk-pixbuf/makefile.mingw
+gdk-pixbuf/gdk_pixbuf.rc
 gdk-pixbuf/gdk-pixbuf-features.h
 gdk-pixbuf/pixops/Makefile
 gdk-pixbuf/pixops/makefile.mingw
@@ -1315,6 +1475,7 @@ gtk/makefile.msc
 gtk/gtkversion.h
 gtk/gtk-win32.rc
 gtk/stock-icons/Makefile
+gtk/theme-bits/Makefile
 modules/Makefile
 modules/input/Makefile
 contrib/Makefile