1 dnl Process this file with autoconf to produce a configure script
3 dnl ------------------------------------------------
4 dnl Initialization and Versioning
5 dnl ------------------------------------------------
8 AC_INIT([libvorbis],[1.2.2],[vorbis-dev@xiph.org])
10 AC_CONFIG_SRCDIR([lib/mdct.c])
12 AC_CANONICAL_TARGET([])
14 AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION)
15 AM_CONFIG_HEADER([config.h])
17 dnl Add parameters for aclocal
18 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
20 dnl Library versioning
21 dnl - library source changed -> increment REVISION
22 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
23 dnl - interfaces added -> increment AGE
24 dnl - interfaces removed -> AGE = 0
35 AC_SUBST(V_LIB_CURRENT)
36 AC_SUBST(V_LIB_REVISION)
38 AC_SUBST(VF_LIB_CURRENT)
39 AC_SUBST(VF_LIB_REVISION)
41 AC_SUBST(VE_LIB_CURRENT)
42 AC_SUBST(VE_LIB_REVISION)
45 dnl --------------------------------------------------
46 dnl Check for programs
47 dnl --------------------------------------------------
49 dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
50 dnl if $CFLAGS is blank
62 dnl docbook xml transform and processing tools
64 AC_HELP_STRING([--enable-docs], [build the documentation]))
66 dnl ideally we'd look for other tools and support them
67 if test x$enable_docs = xyes; then
68 AC_CHECK_PROGS([XSLTPROC], xsltproc, [/bin/false])
69 AC_CHECK_PROGS([PDFXMLTEX], pdfxmltex, [/bin/false])
70 if test "x$XSLTPROC" = "x/bin/false" || test "x$PDFXMLTEX" = "x/bin/false"; then
72 AC_MSG_WARN([Documentation will not be built!])
76 AM_CONDITIONAL(BUILD_DOCS, [test x$enable_docs = xyes])
78 dnl --------------------------------------------------
79 dnl Set build flags based on environment
80 dnl --------------------------------------------------
82 dnl Set some target options
85 if test -z "$GCC"; then
88 dnl If we're on IRIX, we wanna use cc even if gcc
89 dnl is there (unless the user has overriden us)...
90 if test -z "$CC"; then
94 CFLAGS="-O2 -w -signed"
95 PROFILE="-p -g3 -O2 -signed" ;;
98 CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
99 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
107 AC_MSG_CHECKING([GCC version])
108 GCC_VERSION=`$CC -dumpversion`
109 AC_MSG_RESULT([$GCC_VERSION])
112 DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
113 CFLAGS="-O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
114 # PROFILE="-Wall -Wextra -pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
115 PROFILE="-Wall -Wextra -pg -g -O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline"
117 # glibc < 2.1.3 has a serious FP bug in the math inline header
118 # that will cripple Vorbis. Look to see if the magic FP stack
119 # clobber is missing in the mathinline header, thus indicating
122 AC_EGREP_CPP(log10.*fldlg2.*fxch,[
123 #define __LIBC_INTERNAL_MATH_INLINES 1
127 if test ${bad} = "maybe" ;then
128 AC_EGREP_CPP(log10.*fldlg2.*fxch.*st\([[0123456789]]*\),
130 #define __LIBC_INTERNAL_MATH_INLINES 1
135 if test ${bad} = "yes" ;then
137 AC_MSG_WARN([********************************************************])
138 AC_MSG_WARN([* The glibc headers on this machine have a serious bug *])
139 AC_MSG_WARN([* in /usr/include/bits/mathinline.h This bug affects *])
140 AC_MSG_WARN([* all floating point code, not just Ogg, built on this *])
141 AC_MSG_WARN([* machine. Upgrading to glibc 2.1.3 is strongly urged *])
142 AC_MSG_WARN([* to correct the problem. Note that upgrading glibc *])
143 AC_MSG_WARN([* will not fix any previously built programs; this is *])
144 AC_MSG_WARN([* a compile-time time bug. *])
145 AC_MSG_WARN([* To work around the problem for this build of Ogg, *])
146 AC_MSG_WARN([* autoconf is disabling all math inlining. This will *])
147 AC_MSG_WARN([* hurt Ogg performace but is necessary for an Ogg that *])
148 AC_MSG_WARN([* will actually work. Once glibc is upgraded, rerun *])
149 AC_MSG_WARN([* configure and make to build with inlining. *])
150 AC_MSG_WARN([********************************************************])
153 CFLAGS=${OPT}" -D__NO_MATH_INLINES"
154 PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
157 DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES"
158 CFLAGS="-O3 -Wall -Wextra -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT"
159 PROFILE="-pg -g -O3 -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT";;
161 DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
162 CFLAGS="-O20 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char"
163 PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
165 DEBUG="-g -Wall -Wextra -D__NO_MATH_INLINES -fsigned-char -mv8"
166 CFLAGS="-O20 -Wall -Wextra -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
167 PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
169 DEBUG="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O0 -fsigned-char"
170 CFLAGS="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O4 -ffast-math -fsigned-char"
171 PROFILE="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -pg -O4 -ffast-math -fsigned-char";;
173 # Use -W instead of -Wextra because gcc on OS/2 is an old version.
174 DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
175 CFLAGS="-O20 -Wall -W -ffast-math -D_REENTRANT -fsigned-char"
176 PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
178 DEBUG="-g -Wall -Wextra -D__NO_MATH_INLINES -fsigned-char"
179 CFLAGS="-O20 -Wall -Wextra -D__NO_MATH_INLINES -fsigned-char"
180 PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
183 AC_ADD_CFLAGS([-Wdeclaration-after-statement])
185 CFLAGS="$CFLAGS $cflags_save"
187 dnl --------------------------------------------------
188 dnl Check for headers
189 dnl --------------------------------------------------
191 AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
193 dnl --------------------------------------------------
194 dnl Check for typedefs, structures, etc
195 dnl --------------------------------------------------
199 dnl --------------------------------------------------
200 dnl Check for libraries
201 dnl --------------------------------------------------
203 AC_CHECK_LIB(m, cos, VORBIS_LIBS="-lm", VORBIS_LIBS="")
204 AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
209 if test "x$PKG_CONFIG" != "x"
211 PKG_CHECK_MODULES(OGG, ogg >= 1.0, HAVE_OGG=yes, HAVE_OGG=no)
213 if test "x$HAVE_OGG" = "xno"
215 dnl fall back to the old school test
216 XIPH_PATH_OGG(, AC_MSG_ERROR(must have Ogg installed!))
218 LIBS="$OGG_LIBS $VORBIS_LIBS"
219 AC_CHECK_FUNC(oggpack_writealign, , AC_MSG_ERROR(Ogg >= 1.0 required !))
223 dnl --------------------------------------------------
224 dnl Check for library functions
225 dnl --------------------------------------------------
230 dnl --------------------------------------------------
232 dnl --------------------------------------------------
234 AC_SUBST(VORBIS_LIBS)
237 AC_SUBST(pthread_lib)
239 dnl The following line causes the libtool distributed with the source
240 dnl to be replaced if the build system has a more recent version.
241 AC_SUBST(LIBTOOL_DEPS)
249 lib/books/coupled/Makefile
250 lib/books/uncoupled/Makefile
251 lib/books/floor/Makefile
252 doc/Makefile doc/vorbisfile/Makefile doc/vorbisenc/Makefile
253 include/Makefile include/vorbis/Makefile
261 vorbis-uninstalled.pc
262 vorbisenc-uninstalled.pc
263 vorbisfile-uninstalled.pc