1dnl Process this file with autoconf to produce a configure script.
2
3AC_INIT([libogg],[1.3.2],[ogg-dev@xiph.org])
4
5AC_CONFIG_SRCDIR(src/framing.c)
6
7AM_INIT_AUTOMAKE
8AM_MAINTAINER_MODE([enable])
9
10dnl Library versioning
11
12LIB_CURRENT=8
13LIB_REVISION=2
14LIB_AGE=8
15AC_SUBST(LIB_CURRENT)
16AC_SUBST(LIB_REVISION)
17AC_SUBST(LIB_AGE)
18
19AC_PROG_CC
20AM_PROG_LIBTOOL
21AM_PROG_CC_C_O
22
23dnl Set some options based on environment
24
25cflags_save="$CFLAGS"
26if test -z "$GCC"; then
27        case $host in
28        *-*-irix*)
29                DEBUG="-g -signed"
30                CFLAGS="-O2 -w -signed"
31                PROFILE="-p -g3 -O2 -signed"
32		;;
33        sparc-sun-solaris*)
34                DEBUG="-v -g"
35                CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
36                PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc"
37		;;
38        *)
39                DEBUG="-g"
40                CFLAGS="-O"
41                PROFILE="-g -p"
42		;;
43        esac
44else
45        case $host in
46        *-*-linux*)
47                DEBUG="-g -Wall -fsigned-char"
48                CFLAGS="-O20 -Wall -ffast-math -fsigned-char"
49                PROFILE="-Wall -W -pg -g -O20 -ffast-math -fsigned-char"
50		;;
51        sparc-sun-*)
52                DEBUG="-g -Wall -fsigned-char"
53                CFLAGS="-O20 -ffast-math -fsigned-char"
54                PROFILE="-pg -g -O20 -fsigned-char"
55		;;
56	*-*-darwin*)
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"
60		;;
61        *)
62                DEBUG="-g -Wall -fsigned-char"
63                CFLAGS="-O20 -fsigned-char"
64                PROFILE="-O20 -g -pg -fsigned-char"
65		;;
66        esac
67fi
68CFLAGS="$CFLAGS $cflags_save"
69DEBUG="$DEBUG $cflags_save"
70PROFILE="$PROFILE $cflags_save"
71
72dnl Checks for programs.
73
74dnl Checks for libraries.
75
76dnl Checks for header files.
77AC_HEADER_STDC
78INCLUDE_INTTYPES_H=0
79INCLUDE_STDINT_H=0
80INCLUDE_SYS_TYPES_H=0
81AC_CHECK_HEADER(inttypes.h,INCLUDE_INTTYPES_H=1)
82AC_CHECK_HEADER(stdint.h,INCLUDE_STDINT_H=1)
83AC_CHECK_HEADER(sys/types.h,INCLUDE_SYS_TYPES_H=1)
84
85dnl Checks for typedefs, structures, and compiler characteristics.
86AC_C_CONST
87
88dnl Check for types
89
90AC_CHECK_SIZEOF(int16_t)
91AC_CHECK_SIZEOF(uint16_t)
92AC_CHECK_SIZEOF(u_int16_t)
93AC_CHECK_SIZEOF(int32_t)
94AC_CHECK_SIZEOF(uint32_t)
95AC_CHECK_SIZEOF(u_int32_t)
96AC_CHECK_SIZEOF(int64_t)
97AC_CHECK_SIZEOF(short)
98AC_CHECK_SIZEOF(int)
99AC_CHECK_SIZEOF(long)
100AC_CHECK_SIZEOF(long long)
101
102case 2 in
103     $ac_cv_sizeof_int16_t) SIZE16="int16_t";;
104     $ac_cv_sizeof_short) SIZE16="short";;
105     $ac_cv_sizeof_int) SIZE16="int";;
106esac
107
108case 2 in
109     $ac_cv_sizeof_uint16_t) USIZE16="uint16_t";;
110     $ac_cv_sizeof_short) USIZE16="unsigned short";;
111     $ac_cv_sizeof_int) USIZE16="unsigned int";;
112     $ac_cv_sizeof_u_int16_t) USIZE16="u_int16_t";;
113esac
114
115case 4 in
116     $ac_cv_sizeof_int32_t) SIZE32="int32_t";;
117     $ac_cv_sizeof_short) SIZE32="short";;
118     $ac_cv_sizeof_int) SIZE32="int";;
119     $ac_cv_sizeof_long) SIZE32="long";;
120esac
121
122case 4 in
123     $ac_cv_sizeof_uint32_t) USIZE32="uint32_t";;
124     $ac_cv_sizeof_short) USIZE32="unsigned short";;
125     $ac_cv_sizeof_int) USIZE32="unsigned int";;
126     $ac_cv_sizeof_long) USIZE32="unsigned long";;
127     $ac_cv_sizeof_u_int32_t) USIZE32="u_int32_t";;
128esac
129
130case 8 in
131     $ac_cv_sizeof_int64_t) SIZE64="int64_t";;
132     $ac_cv_sizeof_int) SIZE64="int";;
133     $ac_cv_sizeof_long) SIZE64="long";;
134     $ac_cv_sizeof_long_long) SIZE64="long long";;
135esac
136
137if test -z "$SIZE16"; then
138        AC_MSG_ERROR(No 16 bit type found on this platform!)
139fi
140if test -z "$USIZE16"; then
141        AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
142fi
143if test -z "$SIZE32"; then
144        AC_MSG_ERROR(No 32 bit type found on this platform!)
145fi
146if test -z "$USIZE32"; then
147        AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
148fi
149if test -z "$SIZE64"; then
150        AC_MSG_WARN(No 64 bit type found on this platform!)
151fi
152
153dnl Checks for library functions.
154AC_FUNC_MEMCMP
155
156dnl Make substitutions
157
158AC_SUBST(LIBTOOL_DEPS)
159AC_SUBST(INCLUDE_INTTYPES_H)
160AC_SUBST(INCLUDE_STDINT_H)
161AC_SUBST(INCLUDE_SYS_TYPES_H)
162AC_SUBST(SIZE16)
163AC_SUBST(USIZE16)
164AC_SUBST(SIZE32)
165AC_SUBST(USIZE32)
166AC_SUBST(SIZE64)
167AC_SUBST(OPT)
168AC_SUBST(LIBS)
169AC_SUBST(DEBUG)
170AC_SUBST(CFLAGS)
171AC_SUBST(PROFILE)
172
173
174AC_CONFIG_FILES([
175Makefile
176src/Makefile
177doc/Makefile doc/libogg/Makefile
178include/Makefile include/ogg/Makefile include/ogg/config_types.h
179libogg.spec
180ogg.pc
181ogg-uninstalled.pc
182])
183AC_CONFIG_HEADERS([config.h])
184
185AC_OUTPUT
186