1 dnl Process this file with autoconf to produce a configure script.
5 AM_INIT_AUTOMAKE(libogg,1.99-svn)
14 AC_SUBST(LIB_REVISION)
20 AM_CONFIG_HEADER([config.h])
22 dnl Set some options based on environment
25 ldflags_save="$LDFLAGS"
26 if test -z "$GCC"; then
30 CFLAGS="-O2 -w -signed"
31 PROFILE="-p -g3 -O2 -signed"
35 CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
36 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc"
47 DEBUG="-g -Wall -fsigned-char"
48 CFLAGS="-O20 -ffast-math -fsigned-char"
49 PROFILE="-Wall -W -pg -g -O20 -ffast-math -fsigned-char"
52 DEBUG="-g -Wall -fsigned-char -mv8"
53 CFLAGS="-O20 -ffast-math -fsigned-char -mv8"
54 PROFILE="-pg -g -O20 -fsigned-char -mv8"
57 DEBUG="-fno-common -g -Wall -fsigned-char"
58 CFLAGS="-fno-common -O4 -Wall -fsigned-char -ffast-math"
59 PROFILE="-fno-common -O4 -Wall -pg -g -fsigned-char -ffast-math"
62 DEBUG="-g -Wall -fsigned-char"
63 CFLAGS="-O20 -fsigned-char"
64 PROFILE="-O20 -g -pg -fsigned-char"
68 CFLAGS="$CFLAGS $cflags_save"
69 DEBUG="$DEBUG $cflags_save"
70 PROFILE="$PROFILE $cflags_save"
71 LDFLAGS="$LDFLAGS $ldflags_save"
73 dnl Checks for programs.
75 dnl Checks for libraries.
76 AC_CHECK_LIB(m, cos, LIBS="$LIBS -lm")
77 AC_CHECK_LIB(pthread, pthread_mutex_lock, CFLAGS="$CFLAGS -DUSE_POSIX_THREADS" LIBS="$LIBS -lpthread")
79 dnl Checks for header files.
82 dnl Checks for typedefs, structures, and compiler characteristics.
87 AC_MSG_CHECKING(for int16_t)
88 AC_CACHE_VAL(has_int16_t,
93 #include <sys/types.h>
95 int main() {return 0;}
101 AC_MSG_RESULT($has_int16_t)
103 AC_MSG_CHECKING(for int32_t)
104 AC_CACHE_VAL(has_int32_t,
107 #include <inttypes.h>
109 #include <sys/types.h>
111 int main() {return 0;}
117 AC_MSG_RESULT($has_int32_t)
119 AC_MSG_CHECKING(for uint32_t)
120 AC_CACHE_VAL(has_uint32_t,
123 #include <inttypes.h>
125 #include <sys/types.h>
127 int main() {return 0;}
133 AC_MSG_RESULT($has_uint32_t)
135 AC_MSG_CHECKING(for uint16_t)
136 AC_CACHE_VAL(has_uint16_t,
139 #include <inttypes.h>
141 #include <sys/types.h>
143 int main() {return 0;}
149 AC_MSG_RESULT($has_uint16_t)
151 AC_MSG_CHECKING(for u_int32_t)
152 AC_CACHE_VAL(has_u_int32_t,
155 #include <inttypes.h>
157 #include <sys/types.h>
159 int main() {return 0;}
165 AC_MSG_RESULT($has_u_int32_t)
167 AC_MSG_CHECKING(for u_int16_t)
168 AC_CACHE_VAL(has_u_int16_t,
171 #include <inttypes.h>
173 #include <sys/types.h>
175 int main() {return 0;}
181 AC_MSG_RESULT($has_u_int16_t)
183 AC_MSG_CHECKING(for int64_t)
184 AC_CACHE_VAL(has_int64_t,
187 #include <inttypes.h>
189 #include <sys/types.h>
191 int main() {return 0;}
197 AC_MSG_RESULT($has_int64_t)
199 AC_CHECK_SIZEOF(short)
201 AC_CHECK_SIZEOF(long)
202 AC_CHECK_SIZEOF(long long)
205 if test x$has_int16_t = "xyes" ; then
209 $ac_cv_sizeof_short) SIZE16="short";;
210 $ac_cv_sizeof_int) SIZE16="int";;
214 if test x$has_int32_t = "xyes" ; then
218 $ac_cv_sizeof_short) SIZE32="short";;
219 $ac_cv_sizeof_int) SIZE32="int";;
220 $ac_cv_sizeof_long) SIZE32="long";;
224 if test x$has_uint32_t = "xyes" ; then
227 if test x$has_u_int32_t = "xyes" ; then
231 $ac_cv_sizeof_short) USIZE32="unsigned short";;
232 $ac_cv_sizeof_int) USIZE32="unsigned int";;
233 $ac_cv_sizeof_long) USIZE32="unsigned long";;
238 if test x$has_uint16_t = "xyes" ; then
241 if test x$has_u_int16_t = "xyes" ; then
245 $ac_cv_sizeof_short) USIZE16="unsigned short";;
246 $ac_cv_sizeof_int) USIZE16="unsigned int";;
247 $ac_cv_sizeof_long) USIZE16="unsigned long";;
252 if test x$has_int64_t = "xyes" ; then
256 $ac_cv_sizeof_int) SIZE64="int";;
257 $ac_cv_sizeof_long) SIZE64="long";;
258 $ac_cv_sizeof_long_long) SIZE64="long long";;
262 if test -z "$SIZE16"; then
263 AC_MSG_ERROR(No 16 bit type found on this platform!)
265 if test -z "$USIZE16"; then
266 AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
268 if test -z "$SIZE32"; then
269 AC_MSG_ERROR(No 32 bit type found on this platform!)
271 if test -z "$USIZE32"; then
272 AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
274 if test -z "$SIZE64"; then
275 AC_MSG_WARN(No 64 bit type found on this platform!)
278 dnl Checks for library functions.
281 dnl Make substitutions
283 AC_SUBST(LIBTOOL_DEPS)
302 include/ogg/config_types.h