"make check" now actually tried to encode and decode to see if things work
[opus.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script. -*-m4-*-
2
3 AC_INIT(libcelt/arch.h)
4
5 AM_CONFIG_HEADER([config.h])
6
7 CELT_MAJOR_VERSION=0
8 CELT_MINOR_VERSION=0
9 CELT_MICRO_VERSION=2
10 CELT_EXTRA_VERSION=
11 CELT_VERSION=$CELT_MAJOR_VERSION.$CELT_MINOR_VERSION.$CELT_MICRO_VERSION$CELT_EXTRA_VERSION
12
13 CELT_LT_CURRENT=0
14 CELT_LT_REVISION=0
15 CELT_LT_AGE=0
16
17 AC_SUBST(CELT_LT_CURRENT)
18 AC_SUBST(CELT_LT_REVISION)
19 AC_SUBST(CELT_LT_AGE)
20
21 # For automake.
22 VERSION=$CELT_VERSION
23 PACKAGE=celt
24
25 AC_SUBST(CELT_VERSION)
26
27 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
28 AM_MAINTAINER_MODE
29
30 AC_CANONICAL_HOST
31 AM_PROG_LIBTOOL
32
33 AC_C_BIGENDIAN
34 AC_C_CONST
35 AC_C_INLINE
36 AC_C_RESTRICT
37
38
39 AC_MSG_CHECKING(for C99 variable-size arrays)
40 AC_TRY_COMPILE( , [
41 int foo=10;
42 int array[foo];
43 ],
44 [has_var_arrays=yes;AC_DEFINE([VAR_ARRAYS], [], [Use C99 variable-size arrays])
45 ],
46 has_var_arrays=no
47 )
48 AC_MSG_RESULT($has_var_arrays)
49
50 AC_MSG_CHECKING(for alloca)
51 AC_TRY_COMPILE( [#include <alloca.h>], [
52 int foo=10;
53 int *array = alloca(foo);
54 ],
55 [
56 has_alloca=yes;
57 if test x$has_var_arrays = "xno" ; then
58 AC_DEFINE([USE_ALLOCA], [], [Make use of alloca])
59 fi
60 ],
61 has_alloca=no
62 )
63 AC_MSG_RESULT($has_alloca)
64
65
66 AC_CHECK_HEADERS(sys/soundcard.h sys/audioio.h)
67
68 XIPH_PATH_OGG([src="src"], [src=""])
69 AC_SUBST(src)
70
71 AC_CHECK_LIB(m, sin)
72
73 # Check for getopt_long; if not found, use included source.
74 AC_CHECK_FUNCS([getopt_long],,
75 [# FreeBSD has a gnugetopt library.
76   AC_CHECK_LIB([gnugetopt],[getopt_long],
77 [AC_DEFINE([HAVE_GETOPT_LONG])],
78 [# Use the GNU replacement.
79 AC_LIBOBJ(getopt)
80 AC_LIBOBJ(getopt1)])])
81
82 AC_CHECK_LIB(winmm, main)
83
84 AC_DEFINE_UNQUOTED(CELT_VERSION, "${CELT_VERSION}", [Complete version string])
85 AC_DEFINE_UNQUOTED(CELT_MAJOR_VERSION, ${CELT_MAJOR_VERSION}, [Version major])
86 AC_DEFINE_UNQUOTED(CELT_MINOR_VERSION, ${CELT_MINOR_VERSION}, [Version minor])
87 AC_DEFINE_UNQUOTED(CELT_MICRO_VERSION, ${CELT_MICRO_VERSION}, [Version micro])
88 AC_DEFINE_UNQUOTED(CELT_EXTRA_VERSION, "${CELT_EXTRA_VERSION}", [Version extra])
89
90 AC_CHECK_SIZEOF(short)
91 AC_CHECK_SIZEOF(int)
92 AC_CHECK_SIZEOF(long)
93 AC_CHECK_SIZEOF(long long)
94
95 if test x$has_char16 = "xyes" ; then
96         case 1 in
97                 $ac_cv_sizeof_short) SIZE16="short";;
98                 $ac_cv_sizeof_int) SIZE16="int";;
99         esac
100 else
101         case 2 in
102                 $ac_cv_sizeof_short) SIZE16="short";;
103                 $ac_cv_sizeof_int) SIZE16="int";;
104         esac
105 fi
106
107 if test x$has_char16 = "xyes" ; then
108         case 2 in
109                 $ac_cv_sizeof_int) SIZE32="int";;
110                 $ac_cv_sizeof_long) SIZE32="long";;
111                 $ac_cv_sizeof_short) SIZE32="short";;
112         esac
113 else
114         case 4 in
115                 $ac_cv_sizeof_int) SIZE32="int";;
116                 $ac_cv_sizeof_long) SIZE32="long";;
117                 $ac_cv_sizeof_short) SIZE32="short";;
118         esac
119 fi
120
121 AC_SUBST(SIZE16)
122 AC_SUBST(SIZE32)
123
124 AC_OUTPUT([Makefile libcelt/Makefile tests/Makefile celt.pc])
125
126 if test "x$src" = "x"; then 
127 echo "**IMPORTANT**"
128 echo "You don't seem to have the development package for libogg (libogg-devel) installed. Only the library will be built (no encoder/decoder executable)"
129 echo "You can download libogg from http://www.vorbis.com/download.psp"
130 fi
131
132 echo "Type \"make; make install\" to compile and install";