[Autotools] Add the AM_WEBKIT_FEATURE_CONDITIONAL macro
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2013 17:51:57 +0000 (17:51 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2013 17:51:57 +0000 (17:51 +0000)
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139327 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/autotools/webkitfeature.m4

index 808969d..75cb11c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2013-01-10  Zan Dobersek  <zandobersek@gmail.com>
 
+        [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:
+
+2013-01-10  Zan Dobersek  <zandobersek@gmail.com>
+
         Remove the ENABLE_ANIMATION_API feature define occurences
         https://bugs.webkit.org/show_bug.cgi?id=106544
 
index feb1246..79f9c03 100644 (file)
@@ -1,25 +1,23 @@
-dnl AC_CHECK_WEBKIT_FEATURE_ENABLED
+dnl AM_WEBKIT_FEATURE_CONDITIONAL
 dnl Checks whether the given feature is enabled in the
-dnl build that is being configured.
+dnl build that is being configured and sets up equally-named
+dnl Automake conditional reflecting the feature status.
 dnl
 dnl Usage:
-dnl AC_CHECK_WEBKIT_FEATURE_ENABLED([FEATURE], [ACTION_IF_ENABLED], [ACTION_IF_DISABLED])
+dnl AM_WEBKIT_FEATURE_CONDITIONAL([FEATURE])
 
-AC_DEFUN([AC_CHECK_WEBKIT_FEATURE_ENABLED], [
+AC_DEFUN([AM_WEBKIT_FEATURE_CONDITIONAL], [
   AC_PROG_AWK
 
   dnl Grep the generated GNUmakefile.features.am
   dnl to determine if the specified feature is enabled.
-  grep -qE "($1=1)" Source/WebCore/GNUmakefile.features.am
+  grep -qE "($1=1)" $srcdir/Source/WebCore/GNUmakefile.features.am
   if test $? -eq 0; then
-    feature_enabled="true";
+    feature_enabled="yes";
   else
-    feature_enabled="false";
+    feature_enabled="no";
   fi
 
-  dnl Execute ACTION_IF_ENABLED / ACTION_IF_DISABLED.
-  if test "$feature_enabled" = "true" ; then
-    m4_ifvaln([$2],[$2],[:])
-    m4_ifvaln([$3],[else $3])
-  fi
-]) dnl AC_CHECK_WEBKIT_FEATURE_ENABLED
+  AM_CONDITIONAL([$1],[test "$feature_enabled" = "yes"])
+
+]) dnl AM_WEBKIT_FEATURE_CONDITIONAL