build.sh 761 B

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