configure.ac 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT([libogg],[1.3.3],[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=3
  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="-O20 -Wall -ffast-math -fsigned-char"
  42. PROFILE="-Wall -W -pg -g -O20 -ffast-math -fsigned-char"
  43. ;;
  44. sparc-sun-*)
  45. DEBUG="-g -Wall -fsigned-char"
  46. CFLAGS="-O20 -ffast-math -fsigned-char"
  47. PROFILE="-pg -g -O20 -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="-O20 -fsigned-char"
  57. PROFILE="-O20 -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(short)
  85. AC_CHECK_SIZEOF(int)
  86. AC_CHECK_SIZEOF(long)
  87. AC_CHECK_SIZEOF(long long)
  88. case 2 in
  89. $ac_cv_sizeof_int16_t) SIZE16="int16_t";;
  90. $ac_cv_sizeof_short) SIZE16="short";;
  91. $ac_cv_sizeof_int) SIZE16="int";;
  92. esac
  93. case 2 in
  94. $ac_cv_sizeof_uint16_t) USIZE16="uint16_t";;
  95. $ac_cv_sizeof_short) USIZE16="unsigned short";;
  96. $ac_cv_sizeof_int) USIZE16="unsigned int";;
  97. $ac_cv_sizeof_u_int16_t) USIZE16="u_int16_t";;
  98. esac
  99. case 4 in
  100. $ac_cv_sizeof_int32_t) SIZE32="int32_t";;
  101. $ac_cv_sizeof_short) SIZE32="short";;
  102. $ac_cv_sizeof_int) SIZE32="int";;
  103. $ac_cv_sizeof_long) SIZE32="long";;
  104. esac
  105. case 4 in
  106. $ac_cv_sizeof_uint32_t) USIZE32="uint32_t";;
  107. $ac_cv_sizeof_short) USIZE32="unsigned short";;
  108. $ac_cv_sizeof_int) USIZE32="unsigned int";;
  109. $ac_cv_sizeof_long) USIZE32="unsigned long";;
  110. $ac_cv_sizeof_u_int32_t) USIZE32="u_int32_t";;
  111. esac
  112. case 8 in
  113. $ac_cv_sizeof_int64_t) SIZE64="int64_t";;
  114. $ac_cv_sizeof_int) SIZE64="int";;
  115. $ac_cv_sizeof_long) SIZE64="long";;
  116. $ac_cv_sizeof_long_long) SIZE64="long long";;
  117. esac
  118. if test -z "$SIZE16"; then
  119. AC_MSG_ERROR(No 16 bit type found on this platform!)
  120. fi
  121. if test -z "$USIZE16"; then
  122. AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
  123. fi
  124. if test -z "$SIZE32"; then
  125. AC_MSG_ERROR(No 32 bit type found on this platform!)
  126. fi
  127. if test -z "$USIZE32"; then
  128. AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
  129. fi
  130. if test -z "$SIZE64"; then
  131. AC_MSG_WARN(No 64 bit type found on this platform!)
  132. fi
  133. AC_ARG_ENABLE([crc],
  134. [AS_HELP_STRING([--disable-crc],
  135. [Disable CRC in the demuxer)])],,
  136. [enable_crc=yes])
  137. AM_CONDITIONAL([DISABLE_CRC], [test "$enable_crc" = "no"])
  138. AS_IF([test "$enable_crc" = "no"],[
  139. AC_DEFINE([DISABLE_CRC], [1], [Do not build with CRC])
  140. ])
  141. dnl Checks for library functions.
  142. AC_FUNC_MEMCMP
  143. dnl Make substitutions
  144. AC_SUBST(LIBTOOL_DEPS)
  145. AC_SUBST(INCLUDE_INTTYPES_H)
  146. AC_SUBST(INCLUDE_STDINT_H)
  147. AC_SUBST(INCLUDE_SYS_TYPES_H)
  148. AC_SUBST(SIZE16)
  149. AC_SUBST(USIZE16)
  150. AC_SUBST(SIZE32)
  151. AC_SUBST(USIZE32)
  152. AC_SUBST(SIZE64)
  153. AC_SUBST(OPT)
  154. AC_SUBST(LIBS)
  155. AC_SUBST(DEBUG)
  156. AC_SUBST(CFLAGS)
  157. AC_SUBST(PROFILE)
  158. AC_CONFIG_FILES([
  159. Makefile
  160. src/Makefile
  161. doc/Makefile doc/libogg/Makefile
  162. include/Makefile include/ogg/Makefile include/ogg/config_types.h
  163. libogg.spec
  164. ogg.pc
  165. ogg-uninstalled.pc
  166. ])
  167. AC_CONFIG_HEADERS([config.h])
  168. AC_OUTPUT