The xml cleanup occurs after this anyway, and doing this here can cause
[xiph/unicode.git] / ogg / configure.in
blobd620d65cc62681085db578fd53a9728ac69b8274
1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(src/framing.c)
5 AM_INIT_AUTOMAKE(libogg,1.0)
7 dnl Library versioning
9 LIB_CURRENT=4
10 LIB_REVISION=0
11 LIB_AGE=4
12 AC_SUBST(LIB_CURRENT)
13 AC_SUBST(LIB_REVISION)
14 AC_SUBST(LIB_AGE)
16 AC_PROG_CC
17 AM_PROG_LIBTOOL
19 dnl Set some options based on environment
21 cflags_save="$CFLAGS"
22 ldflags_save="$LDFLAGS"
23 if test -z "$GCC"; then
24         case $host in 
25         *-*-irix*)
26                 DEBUG="-g -signed" 
27                 CFLAGS="-O2 -w -signed"
28                 PROFILE="-p -g3 -O2 -signed"
29                 ;;
30         sparc-sun-solaris*)
31                 DEBUG="-v -g"
32                 CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
33                 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc"
34                 ;;
35         *)
36                 DEBUG="-g"
37                 CFLAGS="-O"
38                 PROFILE="-g -p" 
39                 ;;
40         esac
41 else
42         case $host in 
43         *-*-linux*)
44                 DEBUG="-g -Wall -fsigned-char"
45                 CFLAGS="-O20 -ffast-math -fsigned-char"
46                 PROFILE="-Wall -W -pg -g -O20 -ffast-math -fsigned-char"
47                 ;;
48         sparc-sun-*)
49                 DEBUG="-g -Wall -fsigned-char -mv8"
50                 CFLAGS="-O20 -ffast-math -fsigned-char -mv8"
51                 PROFILE="-pg -g -O20 -fsigned-char -mv8" 
52                 ;;
53         *-*-darwin*)
54                 DEBUG="-fno-common -g -Wall -fsigned-char"
55                 CFLAGS="-fno-common -O4 -Wall -fsigned-char -ffast-math"
56                 PROFILE="-fno-common -O4 -Wall -pg -g -fsigned-char -ffast-math"
57                 ;;
58         *)
59                 DEBUG="-g -Wall -fsigned-char"
60                 CFLAGS="-O20 -fsigned-char"
61                 PROFILE="-O20 -g -pg -fsigned-char" 
62                 ;;
63         esac
65 CFLAGS="$CFLAGS $cflags_save"
66 DEBUG="$DEBUG $cflags_save"
67 PROFILE="$PROFILE $cflags_save"
68 LDFLAGS="$LDFLAGS $ldflags_save"
70 dnl Checks for programs.
72 dnl Checks for libraries.
74 dnl Checks for header files.
75 AC_HEADER_STDC
77 dnl Checks for typedefs, structures, and compiler characteristics.
78 AC_C_CONST
80 dnl Check for types
82 AC_MSG_CHECKING(for int16_t)
83 AC_CACHE_VAL(has_int16_t,
84 [AC_TRY_RUN([
85 #ifdef __BEOS__
86 #include <inttypes.h>
87 #endif
88 #include <sys/types.h>
89 int16_t foo;
90 int main() {return 0;}
92 has_int16_t=yes,
93 has_int16_t=no,
94 has_int16_t=no
95 )])
96 AC_MSG_RESULT($has_int16_t)
98 AC_MSG_CHECKING(for int32_t)
99 AC_CACHE_VAL(has_int32_t,
100 [AC_TRY_RUN([
101 #ifdef __BEOS__
102 #include <inttypes.h>
103 #endif
104 #include <sys/types.h>
105 int32_t foo;
106 int main() {return 0;}
108 has_int32_t=yes,
109 has_int32_t=no,
110 has_int32_t=no
112 AC_MSG_RESULT($has_int32_t)
114 AC_MSG_CHECKING(for uint32_t)
115 AC_CACHE_VAL(has_uint32_t,
116 [AC_TRY_RUN([
117 #ifdef __BEOS__
118 #include <inttypes.h>
119 #endif
120 #include <sys/types.h>
121 uint32_t foo;
122 int main() {return 0;}
124 has_uint32_t=yes,
125 has_uint32_t=no,
126 has_uint32_t=no
128 AC_MSG_RESULT($has_uint32_t)
130 AC_MSG_CHECKING(for uint16_t)
131 AC_CACHE_VAL(has_uint16_t,
132 [AC_TRY_RUN([
133 #ifdef __BEOS__
134 #include <inttypes.h>
135 #endif
136 #include <sys/types.h>
137 uint16_t foo;
138 int main() {return 0;}
140 has_uint16_t=yes,
141 has_uint16_t=no,
142 has_uint16_t=no
144 AC_MSG_RESULT($has_uint16_t)
146 AC_MSG_CHECKING(for u_int32_t)
147 AC_CACHE_VAL(has_u_int32_t,
148 [AC_TRY_RUN([
149 #ifdef __BEOS__
150 #include <inttypes.h>
151 #endif
152 #include <sys/types.h>
153 u_int32_t foo;
154 int main() {return 0;}
156 has_u_int32_t=yes,
157 has_u_int32_t=no,
158 has_u_int32_t=no
160 AC_MSG_RESULT($has_u_int32_t)
162 AC_MSG_CHECKING(for u_int16_t)
163 AC_CACHE_VAL(has_u_int16_t,
164 [AC_TRY_RUN([
165 #ifdef __BEOS__
166 #include <inttypes.h>
167 #endif
168 #include <sys/types.h>
169 u_int16_t foo;
170 int main() {return 0;}
172 has_u_int16_t=yes,
173 has_u_int16_t=no,
174 has_u_int16_t=no
176 AC_MSG_RESULT($has_u_int16_t)
178 AC_MSG_CHECKING(for int64_t)
179 AC_CACHE_VAL(has_int64_t,
180 [AC_TRY_RUN([
181 #ifdef __BEOS__
182 #include <inttypes.h>
183 #endif
184 #include <sys/types.h>
185 int64_t foo;
186 int main() {return 0;}
188 has_int64_t=yes,
189 has_int64_t=no,
190 has_int64_t=no
192 AC_MSG_RESULT($has_int64_t)
194 AC_CHECK_SIZEOF(short)
195 AC_CHECK_SIZEOF(int)
196 AC_CHECK_SIZEOF(long)
197 AC_CHECK_SIZEOF(long long)
200 if test x$has_int16_t = "xyes" ; then
201         SIZE16="int16_t"
202 else
203         case 2 in
204                 $ac_cv_sizeof_short) SIZE16="short";;
205                 $ac_cv_sizeof_int) SIZE16="int";;
206         esac
209 if test x$has_int32_t = "xyes" ; then
210         SIZE32="int32_t"
211 else
212         case 4 in
213                 $ac_cv_sizeof_short) SIZE32="short";;
214                 $ac_cv_sizeof_int) SIZE32="int";;
215                 $ac_cv_sizeof_long) SIZE32="long";;
216         esac
219 if test x$has_uint32_t = "xyes" ; then
220         USIZE32="uint32_t"
221 else
222         if test x$has_u_int32_t = "xyes" ; then
223                 USIZE32="u_int32_t"
224         else
225                 case 4 in
226                         $ac_cv_sizeof_short) USIZE32="unsigned short";;
227                         $ac_cv_sizeof_int) USIZE32="unsigned int";;
228                         $ac_cv_sizeof_long) USIZE32="unsigned long";;
229                 esac
230         fi
233 if test x$has_uint16_t = "xyes" ; then
234         USIZE16="uint16_t"
235 else
236         if test x$has_u_int16_t = "xyes" ; then
237                 USIZE16="u_int16_t"
238         else
239                 case 2 in
240                         $ac_cv_sizeof_short) USIZE16="unsigned short";;
241                         $ac_cv_sizeof_int) USIZE16="unsigned int";;
242                         $ac_cv_sizeof_long) USIZE16="unsigned long";;
243                 esac
244         fi
247 if test x$has_int64_t = "xyes" ; then
248         SIZE64="int64_t"
249 else
250 case 8 in
251         $ac_cv_sizeof_int) SIZE64="int";;
252         $ac_cv_sizeof_long) SIZE64="long";;
253         $ac_cv_sizeof_long_long) SIZE64="long long";;
254 esac
257 if test -z "$SIZE16"; then
258         AC_MSG_ERROR(No 16 bit type found on this platform!)
260 if test -z "$USIZE16"; then
261         AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
263 if test -z "$SIZE32"; then
264         AC_MSG_ERROR(No 32 bit type found on this platform!)
266 if test -z "$USIZE32"; then
267         AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
269 if test -z "$SIZE64"; then
270         AC_MSG_WARN(No 64 bit type found on this platform!)
273 dnl Checks for library functions.
274 AC_FUNC_MEMCMP
276 dnl Make substitutions
278 AC_SUBST(LIBTOOL_DEPS)
279 AC_SUBST(SIZE16)
280 AC_SUBST(USIZE16)
281 AC_SUBST(SIZE32)
282 AC_SUBST(USIZE32)
283 AC_SUBST(SIZE64)
284 AC_SUBST(OPT)
285 AC_SUBST(LIBS)
286 AC_SUBST(DEBUG)
287 AC_SUBST(CFLAGS)
288 AC_SUBST(PROFILE)
290 AC_OUTPUT(Makefile src/Makefile doc/Makefile doc/ogg/Makefile include/Makefile include/ogg/Makefile include/ogg/config_types.h win32/Makefile debian/Makefile)