forked from Lindharden/DISCO2-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·37 lines (30 loc) · 969 Bytes
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# Check if the number of arguments is exactly 1
if [ $# -ne 1 ]; then
echo "Usage: $0 [build|test]"
exit 1
fi
# Define the default value for cross-compile option
cross_compile_value="false"
# Check if the argument is 'build' or 'test'
if [ "$1" = "build" ]; then
echo "Building shared object files..."
cross_compile_value="true"
elif [ "$1" = "test" ]; then
echo "Building test files..."
else
echo "Invalid argument. Expected 'build' or 'test'."
exit 1
fi
# Write the option to meson_options.txt
echo "option('cross-compile', type : 'boolean', value : $cross_compile_value, description : 'Determine whether to cross-compile to AArch64')" > meson_options.txt
# Clean and setup the build directory
rm -rf builddir
if $cross_compile_value = "true"; then
meson setup builddir --cross-file linux-aarch64.txt
else
meson setup . builddir
fi
# Navigate to the build directory and build the project
ninja -C builddir
exit 0