From: Cary Coutant Date: Wed, 18 Dec 2013 23:53:05 +0000 (-0800) Subject: Add configure checks for and . X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8356f2d009e20e5ca567f5f9456a40f75e9560dc;p=binutils-gdb.git Add configure checks for and . gold/ * configure.ac: Check for and . * config.in: Regenerate. * configure: Regenerate. * system.h: Use and if available. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index ea67ee959f4..2e269463bac 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,10 @@ +2013-12-18 Cary Coutant + + * configure.ac: Check for and . + * config.in: Regenerate. + * configure: Regenerate. + * system.h: Use and if available. + 2013-12-10 Roland McGrath * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses diff --git a/gold/config.in b/gold/config.in index d46fd757484..be778105418 100644 --- a/gold/config.in +++ b/gold/config.in @@ -187,6 +187,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the header file. */ +#undef HAVE_UNORDERED_MAP + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNORDERED_SET + /* Define to 1 if you have the header file. */ #undef HAVE_WINDOWS_H diff --git a/gold/configure b/gold/configure index 24140cfec25..22573247808 100755 --- a/gold/configure +++ b/gold/configure @@ -7133,6 +7133,20 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +for ac_header in unordered_set unordered_map +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + for ac_header in tr1/unordered_set tr1/unordered_map do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` diff --git a/gold/configure.ac b/gold/configure.ac index 9bc216b947c..b2741cfbd1c 100644 --- a/gold/configure.ac +++ b/gold/configure.ac @@ -523,6 +523,7 @@ AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf, strvers AC_LANG_PUSH(C++) +AC_CHECK_HEADERS(unordered_set unordered_map) AC_CHECK_HEADERS(tr1/unordered_set tr1/unordered_map) AC_CHECK_HEADERS(ext/hash_map ext/hash_set) AC_CHECK_HEADERS(byteswap.h) diff --git a/gold/system.h b/gold/system.h index 3e6fe1d4cb1..aea3723b97b 100644 --- a/gold/system.h +++ b/gold/system.h @@ -57,8 +57,21 @@ // Figure out how to get a hash set and a hash map. -#if defined(HAVE_TR1_UNORDERED_SET) && defined(HAVE_TR1_UNORDERED_MAP) \ - && defined(HAVE_TR1_UNORDERED_MAP_REHASH) +#if defined(HAVE_UNORDERED_SET) && defined(HAVE_UNORDERED_MAP) + +#include +#include + +// We need a template typedef here. + +#define Unordered_set std::unordered_set +#define Unordered_map std::unordered_map +#define Unordered_multimap std::unordered_multimap + +#define reserve_unordered_map(map, n) ((map)->rehash(n)) + +#elif defined(HAVE_TR1_UNORDERED_SET) && defined(HAVE_TR1_UNORDERED_MAP) \ + && defined(HAVE_TR1_UNORDERED_MAP_REHASH) #include #include