Changeset 142284 in webkit


Ignore:
Timestamp:
Feb 8, 2013 8:15:18 AM (11 years ago)
Author:
Martin Robinson
Message:

[GTK] Split configure.ac into reusable portions
https://bugs.webkit.org/show_bug.cgi?id=109246

Reviewed by Philippe Normand.

Split up configure.ac into sections based on different "phases"
of configuration. This should make it easier to find what you are
looking for as well as creating a "right" place to put things.
A nice side effect of this is that we can share the different
modules with a gyp build.

  • Source/autotools/CheckSystemAndBasicDependencies.m4: Added.
  • Source/autotools/FindDependencies.m4: Added.
  • Source/autotools/PrintBuildConfiguration.m4: Added.
  • Source/autotools/ReadCommandLineArguments.m4: Added.
  • Source/autotools/SetupAutoconfHeader.m4: Added.
  • Source/autotools/SetupAutomake.m4: Added.
  • Source/autotools/SetupCompilerFlags.m4: Added.
  • Source/autotools/SetupLibtool.m4: Added.
  • Source/autotools/Versions.m4: Added.
  • configure.ac:
Location:
trunk
Files:
9 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r142207 r142284  
     12013-02-07  Martin Robinson  <mrobinson@igalia.com>
     2
     3        [GTK] Split configure.ac into reusable portions
     4        https://bugs.webkit.org/show_bug.cgi?id=109246
     5
     6        Reviewed by Philippe Normand.
     7
     8        Split up configure.ac into sections based on different "phases"
     9        of configuration. This should make it easier to find what you are
     10        looking for as well as creating a "right" place to put things.
     11        A nice side effect of this is that we can share the different
     12        modules with a gyp build.
     13
     14        * Source/autotools/CheckSystemAndBasicDependencies.m4: Added.
     15        * Source/autotools/FindDependencies.m4: Added.
     16        * Source/autotools/PrintBuildConfiguration.m4: Added.
     17        * Source/autotools/ReadCommandLineArguments.m4: Added.
     18        * Source/autotools/SetupAutoconfHeader.m4: Added.
     19        * Source/autotools/SetupAutomake.m4: Added.
     20        * Source/autotools/SetupCompilerFlags.m4: Added.
     21        * Source/autotools/SetupLibtool.m4: Added.
     22        * Source/autotools/Versions.m4: Added.
     23        * configure.ac:
     24
    1252013-02-07  David Farler  <dfarler@apple.com>
    226
  • trunk/configure.ac

    r142179 r142284  
    11AC_PREREQ(2.60)
    22
    3 m4_define([webkit_major_version], [1])
    4 m4_define([webkit_minor_version], [11])
    5 m4_define([webkit_micro_version], [5])
    6 
    7 # This is the version we'll be using as part of our User-Agent string,
    8 # e.g., AppleWebKit/$(webkit_user_agent_version) ...
    9 #
    10 # Sourced from Source/WebCore/Configurations/Version.xcconfig
    11 m4_define([webkit_user_agent_major_version], [537])
    12 m4_define([webkit_user_agent_minor_version], [30])
     3m4_include([Source/autotools/Versions.m4])
    134
    145AC_INIT([WebKitGTK],[webkit_major_version.webkit_minor_version.webkit_micro_version],[http://bugs.webkit.org/])
    15 
    166AC_CONFIG_MACRO_DIR([Source/autotools])
    177AC_CONFIG_AUX_DIR([Source/autotools])
    188AC_SUBST(ACLOCAL_AMFLAGS, "-I Source/autotools")
    19 
    209AC_CONFIG_HEADERS([autotoolsconfig.h])
    21 AC_CANONICAL_HOST
     10AC_CONFIG_SRCDIR([Source/WebCore/config.h])
    2211
    2312WEBKIT_MAJOR_VERSION=webkit_major_version
     
    3221AC_SUBST(WEBKIT_USER_AGENT_MINOR_VERSION)
    3322
    34 AC_CONFIG_SRCDIR([Source/WebCore/config.h])
     23m4_include([Source/autotools/CheckSystemAndBasicDependencies.m4])
     24m4_include([Source/autotools/SetupLibtool.m4])
     25m4_include([Source/autotools/ReadCommandLineArguments.m4])
     26m4_include([Source/autotools/FindDependencies.m4])
     27m4_include([Source/autotools/SetupCompilerFlags.m4])
     28m4_include([Source/autotools/SetupAutoconfHeader.m4])
    3529
    36 # Libtool library version, not to confuse with API version.
    37 # See http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
    38 LIBWEBKITGTK_VERSION=18:1:18
    39 AC_SUBST([LIBWEBKITGTK_VERSION])
     30# We would put AM_INIT_AUTOMAKE into SetupAutomake.m4, but seems to cause autoconf errors.
     31AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz no-dist-gzip tar-ustar])
     32m4_include([Source/autotools/SetupAutomake.m4])
    4033
    41 LIBJAVASCRIPTCOREGTK_VERSION=13:8:13
    42 AC_SUBST([LIBJAVASCRIPTCOREGTK_VERSION])
    43 
    44 LIBWEBKIT2GTK_VERSION=21:0:21
    45 AC_SUBST([LIBWEBKIT2GTK_VERSION])
    46 
    47 AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz no-dist-gzip tar-ustar])
    48 
    49 # Use AM_SILENT_RULES if present.
    50 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
    51 
    52 # Host checking - inspired by the GTK+ configure.in
    53 # TODO: move these to webkit.m4?
    54 AC_MSG_CHECKING([for native Win32])
    55 case "$host" in
    56     *-*-mingw*)
    57         os_win32=yes
    58         ;;
    59     *)
    60         os_win32=no
    61         ;;
    62 esac
    63 AC_MSG_RESULT([$os_win32])
    64 case "$host" in
    65     *-*-linux*)
    66         os_linux=yes
    67         ;;
    68     *-*-freebsd*)
    69         os_freebsd=yes
    70         ;;
    71     *-*-darwin*)
    72         os_darwin=yes
    73         ;;
    74 esac
    75 
    76 case "$host_os" in
    77     gnu* | linux* | k*bsd*-gnu)
    78         os_gnu=yes
    79         ;;
    80     *)
    81         os_gnu=no
    82         ;;
    83 esac
    84 
    85 # If CFLAGS and CXXFLAGS are unset, default to empty.
    86 # This is to tell automake not to include '-g' if C{XX,}FLAGS is not set.
    87 # For more info - http://www.gnu.org/software/automake/manual/autoconf.html#C_002b_002b-Compiler
    88 if test -z "$CXXFLAGS"; then
    89     CXXFLAGS=""
    90 fi
    91 if test -z "$CFLAGS"; then
    92     CFLAGS=""
    93 fi
    94 
    95 PKG_PROG_PKG_CONFIG
    96 
    97 AC_PATH_PROG(PERL, perl)
    98 if test -z "$PERL"; then
    99     AC_MSG_ERROR([You need 'perl' to compile WebKit])
    100 fi
    101 
    102 AC_PATH_PROG(PYTHON, python)
    103 if test -z "$PYTHON"; then
    104     AC_MSG_ERROR([You need 'python' to compile WebKit])
    105 fi
    106 
    107 AC_PATH_PROG(RUBY, ruby)
    108 if test -z "$RUBY"; then
    109     AC_MSG_ERROR([You need 'ruby' to compile WebKit])
    110 fi
    111 
    112 AC_PATH_PROG(BISON, bison)
    113 if test -z "$BISON"; then
    114     AC_MSG_ERROR([You need the 'bison' parser generator to compile WebKit])
    115 fi
    116 
    117 AC_PATH_PROG(MV, mv)
    118 if test -z "$MV"; then
    119     AC_MSG_ERROR([You need 'mv' to compile WebKit])
    120 fi
    121 
    122 AC_PROG_CC
    123 AC_PROG_CXX
    124 AM_PROG_CC_C_O
    125 AC_PROG_INSTALL
    126 AC_SYS_LARGEFILE
    127 
    128 if test -z "$AR_FLAGS"; then
    129     AR_FLAGS="cruT"
    130 fi
    131 
    132 # Check whether a C++ was found (AC_PROG_CXX sets $CXX to "g++" even when it doesn't exist).
    133 AC_LANG_PUSH([C++])
    134 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[],[AC_MSG_ERROR([No C++ compiler found])])
    135 AC_LANG_POP([C++])
    136 
    137 # C/C++ Language Features
    138 AC_C_CONST
    139 AC_C_INLINE
    140 AC_C_VOLATILE
    141 
    142 # C/C++ Headers
    143 AC_HEADER_STDC
    144 AC_HEADER_STDBOOL
    145 
    146 # Linker
    147 AC_DISABLE_STATIC
    148 AC_LIBTOOL_WIN32_DLL
    149 AC_PROG_LIBTOOL
    150 
    151 # Use dolt to speedup the build.
    152 DOLT
    153 
    154 AC_PATH_PROG(FLEX, flex)
    155 if test -z "$FLEX"; then
    156     AC_MSG_ERROR([You need the 'flex' lexer generator to compile WebKit])
    157 else
    158     FLEX_VERSION=`$FLEX --version | sed 's,.*\ \([0-9]*\.[0-9]*\.[0-9]*\)$,\1,'`
    159     AX_COMPARE_VERSION([2.5.33],[gt],[$FLEX_VERSION],
    160         AC_MSG_WARN([You need at least version 2.5.33 of the 'flex' lexer generator to compile WebKit correctly]))
    161 fi
    162 
    163 AC_PATH_PROG(GPERF, gperf)
    164 if test -z "$GPERF"; then
    165     AC_MSG_ERROR([You need the 'gperf' hash function generator to compile WebKit])
    166 fi
    167 
    168 # Check for -fvisibility=hidden compiler support (GCC >= 4).
    169 saved_CFLAGS="$CFLAGS"
    170 CFLAGS="$CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
    171 AC_MSG_CHECKING([if ${CXX} supports -fvisibility=hidden -fvisibility-inlines-hidden])
    172 AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], [AC_MSG_RESULT([yes])
    173     SYMBOL_VISIBILITY="-fvisibility=hidden" SYMBOL_VISIBILITY_INLINES="-fvisibility-inlines-hidden"], [AC_MSG_RESULT([no])])
    174 CFLAGS="$saved_CFLAGS"
    175 AC_SUBST(SYMBOL_VISIBILITY)
    176 AC_SUBST(SYMBOL_VISIBILITY_INLINES)
    177 
    178 # Disable C++0x compat warnings for GCC >= 4.6.0 until we build cleanly with that.
    179 AC_LANG_PUSH(C++)
    180 TMPCXXFLAGS=$CXXFLAGS
    181 CXXFLAGS="-Wall -Werror"
    182 AC_MSG_CHECKING([if we have to disable C++0x compat warnings for GCC >= 4.6.0])
    183 AC_TRY_COMPILE([
    184 namespace std {
    185     class nullptr_t { };
    186 }
    187 extern std::nullptr_t nullptr;
    188 ], [return 0;], disable_cxx0x_compat=no, disable_cxx0x_compat=yes)
    189 AC_MSG_RESULT($disable_cxx0x_compat)
    190 if test "$disable_cxx0x_compat" = yes; then
    191     CXXFLAGS="$TMPCXXFLAGS -Wno-c++0x-compat"
    192 else
    193     CXXFLAGS="$TMPCXXFLAGS"
    194 fi
    195 AC_LANG_POP(C++)
    196 
    197 # Check for libjpeg the way Gtk does it.
    198 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, jpeg_ok=yes, jpeg_ok=no AC_MSG_ERROR([JPEG library (libjpeg) not found]))
    199 if test "$jpeg_ok" = yes; then
    200     AC_MSG_CHECKING([for jpeglib])
    201     AC_TRY_CPP([
    202 #include <stdio.h>
    203 #undef PACKAGE
    204 #undef VERSION
    205 #undef HAVE_STDLIB_H
    206 #include <jpeglib.h>
    207 ], jpeg_ok=yes, jpeg_ok=no)
    208     AC_MSG_RESULT($jpeg_ok)
    209     if test "$jpeg_ok" = yes; then
    210         JPEG_LIBS="-ljpeg"
    211         # Should we check for progressive JPEG like GTK+ as well?
    212     else
    213         AC_MSG_ERROR([JPEG library (libjpeg) not found])
    214     fi
    215 fi
    216 AC_SUBST([JPEG_LIBS])
    217 
    218 # Check for libpng the way Gtk+ does it.
    219 for l in libpng libpng14 libpng12; do
    220     AC_MSG_CHECKING(for $l)
    221     if $PKG_CONFIG --exists $l ; then
    222         AC_MSG_RESULT(yes)
    223         PNG_LIBS=`$PKG_CONFIG --libs $l`
    224         png_ok=yes
    225         break
    226     else
    227         AC_MSG_RESULT(no)
    228         png_ok=no
    229     fi
    230 done
    231 if test "$png_ok" != yes; then
    232     AC_CHECK_LIB(png, png_read_info, [AC_CHECK_HEADER(png.h, png_ok=yes, png_ok=no)],
    233         AC_MSG_ERROR([PNG library (libpng) not found]), -lz -lm)
    234    if test "$png_ok" = yes; then
    235         AC_MSG_CHECKING([for png_structp in png.h])
    236         AC_TRY_COMPILE([
    237 #include <png.h>
    238 ], [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;], png_ok=yes, png_ok=no)
    239         AC_MSG_RESULT($png_ok)
    240         if test "$png_ok" = yes; then
    241             PNG_LIBS='-lpng -lz'
    242         else
    243             AC_MSG_ERROR([PNG library (libpng) not found])
    244         fi
    245     else
    246         AC_MSG_ERROR([PNG library (libpng) not found])
    247     fi
    248 fi
    249 AC_SUBST([PNG_LIBS])
    250 
    251 # Check for WebP Image support.
    252 AC_CHECK_HEADERS([webp/decode.h], [WEBP_LIBS='-lwebp'], [AC_MSG_ERROR([WebP library (libwebp) not found])])
    253 AC_SUBST([WEBP_LIBS])
    254 
    255 if test "$os_win32" = "yes"; then
    256     WINMM_LIBS=-lwinmm
    257     SHLWAPI_LIBS=-lshlwapi
    258     OLE32_LIBS=-lole32
    259 fi
    260 AC_SUBST([WINMM_LIBS])
    261 AC_SUBST([SHLWAPI_LIBS])
    262 AC_SUBST([OLE32_LIBS])
    263 
    264 # Check whether dlopen() is in the core libc like on FreeBSD, or in a separate
    265 # libdl like on GNU/Linux (in which case we want to link to libdl).
    266 AC_CHECK_FUNC([dlopen], [], [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
    267 AC_SUBST([DLOPEN_LIBS])
    268 
    269 # Determine the GTK+ version to use.
    270 AC_MSG_CHECKING([the GTK+ version to use])
    271 AC_ARG_WITH([gtk], [AS_HELP_STRING([--with-gtk=2.0|3.0], [the GTK+ version to use (default: 3.0)])],
    272         [case "$with_gtk" in
    273             2.0|3.0) ;;
    274             *) AC_MSG_ERROR([invalid GTK+ version specified]) ;;
    275         esac], [with_gtk=3.0])
    276 AC_MSG_RESULT([$with_gtk])
    277 
    278 GTK2_REQUIRED_VERSION=2.10
    279 GAIL2_REQUIRED_VERSION=1.8
    280 GTK3_REQUIRED_VERSION=3.4.0
    281 GAIL3_REQUIRED_VERSION=3.0
    282 
    283 case "$with_gtk" in
    284     2.0) GTK_REQUIRED_VERSION=$GTK2_REQUIRED_VERSION
    285         GTK_API_VERSION=2.0
    286         WEBKITGTK_API_MAJOR_VERSION=1
    287         WEBKITGTK_API_MINOR_VERSION=0
    288         WEBKITGTK_API_VERSION=1.0
    289         WEBKITGTK_PC_NAME=webkit
    290         GAIL_PC_NAME=gail
    291         GAIL_REQUIRED_VERSION=$GAIL2_REQUIRED_VERSION
    292         ;;
    293     3.0) GTK_REQUIRED_VERSION=$GTK3_REQUIRED_VERSION
    294         GTK_API_VERSION=3.0
    295         WEBKITGTK_API_MAJOR_VERSION=3
    296         WEBKITGTK_API_MINOR_VERSION=0
    297         WEBKITGTK_API_VERSION=3.0
    298         WEBKITGTK_PC_NAME=webkitgtk
    299         GAIL_PC_NAME=gail-3.0
    300         GAIL_REQUIRED_VERSION=$GAIL3_REQUIRED_VERSION
    301         ;;
    302 esac
    303 
    304 AC_SUBST([WEBKITGTK_API_MAJOR_VERSION])
    305 AC_SUBST([WEBKITGTK_API_MINOR_VERSION])
    306 AC_SUBST([WEBKITGTK_API_VERSION])
    307 AC_SUBST([WEBKITGTK_PC_NAME])
    308 AC_SUBST([GTK_API_VERSION])
    309 AM_CONDITIONAL([GTK_API_VERSION_2],[test "$GTK_API_VERSION" = "2.0"])
    310 
    311 # Determine the GDK/GTK+ target.
    312 AC_MSG_CHECKING([the target windowing system])
    313 AC_ARG_WITH(target, AC_HELP_STRING([--with-target=@<:@x11/win32/quartz/directfb@:>@], [Select webkit target [default=x11]]),
    314     [],[with_target="x11"])
    315 
    316 case "$with_target" in
    317     x11|win32|quartz|directfb) ;;
    318     *) AC_MSG_ERROR([Invalid target: must be x11, quartz, win32, or directfb.]) ;;
    319 esac
    320 
    321 AC_MSG_RESULT([$with_target])
    322 
    323 # Minimum base dependencies.
    324 CAIRO_REQUIRED_VERSION=1.10
    325 FONTCONFIG_REQUIRED_VERSION=2.4
    326 FREETYPE2_REQUIRED_VERSION=9.0
    327 GLIB_REQUIRED_VERSION=2.32.0
    328 LIBSOUP_REQUIRED_VERSION=2.40.0
    329 LIBXML_REQUIRED_VERSION=2.6
    330 PANGO_REQUIRED_VERSION=1.21.0
    331 
    332 # Optional modules.
    333 LIBXSLT_REQUIRED_VERSION=1.1.7
    334 SQLITE_REQUIRED_VERSION=3.0
    335 ENCHANT_REQUIRED_VERSION=0.22
    336 CLUTTER_REQUIRED_VERSION=1.12
    337 CLUTTER_GTK_REQUIRED_VERSION=1.0.2
    338 ATSPI2_REQUIRED_VERSION=2.2.1
    339 
    340 # Check for glib and required utilities.
    341 AM_PATH_GLIB_2_0($GLIB_REQUIRED_VERSION, :, :, gmodule gobject gthread gio)
    342 if test -z "$GLIB_GENMARSHAL" || test -z "$GLIB_MKENUMS"; then
    343     AC_MSG_ERROR([You need the GLib dev tools in your path])
    344 fi
    345 
    346 # GResources
    347 GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
    348 AC_SUBST(GLIB_COMPILE_RESOURCES)
    349 
    350 GLIB_GSETTINGS
    351 
    352 # Check and identify which unicode backend to use.
    353 AC_MSG_CHECKING([which Unicode backend to use])
    354 AC_ARG_WITH(unicode_backend,
    355     AC_HELP_STRING([--with-unicode-backend=@<:@icu/glib@:>@],
    356         [Select Unicode backend (WARNING: the glib-based backend is slow, and incomplete) [default=icu]]),
    357     [],[with_unicode_backend="icu"])
    358 
    359 case "$with_unicode_backend" in
    360     icu|glib) ;;
    361     *) AC_MSG_ERROR([Invalid Unicode backend: must be icu or glib.]) ;;
    362 esac
    363 
    364 AC_MSG_RESULT([$with_unicode_backend])
    365 
    366 if test "$with_unicode_backend" = "icu"; then
    367     # TODO: use pkg-config (after CFLAGS in their .pc files are cleaned up).
    368     case "$host" in
    369         *-*-darwin*)
    370             UNICODE_CFLAGS="-I$srcdir/Source/JavaScriptCore/icu -I$srcdir/Source/WebCore/icu"
    371             UNICODE_LIBS="-licucore"
    372             ;;
    373         *-*-mingw*)
    374             UNICODE_CFLAGS=""
    375             UNICODE_LIBS="-licui18n -licuuc"
    376             ;;
    377         *)
    378             AC_PATH_PROG(icu_config, icu-config, no)
    379             if test "$icu_config" = "no"; then
    380                 AC_MSG_ERROR([Cannot find icu-config. The ICU library is needed.])
    381             fi
    382 
    383             # We don't use --cflags as this gives us a lot of things that we don't necessarily want,
    384             # like debugging and optimization flags. See man (1) icu-config for more info.
    385             UNICODE_CFLAGS=`$icu_config --cppflags`
    386             UNICODE_LIBS=`$icu_config --ldflags-libsonly`
    387             ;;
    388     esac
    389 fi
    390 
    391 if test "$with_unicode_backend" = "glib"; then
    392     PKG_CHECK_MODULES([UNICODE], [glib-2.0 pango >= $PANGO_REQUIRED_VERSION])
    393 fi
    394 
    395 AC_SUBST([UNICODE_CFLAGS])
    396 AC_SUBST([UNICODE_LIBS])
    397 
    398 PKG_CHECK_MODULES([ZLIB], [zlib])
    399 AC_SUBST([ZLIB_CFLAGS])
    400 AC_SUBST([ZLIB_LIBS])
    401 
    402 GETTEXT_PACKAGE=$PACKAGE-$GTK_API_VERSION
    403 AC_SUBST(GETTEXT_PACKAGE)
    404 
    405 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED_VERSION)
    406 AC_SUBST(LIBXML_CFLAGS)
    407 AC_SUBST(LIBXML_LIBS)
    408 
    409 PKG_CHECK_MODULES(PANGO, [pango >= $PANGO_REQUIRED_VERSION pangoft2])
    410 AC_SUBST(PANGO_CFLAGS)
    411 AC_SUBST(PANGO_LIBS)
    412 
    413 AC_MSG_CHECKING([whether to enable spellcheck support])
    414 AC_ARG_ENABLE([spellcheck], [AS_HELP_STRING([--enable-spellcheck],[enable support for spellcheck])],
    415     [], [enable_spellcheck="yes"])
    416 AC_MSG_RESULT([$enable_spellcheck])
    417 
    418 if test "$enable_spellcheck" = "yes"; then
    419     PKG_CHECK_MODULES(ENCHANT, enchant >= $ENCHANT_REQUIRED_VERSION, [], [enable_spellcheck="no"])
    420     AC_SUBST(ENCHANT_CFLAGS)
    421     AC_SUBST(ENCHANT_LIBS)
    422 fi
    423 
    424 PKG_CHECK_MODULES(GAIL, $GAIL_PC_NAME >= $GAIL_REQUIRED_VERSION)
    425 AC_SUBST(GAIL_CFLAGS)
    426 AC_SUBST(GAIL_LIBS)
    427 
    428 # Check for target-specific dependencies.
    429 if test "$with_target" = "directfb"; then
    430     PKG_CHECK_MODULES(CAIRO, cairo-directfb >= $CAIRO_REQUIRED_VERSION)
    431     PKG_CHECK_MODULES(GTK, gtk+-directfb-2.0 >= $GTK_REQUIRED_VERSION)
    432 else
    433     PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_REQUIRED_VERSION)
    434     PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED_VERSION)
    435 
    436     if test "$with_target" = "x11" && test "$os_win32" = "no"; then
    437         PKG_CHECK_MODULES([XT], [xt], [xt_has_pkg_config=yes], [xt_has_pkg_config=no])
    438 
    439         # Some old versions of Xt do not provide xt.pc, so try to link against Xt
    440         # and if it's installed fall back to just adding -lXt.
    441         if test "$xt_has_pkg_config" = "no"; then
    442             # Using AC_CHECK_LIB instead of AC_SEARCH_LIB is fine in this case as we don't care
    443             # about the XtOpenDisplay symbol but only about the existence of libXt.
    444             AC_CHECK_LIB([Xt], [XtOpenDisplay], [XT_CFLAGS=""; XT_LIBS="-lXt"],
    445                 [AC_MSG_ERROR([X Toolkit Intrinsics library (libXt) not found])])
    446         fi
    447 
    448         AC_SUBST([XT_CFLAGS])
    449         AC_SUBST([XT_LIBS])
    450    fi
    451 fi
    452 AC_SUBST(GTK_CFLAGS)
    453 AC_SUBST(GTK_LIBS)
    454 AC_SUBST(CAIRO_CFLAGS)
    455 AC_SUBST(CAIRO_LIBS)
    456 
    457 # Check whether to build with debugging enabled.
    458 AC_MSG_CHECKING([whether to do a debug build])
    459 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [turn on debugging [default=no]]), [],[enable_debug="no"])
    460 AC_MSG_RESULT([$enable_debug])
    461 
    462 # Check whether to enable optimized builds.
    463 AC_MSG_CHECKING([whether to enable optimized builds])
    464 AC_ARG_ENABLE(optimizations, AC_HELP_STRING([--enable-optimizations], [turn on optimize builds (GCC only) [default=yes]]),
    465     [enable_optimizations=$enableval],
    466     [if test "$enable_debug" = "yes"; then enable_optimizations="no"; else enable_optimizations="yes"; fi])
    467 AC_MSG_RESULT([$enable_optimizations])
    468 
    469 found_opengl=no
    470 AC_ARG_ENABLE(glx, AC_HELP_STRING([--enable-glx], [enable support for GLX [default=auto]]), [], [enable_glx="auto"])
    471 AC_ARG_ENABLE(egl, AC_HELP_STRING([--enable-egl], [enable support for EGL [default=auto]]), [], [enable_egl="auto"])
    472 AC_ARG_ENABLE(gles2, AC_HELP_STRING([--enable-gles2], [enable support for OpenGL ES 2 [default=auto]]), [], [enable_gles2="auto"])
    473 
    474 have_glx=no
    475 AC_CHECK_HEADERS([GL/glx.h], [have_glx="yes"], [have_glx="no"])
    476 AC_MSG_CHECKING([whether to enable GLX support])
    477 if test "$enable_glx" != "no"; then
    478     if test "$have_glx" = "no"; then
    479         if test "$enable_glx" = "yes"; then
    480             AC_MSG_ERROR([--enable-glx specified, but not available])
    481         else
    482             enable_glx=no
    483         fi
    484     elif test "$enable_gles2" != "yes"; then
    485         enable_glx=yes
    486     fi
    487 fi
    488 AC_MSG_RESULT([$enable_glx])
    489 
    490 have_egl=no
    491 AC_CHECK_HEADERS([EGL/egl.h], [have_egl="yes"], [have_egl="no"])
    492 AC_MSG_CHECKING([whether to enable EGL support])
    493 if test "$enable_egl" != "no"; then
    494     if test "$have_egl" = "no"; then
    495         if test "$enable_egl" = "yes"; then
    496             AC_MSG_ERROR([--enable-egl specified, but not available])
    497         else
    498             enable_egl=no
    499         fi
    500     else
    501         enable_egl=yes
    502     fi
    503 fi
    504 AC_MSG_RESULT([$enable_egl])
    505 
    506 have_gles2=no
    507 AC_CHECK_HEADERS([GLES2/gl2.h], [have_gles2="yes"], [have_gles2="no"])
    508 AC_MSG_CHECKING([whether to use OpenGL ES 2 support])
    509 if test "$enable_glx" = "yes"; then
    510     if test "$enable_gles2" = "yes"; then
    511         AC_MSG_ERROR([Cannot enable OpenGL ES 2 support with GLX])
    512     else
    513         enable_gles2=no
    514     fi
    515 fi
    516 if test "$enable_egl" = "no"; then
    517     if test "$enable_gles2" = "yes"; then
    518         AC_MSG_ERROR([Cannot enable OpenGL ES 2 support without EGL])
    519     else
    520         enable_gles2=no
    521     fi
    522 fi
    523 if test "$enable_gles2" != "no"; then
    524     if test "$have_gles2" = "no"; then
    525         if test "$enable_gles2" = "yes"; then
    526             AC_MSG_ERROR([--enable-gles2 specified, but not available])
    527         else
    528             enable_gles2=no
    529         fi
    530    else
    531         enable_gles2=yes
    532         found_opengl=yes
    533    fi
    534 fi
    535 AC_MSG_RESULT([$enable_gles2])
    536 
    537 if test "$enable_gles2" != "yes"; then
    538     AC_CHECK_HEADERS([GL/gl.h], [found_opengl="yes"], [])
    539 fi
    540 
    541 AC_MSG_CHECKING([which GPU acceleration backend to use])
    542 AC_ARG_WITH(acceleration_backend,
    543     AC_HELP_STRING([--with-acceleration-backend=@<:@opengl/clutter/none@:>@],
    544         [Select accelerated backend (Clutter currently unsupported, OpenGL autodetected) [default=autodetect]]), [],
    545     [
    546         if test "$found_opengl" = "yes"; then
    547             with_acceleration_backend="opengl";
    548         else
    549             with_acceleration_backend="none";
    550         fi
    551     ])
    552 AC_MSG_RESULT([$with_acceleration_backend])
    553 
    554 if test "$with_acceleration_backend" = "opengl"; then
    555     PKG_CHECK_MODULES([XCOMPOSITE], [xcomposite]);
    556     PKG_CHECK_MODULES([XDAMAGE], [xdamage]);
    557     AC_SUBST(XCOMPOSITE_CFLAGS)
    558     AC_SUBST(XCOMPOSITE_LIBS)
    559     AC_SUBST(XDAMAGE_CFLAGS)
    560     AC_SUBST(XDAMAGE_LIBS)
    561 fi
    562 
    563 # OpenGL is turned on by default (along with WebGL and accelerated compositing), but if Clutter is chosen
    564 # as the accelerated drawing backend, we want to disable it. COGL does not play well with OpenGL.
    565 AC_MSG_CHECKING([whether to enable WebGL support])
    566 AC_ARG_ENABLE(webgl, AC_HELP_STRING([--enable-webgl], [enable support for WebGL [default=check]]), [],
    567     [
    568         if test "$with_acceleration_backend" = "opengl"; then
    569             enable_webgl="yes";
    570         else
    571             enable_webgl="no";
    572         fi
    573     ])
    574 AC_MSG_RESULT([$enable_webgl])
    575 if test "$enable_webgl" = "yes" && test "$with_acceleration_backend" != "opengl"; then
    576     AC_MSG_ERROR([OpenGL must be active (and Clutter disabled) to use WebGL.])
    577 fi;
    578 
    579 AC_MSG_CHECKING([whether to enable accelerated compositing support])
    580 AC_ARG_ENABLE(accelerated_compositing,
    581     AC_HELP_STRING([--enable-accelerated-compositing], [enable support for accelerated compositing [default=check]]),
    582     [
    583         if test "$enableval" = "yes" && test "$with_acceleration_backend" = "none"; then
    584             AC_MSG_ERROR([OpenGL or Clutter must be active to use accelerated compositing.])
    585         fi
    586         enable_accelerated_compositing=$enableval;
    587     ],
    588     [
    589         if test "$with_acceleration_backend" != "none"; then
    590             enable_accelerated_compositing="yes";
    591         else
    592             enable_accelerated_compositing="no";
    593         fi
    594     ])
    595 AC_MSG_RESULT([$enable_accelerated_compositing])
    596 
    597 # Check whether to enable Gamepad support.
    598 AC_MSG_CHECKING([whether to enable Gamepad support])
    599 AC_ARG_ENABLE(gamepad, AC_HELP_STRING([--enable-gamepad], [enable Gamepad support [default=no]]), [],[enable_gamepad="no"])
    600 AC_MSG_RESULT([$enable_gamepad])
    601 
    602 if test "$enable_gamepad" = "yes" && test "$os_linux" = no; then
    603     AC_MSG_WARN([Gamepad support is only available on Linux. Disabling Gamepad support.])
    604     enable_gamepad=no;
    605 fi
    606 
    607 # Check whether to enable HTML5 audio/video support.
    608 AC_MSG_CHECKING([whether to enable HTML5 video support])
    609 AC_ARG_ENABLE(video, AC_HELP_STRING([--enable-video], [enable HTML5 video support [default=yes]]), [],[enable_video="yes"])
    610 AC_MSG_RESULT([$enable_video])
    611 
    612 # Check whether to enable media stream support.
    613 AC_MSG_CHECKING([whether to enable media stream support])
    614 AC_ARG_ENABLE(media_stream, AC_HELP_STRING([--enable-media-stream], [enable media stream support (incomplete) [default=no]]),
    615     [],[enable_media_stream="no"])
    616 AC_MSG_RESULT([$enable_media_stream])
    617 
    618 # Check whether to enable XSLT support.
    619 AC_MSG_CHECKING([whether to enable XSLT support])
    620 AC_ARG_ENABLE(xslt, AC_HELP_STRING([--enable-xslt], [enable support for XSLT [default=yes]]), [],[enable_xslt="yes"])
    621 AC_MSG_RESULT([$enable_xslt])
    622 
    623 # Check whether to enable geolocation support.
    624 AC_MSG_CHECKING([whether to enable geolocation support])
    625 AC_ARG_ENABLE(geolocation, AC_HELP_STRING([--enable-geolocation], [enable support for geolocation [default=yes]]),
    626     [], [enable_geolocation="yes"])
    627 AC_MSG_RESULT([$enable_geolocation])
    628 
    629 # Check whether to enable SVG support.
    630 AC_MSG_CHECKING([whether to enable SVG support])
    631 AC_ARG_ENABLE(svg, AC_HELP_STRING([--enable-svg], [enable support for SVG [default=yes]]),
    632     [], [enable_svg="yes"])
    633 AC_MSG_RESULT([$enable_svg])
    634 
    635 # Turn off svg features if --disable-svg is requested.
    636 if test "$enable_svg" = "no"; then
    637    enable_svg_fonts=no
    638 fi
    639 
    640 # Check whether to enable support for SVG fonts.
    641 AC_MSG_CHECKING([whether to enable support for SVG fonts])
    642 AC_ARG_ENABLE(svg_fonts, AC_HELP_STRING([--enable-svg-fonts], [enable support for SVG fonts (experimental) [default=yes]]),
    643     [], [enable_svg_fonts="yes"])
    644 AC_MSG_RESULT([$enable_svg_fonts])
    645 
    646 # Check for SVG features, enabling SVG if necessary.
    647 if test "$enable_svg_fonts" = "yes" && test "$enable_svg" = "no"; then
    648     AC_MSG_WARN([SVG feature(s) requested but SVG is disabled.. Enabling SVG support])
    649     enable_svg=yes
    650 fi
    651 
    652 # Check whether to enable Web Audio support.
    653 AC_MSG_CHECKING([whether to enable Web Audio support])
    654 AC_ARG_ENABLE(web_audio, AC_HELP_STRING([--enable-web-audio], [enable support for Web Audio [default=no]]),
    655     [], [enable_web_audio="no"])
    656 AC_MSG_RESULT([$enable_web_audio])
    657 
    658 # Check whether to enable code coverage.
    659 AC_MSG_CHECKING([whether to enable code coverage support])
    660 AC_ARG_ENABLE(coverage, AC_HELP_STRING([--enable-coverage], [enable code coverage support [default=no]]),
    661     [], [enable_coverage="no"])
    662 AC_MSG_RESULT([$enable_coverage])
    663 
    664 # Check whether to enable FastMalloc.
    665 AC_MSG_CHECKING([whether to enable optimized memory allocator])
    666 AC_ARG_ENABLE(fast_malloc, AC_HELP_STRING([--enable-fast-malloc],
    667                             [enable optimized memory allocator default=yes, default=no for debug builds]),
    668     [], [if test "$enable_debug" = "yes"; then enable_fast_malloc="no"; else enable_fast_malloc="yes"; fi])
    669 AC_MSG_RESULT([$enable_fast_malloc])
    670 
    671 # Check whether to enable debug symbols.
    672 AC_MSG_CHECKING([whether to enable debug symbols])
    673 AC_ARG_ENABLE(debug_symbols,
    674     AC_HELP_STRING([--enable-debug-symbols=yes|no|min|full], [enable debug symbols default=no, default=yes for debug builds]),
    675     [], [if test "$enable_debug" = "yes"; then enable_debug_symbols="yes"; else enable_debug_symbols="no"; fi])
    676 
    677 case "$enable_debug_symbols" in
    678     yes) enable_debug_symbols="full" ;;
    679     no|min|full) ;;
    680     *) AC_MSG_ERROR([Invalid debug symbols option: must be yes, no, min or full.]) ;;
    681 esac
    682 AC_MSG_RESULT([$enable_debug_symbols])
    683 
    684 # Selecting GStreamer version.
    685 AC_MSG_CHECKING([the GStreamer version to use])
    686 AC_ARG_WITH([gstreamer],
    687     AS_HELP_STRING([--with-gstreamer=1.0|0.10|auto],
    688         [the GStreamer version to use (default: auto, tries 1.0 first, 0.10 is fallback)]),
    689     [
    690         case "$with_gstreamer" in
    691             0.10|1.0|auto) ;;
    692             *) AC_MSG_ERROR([invalid GStreamer version specified]) ;;
    693         esac
    694     ], [with_gstreamer=auto])
    695 AC_MSG_RESULT([$with_gstreamer])
    696 
    697 GSTREAMER_0_10_REQUIRED_VERSION=0.10
    698 GSTREAMER_0_10_PLUGINS_BASE_REQUIRED_VERSION=0.10.30
    699 GSTREAMER_1_0_REQUIRED_VERSION=1.0.3
    700 GSTREAMER_1_0_PLUGINS_BASE_REQUIRED_VERSION=1.0.3
    701 
    702 if test "$enable_video" = "yes" || test "$enable_web_audio" = "yes"; then
    703     if test "$with_gstreamer" = "auto"; then
    704         gstreamer_modules="gstreamer-1.0 >= $GSTREAMER_1_0_REQUIRED_VERSION gstreamer-app-1.0 gstreamer-audio-1.0
    705             gstreamer-fft-1.0 gstreamer-base-1.0 gstreamer-pbutils-1.0
    706             gstreamer-plugins-base-1.0 >= $GSTREAMER_1_0_PLUGINS_BASE_REQUIRED_VERSION gstreamer-video-1.0";
    707         PKG_CHECK_MODULES([GSTREAMER_1_0], [$gstreamer_modules], [with_gstreamer=1.0], [with_gstreamer=0.10])
    708         AC_MSG_NOTICE([Selected GStreamer $with_gstreamer])
    709     fi
    710 else
    711     if test "$with_gstreamer" != "auto"; then
    712         AC_MSG_WARN([You have specified GStreamer $with_gstreamer version but it will not be used
    713             because neither HTML5 Video nor Web Audio are enabled])
    714     fi
    715 fi
    716 
    717 case "$with_gstreamer" in
    718     0.10) GSTREAMER_REQUIRED_VERSION=$GSTREAMER_0_10_REQUIRED_VERSION
    719         GSTREAMER_PLUGINS_BASE_REQUIRED_VERSION=$GSTREAMER_0_10_PLUGINS_BASE_REQUIRED_VERSION
    720         GST_API_VERSION=0.10
    721         ;;
    722     1.0) GSTREAMER_REQUIRED_VERSION=$GSTREAMER_1_0_REQUIRED_VERSION
    723         GSTREAMER_PLUGINS_BASE_REQUIRED_VERSION=$GSTREAMER_1_0_PLUGINS_BASE_REQUIRED_VERSION
    724         GST_API_VERSION=1.0
    725         ;;
    726 esac
    727 
    728 AC_SUBST([GST_API_VERSION])
    729 
    730 # Check whether to enable debug features.
    731 AC_MSG_CHECKING([whether to enable debug features])
    732 AC_ARG_ENABLE(debug_features,
    733     AC_HELP_STRING([--enable-debug-features], [enable debug features default=no, default=yes for debug builds]),
    734     [],[if test "$enable_debug" = "yes"; then enable_debug_features="yes"; else enable_debug_features="no"; fi])
    735 AC_MSG_RESULT([$enable_debug_features])
    736 
    737 AC_MSG_CHECKING([whether to enable JIT compilation])
    738 AC_ARG_ENABLE(jit, AS_HELP_STRING([--enable-jit], [Enable JIT compilation (default: autodetect)]))
    739 case "$enable_jit" in
    740     yes) JSC_CPPFLAGS="-DENABLE_JIT=1" ;;
    741     no) JSC_CPPFLAGS="-DENABLE_JIT=0" ;;
    742     *) enable_jit="autodetect" ;;
    743 esac
    744 AC_SUBST(JSC_CPPFLAGS)
    745 AC_MSG_RESULT([$enable_jit])
    746 
    747 # Opcode stats.
    748 AC_MSG_CHECKING([whether to enable opcode stats])
    749 AC_ARG_ENABLE([opcode-stats], AS_HELP_STRING([--enable-opcode-stats], [Enable Opcode statistics (default: disabled)]),
    750     [], [enable_opcode_stats=no])
    751 AC_MSG_RESULT([$enable_opcode_stats])
    752 
    753 if test "$enable_opcode_stats" = "yes"; then
    754     if test "$enable_jit" = "yes"; then
    755         AC_MSG_ERROR([JIT must be disabled for Opcode stats to work.])
    756     fi
    757 fi
    758 
    759 # GObject Introspection.
    760 AC_MSG_CHECKING([whether to enable GObject introspection support])
    761 AC_ARG_ENABLE([introspection], AS_HELP_STRING([--enable-introspection],[Enable GObject introspection (default: disabled)]),
    762     [],[enable_introspection=no])
    763 AC_MSG_RESULT([$enable_introspection])
    764 
    765 # Enable CSS Filters and Shaders if accelerated_compositing is turned on.
    766 enable_css_filters=no;
    767 enable_css_shaders=no;
    768 AC_MSG_CHECKING([whether to enable CSS Filters and Shaders])
    769 if test "$enable_accelerated_compositing" = "yes" && test "$with_acceleration_backend" = "opengl"; then
    770     enable_css_filters=yes;
    771     enable_css_shaders=yes;
    772 fi
    773 AC_MSG_RESULT([$enable_css_filters])
    774 
    775 G_IR_SCANNER=
    776 G_IR_COMPILER=
    777 G_IR_GENERATE=
    778 GIRDIR=
    779 GIRTYPELIBDIR=
    780 
    781 if test "$enable_introspection" = "yes"; then
    782     GOBJECT_INTROSPECTION_REQUIRED=0.9.5
    783     PKG_CHECK_MODULES([INTROSPECTION],[gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED])
    784 
    785     G_IR_SCANNER="$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)"
    786     G_IR_COMPILER="$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)"
    787     G_IR_GENERATE="$($PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0)"
    788 fi
    789 
    790 AC_SUBST([G_IR_SCANNER])
    791 AC_SUBST([G_IR_COMPILER])
    792 AC_SUBST([G_IR_GENERATE])
    793 
    794 if test "$host_cpu" = "sh4"; then
    795     CXXFLAGS="$CXXFLAGS -mieee -w"
    796     CFLAGS="$CFLAGS -mieee -w"
    797 fi
    798 
    799 # Add '-g' flag to gcc to build with debug symbols.
    800 if test "$enable_debug_symbols" = "min"; then
    801     CXXFLAGS="$CXXFLAGS -g1"
    802     CFLAGS="$CFLAGS -g1"
    803 elif test "$enable_debug_symbols" != "no"; then
    804     CXXFLAGS="$CXXFLAGS -g"
    805     CFLAGS="$CFLAGS -g"
    806 fi
    807 
    808 # Add the appropriate 'O' level for optimized builds.
    809 if test "$enable_optimizations" = "yes"; then
    810     CXXFLAGS="$CXXFLAGS -O2"
    811     CFLAGS="$CFLAGS -O2"
    812 else
    813     CXXFLAGS="$CXXFLAGS -O0"
    814     CFLAGS="$CFLAGS -O0"
    815 fi
    816 
    817 PKG_CHECK_MODULES([LIBSOUP], [libsoup-2.4 >= $LIBSOUP_REQUIRED_VERSION])
    818 AC_SUBST([LIBSOUP_CFLAGS])
    819 AC_SUBST([LIBSOUP_LIBS])
    820 
    821 PKG_CHECK_MODULES([LIBSECRET], [libsecret-1])
    822 AC_SUBST([LIBSECRET_CFLAGS])
    823 AC_SUBST([LIBSECRET_LIBS])
    824 
    825 # Check if FreeType/FontConfig are available.
    826 if test "$with_target" = "directfb"; then
    827     PKG_CHECK_MODULES([FREETYPE],
    828         [fontconfig >= $FONTCONFIG_REQUIRED_VERSION freetype2 >= $FREETYPE2_REQUIRED_VERSION harfbuzz])
    829 else
    830     PKG_CHECK_MODULES([FREETYPE],
    831         [cairo-ft fontconfig >= $FONTCONFIG_REQUIRED_VERSION freetype2 >= $FREETYPE2_REQUIRED_VERSION harfbuzz])
    832 fi
    833 AC_SUBST([FREETYPE_CFLAGS])
    834 AC_SUBST([FREETYPE_LIBS])
    835 
    836 # Check if SQLite3 is available. Error out only if one of the features hard-depending
    837 # on it is enabled while SQLite3 is unavailable.
    838 PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= $SQLITE_REQUIRED_VERSION], [sqlite3_has_pkg_config=yes], [sqlite3_has_pkg_config=no])
    839 if test "$sqlite3_has_pkg_config" = "no"; then
    840     AC_SEARCH_LIBS([sqlite3_open16], [sqlite3],
    841         [sqlite3_found=yes; SQLITE3_LIBS="$LIBS"; SQLITE3_CFLAGS="-I $srcdir/WebKitLibraries/WebCoreSQLite3"], [sqlite3_found=no])
    842 fi
    843 AC_SUBST([SQLITE3_CFLAGS])
    844 AC_SUBST([SQLITE3_LIBS])
    845 
    846 if (test "$sqlite3_found" = "no"); then
    847     AC_MSG_ERROR([SQLite3 is required for the Database related features])
    848 fi
    849 
    850 # Check if libxslt is available.
    851 if test "$enable_xslt" = "yes"; then
    852     PKG_CHECK_MODULES([LIBXSLT],[libxslt >= $LIBXSLT_REQUIRED_VERSION])
    853     AC_SUBST([LIBXSLT_CFLAGS])
    854     AC_SUBST([LIBXSLT_LIBS])
    855 fi
    856 
    857 # Check if geoclue is available.
    858 if test "$enable_geolocation" = "yes"; then
    859     PKG_CHECK_MODULES([GEOCLUE], [geoclue])
    860     AC_SUBST([GEOCLUE_CFLAGS])
    861     AC_SUBST([GEOCLUE_LIBS])
    862 fi
    863 
    864 # Check for XRender under Linux/Unix. Some linkers require explicit linkage (like GNU Gold),
    865 # so we cannot rely on GTK+ pulling XRender.
    866 if test "$os_win32" = "no"; then
    867     PKG_CHECK_MODULES([XRENDER], [xrender])
    868     AC_SUBST([XRENDER_CFLAGS])
    869     AC_SUBST([XRENDER_LIBS])
    870 fi
    871 
    872 # Check if Gstreamer is available.
    873 if test "$enable_video" = "yes" || test "$enable_web_audio" = "yes"; then
    874     gstreamer_modules="gstreamer-$GST_API_VERSION >= $GSTREAMER_REQUIRED_VERSION gstreamer-app-$GST_API_VERSION
    875         gstreamer-audio-$GST_API_VERSION gstreamer-fft-$GST_API_VERSION gstreamer-base-$GST_API_VERSION
    876         gstreamer-pbutils-$GST_API_VERSION gstreamer-plugins-base-$GST_API_VERSION >= $GSTREAMER_PLUGINS_BASE_REQUIRED_VERSION
    877         gstreamer-video-$GST_API_VERSION";
    878     if test "$GST_API_VERSION" != "1.0"; then
    879         gstreamer_modules="$gstreamer_modules gstreamer-interfaces-$GST_API_VERSION";
    880     fi
    881     PKG_CHECK_MODULES([GSTREAMER], [$gstreamer_modules], [have_gstreamer=yes])
    882     AC_SUBST([GSTREAMER_CFLAGS])
    883     AC_SUBST([GSTREAMER_LIBS])
    884 fi
    885 
    886 acceleration_backend_description=$with_acceleration_backend
    887 if test "$with_acceleration_backend" = "clutter"; then
    888     PKG_CHECK_MODULES(CLUTTER, clutter-1.0 >= $CLUTTER_REQUIRED_VERSION)
    889     PKG_CHECK_MODULES([CLUTTER_GTK], [clutter-gtk-1.0 >= $CLUTTER_GTK_REQUIRED_VERSION])
    890 
    891     AC_SUBST(CLUTTER_CFLAGS)
    892     AC_SUBST(CLUTTER_LIBS)
    893     AC_SUBST(CLUTTER_GTK_CFLAGS)
    894     AC_SUBST(CLUTTER_GTK_LIBS)
    895 
    896     enable_gles2=no
    897     enable_glx=no
    898     enable_egl=no
    899 fi
    900 
    901 if test "$with_acceleration_backend" = "opengl"; then
    902     if test "$enable_gles2" = "yes"; then
    903         acceleration_backend_description+= "(gles2"
    904         OPENGL_LIBS="-lGLESv2"
    905     else
    906         acceleration_backend_description+="(gl"
    907         OPENGL_LIBS="-lGL"
    908     fi
    909     if test "$enable_egl" = "yes"; then
    910         acceleration_backend_description+=", egl"
    911         OPENGL_LIBS+=" -lEGL"
    912     fi
    913     if test "$enable_glx" = "yes"; then
    914         acceleration_backend_description+=", glx"
    915     fi
    916     OPENGL_LIBS+=" $DLOPEN_LIBS"
    917     acceleration_backend_description+=")"
    918 fi
    919 AC_SUBST([OPENGL_LIBS])
    920 
    921 if test "$enable_gamepad" = "yes"; then
    922     PKG_CHECK_MODULES([GAMEPAD], [gio-unix-2.0 gudev-1.0])
    923 
    924     AC_SUBST(GAMEPAD_CFLAGS)
    925     AC_SUBST(GAMEPAD_LIBS)
    926 fi
    927 
    928 # Check whether to enable code coverage support.
    929 if test "$enable_coverage" = "yes"; then
    930     COVERAGE_CFLAGS="-MD"
    931     COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
    932     AC_SUBST([COVERAGE_CFLAGS])
    933     AC_SUBST([COVERAGE_LDFLAGS])
    934 fi
    935 
    936 # WebKit1
    937 AC_MSG_CHECKING([whether to build WebKit1])
    938 AC_ARG_ENABLE(webkit1, AC_HELP_STRING([--enable-webkit1], [build WebKit1 [default=yes]]), [], [enable_webkit1="yes"])
    939 AC_MSG_RESULT([$enable_webkit1])
    940 
    941 # WebKit2
    942 # If you change the default here, please also make sure the assumptions made
    943 # in Tools/Scripts/webkitdirs.pm:buildAutotoolsProject still make sense.
    944 AC_MSG_CHECKING([whether to build WebKit2])
    945 AC_ARG_ENABLE(webkit2, AC_HELP_STRING([--enable-webkit2], [build WebKit2 [default=yes]]), [], [enable_webkit2="yes"])
    946 AC_MSG_RESULT([$enable_webkit2])
    947 if test "$enable_webkit2" = "yes"; then
    948     if test "$GTK_API_VERSION" = "2.0"; then
    949         AC_MSG_ERROR([WebKit2 requires GTK+ 3.x, use --with-gtk=3.0])
    950     fi
    951 
    952     # Make sure we have GTK+ 2.x to build the plugin process.
    953     PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= $GTK2_REQUIRED_VERSION gail >= $GAIL2_REQUIRED_VERSION)
    954     AC_SUBST(GTK2_CFLAGS)
    955     AC_SUBST(GTK2_LIBS)
    956 
    957     # Check Unix printing
    958     PKG_CHECK_MODULES(GTK_UNIX_PRINTING, gtk+-unix-print-3.0, [have_gtk_unix_printing=yes], [have_gtk_unix_printing=no])
    959     AC_SUBST(GTK_UNIX_PRINTING_CFLAGS)
    960     AC_SUBST(GTK_UNIX_PRINTING_LIBS)
    961 
    962     # On some Linux/Unix platforms, shm_* may only be available if linking
    963     # against librt
    964     if test "$os_win32" = "no"; then
    965         AC_SEARCH_LIBS([shm_open], [rt], [SHM_LIBS="-lrt"])
    966         AC_SUBST(SHM_LIBS)
    967     fi
    968 fi
    969 
    970 GTK_DOC_CHECK([1.10])
    971 
    972 # We need atspi2 for Webkit2 unit tests
    973 if test "$enable_webkit2" = "yes"; then
    974    PKG_CHECK_MODULES([ATSPI2], [atspi-2 >= $ATSPI2_REQUIRED_VERSION], [have_atspi2=yes], [have_atspi2=no])
    975    AC_SUBST([ATSPI2_CFLAGS])
    976    AC_SUBST([ATSPI2_LIBS])
    977 fi
    978 
    979 # For the moment we need to check whether or not indexed database is enabled because it determines if we build leveldb or not.
    980 AM_WEBKIT_FEATURE_CONDITIONAL([ENABLE_INDEXED_DATABASE])
    981 
    982 # OS conditionals.
    983 AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
    984 AM_CONDITIONAL([OS_UNIX],[test "$os_win32" = "no"])
    985 AM_CONDITIONAL([OS_LINUX],[test "$os_linux" = "yes"])
    986 AM_CONDITIONAL([OS_GNU],[test "$os_gnu" = "yes"])
    987 AM_CONDITIONAL([OS_FREEBSD],[test "$os_freebsd" = "yes"])
    988 
    989 # Target conditionals.
    990 AM_CONDITIONAL([TARGET_X11], [test "$with_target" = "x11"])
    991 AM_CONDITIONAL([TARGET_WIN32], [test "$with_target" = "win32"])
    992 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"])
    993 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"])
    994 
    995 # Unicode backend conditionals.
    996 AM_CONDITIONAL([USE_ICU_UNICODE], [test "$with_unicode_backend" = "icu"])
    997 AM_CONDITIONAL([USE_GLIB_UNICODE], [test "$with_unicode_backend" = "glib"])
    998 
    999 # GStreamer feature conditionals.
    1000 AM_CONDITIONAL([USE_GSTREAMER], [test "$have_gstreamer" = "yes"])
    1001 AM_CONDITIONAL([USE_WEBAUDIO_GSTREAMER], [test "$enable_web_audio" = "yes"])
    1002 
    1003 # ATSPI2 conditional.
    1004 AM_CONDITIONAL([HAVE_ATSPI2], [test "$have_atspi2" = "yes"])
    1005 
    1006 # Accelerated compositing conditionals.
    1007 AM_CONDITIONAL([USE_ACCELERATED_COMPOSITING], [test "$enable_accelerated_compositing" = "yes"])
    1008 AM_CONDITIONAL([USE_TEXTURE_MAPPER_CAIRO],
    1009     [test "$enable_accelerated_compositing" = "yes" && test "$with_acceleration_backend" = "none"])
    1010 AM_CONDITIONAL([USE_TEXTURE_MAPPER_GL],
    1011     [test "$enable_accelerated_compositing" = "yes" && test "$with_acceleration_backend" = "opengl"])
    1012 AM_CONDITIONAL([USE_CLUTTER], [test "$with_acceleration_backend" = "clutter"])
    1013 
    1014 # These are the same for now, but they will soon be separate.
    1015 AM_CONDITIONAL([USE_OPENGL], [test "$with_acceleration_backend" = "opengl"])
    1016 AM_CONDITIONAL([USE_EGL], [test "$enable_egl" = "yes"])
    1017 AM_CONDITIONAL([USE_GLES2], [test "$enable_gles2" = "yes"])
    1018 AM_CONDITIONAL([USE_GLX], [test "$enable_glx" = "yes"])
    1019 
    1020 #######################################################################################
    1021 #                                     ATTENTION                                       #
    1022 # Please refer to the following guidelines if you're about to add an Automake         #
    1023 # conditional that reflects any configuration option you've probably also added.      #
    1024 # Chances are neither of these changes are required.                                  #
    1025 # http://trac.webkit.org/wiki/AddingFeatures#ActivatingafeatureforAutotoolsbasedports #
    1026 #######################################################################################
    1027 
    1028 # WebKit feature conditionals.
    1029 AM_CONDITIONAL([ENABLE_DEBUG],[test "$enable_debug_features" = "yes"])
    1030 AM_CONDITIONAL([ENABLE_WEBGL],[test "$enable_webgl" = "yes"])
    1031 AM_CONDITIONAL([ENABLE_GAMEPAD],[test "$enable_gamepad" = "yes"])
    1032 AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
    1033 AM_CONDITIONAL([ENABLE_GEOLOCATION], [test "$enable_geolocation" = "yes"])
    1034 AM_CONDITIONAL([ENABLE_VIDEO],[test "$enable_video" = "yes"])
    1035 AM_CONDITIONAL([ENABLE_MEDIA_STREAM],[test "$enable_media_stream" = "yes"])
    1036 AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"])
    1037 AM_CONDITIONAL([ENABLE_SVG_FONTS],[test "$enable_svg_fonts" = "yes"])
    1038 AM_CONDITIONAL([ENABLE_COVERAGE],[test "$enable_coverage" = "yes"])
    1039 AM_CONDITIONAL([ENABLE_WEB_AUDIO],[test "$enable_web_audio" = "yes"])
    1040 AM_CONDITIONAL([ENABLE_OPCODE_STATS],[test "$enable_opcode_stats" = "yes"])
    1041 AM_CONDITIONAL([ENABLE_WEBKIT1],[test "$enable_webkit1" = "yes"])
    1042 AM_CONDITIONAL([ENABLE_WEBKIT2],[test "$enable_webkit2" = "yes"])
    1043 AM_CONDITIONAL([ENABLE_SPELLCHECK],[test "$enable_spellcheck" = "yes"])
    1044 AM_CONDITIONAL([ENABLE_CSS_FILTERS],[test "$enable_css_filters" = "yes"])
    1045 AM_CONDITIONAL([ENABLE_CSS_SHADERS],[test "$enable_css_shaders" = "yes"])
    1046 
    1047 # Introspection conditional.
    1048 AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"])
     34######################################################################################
     35# Processing of configuration files
     36######################################################################################
    104937
    105038AC_CONFIG_FILES([GNUmakefile])
     
    107058fi
    107159
    1072 # Configuration flags that are used throughout WebKitGTK+.
    1073 AC_DEFINE([ENABLE_GLIB_SUPPORT], [1], [ ])
    1074 AC_DEFINE([WTF_USE_FREETYPE], [1], [ ])
    1075 AC_DEFINE([WTF_USE_HARFBUZZ], [1], [ ])
    1076 AC_DEFINE([WTF_USE_SOUP], [1], [ ])
    1077 AC_DEFINE([WTF_USE_WEBP], [1], [ ])
    1078 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext catalog name])
    1079 
    1080 if test "$enable_debug_features" = "yes"; then
    1081     AC_DEFINE([GDK_PIXBUF_DISABLE_DEPRECATED], [1], [ ])
    1082     AC_DEFINE([GDK_DISABLE_DEPRECATED], [1], [ ])
    1083     AC_DEFINE([GTK_DISABLE_DEPRECATED], [1], [ ])
    1084     AC_DEFINE([PANGO_DISABLE_DEPRECATED], [1], [ ])
    1085 else
    1086     AC_DEFINE([NDEBUG], [1], [Define to disable debugging features])
    1087 fi
    1088 
    1089 if test "$os_win32" = "no"; then
    1090 AC_CHECK_HEADERS([pthread.h],
    1091     AC_DEFINE([HAVE_PTHREAD_H],[1],[Define if pthread exists]),
    1092     AC_MSG_ERROR([pthread support is required to build WebKit]))
    1093 AC_CHECK_LIB(pthread, pthread_rwlock_init,
    1094     AC_DEFINE([HAVE_PTHREAD_RWLOCK],[1],[Define if pthread rwlock is present]),
    1095     AC_MSG_WARN([pthread rwlock support is not available]))
    1096 fi
    1097 
    1098 if test "$GTK_API_VERSION" = "2.0"; then
    1099     AC_DEFINE([GTK_API_VERSION_2], [1], [ ])
    1100 fi
    1101 
    1102 if test "$enable_webkit2" = "yes"; then
    1103     AC_DEFINE([ENABLE_PLUGIN_PROCESS], [1], [ ])
    1104     if test "$have_gtk_unix_printing" = "yes"; then
    1105         AC_DEFINE([HAVE_GTK_UNIX_PRINTING], [1], [Define if GTK+ UNIX Printing is available])
    1106     fi
    1107 fi
    1108 
    1109 if test "$os_win32" = "yes"; then
    1110     AC_DEFINE([XP_WIN], [1], [ ])
    1111     AC_DEFINE([UNICODE], [1], [ ])
    1112     AC_DEFINE([_UNICODE], [1], [ ])
    1113 else
    1114     AC_DEFINE([XP_UNIX], [1], [ ])
    1115 fi
    1116 
    1117 if test "$with_target" = "x11"; then
    1118     AC_DEFINE([MOZ_X11], [1], [ ])
    1119     AC_DEFINE([WTF_PLATFORM_X11], [1], [Define if target is X11])
    1120 fi
    1121 
    1122 if test "$with_unicode_backend" = "icu"; then
    1123     AC_DEFINE([WTF_USE_ICU_UNICODE], [1], [ ])
    1124 else
    1125     AC_DEFINE([WTF_USE_GLIB_UNICODE], [1], [ ])
    1126 fi
    1127 
    1128 if test "$enable_fast_malloc" = "no"; then
    1129     AC_DEFINE([WTF_SYSTEM_MALLOC], [1], [ ])
    1130 fi
    1131 
    1132 if test "$enable_opcode_stats" = "yes"; then
    1133     AC_DEFINE([ENABLE_OPCODE_STATS], [1], [Define to enable Opcode statistics])
    1134 fi
    1135 
    1136 if test "$enable_introspection" = "yes"; then
    1137     AC_DEFINE([ENABLE_INTROSPECTION], [1], [Define to enable GObject introspection support])
    1138 fi
    1139 
    1140 if test "$have_gstreamer" = "yes"; then
    1141     AC_DEFINE([WTF_USE_GSTREAMER], [1], [ ])
    1142     if test "$enable_debug_features" = "yes"; then
    1143         AC_DEFINE([GST_DISABLE_DEPRECATED], [1], [ ])
    1144     fi
    1145 
    1146     if test "$enable_video" = "yes"; then
    1147         AC_DEFINE([WTF_USE_NATIVE_FULLSCREEN_VIDEO], [1], [ ])
    1148     fi
    1149 fi
    1150 
    1151 if test "$GST_API_VERSION" = "1.0"; then
    1152     AC_DEFINE([GST_API_VERSION_1], [1], [Using GStreamer 1.0])
    1153 fi
    1154 
    1155 if test "$enable_web_audio" = "yes"; then
    1156     AC_DEFINE([WTF_USE_WEBAUDIO_GSTREAMER], [1], [1])
    1157 fi
    1158 
    1159 if test "$enable_accelerated_compositing" = "yes"; then
    1160     AC_DEFINE([WTF_USE_ACCELERATED_COMPOSITING], [1], [ ])
    1161     AC_DEFINE([ENABLE_3D_RENDERING], [1], [ ])
    1162 
    1163     if test "$with_acceleration_backend" = "none"; then
    1164         AC_DEFINE([DWTF_USE_TEXTURE_MAPPER], [1], [ ])
    1165         AC_DEFINE([DWTF_USE_TEXTURE_MAPPER_CAIRO], [1], [ ])
    1166     fi
    1167 
    1168     if test "$with_acceleration_backend" = "opengl"; then
    1169         AC_DEFINE([WTF_USE_TEXTURE_MAPPER], [1], [ ])
    1170         AC_DEFINE([WTF_USE_TEXTURE_MAPPER_GL], [1], [ ])
    1171     fi
    1172 
    1173     if test "$with_acceleration_backend" = "clutter"; then
    1174         AC_DEFINE([WTF_USE_CLUTTER], [1], [ ])
    1175     fi
    1176 fi
    1177 
    1178 if test "$with_acceleration_backend" = "opengl"; then
    1179     AC_DEFINE([WTF_USE_OPENGL], [1], [ ])
    1180 fi
    1181 
    1182 if test "$enable_glx" = "yes"; then
    1183     AC_DEFINE([WTF_USE_GLX], [1], [ ])
    1184 fi
    1185 
    1186 if test "$enable_egl" = "yes"; then
    1187     AC_DEFINE([WTF_USE_EGL], [1], [ ])
    1188 fi
    1189 
    1190 if test "$enable_gles2" = "yes"; then
    1191     AC_DEFINE([WTF_USE_OPENGL_ES_2], [1], [ ])
    1192 fi
    1193 
    1194 if test "$enable_spellcheck" = "yes"; then
    1195     AC_DEFINE([ENABLE_SPELLCHECK], [1], [ ])
    1196 fi
    1197 
    1198 AC_OUTPUT
    1199 
    1200 echo "
    1201 WebKit was configured with the following options:
    1202 
    1203 Build configuration:
    1204  Enable debugging (slow)                                  : $enable_debug
    1205  Compile with debug symbols (slow)                        : $enable_debug_symbols
    1206  Enable debug features (slow)                             : $enable_debug_features
    1207  Enable GCC build optimization                            : $enable_optimizations
    1208  Code coverage support                                    : $enable_coverage
    1209  Unicode backend                                          : $with_unicode_backend
    1210  Optimized memory allocator                               : $enable_fast_malloc
    1211  Accelerated rendering backend                            : $acceleration_backend_description
    1212 
    1213 Features:
    1214 =======
    1215  WebKit1 support                                          : $enable_webkit1
    1216  WebKit2 support                                          : $enable_webkit2
    1217  Accelerated Compositing                                  : $enable_accelerated_compositing
    1218  Gamepad support                                          : $enable_gamepad
    1219  Geolocation support                                      : $enable_geolocation
    1220  HTML5 video element support                              : $enable_video
    1221  JIT compilation                                          : $enable_jit
    1222  Media stream support                                     : $enable_media_stream
    1223  Opcode stats                                             : $enable_opcode_stats
    1224  SVG fonts support                                        : $enable_svg_fonts
    1225  SVG support                                              : $enable_svg
    1226  Spellcheck support                                       : $enable_spellcheck
    1227  Web Audio support                                        : $enable_web_audio
    1228  WebGL                                                    : $enable_webgl
    1229  XSLT support                                             : $enable_xslt
    1230 
    1231 
    1232 GTK+ configuration:
    1233  GTK+ version                                             : $with_gtk
    1234  GDK target                                               : $with_target
    1235  GStreamer version                                        : $with_gstreamer
    1236  Introspection support                                    : $enable_introspection
    1237  Generate documentation                                   : $enable_gtk_doc
    1238 "
    1239 if test "$with_unicode_backend" = "glib"; then
    1240     echo "     >> WARNING: the glib-based unicode backend is slow and incomplete <<"
    1241     echo
    1242     echo
    1243 fi
     60m4_include([Source/autotools/PrintBuildConfiguration.m4])
Note: See TracChangeset for help on using the changeset viewer.