Changeset 139327 in webkit


Ignore:
Timestamp:
Jan 10, 2013, 9:51:57 AM (12 years ago)
Author:
zandobersek@gmail.com
Message:

[Autotools] Add the AM_WEBKIT_FEATURE_CONDITIONAL macro
https://bugs.webkit.org/show_bug.cgi?id=106576

Reviewed by Martin Robinson.

Replace the AC_CHECK_WEBKIT_FEATURE_ENABLED with the new macro.
The former was executing actions based on the passed-in feature being
enabled in the (possibly overridden) GNUmakefile.features.am, the actions
usually affecting the Automake conditional value that was set up afterwards.
The new macro does this directly, setting up an Automake conditional of the
same name as the feature that was checked.

  • Source/autotools/webkitfeature.m4:
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r139324 r139327  
     12013-01-10  Zan Dobersek  <zandobersek@gmail.com>
     2
     3        [Autotools] Add the AM_WEBKIT_FEATURE_CONDITIONAL macro
     4        https://bugs.webkit.org/show_bug.cgi?id=106576
     5
     6        Reviewed by Martin Robinson.
     7
     8        Replace the AC_CHECK_WEBKIT_FEATURE_ENABLED with the new macro.
     9        The former was executing actions based on the passed-in feature being
     10        enabled in the (possibly overridden) GNUmakefile.features.am, the actions
     11        usually affecting the Automake conditional value that was set up afterwards.
     12        The new macro does this directly, setting up an Automake conditional of the
     13        same name as the feature that was checked.
     14
     15        * Source/autotools/webkitfeature.m4:
     16
    1172013-01-10  Zan Dobersek  <zandobersek@gmail.com>
    218
  • trunk/Source/autotools/webkitfeature.m4

    r139130 r139327  
    1 dnl AC_CHECK_WEBKIT_FEATURE_ENABLED
     1dnl AM_WEBKIT_FEATURE_CONDITIONAL
    22dnl Checks whether the given feature is enabled in the
    3 dnl build that is being configured.
     3dnl build that is being configured and sets up equally-named
     4dnl Automake conditional reflecting the feature status.
    45dnl
    56dnl Usage:
    6 dnl AC_CHECK_WEBKIT_FEATURE_ENABLED([FEATURE], [ACTION_IF_ENABLED], [ACTION_IF_DISABLED])
     7dnl AM_WEBKIT_FEATURE_CONDITIONAL([FEATURE])
    78
    8 AC_DEFUN([AC_CHECK_WEBKIT_FEATURE_ENABLED], [
     9AC_DEFUN([AM_WEBKIT_FEATURE_CONDITIONAL], [
    910  AC_PROG_AWK
    1011
    1112  dnl Grep the generated GNUmakefile.features.am
    1213  dnl to determine if the specified feature is enabled.
    13   grep -qE "($1=1)" Source/WebCore/GNUmakefile.features.am
     14  grep -qE "($1=1)" $srcdir/Source/WebCore/GNUmakefile.features.am
    1415  if test $? -eq 0; then
    15     feature_enabled="true";
     16    feature_enabled="yes";
    1617  else
    17     feature_enabled="false";
     18    feature_enabled="no";
    1819  fi
    1920
    20   dnl Execute ACTION_IF_ENABLED / ACTION_IF_DISABLED.
    21   if test "$feature_enabled" = "true" ; then
    22     m4_ifvaln([$2],[$2],[:])
    23     m4_ifvaln([$3],[else $3])
    24   fi
    25 ]) dnl AC_CHECK_WEBKIT_FEATURE_ENABLED
     21  AM_CONDITIONAL([$1],[test "$feature_enabled" = "yes"])
     22
     23]) dnl AM_WEBKIT_FEATURE_CONDITIONAL
Note: See TracChangeset for help on using the changeset viewer.