diff --git a/source/build.sh b/source/build.sh index 94b86bc..4e07002 100755 --- a/source/build.sh +++ b/source/build.sh @@ -19,19 +19,23 @@ function build_native() { mkdir -p ${BUILDDIR} cd ${SCRIPT_DIR} + CC="${HOME}/.musl-cross/x86_64-linux-musl-native/bin/x86_64-linux-musl-gcc" + CXX="${HOME}/.musl-cross/x86_64-linux-musl-native/bin/x86_64-linux-musl-g++" + + cmake -B ${BUILDDIR} -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_LINKER=mold \ - -DCMAKE_C_COMPILER=clang \ - -DCMAKE_CXX_COMPILER=clang++ + -DCMAKE_C_COMPILER=${CC} \ + -DCMAKE_CXX_COMPILER=${CXX} cd ${BUILDDIR} ninja -j"$JOBS" - upx ${BUILDDIR}/dropshell - cp ${BUILDDIR}/dropshell ${OUTPUT_DIR}/dropshell + #upx ${BUILDDIR}/dropshell + cp ${BUILDDIR}/dropshell ${OUTPUT_DIR}/dropshell.native cd ${PREVDIR} } @@ -40,6 +44,6 @@ build_native echo "Auto-installing dropshell locally..." mkdir -p "${INSTALL_DIR}" -cp "${OUTPUT_DIR}/dropshell" "${INSTALL_DIR}/dropshell" +cp "${OUTPUT_DIR}/dropshell.native" "${INSTALL_DIR}/dropshell" ds version -echo "Build process completed!" \ No newline at end of file +echo "Build process completed!" diff --git a/source/install_build_prerequisites.sh b/source/install_build_prerequisites.sh index 8cf06e5..f47f1c7 100755 --- a/source/install_build_prerequisites.sh +++ b/source/install_build_prerequisites.sh @@ -107,6 +107,13 @@ if [ ! -d "$INSTALL_DIR/x86_64-linux-musl-cross" ]; then tar -C "$INSTALL_DIR" -xvf "$TMPDIR/x86_64-linux-musl-cross.tgz" fi +# x86_64 native +if [ ! -d "$INSTALL_DIR/x86_64-linux-musl-native" ]; then + echo "Downloading x86_64 musl native toolchain..." + wget -nc -O "$TMPDIR/x86_64-linux-musl-native.tgz" $MUSL_CC_URL/x86_64-linux-musl-native.tgz + tar -C "$INSTALL_DIR" -xvf "$TMPDIR/x86_64-linux-musl-native.tgz" +fi + # aarch64 if [ ! -d "$INSTALL_DIR/aarch64-linux-musl-cross" ]; then echo "Downloading aarch64 musl cross toolchain..."