diff --git a/setup_build.sh b/setup_build.sh new file mode 100755 index 0000000..258c285 --- /dev/null +++ b/setup_build.sh @@ -0,0 +1,29 @@ +#!/bin/bash +cpu=$(arch) #cpu架构 +strinstallpath="" +read -p "Enter the path you want to install: " installpath +strinstallpath=$installpath"/libusb_install" +echo $strinstallpath + +if [!-d $strinstallpath];then + echo "$strinstallpath do not exist,will make dir" + mkdir $strinstallpath +else + echo "$strinstallpath exist" +fi + +./bootstrap.sh +if [ "$cpu" == "loongarch64" ]; then +./configure --build=loongarch64-unknown-linux-gnu --with-pic --prefix=$strinstallpath --enable-static=no --enable-static=yes + +else + ./configure --with-pic --prefix=$strinstallpath --enable-shared=no --enable-static=yes +fi + +echo "configure done!!!!" +echo "start to make source code" +make -j4 +echo "make done" +echo "start to make install " +make install +echo "make install done! installed in "