🛠️🐜 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. LDFLAGS="$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. SDL_CFLAGS="$( pkg-config sdl2 --cflags )"
  25. SDL_LDFLAGS="$( pkg-config sdl2 --libs )"
  26. SDL_STATIC_LDFLAGS="$( pkg-config sdl2 --libs --static )"
  27. compile_cmd="$CC -c "$testdir/main_gui.c" -o main_gui_pkgconfig.c.o $SDL_CFLAGS $CFLAGS"
  28. link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig${EXESUFFIX} $SDL_LDFLAGS $LDFLAGS"
  29. static_link_cmd="$CC main_gui_pkgconfig.c.o -o ${EXEPREFIX}main_gui_pkgconfig_static${EXESUFFIX} $SDL_STATIC_LDFLAGS $LDFLAGS"
  30. echo "-- CC: $CC"
  31. echo "-- CFLAGS: $CFLAGS"
  32. echo "-- LDFLASG: $LDFLAGS"
  33. echo "-- SDL_CFLAGS: $SDL_CFLAGS"
  34. echo "-- SDL_LDFLAGS: $SDL_LDFLAGS"
  35. echo "-- SDL_STATIC_LDFLAGS: $SDL_STATIC_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