# We want the public API
Set("CONFIG_INSTALL_API");
+# Enable GCC link-time optimizations (experimental)
+UnSet("CONFIG_LTO");
+
# LibUCW should support files >2GB and threading
Set("CONFIG_UCW_LARGE_FILES");
Set("CONFIG_UCW_THREADS" => 1);
Append("LOPT" => "-s");
}
+# Link-time optimization (experimental)
+# This is currently very inefficient, because we do not attempt to disable
+# optimizations when compiling individual modules. Therefore, we optimize
+# each shared library module twice: when compiling and when linking.
+# Doing it properly would require hacking makefiles.
+if (IsSet("CONFIG_LTO")) {
+ Append("LOPT", "-flto");
+ Append("COPT", "-flto");
+}
+
if (IsSet("CONFIG_DARWIN")) {
# gcc-4.0 on Darwin doesn't set this in the gnu99 mode
Append("CLANG" => "-fnested-functions");