]> git.puffer.fish Git - mirror/frr.git/commitdiff
configure: allow building without getrusage
authorStephen Hemminger <shemminger@vyatta.com>
Fri, 4 Jan 2013 22:29:22 +0000 (22:29 +0000)
committerDavid Lamparter <equinox@opensourcerouting.org>
Tue, 15 Jan 2013 16:49:46 +0000 (17:49 +0100)
Measuring the resource usage of threads is moderately expensive
since it requires doing an additional system call everytime a
thread context switches. Make it possible to disable this with
a configuration option.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
configure.ac

index b69c99d544825d389943839d4324b6ba0de9ea64..ff34f03a7be77e23a3ce32f3eed2ba5bf8095b7e 100755 (executable)
@@ -266,6 +266,8 @@ AC_ARG_ENABLE(isis_topology,
 [  --enable-isis-topology        enable IS-IS topology generator])
 AC_ARG_ENABLE(capabilities,
 [  --disable-capabilities        disable using POSIX capabilities])
+AC_ARG_ENABLE(rusage,
+[  --disable-rusage              disable using getrusage])
 AC_ARG_ENABLE(gcc_ultra_verbose,
 [  --enable-gcc-ultra-verbose    enable ultra verbose GCC warnings])
 AC_ARG_ENABLE(linux24_tcp_md5,
@@ -1486,12 +1488,13 @@ AC_CHECK_TYPES([struct in_pktinfo],
 dnl --------------------------------------
 dnl checking for getrusage struct and call
 dnl --------------------------------------
-AC_MSG_CHECKING(whether getrusage is available)
-AC_TRY_COMPILE([#include <sys/resource.h>
-],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
-[AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_RUSAGE,,rusage)],
- AC_MSG_RESULT(no))
+if test "${enable_rusage}" != "no"; then
+  AC_MSG_CHECKING(whether getrusage is available)
+  AC_TRY_COMPILE([#include <sys/resource.h>],[struct rusage ac_x; getrusage (RUSAGE_SELF, &ac_x);],
+    [AC_MSG_RESULT(yes)
+     AC_DEFINE(HAVE_RUSAGE,,rusage)],
+      AC_MSG_RESULT(no))
+fi
 
 dnl --------------------------------------
 dnl checking for clock_time monotonic struct and call