Mercurial > hg > audiostuff
comparison spandsp-0.0.3/spandsp-0.0.3/configure.ac @ 5:f762bf195c4b
import spandsp-0.0.3
author | Peter Meerwald <pmeerw@cosy.sbg.ac.at> |
---|---|
date | Fri, 25 Jun 2010 16:00:21 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
4:26cd8f1ef0b1 | 5:f762bf195c4b |
---|---|
1 # configure.ac -- Process this file with autoconf to produce configure | |
2 # | |
3 # This program is free software; you can redistribute it and/or modify | |
4 # it under the terms of the GNU General Public License version 2, as | |
5 # published by the Free Software Foundation. | |
6 # | |
7 # This program is distributed in the hope that it will be useful, | |
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
10 # GNU General Public License for more details. | |
11 # | |
12 # You should have received a copy of the GNU General Public License | |
13 # along with this program; if not, write to the Free Software | |
14 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
15 # | |
16 # $Id: configure.ac,v 1.17 2006/11/26 13:13:30 steveu Exp $ | |
17 | |
18 # @start 1 | |
19 | |
20 AC_INIT | |
21 | |
22 AC_DEFUN([AX_COMPILER_VENDOR], | |
23 [ | |
24 AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, | |
25 [ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown | |
26 # note: don't check for GCC first, since some other compilers define __GNUC__ | |
27 for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do | |
28 vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" | |
29 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ | |
30 #if !($vencpp) | |
31 thisisanerror; | |
32 #endif | |
33 ])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break]) | |
34 done | |
35 ]) | |
36 ]) | |
37 | |
38 SPANDSP_MAJOR_VERSION=0 | |
39 SPANDSP_MINOR_VERSION=0 | |
40 SPANDSP_MICRO_VERSION=3 | |
41 | |
42 SPANDSP_LT_CURRENT=0 | |
43 SPANDSP_LT_REVISION=2 | |
44 SPANDSP_LT_AGE=0 | |
45 | |
46 VERSION=$SPANDSP_MAJOR_VERSION.$SPANDSP_MINOR_VERSION.$SPANDSP_MICRO_VERSION | |
47 PACKAGE=spandsp | |
48 | |
49 AC_SUBST(SPANDSP_LT_CURRENT) | |
50 AC_SUBST(SPANDSP_LT_REVISION) | |
51 AC_SUBST(SPANDSP_LT_AGE) | |
52 | |
53 AC_CONFIG_SRCDIR([src/tone_generate.c]) | |
54 AC_CONFIG_AUX_DIR(config) | |
55 AC_CONFIG_HEADERS([src/config.h:config-h.in]) | |
56 AM_INIT_AUTOMAKE($PACKAGE, $VERSION) | |
57 | |
58 AC_CANONICAL_HOST | |
59 AC_PROG_CC | |
60 AC_PROG_CXX | |
61 AC_PROG_GCC_TRADITIONAL | |
62 AC_PROG_LIBTOOL | |
63 AC_LANG([C]) | |
64 | |
65 AX_COMPILER_VENDOR | |
66 | |
67 AC_C_CONST | |
68 AC_C_INLINE | |
69 AC_C_VOLATILE | |
70 | |
71 AC_CHECK_TYPES(long long) | |
72 AC_CHECK_TYPES(long double) | |
73 | |
74 AC_TYPE_SIGNAL | |
75 | |
76 AC_ARG_ENABLE(doc, [ --enable-doc Build the documentation]) | |
77 AC_ARG_ENABLE(tests, [ --enable-tests Build the test programs]) | |
78 AC_ARG_ENABLE(itutests,[ --enable-itutests Build TIFF test files for some ITU test images]) | |
79 AC_ARG_ENABLE(mmx, [ --enable-mmx Enable MMX support]) | |
80 AC_ARG_ENABLE(sse, [ --enable-sse Enable SSE support]) | |
81 | |
82 AC_FUNC_ERROR_AT_LINE | |
83 AC_FUNC_VPRINTF | |
84 AC_FUNC_MALLOC | |
85 AC_FUNC_MEMCMP | |
86 AC_FUNC_REALLOC | |
87 AC_FUNC_SELECT_ARGTYPES | |
88 | |
89 AC_CHECK_FUNCS([memmove]) | |
90 AC_CHECK_FUNCS([memset]) | |
91 AC_CHECK_FUNCS([pow]) | |
92 AC_CHECK_FUNCS([sqrt]) | |
93 AC_CHECK_FUNCS([rint]) | |
94 AC_CHECK_FUNCS([select]) | |
95 AC_CHECK_FUNCS([strcasecmp]) | |
96 AC_CHECK_FUNCS([strchr]) | |
97 AC_CHECK_FUNCS([strdup]) | |
98 AC_CHECK_FUNCS([strerror]) | |
99 AC_CHECK_FUNCS([strstr]) | |
100 AC_CHECK_FUNCS([strtol]) | |
101 AC_CHECK_FUNCS([gettimeofday]) | |
102 | |
103 AC_HEADER_STDC | |
104 AC_HEADER_SYS_WAIT | |
105 AC_HEADER_TIME | |
106 | |
107 # Check for header files. | |
108 AC_CHECK_HEADERS([socket.h]) | |
109 AC_CHECK_HEADERS([inttypes.h]) | |
110 AC_CHECK_HEADERS([unistd.h]) | |
111 AC_CHECK_HEADERS([stdlib.h]) | |
112 AC_CHECK_HEADERS([string.h]) | |
113 AC_CHECK_HEADERS([strings.h]) | |
114 AC_CHECK_HEADERS([malloc.h]) | |
115 AC_CHECK_HEADERS([tgmath.h]) | |
116 AC_CHECK_HEADERS([math.h]) | |
117 AC_CHECK_HEADERS([float.h]) | |
118 AC_CHECK_HEADERS([fcntl.h]) | |
119 AC_CHECK_HEADERS([sys/time.h]) | |
120 AC_CHECK_HEADERS([sys/select.h]) | |
121 AC_CHECK_HEADERS([sys/ioctl.h]) | |
122 AC_CHECK_HEADERS([sys/fcntl.h]) | |
123 AC_CHECK_HEADERS([audiofile.h]) | |
124 AC_CHECK_HEADERS([fftw.h]) | |
125 AC_CHECK_HEADERS([fftw3.h]) | |
126 AC_CHECK_HEADERS([tiffio.h]) | |
127 AC_CHECK_HEADERS([pthread.h]) | |
128 AC_CHECK_HEADERS([unicall.h]) | |
129 AC_CHECK_HEADERS([X11/X.h]) | |
130 | |
131 # Determine XML2 include path | |
132 AC_MSG_CHECKING(for libxml/xmlmemory.h) | |
133 | |
134 # Can we include headers using system include dirs? | |
135 AC_TRY_COMPILE([#include <libxml/xmlmemory.h>], [int a = 1;], | |
136 XML2_INCLUDE=" ", | |
137 XML2_INCLUDE= | |
138 ) | |
139 | |
140 # Hunt through several possible directories to find the includes for libxml2 | |
141 if test "x$XML2_INCLUDE" = "x"; then | |
142 old_CPPFLAGS="$CPPFLAGS" | |
143 for i in $xml2_include_dir /usr/include /usr/local/include /usr/include/libxml2 /usr/local/include/libxml2 ; do | |
144 CPPFLAGS="$old_CPPFLAGS -I$i" | |
145 AC_TRY_COMPILE([#include <libxml/xmlmemory.h>], [int a = 1;], | |
146 XML2_INCLUDE="-I$i", | |
147 XML2_INCLUDE= | |
148 ) | |
149 if test "x$XML2_INCLUDE" != "x"; then | |
150 break; | |
151 fi | |
152 done | |
153 CPPFLAGS="$old_CPPFLAGS $XML2_INCLUDE" | |
154 fi | |
155 | |
156 AC_CHECK_HEADERS([libxml/xmlmemory.h]) | |
157 AC_CHECK_HEADERS([libxml/parser.h]) | |
158 AC_CHECK_HEADERS([libxml/xinclude.h]) | |
159 | |
160 AC_LANG([C++]) | |
161 AC_CHECK_HEADERS([FL/Fl.H]) | |
162 AC_CHECK_HEADERS([FL/Fl_Overlay_Window.H]) | |
163 AC_CHECK_HEADERS([FL/Fl_Light_Button.H]) | |
164 AC_CHECK_HEADERS([FL/fl_draw.H]) | |
165 AC_CHECK_HEADERS([FL/Fl_Cartesian.H], [], [], [],[[#include <FL/Fl.H> | |
166 ]]) | |
167 AC_CHECK_HEADERS([FL/Fl_Audio_Meter.H], [], [], [],[[#include <FL/Fl.H> | |
168 ]]) | |
169 | |
170 AC_LANG([C]) | |
171 # X86_64 Linux machines have both 64 bit and 32 bit libraries. We need to choose the right set | |
172 AC_CHECK_FILE([/usr/X11R6/lib64], [TESTLIBS="$TESTLIBS -L/usr/X11R6/lib64"], AC_CHECK_FILE([/usr/X11R6/lib], [TESTLIBS="$TESTLIBS -L/usr/X11R6/lib"])) | |
173 | |
174 # Checks for libraries. | |
175 AC_CHECK_LIB([Xft], [XftFontOpen], TESTLIBS="$TESTLIBS -lXft",, $TESTLIBS) | |
176 AC_CHECK_LIB([Xext], [XextCreateExtension], TESTLIBS="$TESTLIBS -lXext",, $TESTLIBS) | |
177 AC_CHECK_LIB([X11], [XOpenDisplay], TESTLIBS="$TESTLIBS -lX11",, $TESTLIBS) | |
178 AC_CHECK_LIB([tiff], [TIFFOpen], , AC_MSG_ERROR("Can't build without libtiff (does your system require a libtiff-devel package?)"), -lm) | |
179 AC_CHECK_LIB([m], [cos]) | |
180 AC_CHECK_LIB([xml2], [xmlParseFile], [AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have the 'libxml2' library (-lxml2).]) TESTLIBS="$TESTLIBS -lxml2"]) | |
181 if test -n "$enable_tests" ; then | |
182 AC_LANG([C++]) | |
183 AC_CHECK_LIB([fltk], [main], TESTLIBS="$TESTLIBS -lfltk -lsupc++") | |
184 AC_CHECK_LIB([fltk_cartesian], [main], TESTLIBS="-lfltk_cartesian $TESTLIBS") | |
185 AC_CHECK_LIB([fltk_audio_meter], [main], TESTLIBS="-lfltk_audio_meter $TESTLIBS") | |
186 AC_LANG([C]) | |
187 AC_CHECK_LIB([audiofile], [afOpenFile], TESTLIBS="$TESTLIBS -laudiofile", AC_MSG_ERROR("Can't make tests without libaudiofile (does your system require a libaudiofile-devel package?)")) | |
188 AC_CHECK_LIB([fftw3], [fftw_plan_dft_1d], TESTLIBS="$TESTLIBS -lfftw3") | |
189 AC_CHECK_LIB([fftw], [fftw_create_plan], TESTLIBS="$TESTLIBS -lfftw") | |
190 AC_CHECK_LIB([pthread], [pthread_attr_init], TESTLIBS="$TESTLIBS -lpthread") | |
191 AC_CHECK_LIB([dl], [dlopen], TESTLIBS="$TESTLIBS -ldl") | |
192 AC_CHECK_LIB([unicall], [uc_start], TESTLIBS="$TESTLIBS -lunicall",, -ltiff -ldl) | |
193 fi | |
194 | |
195 case "${ax_cv_c_compiler_vendor}" in | |
196 gnu) | |
197 COMP_VENDOR_CFLAGS="-O2 -g -std=gnu99 -Wall -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes" | |
198 if test "$enable_sse" = "yes" ; then | |
199 COMP_VENDOR_CFLAGS="-msse $COMP_VENDOR_CFLAGS" | |
200 fi | |
201 if test "$enable_mmx" = "yes" ; then | |
202 COMP_VENDOR_CFLAGS="-mmmx $COMP_VENDOR_CFLAGS" | |
203 fi | |
204 ;; | |
205 *) | |
206 COMP_VENDOR_CFLAGS="-O2 -g -std=c99 -Wall -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes" | |
207 ;; | |
208 esac | |
209 | |
210 AM_CONDITIONAL([COND_DOC], [test "$enable_doc" = yes]) | |
211 AM_CONDITIONAL([COND_TESTS], [test "$enable_tests" = yes]) | |
212 AM_CONDITIONAL([COND_ITUTESTS], [test "$enable_itutests" = yes]) | |
213 AM_CONDITIONAL([COND_MMX], [test "$enable_mmx" = yes]) | |
214 AM_CONDITIONAL([COND_SSE], [test "$enable_sse" = yes]) | |
215 | |
216 AC_SUBST(TESTLIBS, $TESTLIBS) | |
217 AC_SUBST(COMP_VENDOR_CFLAGS, $COMP_VENDOR_CFLAGS) | |
218 | |
219 AC_CONFIG_FILES([Makefile | |
220 doc/Makefile | |
221 itutests/Makefile | |
222 itutests/fax/Makefile | |
223 src/Makefile | |
224 tests/Makefile | |
225 spandsp.spec]) | |
226 | |
227 AC_OUTPUT | |
228 | |
229 # @end 1 |