1 # $Id: configure.in,v 1.22 2000/08/30 07:09:46 xiphmont Exp $
4 #AC_CONFIG_HEADER(config.h)
6 cp configure.guess config.guess
7 cp configure.sub config.sub
11 dnl If we're on IRIX, we wanna use cc even if gcc is there (unless the user
12 dnl has overriden us)...
15 if test -z "$CC"; then
18 AC_CHECK_LIB(audio, ALwritesamps)
20 # BeOS does not use -lm
24 # added better check below
31 AC_CHECK_PROG(AR,ar,ar)
32 AC_CHECK_PROG(INSTALL,install,install)
34 #not everyone uses libm (eg, BeOS)
35 #AC_CHECK_LIB(m, cos, LIBS="-lm"; AC_DEFINE(HAVE_LIBM), LIBS="")
36 # We no longer use config.h
37 AC_CHECK_LIB(m, cos, LIBS="-lm", LIBS="")
39 dnl Set some target options
40 if test -z "$GCC"; then
45 PROFILE="-p -g3 -O2 -signed" ;;
48 OPT="-xO4 -fast -w -fsimple -native -xcg92"
49 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
59 DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
60 OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
61 PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char"
63 # glibc < 2.1.3 has a serious FP bug in the math inline header
64 # that will cripple Vorbis. Look to see if the magic FP stack
65 # clobber is missing in the mathinline header, thus indicating
68 AC_EGREP_CPP(log10.*fldlg2.*fxch,[
69 #define __LIBC_INTERNAL_MATH_INLINES 1
73 if test ${bad} = "maybe" ;then
74 AC_EGREP_CPP(log10.*fldlg2.*fxch.*st\([[0123456789]]*\),
76 #define __LIBC_INTERNAL_MATH_INLINES 1
81 if test ${bad} = "yes" ;then
83 AC_MSG_WARN([********************************************************])
84 AC_MSG_WARN([* The glibc headers on this machine have a serious bug *])
85 AC_MSG_WARN([* in /usr/include/bits/mathinline.h This bug affects *])
86 AC_MSG_WARN([* all floating point code, not just Ogg, built on this *])
87 AC_MSG_WARN([* machine. Upgrading to glibc 2.1.3 is strongly urged *])
88 AC_MSG_WARN([* to correct the problem. Note that upgrading glibc *])
89 AC_MSG_WARN([* will not fix any previously built programs; this is *])
90 AC_MSG_WARN([* a compile-time time bug. *])
91 AC_MSG_WARN([* To work around the problem for this build of Ogg, *])
92 AC_MSG_WARN([* autoconf is disabling all math inlining. This will *])
93 AC_MSG_WARN([* hurt Ogg performace but is necessary for an Ogg that *])
94 AC_MSG_WARN([* will actually work. Once glibc is upgraded, rerun *])
95 AC_MSG_WARN([* configure and make to build with inlining. *])
96 AC_MSG_WARN([********************************************************])
99 OPT=${OPT}" -D__NO_MATH_INLINES"
100 PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
103 DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
104 OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
105 PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
107 DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -mv8"
108 OPT="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
109 PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
111 DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
112 OPT="-O20 -D__NO_MATH_INLINES -fsigned-char"
113 PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
122 #AC_CHECK_LIB(pthread, pthread_create,
123 # pthread_lib="-lpthread"; AC_DEFINE(HAVE_LIBPTHREAD), :)
124 # We no longer use config.h
125 AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
127 #dnl Linuxthreads require you to define _REENTRANT in all threaded
128 #dnl code. Bogus, bogus...
130 #if test -n "$pthread_lib"; then
133 # AC_DEFINE(_REENTRANT)
137 # We no longer use config.h
139 #if test -n "$x_libraries"; then
142 # dnl If we find libgtk installed, great; otherwise assume we have
143 # dnl to build it ourselves.
145 # AC_CHECK_LIB(gtk, gtk_main, :, LIBGTKDIR="libgtk", $X_LIBS -lglib -lgdk -lX11 -lXext -lm)
147 # dnl libpthread is required for xogg.
149 # if test -z "$pthread_lib"; then XOGG=""; fi
151 # dnl If we don't have libgtk installed, and we don't have a libgtk
152 # dnl subdirectory to build the library ourself, we can't build xogg.
154 # if test -n "$LIBGTKDIR" -a ! -d "$LIBGTKDIR"; then
160 dnl This seems to be the only way to make autoconf only *sometimes* configure
161 dnl a subdirectory with AC_CONFIG_SUBDIRS. "__noconf" is assumed to not
162 dnl exist as a directory, so configure won't try to recursively enter it, unless
163 dnl the shell variable $dummy is reset to an existing directory inside the
168 #if test -d "$LIBGTKDIR"; then
169 # enable_shared="no"; export enable_shared
171 # AC_CONFIG_SUBDIRS("$dummy")
172 # X_LIBS="-L${srcdir}/libgtk/gtk/.libs -L${srcdir}/libgtk/gdk/.libs -L${srcdir}/libgtk/glib/.libs $X_LIBS"
175 # check macro modified from Jon Shiring's to compensate for autoconf's lagging
176 # behind the times on type madness
178 AC_MSG_CHECKING(for int16_t)
179 AC_CACHE_VAL(has_int16_t,
182 #include <inttypes.h>
184 #include <sys/types.h>
186 int main() {return 0;}
192 AC_MSG_RESULT($has_int16_t)
194 AC_MSG_CHECKING(for int32_t)
195 AC_CACHE_VAL(has_int32_t,
198 #include <inttypes.h>
200 #include <sys/types.h>
202 int main() {return 0;}
208 AC_MSG_RESULT($has_int32_t)
210 AC_MSG_CHECKING(for uint32_t)
211 AC_CACHE_VAL(has_uint32_t,
214 #include <inttypes.h>
216 #include <sys/types.h>
218 int main() {return 0;}
224 AC_MSG_RESULT($has_uint32_t)
226 AC_MSG_CHECKING(for u_int32_t)
227 AC_CACHE_VAL(has_u_int32_t,
230 #include <inttypes.h>
232 #include <sys/types.h>
234 int main() {return 0;}
240 AC_MSG_RESULT($has_u_int32_t)
242 AC_MSG_CHECKING(for int64_t)
243 AC_CACHE_VAL(has_int64_t,
246 #include <inttypes.h>
248 #include <sys/types.h>
250 int main() {return 0;}
256 AC_MSG_RESULT($has_int64_t)
258 AC_CHECK_SIZEOF(short)
260 AC_CHECK_SIZEOF(long)
261 AC_CHECK_SIZEOF(long long)
264 if test x$has_int16_t = "xyes" ; then
268 $ac_cv_sizeof_short) SIZE16="short";;
269 $ac_cv_sizeof_int) SIZE16="int";;
273 if test x$has_int32_t = "xyes" ; then
277 $ac_cv_sizeof_short) SIZE32="short";;
278 $ac_cv_sizeof_int) SIZE32="int";;
279 $ac_cv_sizeof_long) SIZE32="long";;
283 if test x$has_uint32_t = "xyes" ; then
286 if test x$has_u_int32_t = "xyes" ; then
290 $ac_cv_sizeof_short) USIZE32="unsigned short";;
291 $ac_cv_sizeof_int) USIZE32="unsigned int";;
292 $ac_cv_sizeof_long) USIZE32="unsigned long";;
297 if test x$has_int64_t = "xyes" ; then
301 $ac_cv_sizeof_int) SIZE64="int";;
302 $ac_cv_sizeof_long) SIZE64="long";;
303 $ac_cv_sizeof_long_long) SIZE64="long long";;
307 if test -z "$SIZE16"; then
308 AC_MSG_ERROR(No 16 bit type found on this platform!)
310 if test -z "$SIZE32"; then
311 AC_MSG_ERROR(No 32 bit type found on this platform!)
313 if test -z "$USIZE32"; then
314 AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
316 if test -z "$SIZE64"; then
317 AC_MSG_WARN(No 64 bit type found on this platform!)
320 #AC_CHECK_HEADER(alloca.h,AC_DEFINE(USE_ALLOCA_H),:)
321 #AC_CHECK_HEADER(memory.h,AC_DEFINE(USE_MEMORY_H),:)
322 # We no longer use config.h
323 AC_CHECK_HEADER(alloca.h,CFLAGS="$CFLAGS -DUSE_ALLOCA_H",:)
324 AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
333 AC_CHECK_FUNCS(gettimeofday select strcspn strerror strspn sigaction)
347 AC_SUBST(pthread_lib)
349 AC_CONFIG_SUBDIRS(vorbis-tools/libao)
351 AC_OUTPUT(Makefile lib/Makefile examples/Makefile include/vorbis/os_types.h\
352 vorbis-tools/Makefile\
353 vq/Makefile huff/Makefile cmdline/Makefile xmms/Makefile kmpg/Makefile)