-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.ac
203 lines (177 loc) · 6.44 KB
/
configure.ac
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
AC_PREREQ(2.50)
AC_INIT(camunits/unit.h)
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(camunits, 0.3.0)
AC_CONFIG_MACRO_DIR([m4])
case "$target_os" in
linux*) arch=linux;;
darwin*)
AM_CFLAGS="$AM_CFLAGS -I/usr/X11R6/include -I/opt/local/include"
LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -L/opt/local/lib -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
;;
*) arch=unknown;;
esac
AC_PROG_CC
AM_PATH_GLIB_2_0(,,,gthread gobject gmodule)
AM_PATH_GTK_2_0
AC_CHECK_LIB(GL, glBegin, GL_LIBS='-lGL',
[AC_MSG_ERROR([OpenGL not found, but is required by camunits.])])
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, JPEG_LIBS='-ljpeg',
[AC_MSG_ERROR([libjpeg not found, but is required by camunits.])])
AC_SUBST(GL_LIBS)
AC_SUBST(JPEG_LIBS)
AM_CONDITIONAL(HAVE_GL, test "x$GL_LIBS" != x)
AM_CONDITIONAL(HAVE_JPEG, test "x$JPEG_LIBS" != x)
AC_ARG_WITH(dc1394-plugin,
[AS_HELP_STRING([--with-dc1394-plugin],
[Compile dc1394 plugin if available])],
[], [with_dc1394_plugin=yes])
if test x$with_dc1394_plugin = xyes; then
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES(DC1394, [libdc1394-2 >= 2.0.0],,
[AC_MSG_WARN([libdc1394 not found, firewire camera support will be disabled])])
if test "x$DC1394_LIBS" = x; then
DC1394MSG="Disabled (libdc1394 not found)"
else
DC1394MSG="Enabled"
fi
else
DC1394MSG="Disabled"
fi
AM_CONDITIONAL(HAVE_DC1394, test x$with_dc1394_plugin = xyes -a "x$DC1394_LIBS" != x)
AM_CONDITIONAL([LINUX], [test x$arch = xlinux])
if test x$target_cpu = xi386 -o x$target_cpu = xi486 -o x$target_cpu = xi586 -o x$target_cpu = xi686 -o x$target_cpu = xx86_64; then
AC_DEFINE(HAVE_INTEL, [1], [x86 instructions are available])
have_intel=yes
fi
AM_CONDITIONAL(INTEL, [test x$have_intel = xyes])
dnl compile the V4L 1 plugin?
AC_ARG_WITH(v4l1-plugin,
[AS_HELP_STRING([--with-v4l1-plugin],
[Compile V4L1 plugin])],
[], [with_v4l1_plugin=no])
if test x$with_v4l1_plugin = xyes -a x$arch != xlinux; then
AC_MSG_ERROR([Video 4 Linux 1 plugin requires Linux])
fi
AM_CONDITIONAL([WITH_V4L1_PLUGIN], [test x$with_v4l1_plugin = xyes])
dnl compile the V4L 2 plugin?
AC_ARG_WITH(v4l2-plugin,
[AS_HELP_STRING([--with-v4l2-plugin],
[Compile V4L2 plugin if available])],
[], [with_v4l2_plugin=yes])
AM_CONDITIONAL([WITH_V4L2_PLUGIN],
[test x$with_v4l2_plugin = xyes -a x$arch = xlinux])
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 has been changed since the last release, increment
dnl 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 elements, set AGE to 0.
dnl ---------------------------------------------------------------------------
CAMUNITS_AGE=0
CAMUNITS_REVISION=2
CAMUNITS_CURRENT=6
AC_SUBST(CAMUNITS_AGE)
AC_SUBST(CAMUNITS_REVISION)
AC_SUBST(CAMUNITS_CURRENT)
CAMUNITS_VERSION_INFO=$CAMUNITS_CURRENT:$CAMUNITS_REVISION:$CAMUNITS_AGE
AC_SUBST(CAMUNITS_VERSION_INFO)
CAMUNITS_GTK_AGE=0
CAMUNITS_GTK_REVISION=2
CAMUNITS_GTK_CURRENT=6
AC_SUBST(CAMUNITS_GTK_AGE)
AC_SUBST(CAMUNITS_GTK_REVISION)
AC_SUBST(CAMUNITS_GTK_CURRENT)
CAMUNITS_GTK_VERSION_INFO=$CAMUNITS_GTK_CURRENT:$CAMUNITS_GTK_REVISION:$CAMUNITS_GTK_AGE
AC_SUBST(CAMUNITS_GTK_VERSION_INFO)
AM_DISABLE_STATIC
AM_PROG_LIBTOOL
dnl ---------------------------------------------------------------------------
dnl i18n support
dnl ---------------------------------------------------------------------------
ALL_LINGUAS=""
dnl The gettext domain of the library
GETTEXT_PACKAGE=${PACKAGE}
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The gettext domain for the library])
AC_SUBST(GETTEXT_PACKAGE)
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.14.3)
AM_ICONV()
GTK_DOC_CHECK([1.4])
camunitsplugindir="$libdir/$PACKAGE"
AC_SUBST(camunitsplugindir)
camunitspluginincludedir="$includedir/$PACKAGE/plugins"
AC_SUBST(camunitspluginincludedir)
camunitspixmapdir="$datadir/pixmaps/$PACKAGE"
AC_SUBST(camunitspixmapdir)
camunitsdatadir="$datadir/$PACKAGE"
AC_SUBST(camunitsdatadir)
dnl ---------------------------------------------------------------------------
dnl additional plugin paths can be specified as a configure argument
dnl ---------------------------------------------------------------------------
AC_ARG_WITH(plugin-extra-path,
[AS_HELP_STRING([--with-plugin-extra-path=<path>],
[Colon-separated plugin search path])])
if ! test -z "$with_plugin_extra_path" ; then
extra_plugin_path="$with_plugin_extra_path"
else
extra_plugin_path=""
fi
CAMUNITS_PLUGIN_PATH="$camunitsplugindir:$with_plugin_extra_path"
AC_SUBST(CAMUNITS_PLUGIN_PATH)
dnl ---------------------------------------------------------------------------
dnl C99 support, Warnings, and Large file support
dnl ---------------------------------------------------------------------------
if test "x$GCC" = "xyes"; then
AM_CFLAGS="$AM_CFLAGS -std=gnu99 -Wall -Wmissing-declarations -Wmissing-prototypes -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
LDFLAGS="$LDFLAGS -g -Wall"
AC_SUBST(AM_CFLAGS)
AC_SUBST(LDFLAGS)
fi
AC_OUTPUT([
Makefile
camunits.spec
camunits/Makefile
camunits-gtk/Makefile
camview/Makefile
camlog/Makefile
m4/Makefile
m4macros/Makefile
camunits/camunits.pc
camunits-gtk/camunits-gtk.pc
camunits-gtk/pixmaps/Makefile
po/Makefile.in
plugins/Makefile
plugins/dc1394/Makefile
plugins/v4l/Makefile
plugins/v4l2/Makefile
plugins/convert/Makefile
plugins/other/Makefile
examples/Makefile
examples/basic/Makefile
examples/qt4/Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/libcamunits/Makefile
docs/reference/libcamunits-gtk/Makefile
docs/tutorial/Makefile
docs/plugins/Makefile
docs/plugins/build/Makefile
])
if test x$have_intel = xyes; then
INTELMSG="Enabled"
else
INTELMSG="Disabled"
fi
echo "
Configuration (camunits):
Source code location: ${srcdir}
Compiler: ${CC}
x86 optimizations: ${INTELMSG}
DC1394 plugin: ${DC1394MSG}"
if test x$with_v4l1_plugin = xyes; then
echo " Video4Linux 1 plugin: Enabled"
fi