Skip to content

Commit 3f77600

Browse files
committed
refactor: binutils-gdb 安装到项目目录
1 parent bb7a165 commit 3f77600

File tree

4 files changed

+54
-7
lines changed

4 files changed

+54
-7
lines changed

Diff for: test/test.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
root_dir=$(cd `dirname $0`/.. && pwd -P)
6+
7+
if [ ! -d "$root_dir/binutils-gdb" ]; then
8+
echo "not found"
9+
else
10+
echo "found"
11+
fi

Diff for: tools/binutils-gdb.sh

+31-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,38 @@
11
#!/bin/bash
22
set -e
3-
export https_proxy=http://172.27.176.1:7890
4-
git clone https://sourceware.org/git/binutils-gdb.git
3+
root_dir=$(cd `dirname $0`/.. && pwd -P)
4+
5+
success() {
6+
echo -e "\033[42;37m 成功 \033[0m $1"
7+
}
8+
notice() {
9+
echo -e "\033[36m $1 \033[0m "
10+
}
11+
fail() {
12+
echo -e "\033[41;37m 失败 \033[0m $1"
13+
}
14+
15+
if [ ! -d "$root_dir/binutils-gdb" ]; then
16+
notice "binutils-gdb not cloned, start to clone......"
17+
git clone https://sourceware.org/git/binutils-gdb.git
18+
fi
19+
20+
max_thread=$(cat /proc/cpuinfo| grep "processor"| wc -l)
21+
export JOBS=$max_thread
22+
523
cd binutils-gdb
624
mkdir build
725
cd build
8-
../configure --prefix=/opt/loongarch64/toolchain --target=x86_64-linux-gnu --disable-nls --enable-shared --enable-64-bit-bfd --disable-werror
9-
make -j12 && make install
26+
toolchain_dir="$root_dir/toolchain"
27+
mkdir -p "$toolchain_dir"
28+
29+
notice "configure binutils-gdb for x86_64"
30+
../configure --prefix=$toolchain_dir --target=x86_64-linux-gnu --disable-nls --enable-shared --enable-64-bit-bfd --disable-werror
31+
notice "make binutils-gdb for x86_64"
32+
make && make install
1033

1134
rm ./* -rf
12-
../configure --prefix=/opt/loongarch64/toolchain --target=loongarch64-linux-gnu --with-sysroot --disable-nls --enable-shared --enable-64-bit-bfd --disable-werror
13-
make -j12 && make install
35+
notice "configure binutils-gdb for loongarch64"
36+
../configure --prefix=$toolchain_dir --target=loongarch64-linux-gnu --with-sysroot --disable-nls --enable-shared --enable-64-bit-bfd --disable-werror
37+
notice "make binutils-gdb for loongarch64"
38+
make && make install

Diff for: tools/build.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
#!/bin/bash
2+
set -e
3+
4+
root_dir=$(cd `dirname $0`/.. && pwd -P)
5+
6+
cd "$root_dir/nwjs/src"
17
./buildtools/linux64/gn gen out/nw --args='clang_use_chrome_plugins=false treat_warnings_as_errors=false dcheck_always_on=false use_gold=false use_lld=false clang_base_path="/opt/loongarch64/llvm-18" is_debug=false is_component_build=false is_component_ffmpeg=true target_cpu="loong64" use_sysroot=false'
2-
PYTHONPATH=${PWD}/third_party/node-nw/tools/v8_gypfiles GYP_CHROMIUM_NO_ACTION=0 GYP_CROSSCOMPILE=1 ./build/gyp_chromium -I third_party/node-nw/common.gypi -D building_nw=1 -D clang=1 -D target_arch=loong64 -D clang_base_dir="/opt/loongarch64/llvm-18" third_party/node-nw/node.gyp --no-duplicate-basename-check
8+
PYTHONPATH=${PWD}/third_party/node-nw/tools/v8_gypfiles GYP_CHROMIUM_NO_ACTION=0 GYP_CROSSCOMPILE=1 ./build/gyp_chromium -I third_party/node-nw/common.gypi -D building_nw=1 -D clang=1 -D target_arch=loong64 -D clang_base_dir="/opt/loongarch64/llvm-18" third_party/node-nw/node.gyp --no-duplicate-basename-check

Diff for: tools/setup.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -e
3+
4+
root_dir=$(cd `dirname $0`/.. && pwd -P)
5+

0 commit comments

Comments
 (0)