The ninja port is configured to compile with g++, not clang. Clang is the FreeBSD default compiler and sets defines differently than g++. One error with the default use of clang is use of a g++ deprecated and hence removed /user/include/c++/v1/ext/hash_map file: src/hash_map.h:91:10: fatal error: 'ext/hash_map' file not found The port's Makefile correctly uses the gnu replacement for hash_map only if you use g++, and NOT clang. I tried using "clang-cpp -x c++ -std=c++0x" in place of ${CXX} in the port's Makefile, but I still had additional build errors. To build the port, I substituted g++ for ${CXX} in the Makefile. You will not experience this problem if you retained the old include files from earlier g++ distributions! Pertinent info... PORTNAME=ninja PORTVERSION=1.6.0 FreeBSD 10.2-RELEASE-p7 #0.... root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386 # c++ --version FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 Target: i386-unkown-freebsd10.2 Thread model: posix # g++ --version g++ (FreeBSD Ports Collection) 4.8.5 Copyright (C) 2015 Free Software Foundation, Inc. ...
Looks like issue on your system. On fresh FreeBSD 10.2: - I have no problem with building ninja using clang. - There is no g++ in base system. - /usr/include/c++/v1/hash_map should be from LLVM not from GCC nor removed.
My system is from a previous release 9 something, upgraded to 10.0, then 10.2 using freebsd-update. freebsd-update -r 10.2-RELEASE IDS did not report anything wrong with /usr/include I'm not sure how to proceed.
I nuked my system and reinstalled 10.0 from scratch (I have a DVD). Directory /usr/include/c++/v1/ext returned. Have run freebsd-update to 10.2-RELEASE, and the includes are still there. I have no idea why these includes disappeared in the first place. Thanks for your patience.