1 # $Id: configure.in,v 1.20 2000/08/15 09:09:31 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
28 if test -z "$CC"; then
33 AC_CHECK_PROG(AR,ar,ar)
34 AC_CHECK_PROG(INSTALL,install,install)
36 #not everyone uses libm (eg, BeOS)
37 #AC_CHECK_LIB(m, cos, LIBS="-lm"; AC_DEFINE(HAVE_LIBM), LIBS="")
38 # We no longer use config.h
39 AC_CHECK_LIB(m, cos, LIBS="-lm", LIBS="")
41 dnl Set some target options
42 if test -z "$GCC"; then
47 PROFILE="-p -g3 -O2 -signed" ;;
50 OPT="-xO4 -fast -w -fsimple -native -xcg92"
51 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
61 DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
62 OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
63 PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char"
65 # glibc < 2.1.3 has a serious FP bug in the math inline header
66 # that will cripple Vorbis. Look to see if the magic FP stack
67 # clobber is missing in the mathinline header, thus indicating
70 AC_EGREP_CPP(log10.*fldlg2.*fxch,[
71 #define __LIBC_INTERNAL_MATH_INLINES 1
75 if test ${bad} = "maybe" ;then
76 AC_EGREP_CPP(log10.*fldlg2.*fxch.*st\([[0123456789]]*\),
78 #define __LIBC_INTERNAL_MATH_INLINES 1
83 if test ${bad} = "yes" ;then
85 AC_MSG_WARN([********************************************************])
86 AC_MSG_WARN([* The glibc headers on this machine have a serious bug *])
87 AC_MSG_WARN([* in /usr/include/bits/mathinline.h This bug affects *])
88 AC_MSG_WARN([* all floating point code, not just Ogg, built on this *])
89 AC_MSG_WARN([* machine. Upgrading to glibc 2.1.3 is strongly urged *])
90 AC_MSG_WARN([* to correct the problem. Note that upgrading glibc *])
91 AC_MSG_WARN([* will not fix any previously built programs; this is *])
92 AC_MSG_WARN([* a compile-time time bug. *])
93 AC_MSG_WARN([* To work around the problem for this build of Ogg, *])
94 AC_MSG_WARN([* autoconf is disabling all math inlining. This will *])
95 AC_MSG_WARN([* hurt Ogg performace but is necessary for an Ogg that *])
96 AC_MSG_WARN([* will actually work. Once glibc is upgraded, rerun *])
97 AC_MSG_WARN([* configure and make to build with inlining. *])
98 AC_MSG_WARN([********************************************************])
101 OPT=${OPT}" -D__NO_MATH_INLINES"
102 PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
105 DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
106 OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
107 PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
109 DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -mv8"
110 OPT="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
111 PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
113 DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
114 OPT="-O20 -D__NO_MATH_INLINES -fsigned-char"
115 PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
126 #AC_CHECK_LIB(pthread, pthread_create,
127 # pthread_lib="-lpthread"; AC_DEFINE(HAVE_LIBPTHREAD), :)
128 # We no longer use config.h
129 AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
131 #dnl Linuxthreads require you to define _REENTRANT in all threaded
132 #dnl code. Bogus, bogus...
134 #if test -n "$pthread_lib"; then
137 # AC_DEFINE(_REENTRANT)
141 # We no longer use config.h
143 #if test -n "$x_libraries"; then
146 # dnl If we find libgtk installed, great; otherwise assume we have
147 # dnl to build it ourselves.
149 # AC_CHECK_LIB(gtk, gtk_main, :, LIBGTKDIR="libgtk", $X_LIBS -lglib -lgdk -lX11 -lXext -lm)
151 # dnl libpthread is required for xogg.
153 # if test -z "$pthread_lib"; then XOGG=""; fi
155 # dnl If we don't have libgtk installed, and we don't have a libgtk
156 # dnl subdirectory to build the library ourself, we can't build xogg.
158 # if test -n "$LIBGTKDIR" -a ! -d "$LIBGTKDIR"; then
164 dnl This seems to be the only way to make autoconf only *sometimes* configure
165 dnl a subdirectory with AC_CONFIG_SUBDIRS. "__noconf" is assumed to not
166 dnl exist as a directory, so configure won't try to recursively enter it, unless
167 dnl the shell variable $dummy is reset to an existing directory inside the
172 #if test -d "$LIBGTKDIR"; then
173 # enable_shared="no"; export enable_shared
175 # AC_CONFIG_SUBDIRS("$dummy")
176 # X_LIBS="-L${srcdir}/libgtk/gtk/.libs -L${srcdir}/libgtk/gdk/.libs -L${srcdir}/libgtk/glib/.libs $X_LIBS"
179 AC_CHECK_SIZEOF(short)
181 AC_CHECK_SIZEOF(long)
182 AC_CHECK_SIZEOF(long long)
185 $ac_cv_sizeof_short) SIZE16="short";;
186 $ac_cv_sizeof_int) SIZE16="int";;
190 $ac_cv_sizeof_short) SIZE32="short";;
191 $ac_cv_sizeof_int) SIZE32="int";;
192 $ac_cv_sizeof_long) SIZE32="long";;
196 $ac_cv_sizeof_int) SIZE64="int";;
197 $ac_cv_sizeof_long) SIZE64="long";;
198 $ac_cv_sizeof_long_long) SIZE64="long long";;
201 if test -z "$SIZE16"; then
202 AC_MSG_ERROR(No 16 bit type found on this platform!)
204 if test -z "$SIZE32"; then
205 AC_MSG_ERROR(No 32 bit type found on this platform!)
207 if test -z "$SIZE64"; then
208 AC_MSG_WARN(No 64 bit type found on this platform!)
211 #AC_CHECK_HEADER(alloca.h,AC_DEFINE(USE_ALLOCA_H),:)
212 #AC_CHECK_HEADER(memory.h,AC_DEFINE(USE_MEMORY_H),:)
213 # We no longer use config.h
214 AC_CHECK_HEADER(alloca.h,CFLAGS="$CFLAGS -DUSE_ALLOCA_H",:)
215 AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
224 AC_CHECK_FUNCS(gettimeofday select strcspn strerror strspn sigaction)
237 AC_SUBST(pthread_lib)
239 AC_CONFIG_SUBDIRS(vorbis-tools/libao)
241 AC_OUTPUT(Makefile lib/Makefile examples/Makefile vorbis-tools/Makefile\
242 vq/Makefile huff/Makefile cmdline/Makefile xmms/Makefile kmpg/Makefile)