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.2.1svn)
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
54 dnl docbook xml transform and processing tools
56 [ --enable-docs build the documentation],
57 [case "${enableval}" in
58 yes) build_docs=true;;
59 no) build_docs=false;;
60 *) AC_MSG_ERROR(unknown value ${enableval} for --enable-docs);;
61 esac],[build_docs=false])
63 dnl ideally we'd look for other tools and support them
64 if test x$build_docs = xtrue; then
65 AC_CHECK_PROGS([XSLTPROC], xsltproc, [/bin/false])
66 AC_CHECK_PROGS([PDFXMLTEX], pdfxmltex, [/bin/false])
67 if test "x$XSLTPROC" = "x/bin/false" || test "x$PDFXMLTEX" = "x/bin/false"; then
69 AC_MSG_WARN([Documentation will not be built!])
73 AM_CONDITIONAL(BUILD_DOCS, [test x$build_docs = xtrue])
75 dnl --------------------------------------------------
76 dnl Set build flags based on environment
77 dnl --------------------------------------------------
79 dnl Set some target options
82 if test -z "$GCC"; then
85 dnl If we're on IRIX, we wanna use cc even if gcc
86 dnl is there (unless the user has overriden us)...
87 if test -z "$CC"; then
91 CFLAGS="-O2 -w -signed"
92 PROFILE="-p -g3 -O2 -signed" ;;
95 CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
96 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
104 AC_MSG_CHECKING([GCC version])
105 GCC_VERSION=`$CC -dumpversion`
106 AC_MSG_RESULT([$GCC_VERSION])
109 DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
110 CFLAGS="-O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
111 # PROFILE="-Wall -Wextra -pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
112 PROFILE="-Wall -Wextra -pg -g -O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline"
114 # glibc < 2.1.3 has a serious FP bug in the math inline header
115 # that will cripple Vorbis. Look to see if the magic FP stack
116 # clobber is missing in the mathinline header, thus indicating
119 AC_EGREP_CPP(log10.*fldlg2.*fxch,[
120 #define __LIBC_INTERNAL_MATH_INLINES 1
124 if test ${bad} = "maybe" ;then
125 AC_EGREP_CPP(log10.*fldlg2.*fxch.*st\([[0123456789]]*\),
127 #define __LIBC_INTERNAL_MATH_INLINES 1
132 if test ${bad} = "yes" ;then
134 AC_MSG_WARN([********************************************************])
135 AC_MSG_WARN([* The glibc headers on this machine have a serious bug *])
136 AC_MSG_WARN([* in /usr/include/bits/mathinline.h This bug affects *])
137 AC_MSG_WARN([* all floating point code, not just Ogg, built on this *])
138 AC_MSG_WARN([* machine. Upgrading to glibc 2.1.3 is strongly urged *])
139 AC_MSG_WARN([* to correct the problem. Note that upgrading glibc *])
140 AC_MSG_WARN([* will not fix any previously built programs; this is *])
141 AC_MSG_WARN([* a compile-time time bug. *])
142 AC_MSG_WARN([* To work around the problem for this build of Ogg, *])
143 AC_MSG_WARN([* autoconf is disabling all math inlining. This will *])
144 AC_MSG_WARN([* hurt Ogg performace but is necessary for an Ogg that *])
145 AC_MSG_WARN([* will actually work. Once glibc is upgraded, rerun *])
146 AC_MSG_WARN([* configure and make to build with inlining. *])
147 AC_MSG_WARN([********************************************************])
150 CFLAGS=${OPT}" -D__NO_MATH_INLINES"
151 PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
154 DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES"
155 CFLAGS="-O3 -Wall -Wextra -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT"
156 PROFILE="-pg -g -O3 -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT";;
158 DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
159 CFLAGS="-O20 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char"
160 PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
162 DEBUG="-g -Wall -Wextra -D__NO_MATH_INLINES -fsigned-char -mv8"
163 CFLAGS="-O20 -Wall -Wextra -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
164 PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
166 DEBUG="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O0 -fsigned-char"
167 CFLAGS="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O4 -ffast-math -fsigned-char"
168 PROFILE="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -pg -O4 -ffast-math -fsigned-char";;
170 DEBUG="-g -Wall -Wextra -D__NO_MATH_INLINES -fsigned-char"
171 CFLAGS="-O20 -Wall -Wextra -D__NO_MATH_INLINES -fsigned-char"
172 PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
175 CFLAGS="$CFLAGS $cflags_save"
177 dnl --------------------------------------------------
178 dnl Check for headers
179 dnl --------------------------------------------------
181 AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
183 dnl --------------------------------------------------
184 dnl Check for typedefs, structures, etc
185 dnl --------------------------------------------------
189 dnl --------------------------------------------------
190 dnl Check for libraries
191 dnl --------------------------------------------------
193 AC_CHECK_LIB(m, cos, VORBIS_LIBS="-lm", VORBIS_LIBS="")
194 AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
197 dnl first check through pkg-config
198 dnl check for pkg-config itself so we don't try the m4 macro without pkg-config
199 AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
200 if test "x$HAVE_PKG_CONFIG" = "xyes"
202 PKG_CHECK_MODULES(OGG, ogg >= 1.0, HAVE_OGG=yes, HAVE_OGG=no)
204 if test "x$HAVE_OGG" = "xno"
206 dnl fall back to the old school test
207 XIPH_PATH_OGG(, AC_MSG_ERROR(must have Ogg installed!))
209 LIBS="$OGG_LIBS $VORBIS_LIBS"
210 AC_CHECK_FUNC(oggpack_writealign, , AC_MSG_ERROR(Ogg >= 1.0 required !))
214 dnl --------------------------------------------------
215 dnl Check for library functions
216 dnl --------------------------------------------------
221 dnl --------------------------------------------------
223 dnl --------------------------------------------------
225 AC_SUBST(VORBIS_LIBS)
228 AC_SUBST(pthread_lib)
235 lib/books/coupled/Makefile
236 lib/books/uncoupled/Makefile
237 lib/books/floor/Makefile
238 doc/Makefile doc/vorbisfile/Makefile doc/vorbisenc/Makefile
239 include/Makefile include/vorbis/Makefile
247 vorbis-uninstalled.pc
248 vorbisenc-uninstalled.pc
249 vorbisfile-uninstalled.pc