configure.ac 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT([libogg],[1.3.4],[ogg-dev@xiph.org])
  3. LT_INIT
  4. AC_CONFIG_MACRO_DIR([m4])
  5. AC_CONFIG_SRCDIR(src/framing.c)
  6. AM_INIT_AUTOMAKE
  7. AM_MAINTAINER_MODE([enable])
  8. dnl Library versioning
  9. LIB_CURRENT=8
  10. LIB_REVISION=4
  11. LIB_AGE=8
  12. AC_SUBST(LIB_CURRENT)
  13. AC_SUBST(LIB_REVISION)
  14. AC_SUBST(LIB_AGE)
  15. AC_PROG_CC
  16. AM_PROG_CC_C_O
  17. dnl Set some options based on environment
  18. cflags_save="$CFLAGS"
  19. if test -z "$GCC"; then
  20. case $host in
  21. *-*-irix*)
  22. DEBUG="-g -signed"
  23. CFLAGS="-O2 -w -signed"
  24. PROFILE="-p -g3 -O2 -signed"
  25. ;;
  26. sparc-sun-solaris*)
  27. DEBUG="-v -g"
  28. CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
  29. PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc"
  30. ;;
  31. *)
  32. DEBUG="-g"
  33. CFLAGS="-O"
  34. PROFILE="-g -p"
  35. ;;
  36. esac
  37. else
  38. case $host in
  39. *-*-linux*)
  40. DEBUG="-g -Wall -fsigned-char"
  41. CFLAGS="-O2 -Wall -ffast-math -fsigned-char"
  42. PROFILE="-Wall -W -pg -g -O2 -ffast-math -fsigned-char"
  43. ;;
  44. sparc-sun-*)
  45. DEBUG="-g -Wall -fsigned-char"
  46. CFLAGS="-O2 -ffast-math -fsigned-char"
  47. PROFILE="-pg -g -O2 -fsigned-char"
  48. ;;
  49. *-*-darwin*)
  50. DEBUG="-fno-common -g -Wall -fsigned-char"
  51. CFLAGS="-fno-common -O4 -Wall -fsigned-char -ffast-math"
  52. PROFILE="-fno-common -O4 -Wall -pg -g -fsigned-char -ffast-math"
  53. ;;
  54. *)
  55. DEBUG="-g -Wall -fsigned-char"
  56. CFLAGS="-O2 -fsigned-char"
  57. PROFILE="-O2 -g -pg -fsigned-char"
  58. ;;
  59. esac
  60. fi
  61. CFLAGS="$CFLAGS $cflags_save"
  62. DEBUG="$DEBUG $cflags_save"
  63. PROFILE="$PROFILE $cflags_save"
  64. dnl Checks for programs.
  65. dnl Checks for libraries.
  66. dnl Checks for header files.
  67. AC_HEADER_STDC
  68. INCLUDE_INTTYPES_H=0
  69. INCLUDE_STDINT_H=0
  70. INCLUDE_SYS_TYPES_H=0
  71. AC_CHECK_HEADER(inttypes.h,INCLUDE_INTTYPES_H=1)
  72. AC_CHECK_HEADER(stdint.h,INCLUDE_STDINT_H=1)
  73. AC_CHECK_HEADER(sys/types.h,INCLUDE_SYS_TYPES_H=1)
  74. dnl Checks for typedefs, structures, and compiler characteristics.
  75. AC_C_CONST
  76. dnl Check for types
  77. AC_CHECK_SIZEOF(int16_t)
  78. AC_CHECK_SIZEOF(uint16_t)
  79. AC_CHECK_SIZEOF(u_int16_t)
  80. AC_CHECK_SIZEOF(int32_t)
  81. AC_CHECK_SIZEOF(uint32_t)
  82. AC_CHECK_SIZEOF(u_int32_t)
  83. AC_CHECK_SIZEOF(int64_t)
  84. AC_CHECK_SIZEOF(uint64_t)
  85. AC_CHECK_SIZEOF(short)
  86. AC_CHECK_SIZEOF(int)
  87. AC_CHECK_SIZEOF(long)
  88. AC_CHECK_SIZEOF(long long)
  89. case 2 in
  90. $ac_cv_sizeof_int16_t) SIZE16="int16_t";;
  91. $ac_cv_sizeof_short) SIZE16="short";;
  92. $ac_cv_sizeof_int) SIZE16="int";;
  93. esac
  94. case 2 in
  95. $ac_cv_sizeof_uint16_t) USIZE16="uint16_t";;
  96. $ac_cv_sizeof_short) USIZE16="unsigned short";;
  97. $ac_cv_sizeof_int) USIZE16="unsigned int";;
  98. $ac_cv_sizeof_u_int16_t) USIZE16="u_int16_t";;
  99. esac
  100. case 4 in
  101. $ac_cv_sizeof_int32_t) SIZE32="int32_t";;
  102. $ac_cv_sizeof_short) SIZE32="short";;
  103. $ac_cv_sizeof_int) SIZE32="int";;
  104. $ac_cv_sizeof_long) SIZE32="long";;
  105. esac
  106. case 4 in
  107. $ac_cv_sizeof_uint32_t) USIZE32="uint32_t";;
  108. $ac_cv_sizeof_short) USIZE32="unsigned short";;
  109. $ac_cv_sizeof_int) USIZE32="unsigned int";;
  110. $ac_cv_sizeof_long) USIZE32="unsigned long";;
  111. $ac_cv_sizeof_u_int32_t) USIZE32="u_int32_t";;
  112. esac
  113. case 8 in
  114. $ac_cv_sizeof_int64_t) SIZE64="int64_t";;
  115. $ac_cv_sizeof_int) SIZE64="int";;
  116. $ac_cv_sizeof_long) SIZE64="long";;
  117. $ac_cv_sizeof_long_long) SIZE64="long long";;
  118. esac
  119. case 8 in
  120. $ac_cv_sizeof_uint64_t) USIZE64="uint64_t";;
  121. $ac_cv_sizeof_unsigned_int) USIZE64="unsigned int";;
  122. $ac_cv_sizeof_unsigned_long) USIZE64="unsigned long";;
  123. $ac_cv_sizeof_unsigned_long_long) USIZE64="unsigned long long";;
  124. esac
  125. if test -z "$SIZE16"; then
  126. AC_MSG_ERROR(No 16 bit type found on this platform!)
  127. fi
  128. if test -z "$USIZE16"; then
  129. AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
  130. fi
  131. if test -z "$SIZE32"; then
  132. AC_MSG_ERROR(No 32 bit type found on this platform!)
  133. fi
  134. if test -z "$USIZE32"; then
  135. AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
  136. fi
  137. if test -z "$SIZE64"; then
  138. AC_MSG_WARN(No 64 bit type found on this platform!)
  139. fi
  140. if test -z "$USIZE64"; then
  141. AC_MSG_WARN(No unsigned 64 bit type found on this platform!)
  142. fi
  143. AC_ARG_ENABLE([crc],
  144. [AS_HELP_STRING([--disable-crc],
  145. [Disable CRC in the demuxer])],,
  146. [enable_crc=yes])
  147. AM_CONDITIONAL([DISABLE_CRC], [test "$enable_crc" = "no"])
  148. AS_IF([test "$enable_crc" = "no"],[
  149. AC_DEFINE([DISABLE_CRC], [1], [Do not build with CRC])
  150. ])
  151. dnl Checks for library functions.
  152. AC_FUNC_MEMCMP
  153. dnl Make substitutions
  154. AC_SUBST(LIBTOOL_DEPS)
  155. AC_SUBST(INCLUDE_INTTYPES_H)
  156. AC_SUBST(INCLUDE_STDINT_H)
  157. AC_SUBST(INCLUDE_SYS_TYPES_H)
  158. AC_SUBST(SIZE16)
  159. AC_SUBST(USIZE16)
  160. AC_SUBST(SIZE32)
  161. AC_SUBST(USIZE32)
  162. AC_SUBST(SIZE64)
  163. AC_SUBST(USIZE64)
  164. AC_SUBST(OPT)
  165. AC_SUBST(LIBS)
  166. AC_SUBST(DEBUG)
  167. AC_SUBST(CFLAGS)
  168. AC_SUBST(PROFILE)
  169. AC_CONFIG_FILES([
  170. Makefile
  171. src/Makefile
  172. include/Makefile include/ogg/Makefile include/ogg/config_types.h
  173. libogg.spec
  174. ogg.pc
  175. ogg-uninstalled.pc
  176. ])
  177. AC_CONFIG_HEADERS([config.h])
  178. AC_OUTPUT