1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
|
# $Id: configure.in,v 1.18.2.1 2000/08/15 08:32:58 xiphmont Exp $
AC_INIT(lib/mdct.c)
#AC_CONFIG_HEADER(config.h)
cp configure.guess config.guess
cp configure.sub config.sub
AC_CANONICAL_HOST
dnl If we're on IRIX, we wanna use cc even if gcc is there (unless the user
dnl has overriden us)...
case $host in
*-*-irix*)
if test -z "$CC"; then
CC=cc
fi
AC_CHECK_LIB(audio, ALwritesamps)
;;
# BeOS does not use -lm
# *-*-beos)
# LIBS=""
# ;;
# added better check below
esac
if test -z "$CC"; then
AC_PROG_CC
fi
AC_PROG_CPP
AC_PROG_RANLIB
AC_CHECK_PROG(AR,ar,ar)
AC_CHECK_PROG(INSTALL,install,install)
#not everyone uses libm (eg, BeOS)
#AC_CHECK_LIB(m, cos, LIBS="-lm"; AC_DEFINE(HAVE_LIBM), LIBS="")
# We no longer use config.h
AC_CHECK_LIB(m, cos, LIBS="-lm", LIBS="")
dnl Set some target options
if test -z "$GCC"; then
case $host in
*-*-irix*)
DEBUG="-g -signed"
OPT="-O2 -w -signed"
PROFILE="-p -g3 -O2 -signed" ;;
sparc-sun-solaris*)
DEBUG="-v -g"
OPT="-xO4 -fast -w -fsimple -native -xcg92"
PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
*)
DEBUG="-g"
OPT="-O"
PROFILE="-g -p" ;;
esac
else
case $host in
*86-*-linux*)
DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char"
# glibc < 2.1.3 has a serious FP bug in the math inline header
# that will cripple Vorbis. Look to see if the magic FP stack
# clobber is missing in the mathinline header, thus indicating
# the buggy version
AC_EGREP_CPP(log10.*fldlg2.*fxch,[
#define __LIBC_INTERNAL_MATH_INLINES 1
#define __OPTIMIZE__
#include <math.h>
],bad=maybe,bad=no)
if test ${bad} = "maybe" ;then
AC_EGREP_CPP(log10.*fldlg2.*fxch.*st\([[0123456789]]*\),
[
#define __LIBC_INTERNAL_MATH_INLINES 1
#define __OPTIMIZE__
#include <math.h>
],bad=no,bad=yes)
fi
if test ${bad} = "yes" ;then
AC_MSG_WARN([ ])
AC_MSG_WARN([********************************************************])
AC_MSG_WARN([* The glibc headers on this machine have a serious bug *])
AC_MSG_WARN([* in /usr/include/bits/mathinline.h This bug affects *])
AC_MSG_WARN([* all floating point code, not just Ogg, built on this *])
AC_MSG_WARN([* machine. Upgrading to glibc 2.1.3 is strongly urged *])
AC_MSG_WARN([* to correct the problem. Note that upgrading glibc *])
AC_MSG_WARN([* will not fix any previously built programs; this is *])
AC_MSG_WARN([* a compile-time time bug. *])
AC_MSG_WARN([* To work around the problem for this build of Ogg, *])
AC_MSG_WARN([* autoconf is disabling all math inlining. This will *])
AC_MSG_WARN([* hurt Ogg performace but is necessary for an Ogg that *])
AC_MSG_WARN([* will actually work. Once glibc is upgraded, rerun *])
AC_MSG_WARN([* configure and make to build with inlining. *])
AC_MSG_WARN([********************************************************])
AC_MSG_WARN([ ])
OPT=${OPT}" -D__NO_MATH_INLINES"
PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
fi;;
*-*-linux*)
DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
sparc-sun-*)
DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -mv8"
OPT="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
*)
DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
OPT="-O20 -D__NO_MATH_INLINES -fsigned-char"
PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
esac
fi
AC_HEADER_STDC
CFLAGS=""
dnl AC_PATH_X
dnl AC_PATH_XTRA
#AC_CHECK_LIB(pthread, pthread_create,
# pthread_lib="-lpthread"; AC_DEFINE(HAVE_LIBPTHREAD), :)
# We no longer use config.h
AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
#dnl Linuxthreads require you to define _REENTRANT in all threaded
#dnl code. Bogus, bogus...
#
#if test -n "$pthread_lib"; then
# case $host in
# i?86-*-linux*)
# AC_DEFINE(_REENTRANT)
# ;;
# esac
#fi
# We no longer use config.h
#if test -n "$x_libraries"; then
# XOGG="yes"
#
# dnl If we find libgtk installed, great; otherwise assume we have
# dnl to build it ourselves.
#
# AC_CHECK_LIB(gtk, gtk_main, :, LIBGTKDIR="libgtk", $X_LIBS -lglib -lgdk -lX11 -lXext -lm)
#
# dnl libpthread is required for xogg.
#
# if test -z "$pthread_lib"; then XOGG=""; fi
#
# dnl If we don't have libgtk installed, and we don't have a libgtk
# dnl subdirectory to build the library ourself, we can't build xogg.
#
# if test -n "$LIBGTKDIR" -a ! -d "$LIBGTKDIR"; then
# XOGG=""
# LIBGTKDIR=""
# fi
#fi
dnl This seems to be the only way to make autoconf only *sometimes* configure
dnl a subdirectory with AC_CONFIG_SUBDIRS. "__noconf" is assumed to not
dnl exist as a directory, so configure won't try to recursively enter it, unless
dnl the shell variable $dummy is reset to an existing directory inside the
dnl if clause.
dummy="__noconf"
#if test -d "$LIBGTKDIR"; then
# enable_shared="no"; export enable_shared
# dummy="libgtk"
# AC_CONFIG_SUBDIRS("$dummy")
# X_LIBS="-L${srcdir}/libgtk/gtk/.libs -L${srcdir}/libgtk/gdk/.libs -L${srcdir}/libgtk/glib/.libs $X_LIBS"
#fi
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
case 2 in
$ac_cv_sizeof_short) SIZE16="short";;
$ac_cv_sizeof_int) SIZE16="int";;
esac
case 4 in
$ac_cv_sizeof_short) SIZE32="short";;
$ac_cv_sizeof_int) SIZE32="int";;
$ac_cv_sizeof_long) SIZE32="long";;
esac
case 8 in
$ac_cv_sizeof_int) SIZE64="int";;
$ac_cv_sizeof_long) SIZE64="long";;
$ac_cv_sizeof_long_long) SIZE64="long long";;
esac
if test -z "$SIZE16"; then
AC_MSG_ERROR(No 16 bit type found on this platform!)
fi
if test -z "$SIZE32"; then
AC_MSG_ERROR(No 32 bit type found on this platform!)
fi
if test -z "$SIZE64"; then
AC_MSG_WARN(No 64 bit type found on this platform!)
fi
#AC_CHECK_HEADER(alloca.h,AC_DEFINE(USE_ALLOCA_H),:)
#AC_CHECK_HEADER(memory.h,AC_DEFINE(USE_MEMORY_H),:)
# We no longer use config.h
AC_CHECK_HEADER(alloca.h,CFLAGS="$CFLAGS -DUSE_ALLOCA_H",:)
AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
AC_C_CONST
AC_HEADER_TIME
AC_STRUCT_TM
AC_PROG_MAKE_SET
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(gettimeofday select strcspn strerror strspn sigaction)
AC_SUBST(SIZE16)
AC_SUBST(SIZE32)
AC_SUBST(SIZE64)
AC_SUBST(OPT)
AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(PROFILE)
AC_SUBST(CC)
AC_SUBST(RANLIB)
#AC_SUBST(XOGG)
#AC_SUBST(LIBGTKDIR)
AC_SUBST(pthread_lib)
AC_CONFIG_SUBDIRS(vorbis-tools/libao)
AC_OUTPUT(Makefile lib/Makefile examples/Makefile vorbis-tools/Makefile\
vq/Makefile huff/Makefile cmdline/Makefile xmms/Makefile kmpg/Makefile)
|