1 dnl Process this file with autoconf to produce a configure script
3 dnl ------------------------------------------------
4 dnl Initialization and Versioning
5 dnl ------------------------------------------------
8 AM_INIT_AUTOMAKE(libvorbis,1.0prebeta4)
10 dnl Library versioning
21 AC_SUBST(V_LIB_CURRENT)
22 AC_SUBST(V_LIB_REVISION)
24 AC_SUBST(VF_LIB_CURRENT)
25 AC_SUBST(VF_LIB_REVISION)
27 AC_SUBST(VE_LIB_CURRENT)
28 AC_SUBST(VE_LIB_REVISION)
31 dnl --------------------------------------------------
32 dnl Check for programs
33 dnl --------------------------------------------------
35 dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
36 dnl if $CFLAGS is blank
44 dnl --------------------------------------------------
45 dnl Set build flags based on environment
46 dnl --------------------------------------------------
50 dnl Set some target options
51 if test -z "$GCC"; then
54 dnl If we're on IRIX, we wanna use cc even if gcc
55 dnl is there (unless the user has overriden us)...
56 if test -z "$CC"; then
60 CFLAGS="-O2 -w -signed"
61 PROFILE="-p -g3 -O2 -signed" ;;
64 CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
65 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
75 DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
76 CFLAGS="-O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
77 # PROFILE="-Wall -W -pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
78 PROFILE="-Wall -W -pg -g -O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline -static"
80 # glibc < 2.1.3 has a serious FP bug in the math inline header
81 # that will cripple Vorbis. Look to see if the magic FP stack
82 # clobber is missing in the mathinline header, thus indicating
85 AC_EGREP_CPP(log10.*fldlg2.*fxch,[
86 #define __LIBC_INTERNAL_MATH_INLINES 1
90 if test ${bad} = "maybe" ;then
91 AC_EGREP_CPP(log10.*fldlg2.*fxch.*st\([[0123456789]]*\),
93 #define __LIBC_INTERNAL_MATH_INLINES 1
98 if test ${bad} = "yes" ;then
100 AC_MSG_WARN([********************************************************])
101 AC_MSG_WARN([* The glibc headers on this machine have a serious bug *])
102 AC_MSG_WARN([* in /usr/include/bits/mathinline.h This bug affects *])
103 AC_MSG_WARN([* all floating point code, not just Ogg, built on this *])
104 AC_MSG_WARN([* machine. Upgrading to glibc 2.1.3 is strongly urged *])
105 AC_MSG_WARN([* to correct the problem. Note that upgrading glibc *])
106 AC_MSG_WARN([* will not fix any previously built programs; this is *])
107 AC_MSG_WARN([* a compile-time time bug. *])
108 AC_MSG_WARN([* To work around the problem for this build of Ogg, *])
109 AC_MSG_WARN([* autoconf is disabling all math inlining. This will *])
110 AC_MSG_WARN([* hurt Ogg performace but is necessary for an Ogg that *])
111 AC_MSG_WARN([* will actually work. Once glibc is upgraded, rerun *])
112 AC_MSG_WARN([* configure and make to build with inlining. *])
113 AC_MSG_WARN([********************************************************])
116 CFLAGS=${OPT}" -D__NO_MATH_INLINES"
117 PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
120 DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
121 CFLAGS="-O20 -ffast-math -D_REENTRANT -fsigned-char"
122 PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
124 DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -mv8"
125 CFLAGS="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
126 PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
128 DEBUG="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O0 -fsigned-char"
129 CFLAGS="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O4 -ffast-math -fsigned-char"
130 PROFILE="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -pg -O4 -ffast-math -fsigned-char";;
132 DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
133 CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char"
134 PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
138 dnl --------------------------------------------------
139 dnl Check for headers
140 dnl --------------------------------------------------
142 AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
144 dnl --------------------------------------------------
145 dnl Check for typedefs, structures, etc
146 dnl --------------------------------------------------
150 dnl --------------------------------------------------
151 dnl Check for libraries
152 dnl --------------------------------------------------
154 AC_CHECK_LIB(m, cos, LIBS="-lm", LIBS="")
155 AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
157 AM_PATH_OGG(LIBS="$LIBS $OGG_LIBS", AC_MSG_ERROR(must have Ogg installed!))
159 dnl --------------------------------------------------
160 dnl Check for library functions
161 dnl --------------------------------------------------
166 dnl --------------------------------------------------
168 dnl --------------------------------------------------
172 AC_SUBST(pthread_lib)
174 AC_OUTPUT(Makefile lib/Makefile lib/modes/Makefile lib/books/Makefile doc/Makefile doc/vorbisfile/Makefile doc/vorbisenc/Makefile include/Makefile include/vorbis/Makefile examples/Makefile win32/Makefile debian/Makefile vq/Makefile)