Commit c3cdcdd9 authored by Tiago Peixoto's avatar Tiago Peixoto

Improve inclusion of sparsehash when directory prefix is nonstandard

parent 4323e370
...@@ -318,18 +318,23 @@ if test "$USING_CAIRO" = "yes"; then ...@@ -318,18 +318,23 @@ if test "$USING_CAIRO" = "yes"; then
fi fi
dnl sparsehash dnl sparsehash
[SPARSEHASH_PREFIX=sparsehash]
AC_ARG_WITH([sparsehash-prefix], [AS_HELP_STRING([--with-sparsehash-prefix=prefix],
[include directory prefix for sparsehash
[default=sparsehash] ])],
[SPARSEHASH_PREFIX=$withval])
if test "$USING_SPARSEHASH" = "yes"; then if test "$USING_SPARSEHASH" = "yes"; then
PKG_CHECK_MODULES(SPARSEHASH, [libsparsehash], AC_DEFINE([HAVE_SPARSEHASH], [1], PKG_CHECK_MODULES(SPARSEHASH, [libsparsehash], AC_DEFINE([HAVE_SPARSEHASH], [1],
[Using google's sparsehash]), []) [Using google's sparsehash]), [])
[SPARSEHASH_CFLAGS="${SPARSEHASH_CFLAGS} -DSPARSEHASH_PREFIX=${SPARSEHASH_PREFIX}"]
AC_SUBST(SPARSEHASH_CFLAGS) AC_SUBST(SPARSEHASH_CFLAGS)
[OLD_CXXFLAGS="${CXXFLAGS}"] AC_DEFINE_UNQUOTED([SPARSEHASH_INCLUDE(f)], [<${SPARSEHASH_PREFIX}/f>],
[OLD_CPPFLAGS="${CPPFLAGS}"] [Sparsehash include macro])
[CXXFLAGS="${CXXFLAGS} ${SPARSEHASH_CFLAGS}"] [CXXFLAGS="${CXXFLAGS} ${SPARSEHASH_CFLAGS}"]
[CPPFLAGS="${CPPFLAGS} ${SPARSEHASH_CFLAGS}"] [CPPFLAGS="${CPPFLAGS} ${SPARSEHASH_CFLAGS}"]
AC_CHECK_HEADER([sparsehash/dense_hash_set], [], AC_CHECK_HEADER([${SPARSEHASH_PREFIX}/dense_hash_set], [],
[AC_MSG_ERROR([sparsehash headers not found])]) [AC_MSG_ERROR([sparsehash headers not found])])
[CXXFLAGS="${OLD_CXXFLAGS}"]
[CPPFLAGS="${OLD_CPPFLAGS}"]
fi fi
dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for typedefs, structures, and compiler characteristics.
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <boost/mpl/if.hpp> #include <boost/mpl/if.hpp>
#ifdef HAVE_SPARSEHASH #ifdef HAVE_SPARSEHASH
#include <sparsehash/dense_hash_set> #include SPARSEHASH_INCLUDE(dense_hash_set)
#endif #endif
#ifndef __clang__ #ifndef __clang__
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
#include <tuple> #include <tuple>
#ifdef HAVE_SPARSEHASH #ifdef HAVE_SPARSEHASH
#include <sparsehash/dense_hash_set> #include SPARSEHASH_INCLUDE(dense_hash_set)
#include <sparsehash/dense_hash_map> #include SPARSEHASH_INCLUDE(dense_hash_map)
#endif #endif
#include "../generation/sampler.hh" #include "../generation/sampler.hh"
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <unordered_map> #include <unordered_map>
#ifdef HAVE_SPARSEHASH #ifdef HAVE_SPARSEHASH
#include <sparsehash/dense_hash_map> #include SPARSEHASH_INCLUDE(dense_hash_map)
#endif #endif
#include <iostream> #include <iostream>
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "random.hh" #include "random.hh"
#ifdef HAVE_SPARSEHASH #ifdef HAVE_SPARSEHASH
#include <sparsehash/dense_hash_map> #include SPARSEHASH_INCLUDE(dense_hash_map)
#endif #endif
namespace graph_tool namespace graph_tool
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <unordered_map> #include <unordered_map>
#ifdef HAVE_SPARSEHASH #ifdef HAVE_SPARSEHASH
#include <sparsehash/dense_hash_map> #include SPARSEHASH_INCLUDE(dense_hash_map)
#endif #endif
#include "graph_util.hh" #include "graph_util.hh"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment