48 lines
1.8 KiB
Plaintext
48 lines
1.8 KiB
Plaintext
|
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
||
|
# Use of this source code is governed by a BSD-style license that can be
|
||
|
# found in the LICENSE file.
|
||
|
|
||
|
cc = "gcc"
|
||
|
cxx = "g++"
|
||
|
ld = cxx
|
||
|
|
||
|
toolchain("gcc") {
|
||
|
tool("cc") {
|
||
|
# cflags_pch_c
|
||
|
command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c -c \$in -o \$out"
|
||
|
description = "CC \$out"
|
||
|
depfile = "\$out.d"
|
||
|
deps = "gcc"
|
||
|
}
|
||
|
tool("cxx") {
|
||
|
# cflags_pch_cc
|
||
|
command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc -c \$in -o \$out"
|
||
|
description = "CXX \$out"
|
||
|
depfile = "\$out.d"
|
||
|
deps = "gcc"
|
||
|
}
|
||
|
tool("alink") {
|
||
|
command = "rm -f \$out && ar rcs \$out \$in"
|
||
|
description = "AR \$out"
|
||
|
}
|
||
|
tool("solink") {
|
||
|
command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ]; then $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi"
|
||
|
description = "SOLINK \$lib"
|
||
|
#pool = "link_pool"
|
||
|
restat = "1"
|
||
|
}
|
||
|
tool("link") {
|
||
|
command = "$ld \$ldflags -o \$out -Wl,--start-group \$in \$solibs -Wl,--end-group \$libs"
|
||
|
description = "LINK \$out"
|
||
|
#pool = "link_pool"
|
||
|
}
|
||
|
tool("stamp") {
|
||
|
command = "\${postbuilds}touch \$out"
|
||
|
description = "STAMP \$out"
|
||
|
}
|
||
|
tool("copy") {
|
||
|
command = "ln -f \$in \$out 2>/dev/null || (rm -rf \$out && cp -af \$in \$out)"
|
||
|
description = "COPY \$in \$out"
|
||
|
}
|
||
|
}
|