root/trunk/libfreebob/configure.ac

Revision 358, 7.3 kB (checked in by wagi, 17 years ago)

basic bebob serializing code added.

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