root/trunk/libfreebob/configure.ac

Revision 159, 5.1 kB (checked in by pieterpalmers, 18 years ago)

- Added streaming API
- Added test programs for the streaming API

  • 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 by Daniel Wagner.
3 #
4 # This file is part of FreeBob.
5 #
6 # FreeBob is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 # FreeBob is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with FreeBob; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17 #
18 #                                               -*- Autoconf -*-
19 # Process this file with autoconf to produce a configure script.
20
21 AC_PREREQ(2.57)
22
23 m4_define(freebob_major_version, 0)
24 m4_define(freebob_minor_version, 2)
25 m4_define(freebob_micro_version, 0)
26
27 m4_define(freebob_version, freebob_major_version.freebob_minor_version.freebob_micro_version)
28
29 AC_INIT(libfreebob, freebob_version, <freebob-devel@lists.sf.net>)
30
31 # Before making a release, the LT_VERSION string should be modified.
32 # The string is of the form C:R:A.
33 # - If interfaces have been changed or added, but binary compatibility has
34 #   been preserved, change to C+1:0:A+1
35 # - If binary compatibility has been broken (eg removed or changed interfaces)
36 #   change to C+1:0:0
37 # - If the interface is the same as the previous version, change to C:R+1:A
38
39 LT_VERSION=1:0:1
40 AC_SUBST(LT_VERSION)
41
42 AC_DEFINE(FREEBOB_MAJOR_VERSION, freebob_major_version,[Freebob major version])
43 AC_DEFINE(FREEBOB_MINOR_VERSION, freebob_minor_version,[Freebob minor version])
44 AC_DEFINE(FREEBOB_MICRO_VERSION, freebob_micro_version,[Freebob micro version])
45 AC_SUBST(FREEBOB_MINOR_VERSION, freebob_minor_version)
46 AC_SUBST(FREEBOB_MAJOR_VERSION, freebob_major_version)
47 AC_SUBST(FREEBOB_MICRO_VERSION, freebob_micro_version)
48
49 AM_INIT_AUTOMAKE
50 AM_MAINTAINER_MODE
51 AC_CONFIG_SRCDIR([src/freebob.cpp])
52 AC_CONFIG_HEADER([config.h])
53 AC_GNU_SOURCE
54 AC_LANG(C++)
55
56 # Prefix handling
57 AC_MSG_CHECKING(prefix)
58 defaultprefix=/usr/local
59 if test -z "$prefix" -o "$prefix" = "NONE"; then
60         prefix=$defaultprefix
61 fi
62 AC_PREFIX_DEFAULT($prefix)
63 AC_MSG_RESULT($prefix)
64
65 maintainer_mode=${enable_maintainer_mode-no}
66
67 # Checks for programs.
68 # AC_PROG_CC and AC_PROG_CXX will add by default "-g -O2" if
69 # CFLAGS and CXXFLAGS do not exists.  Disable this feature.
70 test ".$CFLAGS" = "." && CFLAGS=""
71 test ".$CXXFLAGS" = "." && CXXFLAGS=""
72 AC_PROG_CC
73 AC_PROG_CXX
74 AM_PROG_AS
75 AC_PROG_LIBTOOL
76 AC_CHECK_TOOL([AR], [ar], :)
77 AC_CHECK_TOOL([NM], [nm], :)
78 AC_PATH_PROG([SED], [sed], :)
79 AC_PATH_PROG([SORT], [sort], :)
80
81 # Required for building the documentation
82
83 # Checks for libraries.
84 AC_PROG_LIBTOOL
85
86 # Checks for typedefs, structures, and compiler characteristics.
87 AC_CANONICAL_HOST
88 AC_C_CONST
89 AC_C_VOLATILE
90 AC_TYPE_SIZE_T
91
92 # XXX Debian specific hack:
93 # by Marcelo Magallon <mmagallo@efis.ucr.ac.cr>
94 # Turn around -rpath problem with libtool 1.0c
95 # This define should be improbable enough to not conflict with anything
96 case ${host} in
97   *-pc-linux-gnu)
98     AC_MSG_RESULT([Fixing libtool for -rpath problems.])
99     sed < libtool > libtool-2 \
100     's/^hardcode_libdir_flag_spec.*$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/'
101     mv libtool-2 libtool
102     chmod 755 libtool
103   ;;
104 esac
105
106 AC_CHECK_LIB(pthread, pthread_create,,
107 [
108         AC_ERROR(You need the pthread library to compile freebob)
109 ])
110
111 # Check for dependencies
112 PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 1.2.0)
113 PKG_CHECK_MODULES(LIBIEC61883, libiec61883 >= 1.1.0)
114 PKG_CHECK_MODULES(LIBAVC1394, libavc1394 >= 0.5.2)
115 PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0)
116 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.6.0)
117
118 # Setup CFLAGS and CXXFLAGS
119 AC_ARG_ENABLE(debug,
120 [  --enable-debug    Turn on debugging],
121 [case "${enableval}" in
122   yes) debug=true;;
123   no)  ;;
124   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
125 esac],[debug=false])
126
127 CFLAGS="$CFLAGS -g -Wall -std=gnu99"
128 CXXFLAGS="$CXXFLAGS -g -Wall"
129
130 if test "${debug}" = true; then
131    CFLAGS="$CFLAGS -DDEBUG"
132    CXXFLAGS="$CXXFLAGS -DDEBUG"
133 else
134    CFLAGS="$CFLAGS -O2"
135    CXXFLAGS="$CXXFLAGS -O2"
136 fi;
137
138 AC_SUBST([CFLAGS])
139 AC_SUBST([CXXFLAGS])
140
141 # Configure components.
142 AC_ENABLE_STATIC(yes)
143 AC_ENABLE_SHARED(yes)
144
145 AC_SUBST([LIBSIGC_CFLAGS])
146 AC_SUBST([LIBSIGC_LIBS])
147 AC_SUBST([ALSA_CFLAGS])
148 AC_SUBST([ALSA_LIBS])
149 AC_SUBST([LIBRAW1394_CFLAGS])
150 AC_SUBST([LIBRAW1394_LIBS])
151 AC_SUBST([LIBIEC61883_CFLAGS])
152 AC_SUBST([LIBIEC61883_LIBS])
153 AC_SUBST([LIBAVC1394_CFLAGS])
154 AC_SUBST([LIBAVC1394_LIBS])
155 AC_SUBST([LIBXML_LIBS])
156 AC_SUBST([LIBXML_CFLAGS])
157
158 AC_CONFIG_FILES([Makefile
159                  libfreebob/Makefile
160                  src/debugmodule/Makefile
161                  src/libfreebobavc/Makefile
162                  src/libfreebobstreaming/Makefile
163                  src/Makefile
164                  tests/Makefile
165                  tests/streaming/Makefile
166                  libfreebob.pc])
167 AC_OUTPUT
168
169 # Print a summary so that important information isn't missed.
170 AC_MSG_RESULT([
171
172 FreeBob is now configured for $canonical_host_type
173
174   Source directory:     $srcdir
175   Installation prefix:  $prefix
176   C++ compiler:         $CXX $CXXFLAGS
177 ])
Note: See TracBrowser for help on using the browser.