configure.in 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(src/framing.c)
  3. AM_INIT_AUTOMAKE(libogg,1.2.1)
  4. AM_MAINTAINER_MODE
  5. dnl Library versioning
  6. LIB_CURRENT=7
  7. LIB_REVISION=1
  8. LIB_AGE=7
  9. AC_SUBST(LIB_CURRENT)
  10. AC_SUBST(LIB_REVISION)
  11. AC_SUBST(LIB_AGE)
  12. AC_PROG_CC
  13. AM_PROG_LIBTOOL
  14. AM_PROG_CC_C_O
  15. dnl config.h
  16. AM_CONFIG_HEADER(config.h)
  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_short) SIZE16="short";;
  90. $ac_cv_sizeof_int) SIZE16="int";;
  91. $ac_cv_sizeof_int16_t) SIZE16="int16_t";;
  92. esac
  93. case 2 in
  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. $ac_cv_sizeof_uint16_t) USIZE16="uint16_t";;
  98. esac
  99. case 4 in
  100. $ac_cv_sizeof_short) SIZE32="short";;
  101. $ac_cv_sizeof_int) SIZE32="int";;
  102. $ac_cv_sizeof_long) SIZE32="long";;
  103. $ac_cv_sizeof_int32_t) SIZE32="int32_t";;
  104. esac
  105. case 4 in
  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. $ac_cv_sizeof_uint32_t) USIZE32="uint32_t";;
  111. esac
  112. case 8 in
  113. $ac_cv_sizeof_int) SIZE64="int";;
  114. $ac_cv_sizeof_long) SIZE64="long";;
  115. $ac_cv_sizeof_long_long) SIZE64="long long";;
  116. $ac_cv_sizeof_int64_t) SIZE64="int64_t";;
  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. dnl Checks for library functions.
  134. AC_FUNC_MEMCMP
  135. dnl Make substitutions
  136. AC_SUBST(LIBTOOL_DEPS)
  137. AC_SUBST(INCLUDE_INTTYPES_H)
  138. AC_SUBST(INCLUDE_STDINT_H)
  139. AC_SUBST(INCLUDE_SYS_TYPES_H)
  140. AC_SUBST(SIZE16)
  141. AC_SUBST(USIZE16)
  142. AC_SUBST(SIZE32)
  143. AC_SUBST(USIZE32)
  144. AC_SUBST(SIZE64)
  145. AC_SUBST(OPT)
  146. AC_SUBST(LIBS)
  147. AC_SUBST(DEBUG)
  148. AC_SUBST(CFLAGS)
  149. AC_SUBST(PROFILE)
  150. AC_OUTPUT([
  151. Makefile
  152. src/Makefile
  153. doc/Makefile doc/libogg/Makefile
  154. include/Makefile include/ogg/Makefile include/ogg/config_types.h
  155. libogg.spec
  156. ogg.pc
  157. ogg-uninstalled.pc
  158. ])