1
2# 编译前请先设置参数
3sys_root=$DRAGONOS_SYSROOT
4src_path=请填写flex的路径
5
6current_path=$(pwd)
7# 要安装到的目录
8PREFIX=/usr
9
10
11if [ ! -d ${src_path} ]; then
12    echo "Error: ${src_path} not found"
13    exit 1
14fi
15
16if [ ! -d ${sysroot} ]; then
17    echo "Error: ${sysroot} not found"
18    exit 1
19fi
20
21cd ${src_path}
22autoreconf --install
23autoconf
24sed -i 's/ios[*]/ios* | dragonos* /' build-aux/config.sub
25
26cd ${current_path}
27
28mkdir -p build || exit 1
29mkdir -p ${PREFIX} || exit 1
30
31cd build
32${src_path}/configure --prefix=${PREFIX} --host=x86_64-dragonos || exit 1
33make -j $(nproc) || exit 1
34make DESTDIR=${sys_root} install|| exit 1
35make clean
36cd ..
37rm -rf build