🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.3 KiB

  1. #!/bin/sh
  2. if test "x$CC" = "x"; then
  3. CC=cc
  4. fi
  5. machine="$($CC -dumpmachine)"
  6. case "$machine" in
  7. *mingw* )
  8. EXEPREFIX=""
  9. EXESUFFIX=".exe"
  10. ;;
  11. *android* )
  12. EXEPREFIX="lib"
  13. EXESUFFIX=".so"
  14. EXTRA_LDFLAGS="$EXTRA_LDFLAGS -shared"
  15. ;;
  16. * )
  17. EXEPREFIX=""
  18. EXESUFFIX=""
  19. ;;
  20. esac
  21. set -e
  22. # Get the canonical path of the folder containing this script
  23. testdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
  24. CFLAGS="$( sdl2-config --cflags )"
  25. LDFLAGS="$( sdl2-config --libs )"
  26. STATIC_LDFLAGS="$( sdl2-config --static-libs )"
  27. compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_sdlconfig.c.o $CFLAGS $EXTRA_CFLAGS"
  28. link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig${EXESUFFIX} $LDFLAGS $EXTRA_LDFLAGS"
  29. static_link_cmd="$CC main_gui_sdlconfig.c.o -o ${EXEPREFIX}main_gui_sdlconfig_static${EXESUFFIX} $STATIC_LDFLAGS $EXTRA_LDFLAGS"
  30. echo "-- CC: $CC"
  31. echo "-- CFLAGS: $CFLAGS"
  32. echo "-- EXTRA_CFLAGS: $EXTRA_CFLAGS"
  33. echo "-- LDFLAGS: $LDFLAGS"
  34. echo "-- STATIC_LDFLAGS: $STATIC_LDFLAGS"
  35. echo "-- EXTRA_LDFLAGS: $EXTRA_LDFLAGS"
  36. echo "-- COMPILE: $compile_cmd"
  37. echo "-- LINK: $link_cmd"
  38. echo "-- STATIC_LINK: $static_link_cmd"
  39. set -x
  40. $compile_cmd
  41. $link_cmd
  42. $static_link_cmd