3d engine indev
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.

115 lines
1.5KB

  1. #! /bin/bash
  2. #
  3. # Basic configuration
  4. #
  5. output="Makefile.cfg"
  6. #
  7. # Help screen
  8. #
  9. help()
  10. {
  11. cat << EOF
  12. Configuration script for the fxengine library.
  13. Usage: $0 [options...]
  14. Specified target :
  15. --fxcg50
  16. --fx9680g
  17. If you don't send any option, fx9860g is set as default
  18. * Note fxcg50 is not really supported now, but maybe someday it would happen !
  19. Optional dependencies :
  20. --libprof
  21. By default, profiling is disabled, tht means you will not have access to fps. :(
  22. This option enables fps count, but you need to have libprof (by Lephenixnoir) installed
  23. --liblog
  24. If you want more advanced debug options, you can add this to add a virtual stream used for
  25. logging debug informations
  26. You need tou have liblog (by me) installed
  27. EOF
  28. exit 0
  29. }
  30. if [[ "$@" == "--help" ]]; then
  31. help
  32. exit 1
  33. fi
  34. #
  35. # Parsing arguments
  36. #
  37. target=-DFX9860G
  38. libprof=
  39. liblog=
  40. fail=false
  41. for arg; do case "$arg" in
  42. -h | -? | --help)
  43. help;;
  44. --libprof)
  45. libprof=-DUSE_LIBPROF;;
  46. --liblog)
  47. liblog=-DUSE_LIBLOG;;
  48. --fx9860g)
  49. target=-DFX9860G;;
  50. --fxcg50)
  51. target=-DFXCG50;;
  52. *)
  53. echo "error: unrecognized argument '$arg'";
  54. fail=true;;
  55. esac; done
  56. #
  57. # Checking mandatory arguments
  58. #
  59. if $fail; then
  60. echo "Oops ! Maybe a wrong option..."
  61. exit 1
  62. fi
  63. #
  64. # Output config
  65. #
  66. output_config()
  67. {
  68. echo -n "FLAGS ="
  69. echo -n " $(echo $target)"
  70. echo -n " $(echo $libprof)"
  71. echo -n " $(echo $liblog)"
  72. echo ""
  73. }
  74. output_config > $output
  75. echo "Configuration saved in $output, ready to make!"