root/trunk/libfreebob/configure.ac

Revision 125, 5.8 kB (checked in by wagi, 17 years ago)

Initial revision

  • 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, 0)
25 m4_define(freebob_micro_version, 1)
26 m4_define(freebob_version, freebob_major_version.freebob_minor_version.freebob_micro_version)
27
28 AC_INIT(libfreebob, freebob_version, <freebob-devel@lists.sf.net>)
29
30 # Before making a release, the LT_VERSION string should be modified.
31 # The string is of the form C:R:A.
32 # - If interfaces have been changed or added, but binary compatibility has
33 #   been preserved, change to C+1:0:A+1
34 # - If binary compatibility has been broken (eg removed or changed interfaces)
35 #   change to C+1:0:0
36 # - If the interface is the same as the previous version, change to C:R+1:A
37
38 LT_VERSION=1:0:1
39 AC_SUBST(LT_VERSION)
40
41 AC_DEFINE(FREEBOB_MAJOR_VERSION, freebob_major_version,[Freebob major version])
42 AC_DEFINE(FREEBOB_MINOR_VERSION, freebob_minor_version,[Freebob minor version])
43 AC_DEFINE(FREEBOB_MICRO_VERSION, freebob_micro_version,[Freebob micro version])
44 AC_SUBST(FREEBOB_MINOR_VERSION, freebob_minor_version)
45 AC_SUBST(FREEBOB_MAJOR_VERSION, freebob_major_version)
46 AC_SUBST(FREEBOB_MICRO_VERSION, freebob_micro_version)
47
48 AM_INIT_AUTOMAKE
49 AM_MAINTAINER_MODE
50 AC_CONFIG_SRCDIR([src/freebob.cpp])
51 AC_CONFIG_HEADER([config.h])
52 AC_GNU_SOURCE
53 AC_LANG(C++)
54
55 # Prefix handling
56 AC_MSG_CHECKING(prefix)
57 defaultprefix=/usr/local
58 if test -z "$prefix" -o "$prefix" = "NONE"; then
59         prefix=$defaultprefix
60 fi
61 AC_PREFIX_DEFAULT($prefix)
62 AC_MSG_RESULT($prefix)
63
64 maintainer_mode=${enable_maintainer_mode-no}
65
66 # Checks for programs.
67 # AC_PROG_CC and AC_PROG_CXX will add by default "-g -O2" if
68 # CFLAGS and CXXFLAGS do not exists.  Disable this feature.
69 test ".$CFLAGS" = "." && CFLAGS=""
70 test ".$CXXFLAGS" = "." && CXXFLAGS=""
71 AC_PROG_CC
72 AC_PROG_CXX
73 AM_PROG_AS
74 AC_PROG_LIBTOOL
75 AC_CHECK_TOOL([AR], [ar], :)
76 AC_CHECK_TOOL([NM], [nm], :)
77 AC_PATH_PROG([SED], [sed], :)
78 AC_PATH_PROG([SORT], [sort], :)
79
80 # Required for building the documentation
81
82 # Checks for libraries.
83 AC_PROG_LIBTOOL
84
85 # XXX Debian specific hack:
86 # by Marcelo Magallon <mmagallo@efis.ucr.ac.cr>
87 # Turn around -rpath problem with libtool 1.0c
88 # This define should be improbable enough to not conflict with anything
89 case ${host} in
90   *-pc-linux-gnu)
91     AC_MSG_RESULT([Fixing libtool for -rpath problems.])
92     sed < libtool > libtool-2 \
93     's/^hardcode_libdir_flag_spec.*$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/'
94     mv libtool-2 libtool
95     chmod 755 libtool
96   ;;
97 esac
98
99 AC_CHECK_LIB(raw1394, raw1394_new_handle, ,
100             [AC_MSG_ERROR([Unable to link with libraw1394. Check that you have libraw1394 installed])])
101
102 AC_CHECK_LIB(avc1394, avc1394_vcr_record, ,
103              [AC_MSG_ERROR([Unable to link with libavc1394. Check that you have libavc1394 installed and that the version is 0.4.1 or newer])])
104
105 AC_CHECK_LIB(pthread, pthread_create,,
106 [
107         AC_ERROR(You need the pthread library to compile freebob)
108 ])
109
110 # Checks for header files.
111 AC_CHECK_HEADERS([libraw1394/raw1394.h], ,
112     [AC_MSG_ERROR([raw1394.h not found install libraw1394-devel])
113 ])
114
115 AC_CHECK_HEADER([libavc1394/avc1394.h], ,
116         [AC_MSG_ERROR([avc1394.h not found, install libavc1394-devel])
117 ])
118 AC_CHECK_HEADER(execinfo.h, [AC_DEFINE(HAVE_EXECINFO_H, 1, Wheter or not execinfo.h is present)
119         EXTRA_LIBS="$EXTRA_LIBS -rdynamic"])
120
121 # Check for libXML2
122 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.6.0)
123 AC_SUBST([LIBXML_LIBS])
124 AC_SUBST([LIBXML_CFLAGS])
125        
126 # Checks for typedefs, structures, and compiler characteristics.
127 AC_CANONICAL_HOST
128 AC_C_CONST
129 AC_C_VOLATILE
130 AC_TYPE_SIZE_T
131
132 # Setup CFLAGS and CXXFLAGS
133 AC_ARG_ENABLE(debug,
134 [  --enable-debug    Turn on debugging],
135 [case "${enableval}" in
136   yes) debug=true;;
137   no)  ;;
138   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
139 esac],[debug=false])
140
141 CFLAGS="$CFLAGS -g -Wall -std=gnu99"
142 CXXFLAGS="$CXXFLAGS -g -Wall"
143
144 if test "${debug}" = true; then
145    CFLAGS="$CFLAGS -DDEBUG"
146    CXXFLAGS="$CXXFLAGS -DDEBUG"
147 else
148    CFLAGS="$CFLAGS -O2"
149    CXXFLAGS="$CXXFLAGS -O2"
150 fi;
151
152 AC_SUBST([CFLAGS])
153 AC_SUBST([CXXFLAGS])
154
155 # Configure components.
156 AC_ENABLE_STATIC(yes)
157 AC_ENABLE_SHARED(yes)
158
159 # Create links for header file.
160
161 # Checks for library functions.
162 PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 1.1.0)
163 PKG_CHECK_MODULES(LIBIEC61883, libiec61883 >= 0.1.0)
164
165 PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0)
166
167 AC_SUBST([LIBSIGC_CFLAGS])
168 AC_SUBST([LIBSIGC_LIBS])
169 AC_SUBST([LIBRAW1394_CFLAGS])
170 AC_SUBST([LIBRAW1394_LIBS])
171 AC_SUBST([LIBIEC61883_CFLAGS])
172 AC_SUBST([LIBIEC61883_LIBS])
173 AC_SUBST([ALSA_CFLAGS])
174 AC_SUBST([ALSA_LIBS])
175 LIBAVC_LIBS="-lrom1394 -lavc1394"
176 AC_SUBST([LIBAVC_LIBS])
177
178 AC_CONFIG_FILES([Makefile
179                  libfreebob/Makefile
180                  src/debugmodule/Makefile
181                  src/libfreebobavc/Makefile
182                  src/Makefile
183                  tests/Makefile
184                  libfreebob.pc])
185 AC_OUTPUT
186
187 # Print a summary so that important information isn't missed.
188 AC_MSG_RESULT([
189
190 FreeBob is now configured for $canonical_host_type
191
192   Source directory:     $srcdir
193   Installation prefix:  $prefix
194   C++ compiler:         $CXX $CXXFLAGS
195 ])
Note: See TracBrowser for help on using the browser.