configure.in 4.5 KB

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