--- ./src/include/fst/accumulator.h.orig	2013-01-24 11:36:22.000000000 +0900
+++ ./src/include/fst/accumulator.h	2013-11-17 00:23:01.000000000 +0900
@@ -23,9 +23,15 @@
 
 #include <algorithm>
 #include <functional>
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 #include <vector>
 using std::vector;
 
--- ./src/include/fst/arc-map.h.orig	2013-01-24 11:36:22.000000000 +0900
+++ ./src/include/fst/arc-map.h	2013-11-17 00:23:01.000000000 +0900
@@ -23,9 +23,15 @@
 #ifndef FST_LIB_ARC_MAP_H__
 #define FST_LIB_ARC_MAP_H__
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 #include <string>
 #include <utility>
 using std::pair; using std::make_pair;
--- ./src/include/fst/bi-table.h.orig	2013-01-24 11:36:22.000000000 +0900
+++ ./src/include/fst/bi-table.h	2013-11-17 00:23:01.000000000 +0900
@@ -28,9 +28,15 @@
 #include <vector>
 using std::vector;
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_set>
+using std::unordered_set;
+using std::unordered_multiset;
+#else
 #include <tr1/unordered_set>
 using std::tr1::unordered_set;
 using std::tr1::unordered_multiset;
+#endif
 
 namespace fst {
 
--- ./src/include/fst/determinize.h.orig	2013-01-24 11:36:22.000000000 +0900
+++ ./src/include/fst/determinize.h	2013-11-17 00:23:01.000000000 +0900
@@ -24,9 +24,15 @@
 
 #include <algorithm>
 #include <climits>
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 #include <map>
 #include <fst/slist.h>
 #include <string>
--- ./src/include/fst/edit-fst.h.orig	2013-01-24 11:36:22.000000000 +0900
+++ ./src/include/fst/edit-fst.h	2013-11-17 00:23:01.000000000 +0900
@@ -25,9 +25,15 @@
 
 #include <fst/cache.h>
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 
 namespace fst {
 
--- ./src/include/fst/encode.h.orig	2013-01-24 11:36:22.000000000 +0900
+++ ./src/include/fst/encode.h	2013-11-17 00:23:01.000000000 +0900
@@ -22,9 +22,15 @@
 #define FST_LIB_ENCODE_H__
 
 #include <climits>
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 #include <string>
 #include <vector>
 using std::vector;
--- ./src/include/fst/epsnormalize.h.orig	2013-01-24 11:36:22.000000000 +0900
+++ ./src/include/fst/epsnormalize.h	2013-11-17 00:23:01.000000000 +0900
@@ -21,9 +21,15 @@
 #ifndef FST_LIB_EPSNORMALIZE_H__
 #define FST_LIB_EPSNORMALIZE_H__
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 
 
 #include <fst/factor-weight.h>
--- ./src/include/fst/equivalent.h.orig	2013-01-24 11:36:22.000000000 +0900
+++ ./src/include/fst/equivalent.h	2013-11-17 00:23:01.000000000 +0900
@@ -24,9 +24,15 @@
 #include <algorithm>
 #include <deque>
 using std::deque;
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 #include <utility>
 using std::pair; using std::make_pair;
 #include <vector>
--- ./src/include/fst/extensions/pdt/info.h.orig	2013-01-24 11:36:25.000000000 +0900
+++ ./src/include/fst/extensions/pdt/info.h	2013-11-17 00:23:01.000000000 +0900
@@ -21,12 +21,21 @@
 #ifndef FST_EXTENSIONS_PDT_INFO_H__
 #define FST_EXTENSIONS_PDT_INFO_H__
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#include <unordered_set>
+using std::unordered_set;
+using std::unordered_multiset;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
 #include <tr1/unordered_set>
 using std::tr1::unordered_set;
 using std::tr1::unordered_multiset;
+#endif
 #include <vector>
 using std::vector;
 
--- ./src/include/fst/extensions/pdt/paren.h.orig	2013-01-24 11:36:25.000000000 +0900
+++ ./src/include/fst/extensions/pdt/paren.h	2013-11-17 00:23:01.000000000 +0900
@@ -23,12 +23,21 @@
 #define FST_EXTENSIONS_PDT_PAREN_H_
 
 #include <algorithm>
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#include <unordered_set>
+using std::unordered_set;
+using std::unordered_multiset;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
 #include <tr1/unordered_set>
 using std::tr1::unordered_set;
 using std::tr1::unordered_multiset;
+#endif
 #include <set>
 
 #include <fst/extensions/pdt/pdt.h>
--- ./src/include/fst/extensions/pdt/pdt.h.orig	2013-01-24 11:36:25.000000000 +0900
+++ ./src/include/fst/extensions/pdt/pdt.h	2013-11-17 00:23:01.000000000 +0900
@@ -21,9 +21,15 @@
 #ifndef FST_EXTENSIONS_PDT_PDT_H__
 #define FST_EXTENSIONS_PDT_PDT_H__
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 #include <map>
 #include <set>
 
--- ./src/include/fst/extensions/pdt/replace.h.orig	2013-11-02 10:14:35.000000000 +0900
+++ ./src/include/fst/extensions/pdt/replace.h	2013-11-17 00:23:01.000000000 +0900
@@ -21,9 +21,15 @@
 #ifndef FST_EXTENSIONS_PDT_REPLACE_H__
 #define FST_EXTENSIONS_PDT_REPLACE_H__
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 
 #include <fst/replace.h>
 
--- ./src/include/fst/extensions/pdt/reverse.h.orig	2013-01-24 11:36:25.000000000 +0900
+++ ./src/include/fst/extensions/pdt/reverse.h	2013-11-17 00:23:01.000000000 +0900
@@ -21,9 +21,15 @@
 #ifndef FST_EXTENSIONS_PDT_REVERSE_H__
 #define FST_EXTENSIONS_PDT_REVERSE_H__
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 #include <vector>
 using std::vector;
 
--- ./src/include/fst/extensions/pdt/shortest-path.h.orig	2013-01-24 11:36:25.000000000 +0900
+++ ./src/include/fst/extensions/pdt/shortest-path.h	2013-11-17 00:23:01.000000000 +0900
@@ -25,12 +25,21 @@
 #include <fst/extensions/pdt/paren.h>
 #include <fst/extensions/pdt/pdt.h>
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#include <unordered_set>
+using std::unordered_set;
+using std::unordered_multiset;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
 #include <tr1/unordered_set>
 using std::tr1::unordered_set;
 using std::tr1::unordered_multiset;
+#endif
 #include <stack>
 #include <vector>
 using std::vector;
--- ./src/include/fst/factor-weight.h.orig	2013-01-24 11:36:23.000000000 +0900
+++ ./src/include/fst/factor-weight.h	2013-11-17 00:23:01.000000000 +0900
@@ -22,9 +22,15 @@
 #define FST_LIB_FACTOR_WEIGHT_H__
 
 #include <algorithm>
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 #include <string>
 #include <utility>
 using std::pair; using std::make_pair;
--- ./src/include/fst/label-reachable.h.orig	2013-01-24 11:36:23.000000000 +0900
+++ ./src/include/fst/label-reachable.h	2013-11-17 00:23:01.000000000 +0900
@@ -23,9 +23,15 @@
 #ifndef FST_LIB_LABEL_REACHABLE_H__
 #define FST_LIB_LABEL_REACHABLE_H__
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 #include <vector>
 using std::vector;
 
--- ./src/include/fst/relabel.h.orig	2013-01-24 11:36:23.000000000 +0900
+++ ./src/include/fst/relabel.h	2013-11-17 00:23:01.000000000 +0900
@@ -21,9 +21,15 @@
 #ifndef FST_LIB_RELABEL_H__
 #define FST_LIB_RELABEL_H__
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 #include <string>
 #include <utility>
 using std::pair; using std::make_pair;
@@ -34,9 +40,15 @@
 #include <fst/test-properties.h>
 
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 
 namespace fst {
 
--- ./src/include/fst/replace-util.h.orig	2013-01-24 11:36:24.000000000 +0900
+++ ./src/include/fst/replace-util.h	2013-11-17 00:23:01.000000000 +0900
@@ -25,12 +25,21 @@
 
 #include <vector>
 using std::vector;
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#include <unordered_set>
+using std::unordered_set;
+using std::unordered_multiset;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
 #include <tr1/unordered_set>
 using std::tr1::unordered_set;
 using std::tr1::unordered_multiset;
+#endif
 #include <map>
 
 #include <fst/connect.h>
--- ./src/include/fst/replace.h.orig	2013-01-24 11:36:24.000000000 +0900
+++ ./src/include/fst/replace.h	2013-11-17 00:23:01.000000000 +0900
@@ -22,9 +22,15 @@
 #ifndef FST_LIB_REPLACE_H__
 #define FST_LIB_REPLACE_H__
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 #include <set>
 #include <string>
 #include <utility>
--- ./src/include/fst/rmepsilon.h.orig	2013-01-24 11:36:24.000000000 +0900
+++ ./src/include/fst/rmepsilon.h	2013-11-17 00:23:01.000000000 +0900
@@ -21,9 +21,15 @@
 #ifndef FST_LIB_RMEPSILON_H__
 #define FST_LIB_RMEPSILON_H__
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 #include <fst/slist.h>
 #include <stack>
 #include <string>
--- ./src/include/fst/rmfinalepsilon.h.orig	2013-01-24 11:36:24.000000000 +0900
+++ ./src/include/fst/rmfinalepsilon.h	2013-11-17 00:23:01.000000000 +0900
@@ -21,9 +21,15 @@
 #ifndef FST_LIB_RMFINALEPSILON_H__
 #define FST_LIB_RMFINALEPSILON_H__
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_set>
+using std::unordered_set;
+using std::unordered_multiset;
+#else
 #include <tr1/unordered_set>
 using std::tr1::unordered_set;
 using std::tr1::unordered_multiset;
+#endif
 #include <vector>
 using std::vector;
 
--- ./src/include/fst/script/compile-impl.h.orig	2013-01-24 11:36:26.000000000 +0900
+++ ./src/include/fst/script/compile-impl.h	2013-11-17 00:23:01.000000000 +0900
@@ -21,9 +21,15 @@
 #ifndef FST_SCRIPT_COMPILE_IMPL_H_
 #define FST_SCRIPT_COMPILE_IMPL_H_
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 #include <sstream>
 #include <string>
 #include <vector>
--- ./src/include/fst/sparse-tuple-weight.h.orig	2013-01-24 11:36:24.000000000 +0900
+++ ./src/include/fst/sparse-tuple-weight.h	2013-11-17 00:23:01.000000000 +0900
@@ -33,9 +33,15 @@
 #include<string>
 #include<list>
 #include<stack>
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include<unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include<tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 
 #include <fst/weight.h>
 
--- ./src/include/fst/state-map.h.orig	2013-01-24 11:36:24.000000000 +0900
+++ ./src/include/fst/state-map.h	2013-11-17 00:23:01.000000000 +0900
@@ -23,9 +23,15 @@
 #define FST_LIB_STATE_MAP_H__
 
 #include <algorithm>
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
+#endif
 #include <string>
 #include <utility>
 using std::pair; using std::make_pair;
--- ./src/include/fst/symbol-table-ops.h.orig	2013-01-24 11:36:24.000000000 +0900
+++ ./src/include/fst/symbol-table-ops.h	2013-11-17 00:23:01.000000000 +0900
@@ -20,9 +20,15 @@
 #include <vector>
 using std::vector;
 #include <string>
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_set>
+using std::unordered_set;
+using std::unordered_multiset;
+#else
 #include <tr1/unordered_set>
 using std::tr1::unordered_set;
 using std::tr1::unordered_multiset;
+#endif
 
 
 #include <fst/fst.h>
--- ./src/include/fst/synchronize.h.orig	2013-01-24 11:36:24.000000000 +0900
+++ ./src/include/fst/synchronize.h	2013-11-17 00:23:01.000000000 +0900
@@ -22,12 +22,21 @@
 #define FST_LIB_SYNCHRONIZE_H__
 
 #include <algorithm>
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#include <unordered_set>
+using std::unordered_set;
+using std::unordered_multiset;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
 #include <tr1/unordered_set>
 using std::tr1::unordered_set;
 using std::tr1::unordered_multiset;
+#endif
 #include <string>
 #include <utility>
 using std::pair; using std::make_pair;
--- ./src/include/fst/test-properties.h.orig	2013-01-24 11:36:24.000000000 +0900
+++ ./src/include/fst/test-properties.h	2013-11-17 00:23:01.000000000 +0900
@@ -21,9 +21,15 @@
 #ifndef FST_LIB_TEST_PROPERTIES_H__
 #define FST_LIB_TEST_PROPERTIES_H__
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_set>
+using std::unordered_set;
+using std::unordered_multiset;
+#else
 #include <tr1/unordered_set>
 using std::tr1::unordered_set;
 using std::tr1::unordered_multiset;
+#endif
 
 #include <fst/dfs-visit.h>
 #include <fst/connect.h>
--- ./src/include/fst/util.h.orig	2013-01-24 11:36:24.000000000 +0900
+++ ./src/include/fst/util.h	2013-11-17 00:23:01.000000000 +0900
@@ -21,12 +21,21 @@
 #ifndef FST_LIB_UTIL_H__
 #define FST_LIB_UTIL_H__
 
+#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
+#include <unordered_map>
+using std::unordered_map;
+using std::unordered_multimap;
+#include <unordered_set>
+using std::unordered_set;
+using std::unordered_multiset;
+#else
 #include <tr1/unordered_map>
 using std::tr1::unordered_map;
 using std::tr1::unordered_multimap;
 #include <tr1/unordered_set>
 using std::tr1::unordered_set;
 using std::tr1::unordered_multiset;
+#endif
 #include <list>
 #include <map>
 #include <set>