configure.in 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. # $Id: configure.in,v 1.20 2000/08/15 09:09:31 xiphmont Exp $
  2. AC_INIT(lib/mdct.c)
  3. #AC_CONFIG_HEADER(config.h)
  4. cp configure.guess config.guess
  5. cp configure.sub config.sub
  6. AC_CANONICAL_HOST
  7. dnl If we're on IRIX, we wanna use cc even if gcc is there (unless the user
  8. dnl has overriden us)...
  9. case $host in
  10. *-*-irix*)
  11. if test -z "$CC"; then
  12. CC=cc
  13. fi
  14. AC_CHECK_LIB(audio, ALwritesamps)
  15. ;;
  16. # BeOS does not use -lm
  17. # *-*-beos)
  18. # LIBS=""
  19. # ;;
  20. # added better check below
  21. esac
  22. if test -z "$CC"; then
  23. AC_PROG_CC
  24. fi
  25. AC_PROG_CPP
  26. AC_PROG_RANLIB
  27. AC_CHECK_PROG(AR,ar,ar)
  28. AC_CHECK_PROG(INSTALL,install,install)
  29. #not everyone uses libm (eg, BeOS)
  30. #AC_CHECK_LIB(m, cos, LIBS="-lm"; AC_DEFINE(HAVE_LIBM), LIBS="")
  31. # We no longer use config.h
  32. AC_CHECK_LIB(m, cos, LIBS="-lm", LIBS="")
  33. dnl Set some target options
  34. if test -z "$GCC"; then
  35. case $host in
  36. *-*-irix*)
  37. DEBUG="-g -signed"
  38. OPT="-O2 -w -signed"
  39. PROFILE="-p -g3 -O2 -signed" ;;
  40. sparc-sun-solaris*)
  41. DEBUG="-v -g"
  42. OPT="-xO4 -fast -w -fsimple -native -xcg92"
  43. PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
  44. *)
  45. DEBUG="-g"
  46. OPT="-O"
  47. PROFILE="-g -p" ;;
  48. esac
  49. else
  50. case $host in
  51. *86-*-linux*)
  52. DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
  53. OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
  54. PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char"
  55. # glibc < 2.1.3 has a serious FP bug in the math inline header
  56. # that will cripple Vorbis. Look to see if the magic FP stack
  57. # clobber is missing in the mathinline header, thus indicating
  58. # the buggy version
  59. AC_EGREP_CPP(log10.*fldlg2.*fxch,[
  60. #define __LIBC_INTERNAL_MATH_INLINES 1
  61. #define __OPTIMIZE__
  62. #include <math.h>
  63. ],bad=maybe,bad=no)
  64. if test ${bad} = "maybe" ;then
  65. AC_EGREP_CPP(log10.*fldlg2.*fxch.*st\([[0123456789]]*\),
  66. [
  67. #define __LIBC_INTERNAL_MATH_INLINES 1
  68. #define __OPTIMIZE__
  69. #include <math.h>
  70. ],bad=no,bad=yes)
  71. fi
  72. if test ${bad} = "yes" ;then
  73. AC_MSG_WARN([ ])
  74. AC_MSG_WARN([********************************************************])
  75. AC_MSG_WARN([* The glibc headers on this machine have a serious bug *])
  76. AC_MSG_WARN([* in /usr/include/bits/mathinline.h This bug affects *])
  77. AC_MSG_WARN([* all floating point code, not just Ogg, built on this *])
  78. AC_MSG_WARN([* machine. Upgrading to glibc 2.1.3 is strongly urged *])
  79. AC_MSG_WARN([* to correct the problem. Note that upgrading glibc *])
  80. AC_MSG_WARN([* will not fix any previously built programs; this is *])
  81. AC_MSG_WARN([* a compile-time time bug. *])
  82. AC_MSG_WARN([* To work around the problem for this build of Ogg, *])
  83. AC_MSG_WARN([* autoconf is disabling all math inlining. This will *])
  84. AC_MSG_WARN([* hurt Ogg performace but is necessary for an Ogg that *])
  85. AC_MSG_WARN([* will actually work. Once glibc is upgraded, rerun *])
  86. AC_MSG_WARN([* configure and make to build with inlining. *])
  87. AC_MSG_WARN([********************************************************])
  88. AC_MSG_WARN([ ])
  89. OPT=${OPT}" -D__NO_MATH_INLINES"
  90. PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
  91. fi;;
  92. *-*-linux*)
  93. DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
  94. OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
  95. PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
  96. sparc-sun-*)
  97. DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -mv8"
  98. OPT="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
  99. PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
  100. *)
  101. DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
  102. OPT="-O20 -D__NO_MATH_INLINES -fsigned-char"
  103. PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
  104. esac
  105. fi
  106. AC_HEADER_STDC
  107. CFLAGS=""
  108. dnl AC_PATH_X
  109. dnl AC_PATH_XTRA
  110. #AC_CHECK_LIB(pthread, pthread_create,
  111. # pthread_lib="-lpthread"; AC_DEFINE(HAVE_LIBPTHREAD), :)
  112. # We no longer use config.h
  113. AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
  114. #dnl Linuxthreads require you to define _REENTRANT in all threaded
  115. #dnl code. Bogus, bogus...
  116. #
  117. #if test -n "$pthread_lib"; then
  118. # case $host in
  119. # i?86-*-linux*)
  120. # AC_DEFINE(_REENTRANT)
  121. # ;;
  122. # esac
  123. #fi
  124. # We no longer use config.h
  125. #if test -n "$x_libraries"; then
  126. # XOGG="yes"
  127. #
  128. # dnl If we find libgtk installed, great; otherwise assume we have
  129. # dnl to build it ourselves.
  130. #
  131. # AC_CHECK_LIB(gtk, gtk_main, :, LIBGTKDIR="libgtk", $X_LIBS -lglib -lgdk -lX11 -lXext -lm)
  132. #
  133. # dnl libpthread is required for xogg.
  134. #
  135. # if test -z "$pthread_lib"; then XOGG=""; fi
  136. #
  137. # dnl If we don't have libgtk installed, and we don't have a libgtk
  138. # dnl subdirectory to build the library ourself, we can't build xogg.
  139. #
  140. # if test -n "$LIBGTKDIR" -a ! -d "$LIBGTKDIR"; then
  141. # XOGG=""
  142. # LIBGTKDIR=""
  143. # fi
  144. #fi
  145. dnl This seems to be the only way to make autoconf only *sometimes* configure
  146. dnl a subdirectory with AC_CONFIG_SUBDIRS. "__noconf" is assumed to not
  147. dnl exist as a directory, so configure won't try to recursively enter it, unless
  148. dnl the shell variable $dummy is reset to an existing directory inside the
  149. dnl if clause.
  150. dummy="__noconf"
  151. #if test -d "$LIBGTKDIR"; then
  152. # enable_shared="no"; export enable_shared
  153. # dummy="libgtk"
  154. # AC_CONFIG_SUBDIRS("$dummy")
  155. # X_LIBS="-L${srcdir}/libgtk/gtk/.libs -L${srcdir}/libgtk/gdk/.libs -L${srcdir}/libgtk/glib/.libs $X_LIBS"
  156. #fi
  157. AC_CHECK_SIZEOF(short)
  158. AC_CHECK_SIZEOF(int)
  159. AC_CHECK_SIZEOF(long)
  160. AC_CHECK_SIZEOF(long long)
  161. case 2 in
  162. $ac_cv_sizeof_short) SIZE16="short";;
  163. $ac_cv_sizeof_int) SIZE16="int";;
  164. esac
  165. case 4 in
  166. $ac_cv_sizeof_short) SIZE32="short";;
  167. $ac_cv_sizeof_int) SIZE32="int";;
  168. $ac_cv_sizeof_long) SIZE32="long";;
  169. esac
  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. if test -z "$SIZE16"; then
  176. AC_MSG_ERROR(No 16 bit type found on this platform!)
  177. fi
  178. if test -z "$SIZE32"; then
  179. AC_MSG_ERROR(No 32 bit type found on this platform!)
  180. fi
  181. if test -z "$SIZE64"; then
  182. AC_MSG_WARN(No 64 bit type found on this platform!)
  183. fi
  184. #AC_CHECK_HEADER(alloca.h,AC_DEFINE(USE_ALLOCA_H),:)
  185. #AC_CHECK_HEADER(memory.h,AC_DEFINE(USE_MEMORY_H),:)
  186. # We no longer use config.h
  187. AC_CHECK_HEADER(alloca.h,CFLAGS="$CFLAGS -DUSE_ALLOCA_H",:)
  188. AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
  189. AC_C_CONST
  190. AC_HEADER_TIME
  191. AC_STRUCT_TM
  192. AC_PROG_MAKE_SET
  193. AC_FUNC_MEMCMP
  194. AC_TYPE_SIGNAL
  195. AC_CHECK_FUNCS(gettimeofday select strcspn strerror strspn sigaction)
  196. AC_SUBST(SIZE16)
  197. AC_SUBST(SIZE32)
  198. AC_SUBST(SIZE64)
  199. AC_SUBST(OPT)
  200. AC_SUBST(LIBS)
  201. AC_SUBST(DEBUG)
  202. AC_SUBST(PROFILE)
  203. AC_SUBST(CC)
  204. AC_SUBST(RANLIB)
  205. #AC_SUBST(XOGG)
  206. #AC_SUBST(LIBGTKDIR)
  207. AC_SUBST(pthread_lib)
  208. AC_CONFIG_SUBDIRS(vorbis-tools/libao)
  209. AC_OUTPUT(Makefile lib/Makefile examples/Makefile vorbis-tools/Makefile\
  210. vq/Makefile huff/Makefile cmdline/Makefile xmms/Makefile kmpg/Makefile)