Changeset 156271 in webkit


Ignore:
Timestamp:
Sep 23, 2013 8:09:34 AM (11 years ago)
Author:
zandobersek@gmail.com
Message:

[Autotools] Rework the build target selection
https://bugs.webkit.org/show_bug.cgi?id=121703

Reviewed by Gustavo Noronha Silva.

Replace the --with-target configuration flag with target-specific --enable-*-target flags:

  • --enable-x11-target
  • --enable-wayland-target
  • --enable-win32-target
  • --enable-quartz-target
  • --enable-directfb-target

By default, the X11 target is enabled. This default is preserved only if no --enable-*-target flag
is passed on the command line. When that occurs, the newly-constructed list of build targets is
used to determine what build targets should actually be built. So for instance, executing just
./configure would only enable the X11 target as that's the default, and executing
./configure --enable-wayland-target would only enable the Wayland target, as the defaults are
completely ignored.

  • Source/autotools/CheckSystemAndBasicDependencies.m4: Abort if grep was not found, just in case.
  • Source/autotools/CustomMacros.m4: The new file that contains helpful custom macros.
  • Source/autotools/FindDependencies.m4: Use the appropriate 'enable_*_target' references instead of 'with_*target'.
  • Source/autotools/PrintBuildConfiguration.m4: Use the new AM_APPEND_TO_DESCRIPTION macro to construct a pretty-looking

description string of what targets will be built.

  • Source/autotools/ReadCommandLineArguments.m4: Replace the --with-target configuration flag and the related

hacks with the set of --enable-*-target flags. The new AM_DETERMINE_BUILD_TARGET_STATUS macro is used to determine
whether to enable specific build targets, based indirectly on the passed-in --enable-*-target flags.

  • Source/autotools/SetupAutoconfHeader.m4: Use the appropriate 'enable_*_target' references instead of 'with_*target'.
  • Source/autotools/SetupAutomake.m4: Use the appropriate 'enable_*_target' references instead of 'with_*target'.
  • configure.ac: Include the new CustomMacros.m4 file.
Location:
trunk
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r156269 r156271  
     12013-09-23  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [Autotools] Rework the build target selection
     4        https://bugs.webkit.org/show_bug.cgi?id=121703
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        Replace the --with-target configuration flag with target-specific --enable-*-target flags:
     9        - --enable-x11-target
     10        - --enable-wayland-target
     11        - --enable-win32-target
     12        - --enable-quartz-target
     13        - --enable-directfb-target
     14
     15        By default, the X11 target is enabled. This default is preserved only if no --enable-*-target flag
     16        is passed on the command line. When that occurs, the newly-constructed list of build targets is
     17        used to determine what build targets should actually be built. So for instance, executing just
     18        `./configure` would only enable the X11 target as that's the default, and executing
     19        `./configure --enable-wayland-target` would only enable the Wayland target, as the defaults are
     20        completely ignored.
     21
     22        * Source/autotools/CheckSystemAndBasicDependencies.m4: Abort if grep was not found, just in case.
     23        * Source/autotools/CustomMacros.m4: The new file that contains helpful custom macros.
     24        * Source/autotools/FindDependencies.m4: Use the appropriate 'enable_*_target' references instead of 'with_*target'.
     25        * Source/autotools/PrintBuildConfiguration.m4: Use the new AM_APPEND_TO_DESCRIPTION macro to construct a pretty-looking
     26        description string of what targets will be built.
     27        * Source/autotools/ReadCommandLineArguments.m4: Replace the --with-target configuration flag and the related
     28        hacks with the set of --enable-*-target flags. The new AM_DETERMINE_BUILD_TARGET_STATUS macro is used to determine
     29        whether to enable specific build targets, based indirectly on the passed-in --enable-*-target flags.
     30        * Source/autotools/SetupAutoconfHeader.m4: Use the appropriate 'enable_*_target' references instead of 'with_*target'.
     31        * Source/autotools/SetupAutomake.m4: Use the appropriate 'enable_*_target' references instead of 'with_*target'.
     32        * configure.ac: Include the new CustomMacros.m4 file.
     33
    1342013-09-23  Claudio Saavedra  <csaavedra@igalia.com>
    235
  • trunk/Source/autotools/CheckSystemAndBasicDependencies.m4

    r155246 r156271  
    4848if test -z "$MV"; then
    4949    AC_MSG_ERROR([You need 'mv' to compile WebKit])
     50fi
     51
     52AC_PATH_PROG(GREP, grep)
     53if test -z "$GREP"; then
     54    AC_MSG_ERROR([You need 'grep' to compile WebKit])
    5055fi
    5156
  • trunk/Source/autotools/FindDependencies.m4

    r155534 r156271  
    151151fi
    152152
    153 # Check for target-specific dependencies.
    154 if test "$with_target" = "directfb"; then
    155     PKG_CHECK_MODULES(CAIRO, cairo-directfb >= cairo_required_version)
    156     PKG_CHECK_MODULES(GTK, gtk+-directfb-2.0 >= $GTK_REQUIRED_VERSION)
    157 else
    158     PKG_CHECK_MODULES(CAIRO, cairo >= cairo_required_version)
    159     PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED_VERSION)
    160     GTK_ACTUAL_VERSION=`pkg-config --modversion gtk+-$GTK_API_VERSION`
    161 fi
     153PKG_CHECK_MODULES(CAIRO, cairo >= cairo_required_version)
     154PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED_VERSION)
     155GTK_ACTUAL_VERSION=`pkg-config --modversion gtk+-$GTK_API_VERSION`
     156
     157if test "$enable_directfb_target" = "yes"; then
     158    PKG_CHECK_MODULES(CAIRO_DIRECTFB, cairo-directfb >= cairo_required_version)
     159    CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_DIRECTFB_CFLAGS"
     160    CAIRO_LIBS="$CAIRO_LIBS $CAIRO_DIRECTFB_LIBS"
     161
     162    PKG_CHECK_MODULES(GTK_DIRECTFB, gtk+-directfb-2.0 >= $GTK_REQUIRED_VERSION)
     163    GTK_CFLAGS="$GTK_CFLAGS $GTK_DIRECTFB_CFLAGS"
     164    GTK_LIBS="$GTK_LIBS $GTK_DIRECTFB_LIBS"
     165fi
     166
    162167AC_SUBST(GTK_CFLAGS)
    163168AC_SUBST(GTK_LIBS)
     
    165170AC_SUBST(CAIRO_LIBS)
    166171
    167 if test "$with_x11_target" = "yes"; then
     172if test "$enable_x11_target" = "yes"; then
    168173    # The GTK+ X11 target dependency should match the version of the master GTK+ dependency.
    169174    PKG_CHECK_MODULES(GTK_X11, gtk+-x11-$GTK_API_VERSION = $GTK_ACTUAL_VERSION)
     
    187192    # Check for XRender under Linux/Unix. Some linkers require explicit linkage (like GNU Gold),
    188193    # so we cannot rely on GTK+ pulling XRender.
    189     if test "$with_x11_target" = "yes"; then
     194    if test "$enable_x11_target" = "yes"; then
    190195        PKG_CHECK_MODULES([XRENDER], [xrender])
    191196        AC_SUBST([XRENDER_CFLAGS])
     
    197202fi
    198203
    199 if test "$with_wayland_target" = "yes"; then
     204if test "$enable_wayland_target" = "yes"; then
    200205    # The GTK+ Wayland target dependency should match the version of the master GTK+ dependency.
    201206    PKG_CHECK_MODULES(GTK_WAYLAND, gtk+-wayland-$GTK_API_VERSION = $GTK_ACTUAL_VERSION)
     
    268273fi
    269274
    270 if test "$with_x11_target" = "yes" && test "$found_opengl" = "yes"; then
     275if test "$enable_x11_target" = "yes" && test "$found_opengl" = "yes"; then
    271276    PKG_CHECK_MODULES([XCOMPOSITE], [xcomposite])
    272277    PKG_CHECK_MODULES([XDAMAGE], [xdamage])
     
    288293fi
    289294
    290 if test "$with_x11_target" != "yes" && test "$with_wayland_target" = "yes" && test "enable_accelerated_compositing" != "no"; then
     295if test "$enable_x11_target" != "yes" && test "$enable_wayland_target" = "yes" && test "enable_accelerated_compositing" != "no"; then
    291296    AC_MSG_WARN([Accelerated compositing for Wayland is not yet implemented, disabling due to the Wayland-only target.])
    292297    enable_accelerated_compositing=no
     
    365370
    366371# Check if FreeType/FontConfig are available.
    367 if test "$with_target" = "directfb"; then
     372if test "$enable_directfb_target" = "yes"; then
    368373    PKG_CHECK_MODULES([FREETYPE],
    369374        [fontconfig >= fontconfig_required_version freetype2 >= freetype2_required_version harfbuzz >= harfbuzz_required_version])
  • trunk/Source/autotools/PrintBuildConfiguration.m4

    r155032 r156271  
     1target_description=""
     2AS_IF([test "$enable_x11_target" = "yes"], [AM_APPEND_TO_DESCRIPTION(target_description, "x11")], [])
     3AS_IF([test "$enable_wayland_target" = "yes"], [AM_APPEND_TO_DESCRIPTION(target_description, "wayland")], [])
     4AS_IF([test "$enable_win32_target" = "yes"], [AM_APPEND_TO_DESCRIPTION(target_description, "win32")], [])
     5AS_IF([test "$enable_quartz_target" = "yes"], [AM_APPEND_TO_DESCRIPTION(target_description, "quartz")], [])
     6AS_IF([test "$enable_directfb_target" = "yes"], [AM_APPEND_TO_DESCRIPTION(target_description, "directfb")], [])
     7
    18AC_OUTPUT
    29
     
    3542GTK+ configuration:
    3643 GTK+ version                                             : $with_gtk
    37  GDK targets                                              : $with_target
     44 GDK targets                                              : $target_description
    3845 Introspection support                                    : $enable_introspection
    3946 Generate documentation                                   : $enable_gtk_doc
  • trunk/Source/autotools/ReadCommandLineArguments.m4

    r155918 r156271  
    5959AC_MSG_RESULT([$with_gtk])
    6060
    61 AC_MSG_CHECKING([the target windowing system])
    62 AC_ARG_WITH(target,
    63     AC_HELP_STRING([--with-target=@<:@x11/wayland/x11,wayland/win32/quartz/directfb@:>@], [Select webkit target [default=x11]]),
    64     [
    65         case "$with_target" in
    66             x11|wayland|x11,wayland|win32|quartz|directfb) ;;
    67             *) AC_MSG_ERROR([Invalid target: must be x11, wayland, both x11 and wayland (x11,wayland), quartz, win32, or directfb.]) ;;
    68         esac
    69     ],
    70     [with_target="x11"])
    71 AC_MSG_RESULT([$with_target])
    72 
    73 # To support building for X11 and Wayland targets concurrently, the $with_target value is checked for this
    74 # special case and two additional variables are introduced that denote specifically whether we're building
    75 # the X11 target, the Wayland target, both of these or neither.
    76 if test "$with_target" = "x11,wayland"; then
    77     with_x11_target=yes
    78     with_wayland_target=yes
    79 elif test "$with_target" = "x11"; then
    80     with_x11_target=yes
    81     with_wayland_target=no
    82 elif test "$with_target" = "wayland"; then
    83     with_x11_target=no
    84     with_wayland_target=yes
    85 else
    86     with_x11_target=no
    87     with_wayland_target=no
     61default_build_targets="x11=yes wayland=no win32=no quartz=no directfb=no"
     62build_targets=""
     63
     64AC_ARG_ENABLE([x11-target], [AC_HELP_STRING([--enable-x11-target], [enable building for the X11 target [default=yes]])],
     65    [build_targets="$build_targets x11=$enable_x11_target"], [])
     66AC_ARG_ENABLE([wayland-target], [AC_HELP_STRING([--enable-wayland-target], [enable building for the Wayland target [default=auto]])],
     67    [build_targets="$build_targets wayland=$enable_wayland_target"], [])
     68AC_ARG_ENABLE([win32-target], [AC_HELP_STRING([--enable-win32-target], [enable building for the Win32 target [default=no]])],
     69    [build_targets="$build_targets win32=$enable_win32_target"], [])
     70AC_ARG_ENABLE([quartz-target], [AC_HELP_STRING([--enable-quartz-target], [enable building for the Quartz target [default=no]])],
     71    [build_targets="$build_targets quartz=$enable_quartz_target"], [])
     72AC_ARG_ENABLE([directfb-target], [AC_HELP_STRING([--enable-directfb-target], [enable building for the DirectFB target [default=no]])],
     73    [build_targets="$build_targets directfb=$enable_directfb_target"], [])
     74
     75if test "$build_targets" = ""; then
     76    build_targets="$default_build_targets"
    8877fi
     78
     79AM_WEBKIT_DETERMINE_BUILD_TARGET_STATUS([x11], [enable_x11_target], [build_targets])
     80AM_WEBKIT_DETERMINE_BUILD_TARGET_STATUS([wayland], [enable_wayland_target], [build_targets])
     81AM_WEBKIT_DETERMINE_BUILD_TARGET_STATUS([win32], [enable_win32_target], [build_targets])
     82AM_WEBKIT_DETERMINE_BUILD_TARGET_STATUS([quartz], [enable_quartz_target], [build_targets])
     83AM_WEBKIT_DETERMINE_BUILD_TARGET_STATUS([directfb], [enable_directfb_target], [build_targets])
     84
     85AC_MSG_CHECKING([whether to build for the Win32 target])
     86AC_MSG_RESULT([$enable_wayland_target])
    8987
    9088AC_MSG_CHECKING([whether to enable spellcheck support])
  • trunk/Source/autotools/SetupAutoconfHeader.m4

    r155509 r156271  
    3232    AC_DEFINE([UNICODE], [1], [ ])
    3333    AC_DEFINE([_UNICODE], [1], [ ])
    34 elif test "$with_x11_target" = "yes" || test "$with_wayland_target" != "yes"; then
     34elif test "$enable_x11_target" = "yes" || test "$enable_wayland_target" != "yes"; then
    3535    AC_DEFINE([XP_UNIX], [1], [ ])
    3636fi
    3737
    38 if test "$with_x11_target" = "yes"; then
     38if test "$enable_x11_target" = "yes"; then
    3939    AC_DEFINE([MOZ_X11], [1], [ ])
    4040    AC_DEFINE([WTF_PLATFORM_X11], [1], [Define if target is X11])
    4141fi
    4242
    43 if test "$with_wayland_target" = "yes"; then
     43if test "$enable_wayland_target" = "yes"; then
    4444    AC_DEFINE([WTF_PLATFORM_WAYLAND], [1], [Define if target is Wayland])
    4545fi
  • trunk/Source/autotools/SetupAutomake.m4

    r155918 r156271  
    2424
    2525# Target conditionals.
    26 AM_CONDITIONAL([TARGET_X11], [test "$with_x11_target" = "yes"])
    27 AM_CONDITIONAL([TARGET_WAYLAND], [test "$with_wayland_target" = "yes"])
    28 AM_CONDITIONAL([TARGET_X11_OR_WAYLAND], [test "$with_x11_target" = "yes" || test "$with_wayland_target" = "yes"])
    29 AM_CONDITIONAL([TARGET_WIN32], [test "$with_target" = "win32"])
    30 AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"])
    31 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$with_target" = "directfb"])
     26AM_CONDITIONAL([TARGET_X11], [test "$enable_x11_target" = "yes"])
     27AM_CONDITIONAL([TARGET_WAYLAND], [test "$enable_wayland_target" = "yes"])
     28AM_CONDITIONAL([TARGET_X11_OR_WAYLAND], [test "$enable_x11_target" = "yes" || test "$enable_wayland_target" = "yes"])
     29AM_CONDITIONAL([TARGET_WIN32], [test "$enable_win32_target" = "yes"])
     30AM_CONDITIONAL([TARGET_QUARTZ], [test "$enable_quartz_target" = "yes"])
     31AM_CONDITIONAL([TARGET_DIRECTFB], [test "$enable_directfb_target" = "yes"])
    3232
    3333# GStreamer feature conditionals.
  • trunk/configure.ac

    r154787 r156271  
    2323AC_DEFINE([USER_AGENT_GTK_MINOR_VERSION], [webkit_user_agent_minor_version], [The minor version used in user agent string])
    2424
     25m4_include([Source/autotools/CustomMacros.m4])
    2526m4_include([Source/autotools/CheckSystemAndBasicDependencies.m4])
    2627m4_include([Source/autotools/SetupLibtool.m4])
Note: See TracChangeset for help on using the changeset viewer.