1 |
# configure.ac - Configure script for FreeBob. |
---|
2 |
# Copyright (C) 2004 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 |
AC_INIT(freebob, 0.1, <freebob-devel@lists.sourceforge.net>) |
---|
23 |
AM_INIT_AUTOMAKE |
---|
24 |
AM_MAINTAINER_MODE |
---|
25 |
AC_CONFIG_SRCDIR([src/main.cpp]) |
---|
26 |
AC_CONFIG_HEADER([config.h]) |
---|
27 |
AC_GNU_SOURCE |
---|
28 |
AC_LANG(C++) |
---|
29 |
|
---|
30 |
maintainer_mode=${enable_maintainer_mode-no} |
---|
31 |
|
---|
32 |
# Checks for programs. |
---|
33 |
AC_PROG_CC |
---|
34 |
AC_PROG_CXX |
---|
35 |
AM_PROG_AS |
---|
36 |
AC_PROG_RANLIB |
---|
37 |
AC_CHECK_TOOL([AR], [ar], :) |
---|
38 |
AC_CHECK_TOOL([NM], [nm], :) |
---|
39 |
AC_PATH_PROG([SED], [sed], :) |
---|
40 |
AC_PATH_PROG([SORT], [sort], :) |
---|
41 |
|
---|
42 |
# Required for building the documentation |
---|
43 |
|
---|
44 |
# Checks for libraries. |
---|
45 |
AC_CHECK_LIB(raw1394, raw1394_new_handle, , |
---|
46 |
[AC_MSG_ERROR([Unable to link with libraw1394. Check that you have libraw1394 installed])]) |
---|
47 |
|
---|
48 |
AC_CHECK_LIB(avc1394, avc1394_vcr_record, , |
---|
49 |
[AC_MSG_ERROR([Unable to link with libavc1394. Check that you have libavc1394 installed and that the version is 0.4.1 or newer])]) |
---|
50 |
|
---|
51 |
AC_CHECK_LIB(rom1394, rom1394_get_node_type, , |
---|
52 |
[AC_MSG_ERROR([Unable to link with librom1394. Check that your have librom1394 installed (usually part of libavc1394) and that the version is 0.4.1 or newer])]) |
---|
53 |
|
---|
54 |
AC_CHECK_LIB(pthread, pthread_create,, |
---|
55 |
[ |
---|
56 |
AC_ERROR(You need the pthread library to compile freebob) |
---|
57 |
]) |
---|
58 |
|
---|
59 |
# Checks for header files. |
---|
60 |
AC_CHECK_HEADERS([libraw1394/raw1394.h], , |
---|
61 |
[AC_MSG_ERROR([raw1394.h not found install libraw1394-devel]) |
---|
62 |
]) |
---|
63 |
|
---|
64 |
AC_CHECK_HEADER([libavc1394/avc1394.h], , |
---|
65 |
[AC_MSG_ERROR([avc1394.h not found, install libavc1394-devel]) |
---|
66 |
]) |
---|
67 |
AC_CHECK_HEADER([libavc1394/rom1394.h], , |
---|
68 |
[AC_MSG_ERROR([rom1394.h not found, install libavc1394-devel]) |
---|
69 |
]) |
---|
70 |
AC_CHECK_HEADER(execinfo.h, [AC_DEFINE(HAVE_EXECINFO_H, 1, Wheter or not execinfo.h is present) |
---|
71 |
EXTRA_LIBS="$EXTRA_LIBS -rdynamic"]) |
---|
72 |
|
---|
73 |
# Checks for typedefs, structures, and compiler characteristics. |
---|
74 |
AC_CANONICAL_HOST |
---|
75 |
AC_C_CONST |
---|
76 |
AC_C_VOLATILE |
---|
77 |
CFLAGS="$CFLAGS -Wall -DDEBUG" # XXX DEBUG should not always be set |
---|
78 |
CXXFLAGS="$CXXFLAGS -Wall -DDEBUG" # XXX DEBUG should not always be set |
---|
79 |
|
---|
80 |
AC_SUBST([CFLAGS]) |
---|
81 |
AC_SUBST([CXXFLAGS]) |
---|
82 |
|
---|
83 |
# Configure components. |
---|
84 |
|
---|
85 |
# Create links for header file. |
---|
86 |
|
---|
87 |
# Checks for library functions. |
---|
88 |
PKG_CHECK_MODULES(LIBRAW1394, libraw1394 >= 1.1.0) |
---|
89 |
PKG_CHECK_MODULES(LIBIEC61883, libiec61883 >= 0.1.0) |
---|
90 |
|
---|
91 |
AC_SUBST([LIBSIGC_CFLAGS]) |
---|
92 |
AC_SUBST([LIBSIGC_LIBS]) |
---|
93 |
AC_SUBST([LIBRAW1394_CFLAGS]) |
---|
94 |
AC_SUBST([LIBRAW1394_LIBS]) |
---|
95 |
AC_SUBST([LIBIEC61883_CFLAGS]) |
---|
96 |
AC_SUBST([LIBIEC61883_LIBS]) |
---|
97 |
LIBAVC_LIBS="-lrom1394 -lavc1394" |
---|
98 |
AC_SUBST([LIBAVC_LIBS]) |
---|
99 |
|
---|
100 |
AC_CONFIG_FILES([Makefile |
---|
101 |
src/Makefile]) |
---|
102 |
AC_OUTPUT |
---|
103 |
|
---|
104 |
# Print a summary so that important information isn't missed. |
---|
105 |
AC_MSG_RESULT([ |
---|
106 |
|
---|
107 |
FreeBob is now configured for $canonical_host_type |
---|
108 |
|
---|
109 |
Source directory: $srcdir |
---|
110 |
Installation prefix: $prefix |
---|
111 |
C++ compiler: $CXX $XTRA_CXXFLAGS $WARN_CXXFLAGS $CXXFLAGS |
---|
112 |
]) |
---|