root/trunk/libffado/configure.ac

Revision 445, 11.8 kB (checked in by pieterpalmers, 16 years ago)

* name change from FreeBoB to FFADO
* replaced tabs by 4 spaces
* got rid of end-of-line spaces
* made all license and copyrights conform

library becomes LGPL, apps become GPL
explicitly state LGPL v2.1 and GPL v2 (don't like v3 draft)

copyrights are 2005-2007 Daniel & Pieter
except for the MotU stuff (C) Jonathan, Pieter

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