root/branches/streaming-rework/configure.ac

Revision 384, 7.6 kB (checked in by pieterpalmers, 17 years ago)

- temporary commit as backup measure
- rewrote synchronisation code
- receive streaming based on SYT works
- transmit streaming synced to received stream sort of works, still

have to iron out some issues.

NOTE: all devices but the bebob's are disabled in this code,

because they still have to be ported to the new sync
mechanism.

  • 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, 0)
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_122, libraw1394 >= 1.2.2, libraw1394_1_2_2=yes, libraw1394_1_2_2=no)
116 PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 1.2.1)
117 PKG_CHECK_MODULES(LIBIEC61883, libiec61883 >= 1.0.0)
118 PKG_CHECK_MODULES(LIBAVC1394, libavc1394 >= 0.5.3)
119 PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0)
120 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.6.0)
121 PKG_CHECK_MODULES(LIBXMLCPP, libxml++-2.6 >= 2.14.0)
122
123 # Setup CFLAGS and CXXFLAGS
124 AC_ARG_ENABLE(debug,
125 [  --enable-debug    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 if test "x$libraw1394_1_2_2" = xyes; then
133         CFLAGS="$CFLAGS -DLIBRAW1394_USE_CTRREAD_API"
134         CXXFLAGS="$CXXFLAGS -DLIBRAW1394_USE_CTRREAD_API"
135 fi
136
137 dnl Check for MMX assembly
138
139 AC_ARG_ENABLE(mmx,
140     [  --enable-mmx            enable MMX support (default=auto)],,
141     enable_mmx=yes)
142
143 AC_ARG_ENABLE(sse,
144     [  --enable-sse            enable SSE support (default=auto)],,
145     enable_sse=$enable_mmx)
146
147 if test "x$enable_mmx" = xyes; then
148    
149     AC_MSG_CHECKING(whether we can compile MMX code)
150    
151     AC_COMPILE_IFELSE([asm ("movq 0, %mm0");],
152        
153         AC_DEFINE(USE_MMX, 1, [Define to 1 if MMX assembly is available.])
154         AC_MSG_RESULT(yes)
155         MMX_FLAGS="-mmmx -DENABLE_MMX"
156        
157         if test "x$enable_sse" = xyes; then
158              
159               AC_MSG_CHECKING(whether we can compile SSE code)
160              
161               AC_COMPILE_IFELSE([asm ("movntps %xmm0, 0");],
162                   AC_DEFINE(USE_SSE, 1,
163                             [Define to 1 if SSE assembly is available.])
164                   SSE_FLAGS="-msse -mfpmath=sse -DENABLE_SSE"
165                   AC_MSG_RESULT(yes)
166                   ,
167                   enable_sse=no
168                   AC_MSG_RESULT(no)
169                   AC_MSG_WARN(
170                       [The assembler does not support the SSE command set.]
171                   )
172               )
173              
174           fi
175           ,
176           enable_mmx=no
177           AC_MSG_RESULT(no)
178           AC_MSG_WARN([The assembler does not support the MMX command set.])
179       )
180   fi
181
182   AC_DEFINE(x86, 1, "Nope it's intel")
183   COMMON_X86_OPT_FLAGS="-DREENTRANT -O3 -fomit-frame-pointer -ffast-math -funroll-loops"
184
185   if test "$target_cpu" = "i586"; then
186       FREEBOB_OPT_CFLAGS="-march=i586 "
187   elif test "$target_cpu" = "i686"; then
188       FREEBOB_OPT_CFLAGS="-march=i686"
189   else
190       :
191   fi
192
193   FREEBOB_OPT_CFLAGS="$COMMON_X86_OPT_FLAGS $FREEBOB_OPT_CFLAGS $MMX_FLAGS $SSE_FLAGS"
194
195
196 AC_ARG_ENABLE(optimize,
197     AC_HELP_STRING([--enable-optimize],
198                    [ask the compiler for its best optimizations]),
199     [ if test x$enable_optimize != xno ; then
200         CFLAGS="$CFLAGS $FREEBOB_OPT_CFLAGS" ;
201         CXXFLAGS="$CXXFLAGS $FREEBOB_OPT_CFLAGS"
202       fi
203     ]
204 )
205
206 CFLAGS="$CFLAGS -Wall -std=gnu99"
207 CXXFLAGS="$CXXFLAGS -Wall -DDATADIR=\\\"\$(datadir)\\\""
208
209 if test "${debug}" = true; then
210    CFLAGS="$CFLAGS -g -DDEBUG"
211    CXXFLAGS="$CXXFLAGS -g -DDEBUG"
212 else
213    CFLAGS="$CFLAGS -O2"
214    CXXFLAGS="$CXXFLAGS -O2"
215 fi;
216
217 AC_SUBST([CFLAGS])
218 AC_SUBST([CXXFLAGS])
219
220 # Configure components.
221 AC_ENABLE_STATIC(yes)
222 AC_ENABLE_SHARED(yes)
223
224 AC_SUBST([LIBSIGC_CFLAGS])
225 AC_SUBST([LIBSIGC_LIBS])
226 AC_SUBST([ALSA_CFLAGS])
227 AC_SUBST([ALSA_LIBS])
228 AC_SUBST([LIBRAW1394_CFLAGS])
229 AC_SUBST([LIBRAW1394_LIBS])
230 AC_SUBST([LIBIEC61883_CFLAGS])
231 AC_SUBST([LIBIEC61883_LIBS])
232 AC_SUBST([LIBAVC1394_CFLAGS])
233 AC_SUBST([LIBAVC1394_LIBS])
234 AC_SUBST([LIBXML_LIBS])
235 AC_SUBST([LIBXML_CFLAGS])
236
237 AC_CONFIG_FILES([Makefile
238                  doc/Makefile
239                  doc/reference.doxygen
240                  libfreebob/Makefile
241                  src/Makefile
242                  tests/Makefile
243                  tests/streaming/Makefile
244                  libfreebob.pc])
245
246 AC_OUTPUT
247
248 # Print a summary so that important information isn't missed.
249 AC_MSG_RESULT([
250
251 FreeBoB $VERSION is now configured for $canonical_host_type
252
253   Source directory:     $srcdir
254   Installation prefix:  $prefix
255   C compiler:           $C $CFLAGS
256   C++ compiler:         $CXX $CXXFLAGS
257
258   libraw1394 CFLAGS:    $LIBRAW1394_CFLAGS
259   libraw1394 LIBS:      $LIBRAW1394_LIBS
260    use new cycle timer read api? $libraw1394_1_2_2
261   libiec61883 CFLAGS:   $LIBIEC61883_CFLAGS
262   libiec61883 LIBS:     $LIBIEC61883_LIBS
263   libavc1394 CFLAGS:    $LIBAVC1394_CFLAGS
264   libavc1394 LIBS:      $LIBAVC1394_LIBS
265 ])
Note: See TracBrowser for help on using the browser.