configure.in 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(src/framing.c)
  3. AM_INIT_AUTOMAKE(libogg,1.0.0)
  4. dnl Library versioning
  5. LIB_CURRENT=0
  6. LIB_REVISION=0
  7. LIB_AGE=0
  8. AC_SUBST(LIB_CURRENT)
  9. AC_SUBST(LIB_REVISION)
  10. AC_SUBST(LIB_AGE)
  11. AC_PROG_CC
  12. AM_PROG_LIBTOOL
  13. dnl Set some options based on environment
  14. if test -z "$GCC"; then
  15. case $host in
  16. *-*-irix*)
  17. DEBUG="-g -signed"
  18. CFLAGS="-O2 -w -signed"
  19. PROFILE="-p -g3 -O2 -signed"
  20. ;;
  21. sparc-sun-solaris*)
  22. DEBUG="-v -g"
  23. CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
  24. PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc"
  25. ;;
  26. *)
  27. DEBUG="-g"
  28. CFLAGS="-O"
  29. PROFILE="-g -p"
  30. ;;
  31. esac
  32. else
  33. case $host in
  34. *-*-linux*)
  35. DEBUG="-g -Wall -fsigned-char"
  36. CFLAGS="-O20 -ffast-math -fsigned-char"
  37. PROFILE="-Wall -W -pg -g -O20 -ffast-math -fsigned-char"
  38. ;;
  39. sparc-sun-*)
  40. DEBUG="-g -Wall -fsigned-char -mv8"
  41. CFLAGS="-O20 -ffast-math -fsigned-char -mv8"
  42. PROFILE="-pg -g -O20 -fsigned-char -mv8"
  43. ;;
  44. *)
  45. DEBUG="-g -Wall -fsigned-char"
  46. CFLAGS="-O20 -fsigned-char"
  47. PROFILE="-O20 -g -pg -fsigned-char"
  48. ;;
  49. esac
  50. fi
  51. dnl Checks for programs.
  52. dnl Checks for libraries.
  53. dnl Checks for header files.
  54. AC_HEADER_STDC
  55. dnl Checks for typedefs, structures, and compiler characteristics.
  56. AC_C_CONST
  57. dnl Check for types
  58. AC_MSG_CHECKING(for int16_t)
  59. AC_CACHE_VAL(has_int16_t,
  60. [AC_TRY_RUN([
  61. #ifdef __BEOS__
  62. #include <inttypes.h>
  63. #endif
  64. #include <sys/types.h>
  65. int16_t foo;
  66. int main() {return 0;}
  67. ],
  68. has_int16_t=yes,
  69. has_int16_t=no,
  70. has_int16_t=no
  71. )])
  72. AC_MSG_RESULT($has_int16_t)
  73. AC_MSG_CHECKING(for int32_t)
  74. AC_CACHE_VAL(has_int32_t,
  75. [AC_TRY_RUN([
  76. #ifdef __BEOS__
  77. #include <inttypes.h>
  78. #endif
  79. #include <sys/types.h>
  80. int32_t foo;
  81. int main() {return 0;}
  82. ],
  83. has_int32_t=yes,
  84. has_int32_t=no,
  85. has_int32_t=no
  86. )])
  87. AC_MSG_RESULT($has_int32_t)
  88. AC_MSG_CHECKING(for uint32_t)
  89. AC_CACHE_VAL(has_uint32_t,
  90. [AC_TRY_RUN([
  91. #ifdef __BEOS__
  92. #include <inttypes.h>
  93. #endif
  94. #include <sys/types.h>
  95. uint32_t foo;
  96. int main() {return 0;}
  97. ],
  98. has_uint32_t=yes,
  99. has_uint32_t=no,
  100. has_uint32_t=no
  101. )])
  102. AC_MSG_RESULT($has_uint32_t)
  103. AC_MSG_CHECKING(for u_int32_t)
  104. AC_CACHE_VAL(has_u_int32_t,
  105. [AC_TRY_RUN([
  106. #ifdef __BEOS__
  107. #include <inttypes.h>
  108. #endif
  109. #include <sys/types.h>
  110. u_int32_t foo;
  111. int main() {return 0;}
  112. ],
  113. has_u_int32_t=yes,
  114. has_u_int32_t=no,
  115. has_u_int32_t=no
  116. )])
  117. AC_MSG_RESULT($has_u_int32_t)
  118. AC_MSG_CHECKING(for int64_t)
  119. AC_CACHE_VAL(has_int64_t,
  120. [AC_TRY_RUN([
  121. #ifdef __BEOS__
  122. #include <inttypes.h>
  123. #endif
  124. #include <sys/types.h>
  125. int64_t foo;
  126. int main() {return 0;}
  127. ],
  128. has_int64_t=yes,
  129. has_int64_t=no,
  130. has_int64_t=no
  131. )])
  132. AC_MSG_RESULT($has_int64_t)
  133. AC_CHECK_SIZEOF(short)
  134. AC_CHECK_SIZEOF(int)
  135. AC_CHECK_SIZEOF(long)
  136. AC_CHECK_SIZEOF(long long)
  137. if test x$has_int16_t = "xyes" ; then
  138. SIZE16="int16_t"
  139. else
  140. case 2 in
  141. $ac_cv_sizeof_short) SIZE16="short";;
  142. $ac_cv_sizeof_int) SIZE16="int";;
  143. esac
  144. fi
  145. if test x$has_int32_t = "xyes" ; then
  146. SIZE32="int32_t"
  147. else
  148. case 4 in
  149. $ac_cv_sizeof_short) SIZE32="short";;
  150. $ac_cv_sizeof_int) SIZE32="int";;
  151. $ac_cv_sizeof_long) SIZE32="long";;
  152. esac
  153. fi
  154. if test x$has_uint32_t = "xyes" ; then
  155. USIZE32="uint32_t"
  156. else
  157. if test x$has_u_int32_t = "xyes" ; then
  158. USIZE32="u_int32_t"
  159. else
  160. case 4 in
  161. $ac_cv_sizeof_short) USIZE32="unsigned short";;
  162. $ac_cv_sizeof_int) USIZE32="unsigned int";;
  163. $ac_cv_sizeof_long) USIZE32="unsigned long";;
  164. esac
  165. fi
  166. fi
  167. if test x$has_int64_t = "xyes" ; then
  168. SIZE64="int64_t"
  169. else
  170. case 8 in
  171. $ac_cv_sizeof_int) SIZE64="int";;
  172. $ac_cv_sizeof_long) SIZE64="long";;
  173. $ac_cv_sizeof_long_long) SIZE64="long long";;
  174. esac
  175. fi
  176. if test -z "$SIZE16"; then
  177. AC_MSG_ERROR(No 16 bit type found on this platform!)
  178. fi
  179. if test -z "$SIZE32"; then
  180. AC_MSG_ERROR(No 32 bit type found on this platform!)
  181. fi
  182. if test -z "$USIZE32"; then
  183. AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
  184. fi
  185. if test -z "$SIZE64"; then
  186. AC_MSG_WARN(No 64 bit type found on this platform!)
  187. fi
  188. dnl Checks for library functions.
  189. AC_FUNC_MEMCMP
  190. dnl Make substitutions
  191. AC_SUBST(LIBTOOL_DEPS)
  192. AC_SUBST(SIZE16)
  193. AC_SUBST(SIZE32)
  194. AC_SUBST(USIZE32)
  195. AC_SUBST(SIZE64)
  196. AC_SUBST(OPT)
  197. AC_SUBST(LIBS)
  198. AC_SUBST(DEBUG)
  199. AC_SUBST(CFLAGS)
  200. AC_SUBST(PROFILE)
  201. AC_SUBST(CC)
  202. AC_SUBST(RANLIB)
  203. AC_OUTPUT(Makefile ogg-config src/Makefile doc/Makefile include/Makefile include/ogg/Makefile include/ogg/config_types.h win32/Makefile)