ETL.m4 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # ETL M4 Macro
  2. # For GNU Autotools
  3. # $Id$
  4. #
  5. # By Robert B. Quattlebaum Jr. <darco@users.sf.net>
  6. #
  7. AC_DEFUN([ETL_DEPS],
  8. [
  9. AC_CHECK_LIB(user32, main)
  10. AC_CHECK_LIB([kernel32], [CreateMutex])
  11. AC_CHECK_LIB([pthread], [pthread_mutex_init])
  12. AC_HEADER_STDC
  13. AC_CHECK_HEADERS(pthread.h)
  14. AC_CHECK_HEADERS(sched.h)
  15. AC_CHECK_HEADERS(sys/time.h)
  16. AC_CHECK_HEADERS(unistd.h)
  17. AC_CHECK_HEADERS(windows.h)
  18. AC_CHECK_FUNCS([pthread_create])
  19. AC_CHECK_FUNCS([pthread_rwlock_init])
  20. AC_CHECK_FUNCS([sched_yield])
  21. AC_CHECK_FUNCS([CreateThread])
  22. AC_CHECK_FUNCS([QueryPerformanceCounter])
  23. AC_CHECK_FUNCS([gettimeofday])
  24. AC_CHECK_FUNCS([sscanf])
  25. AC_CHECK_FUNCS([vsscanf])
  26. AC_CHECK_FUNCS([vsprintf])
  27. AC_CHECK_FUNCS([vasprintf])
  28. AC_CHECK_FUNCS([vsnprintf],[],[
  29. AC_CHECK_FUNC([_vsnprintf],[
  30. AC_DEFINE(vsnprintf,_vsnprintf,[define if the vsnprintf function is mangled])
  31. AC_DEFINE(HAVE_VSNPRINTF,1)
  32. ])
  33. ])
  34. ])
  35. AC_DEFUN([USING_ETL],
  36. [
  37. AC_ARG_WITH(ETL-includes,
  38. [ --with-ETL-includes Specify location of ETL headers],[
  39. CXXFLAGS="$CXXFLAGS -I$withval"
  40. ])
  41. AC_PATH_PROG(ETL_CONFIG,ETL-config,no)
  42. if test "$ETL_CONFIG" = "no"; then
  43. no_ETL_config="yes"
  44. $2
  45. else
  46. AC_MSG_CHECKING([if $ETL_CONFIG works])
  47. if $ETL_CONFIG --libs >/dev/null 2>&1; then
  48. ETL_VERSION="`$ETL_CONFIG --version`"
  49. AC_MSG_RESULT([yes, $ETL_VERSION])
  50. CXXFLAGS="$CXXFLAGS `$ETL_CONFIG --cxxflags`"
  51. $1
  52. else
  53. AC_MSG_RESULT(no)
  54. no_ETL_config="yes"
  55. $2
  56. fi
  57. fi
  58. ETL_DEPS
  59. ])