forked from Lindharden/DIPP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure_run
More file actions
executable file
·39 lines (35 loc) · 1.05 KB
/
configure_run
File metadata and controls
executable file
·39 lines (35 loc) · 1.05 KB
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
38
39
#!/bin/sh
# Default to native build if no arguments provided
CROSS_FILE=""
BUILD_DIR="builddir"
# Check for cross-compilation argument
if [ "$1" = "cross" ] || [ "$1" = "--cross" ]; then
if [ -f "yocto_cross.ini" ]; then
CROSS_FILE="--cross-file yocto_cross.ini"
BUILD_DIR="builddir"
echo "Using cross-compilation with yocto_cross.ini"
else
echo "Error: yocto_cross.ini not found for cross-compilation"
exit 1
fi
elif [ -n "$1" ]; then
# Allow specifying custom cross file
if [ -f "$1" ]; then
CROSS_FILE="--cross-file $1"
BUILD_DIR="builddir"
echo "Using cross-compilation with $1"
else
echo "Error: Cross file $1 not found"
exit 1
fi
fi
echo "Building in directory: $BUILD_DIR"
rm -rf $BUILD_DIR
meson setup . $BUILD_DIR $CROSS_FILE
ninja -C $BUILD_DIR
# Only run the executable if native build (cross-compiled binaries can't run on host)
if [ -z "$CROSS_FILE" ]; then
./$BUILD_DIR/dipp
else
echo "Cross-compiled binary created at $BUILD_DIR/dipp"
fi