summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2007-04-30 19:20:56 -0400
committerBehdad Esfahbod <behdad@behdad.org>2007-04-30 19:20:56 -0400
commit8ea48710dc933cd5dd52fb7d0c29eb8994a5d160 (patch)
treee1d8b966fdf60fcfe2c3c85a33ce6263dcf0beda
parentfbc8bf05033a652d26c1defa56d12183e4009870 (diff)
[perf] Check availability before including nonstandard headers
-rw-r--r--configure.in4
-rw-r--r--perf/cairo-perf-diff-files.c2
-rw-r--r--perf/cairo-perf.c6
3 files changed, 11 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index b2aa53fcf..ddeb635b9 100644
--- a/configure.in
+++ b/configure.in
@@ -609,6 +609,10 @@ AC_CHECK_HEADERS([sched.h], [
])
dnl ===========================================================================
+dnl Checks for misc headers
+AC_CHECK_HEADERS([libgen.h])
+
+dnl ===========================================================================
dnl check compiler flags
AC_DEFUN([CAIRO_CC_TRY_FLAG], [
AC_MSG_CHECKING([whether $CC supports $1])
diff --git a/perf/cairo-perf-diff-files.c b/perf/cairo-perf-diff-files.c
index 2fd6229d2..682837583 100644
--- a/perf/cairo-perf-diff-files.c
+++ b/perf/cairo-perf-diff-files.c
@@ -38,7 +38,9 @@
#include <ctype.h>
#include <math.h>
#include <assert.h>
+#ifdef HAVE_LIBGEN_H
#include <libgen.h>
+#endif
typedef struct _test_report {
int id;
diff --git a/perf/cairo-perf.c b/perf/cairo-perf.c
index af06bb695..360f2ddb6 100644
--- a/perf/cairo-perf.c
+++ b/perf/cairo-perf.c
@@ -27,12 +27,16 @@
*/
#include "cairo-perf.h"
-#include "config.h"
/* For getopt */
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+
/* For basename */
+#ifdef HAVE_LIBGEN_H
#include <libgen.h>
+#endif
#if HAVE_FCFINI
#include <fontconfig/fontconfig.h>