1dnl                                               -*- Autoconf -*-
2dnl Process this file with autoconf to produce a configure script.
3
4AC_INIT([opencore-amr], [0.1.5], [http://sourceforge.net/projects/opencore-amr/])
5AC_CONFIG_AUX_DIR(.)
6AC_CONFIG_MACRO_DIR([m4])
7AM_INIT_AUTOMAKE([tar-ustar foreign])
8m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
9AM_MAINTAINER_MODE
10
11dnl Various options for configure
12AC_ARG_ENABLE([compile-c],
13            [AS_HELP_STRING([--enable-compile-c],
14               [enable compiling as C program (default is yes)])],
15            [compile_as_c=$enableval],
16            [compile_as_c=yes])
17AC_ARG_ENABLE([gcc-armv5],
18            [AS_HELP_STRING([--enable-gcc-armv5],
19               [enable GCC specific ARMv5 assembler (default is no)])],
20            [gcc_armv5=$enableval], [gcc_armv5=no])
21AC_ARG_ENABLE([amrnb-encoder],
22            [AS_HELP_STRING([--enable-amrnb-encoder],
23               [enable AMR-NB encoder (default is yes)])],
24            [amrnb_encoder=$enableval], [amrnb_encoder=yes])
25AC_ARG_ENABLE([amrnb-decoder],
26            [AS_HELP_STRING([--enable-amrnb-decoder],
27               [enable AMR-NB decoder (default is yes)])],
28            [amrnb_decoder=$enableval], [amrnb_decoder=yes])
29AC_ARG_ENABLE([examples],
30            [AS_HELP_STRING([--enable-examples],
31               [enable example encoding/decoding programs (default is no)])],
32            [examples=$enableval], [examples=no])
33
34dnl Automake conditionals to set
35AM_CONDITIONAL(COMPILE_AS_C, test x$compile_as_c = xyes)
36AM_CONDITIONAL(GCC_ARMV5, test x$gcc_armv5 = xyes)
37AM_CONDITIONAL(AMRNB_ENCODER, test x$amrnb_encoder = xyes)
38AM_CONDITIONAL(AMRNB_DECODER, test x$amrnb_decoder = xyes)
39AM_CONDITIONAL(EXAMPLES, test x$examples = xyes)
40
41dnl Checks for programs.
42AC_PROG_CXX
43AC_PROG_CC
44AC_PROG_INSTALL
45AC_PROG_LN_S
46AC_PROG_MAKE_SET
47
48dnl Setup for libtool
49LT_INIT
50
51dnl Checks for libraries.
52AC_CHECK_LIB([m], [main])
53
54dnl Checks for header files.
55AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
56
57dnl Checks for typedefs, structures, and compiler characteristics.
58AC_HEADER_STDBOOL
59AC_C_INLINE
60AC_TYPE_INT16_T
61AC_TYPE_INT32_T
62AC_TYPE_INT64_T
63AC_TYPE_INT8_T
64AC_TYPE_UINT16_T
65AC_TYPE_UINT32_T
66AC_TYPE_UINT64_T
67AC_TYPE_UINT8_T
68
69dnl Checks for library functions.
70AC_CHECK_FUNCS([memset])
71
72dnl OpenCORE AMR soname version to use
73dnl goes by ‘current[:revision[:age]]’ with the soname ending up as
74dnl current.age.revision.
75OPENCORE_AMRNB_VERSION=0:3:0
76OPENCORE_AMRWB_VERSION=0:3:0
77AC_SUBST(OPENCORE_AMRNB_VERSION)
78AC_SUBST(OPENCORE_AMRWB_VERSION)
79
80AC_CONFIG_FILES([Makefile
81                 amrnb/Makefile
82                 amrwb/Makefile
83                 test/Makefile
84                 amrnb/opencore-amrnb.pc
85                 amrwb/opencore-amrwb.pc])
86AC_OUTPUT
87