Mesa (master): configure.ac: add --enable-profile

Oded Gabbay gabbayo at kemper.freedesktop.org
Fri Jan 8 19:59:56 UTC 2016


Module: Mesa
Branch: master
Commit: 6613042c4ed4d8ef64fa21ad19a2131dae2f4702
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6613042c4ed4d8ef64fa21ad19a2131dae2f4702

Author: Oded Gabbay <oded.gabbay at gmail.com>
Date:   Thu Jan  7 17:20:47 2016 +0200

configure.ac: add --enable-profile

For profiling mesa's code, especially llvmpipe, PROFILE should be
defined. Currently, this define can only be generated if mesa is
built using scons.
This patch makes it possible to generate this define also when building
mesa through automake tools.

v2:

- Change --enable-llvmpipe-profile to --enable-profile
- Add -fno-omit-frame-pointer to CFLAGS and CXXFLAGS when enabling profile

Signed-off-by: Oded Gabbay <oded.gabbay at gmail.com>
Reviewed-by: Jose Fonseca <jfonseca at vmware.com>

---

 configure.ac |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/configure.ac b/configure.ac
index b1c1d7d..9c3d1a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -476,8 +476,29 @@ AC_ARG_ENABLE([debug],
     [enable_debug="$enableval"],
     [enable_debug=no]
 )
+
+AC_ARG_ENABLE([profile],
+    [AS_HELP_STRING([--enable-profile],
+        [enable profiling of code @<:@default=disabled@:>@])],
+    [enable_profile="$enableval"],
+    [enable_profile=no]
+)
+
+if test "x$enable_profile" = xyes; then
+    DEFINES="$DEFINES -DPROFILE"
+    if test "x$GCC" = xyes; then
+        CFLAGS="$CFLAGS -fno-omit-frame-pointer"
+    fi
+    if test "x$GXX" = xyes; then
+        CXXFLAGS="$CXXFLAGS -fno-omit-frame-pointer"
+    fi
+fi
+
 if test "x$enable_debug" = xyes; then
     DEFINES="$DEFINES -DDEBUG"
+    if test "x$enable_profile" = xyes; then
+        AC_MSG_WARN([Debug and Profile are enabled at the same time])
+    fi
     if test "x$GCC" = xyes; then
         if ! echo "$CFLAGS" | grep -q -e '-g'; then
             CFLAGS="$CFLAGS -g"




More information about the mesa-commit mailing list