forked from robhemsley/libdc1394
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
executable file
·231 lines (199 loc) · 6.69 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# process this file with autoconf to get a configure script
AC_PREREQ([2.6.0])
AC_INIT([libdc1394],[2.2.1],[[email protected]])
AC_CONFIG_SRCDIR([dc1394/control.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_SYSTEM
case "$host" in
*-*-cygwin* | *-*-mingw*)
AC_LIBTOOL_WIN32_DLL
;;
esac
#
DX_HTML_FEATURE(OFF)
DX_CHM_FEATURE(OFF)
DX_CHI_FEATURE(OFF)
DX_MAN_FEATURE(OFF)
DX_RTF_FEATURE(OFF)
DX_XML_FEATURE(OFF)
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
#
DX_INIT_DOXYGEN([libdc1394], [Doxyfile.in])
#
AM_INIT_AUTOMAKE([--warnings=all 1.9.6])
AC_CONFIG_HEADERS([config.h])
AC_PROG_CC
AC_PROG_LIBTOOL
AM_PROG_CC_C_O
PKG_PROG_PKG_CONFIG
# check if the 'restrict' prefix is supported
AC_C_RESTRICT
AC_CHECK_LIB(m, pow, [ LIBS="-lm $LIBS" ], [])
PKG_CHECK_MODULES(LIBUSB, [libusb-1.0],
[AC_DEFINE(HAVE_LIBUSB,[],[Defined if libusb is present])],
[AC_MSG_WARN([libusb-1.0 not found])])
MIN_SDL_VERSION=1.2.4
AH_TEMPLATE(HAVE_LIBSDL, [SDL library])
AM_PATH_SDL($MIN_SDL_VERSION, [AC_DEFINE(HAVE_LIBSDL) HAVE_LIBSDL="yes"])
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
case "$host" in
*-*-linux*)
have_linux=true
AC_DEFINE(HAVE_LINUX,[],[Defined if compiled for Linux])
# Check for the new version of libraw1394 first since they might have both
# installed and we want to use the newest version
AC_CHECK_LIB(raw1394, raw1394_channel_modify,
[AC_DEFINE(HAVE_LIBRAW1394,[],[Defined if libraw1394 is present]) libraw1394=true],
[AC_MSG_WARN(libraw1394 not found or too old. Please upgrade to 1.2.0 or a more recent version.)])
;;
*-*-darwin*)
AC_CHECK_LIB(IOKit, IOMasterPort,
[AC_DEFINE(HAVE_MACOSX,[],[Defined if IOKitLib is present]) have_macosx=true],
[AC_MSG_ERROR(IOKitLib not found.)])
platform_LDFLAGS="-framework CoreServices -framework CoreFoundation -framework Carbon"
AC_SUBST(platform_LDFLAGS)
;;
*-*-cygwin* | *-*-mingw*)
have_windows=true
AC_DEFINE(HAVE_WINDOWS,[],[Defined if compiled for Windows])
AC_CHECK_LIB(1394camera, GetCmdrVersion,
[AC_DEFINE(HAVE_LIB1394CAMERA,[],[Defined if lib1394camera present]) lib1394camera=true],
[AC_MSG_ERROR(lib1394camera not found or too old. Please upgrade to 6.4.5 or a more recent version.)])
platform_LDFLAGS="-Wl,--export-all -no-undefined -l1394camera -lsetupapi -lws2_32"
AC_SUBST(platform_LDFLAGS)
;;
esac
AH_TEMPLATE(HAVE_OPENGL, [OpenGL library])
case "$host" in
*-*-linux* | *-*-darwin*)
AC_CHECK_LIB(GL, main, [AC_DEFINE(HAVE_OPENGL) have_opengl="yes"])
;;
*-*-cygwin* | *-*-mingw*)
AC_CHECK_LIB(opengl32, main, [AC_DEFINE(HAVE_OPENGL) have_opengl="yes"])
;;
esac
AM_CONDITIONAL(HAVE_LINUX, test x$have_linux = xtrue)
AM_CONDITIONAL(HAVE_MACOSX, test x$have_macosx = xtrue)
AM_CONDITIONAL(HAVE_WINDOWS, test x$have_windows = xtrue)
AM_CONDITIONAL(HAVE_LIBRAW1394, test x$libraw1394 = xtrue)
AM_CONDITIONAL(HAVE_LIBUSB, test "x$LIBUSB_LIBS" != "x")
AM_CONDITIONAL(HAVE_LIBSDL, test "x$SDL_LIBS" != "x")
AM_CONDITIONAL(HAVE_OPENGL, test "x$have_opengl" != "x")
AC_CHECK_HEADER([linux/videodev.h], [have_videodev=true])
AM_CONDITIONAL(HAVE_VIDEODEV, test x$have_videodev = xtrue)
AC_ARG_ENABLE([examples], [AS_HELP_STRING([--disable-examples], [don't build example programs])], [build_examples=$enableval], [build_examples=true])
AM_CONDITIONAL(MAKE_EXAMPLES, test x$build_examples = xtrue)
# check for Xv extensions (necessary for examples/dc1394_multiview)
# imported from Coriander
AC_DEFUN([AC_CHECK_XV],[
AC_SUBST(XV_CFLAGS)
AC_SUBST(XV_LIBS)
AC_MSG_CHECKING(for Xv extensions)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <X11/Xlib.h>
#include <X11/extensions/Xvlib.h>]], [[
int main(void) { (void) XvGetPortAttribute(0, 0, 0, 0); return 0; }
]])],[xv=yes],[xv=no])
AC_MSG_RESULT($xv)
if test x$xv = xyes; then
XV_LIBS="-lXv -lXext"
XV_CFLAGS=""
fi
AM_CONDITIONAL(HAVE_XV, test x$xv = xyes)
])
AC_CHECK_XV
AC_HEADER_STDC
AC_CHECK_HEADERS(stdint.h fcntl.h sys/ioctl.h unistd.h sys/mman.h netinet/in.h)
AC_PATH_XTRA
AC_TYPE_SIZE_T
AC_FUNC_MMAP
dnl ---------------------------------------------------------------------------
dnl When making a release:
dnl 1. If the library source code has changed at all since the last release,
dnl then increment REVISION.
dnl 2. If the interface (ABI) has been modified since the last release,
dnl increment CURRENT, and set REVISION to 0.
dnl 3. If the interface changes consist solely of additions, increment AGE.
dnl 4. If the interface has removed or changed elements, set AGE to 0.
dnl ---------------------------------------------------------------------------
lt_current=23
lt_revision=8
lt_age=1
AC_SUBST(lt_current)
AC_SUBST(lt_revision)
AC_SUBST(lt_age)
pkgincludedir='$(includedir)/dc1394'
AC_SUBST(pkgincludedir)
dnl AX_CFLAGS_WARN_ALL(CFLAGS)
CFLAGS="-Wall -Wunused -std=gnu99 $CFLAGS"
dnl for pedantic compilation, try to add "-pedantic" to the above string
AC_CONFIG_FILES([ \
Makefile \
libdc1394-2.pc \
dc1394/Makefile \
dc1394/linux/Makefile \
dc1394/juju/Makefile \
dc1394/macosx/Makefile \
dc1394/windows/Makefile \
dc1394/usb/Makefile \
dc1394/vendor/Makefile \
examples/Makefile \
])
AC_OUTPUT
LINUXMSG="Disabled (Linux not detected)"
RAW1394MSG="Disabled (libraw1394 not found)"
MACOSXMSG="Disabled (Mac OS not detected)"
WINDOWSMSG="Disabled (Windows not detected)"
USBMSG="Disabled (libusb-1.0 not found)"
if test x$have_linux = xtrue; then
if test x$libraw1394 = xtrue; then
RAW1394MSG="Enabled"
fi
LINUXMSG="Enabled"
fi
if test x$have_macosx = xtrue; then
MACOSXMSG="Enabled"
fi
if test x$have_windows = xtrue; then
WINDOWSMSG="Enabled"
fi
if test "x$LIBUSB_LIBS" != "x"; then
USBMSG="Enabled"
fi
EXAMPLESMSG="No"
SDLEXAMPLESMSG="No"
XVEXAMPLESMSG="No"
VIDEXAMPLESMSG="No"
if test x$build_examples = xtrue; then
EXAMPLESMSG="Yes"
if test x$have_opengl = xyes; then
if test "x$SDL_LIBS" != "x"; then
SDLEXAMPLESMSG="Yes"
fi
fi
if test x$xv = xyes; then
XVEXAMPLESMSG="Yes"
fi
if test x$have_videodev = xtrue; then
VIDEXAMPLESMSG="Yes"
fi
fi
echo "
Configuration (libdc1394):
Linux support: ${LINUXMSG}"
if test "x$LINUXMSG" = "xEnabled"; then
echo " Legacy drivers (libraw1394): ${RAW1394MSG}"
fi
echo " Mac OS X support: ${MACOSXMSG}
Windows support: ${WINDOWSMSG}
IIDC-over-USB support: ${USBMSG}
Build examples: ${EXAMPLESMSG}"
if test "x$EXAMPLESMSG" = xYes; then
echo " Build SDL/OpenGL examples: ${SDLEXAMPLESMSG}
Build XV examples: ${XVEXAMPLESMSG}
Build V4L examples: ${VIDEXAMPLESMSG}"
fi
dnl extra newline:
echo ""