root/branches/streaming-rework/configure.ac

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

- Changed the way the device class configure options are handled. Now they are handled in the makefiles instead of the source files. The only source file that still contains the #ifdef's is devicemanager.cpp, to conditionally include the device class include files and to conditionally probe the classes that might be supported.
- added a configure option to disable the compilation of the test programs in tests/
- cleaned up the ADMTP transmit streamprocessor. Now it sends silenced packets when in the disabled state, instead of no-data packets
- added a getNodeID() to ieee1394service
- made comments in ieee1394service.h doxygen compliant

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