configure.in 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(src/framing.c)
  3. AM_INIT_AUTOMAKE(libogg,1.1.3)
  4. AM_MAINTAINER_MODE
  5. dnl Library versioning
  6. LIB_CURRENT=5
  7. LIB_REVISION=3
  8. LIB_AGE=5
  9. AC_SUBST(LIB_CURRENT)
  10. AC_SUBST(LIB_REVISION)
  11. AC_SUBST(LIB_AGE)
  12. AC_PROG_CC
  13. AM_PROG_LIBTOOL
  14. dnl config.h
  15. AM_CONFIG_HEADER(config.h)
  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 -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 -mv8"
  45. CFLAGS="-O20 -ffast-math -fsigned-char -mv8"
  46. PROFILE="-pg -g -O20 -fsigned-char -mv8"
  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. dnl Checks for typedefs, structures, and compiler characteristics.
  68. AC_C_CONST
  69. dnl Check for types
  70. AC_MSG_CHECKING(for int16_t)
  71. AC_CACHE_VAL(has_int16_t,
  72. [AC_TRY_RUN([
  73. #ifdef __BEOS__
  74. #include <inttypes.h>
  75. #endif
  76. #include <sys/types.h>
  77. int16_t foo;
  78. int main() {return 0;}
  79. ],
  80. has_int16_t=yes,
  81. has_int16_t=no,
  82. has_int16_t=no
  83. )])
  84. AC_MSG_RESULT($has_int16_t)
  85. AC_MSG_CHECKING(for int32_t)
  86. AC_CACHE_VAL(has_int32_t,
  87. [AC_TRY_RUN([
  88. #ifdef __BEOS__
  89. #include <inttypes.h>
  90. #endif
  91. #include <sys/types.h>
  92. int32_t foo;
  93. int main() {return 0;}
  94. ],
  95. has_int32_t=yes,
  96. has_int32_t=no,
  97. has_int32_t=no
  98. )])
  99. AC_MSG_RESULT($has_int32_t)
  100. AC_MSG_CHECKING(for uint32_t)
  101. AC_CACHE_VAL(has_uint32_t,
  102. [AC_TRY_RUN([
  103. #ifdef __BEOS__
  104. #include <inttypes.h>
  105. #endif
  106. #include <sys/types.h>
  107. uint32_t foo;
  108. int main() {return 0;}
  109. ],
  110. has_uint32_t=yes,
  111. has_uint32_t=no,
  112. has_uint32_t=no
  113. )])
  114. AC_MSG_RESULT($has_uint32_t)
  115. AC_MSG_CHECKING(for uint16_t)
  116. AC_CACHE_VAL(has_uint16_t,
  117. [AC_TRY_RUN([
  118. #ifdef __BEOS__
  119. #include <inttypes.h>
  120. #endif
  121. #include <sys/types.h>
  122. uint16_t foo;
  123. int main() {return 0;}
  124. ],
  125. has_uint16_t=yes,
  126. has_uint16_t=no,
  127. has_uint16_t=no
  128. )])
  129. AC_MSG_RESULT($has_uint16_t)
  130. AC_MSG_CHECKING(for u_int32_t)
  131. AC_CACHE_VAL(has_u_int32_t,
  132. [AC_TRY_RUN([
  133. #ifdef __BEOS__
  134. #include <inttypes.h>
  135. #endif
  136. #include <sys/types.h>
  137. u_int32_t foo;
  138. int main() {return 0;}
  139. ],
  140. has_u_int32_t=yes,
  141. has_u_int32_t=no,
  142. has_u_int32_t=no
  143. )])
  144. AC_MSG_RESULT($has_u_int32_t)
  145. AC_MSG_CHECKING(for u_int16_t)
  146. AC_CACHE_VAL(has_u_int16_t,
  147. [AC_TRY_RUN([
  148. #ifdef __BEOS__
  149. #include <inttypes.h>
  150. #endif
  151. #include <sys/types.h>
  152. u_int16_t foo;
  153. int main() {return 0;}
  154. ],
  155. has_u_int16_t=yes,
  156. has_u_int16_t=no,
  157. has_u_int16_t=no
  158. )])
  159. AC_MSG_RESULT($has_u_int16_t)
  160. AC_MSG_CHECKING(for int64_t)
  161. AC_CACHE_VAL(has_int64_t,
  162. [AC_TRY_RUN([
  163. #ifdef __BEOS__
  164. #include <inttypes.h>
  165. #endif
  166. #include <sys/types.h>
  167. int64_t foo;
  168. int main() {return 0;}
  169. ],
  170. has_int64_t=yes,
  171. has_int64_t=no,
  172. has_int64_t=no
  173. )])
  174. AC_MSG_RESULT($has_int64_t)
  175. AC_CHECK_SIZEOF(short)
  176. AC_CHECK_SIZEOF(int)
  177. AC_CHECK_SIZEOF(long)
  178. AC_CHECK_SIZEOF(long long)
  179. if test x$has_int16_t = "xyes" ; then
  180. SIZE16="int16_t"
  181. else
  182. case 2 in
  183. $ac_cv_sizeof_short) SIZE16="short";;
  184. $ac_cv_sizeof_int) SIZE16="int";;
  185. esac
  186. fi
  187. if test x$has_int32_t = "xyes" ; then
  188. SIZE32="int32_t"
  189. else
  190. case 4 in
  191. $ac_cv_sizeof_short) SIZE32="short";;
  192. $ac_cv_sizeof_int) SIZE32="int";;
  193. $ac_cv_sizeof_long) SIZE32="long";;
  194. esac
  195. fi
  196. if test x$has_uint32_t = "xyes" ; then
  197. USIZE32="uint32_t"
  198. else
  199. if test x$has_u_int32_t = "xyes" ; then
  200. USIZE32="u_int32_t"
  201. else
  202. case 4 in
  203. $ac_cv_sizeof_short) USIZE32="unsigned short";;
  204. $ac_cv_sizeof_int) USIZE32="unsigned int";;
  205. $ac_cv_sizeof_long) USIZE32="unsigned long";;
  206. esac
  207. fi
  208. fi
  209. if test x$has_uint16_t = "xyes" ; then
  210. USIZE16="uint16_t"
  211. else
  212. if test x$has_u_int16_t = "xyes" ; then
  213. USIZE16="u_int16_t"
  214. else
  215. case 2 in
  216. $ac_cv_sizeof_short) USIZE16="unsigned short";;
  217. $ac_cv_sizeof_int) USIZE16="unsigned int";;
  218. $ac_cv_sizeof_long) USIZE16="unsigned long";;
  219. esac
  220. fi
  221. fi
  222. if test x$has_int64_t = "xyes" ; then
  223. SIZE64="int64_t"
  224. else
  225. case 8 in
  226. $ac_cv_sizeof_int) SIZE64="int";;
  227. $ac_cv_sizeof_long) SIZE64="long";;
  228. $ac_cv_sizeof_long_long) SIZE64="long long";;
  229. esac
  230. fi
  231. if test -z "$SIZE16"; then
  232. AC_MSG_ERROR(No 16 bit type found on this platform!)
  233. fi
  234. if test -z "$USIZE16"; then
  235. AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
  236. fi
  237. if test -z "$SIZE32"; then
  238. AC_MSG_ERROR(No 32 bit type found on this platform!)
  239. fi
  240. if test -z "$USIZE32"; then
  241. AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
  242. fi
  243. if test -z "$SIZE64"; then
  244. AC_MSG_WARN(No 64 bit type found on this platform!)
  245. fi
  246. dnl Checks for library functions.
  247. AC_FUNC_MEMCMP
  248. dnl Make substitutions
  249. AC_SUBST(LIBTOOL_DEPS)
  250. AC_SUBST(SIZE16)
  251. AC_SUBST(USIZE16)
  252. AC_SUBST(SIZE32)
  253. AC_SUBST(USIZE32)
  254. AC_SUBST(SIZE64)
  255. AC_SUBST(OPT)
  256. AC_SUBST(LIBS)
  257. AC_SUBST(DEBUG)
  258. AC_SUBST(CFLAGS)
  259. AC_SUBST(PROFILE)
  260. AC_OUTPUT([
  261. Makefile
  262. src/Makefile
  263. doc/Makefile doc/libogg/Makefile
  264. include/Makefile include/ogg/Makefile include/ogg/config_types.h
  265. win32/Makefile
  266. libogg.spec
  267. ogg.pc
  268. ogg-uninstalled.pc
  269. ])