diff options
author | miwi <miwi@FreeBSD.org> | 2011-02-13 19:10:59 +0800 |
---|---|---|
committer | miwi <miwi@FreeBSD.org> | 2011-02-13 19:10:59 +0800 |
commit | ba43faa194a9810492dac5fcf53487305d52e0fc (patch) | |
tree | cc5471ba08202afb17a55f3f38e4b2a2c1ba0549 /devel/ninja/files | |
parent | 4e68474ccc4d0971fef5aa4c794da19e71a61ab0 (diff) | |
download | freebsd-ports-gnome-ba43faa194a9810492dac5fcf53487305d52e0fc.tar.gz freebsd-ports-gnome-ba43faa194a9810492dac5fcf53487305d52e0fc.tar.zst freebsd-ports-gnome-ba43faa194a9810492dac5fcf53487305d52e0fc.zip |
Ninja is yet another build system. It takes as input the interdependencies
of files (typically source code and output executables) and orchestrates
building them, quickly.
Ninja joins a sea of other build systems. Its distinguishing goal is to be
fast. It is born from my work on the Chromium browser project, which has
over 30,000 source files and whose other build systems (including one built
from custom non-recursive Makefiles) can take ten seconds to start building
after changing one file. Ninja is under a second.
WWW: https://github.com/martine/ninja
PR: ports/154603
Submitted by: Grzegorz Blach <magik at roorback.net>
Diffstat (limited to 'devel/ninja/files')
-rw-r--r-- | devel/ninja/files/patch-build.ninja | 11 | ||||
-rw-r--r-- | devel/ninja/files/patch-src-ninja.cc | 33 |
2 files changed, 44 insertions, 0 deletions
diff --git a/devel/ninja/files/patch-build.ninja b/devel/ninja/files/patch-build.ninja new file mode 100644 index 000000000000..4a5a0b485544 --- /dev/null +++ b/devel/ninja/files/patch-build.ninja @@ -0,0 +1,11 @@ +--- build.ninja.orig 2011-02-10 19:29:29.000000000 +0100 ++++ build.ninja 2011-02-10 19:29:33.000000000 +0100 +@@ -24,7 +24,7 @@ + description = CC $out + + rule ar +- command = ar crsT $out $in ++ command = ar crs $out $in + description = AR $out + + rule link diff --git a/devel/ninja/files/patch-src-ninja.cc b/devel/ninja/files/patch-src-ninja.cc new file mode 100644 index 000000000000..1e6d680429ea --- /dev/null +++ b/devel/ninja/files/patch-src-ninja.cc @@ -0,0 +1,33 @@ +--- src/ninja.orig 2011-02-10 17:21:11.000000000 +0200 ++++ src/ninja.cc 2011-02-10 17:21:43.000000000 +0200 +@@ -20,6 +20,9 @@ + #include <stdio.h> + #include <string.h> + #include <sys/stat.h> ++#if defined(__APPLE__) || defined(__FreeBSD__) ++#include <sys/sysctl.h> ++#endif + #include <sys/types.h> + + #include "build.h" +@@ -64,6 +67,7 @@ void usage(const BuildConfig& config) { + int GuessParallelism() { + int processors = 0; + ++#if defined(linux) + const char kProcessorPrefix[] = "processor\t"; + char buf[16 << 10]; + FILE* f = fopen("/proc/cpuinfo", "r"); +@@ -74,6 +78,12 @@ int GuessParallelism() { + ++processors; + } + fclose(f); ++#elif defined(__APPLE__) || defined(__FreeBSD__) ++ size_t procSize = sizeof(processors); ++ int name[] = {CTL_HW, HW_NCPU}; ++ if (sysctl(name, sizeof(name) / sizeof(int), &processors, &procSize, NULL, 0)) ++ return 2; ++#endif + + switch (processors) { + case 0: |