mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-04-19 08:55:16 +00:00
Merge df3b20b2664169df78f7b60921b86ac6ad884d8e into 2dafe755097057a4faf5e240f0abc98b9b4cdcb8
This commit is contained in:
commit
f67fdd9990
@ -1,32 +1,40 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Remove existing files
|
||||||
rm -f vtoygpt_64
|
rm -f vtoygpt_64
|
||||||
rm -f vtoygpt_32
|
rm -f vtoygpt_32
|
||||||
rm -f vtoygpt_aa64
|
rm -f vtoygpt_aa64
|
||||||
|
|
||||||
|
# Compile for x86_64
|
||||||
/opt/diet64/bin/diet -Os gcc -D_FILE_OFFSET_BITS=64 vtoygpt.c crc32.c -o vtoygpt_64
|
/opt/diet64/bin/diet -Os gcc -D_FILE_OFFSET_BITS=64 vtoygpt.c crc32.c -o vtoygpt_64
|
||||||
|
|
||||||
|
# Compile for i386
|
||||||
/opt/diet32/bin/diet -Os gcc -D_FILE_OFFSET_BITS=64 -m32 vtoygpt.c crc32.c -o vtoygpt_32
|
/opt/diet32/bin/diet -Os gcc -D_FILE_OFFSET_BITS=64 -m32 vtoygpt.c crc32.c -o vtoygpt_32
|
||||||
|
|
||||||
|
# Compile for aarch64
|
||||||
aarch64-buildroot-linux-uclibc-gcc -Os -static -D_FILE_OFFSET_BITS=64 vtoygpt.c crc32.c -o vtoygpt_aa64
|
aarch64-buildroot-linux-uclibc-gcc -Os -static -D_FILE_OFFSET_BITS=64 vtoygpt.c crc32.c -o vtoygpt_aa64
|
||||||
|
|
||||||
|
# Compile for mips64el
|
||||||
mips64el-linux-musl-gcc -mips64r2 -mabi=64 -static -Os -D_FILE_OFFSET_BITS=64 vtoygpt.c crc32.c -o vtoygpt_m64e
|
mips64el-linux-musl-gcc -mips64r2 -mabi=64 -static -Os -D_FILE_OFFSET_BITS=64 vtoygpt.c crc32.c -o vtoygpt_m64e
|
||||||
|
|
||||||
|
# Check compilation success
|
||||||
#gcc -D_FILE_OFFSET_BITS=64 -static -Wall vtoygpt.c -o vtoytool_64
|
|
||||||
#gcc -D_FILE_OFFSET_BITS=64 -Wall -m32 vtoygpt.c -o vtoytool_32
|
|
||||||
|
|
||||||
if [ -e vtoygpt_64 ] && [ -e vtoygpt_32 ] && [ -e vtoygpt_aa64 ] && [ -e vtoygpt_m64e ]; then
|
if [ -e vtoygpt_64 ] && [ -e vtoygpt_32 ] && [ -e vtoygpt_aa64 ] && [ -e vtoygpt_m64e ]; then
|
||||||
echo -e '\n############### SUCCESS ###############\n'
|
echo -e '\n############### SUCCESS ###############\n'
|
||||||
|
|
||||||
|
# Move files to installation directories
|
||||||
mv vtoygpt_64 ../INSTALL/tool/x86_64/vtoygpt
|
mv vtoygpt_64 ../INSTALL/tool/x86_64/vtoygpt
|
||||||
mv vtoygpt_32 ../INSTALL/tool/i386/vtoygpt
|
mv vtoygpt_32 ../INSTALL/tool/i386/vtoygpt
|
||||||
|
|
||||||
|
# Strip symbols and move aarch64 executable
|
||||||
aarch64-buildroot-linux-uclibc-strip --strip-all vtoygpt_aa64
|
aarch64-buildroot-linux-uclibc-strip --strip-all vtoygpt_aa64
|
||||||
mv vtoygpt_aa64 ../INSTALL/tool/aarch64/vtoygpt
|
mv vtoygpt_aa64 ../INSTALL/tool/aarch64/vtoygpt
|
||||||
|
|
||||||
|
# Strip symbols and move mips64el executable
|
||||||
mips64el-linux-musl-strip --strip-all vtoygpt_m64e
|
mips64el-linux-musl-strip --strip-all vtoygpt_m64e
|
||||||
mv vtoygpt_m64e ../INSTALL/tool/mips64el/vtoygpt
|
mv vtoygpt_m64e ../INSTALL/tool/mips64el/vtoygpt
|
||||||
|
|
||||||
|
echo -e 'Compilation successful. Executables moved to the installation directory.'
|
||||||
else
|
else
|
||||||
echo -e '\n############### FAILED ################\n'
|
echo -e '\n############### FAILED ################\n'
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user