root/trunk/libffado/configure.ac

Revision 554, 12.5 kB (checked in by ppalmers, 16 years ago)

Merge echoaudio branch into trunk.

This adds support for the Echo Audiofire devices to FFADO. Possibly also other devices working with the Apple Class Driver will work with this code. It is not fully complete yet, but the main rework is
done.

First of all the IAvDevice class/interface is renamed to FFADODevice, in order to separate the AV/C code from the FFADO API code. A device supported by FFADO implements a FFADODevice.

The BeBoB device has been split up into three groups:
- libavc/* : all code and commands that are specified by AV/C specs. Note that a lot of the code that used to be in BeBoB::AvDevice? now resides in AVC::Unit
- genericavc/* : a FFADODevice that uses AV/C descriptors & commands for discovery and config
- bebob/* : the bebob FFADODevice that inherits from GenericAVC::AvDevice? but that uses BridgeCo? commands for discovery

Everything has been moved as high as possible in the class hierarchy. If necessary, a subclass that uses device specific commands is introduced (e.g. BeBoB::Plug inherits from AVC::Plug and uses the
BridgeCo? extended plug info command to discover it's properties).

There are some other fixes along the way that have been done too.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 # configure.ac - Configure script for FFADO.
2 # Copyright (C) 2005,06,07 by Daniel Wagner.
3 # Copyright (C) 2006,07 by Pieter Palmers.
4 #
5 # This file is part of FFADO.
6 # FFADO is based upon FreeBoB.
7 #
8 # FFADO is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 # FFADO is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with FFADO; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 #
20 #                                               -*- Autoconf -*-
21 # Process this file with autoconf to produce a configure script.
22
23 AC_PREREQ(2.57)
24
25
26 m4_define(ffado_major_version, 1)
27 m4_define(ffado_minor_version, 999)
28 m4_define(ffado_micro_version, 6)
29
30 m4_define(ffado_version, ffado_major_version.ffado_minor_version.ffado_micro_version)
31
32 AC_INIT(libffado, ffado_version, <ffado-devel@lists.sf.net>)
33
34 # Before making a release, the LT_VERSION string should be modified.
35 # The string is of the form C:R:A.
36 # - If interfaces have been changed or added, but binary compatibility has
37 #   been preserved, change to C+1:0:A+1
38 # - If binary compatibility has been broken (eg removed or changed interfaces)
39 #   change to C+1:0:0
40 # - If the interface is the same as the previous version, change to C:R+1:A
41
42
43 LT_VERSION=1:0:0
44 AC_SUBST(LT_VERSION)
45
46 AC_DEFINE(FFADO_MAJOR_VERSION, ffado_major_version,[FFADO major version])
47 AC_DEFINE(FFADO_MINOR_VERSION, ffado_minor_version,[FFADO minor version])
48 AC_DEFINE(FFADO_MICRO_VERSION, ffado_micro_version,[FFADO micro version])
49 AC_SUBST(FFADO_MINOR_VERSION, ffado_minor_version)
50 AC_SUBST(FFADO_MAJOR_VERSION, ffado_major_version)
51 AC_SUBST(FFADO_MICRO_VERSION, ffado_micro_version)
52
53 AM_INIT_AUTOMAKE([subdir-objects])
54 AM_MAINTAINER_MODE
55 AC_CONFIG_SRCDIR([src/ffado.cpp])
56 AC_CONFIG_HEADER([config.h])
57 AC_GNU_SOURCE
58 AC_LANG(C++)
59
60 # Prefix handling
61 AC_MSG_CHECKING(prefix)
62 defaultprefix=/usr/local
63 if test -z "$prefix" -o "$prefix" = "NONE"; then
64         prefix=$defaultprefix
65 fi
66 AC_PREFIX_DEFAULT($prefix)
67 AC_MSG_RESULT($prefix)
68
69 maintainer_mode=${enable_maintainer_mode-no}
70
71 # Checks for programs.
72 # AC_PROG_CC and AC_PROG_CXX will add by default "-g -O2" if
73 # CFLAGS and CXXFLAGS do not exists.  Disable this feature.
74 test ".$CFLAGS" = "." && CFLAGS=""
75 test ".$CXXFLAGS" = "." && CXXFLAGS=""
76 AC_PROG_CC
77 AC_PROG_CXX
78 AM_PROG_AS
79 AM_PROG_CC_C_O
80 AC_PROG_LIBTOOL
81 AC_CHECK_TOOL([AR], [ar], :)
82 AC_CHECK_TOOL([NM], [nm], :)
83 AC_PATH_PROG([SED], [sed], :)
84 AC_PATH_PROG([SORT], [sort], :)
85
86 # Required for building the documentation
87
88 # Checks for libraries.
89 AC_PROG_LIBTOOL
90
91 # Checks for typedefs, structures, and compiler characteristics.
92 AC_CANONICAL_HOST
93 AC_C_CONST
94 AC_C_VOLATILE
95 AC_TYPE_SIZE_T
96
97 # XXX Debian specific hack:
98 # by Marcelo Magallon <mmagallo@efis.ucr.ac.cr>
99 # Turn around -rpath problem with libtool 1.0c
100 # This define should be improbable enough to not conflict with anything
101 case ${host} in
102   *-pc-linux-gnu)
103     AC_MSG_RESULT([Fixing libtool for -rpath problems.])
104     sed < libtool > libtool-2 \
105     's/^hardcode_libdir_flag_spec.*$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/'
106     mv libtool-2 libtool
107     chmod 755 libtool
108   ;;
109 esac
110
111 AC_CHECK_LIB(pthread, pthread_create,,
112 [
113         AC_ERROR(You need the pthread library to compile ffado)
114 ])
115
116 # Check for dependencies
117 PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 1.3.0)
118 PKG_CHECK_MODULES(LIBIEC61883, libiec61883 >= 1.1.0)
119 PKG_CHECK_MODULES(LIBAVC1394, libavc1394 >= 0.5.3)
120 PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0)
121 PKG_CHECK_MODULES(LIBXMLCPP, libxml++-2.6 >= 2.14.0)
122 PKG_CHECK_MODULES(LIBLO, liblo >= 0.22)
123
124 # Setup CFLAGS and CXXFLAGS
125 AC_ARG_ENABLE(debug,
126     AC_HELP_STRING([--enable-debug],
127                    [Turn on debugging]),
128 [case "${enableval}" in
129   yes) debug=true;;
130   no)  ;;
131   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
132 esac],[debug=false])
133
134 dnl Check for MMX assembly
135
136 AC_ARG_ENABLE(mmx,
137     AC_HELP_STRING([--enable-mmx],
138                    [enable MMX support (default=auto)]),,
139     enable_mmx=yes)
140
141 AC_ARG_ENABLE(sse,
142     AC_HELP_STRING([--enable-sse],
143                    [enable SSE support (default=auto)]),,
144     enable_sse=$enable_mmx)
145
146 if test "x$enable_mmx" = xyes; then
147    
148     AC_MSG_CHECKING(whether we can compile MMX code)
149    
150     AC_COMPILE_IFELSE([asm ("movq 0, %mm0");],
151        
152         AC_DEFINE(USE_MMX, 1, [Define to 1 if MMX assembly is available.])
153         AC_MSG_RESULT(yes)
154         MMX_FLAGS="-mmmx -DENABLE_MMX"
155        
156         if test "x$enable_sse" = xyes; then
157              
158               AC_MSG_CHECKING(whether we can compile SSE code)
159              
160               AC_COMPILE_IFELSE([asm ("movntps %xmm0, 0");],
161                   AC_DEFINE(USE_SSE, 1,
162                             [Define to 1 if SSE assembly is available.])
163                   SSE_FLAGS="-msse -mfpmath=sse -DENABLE_SSE"
164                   AC_MSG_RESULT(yes)
165                   ,
166                   enable_sse=no
167                   AC_MSG_RESULT(no)
168                   AC_MSG_WARN(
169                       [The assembler does not support the SSE command set.]
170                   )
171               )
172              
173           fi
174           ,
175           enable_mmx=no
176           AC_MSG_RESULT(no)
177           AC_MSG_WARN([The assembler does not support the MMX command set.])
178       )
179   fi
180
181   AC_DEFINE(x86, 1, "Nope it's intel")
182   COMMON_X86_OPT_FLAGS="-DREENTRANT -O3 -fomit-frame-pointer -ffast-math -funroll-loops"
183
184   if test "$target_cpu" = "i586"; then
185       FFADO_OPT_CFLAGS="-march=i586 "
186   elif test "$target_cpu" = "i686"; then
187       FFADO_OPT_CFLAGS="-march=i686"
188   else
189       :
190   fi
191
192   FFADO_OPT_CFLAGS="$COMMON_X86_OPT_FLAGS $FFADO_OPT_CFLAGS $MMX_FLAGS $SSE_FLAGS"
193
194
195 AC_ARG_ENABLE(optimize,
196     AC_HELP_STRING([--enable-optimize],
197                    [ask the compiler for its best optimizations]),
198     [ if test x$enable_optimize != xno ; then
199         CFLAGS="$CFLAGS $FFADO_OPT_CFLAGS" ;
200         CXXFLAGS="$CXXFLAGS $FFADO_OPT_CFLAGS"
201       fi
202     ]
203 )
204
205 dnl Conditional compilation of targets
206
207 dnl --- Build BeBoB code?
208
209 AC_ARG_ENABLE(bebob,
210     AC_HELP_STRING([--enable-bebob],
211                    [build BeBoB support (default=yes)]),
212 [case "${enableval}" in
213   yes) build_bebob=true;;
214   no)  build_bebob=false;;
215   *) AC_MSG_ERROR(bad value ${enableval} for --enable-bebob) ;;
216 esac],
217 [build_bebob=true])
218
219 dnl --- Build Generic AV/C code (Apple class driver compatible)?
220
221 AC_ARG_ENABLE(generic-avc,
222     AC_HELP_STRING([--enable-generic-avc],
223                    [build Generic AV/C support (default=yes)]),
224 [case "${enableval}" in
225   yes) build_genericavc=true;;
226   no)  build_genericavc=false;;
227   *) AC_MSG_ERROR(bad value ${enableval} for --enable-generic-avc) ;;
228 esac],
229 [build_genericavc=true])
230
231 dnl --- Build Motu code?
232
233 AC_ARG_ENABLE(motu,
234     AC_HELP_STRING([--enable-motu],
235                    [build Motu support (default=no)]),
236 [case "${enableval}" in
237   yes) build_motu=true;;
238   no)  build_motu=false;;
239   *) AC_MSG_ERROR(bad value ${enableval} for --enable-motu) ;;
240 esac],
241 [build_motu=false])
242
243 dnl --- Build DICE code?
244
245 AC_ARG_ENABLE(dice,
246     AC_HELP_STRING([--enable-dice],
247                    [build DICE support (default=no)]),
248 [case "${enableval}" in
249   yes) build_dice=true;;
250   no)  build_dice=false;;
251   *) AC_MSG_ERROR(bad value ${enableval} for --enable-dice) ;;
252 esac],
253 [build_dice=false])
254
255 dnl --- Build Metric Halo code?
256
257 AC_ARG_ENABLE(metric-halo,
258     AC_HELP_STRING([--enable-metric-halo],
259                    [build Metric Halo support (note: completely useless) (default=no)]),
260 [case "${enableval}" in
261   yes) build_metric_halo=true;;
262   no)  build_metric_halo=false;;
263   *) AC_MSG_ERROR(bad value ${enableval} for --enable-metric-halo) ;;
264 esac],
265 [build_metric_halo=false])
266
267 dnl --- Build Metric Halo code?
268
269 AC_ARG_ENABLE(rme,
270     AC_HELP_STRING([--enable-rme],
271                    [build RME support (note: completely useless) (default=no)]),
272 [case "${enableval}" in
273   yes) build_rme=true;;
274   no)  build_rme=false;;
275   *) AC_MSG_ERROR(bad value ${enableval} for --enable-rme) ;;
276 esac],
277 [build_rme=false])
278
279 dnl --- Build Bounce device code?
280
281 AC_ARG_ENABLE(bounce,
282     AC_HELP_STRING([--enable-bounce],
283                    [build Bounce device support (default=no)]),
284 [case "${enableval}" in
285   yes) build_bounce=true;;
286   no)  build_bounce=false;;
287   *) AC_MSG_ERROR(bad value ${enableval} for --enable-bounce) ;;
288 esac],
289 [build_bounce=false])
290
291 dnl --- Build support for all supported devices?
292
293 AC_ARG_ENABLE(all-devices,
294     AC_HELP_STRING([--enable-all-devices],
295                    [build support for all supported devices (default=no)]),
296 [case "${enableval}" in
297   yes) build_all=true;;
298   no)  build_all=false;;
299   *) AC_MSG_ERROR(bad value ${enableval} for --enable-all-devices) ;;
300 esac],
301 [build_all=false])
302
303 AC_ARG_ENABLE(tests,
304     AC_HELP_STRING([--enable-tests],
305                    [build programs in the tests directory (default=yes)]),
306 [case "${enableval}" in
307   yes) build_tests=true;;
308   no)  build_tests=false;;
309   *) AC_MSG_ERROR(bad value ${enableval} for --enable-tests) ;;
310 esac],
311 [build_tests=true])
312
313 CFLAGS="$CFLAGS -Wall -std=gnu99"
314 CXXFLAGS="$CXXFLAGS -Wall -DDATADIR=\\\"\$(datadir)\\\"  -DCACHEDIR=\\\"\$(localstatedir)\\\""
315 if test "${debug}" = true; then
316    CFLAGS="$CFLAGS -g -DDEBUG"
317    CXXFLAGS="$CXXFLAGS -g -DDEBUG"
318 else
319    CFLAGS="$CFLAGS -O2"
320    CXXFLAGS="$CXXFLAGS -O2"
321 fi;
322
323 dnl Device classes
324 if test "${build_all}" = true; then
325     build_bebob=true
326     build_genericavc=true
327     build_motu=true
328     build_dice=true
329     build_metric_halo=true
330     build_bounce=true
331     build_rme=true
332 fi;
333
334 build_amdtp=false
335
336 if test "${build_bebob}" = true; then
337    CFLAGS="$CFLAGS -DENABLE_BEBOB"
338    CXXFLAGS="$CXXFLAGS -DENABLE_BEBOB"
339    supported_devices="${supported_devices}BeBoB  "
340    build_amdtp=true
341 fi;
342
343 if test "${build_genericavc}" = true; then
344    CFLAGS="$CFLAGS -DENABLE_GENERICAVC"
345    CXXFLAGS="$CXXFLAGS -DENABLE_GENERICAVC"
346    supported_devices="${supported_devices}GenericAVC  "
347    build_amdtp=true
348 fi;
349
350 if test "${build_motu}" = true; then
351    CFLAGS="$CFLAGS -DENABLE_MOTU"
352    CXXFLAGS="$CXXFLAGS -DENABLE_MOTU"
353    supported_devices="${supported_devices}Motu  "
354 fi;
355
356 if test "${build_dice}" = true; then
357    CFLAGS="$CFLAGS -DENABLE_DICE"
358    CXXFLAGS="$CXXFLAGS -DENABLE_DICE"
359    supported_devices="${supported_devices}DICE  "
360    build_amdtp=true
361 fi;
362
363 if test "${build_metric_halo}" = true; then
364    CFLAGS="$CFLAGS -DENABLE_METRIC_HALO"
365    CXXFLAGS="$CXXFLAGS -DENABLE_METRIC_HALO"
366    supported_devices="${supported_devices}Metric Halo (useless)  "
367 fi;
368
369 if test "${build_bounce}" = true; then
370    CFLAGS="$CFLAGS -DENABLE_BOUNCE"
371    CXXFLAGS="$CXXFLAGS -DENABLE_BOUNCE"
372    supported_devices="${supported_devices}Bounce  "
373    build_amdtp=true
374 fi;
375
376 if test "${build_rme}" = true; then
377    CFLAGS="$CFLAGS -DENABLE_RME"
378    CXXFLAGS="$CXXFLAGS -DENABLE_RME"
379    supported_devices="${supported_devices}RME (useless)  "
380 fi;
381
382 if test "${supported_devices}" = ""; then
383     AC_ERROR(You need to enable at least one device class to support!)
384 fi;
385
386 AM_CONDITIONAL(BUILD_BEBOB,test "${build_bebob}" = true)
387 AM_CONDITIONAL(BUILD_GENERICAVC,test "${build_genericavc}" = true)
388 AM_CONDITIONAL(BUILD_MOTU,test "${build_motu}" = true)
389 AM_CONDITIONAL(BUILD_DICE,test "${build_dice}" = true)
390 AM_CONDITIONAL(BUILD_METRIC_HALO,test "${build_metric_halo}" = true)
391 AM_CONDITIONAL(BUILD_BOUNCE,test "${build_bounce}" = true)
392 AM_CONDITIONAL(BUILD_RME,test "${build_rme}" = true)
393
394 AM_CONDITIONAL(BUILD_AMDTP,test "${build_amdtp}" = true)
395
396 AM_CONDITIONAL(BUILD_TESTS,test "${build_tests}" = true)
397
398 AC_SUBST([CFLAGS])
399 AC_SUBST([CXXFLAGS])
400
401 # Configure components.
402 AC_ENABLE_STATIC(yes)
403 AC_ENABLE_SHARED(yes)
404
405 AC_SUBST([LIBSIGC_CFLAGS])
406 AC_SUBST([LIBSIGC_LIBS])
407 AC_SUBST([ALSA_CFLAGS])
408 AC_SUBST([ALSA_LIBS])
409 AC_SUBST([LIBRAW1394_CFLAGS])
410 AC_SUBST([LIBRAW1394_LIBS])
411 AC_SUBST([LIBIEC61883_CFLAGS])
412 AC_SUBST([LIBIEC61883_LIBS])
413 AC_SUBST([LIBAVC1394_CFLAGS])
414 AC_SUBST([LIBAVC1394_LIBS])
415 AC_SUBST([LIBLO_LIBS])
416 AC_SUBST([LIBLO_CFLAGS])
417
418 AC_SUBST([BIN_PROGRAMS])
419
420 AC_CONFIG_FILES([Makefile
421                  doc/Makefile
422                  doc/reference.doxygen
423                  libffado/Makefile
424                  src/Makefile
425                  tests/Makefile
426                  tests/streaming/Makefile
427                  libffado.pc])
428
429 AC_OUTPUT
430
431 # Print a summary so that important information isn't missed.
432 AC_MSG_RESULT([
433
434 FFADO $VERSION is now configured for $canonical_host_type
435
436   Building support for: $supported_devices
437    build AMDTP support: $build_amdtp
438    
439   Building tests:       $build_tests
440
441   Source directory:     $srcdir
442   Installation prefix:  $prefix
443   C compiler:           $CC $CFLAGS
444   C++ compiler:         $CXX $CXXFLAGS
445
446   libraw1394 CFLAGS:    $LIBRAW1394_CFLAGS
447   libraw1394 LIBS:      $LIBRAW1394_LIBS
448   libiec61883 CFLAGS:   $LIBIEC61883_CFLAGS
449   libiec61883 LIBS:     $LIBIEC61883_LIBS
450   libavc1394 CFLAGS:    $LIBAVC1394_CFLAGS
451   libavc1394 LIBS:      $LIBAVC1394_LIBS
452 ])
Note: See TracBrowser for help on using the browser.