configure.ac 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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.11 foreign no-define])
  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. OP_LT_CURRENT=0
  29. OP_LT_REVISION=1
  30. OP_LT_AGE=0
  31. AC_SUBST(OP_LT_CURRENT)
  32. AC_SUBST(OP_LT_REVISION)
  33. AC_SUBST(OP_LT_AGE)
  34. CC_CHECK_CFLAGS_APPEND(
  35. [-std=c89 -pedantic -Wall -Wextra -Wno-parentheses -Wno-long-long])
  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. esac
  50. AM_CONDITIONAL(OP_WIN32, test "$host_mingw" = "true")
  51. AC_ARG_ENABLE([assertions],
  52. AS_HELP_STRING([--enable-assertions], [Enable assertions in code]),,
  53. enable_assertions=no)
  54. AS_IF([test "$enable_assertions" = "yes"], [
  55. AC_DEFINE([OP_ENABLE_ASSERTIONS], [1], [Enable assertions in code])
  56. ])
  57. PKG_CHECK_MODULES([OGG], [ogg >= 1.3])
  58. PKG_CHECK_MODULES([SDL], [sdl])
  59. #CC_ATTRIBUTE_VISIBILITY([default], [
  60. # CC_FLAG_VISIBILITY([CFLAGS="${CFLAGS} -fvisibility=hidden"])
  61. #])
  62. dnl Check for doxygen
  63. AC_ARG_ENABLE([doc],
  64. AS_HELP_STRING([--disable-doc], [Do not build API documentation]),,
  65. [enable_doc=yes]
  66. )
  67. AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, yes, no)
  68. if test "$HAVE_DOXYGEN" != "yes" -o "$enable_doc" != "yes" ; then
  69. HAVE_DOXYGEN="no"
  70. enable_doc="no"
  71. fi
  72. AM_CONDITIONAL(HAVE_DOXYGEN, [test $HAVE_DOXYGEN = yes])
  73. AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, yes, no)
  74. if test "$HAVE_FIG2DEV" != "yes" -o "$enable_doc" != "yes" ; then
  75. HAVE_FIG2DEV="no"
  76. enable_doc="no"
  77. fi
  78. AM_CONDITIONAL(HAVE_FIG2DEV, [test $HAVE_FIG2DEV = yes])
  79. AM_CONDITIONAL(ENABLE_X86ASM, [test yes = yes])
  80. AM_CONDITIONAL(ENABLE_DOCS, [test $enable_doc = yes])
  81. DAALA_DEC_LIBS="\$(top_builddir)/src/libdaaladec.la \$(top_builddir)/src/libdaalabase.la -lm"
  82. AC_SUBST(DAALA_DEC_LIBS)
  83. DAALA_ENC_LIBS="\$(top_builddir)/src/libdaalaenc.la \$(top_builddir)/src/libdaalabase.la -lm"
  84. AC_SUBST(DAALA_ENC_LIBS)
  85. AC_CONFIG_FILES([
  86. Makefile
  87. daala.pc
  88. daala-uninstalled.pc
  89. src/Makefile
  90. examples/Makefile
  91. include/Makefile
  92. ])
  93. AC_OUTPUT
  94. AC_MSG_NOTICE([
  95. ------------------------------------------------------------------------
  96. $PACKAGE_NAME $PACKAGE_VERSION: Automatic configuration OK.
  97. Assertions ................... ${enable_assertions}
  98. Hidden visibility ............ ${cc_cv_flag_visibility}
  99. API documentation ............ ${enable_doc}
  100. ------------------------------------------------------------------------
  101. ])