Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/libvorbis-1.2.0/configure.in @ 62

Last change on this file since 62 was 16, checked in by landauf, 17 years ago

added libvorbis

File size: 7.7 KB
Line 
1dnl Process this file with autoconf to produce a configure script
2
3dnl ------------------------------------------------
4dnl Initialization and Versioning
5dnl ------------------------------------------------
6
7AC_INIT(lib/mdct.c)
8
9AC_CANONICAL_HOST
10AC_CANONICAL_TARGET
11
12AM_CONFIG_HEADER([config.h])
13
14AM_INIT_AUTOMAKE(libvorbis,1.2.0)
15AM_MAINTAINER_MODE
16
17dnl Library versioning
18
19V_LIB_CURRENT=4
20V_LIB_REVISION=0
21V_LIB_AGE=4
22VF_LIB_CURRENT=5
23VF_LIB_REVISION=0
24VF_LIB_AGE=2
25VE_LIB_CURRENT=2
26VE_LIB_REVISION=3
27VE_LIB_AGE=0
28AC_SUBST(V_LIB_CURRENT)
29AC_SUBST(V_LIB_REVISION)
30AC_SUBST(V_LIB_AGE)
31AC_SUBST(VF_LIB_CURRENT)
32AC_SUBST(VF_LIB_REVISION)
33AC_SUBST(VF_LIB_AGE)
34AC_SUBST(VE_LIB_CURRENT)
35AC_SUBST(VE_LIB_REVISION)
36AC_SUBST(VE_LIB_AGE)
37
38dnl -------------------------------------------------- 
39dnl Check for programs
40dnl -------------------------------------------------- 
41
42dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
43dnl if $CFLAGS is blank
44cflags_save="$CFLAGS"
45AC_PROG_CC
46AC_PROG_CPP
47CFLAGS="$cflags_save"
48
49AM_PROG_LIBTOOL
50
51dnl docbook xml transform and processing tools
52AC_ARG_ENABLE(docs,
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])
59
60dnl ideally we'd look for other tools and support them
61if 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
65    build_docs=false
66    AC_MSG_WARN([Documentation will not be built!])
67  fi
68fi
69
70AM_CONDITIONAL(BUILD_DOCS, [test x$build_docs = xtrue])
71
72dnl --------------------------------------------------
73dnl Set build flags based on environment
74dnl --------------------------------------------------
75
76dnl Set some target options
77
78cflags_save="$CFLAGS"
79if test -z "$GCC"; then
80        case $host in
81        *-*-irix*)
82                dnl If we're on IRIX, we wanna use cc even if gcc
83                dnl is there (unless the user has overriden us)...
84                if test -z "$CC"; then
85                        CC=cc
86                fi
87                DEBUG="-g -signed"
88                CFLAGS="-O2 -w -signed"
89                PROFILE="-p -g3 -O2 -signed" ;;
90        sparc-sun-solaris*)
91                DEBUG="-v -g"
92                CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
93                PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
94        *)
95                DEBUG="-g"
96                CFLAGS="-O"
97                PROFILE="-g -p" ;;
98        esac
99else
100
101        AC_MSG_CHECKING([GCC version])
102        GCC_VERSION=`$CC -dumpversion`
103        AC_MSG_RESULT([$GCC_VERSION])
104        case $host in
105        *86-*-linux*)
106                DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
107                CFLAGS="-O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
108#               PROFILE="-Wall -W -pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
109                PROFILE="-Wall -W -pg -g -O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline"
110
111                # glibc < 2.1.3 has a serious FP bug in the math inline header
112                # that will cripple Vorbis.  Look to see if the magic FP stack
113                # clobber is missing in the mathinline header, thus indicating
114                # the buggy version
115
116                AC_EGREP_CPP(log10.*fldlg2.*fxch,[
117                                #define __LIBC_INTERNAL_MATH_INLINES 1
118                                #define __OPTIMIZE__
119                                #include <math.h>
120                                ],bad=maybe,bad=no)
121                if test ${bad} = "maybe" ;then
122                      AC_EGREP_CPP(log10.*fldlg2.*fxch.*st\([[0123456789]]*\),
123                                        [
124                                        #define __LIBC_INTERNAL_MATH_INLINES 1
125                                        #define __OPTIMIZE__
126                                        #include <math.h>
127                                        ],bad=no,bad=yes)
128                fi
129                if test ${bad} = "yes" ;then
130 AC_MSG_WARN([                                                        ])
131 AC_MSG_WARN([********************************************************])
132 AC_MSG_WARN([* The glibc headers on this machine have a serious bug *])
133 AC_MSG_WARN([* in /usr/include/bits/mathinline.h  This bug affects  *])
134 AC_MSG_WARN([* all floating point code, not just Ogg, built on this *])
135 AC_MSG_WARN([* machine.  Upgrading to glibc 2.1.3 is strongly urged *])
136 AC_MSG_WARN([* to correct the problem.  Note that upgrading glibc   *])
137 AC_MSG_WARN([* will not fix any previously built programs; this is  *])
138 AC_MSG_WARN([* a compile-time time bug.                             *])
139 AC_MSG_WARN([* To work around the problem for this build of Ogg,    *])
140 AC_MSG_WARN([* autoconf is disabling all math inlining.  This will  *])
141 AC_MSG_WARN([* hurt Ogg performace but is necessary for an Ogg that *])
142 AC_MSG_WARN([* will actually work.  Once glibc is upgraded, rerun   *])
143 AC_MSG_WARN([* configure and make to build with inlining.           *])
144 AC_MSG_WARN([********************************************************])
145 AC_MSG_WARN([                                                        ])
146
147                CFLAGS=${OPT}" -D__NO_MATH_INLINES"
148                PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
149                fi;;
150        powerpc-*-linux*)
151                DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES"
152                CFLAGS="-O3 -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT"
153                PROFILE="-pg -g -O3 -ffast-math -mfused-madd -mcpu=750 -D_REENTRANT";;
154        *-*-linux*)
155                DEBUG="-g -Wall -W -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
156                CFLAGS="-O20 -ffast-math -D_REENTRANT -fsigned-char"
157                PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
158        sparc-sun-*)
159                DEBUG="-g -Wall -W -D__NO_MATH_INLINES -fsigned-char -mv8"
160                CFLAGS="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
161                PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
162        *-*-darwin*)
163                DEBUG="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O0 -fsigned-char"
164                CFLAGS="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -O4 -ffast-math -fsigned-char"
165                PROFILE="-DDARWIN -fno-common -force_cpusubtype_ALL -Wall -g -pg -O4 -ffast-math -fsigned-char";;
166        *)
167                DEBUG="-g -Wall -W -D__NO_MATH_INLINES -fsigned-char"
168                CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char"
169                PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
170        esac
171fi
172CFLAGS="$CFLAGS $cflags_save"
173
174dnl --------------------------------------------------
175dnl Check for headers
176dnl --------------------------------------------------
177
178AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
179
180dnl --------------------------------------------------
181dnl Check for typedefs, structures, etc
182dnl --------------------------------------------------
183
184dnl none
185
186dnl --------------------------------------------------
187dnl Check for libraries
188dnl --------------------------------------------------
189
190AC_CHECK_LIB(m, cos, VORBIS_LIBS="-lm", VORBIS_LIBS="")
191AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
192
193HAVE_OGG=no
194dnl first check through pkg-config
195dnl check for pkg-config itself so we don't try the m4 macro without pkg-config
196AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
197if test "x$HAVE_PKG_CONFIG" = "xyes"
198then
199  PKG_CHECK_MODULES(OGG, ogg >= 1.0, HAVE_OGG=yes, HAVE_OGG=no)
200fi
201if test "x$HAVE_OGG" = "xno"
202then
203  dnl fall back to the old school test
204  XIPH_PATH_OGG(, AC_MSG_ERROR(must have Ogg installed!))
205  libs_save=$LIBS
206  LIBS="$OGG_LIBS $VORBIS_LIBS"
207  AC_CHECK_FUNC(oggpack_writealign, , AC_MSG_ERROR(Ogg >= 1.0 required !))
208  LIBS=$libs_save
209fi
210
211dnl --------------------------------------------------
212dnl Check for library functions
213dnl --------------------------------------------------
214
215AC_FUNC_ALLOCA
216AC_FUNC_MEMCMP
217
218dnl --------------------------------------------------
219dnl Do substitutions
220dnl --------------------------------------------------
221
222AC_SUBST(VORBIS_LIBS)
223AC_SUBST(DEBUG)
224AC_SUBST(PROFILE)
225AC_SUBST(pthread_lib)
226
227AC_OUTPUT([
228Makefile
229lib/Makefile
230lib/modes/Makefile
231lib/books/Makefile
232lib/books/coupled/Makefile
233lib/books/uncoupled/Makefile
234lib/books/floor/Makefile
235doc/Makefile doc/vorbisfile/Makefile doc/vorbisenc/Makefile
236include/Makefile include/vorbis/Makefile
237examples/Makefile
238vq/Makefile
239libvorbis.spec
240vorbis.pc
241vorbisenc.pc
242vorbisfile.pc
243vorbis-uninstalled.pc
244vorbisenc-uninstalled.pc
245vorbisfile-uninstalled.pc
246])
Note: See TracBrowser for help on using the repository browser.