diff options
author | 3gg <3gg@shellblade.net> | 2024-05-04 16:51:29 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2024-05-04 16:51:29 -0700 |
commit | 8222bfe56d4dabe8d92fc4b25ea1b0163b16f3e1 (patch) | |
tree | 763389e42276035ac134d94eb1dc32293b88d807 /src/contrib/SDL-2.30.2/cmake/test/test_sdlconfig.sh |
Initial commit.
Diffstat (limited to 'src/contrib/SDL-2.30.2/cmake/test/test_sdlconfig.sh')
-rwxr-xr-x | src/contrib/SDL-2.30.2/cmake/test/test_sdlconfig.sh | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/contrib/SDL-2.30.2/cmake/test/test_sdlconfig.sh b/src/contrib/SDL-2.30.2/cmake/test/test_sdlconfig.sh new file mode 100755 index 0000000..fa41dbb --- /dev/null +++ b/src/contrib/SDL-2.30.2/cmake/test/test_sdlconfig.sh | |||
@@ -0,0 +1,51 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if test "x$CC" = "x"; then | ||
4 | CC=cc | ||
5 | fi | ||
6 | |||
7 | machine="$($CC -dumpmachine)" | ||
8 | case "$machine" in | ||
9 | *mingw* ) | ||
10 | EXEPREFIX="" | ||
11 | EXESUFFIX=".exe" | ||
12 | ;; | ||
13 | *android* ) | ||
14 | EXEPREFIX="lib" | ||
15 | EXESUFFIX=".so" | ||
16 | LDFLAGS="$LDFLAGS -shared" | ||
17 | ;; | ||
18 | * ) | ||
19 | EXEPREFIX="" | ||
20 | EXESUFFIX="" | ||
21 | ;; | ||
22 | esac | ||
23 | |||
24 | set -e | ||
25 | |||
26 | # Get the canonical path of the folder containing this script | ||
27 | testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)") | ||
28 | SDL_CFLAGS="$( sdl2-config --cflags )" | ||
29 | SDL_LDFLAGS="$( sdl2-config --libs )" | ||
30 | SDL_STATIC_LDFLAGS="$( sdl2-config --static-libs )" | ||
31 | |||
32 | compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_sdlconfig.c.o $CFLAGS $SDL_CFLAGS" | ||
33 | link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig${EXESUFFIX} $SDL_LDFLAGS $LDFLAGS" | ||
34 | static_link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig_static${EXESUFFIX} $SDL_STATIC_LDFLAGS $LDFLAGS" | ||
35 | |||
36 | echo "-- CC: $CC" | ||
37 | echo "-- CFLAGS: $CFLAGS" | ||
38 | echo "-- LDFLAGS: $LDFLAGS" | ||
39 | echo "-- SDL_CFLAGS: $SDL_CFLAGS" | ||
40 | echo "-- SDL_LDFLAGS: $SDL_LDFLAGS" | ||
41 | echo "-- SDL_STATIC_LDFLAGS: $SDL_STATIC_LDFLAGS" | ||
42 | |||
43 | echo "-- COMPILE: $compile_cmd" | ||
44 | echo "-- LINK: $link_cmd" | ||
45 | echo "-- STATIC_LINK: $static_link_cmd" | ||
46 | |||
47 | set -x | ||
48 | |||
49 | $compile_cmd | ||
50 | $link_cmd | ||
51 | $static_link_cmd | ||