configure.ac 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. AC_PREREQ([2.52])
  2. AC_INIT(libtinySAK, 0.1, diopmamadou@doubango.org)
  3. AM_INIT_AUTOMAKE
  4. AC_CONFIG_HEADERS([config.h])
  5. AC_CONFIG_SRCDIR([src/tsk.c])
  6. dnl find suitable C++ compiler
  7. AC_PROG_CC
  8. AC_PROG_INSTALL
  9. AC_LIBTOOL_WIN32_DLL
  10. AC_PROG_LIBTOOL
  11. ## Are we using Windows?
  12. #dnl detecting WIN32
  13. #case "$host" in
  14. # *cygwin* | *mingw*)
  15. # AC_DEFINE([WIN32], [], "Using Windows as target os.")
  16. # ;;
  17. # *)
  18. # AC_MSG_RESULT(${host} is not Windows... I will do my best.)
  19. # ;;
  20. #esac
  21. # CFLAGS
  22. CFLAGS="${CFLAGS=}"
  23. #echo Setting up build environment for ${target_cpu}${target_os}
  24. ### ENABLE-DEBUG
  25. AC_MSG_CHECKING(whether to enable debugging)
  26. debug_default="yes"
  27. AC_ARG_ENABLE(debug,
  28. [ --enable-debug[=no/yes] turn on/off debugging
  29. [[default=$debug_default]]],
  30. [ if test "x$enableval" = "xyes" ; then
  31. CFLAGS="$CFLAGS -O0 -g3 -DDEBUG"
  32. AC_MSG_RESULT(yes)
  33. else
  34. CFLAGS="$CFLAGS -O3 -NDEBUG"
  35. AC_MSG_RESULT(no)
  36. fi
  37. ],
  38. [CFLAGS="$CFLAGS -O0 -g3 -DDEBUG"
  39. AC_MSG_RESULT(yes)])
  40. ### DEBUG-LEVEL
  41. AC_ARG_WITH(debug-level,
  42. [ --with-debug-level[=level] Set debug-level to level [[default=info]]
  43. info: informational
  44. warn: warnings
  45. error [default]: errors
  46. fatal: fatal],
  47. [ if test "x$withval" = "xinfo" ; then
  48. AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_INFO, [info debug])
  49. AC_MSG_RESULT(info)
  50. elif test "x$withval" = "xwarn" ; then
  51. AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_INFO, [warn debug])
  52. AC_MSG_RESULT(warn)
  53. elif test "x$withval" = "xerror" ; then
  54. AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_ERROR, [error debug])
  55. AC_MSG_RESULT(error)
  56. elif test "x$withval" = "xfatal" ; then
  57. AC_DEFINE(DEBUG_LEVEL, DEBUG_LEVEL_FATAL, [fatal debug])
  58. AC_MSG_RESULT(fatal)
  59. fi
  60. ])
  61. AC_OUTPUT(
  62. Makefile
  63. src/Makefile
  64. test/Makefile
  65. )