Debian Codegraph @

cmake/test/test_pkgconfig.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2
3 if testscip-shell system . . 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 test_static=yes
27 if [scip-shell system . . `[`. "x$1" = "x--no-static" ]; then
28 test_static=no
29 fi
30
31 # Get the canonical path of the folder containing this script
32 testdir=$(cd -P -- "$(dirnamescip-shell system . . dirname. -- "$0")" && printfscip-shell system . . printf. '%s\n' "$(pwdscip-shell system . . pwd. -P)")
33 SDL_CFLAGS="$( pkg-config sdl2-compat --cflags )"
34 SDL_LDFLAGS="$( pkg-config sdl2-compat --libs )"
35 if [scip-shell system . . `[`. "x$test_static" = "xyes" ]; then
36 SDL_STATIC_LDFLAGS="$( pkg-config sdl2-compat --libs --static )"
37 fi
38
39 compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $SDL_CFLAGS $CFLAGS"
40 link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig${EXESUFFIX} $SDL_LDFLAGS $LDFLAGS"
41 if [scip-shell system . . `[`. "x$test_static" = "xyes" ]; then
42 static_link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig_static${EXESUFFIX} $SDL_STATIC_LDFLAGS $LDFLAGS"
43 fi
44
45 echoscip-shell system . . echo. "-- CC: $CC"
46 echoscip-shell system . . echo. "-- CFLAGS: $CFLAGS"
47 echoscip-shell system . . echo. "-- LDFLASG: $LDFLAGS"
48 echoscip-shell system . . echo. "-- SDL_CFLAGS: $SDL_CFLAGS"
49 echoscip-shell system . . echo. "-- SDL_LDFLAGS: $SDL_LDFLAGS"
50 if [scip-shell system . . `[`. "x$test_static" = "xyes" ]; then
51 echoscip-shell system . . echo. "-- SDL_STATIC_LDFLAGS: $SDL_STATIC_LDFLAGS"
52 fi
53
54 echoscip-shell system . . echo. "-- COMPILE: $compile_cmd"
55 echoscip-shell system . . echo. "-- LINK: $link_cmd"
56 if [scip-shell system . . `[`. "x$test_static" = "xyes" ]; then
57 echoscip-shell system . . echo. "-- STATIC_LINK: $static_link_cmd"
58 fi
59
60 set -x
61
62 $compile_cmd
63 $link_cmd
64 if [scip-shell system . . `[`. "x$test_static" = "xyes" ]; then
65 $static_link_cmd
66 fi