1 dnl Process this file with autoconf to produce a configure script
3 dnl ------------------------------------------------
4 dnl Initialization and Versioning
5 dnl ------------------------------------------------
12 AM_INIT_AUTOMAKE(libvorbis,1.0.1)
15 dnl Library versioning
26 AC_SUBST(V_LIB_CURRENT)
27 AC_SUBST(V_LIB_REVISION)
29 AC_SUBST(VF_LIB_CURRENT)
30 AC_SUBST(VF_LIB_REVISION)
32 AC_SUBST(VE_LIB_CURRENT)
33 AC_SUBST(VE_LIB_REVISION)
36 dnl --------------------------------------------------
37 dnl Check for programs
38 dnl --------------------------------------------------
40 dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
41 dnl if $CFLAGS is blank
49 dnl docbook xml transform and processing tools
51 [ --enable-docs build the documentation],
52 [case "${enableval}" in
53 yes) build_docs=true;;
54 no) build_docs=false;;
55 *) AC_MSG_ERROR(unknown value ${enableval} for --enable-docs);;
56 esac],[build_docs=false])
58 dnl ideally we'd look for other tools and support them
59 if test x$build_docs = xtrue; then
60 AC_CHECK_PROGS([XSLTPROC], xsltproc, [/bin/false])
61 AC_CHECK_PROGS([PDFXMLTEX], pdfxmltex, [/bin/false])
62 if test "x$XSLTPROC" = "x/bin/false" || test "x$PDFXMLTEX" = "x/bin/false"; then
64 AC_MSG_WARN([Documentation will not be built])
68 AM_CONDITIONAL(BUILD_DOCS, [test x$build_docs = xtrue])
70 dnl --------------------------------------------------
71 dnl Set build flags based on environment
72 dnl --------------------------------------------------
74 dnl Set some target options
77 ldflags_save="$LDFLAGS"
78 if test -z "$GCC"; then
81 dnl If we're on IRIX, we wanna use cc even if gcc
82 dnl is there (unless the user has overriden us)...
83 if test -z "$CC"; then
87 CFLAGS="-O2 -w -signed"
88 PROFILE="-p -g3 -O2 -signed" ;;
91 CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
92 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
102 DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
103 CFLAGS="-O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
104 # PROFILE="-Wall -W -pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
105 PROFILE="-Wall -W -pg -g -O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline"
107 # glibc < 2.1.3 has a serious FP bug in the math inline header
108 # that will cripple Vorbis. Look to see if the magic FP stack
109 # clobber is missing in the mathinline header, thus indicating
112 AC_EGREP_CPP(log10.*fldlg2.*fxch,[
113 #define __LIBC_INTERNAL_MATH_INLINES 1
117 if test ${bad} = "maybe" ;then
118 AC_EGREP_CPP(log10.*fldlg2.*fxch.*st\([[0123456789]]*\),
120 #define __LIBC_INTERNAL_MATH_INLINES 1
125 if test ${bad} = "yes" ;then
127 AC_MSG_WARN([********************************************************])
128 AC_MSG_WARN([* The glibc headers on this machine have a serious bug *])
129 AC_MSG_WARN([* in /usr/include/bits/mathinline.h This bug affects *])
130 AC_MSG_WARN([* all floating point code, not just Ogg, built on this *])
131 AC_MSG_WARN([* machine. Upgrading to glibc 2.1.3 is strongly urged *])
132 AC_MSG_WARN([* to correct the problem. Note that upgrading glibc *])
133 AC_MSG_WARN([* will not fix any previously built programs; this is *])
134 AC_MSG_WARN([* a compile-time time bug. *])
135 AC_MSG_WARN([* To work around the problem for this build of Ogg, *])
136 AC_MSG_WARN([* autoconf is disabling all math inlining. This will *])
137 AC_MSG_WARN([* hurt Ogg performace but is necessary for an Ogg that *])
138 AC_MSG_WARN([* will actually work. Once glibc is upgraded, rerun *])
139 AC_MSG_WARN([* configure and make to build with inlining. *])
140 AC_MSG_WARN([********************************************************])
143 CFLAGS=${OPT}" -D__NO_MATH_INLINES"
144 PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
147 DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES"
148 CFLAGS="-O3 -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT"
149 PROFILE="-pg -g -O3 -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT";;
151 DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
152 CFLAGS="-O20 -ffast-math -D_REENTRANT -fsigned-char"
153 PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
155 DEBUG="-g -Wall -W -D__NO_MATH_INLINES -fsigned-char -mv8"
156 CFLAGS="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
157 PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
159 DEBUG="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O0 -fsigned-char"
160 CFLAGS="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O4 -ffast-math -fsigned-char"
161 PROFILE="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -pg -O4 -ffast-math -fsigned-char";;
163 DEBUG="-g -Wall -W -D__NO_MATH_INLINES -fsigned-char"
164 CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char"
165 PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
168 CFLAGS="$CFLAGS $cflags_save"
169 LDFLAGS="$LDFLAGS $ldflags_save"
171 dnl --------------------------------------------------
172 dnl Check for headers
173 dnl --------------------------------------------------
175 AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
177 dnl --------------------------------------------------
178 dnl Check for typedefs, structures, etc
179 dnl --------------------------------------------------
183 dnl --------------------------------------------------
184 dnl Check for libraries
185 dnl --------------------------------------------------
187 AC_CHECK_LIB(m, cos, VORBIS_LIBS="-lm", VORBIS_LIBS="")
188 AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
191 dnl first check through pkg-config
192 dnl check for pkg-config itself so we don't try the m4 macro without pkg-config
193 AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
194 if test "x$HAVE_PKG_CONFIG" = "xyes"
196 PKG_CHECK_MODULES(OGG, ogg >= 1.0, HAVE_OGG=yes, HAVE_OGG=no)
198 if test "x$HAVE_OGG" = "xno"
200 dnl fall back to the old school test
201 XIPH_PATH_OGG(, AC_MSG_ERROR(must have Ogg installed!))
203 LIBS="$OGG_LIBS $VORBIS_LIBS"
204 AC_CHECK_FUNC(oggpack_writealign, , AC_MSG_ERROR(Ogg >= 1.0 required !))
208 dnl --------------------------------------------------
209 dnl Check for library functions
210 dnl --------------------------------------------------
215 dnl --------------------------------------------------
217 dnl --------------------------------------------------
219 AC_SUBST(VORBIS_LIBS)
222 AC_SUBST(pthread_lib)
229 lib/books/coupled/Makefile
230 lib/books/uncoupled/Makefile
231 lib/books/floor/Makefile
232 doc/Makefile doc/vorbisfile/Makefile doc/vorbisenc/Makefile
233 include/Makefile include/vorbis/Makefile
242 vorbis-uninstalled.pc
243 vorbisenc-uninstalled.pc
244 vorbisfile-uninstalled.pc