return %settings;
}
+sub __test_compiler($) {
+ my $compiler = shift;
+ return 0 unless run_test("`$compiler`", !system "$compiler -v >/dev/null 2>&1");
+ return 0 unless run_test("`$compiler`", test_file($compiler, 'compiler.cpp', '-fno-rtti'), 'compatible');
+ return 1;
+}
+
sub cmd_clean {
unlink CONFIGURE_CACHE_FILE;
}
exit 0;
}
-sub run_test($$) {
- my ($what, $result) = @_;
- print_format "Checking whether <|GREEN $what|> is available ... ";
+sub run_test($$;$) {
+ my ($what, $result, $adjective) = @_;
+ $adjective ||= 'available';
+ print_format "Checking whether <|GREEN $what|> is $adjective ... ";
print_format $result ? "<|GREEN yes|>\n" : "<|RED no|>\n";
return $result;
}
sub find_compiler {
my @compilers = qw(c++ g++ clang++ icpc);
foreach my $compiler (shift || @compilers) {
- return $compiler if run_test "`$compiler`", test_file $compiler, 'compiler.cpp';
- if ($^O eq 'darwin') {
- return $compiler if run_test "`xcrun $compiler`", test_file "xcrun $compiler", 'compiler.cpp';
- }
+ return $compiler if __test_compiler $compiler;
+ return "xcrun $compiler" if $^O eq 'darwin' && __test_compiler "xcrun $compiler";
}
}
SYSTEM = @SYSTEM_NAME@
BUILDPATH ?= $(PWD)/build
SOCKETENGINE = @SOCKETENGINE@
-CORECXXFLAGS = -fPIC -fvisibility-inlines-hidden -pipe -Iinclude -Wall -Wextra -Wfatal-errors -Wno-unused-parameter -Wshadow
+CORECXXFLAGS = -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -pipe -Iinclude -Wall -Wextra -Wfatal-errors -Wno-unused-parameter -Wshadow
LDLIBS = -lstdc++
CORELDFLAGS = -rdynamic -L. $(LDFLAGS)
PICLDFLAGS = -fPIC -shared -rdynamic $(LDFLAGS)
@ENDIF
@ENDIF
-@IFNEQ $(SYSTEM)-$(COMPILER) darwin-GCC
- CORECXXFLAGS += -fvisibility=hidden
-@ENDIF
-
@IFNEQ $(SYSTEM) darwin
LDLIBS += -pthread
@ENDIF
#include <iostream>
#if defined _LIBCPP_VERSION
+# include <type_traits>
# include <unordered_map>
#else
+# include <tr1/type_traits>
# include <tr1/unordered_map>
#endif
+#if defined __APPLE__ && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ == 1
+# error "LLVM-GCC 4.2.1 has broken visibility support."
+#endif
+
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;