Title: [139130] trunk
Revision
139130
Author
[email protected]
Date
2013-01-08 16:30:42 -0800 (Tue, 08 Jan 2013)

Log Message

Add an Autoconf macro that checks whether a given feature is enabled
https://bugs.webkit.org/show_bug.cgi?id=106380

Reviewed by Martin Robinson.

Add the AC_CHECK_WEBKIT_FEATURE_ENABLED macro. It checks the generated
Source/WebCore/GNUmakefile.features.am file to determine whether the
given feature is enabled or disabled in the build that's being configured.

* Source/autotools/webkitfeature.m4: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/ChangeLog (139129 => 139130)


--- trunk/ChangeLog	2013-01-09 00:29:29 UTC (rev 139129)
+++ trunk/ChangeLog	2013-01-09 00:30:42 UTC (rev 139130)
@@ -1,3 +1,16 @@
+2013-01-08  Zan Dobersek  <[email protected]>
+
+        Add an Autoconf macro that checks whether a given feature is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=106380
+
+        Reviewed by Martin Robinson.
+
+        Add the AC_CHECK_WEBKIT_FEATURE_ENABLED macro. It checks the generated
+        Source/WebCore/GNUmakefile.features.am file to determine whether the
+        given feature is enabled or disabled in the build that's being configured.
+
+        * Source/autotools/webkitfeature.m4: Added.
+
 2013-01-08  Hajime Morrita  <[email protected]>
 
         [Shadow DOM] Distribution related code on ShadowRoot should be minimized.

Added: trunk/Source/autotools/webkitfeature.m4 (0 => 139130)


--- trunk/Source/autotools/webkitfeature.m4	                        (rev 0)
+++ trunk/Source/autotools/webkitfeature.m4	2013-01-09 00:30:42 UTC (rev 139130)
@@ -0,0 +1,25 @@
+dnl AC_CHECK_WEBKIT_FEATURE_ENABLED
+dnl Checks whether the given feature is enabled in the
+dnl build that is being configured.
+dnl
+dnl Usage:
+dnl AC_CHECK_WEBKIT_FEATURE_ENABLED([FEATURE], [ACTION_IF_ENABLED], [ACTION_IF_DISABLED])
+
+AC_DEFUN([AC_CHECK_WEBKIT_FEATURE_ENABLED], [
+  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
+  if test $? -eq 0; then
+    feature_enabled="true";
+  else
+    feature_enabled="false";
+  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
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to