ETL.m4 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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_C_BIGENDIAN
  10. AC_CHECK_LIB(user32, main)
  11. AC_CHECK_LIB([kernel32], [CreateMutex])
  12. AC_CHECK_LIB([pthread], [pthread_mutex_init])
  13. AC_HEADER_STDC
  14. AC_CHECK_HEADERS(pthread.h)
  15. AC_CHECK_HEADERS(sched.h)
  16. AC_CHECK_HEADERS(sys/times.h)
  17. AC_CHECK_HEADERS(sys/time.h)
  18. AC_CHECK_HEADERS(unistd.h)
  19. AC_CHECK_HEADERS(windows.h)
  20. AC_CHECK_FUNCS([pthread_create])
  21. AC_CHECK_FUNCS([pthread_rwlock_init])
  22. AC_CHECK_FUNCS([pthread_yield])
  23. AC_CHECK_FUNCS([sched_yield])
  24. AC_CHECK_FUNCS([CreateThread])
  25. AC_CHECK_FUNCS([__clone])
  26. AC_CHECK_FUNCS([QueryPerformanceCounter])
  27. AC_CHECK_FUNCS([gettimeofday])
  28. AC_CHECK_FUNCS([vsscanf])
  29. AC_CHECK_FUNCS([vsprintf])
  30. AC_CHECK_FUNCS([vasprintf])
  31. AC_CHECK_FUNCS([vsnprintf],[],[
  32. AC_CHECK_FUNC([_vsnprintf],[
  33. AC_DEFINE(vsnprintf,_vsnprintf,[define if the vsnprintf function is mangled])
  34. AC_DEFINE(HAVE_VSNPRINTF,1)
  35. ])
  36. ])
  37. $1
  38. ])
  39. AC_DEFUN([USING_ETL],
  40. [
  41. AC_ARG_WITH(ETL-includes,
  42. [ --with-ETL-includes Specify location of ETL headers],[
  43. CXXFLAGS="$CXXFLAGS -I$withval"
  44. ])
  45. AC_PATH_PROG(ETL_CONFIG,ETL-config,no)
  46. if test "$ETL_CONFIG" = "no"; then
  47. no_ETL_config="yes"
  48. $2
  49. else
  50. AC_MSG_CHECKING([if $ETL_CONFIG works])
  51. if $ETL_CONFIG --libs >/dev/null 2>&1; then
  52. ETL_VERSION="`$ETL_CONFIG --version`"
  53. AC_MSG_RESULT([yes, $ETL_VERSION])
  54. CXXFLAGS="$CXXFLAGS `$ETL_CONFIG --cxxflags`"
  55. $1
  56. else
  57. AC_MSG_RESULT(no)
  58. no_ETL_config="yes"
  59. $2
  60. fi
  61. fi
  62. ETL_DEPS($1,$2)
  63. ])