1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | |
---|
3 | AC_INIT(src/framing.c) |
---|
4 | |
---|
5 | AM_INIT_AUTOMAKE(libogg,1.1.3) |
---|
6 | AM_MAINTAINER_MODE |
---|
7 | |
---|
8 | dnl Library versioning |
---|
9 | |
---|
10 | LIB_CURRENT=5 |
---|
11 | LIB_REVISION=3 |
---|
12 | LIB_AGE=5 |
---|
13 | AC_SUBST(LIB_CURRENT) |
---|
14 | AC_SUBST(LIB_REVISION) |
---|
15 | AC_SUBST(LIB_AGE) |
---|
16 | |
---|
17 | AC_PROG_CC |
---|
18 | AM_PROG_LIBTOOL |
---|
19 | |
---|
20 | dnl config.h |
---|
21 | AM_CONFIG_HEADER(config.h) |
---|
22 | |
---|
23 | dnl Set some options based on environment |
---|
24 | |
---|
25 | cflags_save="$CFLAGS" |
---|
26 | if 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 |
---|
44 | else |
---|
45 | case $host in |
---|
46 | *-*-linux*) |
---|
47 | DEBUG="-g -Wall -fsigned-char" |
---|
48 | CFLAGS="-O20 -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 -mv8" |
---|
53 | CFLAGS="-O20 -ffast-math -fsigned-char -mv8" |
---|
54 | PROFILE="-pg -g -O20 -fsigned-char -mv8" |
---|
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 |
---|
67 | fi |
---|
68 | CFLAGS="$CFLAGS $cflags_save" |
---|
69 | DEBUG="$DEBUG $cflags_save" |
---|
70 | PROFILE="$PROFILE $cflags_save" |
---|
71 | |
---|
72 | dnl Checks for programs. |
---|
73 | |
---|
74 | dnl Checks for libraries. |
---|
75 | |
---|
76 | dnl Checks for header files. |
---|
77 | AC_HEADER_STDC |
---|
78 | |
---|
79 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
80 | AC_C_CONST |
---|
81 | |
---|
82 | dnl Check for types |
---|
83 | |
---|
84 | AC_MSG_CHECKING(for int16_t) |
---|
85 | AC_CACHE_VAL(has_int16_t, |
---|
86 | [AC_TRY_RUN([ |
---|
87 | #ifdef __BEOS__ |
---|
88 | #include <inttypes.h> |
---|
89 | #endif |
---|
90 | #include <sys/types.h> |
---|
91 | int16_t foo; |
---|
92 | int main() {return 0;} |
---|
93 | ], |
---|
94 | has_int16_t=yes, |
---|
95 | has_int16_t=no, |
---|
96 | has_int16_t=no |
---|
97 | )]) |
---|
98 | AC_MSG_RESULT($has_int16_t) |
---|
99 | |
---|
100 | AC_MSG_CHECKING(for int32_t) |
---|
101 | AC_CACHE_VAL(has_int32_t, |
---|
102 | [AC_TRY_RUN([ |
---|
103 | #ifdef __BEOS__ |
---|
104 | #include <inttypes.h> |
---|
105 | #endif |
---|
106 | #include <sys/types.h> |
---|
107 | int32_t foo; |
---|
108 | int main() {return 0;} |
---|
109 | ], |
---|
110 | has_int32_t=yes, |
---|
111 | has_int32_t=no, |
---|
112 | has_int32_t=no |
---|
113 | )]) |
---|
114 | AC_MSG_RESULT($has_int32_t) |
---|
115 | |
---|
116 | AC_MSG_CHECKING(for uint32_t) |
---|
117 | AC_CACHE_VAL(has_uint32_t, |
---|
118 | [AC_TRY_RUN([ |
---|
119 | #ifdef __BEOS__ |
---|
120 | #include <inttypes.h> |
---|
121 | #endif |
---|
122 | #include <sys/types.h> |
---|
123 | uint32_t foo; |
---|
124 | int main() {return 0;} |
---|
125 | ], |
---|
126 | has_uint32_t=yes, |
---|
127 | has_uint32_t=no, |
---|
128 | has_uint32_t=no |
---|
129 | )]) |
---|
130 | AC_MSG_RESULT($has_uint32_t) |
---|
131 | |
---|
132 | AC_MSG_CHECKING(for uint16_t) |
---|
133 | AC_CACHE_VAL(has_uint16_t, |
---|
134 | [AC_TRY_RUN([ |
---|
135 | #ifdef __BEOS__ |
---|
136 | #include <inttypes.h> |
---|
137 | #endif |
---|
138 | #include <sys/types.h> |
---|
139 | uint16_t foo; |
---|
140 | int main() {return 0;} |
---|
141 | ], |
---|
142 | has_uint16_t=yes, |
---|
143 | has_uint16_t=no, |
---|
144 | has_uint16_t=no |
---|
145 | )]) |
---|
146 | AC_MSG_RESULT($has_uint16_t) |
---|
147 | |
---|
148 | AC_MSG_CHECKING(for u_int32_t) |
---|
149 | AC_CACHE_VAL(has_u_int32_t, |
---|
150 | [AC_TRY_RUN([ |
---|
151 | #ifdef __BEOS__ |
---|
152 | #include <inttypes.h> |
---|
153 | #endif |
---|
154 | #include <sys/types.h> |
---|
155 | u_int32_t foo; |
---|
156 | int main() {return 0;} |
---|
157 | ], |
---|
158 | has_u_int32_t=yes, |
---|
159 | has_u_int32_t=no, |
---|
160 | has_u_int32_t=no |
---|
161 | )]) |
---|
162 | AC_MSG_RESULT($has_u_int32_t) |
---|
163 | |
---|
164 | AC_MSG_CHECKING(for u_int16_t) |
---|
165 | AC_CACHE_VAL(has_u_int16_t, |
---|
166 | [AC_TRY_RUN([ |
---|
167 | #ifdef __BEOS__ |
---|
168 | #include <inttypes.h> |
---|
169 | #endif |
---|
170 | #include <sys/types.h> |
---|
171 | u_int16_t foo; |
---|
172 | int main() {return 0;} |
---|
173 | ], |
---|
174 | has_u_int16_t=yes, |
---|
175 | has_u_int16_t=no, |
---|
176 | has_u_int16_t=no |
---|
177 | )]) |
---|
178 | AC_MSG_RESULT($has_u_int16_t) |
---|
179 | |
---|
180 | AC_MSG_CHECKING(for int64_t) |
---|
181 | AC_CACHE_VAL(has_int64_t, |
---|
182 | [AC_TRY_RUN([ |
---|
183 | #ifdef __BEOS__ |
---|
184 | #include <inttypes.h> |
---|
185 | #endif |
---|
186 | #include <sys/types.h> |
---|
187 | int64_t foo; |
---|
188 | int main() {return 0;} |
---|
189 | ], |
---|
190 | has_int64_t=yes, |
---|
191 | has_int64_t=no, |
---|
192 | has_int64_t=no |
---|
193 | )]) |
---|
194 | AC_MSG_RESULT($has_int64_t) |
---|
195 | |
---|
196 | AC_CHECK_SIZEOF(short) |
---|
197 | AC_CHECK_SIZEOF(int) |
---|
198 | AC_CHECK_SIZEOF(long) |
---|
199 | AC_CHECK_SIZEOF(long long) |
---|
200 | |
---|
201 | |
---|
202 | if test x$has_int16_t = "xyes" ; then |
---|
203 | SIZE16="int16_t" |
---|
204 | else |
---|
205 | case 2 in |
---|
206 | $ac_cv_sizeof_short) SIZE16="short";; |
---|
207 | $ac_cv_sizeof_int) SIZE16="int";; |
---|
208 | esac |
---|
209 | fi |
---|
210 | |
---|
211 | if test x$has_int32_t = "xyes" ; then |
---|
212 | SIZE32="int32_t" |
---|
213 | else |
---|
214 | case 4 in |
---|
215 | $ac_cv_sizeof_short) SIZE32="short";; |
---|
216 | $ac_cv_sizeof_int) SIZE32="int";; |
---|
217 | $ac_cv_sizeof_long) SIZE32="long";; |
---|
218 | esac |
---|
219 | fi |
---|
220 | |
---|
221 | if test x$has_uint32_t = "xyes" ; then |
---|
222 | USIZE32="uint32_t" |
---|
223 | else |
---|
224 | if test x$has_u_int32_t = "xyes" ; then |
---|
225 | USIZE32="u_int32_t" |
---|
226 | else |
---|
227 | case 4 in |
---|
228 | $ac_cv_sizeof_short) USIZE32="unsigned short";; |
---|
229 | $ac_cv_sizeof_int) USIZE32="unsigned int";; |
---|
230 | $ac_cv_sizeof_long) USIZE32="unsigned long";; |
---|
231 | esac |
---|
232 | fi |
---|
233 | fi |
---|
234 | |
---|
235 | if test x$has_uint16_t = "xyes" ; then |
---|
236 | USIZE16="uint16_t" |
---|
237 | else |
---|
238 | if test x$has_u_int16_t = "xyes" ; then |
---|
239 | USIZE16="u_int16_t" |
---|
240 | else |
---|
241 | case 2 in |
---|
242 | $ac_cv_sizeof_short) USIZE16="unsigned short";; |
---|
243 | $ac_cv_sizeof_int) USIZE16="unsigned int";; |
---|
244 | $ac_cv_sizeof_long) USIZE16="unsigned long";; |
---|
245 | esac |
---|
246 | fi |
---|
247 | fi |
---|
248 | |
---|
249 | if test x$has_int64_t = "xyes" ; then |
---|
250 | SIZE64="int64_t" |
---|
251 | else |
---|
252 | case 8 in |
---|
253 | $ac_cv_sizeof_int) SIZE64="int";; |
---|
254 | $ac_cv_sizeof_long) SIZE64="long";; |
---|
255 | $ac_cv_sizeof_long_long) SIZE64="long long";; |
---|
256 | esac |
---|
257 | fi |
---|
258 | |
---|
259 | if test -z "$SIZE16"; then |
---|
260 | AC_MSG_ERROR(No 16 bit type found on this platform!) |
---|
261 | fi |
---|
262 | if test -z "$USIZE16"; then |
---|
263 | AC_MSG_ERROR(No unsigned 16 bit type found on this platform!) |
---|
264 | fi |
---|
265 | if test -z "$SIZE32"; then |
---|
266 | AC_MSG_ERROR(No 32 bit type found on this platform!) |
---|
267 | fi |
---|
268 | if test -z "$USIZE32"; then |
---|
269 | AC_MSG_ERROR(No unsigned 32 bit type found on this platform!) |
---|
270 | fi |
---|
271 | if test -z "$SIZE64"; then |
---|
272 | AC_MSG_WARN(No 64 bit type found on this platform!) |
---|
273 | fi |
---|
274 | |
---|
275 | dnl Checks for library functions. |
---|
276 | AC_FUNC_MEMCMP |
---|
277 | |
---|
278 | dnl Make substitutions |
---|
279 | |
---|
280 | AC_SUBST(LIBTOOL_DEPS) |
---|
281 | AC_SUBST(SIZE16) |
---|
282 | AC_SUBST(USIZE16) |
---|
283 | AC_SUBST(SIZE32) |
---|
284 | AC_SUBST(USIZE32) |
---|
285 | AC_SUBST(SIZE64) |
---|
286 | AC_SUBST(OPT) |
---|
287 | AC_SUBST(LIBS) |
---|
288 | AC_SUBST(DEBUG) |
---|
289 | AC_SUBST(CFLAGS) |
---|
290 | AC_SUBST(PROFILE) |
---|
291 | |
---|
292 | AC_OUTPUT([ |
---|
293 | Makefile |
---|
294 | src/Makefile |
---|
295 | doc/Makefile doc/libogg/Makefile |
---|
296 | include/Makefile include/ogg/Makefile include/ogg/config_types.h |
---|
297 | win32/Makefile |
---|
298 | libogg.spec |
---|
299 | ogg.pc |
---|
300 | ogg-uninstalled.pc |
---|
301 | ]) |
---|