Chris@1
|
1 dnl Process this file with autoconf to produce a configure script
|
Chris@1
|
2
|
Chris@1
|
3 dnl ------------------------------------------------
|
Chris@1
|
4 dnl Initialization and Versioning
|
Chris@1
|
5 dnl ------------------------------------------------
|
Chris@1
|
6
|
Chris@1
|
7
|
Chris@1
|
8 AC_INIT([libvorbis],[1.3.3],[vorbis-dev@xiph.org])
|
Chris@1
|
9
|
Chris@1
|
10 AC_CONFIG_SRCDIR([lib/mdct.c])
|
Chris@1
|
11
|
Chris@1
|
12 AC_CANONICAL_TARGET([])
|
Chris@1
|
13
|
Chris@1
|
14 AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION)
|
Chris@1
|
15 AM_MAINTAINER_MODE
|
Chris@1
|
16 AM_CONFIG_HEADER([config.h])
|
Chris@1
|
17
|
Chris@1
|
18 dnl Add parameters for aclocal
|
Chris@1
|
19 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
|
Chris@1
|
20
|
Chris@1
|
21 dnl Library versioning
|
Chris@1
|
22 dnl - library source changed -> increment REVISION
|
Chris@1
|
23 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
|
Chris@1
|
24 dnl - interfaces added -> increment AGE
|
Chris@1
|
25 dnl - interfaces removed -> AGE = 0
|
Chris@1
|
26
|
Chris@1
|
27 V_LIB_CURRENT=4
|
Chris@1
|
28 V_LIB_REVISION=6
|
Chris@1
|
29 V_LIB_AGE=4
|
Chris@1
|
30
|
Chris@1
|
31 VF_LIB_CURRENT=6
|
Chris@1
|
32 VF_LIB_REVISION=5
|
Chris@1
|
33 VF_LIB_AGE=3
|
Chris@1
|
34
|
Chris@1
|
35 VE_LIB_CURRENT=2
|
Chris@1
|
36 VE_LIB_REVISION=9
|
Chris@1
|
37 VE_LIB_AGE=0
|
Chris@1
|
38
|
Chris@1
|
39 AC_SUBST(V_LIB_CURRENT)
|
Chris@1
|
40 AC_SUBST(V_LIB_REVISION)
|
Chris@1
|
41 AC_SUBST(V_LIB_AGE)
|
Chris@1
|
42 AC_SUBST(VF_LIB_CURRENT)
|
Chris@1
|
43 AC_SUBST(VF_LIB_REVISION)
|
Chris@1
|
44 AC_SUBST(VF_LIB_AGE)
|
Chris@1
|
45 AC_SUBST(VE_LIB_CURRENT)
|
Chris@1
|
46 AC_SUBST(VE_LIB_REVISION)
|
Chris@1
|
47 AC_SUBST(VE_LIB_AGE)
|
Chris@1
|
48
|
Chris@1
|
49 dnl --------------------------------------------------
|
Chris@1
|
50 dnl Check for programs
|
Chris@1
|
51 dnl --------------------------------------------------
|
Chris@1
|
52
|
Chris@1
|
53 dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
|
Chris@1
|
54 dnl if $CFLAGS is blank
|
Chris@1
|
55 cflags_save="$CFLAGS"
|
Chris@1
|
56 AC_PROG_CC
|
Chris@1
|
57 AC_PROG_CPP
|
Chris@1
|
58 CFLAGS="$cflags_save"
|
Chris@1
|
59
|
Chris@1
|
60 AC_C_INLINE
|
Chris@1
|
61
|
Chris@1
|
62 AC_LIBTOOL_WIN32_DLL
|
Chris@1
|
63 AC_PROG_LIBTOOL
|
Chris@1
|
64 AM_PROG_CC_C_O
|
Chris@1
|
65
|
Chris@1
|
66 dnl Check for doxygen
|
Chris@1
|
67 if test "x$enable_docs" = xyes; then
|
Chris@1
|
68 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, true, false)
|
Chris@1
|
69 if test $HAVE_DOXYGEN = "false"; then
|
Chris@1
|
70 AC_MSG_WARN([*** doxygen not found, API documentation will not be built])
|
Chris@1
|
71 fi
|
Chris@1
|
72 else
|
Chris@1
|
73 HAVE_DOXYGEN=false
|
Chris@1
|
74 fi
|
Chris@1
|
75 AM_CONDITIONAL(HAVE_DOXYGEN,$HAVE_DOXYGEN)
|
Chris@1
|
76
|
Chris@1
|
77 dnl latex tools for the specification document
|
Chris@1
|
78 AC_ARG_ENABLE(docs,
|
Chris@1
|
79 AC_HELP_STRING([--enable-docs], [build the documentation]))
|
Chris@1
|
80
|
Chris@1
|
81 if test "x$enable_docs" = xyes; then
|
Chris@1
|
82 AC_CHECK_PROGS([PDFLATEX], pdflatex, [/bin/false])
|
Chris@1
|
83 AC_CHECK_PROGS([HTLATEX], htlatex, [/bin/false])
|
Chris@1
|
84 if test "x$PDFLATEX" = x/bin/false || test "x$HTLATEX" = x/bin/false; then
|
Chris@1
|
85 enable_docs=no
|
Chris@1
|
86 AC_MSG_WARN([Documentation will not be built!])
|
Chris@1
|
87 fi
|
Chris@1
|
88 fi
|
Chris@1
|
89
|
Chris@1
|
90 AM_CONDITIONAL(BUILD_DOCS, [test "x$enable_docs" = xyes])
|
Chris@1
|
91
|
Chris@1
|
92 AC_ARG_ENABLE(examples,
|
Chris@1
|
93 AS_HELP_STRING([--enable-examples], [build the examples]))
|
Chris@1
|
94
|
Chris@1
|
95 AM_CONDITIONAL(BUILD_EXAMPLES, [test "x$enable_examples" = xyes])
|
Chris@1
|
96
|
Chris@1
|
97 dnl --------------------------------------------------
|
Chris@1
|
98 dnl Set build flags based on environment
|
Chris@1
|
99 dnl --------------------------------------------------
|
Chris@1
|
100
|
Chris@1
|
101 dnl Set some target options
|
Chris@1
|
102
|
Chris@1
|
103 cflags_save="$CFLAGS"
|
Chris@1
|
104 if test -z "$GCC"; then
|
Chris@1
|
105 case $host in
|
Chris@1
|
106 *-*-irix*)
|
Chris@1
|
107 dnl If we're on IRIX, we wanna use cc even if gcc
|
Chris@1
|
108 dnl is there (unless the user has overriden us)...
|
Chris@1
|
109 if test -z "$CC"; then
|
Chris@1
|
110 CC=cc
|
Chris@1
|
111 fi
|
Chris@1
|
112 DEBUG="-g -signed"
|
Chris@1
|
113 CFLAGS="-O2 -w -signed"
|
Chris@1
|
114 PROFILE="-p -g3 -O2 -signed" ;;
|
Chris@1
|
115 sparc-sun-solaris*)
|
Chris@1
|
116 DEBUG="-v -g"
|
Chris@1
|
117 CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
|
Chris@1
|
118 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
|
Chris@1
|
119 *)
|
Chris@1
|
120 DEBUG="-g"
|
Chris@1
|
121 CFLAGS="-O"
|
Chris@1
|
122 PROFILE="-g -p" ;;
|
Chris@1
|
123 esac
|
Chris@1
|
124 else
|
Chris@1
|
125
|
Chris@1
|
126 AC_MSG_CHECKING([GCC version])
|
Chris@1
|
127 GCC_VERSION=`$CC -dumpversion`
|
Chris@1
|
128 AC_MSG_RESULT([$GCC_VERSION])
|
Chris@1
|
129 case $host in
|
Chris@1
|
130 *86-*-linux*)
|
Chris@1
|
131 DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
|
Chris@1
|
132 CFLAGS="-O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
|
Chris@1
|
133 # PROFILE="-Wall -Wextra -pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
|
Chris@1
|
134 PROFILE="-Wall -Wextra -pg -g -O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline"
|
Chris@1
|
135
|
Chris@1
|
136 # glibc < 2.1.3 has a serious FP bug in the math inline header
|
Chris@1
|
137 # that will cripple Vorbis. Look to see if the magic FP stack
|
Chris@1
|
138 # clobber is missing in the mathinline header, thus indicating
|
Chris@1
|
139 # the buggy version
|
Chris@1
|
140
|
Chris@1
|
141 AC_EGREP_CPP(log10.*fldlg2.*fxch,[
|
Chris@1
|
142 #define __LIBC_INTERNAL_MATH_INLINES 1
|
Chris@1
|
143 #define __OPTIMIZE__
|
Chris@1
|
144 #include <math.h>
|
Chris@1
|
145 ],bad=maybe,bad=no)
|
Chris@1
|
146 if test ${bad} = "maybe" ;then
|
Chris@1
|
147 AC_EGREP_CPP(log10.*fldlg2.*fxch.*st\([[0123456789]]*\),
|
Chris@1
|
148 [
|
Chris@1
|
149 #define __LIBC_INTERNAL_MATH_INLINES 1
|
Chris@1
|
150 #define __OPTIMIZE__
|
Chris@1
|
151 #include <math.h>
|
Chris@1
|
152 ],bad=no,bad=yes)
|
Chris@1
|
153 fi
|
Chris@1
|
154 if test ${bad} = "yes" ;then
|
Chris@1
|
155 AC_MSG_WARN([ ])
|
Chris@1
|
156 AC_MSG_WARN([********************************************************])
|
Chris@1
|
157 AC_MSG_WARN([* The glibc headers on this machine have a serious bug *])
|
Chris@1
|
158 AC_MSG_WARN([* in /usr/include/bits/mathinline.h This bug affects *])
|
Chris@1
|
159 AC_MSG_WARN([* all floating point code, not just Ogg, built on this *])
|
Chris@1
|
160 AC_MSG_WARN([* machine. Upgrading to glibc 2.1.3 is strongly urged *])
|
Chris@1
|
161 AC_MSG_WARN([* to correct the problem. Note that upgrading glibc *])
|
Chris@1
|
162 AC_MSG_WARN([* will not fix any previously built programs; this is *])
|
Chris@1
|
163 AC_MSG_WARN([* a compile-time time bug. *])
|
Chris@1
|
164 AC_MSG_WARN([* To work around the problem for this build of Ogg, *])
|
Chris@1
|
165 AC_MSG_WARN([* autoconf is disabling all math inlining. This will *])
|
Chris@1
|
166 AC_MSG_WARN([* hurt Ogg performace but is necessary for an Ogg that *])
|
Chris@1
|
167 AC_MSG_WARN([* will actually work. Once glibc is upgraded, rerun *])
|
Chris@1
|
168 AC_MSG_WARN([* configure and make to build with inlining. *])
|
Chris@1
|
169 AC_MSG_WARN([********************************************************])
|
Chris@1
|
170 AC_MSG_WARN([ ])
|
Chris@1
|
171
|
Chris@1
|
172 CFLAGS=${OPT}" -D__NO_MATH_INLINES"
|
Chris@1
|
173 PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
|
Chris@1
|
174 fi;;
|
Chris@1
|
175 powerpc-*-linux*spe)
|
Chris@1
|
176 DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES"
|
Chris@1
|
177 CFLAGS="-O3 -Wall -Wextra -ffast-math -mfused-madd -D_REENTRANT"
|
Chris@1
|
178 PROFILE="-pg -g -O3 -ffast-math -mfused-madd -D_REENTRANT";;
|
Chris@1
|
179 powerpc-*-linux*)
|
Chris@1
|
180 DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES"
|
Chris@1
|
181 CFLAGS="-O3 -Wall -Wextra -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT"
|
Chris@1
|
182 PROFILE="-pg -g -O3 -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT";;
|
Chris@1
|
183 *-*-linux*)
|
Chris@1
|
184 DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
|
Chris@1
|
185 CFLAGS="-O20 -Wall -Wextra -ffast-math -D_REENTRANT -fsigned-char"
|
Chris@1
|
186 PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
|
Chris@1
|
187 sparc-sun-*)
|
Chris@1
|
188 sparc_cpu=""
|
Chris@1
|
189 AC_MSG_CHECKING([if gcc supports -mv8])
|
Chris@1
|
190 old_cflags="$CFLAGS"
|
Chris@1
|
191 CFLAGS="$CFLAGS -mv8"
|
Chris@1
|
192 AC_TRY_COMPILE(, [return 0;], [
|
Chris@1
|
193 AC_MSG_RESULT([yes])
|
Chris@1
|
194 sparc_cpu="-mv8"
|
Chris@1
|
195 ])
|
Chris@1
|
196 CFLAGS="$old_cflags"
|
Chris@1
|
197 DEBUG="-g -Wall -Wextra -D__NO_MATH_INLINES -fsigned-char $sparc_cpu"
|
Chris@1
|
198 CFLAGS="-O20 -Wall -Wextra -ffast-math -D__NO_MATH_INLINES -fsigned-char $sparc_cpu"
|
Chris@1
|
199 PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char $sparc_cpu" ;;
|
Chris@1
|
200 *-*-darwin*)
|
Chris@1
|
201 DEBUG="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O0 -fsigned-char"
|
Chris@1
|
202 CFLAGS="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O4 -ffast-math -fsigned-char"
|
Chris@1
|
203 PROFILE="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -pg -O4 -ffast-math -fsigned-char";;
|
Chris@1
|
204 *-*-os2*)
|
Chris@1
|
205 # Use -W instead of -Wextra because gcc on OS/2 is an old version.
|
Chris@1
|
206 DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
|
Chris@1
|
207 CFLAGS="-O20 -Wall -W -ffast-math -D_REENTRANT -fsigned-char"
|
Chris@1
|
208 PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
|
Chris@1
|
209 *)
|
Chris@1
|
210 DEBUG="-g -Wall -Wextra -D__NO_MATH_INLINES -fsigned-char"
|
Chris@1
|
211 CFLAGS="-O20 -Wall -Wextra -D__NO_MATH_INLINES -fsigned-char"
|
Chris@1
|
212 PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
|
Chris@1
|
213 esac
|
Chris@1
|
214
|
Chris@1
|
215 AC_ADD_CFLAGS([-Wdeclaration-after-statement])
|
Chris@1
|
216 fi
|
Chris@1
|
217 CFLAGS="$CFLAGS $cflags_save"
|
Chris@1
|
218
|
Chris@1
|
219 dnl --------------------------------------------------
|
Chris@1
|
220 dnl Check for headers
|
Chris@1
|
221 dnl --------------------------------------------------
|
Chris@1
|
222
|
Chris@1
|
223 AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
|
Chris@1
|
224
|
Chris@1
|
225 dnl --------------------------------------------------
|
Chris@1
|
226 dnl Check for typedefs, structures, etc
|
Chris@1
|
227 dnl --------------------------------------------------
|
Chris@1
|
228
|
Chris@1
|
229 dnl none
|
Chris@1
|
230
|
Chris@1
|
231 dnl --------------------------------------------------
|
Chris@1
|
232 dnl Check for libraries
|
Chris@1
|
233 dnl --------------------------------------------------
|
Chris@1
|
234
|
Chris@1
|
235 AC_CHECK_LIB(m, cos, VORBIS_LIBS="-lm", VORBIS_LIBS="")
|
Chris@1
|
236 AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
|
Chris@1
|
237
|
Chris@1
|
238 PKG_PROG_PKG_CONFIG
|
Chris@1
|
239
|
Chris@1
|
240 HAVE_OGG=no
|
Chris@1
|
241 if test "x$PKG_CONFIG" != "x"
|
Chris@1
|
242 then
|
Chris@1
|
243 PKG_CHECK_MODULES(OGG, ogg >= 1.0, HAVE_OGG=yes, HAVE_OGG=no)
|
Chris@1
|
244 fi
|
Chris@1
|
245 if test "x$HAVE_OGG" = "xno"
|
Chris@1
|
246 then
|
Chris@1
|
247 dnl fall back to the old school test
|
Chris@1
|
248 XIPH_PATH_OGG(, AC_MSG_ERROR(must have Ogg installed!))
|
Chris@1
|
249 libs_save=$LIBS
|
Chris@1
|
250 LIBS="$OGG_LIBS $VORBIS_LIBS"
|
Chris@1
|
251 AC_CHECK_FUNC(oggpack_writealign, , AC_MSG_ERROR(Ogg >= 1.0 required !))
|
Chris@1
|
252 LIBS=$libs_save
|
Chris@1
|
253 fi
|
Chris@1
|
254
|
Chris@1
|
255 dnl --------------------------------------------------
|
Chris@1
|
256 dnl Check for library functions
|
Chris@1
|
257 dnl --------------------------------------------------
|
Chris@1
|
258
|
Chris@1
|
259 AC_FUNC_ALLOCA
|
Chris@1
|
260 AC_FUNC_MEMCMP
|
Chris@1
|
261
|
Chris@1
|
262 dnl --------------------------------------------------
|
Chris@1
|
263 dnl Do substitutions
|
Chris@1
|
264 dnl --------------------------------------------------
|
Chris@1
|
265
|
Chris@1
|
266 AC_SUBST(VORBIS_LIBS)
|
Chris@1
|
267 AC_SUBST(DEBUG)
|
Chris@1
|
268 AC_SUBST(PROFILE)
|
Chris@1
|
269 AC_SUBST(pthread_lib)
|
Chris@1
|
270
|
Chris@1
|
271 dnl The following line causes the libtool distributed with the source
|
Chris@1
|
272 dnl to be replaced if the build system has a more recent version.
|
Chris@1
|
273 AC_SUBST(LIBTOOL_DEPS)
|
Chris@1
|
274
|
Chris@1
|
275 AC_OUTPUT([
|
Chris@1
|
276 Makefile
|
Chris@1
|
277 m4/Makefile
|
Chris@1
|
278 lib/Makefile
|
Chris@1
|
279 lib/modes/Makefile
|
Chris@1
|
280 lib/books/Makefile
|
Chris@1
|
281 lib/books/coupled/Makefile
|
Chris@1
|
282 lib/books/uncoupled/Makefile
|
Chris@1
|
283 lib/books/floor/Makefile
|
Chris@1
|
284 doc/Makefile doc/vorbisfile/Makefile doc/vorbisenc/Makefile doc/libvorbis/Makefile
|
Chris@1
|
285 doc/Doxyfile
|
Chris@1
|
286 include/Makefile include/vorbis/Makefile
|
Chris@1
|
287 examples/Makefile
|
Chris@1
|
288 test/Makefile
|
Chris@1
|
289 vq/Makefile
|
Chris@1
|
290 libvorbis.spec
|
Chris@1
|
291 vorbis.pc
|
Chris@1
|
292 vorbisenc.pc
|
Chris@1
|
293 vorbisfile.pc
|
Chris@1
|
294 vorbis-uninstalled.pc
|
Chris@1
|
295 vorbisenc-uninstalled.pc
|
Chris@1
|
296 vorbisfile-uninstalled.pc
|
Chris@1
|
297 ])
|