File: configure.ac

package info (click to toggle)
farsight2 0.0.20-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 6,036 kB
  • ctags: 3,526
  • sloc: ansic: 32,361; sh: 10,728; perl: 2,765; python: 1,621; makefile: 767; xml: 671
file content (419 lines) | stat: -rw-r--r-- 12,143 bytes parent folder | download
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
AC_PREREQ(2.60)

dnl please read gstreamer/docs/random/autotools before changing this file

dnl initialize autoconf
dnl releases only do -Wall, cvs and prerelease does -Werror too
dnl use a three digit version number for releases, and four for cvs/prerelease
AC_INIT(Farsight2, 0.0.20,
    https://bugs.freedesktop.org/enter_bug.cgi?product=Farsight,
    farsight2)

AG_GST_INIT

dnl initialize automake
AM_INIT_AUTOMAKE([-Wno-portability])

dnl define PACKAGE_VERSION_* variables
AS_VERSION

dnl check if this is a release version
AS_NANO(FS2_CVS="no", FS2_CVS="yes")

dnl can autoconf find the source ?
AC_CONFIG_SRCDIR([gst-libs/gst/farsight/fs-candidate.c])

dnl define the output header for config
AM_CONFIG_HEADER([config.h])

dnl sets host_* variables
AC_CANONICAL_HOST

dnl use pretty build output with automake >= 1.11
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
  [AM_DEFAULT_VERBOSITY=1
   AC_SUBST(AM_DEFAULT_VERBOSITY)])

dnl our libraries and install dirs use major.minor as a version
FS2_MAJORMINOR=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
AC_SUBST(FS2_MAJORMINOR)

GST_MAJORMINOR=0.10
AC_SUBST(GST_MAJORMINOR)
AC_DEFINE_UNQUOTED(GST_MAJORMINOR, "$GST_MAJORMINOR",
  [GStreamer major.minor version])


dnl CURRENT, REVISION, AGE
dnl - library source changed -> increment REVISION
dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
dnl - interfaces added -> increment AGE
dnl - interfaces removed -> AGE = 0
dnl sets FS2_LT_LDFLAGS
AS_LIBTOOL(FS2, 5, 0, 5)

dnl FIXME: this macro doesn't actually work;
dnl the generated libtool script has no support for the listed tags.
dnl So this needs to be fixed first if we want to use this
dnl AS_LIBTOOL_TAGS

AM_PROG_LIBTOOL

dnl *** required versions of GStreamer stuff ***
GST_REQ=0.10.26
GSTPB_REQ=0.10.26

dnl *** autotools stuff ****

dnl allow for different autotools
AS_AUTOTOOLS_ALTERNATE

dnl Add parameters for aclocal
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")

dnl *** check for arguments to configure ***

AG_GST_ARG_DEBUG
AG_GST_ARG_PROFILING
AG_GST_ARG_VALGRIND
AG_GST_ARG_GCOV

AG_GST_ARG_WITH_PKG_CONFIG_PATH
AG_GST_ARG_WITH_PACKAGE_NAME
AG_GST_ARG_WITH_PACKAGE_ORIGIN

dnl let distro override plugin install helper path
AC_ARG_WITH(install-plugins-helper,
  AC_HELP_STRING([--with-install-plugins-helper],
    [specify path of helper script to call to install plugins]),
  [
    case "${withval}" in
      yes) AC_MSG_ERROR(bad value ${withval} for --with-install-plugins-helper) ;;
      no)  AC_MSG_ERROR(bad value ${withval} for --with-install-plugins-helper) ;;
      *)   GST_INSTALL_PLUGINS_HELPER="${withval}" ;;
    esac
  ],
  [
    dnl Default value
    AS_AC_EXPAND(GST_INSTALL_PLUGINS_HELPER,${libexecdir}/gst-install-plugins-helper)
  ]
)
AC_MSG_NOTICE(Using $GST_INSTALL_PLUGINS_HELPER as plugin install helper)
AC_DEFINE_UNQUOTED(GST_INSTALL_PLUGINS_HELPER, "$GST_INSTALL_PLUGINS_HELPER",
    [plugin install helper script])
AC_SUBST(GST_INSTALL_PLUGINS_HELPER)

dnl these are all the gst plug-ins, compilable without additional libs
FS2_PLUGINS_ALL=" \
	fsrtpconference \
	fsmsnconference \
	funnel \
	rtcpfilter \
 	videoanyrate
	"
AC_SUBST(FS2_PLUGINS_ALL)

FS2_PLUGINS_SELECTED=""

AC_ARG_WITH(plugins,
    AC_HELP_STRING([--with-plugins],
      [comma-separated list of plug-ins to compile]),
    [for i in `echo $withval | tr , ' '`; do
        if echo $FS2_PLUGINS_ALL | grep $i > /dev/null
        then
            FS2_PLUGINS_SELECTED="$FS2_PLUGINS_SELECTED $i"
        else
            echo "plug-in $i not recognized, ignoring..."
        fi
    done],
    [FS2_PLUGINS_SELECTED=$FS2_PLUGINS_ALL])

AC_SUBST(FS2_PLUGINS_SELECTED)

dnl *** path for our local plugins ***


dnl these are all the transmitter plug-ins
FS2_TRANSMITTER_PLUGINS_ALL=" \
	rawudp \
	multicast \
	nice
	"
AC_SUBST(FS2_TRANSMITTER_PLUGINS_ALL)

FS2_TRANSMITTER_PLUGINS_SELECTED=""

TRANSMITTERS_DEFAULT=yes

AC_ARG_WITH(transmitter-plugins,
    AC_HELP_STRING([--with-transmitter-plugins],
      [comma-separated list of plug-ins to compile]),
    [for i in `echo $withval | tr , ' '`; do
        if echo $FS2_TRANSMITTER_PLUGINS_ALL | grep $i > /dev/null
        then
            FS2_TRANSMITTER_PLUGINS_SELECTED="$FS2_TRANSMITTER_PLUGINS_SELECTED $i"
        else
            echo "plug-in $i not recognized, ignoring..."
        fi
    done
    TRANSMITTERS_DEFAULT=no],
    [FS2_TRANSMITTER_PLUGINS_SELECTED=$FS2_TRANSMITTER_PLUGINS_ALL])


NICE_REQUIRED=0.0.9

PKG_CHECK_MODULES(NICE, \
       nice >= $NICE_REQUIRED,, AC_MSG_ERROR([Need libnice >= $NICE_REQUIRED]))
AC_SUBST(NICE_CFLAGS)
AC_SUBST(NICE_LIBS)

AC_SUBST(FS2_TRANSMITTER_PLUGINS_SELECTED)

dnl set the plugindir where plugins should be installed
AS_AC_EXPAND(FS2_PLUGIN_PATH, ${libdir}/farsight2-$FS2_MAJORMINOR)
AC_SUBST(FS2_PLUGIN_PATH)
AC_DEFINE_UNQUOTED(FS2_PLUGIN_PATH, "${FS2_PLUGIN_PATH}", [The path were plugins are installed and search by default])


dnl *** checks for platform ***

dnl * hardware/architecture *

AG_GST_ARCH

dnl *** checks for programs ***

dnl find a compiler
AC_PROG_CC

AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")

dnl check for documentation tools
GTK_DOC_CHECK([1.8])
AM_PATH_PYTHON([2.4])
LT_AC_PROG_SED
AG_GST_PLUGIN_DOCS([1.8],[2.1])
AC_SUBST(SED)

dnl Make automake happy with per-target flags
AM_PROG_CC_C_O

dnl *** checks for libraries ***

dnl For interactive UNIX (a Sun thing)
dnl FIXME: this adds -lcposix to LIBS, but I doubt we use LIBS
AC_ISC_POSIX

dnl *** checks for header files ***

dnl check if we have ANSI C header files
AC_HEADER_STDC

dnl used in gst/ffmpegcolorspace/mem.c
dnl FIXME: could be fixed by redefining av_malloc and av_free to GLib's
AC_CHECK_HEADERS([malloc.h])

dnl *** checks for types/defines ***

dnl *** checks for structures ***

AC_CHECK_MEMBER([struct ip_mreqn.imr_ifindex],
	        [AC_DEFINE([HAVE_IP_MREQN], [1], [Have the struct ip_mreqn])],
		[],
		[
#include <sys/socket.h>
#include <netinet/in.h>
])


dnl *** checks for compiler characteristics ***

dnl *** checks for library functions ***

dnl *** checks for dependency libraries ***

dnl GLib is required
AG_GST_GLIB_CHECK([2.14])

dnl checks for gstreamer
dnl uninstalled is selected preferentially -- see pkg-config(1)
AG_GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ])
AG_GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ])
AG_GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
AG_GST_CHECK_GST_PLUGINS_BASE($GST_MAJORMINOR, [$GSTPB_REQ])
AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")

dnl Check for documentation xrefs
GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
FS2_PREFIX="`$PKG_CONFIG --variable=prefix farsight2-$FS2_MAJORMINOR`"
AC_SUBST(GLIB_PREFIX)
AC_SUBST(FS2_PREFIX)

dnl *** set variables based on configure arguments ***

dnl set license and copyright notice
FS2_LICENSE="LGPL"
AC_DEFINE_UNQUOTED(FS2_LICENSE, "$FS2_LICENSE", [Farsight2 license])
AC_SUBST(FS2_LICENSE)

dnl set location of plugin directory
AG_GST_SET_PLUGINDIR

dnl define an ERROR_CFLAGS Makefile variable
AG_GST_SET_ERROR_CFLAGS($FS2_CVS)

dnl define correct level for debugging messages
AG_GST_SET_LEVEL_DEFAULT($FS2_CVS)

AC_CHECK_FUNCS(getifaddrs)

dnl *** finalize CFLAGS, LDFLAGS, LIBS

dnl Overview:
dnl FS2_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
dnl GST_*:              flags shared by built objects to link against GStreamer
dnl FS2_INTERNAL_CFLAGS: to link internally against the farsight libs
dnl                          (compare to other modules) or for i18n
dnl FS2_ALL_LDFLAGS:    linker flags shared by all
dnl FS2_LIB_LDFLAGS:    additional linker flags for all libaries
dnl FS2_LT_LDFLAGS:     library versioning of our libraries
dnl FS2_PLUGIN_LDFLAGS: flags to be used for all plugins

dnl FS2_OPTION_CFLAGS
if test "x$USE_DEBUG" = xyes; then
   PROFILE_CFLAGS="-g"
fi
AC_SUBST(PROFILE_CFLAGS)

dnl every flag in FS2_OPTION_CFLAGS can be overridden at make time
FS2_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS)"
AC_SUBST(FS2_OPTION_CFLAGS)

dnl our libraries need to be versioned correctly
AC_SUBST(FS2_LT_LDFLAGS)

dnl FS2_INTERNAL_CFLAGS
dnl prefer internal headers to already installed ones
dnl also add builddir include for enumtypes and marshal
FS2_INTERNAL_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs"
AC_SUBST(FS2_INTERNAL_CFLAGS)

dnl FIXME: do we want to rename to GST_ALL_* ?
dnl add FS2_OPTION_CFLAGS, but overridable
FS2_CFLAGS="$GST_CFLAGS \$(FS2_OPTION_CFLAGS)"
AC_SUBST(FS2_CFLAGS)

dnl add GCOV libs because libtool strips -fprofile-arcs -ftest-coverage
FS2_LIBS="$GST_LIBS \$(GCOV_LIBS)"
AC_SUBST(FS2_LIBS)

dnl LDFLAGS really should only contain flags, not libs - they get added before
dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
FS2_ALL_LDFLAGS="-no-undefined"
AC_SUBST(FS2_ALL_LDFLAGS)

dnl FS2_LIB_LDFLAGS
dnl linker flags shared by all libraries
dnl LDFLAGS modifier defining exported symbols from built libraries
FS2_LIB_LDFLAGS="-export-symbols-regex ^fs_.*"
AC_SUBST(FS2_LIB_LDFLAGS)

dnl this really should only contain flags, not libs - they get added before
dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
FS2_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*fs_init_plugin\$\$' $FS2_ALL_LDFLAGS"
AC_SUBST(FS2_PLUGIN_LDFLAGS)

dnl this really should only contain flags, not libs - they get added before
dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' $FS2_ALL_LDFLAGS"
AC_SUBST(GST_PLUGIN_LDFLAGS)


AC_ARG_ENABLE([python],
	AC_HELP_STRING([--disable-python], [Disable Python bindings]),
	[case "${enableval}" in
	    yes) WANT_PYTHON=yes ;;
	    no)  WANT_PYTHON=no ;;
	    *) AC_MSG_ERROR(bad value ${enableval} for --enable-python) ;;
        esac],
	WANT_PYTHON=yes)
if test "x$WANT_PYTHON" = "xyes"; then
   AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
   PKG_CHECK_MODULES(PYFARSIGHT, [ pygobject-2.0 >= 2.12.0
				   gst-python-0.10 >= 0.10.10] )
   PKG_CHECK_MODULES(PYCODEGEN, [ pygobject-2.0 >= 2.16.0 ],
     PYCODEGEN=pygobject-codegen-2.0,
     PKG_CHECK_MODULES(PYCODEGEN, [ pygtk-2.0 >= 2.10 ],
       PYCODEGEN=pygtk-codegen-2.0,
       AC_MSG_ERROR([You need pygobject 2.16+ or pygtk for the codegen])))
fi
AC_SUBST(PYCODEGEN)
AM_CONDITIONAL(WANT_PYTHON, test "x$WANT_PYTHON" = "xyes")

AC_ARG_ENABLE([gupnp],
	AC_HELP_STRING([--disable-gupnp], [Disable GUPnP IGD support]),
	[case "${enableval}" in
	    yes) WANT_GUPNP=yes ;;
	    no)  WANT_GUPNP=no ;;
	    *) AC_MSG_ERROR(bad value ${enableval} for --enable-gupnp) ;;
        esac],
	WANT_GUPNP=test)

HAVE_GUPNP=no
if test "x$WANT_GUPNP" != "xno"; then
   PKG_CHECK_MODULES(GUPNP, [ gupnp-igd-1.0 ],
    [ HAVE_GUPNP=yes ],
    [ HAVE_GUPNP=no ])
fi
if test "x$WANT_GUPNP" = "xyes" && test "x$HAVE_GUPNP" = "xno"; then
   AC_ERROR([Requested GUPnP IGD, but it is not available])
fi

if test "x$HAVE_GUPNP" = "xyes"; then
   AC_DEFINE(HAVE_GUPNP,,[Have the GUPnP IGD library])

   PKG_CHECK_MODULES(GUPNP_013, gupnp-1.0 >= 0.13,
	 [AC_DEFINE([HAVE_GUPNP_013], [1], [Have GUPnP 0.13 or higher])],
	 [true])
fi

dnl *** output files ***

AC_CONFIG_FILES(
Makefile
farsight2.pc
common/Makefile
common/m4/Makefile
common-modified/Makefile
gst/Makefile
gst/fsrtpconference/Makefile
gst/fsmsnconference/Makefile
gst/funnel/Makefile
gst/rtcpfilter/Makefile
gst/videoanyrate/Makefile
gst-libs/Makefile
gst-libs/gst/Makefile
gst-libs/gst/farsight/Makefile
transmitters/Makefile
transmitters/rawudp/Makefile
transmitters/multicast/Makefile
transmitters/nice/Makefile
dnl pkgconfig/Makefile
dnl pkgconfig/farsight2.pc
dnl pkgconfig/farsight2-uninstalled.pc
tests/Makefile
tests/check/Makefile
tests/rtp/Makefile
examples/Makefile
examples/gui/Makefile
examples/commandline/Makefile
docs/Makefile
docs/libs/Makefile
docs/plugins/Makefile
docs/version.entities
python/Makefile
m4/Makefile
dnl docs/plugins/Makefile
)
AC_OUTPUT