EXTRA_LDFLAGS=
elif [ "${SYSTEMNAME}" = "FreeBSD" ]; then
EXTRA_CFLAGS="-I/usr/local/include"
- EXTRA_LDFLAGS="-L/usr/local/lib -lexecinfo"
+ EXTRA_LDFLAGS="-L/usr/local/lib"
fi
cat >config.ninja <<EOT
echo "Building ninja manually..."
srcs=$(ls src/*.cc | grep -v test)
-if [ "${SYSTEMNAME}" = "Linux" ]; then
- g++ -Wno-deprecated -o ninja.bootstrap $srcs
-elif [ "${SYSTEMNAME}" = "FreeBSD" ]; then
- g++ -Wno-deprecated ${EXTRA_CFLAGS} ${EXTRA_LDFLAGS} -o ninja.bootstrap $srcs
-fi
+g++ -Wno-deprecated ${EXTRA_CFLAGS} ${EXTRA_LDFLAGS} -o ninja.bootstrap $srcs
echo "Building ninja using itself..."
./ninja.bootstrap ninja
#include "util.h"
-#include <execinfo.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
-void DumpBacktrace(int skip_frames) {
- void* stack[256];
- int size = backtrace(stack, 256);
- ++skip_frames; // Skip ourselves as well.
- backtrace_symbols_fd(stack + skip_frames, size - skip_frames, 2);
-}
-
void Fatal(const char* msg, ...) {
va_list ap;
fprintf(stderr, "FATAL: ");
vfprintf(stderr, msg, ap);
va_end(ap);
fprintf(stderr, "\n");
- DumpBacktrace(1);
exit(1);
}