Add Russian translation provided by Валерий Крувялис <valkru@mail.ru>
[xiph-mirror.git] / ogg2 / configure.in
blob10cdb29d728901bec48e00e109846e7f6147b809
1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(src/sync.c)
5 AM_INIT_AUTOMAKE(libogg,1.99-svn)
6 AM_MAINTAINER_MODE
8 dnl Library versioning
10 LIB_CURRENT=6
11 LIB_REVISION=0
12 LIB_AGE=0
13 AC_SUBST(LIB_CURRENT)
14 AC_SUBST(LIB_REVISION)
15 AC_SUBST(LIB_AGE)
17 AC_PROG_CC
18 AM_PROG_LIBTOOL
20 AM_CONFIG_HEADER([config.h])
22 dnl Set some options based on environment
24 cflags_save="$CFLAGS"
25 ldflags_save="$LDFLAGS"
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
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.
80 AC_HEADER_STDC
82 dnl Checks for typedefs, structures, and compiler characteristics.
83 AC_C_CONST
85 dnl Check for types
87 AC_MSG_CHECKING(for int16_t)
88 AC_CACHE_VAL(has_int16_t,
89 [AC_TRY_RUN([
90 #ifdef __BEOS__
91 #include <inttypes.h>
92 #endif
93 #include <sys/types.h>
94 int16_t foo;
95 int main() {return 0;}
97 has_int16_t=yes,
98 has_int16_t=no,
99 has_int16_t=no
101 AC_MSG_RESULT($has_int16_t)
103 AC_MSG_CHECKING(for int32_t)
104 AC_CACHE_VAL(has_int32_t,
105 [AC_TRY_RUN([
106 #ifdef __BEOS__
107 #include <inttypes.h>
108 #endif
109 #include <sys/types.h>
110 int32_t foo;
111 int main() {return 0;}
113 has_int32_t=yes,
114 has_int32_t=no,
115 has_int32_t=no
117 AC_MSG_RESULT($has_int32_t)
119 AC_MSG_CHECKING(for uint32_t)
120 AC_CACHE_VAL(has_uint32_t,
121 [AC_TRY_RUN([
122 #ifdef __BEOS__
123 #include <inttypes.h>
124 #endif
125 #include <sys/types.h>
126 uint32_t foo;
127 int main() {return 0;}
129 has_uint32_t=yes,
130 has_uint32_t=no,
131 has_uint32_t=no
133 AC_MSG_RESULT($has_uint32_t)
135 AC_MSG_CHECKING(for uint16_t)
136 AC_CACHE_VAL(has_uint16_t,
137 [AC_TRY_RUN([
138 #ifdef __BEOS__
139 #include <inttypes.h>
140 #endif
141 #include <sys/types.h>
142 uint16_t foo;
143 int main() {return 0;}
145 has_uint16_t=yes,
146 has_uint16_t=no,
147 has_uint16_t=no
149 AC_MSG_RESULT($has_uint16_t)
151 AC_MSG_CHECKING(for u_int32_t)
152 AC_CACHE_VAL(has_u_int32_t,
153 [AC_TRY_RUN([
154 #ifdef __BEOS__
155 #include <inttypes.h>
156 #endif
157 #include <sys/types.h>
158 u_int32_t foo;
159 int main() {return 0;}
161 has_u_int32_t=yes,
162 has_u_int32_t=no,
163 has_u_int32_t=no
165 AC_MSG_RESULT($has_u_int32_t)
167 AC_MSG_CHECKING(for u_int16_t)
168 AC_CACHE_VAL(has_u_int16_t,
169 [AC_TRY_RUN([
170 #ifdef __BEOS__
171 #include <inttypes.h>
172 #endif
173 #include <sys/types.h>
174 u_int16_t foo;
175 int main() {return 0;}
177 has_u_int16_t=yes,
178 has_u_int16_t=no,
179 has_u_int16_t=no
181 AC_MSG_RESULT($has_u_int16_t)
183 AC_MSG_CHECKING(for int64_t)
184 AC_CACHE_VAL(has_int64_t,
185 [AC_TRY_RUN([
186 #ifdef __BEOS__
187 #include <inttypes.h>
188 #endif
189 #include <sys/types.h>
190 int64_t foo;
191 int main() {return 0;}
193 has_int64_t=yes,
194 has_int64_t=no,
195 has_int64_t=no
197 AC_MSG_RESULT($has_int64_t)
199 AC_CHECK_SIZEOF(short)
200 AC_CHECK_SIZEOF(int)
201 AC_CHECK_SIZEOF(long)
202 AC_CHECK_SIZEOF(long long)
205 if test x$has_int16_t = "xyes" ; then
206         SIZE16="int16_t"
207 else
208         case 2 in
209                 $ac_cv_sizeof_short) SIZE16="short";;
210                 $ac_cv_sizeof_int) SIZE16="int";;
211         esac
214 if test x$has_int32_t = "xyes" ; then
215         SIZE32="int32_t"
216 else
217         case 4 in
218                 $ac_cv_sizeof_short) SIZE32="short";;
219                 $ac_cv_sizeof_int) SIZE32="int";;
220                 $ac_cv_sizeof_long) SIZE32="long";;
221         esac
224 if test x$has_uint32_t = "xyes" ; then
225         USIZE32="uint32_t"
226 else
227         if test x$has_u_int32_t = "xyes" ; then
228                 USIZE32="u_int32_t"
229         else
230                 case 4 in
231                         $ac_cv_sizeof_short) USIZE32="unsigned short";;
232                         $ac_cv_sizeof_int) USIZE32="unsigned int";;
233                         $ac_cv_sizeof_long) USIZE32="unsigned long";;
234                 esac
235         fi
238 if test x$has_uint16_t = "xyes" ; then
239         USIZE16="uint16_t"
240 else
241         if test x$has_u_int16_t = "xyes" ; then
242                 USIZE16="u_int16_t"
243         else
244                 case 2 in
245                         $ac_cv_sizeof_short) USIZE16="unsigned short";;
246                         $ac_cv_sizeof_int) USIZE16="unsigned int";;
247                         $ac_cv_sizeof_long) USIZE16="unsigned long";;
248                 esac
249         fi
252 if test x$has_int64_t = "xyes" ; then
253         SIZE64="int64_t"
254 else
255 case 8 in
256         $ac_cv_sizeof_int) SIZE64="int";;
257         $ac_cv_sizeof_long) SIZE64="long";;
258         $ac_cv_sizeof_long_long) SIZE64="long long";;
259 esac
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.
279 AC_FUNC_MEMCMP
281 dnl Make substitutions
283 AC_SUBST(LIBTOOL_DEPS)
284 AC_SUBST(SIZE16)
285 AC_SUBST(USIZE16)
286 AC_SUBST(SIZE32)
287 AC_SUBST(USIZE32)
288 AC_SUBST(SIZE64)
289 AC_SUBST(OPT)
290 AC_SUBST(LIBS)
291 AC_SUBST(DEBUG)
292 AC_SUBST(CFLAGS)
293 AC_SUBST(PROFILE)
295 AC_OUTPUT([
296 Makefile
297 src/Makefile
298 doc/Makefile
299 doc/ogg2/Makefile
300 include/Makefile
301 include/ogg/Makefile
302 include/ogg/config_types.h
303 win32/Makefile
304 debian/Makefile
305 libogg2.spec
306 ogg2.pc
307 ogg2-uninstalled.pc