1 dnl Process this file with autoconf to produce a configure script
3 dnl ------------------------------------------------
4 dnl Initialization and Versioning
5 dnl ------------------------------------------------
12 AM_CONFIG_HEADER([config.h])
14 AM_INIT_AUTOMAKE(libvorbis,1.1.0)
17 dnl Library versioning
28 AC_SUBST(V_LIB_CURRENT)
29 AC_SUBST(V_LIB_REVISION)
31 AC_SUBST(VF_LIB_CURRENT)
32 AC_SUBST(VF_LIB_REVISION)
34 AC_SUBST(VE_LIB_CURRENT)
35 AC_SUBST(VE_LIB_REVISION)
38 dnl --------------------------------------------------
39 dnl Check for programs
40 dnl --------------------------------------------------
42 dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
43 dnl if $CFLAGS is blank
51 dnl docbook xml transform and processing tools
53 [ --enable-docs build the documentation],
54 [case "${enableval}" in
55 yes) build_docs=true;;
56 no) build_docs=false;;
57 *) AC_MSG_ERROR(unknown value ${enableval} for --enable-docs);;
58 esac],[build_docs=false])
60 dnl ideally we'd look for other tools and support them
61 if test x$build_docs = xtrue; then
62 AC_CHECK_PROGS([XSLTPROC], xsltproc, [/bin/false])
63 AC_CHECK_PROGS([PDFXMLTEX], pdfxmltex, [/bin/false])
64 if test "x$XSLTPROC" = "x/bin/false" || test "x$PDFXMLTEX" = "x/bin/false"; then
66 AC_MSG_WARN([Documentation will not be built!])
70 AM_CONDITIONAL(BUILD_DOCS, [test x$build_docs = xtrue])
72 dnl --------------------------------------------------
73 dnl Set build flags based on environment
74 dnl --------------------------------------------------
76 dnl Set some target options
79 ldflags_save="$LDFLAGS"
80 if test -z "$GCC"; then
83 dnl If we're on IRIX, we wanna use cc even if gcc
84 dnl is there (unless the user has overriden us)...
85 if test -z "$CC"; then
89 CFLAGS="-O2 -w -signed"
90 PROFILE="-p -g3 -O2 -signed" ;;
93 CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
94 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
104 DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
105 CFLAGS="-O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
106 # PROFILE="-Wall -W -pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
107 PROFILE="-Wall -W -pg -g -O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline"
109 # glibc < 2.1.3 has a serious FP bug in the math inline header
110 # that will cripple Vorbis. Look to see if the magic FP stack
111 # clobber is missing in the mathinline header, thus indicating
114 AC_EGREP_CPP(log10.*fldlg2.*fxch,[
115 #define __LIBC_INTERNAL_MATH_INLINES 1
119 if test ${bad} = "maybe" ;then
120 AC_EGREP_CPP(log10.*fldlg2.*fxch.*st\([[0123456789]]*\),
122 #define __LIBC_INTERNAL_MATH_INLINES 1
127 if test ${bad} = "yes" ;then
129 AC_MSG_WARN([********************************************************])
130 AC_MSG_WARN([* The glibc headers on this machine have a serious bug *])
131 AC_MSG_WARN([* in /usr/include/bits/mathinline.h This bug affects *])
132 AC_MSG_WARN([* all floating point code, not just Ogg, built on this *])
133 AC_MSG_WARN([* machine. Upgrading to glibc 2.1.3 is strongly urged *])
134 AC_MSG_WARN([* to correct the problem. Note that upgrading glibc *])
135 AC_MSG_WARN([* will not fix any previously built programs; this is *])
136 AC_MSG_WARN([* a compile-time time bug. *])
137 AC_MSG_WARN([* To work around the problem for this build of Ogg, *])
138 AC_MSG_WARN([* autoconf is disabling all math inlining. This will *])
139 AC_MSG_WARN([* hurt Ogg performace but is necessary for an Ogg that *])
140 AC_MSG_WARN([* will actually work. Once glibc is upgraded, rerun *])
141 AC_MSG_WARN([* configure and make to build with inlining. *])
142 AC_MSG_WARN([********************************************************])
145 CFLAGS=${OPT}" -D__NO_MATH_INLINES"
146 PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
149 DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES"
150 CFLAGS="-O3 -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT"
151 PROFILE="-pg -g -O3 -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT";;
153 DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
154 CFLAGS="-O20 -ffast-math -D_REENTRANT -fsigned-char"
155 PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
157 DEBUG="-g -Wall -W -D__NO_MATH_INLINES -fsigned-char -mv8"
158 CFLAGS="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
159 PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
161 DEBUG="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O0 -fsigned-char"
162 CFLAGS="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O4 -ffast-math -fsigned-char"
163 PROFILE="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -pg -O4 -ffast-math -fsigned-char";;
165 DEBUG="-g -Wall -W -D__NO_MATH_INLINES -fsigned-char"
166 CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char"
167 PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
170 CFLAGS="$CFLAGS $cflags_save"
171 LDFLAGS="$LDFLAGS $ldflags_save"
173 dnl --------------------------------------------------
174 dnl Check for headers
175 dnl --------------------------------------------------
177 AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
179 dnl --------------------------------------------------
180 dnl Check for typedefs, structures, etc
181 dnl --------------------------------------------------
185 dnl --------------------------------------------------
186 dnl Check for libraries
187 dnl --------------------------------------------------
189 AC_CHECK_LIB(m, cos, VORBIS_LIBS="-lm", VORBIS_LIBS="")
190 AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
193 dnl first check through pkg-config
194 dnl check for pkg-config itself so we don't try the m4 macro without pkg-config
195 AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
196 if test "x$HAVE_PKG_CONFIG" = "xyes"
198 PKG_CHECK_MODULES(OGG, ogg >= 1.0, HAVE_OGG=yes, HAVE_OGG=no)
200 if test "x$HAVE_OGG" = "xno"
202 dnl fall back to the old school test
203 XIPH_PATH_OGG(, AC_MSG_ERROR(must have Ogg installed!))
205 LIBS="$OGG_LIBS $VORBIS_LIBS"
206 AC_CHECK_FUNC(oggpack_writealign, , AC_MSG_ERROR(Ogg >= 1.0 required !))
210 dnl --------------------------------------------------
211 dnl Check for library functions
212 dnl --------------------------------------------------
217 dnl --------------------------------------------------
219 dnl --------------------------------------------------
221 AC_SUBST(VORBIS_LIBS)
224 AC_SUBST(pthread_lib)
231 lib/books/coupled/Makefile
232 lib/books/uncoupled/Makefile
233 lib/books/floor/Makefile
234 doc/Makefile doc/vorbisfile/Makefile doc/vorbisenc/Makefile
235 include/Makefile include/vorbis/Makefile
244 vorbis-uninstalled.pc
245 vorbisenc-uninstalled.pc
246 vorbisfile-uninstalled.pc