configure.ac 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. # autoconf source script for generating configure
  2. dnl The package_version file will be automatically synced to the git revision
  3. dnl by the update_version script when configured in the repository, but will
  4. dnl remain constant in tarball releases unless it is manually edited.
  5. m4_define([CURRENT_VERSION],
  6. m4_esyscmd([ if test -e package_version || ./update_version; then
  7. . ./package_version
  8. printf "$PACKAGE_VERSION"
  9. else
  10. printf "unknown"
  11. fi ]))
  12. AC_INIT([daala],[CURRENT_VERSION],[daala@xiph.org])
  13. AC_CONFIG_SRCDIR([src/decode.c])
  14. AC_USE_SYSTEM_EXTENSIONS
  15. AC_SYS_LARGEFILE
  16. AM_INIT_AUTOMAKE([1.10 foreign no-define subdir-objects])
  17. AM_MAINTAINER_MODE([enable])
  18. LT_INIT
  19. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  20. AC_CONFIG_MACRO_DIR([m4])
  21. dnl Library versioning for libtool.
  22. dnl Please update these for releases.
  23. dnl CURRENT, REVISION, AGE
  24. dnl - library source changed -> increment REVISION
  25. dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
  26. dnl - interfaces added -> increment AGE
  27. dnl - interfaces removed -> AGE = 0
  28. OD_LT_CURRENT=0
  29. OD_LT_REVISION=1
  30. OD_LT_AGE=0
  31. AC_SUBST(OD_LT_CURRENT)
  32. AC_SUBST(OD_LT_REVISION)
  33. AC_SUBST(OD_LT_AGE)
  34. CC_CHECK_CFLAGS_APPEND(
  35. [-std=c89 -pedantic -Wall -Wextra -Wno-parentheses -Wno-long-long -Wno-overlength-strings])
  36. # Platform-specific tweaks
  37. case $host in
  38. *-mingw*)
  39. # -std=c89 causes some warnings under mingw.
  40. CC_CHECK_CFLAGS_APPEND([-U__STRICT_ANSI__])
  41. # We need WINNT>=0x501 (WindowsXP) for getaddrinfo/freeaddrinfo.
  42. # It's okay to define this even when HTTP support is disabled, as it only
  43. # affects header declarations, not linking (unless we actually use some
  44. # XP-only functions).
  45. AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x501,
  46. [We need at least WindowsXP for getaddrinfo/freaddrinfo])
  47. host_mingw=true
  48. ;;
  49. *-*-darwin*)
  50. os_darwin=true
  51. ;;
  52. esac
  53. AM_CONDITIONAL(OD_WIN32, test "$host_mingw" = "true")
  54. AM_CONDITIONAL(OD_OS_DARWIN, test "$os_darwin" = "true")
  55. AC_ARG_ENABLE([assertions],
  56. AS_HELP_STRING([--enable-assertions], [Enable assertions in code]),,
  57. enable_assertions=no)
  58. AS_IF([test "$enable_assertions" = "yes"], [
  59. AC_DEFINE([OD_ENABLE_ASSERTIONS], [1], [Enable assertions in code])
  60. ])
  61. PKG_CHECK_MODULES([OGG], [ogg >= 1.3])
  62. PKG_CHECK_MODULES([SDL], [sdl])
  63. PKG_CHECK_MODULES([PNG], [libpng])
  64. PKG_CHECK_MODULES([THEORA], [theoradec])
  65. PKG_CHECK_MODULES([CHECK], [check])
  66. #CC_ATTRIBUTE_VISIBILITY([default], [
  67. # CC_FLAG_VISIBILITY([CFLAGS="${CFLAGS} -fvisibility=hidden"])
  68. #])
  69. dnl Check for doxygen
  70. AC_ARG_ENABLE([doc],
  71. AS_HELP_STRING([--disable-doc], [Do not build API documentation]),,
  72. [enable_doc=yes]
  73. )
  74. AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, yes, no)
  75. if test "$HAVE_DOXYGEN" != "yes" -o "$enable_doc" != "yes" ; then
  76. HAVE_DOXYGEN="no"
  77. enable_doc="no"
  78. fi
  79. AM_CONDITIONAL(HAVE_DOXYGEN, [test $HAVE_DOXYGEN = yes])
  80. AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, yes, no)
  81. if test "$HAVE_FIG2DEV" != "yes" -o "$enable_doc" != "yes" ; then
  82. HAVE_FIG2DEV="no"
  83. enable_doc="no"
  84. fi
  85. AM_CONDITIONAL(HAVE_FIG2DEV, [test $HAVE_FIG2DEV = yes])
  86. AC_ARG_ENABLE([asm],
  87. AS_HELP_STRING([--disable-asm], [Do not compile assembly versions]),,
  88. [enable_asm=yes]
  89. )
  90. case $host_cpu in
  91. i[3456]86)
  92. cpu_x86=true
  93. ;;
  94. x86_64)
  95. cpu_x86=true
  96. ;;
  97. esac
  98. AM_CONDITIONAL([ENABLE_X86ASM], [test "$enable_asm" = "yes" -a "$cpu_x86" = "true"])
  99. AS_IF([test "$enable_asm" = "yes" -a "$cpu_x86" = "true"], [
  100. AC_DEFINE([OD_X86ASM], [1])
  101. ])
  102. AM_CONDITIONAL(ENABLE_DOCS, [test $enable_doc = yes])
  103. AC_DEFINE([OD_ENABLE_ASSERTIONS], [1], [Enable assertions in code])
  104. AC_DEFINE([OD_LOGGING_ENABLED], [1], [Enable logging])
  105. AC_ARG_ENABLE([dump-images],
  106. AS_HELP_STRING([--disable-dump-images], [Do not dump debugging images]),,
  107. [enable_dump_images=yes])
  108. AS_IF([test x$enable_dump_images = xyes], [
  109. AC_DEFINE([OD_DUMP_IMAGES], [1], [Enable image dumping])
  110. ])
  111. AM_CONDITIONAL([DUMP_IMAGES], [test x$enable_dump_images = xyes])
  112. AC_CONFIG_FILES([
  113. Makefile
  114. daala.pc
  115. daala-uninstalled.pc
  116. doc/Doxyfile
  117. ])
  118. AC_OUTPUT
  119. AC_MSG_NOTICE([
  120. ------------------------------------------------------------------------
  121. $PACKAGE_NAME $PACKAGE_VERSION: Automatic configuration OK.
  122. Assertions ................... ${enable_assertions}
  123. API documentation ............ ${enable_doc}
  124. Assembly optimizations ....... ${enable_asm}
  125. Image dumping ................ ${enable_dump_images}
  126. ------------------------------------------------------------------------
  127. ])