configure: Make -Bsymbolic check work with clang.
[platform/upstream/gstreamer.git] / configure.ac
1 AC_PREREQ([2.69])
2
3 dnl initialize autoconf
4 dnl when going to/from release please set the nano (fourth number) right !
5 dnl releases only do Wall, git and prerelease does Werror too
6 dnl
7 AC_INIT([GStreamer],[1.7.0.1],[http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer],[gstreamer])
8 AG_GST_INIT
9
10 dnl initialize automake (we require GNU make)
11 AM_INIT_AUTOMAKE([-Wno-portability 1.14 no-dist-gzip dist-xz tar-ustar subdir-objects])
12
13 dnl define PACKAGE_VERSION_* variables
14 AS_VERSION
15
16 dnl check if this is a release version
17 AS_NANO(GST_GIT="no", GST_GIT="yes")
18
19 dnl can autoconf find the source ?
20 AC_CONFIG_SRCDIR([gst/gst.c])
21
22 dnl define the output header for config
23 AC_CONFIG_HEADERS([config.h])
24
25 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
26 AM_MAINTAINER_MODE([enable])
27
28 dnl sets host_* variables
29 AC_CANONICAL_HOST
30
31 dnl use pretty build output by default
32 AM_SILENT_RULES([yes])
33
34 dnl GStreamer versioning, this is mostly informational
35 GST_VERSION_MAJOR=$PACKAGE_VERSION_MAJOR
36 GST_VERSION_MINOR=$PACKAGE_VERSION_MINOR
37 GST_VERSION_MICRO=$PACKAGE_VERSION_MICRO
38 GST_VERSION_NANO=$PACKAGE_VERSION_NANO
39 AC_SUBST(GST_VERSION_MAJOR)
40 AC_SUBST(GST_VERSION_MINOR)
41 AC_SUBST(GST_VERSION_MICRO)
42 AC_SUBST(GST_VERSION_NANO)
43
44 dnl our libraries and install dirs use GST_API_VERSION in the filename
45 dnl to allow side-by-side installation of different API versions
46 GST_API_VERSION=1.0
47 AC_SUBST(GST_API_VERSION)
48 AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION",
49   [GStreamer API Version])
50
51 dnl CURRENT, REVISION, AGE
52 dnl - library source changed -> increment REVISION
53 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
54 dnl - interfaces added -> increment AGE
55 dnl - interfaces removed -> AGE = 0
56 dnl
57 dnl Keep CURRENT as MINOR * 100 + MICRO
58 dnl Ex : 1.0.0 => 0
59 dnl      1.0.3 => 3
60 dnl      1.1.0 => 100
61 dnl      1.2.5 => 205
62 dnl      1.10.9 (who knows) => 1009
63 dnl
64 dnl sets GST_LT_LDFLAGS
65 AS_LIBTOOL(GST, 700, 0, 700)
66
67 dnl *** autotools stuff ****
68
69 dnl allow for different autotools
70 AS_AUTOTOOLS_ALTERNATE
71
72 dnl Add parameters for aclocal (keep in sync with Makefile.am)
73 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
74
75 dnl set up gettext
76 dnl the version check needs to stay here because autopoint greps for it
77 AM_GNU_GETTEXT_VERSION([0.17])
78 AM_GNU_GETTEXT([external])
79 AG_GST_GETTEXT([gstreamer-$GST_API_VERSION])
80
81 dnl *** check for arguments to configure ***
82
83 AG_GST_ARG_DISABLE_FATAL_WARNINGS
84 AG_GST_ARG_ENABLE_EXTRA_CHECKS
85
86 dnl subsystems - can influence other decisions so needs to be high up
87 dnl we need to AM_CONDITIONAL them here for automake 1.6.x compatibility
88 AG_GST_CHECK_SUBSYSTEM_DISABLE(GST_DEBUG,[debugging subsystem])
89 AM_CONDITIONAL(GST_DISABLE_GST_DEBUG, test "x$GST_DISABLE_GST_DEBUG" = "xyes")
90 AG_GST_CHECK_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
91 AM_CONDITIONAL(GST_DISABLE_PARSE, test "x$GST_DISABLE_PARSE" = "xyes")
92 if test "x$GST_DISABLE_PARSE" = xyes; then
93   AC_DEFINE(GST_DISABLE_PARSE, 1,
94     [Define if pipeline parsing code is disabled])
95 fi
96 AG_GST_CHECK_SUBSYSTEM_DISABLE(OPTION_PARSING,[option parsing when gst_init])
97 AM_CONDITIONAL(GST_DISABLE_OPTION_PARSING, test "x$GST_DISABLE_OPTION_PARSING" = "xyes")
98 if test "x$GST_DISABLE_OPTION_PARSING" = xyes; then
99   AC_DEFINE(GST_DISABLE_OPTION_PARSING, 1,
100     [Define if option parsing is disabled])
101 fi
102 AG_GST_CHECK_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
103 AM_CONDITIONAL(GST_DISABLE_TRACE, test "x$GST_DISABLE_TRACE" = "xyes")
104 AG_GST_CHECK_SUBSYSTEM_DISABLE(ALLOC_TRACE,[allocation tracing])
105 AM_CONDITIONAL(GST_DISABLE_ALLOC_TRACE, test "x$GST_DISABLE_ALLOC_TRACE" = "xyes")
106 AG_GST_CHECK_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
107 AM_CONDITIONAL(GST_DISABLE_REGISTRY, test "x$GST_DISABLE_REGISTRY" = "xyes")
108 dnl define a substitution to use in docs/gst/gstreamer.types
109 if test "x$GST_DISABLE_REGISTRY" = "xyes"
110 then
111   GST_REGISTRY_DOC_TYPES="%"
112 else
113   GST_REGISTRY_DOC_TYPES=
114 fi
115 AC_SUBST(GST_REGISTRY_DOC_TYPES)
116 AG_GST_CHECK_SUBSYSTEM_DISABLE(PLUGIN,[plugin])
117 AM_CONDITIONAL(GST_DISABLE_PLUGIN, test "x$GST_DISABLE_PLUGIN" = "xyes")
118
119 AG_GST_ARG_DEBUG
120 AG_GST_ARG_PROFILING
121 AG_GST_ARG_VALGRIND
122 AG_GST_ARG_GCOV
123
124 AG_GST_ARG_EXAMPLES
125
126 AG_GST_ARG_WITH_PKG_CONFIG_PATH
127 AG_GST_ARG_WITH_PACKAGE_NAME
128 AG_GST_ARG_WITH_PACKAGE_ORIGIN
129
130 AG_GST_PKG_CONFIG_PATH
131
132 AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
133   ["${srcdir}/gstreamer.doap"],
134   [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
135
136 dnl check for bash completion
137 AC_ARG_WITH([bash-completion-dir],
138     AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
139         [Install the bash auto-completion script in this directory. @<:@default=yes@:>@]),
140     [],
141     [with_bash_completion_dir=yes])
142
143 if test "x$with_bash_completion_dir" = "xyes"
144 then
145     extra_args=
146
147     if test "x$prefix" != "xNONE"
148     then
149         extra_args="--define-variable=prefix=\"$prefix\""
150     fi
151
152     PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],
153         [BASH_COMPLETION_DIR="`eval pkg-config $extra_args --variable=completionsdir bash-completion`"],
154         [BASH_COMPLETION_DIR="$datadir/bash-completion/completions"])
155     PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],
156         [BASH_HELPERS_DIR="`eval pkg-config $extra_args --variable=helpersdir bash-completion`"],
157         [BASH_HELPERS_DIR="$datadir/bash-completion/helpers"])
158 else
159     BASH_COMPLETION_DIR="$with_bash_completion_dir/completions"
160     BASH_HELPERS_DIR="$with_bash_completion_dir/helpers"
161 fi
162
163 AC_SUBST([BASH_COMPLETION_DIR])
164 AC_SUBST([BASH_HELPERS_DIR])
165 AM_CONDITIONAL([ENABLE_BASH_COMPLETION],[test "x$with_bash_completion_dir" != "xno"])
166
167 dnl build static plugins or not
168 AC_MSG_CHECKING([whether to build static plugins or not])
169 AC_ARG_ENABLE(
170   static-plugins,
171   AC_HELP_STRING(
172     [--enable-static-plugins],
173     [build static plugins @<:@default=no@:>@]),
174   [AS_CASE(
175     [$enableval], [no], [], [yes], [],
176     [AC_MSG_ERROR([bad value "$enableval" for --enable-static-plugins])])],
177   [enable_static_plugins=no])
178 AC_MSG_RESULT([$enable_static_plugins])
179 if test "x$enable_static_plugins" = xyes; then
180   AC_DEFINE(GST_PLUGIN_BUILD_STATIC, 1,
181     [Define if static plugins should be built])
182   GST_PLUGIN_LIBTOOLFLAGS=""
183 else
184   GST_PLUGIN_LIBTOOLFLAGS="--tag=disable-static"
185 fi
186 AC_SUBST(GST_PLUGIN_LIBTOOLFLAGS)
187 AM_CONDITIONAL(GST_PLUGIN_BUILD_STATIC, test "x$enable_static_plugins" = "xyes")
188
189 dnl building of tests
190 AC_ARG_ENABLE(tests,
191   AS_HELP_STRING([--disable-tests],[disable building test apps]),
192   [
193     case "${enableval}" in
194       yes) BUILD_TESTS=yes ;;
195       no)  BUILD_TESTS=no ;;
196       *)   AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
197     esac
198   ],
199 [BUILD_TESTS=yes]) dnl Default value
200 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
201
202 dnl tests known to fail
203 AC_ARG_ENABLE(failing-tests,
204   AS_HELP_STRING([--disable-failing-tests],[disable building tests known to fail]),
205   [
206     case "${enableval}" in
207       yes) BUILD_FAILING_TESTS=yes ;;
208       no)  BUILD_FAILING_TESTS=no ;;
209       *)   AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
210     esac
211   ],
212   [BUILD_FAILING_TESTS=no]) dnl Default value
213 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
214 if test x$BUILD_FAILING_TESTS = xyes; then
215   AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
216 else
217   AC_MSG_WARN([Sissy ! By asking to not build the tests known to fail, you hereby waive your right to customer support.  If you do not agree with this EULA, please press Ctrl-C before the next line is printed.  By allowing the next line to be printed, you expressly acknowledge your acceptance of this EULA.])
218 fi
219
220 dnl building of benchmarks
221 AC_ARG_ENABLE(benchmarks,
222   AS_HELP_STRING([--disable-benchmarks],[disable building benchmarks apps]),
223   [
224     case "${enableval}" in
225       yes) BUILD_BENCHMARKS=yes ;;
226       no)  BUILD_BENCHMARKS=no ;;
227       *)   AC_MSG_ERROR(bad value ${enableval} for --disable-benchmarks) ;;
228     esac
229   ],
230 [BUILD_BENCHMARKS=yes]) dnl Default value
231 AM_CONDITIONAL(BUILD_BENCHMARKS, test "x$BUILD_BENCHMARKS" = "xyes")
232
233 dnl building of tools
234 AC_ARG_ENABLE(tools,
235   AS_HELP_STRING([--disable-tools],[disable building tools]),
236   [
237     case "${enableval}" in
238       yes) BUILD_TOOLS=yes ;;
239       no)  BUILD_TOOLS=no ;;
240       *)   AC_MSG_ERROR(bad value ${enableval} for --disable-tools) ;;
241     esac
242   ],
243 [BUILD_TOOLS=yes]) dnl Default value
244 AM_CONDITIONAL(BUILD_TOOLS, test "x$BUILD_TOOLS" = "xyes")
245
246 dnl poison destroyed objects
247 AC_ARG_ENABLE(poisoning,
248   AS_HELP_STRING([--enable-poisoning],[enable poisoning of deallocated objects]),
249   [
250     case "${enableval}" in
251       yes) USE_POISONING=yes ;;
252       no)  USE_POISONING=no ;;
253       *)   AC_MSG_ERROR(bad value ${enableval} for --enable-poisoning) ;;
254     esac
255   ],
256   [USE_POISONING=no]) dnl Default value
257 if test "x$USE_POISONING" = xyes; then
258   AC_DEFINE(USE_POISONING, 1,
259     [Define if we should poison deallocated memory])
260 fi
261
262 dnl PTP support parts
263 AC_MSG_CHECKING([whether PTP support can be enabled])
264 case "$host_os" in
265   *android*)
266     dnl Can't run on Android because of permissions
267     HAVE_PTP=no
268     ;;
269   mingw*|pw32*|cygwin*)
270     dnl Not ported to Windows yet
271     HAVE_PTP=no
272     ;;
273   darwin*)
274     dnl Can't run on iOS because of permissions
275     AC_CHECK_HEADER(MobileCoreServices/MobileCoreServices.h, HAVE_PTP="no", HAVE_PTP="yes", [-])
276     ;;
277   linux*|darwin*|solaris*|netbsd*|freebsd*|openbsd*|kfreebsd*|dragonfly*|gnu*)
278     HAVE_PTP=yes
279     ;;
280   *)
281     HAVE_PTP=no
282     ;;
283 esac
284 AC_MSG_RESULT([$HAVE_PTP])
285
286 dnl user/group to change to in gst-ptp-helper
287 AC_ARG_WITH([ptp-helper-setuid-user],
288   AS_HELP_STRING([--with-ptp-helper-setuid-user],[User to switch to when installing gst-ptp-helper setuid root]),
289   [
290     if test "x$withval" != "x"
291     then
292       AC_DEFINE_UNQUOTED(HAVE_PTP_HELPER_SETUID_USER, "$withval", [PTP helper setuid user])
293     fi
294   ], []
295 )
296
297 dnl group/group to change to in gst-ptp-helper
298 AC_ARG_WITH([ptp-helper-setuid-group],
299   AS_HELP_STRING([--with-ptp-helper-setuid-group],[Group to switch to when installing gst-ptp-helper setuid root]),
300   [
301     if test "x$withval" != "x"
302     then
303       AC_DEFINE_UNQUOTED(HAVE_PTP_HELPER_SETUID_GROUP, "$withval", [PTP helper setuid group])
304     fi
305   ], []
306 )
307
308 AC_ARG_WITH(
309   ptp-helper-permissions,
310   AC_HELP_STRING(
311     [--with-ptp-helper-permissions],
312     [how to gain PTP permissions (none, setuid-root, capabilities, auto)]),
313     [],
314     [with_ptp_helper_permissions=auto])
315
316 gst_ptp_have_cap=no
317 AG_GST_CHECK_LIBHEADER(CAP, cap,
318                        cap_init, ,
319                        sys/capability.h,
320                        CAP_LIBS="-lcap"
321                        AC_SUBST(CAP_LIBS)
322                        gst_ptp_have_cap=yes)
323
324 AC_PATH_PROG([SETCAP], [setcap], [no], [$PATH:/usr/bin:/bin:/usr/sbin:/sbin])
325
326 if test "x$HAVE_PTP" = "xyes"; then
327 AC_DEFINE(HAVE_PTP, 1, [PTP support available])
328
329 AC_MSG_CHECKING([for SIOCGIFCONF, SIOCGIFFLAGS and SIOCGIFHWADDR])
330 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
331     [[
332         #include <sys/ioctl.h>
333         #include <net/if.h>
334     ]],
335     [[
336         struct ifreq ifr;
337         struct ifconf ifc;
338         ioctl(0, SIOCGIFCONF, &ifc);
339         ioctl(0, SIOCGIFFLAGS, &ifr);
340         ioctl(0, SIOCGIFHWADDR, &ifr);
341         int dummy = ifr.ifr_hwaddr.sa_data[0];
342     ]])], [
343         AC_MSG_RESULT(yes)
344         AC_DEFINE(HAVE_SIOCGIFCONF_SIOCGIFFLAGS_SIOCGIFHWADDR, 1, [SIOCGIFCONF, SIOCGIFFLAGS and SIOCGIFHWADDR is available])
345     ], [
346         AC_MSG_RESULT(no)
347 ])
348
349 AC_MSG_CHECKING([for getifaddrs() and AF_LINK])
350 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
351     [[
352         #include <ifaddrs.h>
353         #include <net/if.h>
354         #include <net/if_dl.h>
355     ]],
356     [[
357         struct ifaddrs *ifaddr;
358         getifaddrs(&ifaddr);
359         int dummy = (ifaddr->ifa_flags & IFF_LOOPBACK) && ifaddr->ifa_addr->sa_family != AF_LINK;
360     ]])], [
361         AC_MSG_RESULT(yes)
362         AC_DEFINE(HAVE_GETIFADDRS_AF_LINK, 1, [getifaddrs() and AF_LINK is available])
363     ], [
364         AC_MSG_RESULT(no)
365     ])
366
367 AC_MSG_CHECKING([how to install gst-ptp-helper])
368 if test "x$with_ptp_helper_permissions" = "xauto"; then
369     if test "x$gst_ptp_have_cap" = "xyes" -a "x$SETCAP" != "xno"; then
370         with_ptp_helper_permissions="capabilities"
371     else
372         with_ptp_helper_permissions="setuid-root"
373     fi
374 fi
375 AC_MSG_RESULT([$with_ptp_helper_permissions])
376
377 case "$with_ptp_helper_permissions" in
378   none)
379     ;;
380   setuid-root)
381      AC_DEFINE(HAVE_PTP_HELPER_SETUID, 1,
382         [Use setuid-root for permissions in PTP helper])
383     ;;
384   capabilities)
385      AC_DEFINE(HAVE_PTP_HELPER_CAPABILITIES, 1,
386         [Use capabilities for permissions in PTP helper])
387     ;;
388   *)
389     AC_MSG_ERROR(Invalid parameter [$with_ptp_helper_permissions])
390     ;;
391 esac
392
393 fi
394
395 AM_CONDITIONAL(HAVE_PTP, test "x$HAVE_PTP" = "xyes")
396 AM_CONDITIONAL(HAVE_PTP_HELPER_SETUID, test "x$with_ptp_helper_permissions" = "xsetuid-root")
397 AM_CONDITIONAL(HAVE_PTP_HELPER_CAPABILITIES, test "x$with_ptp_helper_permissions" = "xcapabilities")
398
399 dnl *** checks for platform ***
400
401 dnl * hardware/architecture *
402
403 dnl common/m4/gst-arch.m4
404 dnl check CPU type
405 AG_GST_ARCH
406 dnl substitution for win32/common/config.h
407 HOST_CPU=$host_cpu
408 AC_SUBST(HOST_CPU)
409
410 dnl common/m4/gst-arch.m4
411 dnl check for unaligned access
412 AG_GST_UNALIGNED_ACCESS
413 dnl create a configure variable for gst/gstconfig.h
414 if test x${as_cv_unaligned_access} = xyes ; then
415   GST_HAVE_UNALIGNED_ACCESS_DEFINE="#define GST_HAVE_UNALIGNED_ACCESS 1"
416 else
417   GST_HAVE_UNALIGNED_ACCESS_DEFINE="#define GST_HAVE_UNALIGNED_ACCESS 0"
418 fi
419 AC_SUBST(GST_HAVE_UNALIGNED_ACCESS_DEFINE)
420
421 dnl check for platform specific settings
422 AG_GST_PLATFORM
423
424 dnl * software *
425
426 dnl check for large file support
427 dnl affected plugins must include config.h
428 AC_SYS_LARGEFILE
429
430 dnl *** checks for programs ***
431
432 dnl find a compiler
433 AC_PROG_CC
434 AC_PROG_CC_STDC
435
436 dnl check if the compiler supports '-c' and '-o' options
437 AM_PROG_CC_C_O
438
439 dnl find an assembler
440 AM_PROG_AS
441
442 dnl determine if c++ is available on this system
443 AC_PROG_CXX
444 dnl CXX may be set to some default even if no c++ compiler is available
445 dnl (thanks autotools!), so just try to compile some c++ code to make sure
446 AC_LANG_PUSH([C++])
447 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ class Foo { int bar; };]], [[]])],[working_cxx=yes],[working_cxx=no])
448 AC_LANG_POP([C++])
449 AC_MSG_NOTICE([working c++ compiler found: $working_cxx])
450 AM_CONDITIONAL(HAVE_CXX, test "x$working_cxx" = "xyes")
451
452 dnl Perl is used in building documentation and in the version checks
453 AC_PATH_PROG(PERL_PATH, perl, no)
454 if test x$PERL_PATH = xno; then
455   AC_MSG_ERROR(Could not find perl)
456 fi
457
458 dnl we require flex and bison for building the parser
459 if test "x$GST_DISABLE_PARSE" != xyes; then
460   AG_GST_BISON_CHECK
461   AG_GST_FLEX_CHECK
462 fi
463
464 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
465 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
466
467 dnl check for gobject-introspection
468 GOBJECT_INTROSPECTION_CHECK([1.31.1])
469
470 dnl check for documentation tools
471 AG_GST_DOCBOOK_CHECK
472 GTK_DOC_CHECK([1.12])
473 AG_GST_PLUGIN_DOCS([1.12])
474
475 dnl *** checks for libraries ***
476
477 dnl check for libm, for sin()
478 LT_LIB_M
479 AC_SUBST(LIBM)
480
481 dnl *** checks for header files ***
482
483 dnl check if we have ANSI C header files
484 AC_HEADER_STDC
485
486 dnl Check for ucontext.h
487 AC_CHECK_HEADERS([ucontext.h], [], [], [AC_INCLUDES_DEFAULT])
488
489 dnl Check for sys/socket.h
490 AC_CHECK_HEADERS([sys/socket.h], [HAVE_SYS_SOCKET_H=yes], [HAVE_SYS_SOCKET_H=no], [AC_INCLUDES_DEFAULT])
491 AM_CONDITIONAL(HAVE_SYS_SOCKET_H, test "x$HAVE_SYS_SOCKET_H" = "xyes")
492
493 dnl check for sys/times.h for tests/examples/adapter/
494 AC_CHECK_HEADERS([sys/times.h], [HAVE_SYS_TIMES_H=yes], [HAVE_SYS_TIME_H=no], [AC_INCLUDES_DEFAULT])
495 AC_CHECK_HEADERS([unistd.h], [HAVE_UNISTD_H=yes], [HAVE_UNISTD_H=no], [AC_INCLUDES_DEFAULT])
496 AM_CONDITIONAL(HAVE_SYS_TIMES_H_AND_UNISTD_H, test "x$HAVE_SYS_TIMES_H" = "xyes" -a "x$HAVE_UNISTD_H" = "xyes")
497
498 dnl Check for process.h for getpid() on win32
499 AC_CHECK_HEADERS([process.h], [], [], [AC_INCLUDES_DEFAULT])
500
501 dnl Check for sys/utsname.h for uname
502 AC_CHECK_HEADERS([sys/utsname.h], [], [], [AC_INCLUDES_DEFAULT])
503
504 dnl Check for stdio_ext.f for __fbufsize
505 AC_CHECK_HEADERS([stdio_ext.h], [], [], [AC_INCLUDES_DEFAULT])
506
507 dnl check for pthreads
508 dnl without arguments AX_PTHREAD() will do AC_DEFINE(HAVE_PTHREAD)
509 dnl which later checks use in their test code
510 AX_PTHREAD()
511 AM_CONDITIONAL(HAVE_PTHREAD, test "x$ax_pthread_ok" = "xyes")
512
513 dnl check for sys/prctl for setting thread name on Linux
514 AC_CHECK_HEADERS([sys/prctl.h], [], [], [AC_INCLUDES_DEFAULT])
515
516 dnl check for pthread_setname_np(const char*)
517 dnl which is present on OS X 10.6, iOS 3.2 and above
518 AC_MSG_CHECKING(for pthread_setname_np(const char*))
519 AC_LINK_IFELSE(
520     [AC_LANG_PROGRAM(
521         [#include <pthread.h>],
522         [pthread_setname_np("example")])],
523     [AC_MSG_RESULT(yes)
524      AC_DEFINE(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID,1,
525         [Have function pthread_setname_np(const char*)])],
526     [AC_MSG_RESULT(no)])
527
528 dnl check for sys/uio.h for writev()
529 AC_CHECK_HEADERS([sys/uio.h], [], [], [AC_INCLUDES_DEFAULT])
530
531 dnl Check for valgrind.h
532 dnl separate from HAVE_VALGRIND because you can have the program, but not
533 dnl the dev package
534 AC_CHECK_HEADERS([valgrind/valgrind.h], [], [], [AC_INCLUDES_DEFAULT])
535
536 dnl used in gst/gstpoll.c
537 AC_CHECK_HEADERS([winsock2.h], [HAVE_WINSOCK2_H=yes], [HAVE_WINSOCK2_H=no], [AC_INCLUDES_DEFAULT])
538 AM_CONDITIONAL(HAVE_WINSOCK2_H, test "x$HAVE_WINSOCK2_H" = "xyes")
539 if test "x$HAVE_WINSOCK2_H" = "xyes"; then
540   WIN32_LIBS="-lws2_32"
541   AC_SUBST(WIN32_LIBS)
542 fi
543
544 dnl check for GMP/GSL, used by the gst_util_uint64_scale unit test only
545 if test "x$BUILD_TESTS" = "xyes"; then
546   AG_GST_CHECK_LIBHEADER(GMP, gmp,
547                          __gmpz_init_set_d, ,
548                          gmp.h,
549                          GMP_LIBS="-lgmp"
550                          AC_SUBST(GMP_LIBS)
551                          AC_DEFINE(HAVE_GMP, [1],[Have GMP library]))
552   AG_GST_CHECK_LIBHEADER(GSL, gsl,
553                          gsl_rng_uniform_int, -lgslcblas,
554                          gsl/gsl_rng.h,
555                          GSL_LIBS="-lgsl -lgslcblas"
556                          AC_SUBST(GSL_LIBS)
557                          AC_DEFINE(HAVE_GSL, [1],[Have GSL library]))
558 fi
559
560 dnl *** checks for types/defines ***
561
562 dnl *** checks for structures ***
563
564 dnl *** checks for compiler characteristics ***
565
566 dnl check if the compiler supports __uint128_t (gcc)
567 dnl Actually check for 128-bit division, since that's what we use
568 dnl uint128_t for.
569 AC_CACHE_CHECK(for __uint128_t, gst_cv_uint128_t,
570     AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
571       static __uint128_t v1 = 100;
572       static __uint128_t v2 = 10;
573       static __uint128_t u;
574       u = v1 / v2;
575     ]])],[
576       gst_cv_uint128_t=yes
577     ],[
578       gst_cv_uint128_t=no
579     ])
580 )
581 if test x$gst_cv_uint128_t = xyes; then
582   AC_DEFINE(HAVE_UINT128_T, 1, [Have __uint128_t type])
583 fi
584
585 dnl *** checking for tm_gmtoff ***
586 AC_MSG_CHECKING([for tm_gmtoff])
587 AC_RUN_IFELSE([AC_LANG_SOURCE([[
588         #include <time.h>
589         int main(void) {
590           struct tm t;
591           t.tm_gmtoff = 0;
592           exit(0);
593         }]])],
594   [have_tm_gmtoff=yes
595    AC_DEFINE(HAVE_TM_GMTOFF,1,[Have tm_gmtoff field in struct tm])],
596   [have_tm_gmtoff=no],
597   [have_tm_gmtoff="no (cross compiling)"])
598 AC_MSG_RESULT($have_tm_gmtoff)
599
600
601 dnl *** checks for library functions ***
602
603 AC_CHECK_FUNCS([strcasestr])
604
605 AC_CHECK_FUNCS([gmtime_r])
606 AC_CHECK_FUNCS([localtime_r])
607 AC_CHECK_FUNCS([sigaction])
608 AC_CHECK_FUNCS([getrusage])
609 AM_CONDITIONAL(HAVE_GETRUSAGE, test "x$ac_cv_func_getrusage" = "xyes")
610 AC_CHECK_HEADERS([sys/resource.h])
611
612 dnl check for fseeko()
613 AC_FUNC_FSEEKO
614 dnl check for ftello()
615 AC_CHECK_FUNCS([ftello])
616
617 AC_CHECK_FUNCS([fgetpos])
618 AC_CHECK_FUNCS([fsetpos])
619
620 dnl check for poll(), ppoll() and pselect()
621 AC_CHECK_HEADERS([sys/poll.h], [], [], [AC_INCLUDES_DEFAULT])
622 AC_CHECK_HEADERS([poll.h], [], [], [AC_INCLUDES_DEFAULT])
623 AC_CHECK_FUNCS([poll])
624 AC_CHECK_FUNCS([ppoll])
625 AC_CHECK_FUNCS([pselect])
626
627 dnl check for socketpair()
628 AC_CHECK_FUNC(socketpair, [], [
629   AC_CHECK_LIB(socket, socketpair, [
630     SOCKET_LIBS="-lsocket"
631     AC_SUBST(SOCKET_LIBS)
632   ])
633 ])
634
635 dnl ****************************************
636 dnl *** GLib POLL* compatibility defines ***
637 dnl ****************************************
638
639 AC_MSG_CHECKING([for broken poll])
640 AC_RUN_IFELSE([AC_LANG_SOURCE([[
641         #include <stdlib.h>
642         #include <fcntl.h>
643         #ifdef HAVE_SYS_POLL_H
644         #include <sys/poll.h>
645         #endif
646         #ifdef HAVE_POLL_H
647         #include <poll.h>
648         #endif
649         int main(void) {
650           struct pollfd fds[1];
651           int fd;
652           fd = open("/dev/null", 1);
653           fds[0].fd = fd;
654           fds[0].events = POLLIN;
655           fds[0].revents = 0;
656           if (poll(fds, 1, 0) < 0 || (fds[0].revents & POLLNVAL) != 0) {
657                 exit(1);  /* Does not work for devices -- fail */
658           }
659           exit(0);
660         }]])],
661   [broken_poll=no],
662   [broken_poll=yes
663    AC_DEFINE(BROKEN_POLL,1,[poll doesn't work on devices])],
664   [broken_poll="no (cross compiling)"])
665 AC_MSG_RESULT($broken_poll)
666
667 dnl check for mmap()
668 AC_FUNC_MMAP
669 AM_CONDITIONAL(HAVE_MMAP, test "x$ac_cv_func_mmap_fixed_mapped" = "xyes")
670
671 dnl check for posix_memalign(), getpagesize()
672 AC_CHECK_FUNCS([posix_memalign])
673 AC_CHECK_FUNCS([getpagesize])
674
675 dnl Check for POSIX timers
676 AC_CHECK_FUNCS(clock_gettime, [], [
677   AC_CHECK_LIB(rt, clock_gettime, [
678     AC_DEFINE(HAVE_CLOCK_GETTIME, 1)
679     LIBS="$LIBS -lrt"
680   ], [
681     AC_CHECK_LIB(pthread, clock_gettime, [
682       AC_DEFINE(HAVE_CLOCK_GETTIME, 1)
683       LIBS="$LIBS -lpthread"
684     ])
685   ])
686 ])
687
688 AC_CACHE_CHECK(for posix timers, gst_cv_posix_timers,
689     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
690 #include <time.h>
691 #ifdef HAVE_UNISTD_H
692 #include <unistd.h>
693 #endif
694     ]], [[
695 #if !defined(_POSIX_TIMERS) || _POSIX_TIMERS < 0 || !defined(CLOCK_REALTIME)
696 #error Either _POSIX_TIMERS or CLOCK_REALTIME not defined
697 #endif
698     ]])],[
699       gst_cv_posix_timers=yes
700     ],[
701       gst_cv_posix_timers=no
702     ])
703 )
704
705 if test "$gst_cv_posix_timers" = "yes"; then
706   AC_DEFINE(HAVE_POSIX_TIMERS,1,[Have posix timers])
707   GST_HAVE_POSIX_TIMERS_DEFINE="#define GST_HAVE_POSIX_TIMERS 1"
708 else
709   GST_HAVE_POSIX_TIMERS_DEFINE="#define GST_HAVE_POSIX_TIMERS 0"
710 fi
711 AC_SUBST(GST_HAVE_POSIX_TIMERS_DEFINE)
712 AM_CONDITIONAL(GST_HAVE_POSIX_TIMERS, test "$gst_cv_posix_timers" = "yes")
713
714 AC_CACHE_CHECK(for monotonic clock, gst_cv_monotonic_clock,
715     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
716 #include <time.h>
717 #ifdef HAVE_UNISTD_H
718 #include <unistd.h>
719 #endif
720     ]], [[
721 #if !defined(_POSIX_MONOTONIC_CLOCK) || _POSIX_MONOTONIC_CLOCK < 0 || !defined(CLOCK_MONOTONIC)
722 #error Either _POSIX_MONOTONIC_CLOCK or CLOCK_MONOTONIC not defined
723 #endif
724     ]])],[
725       gst_cv_monotonic_clock=yes
726     ],[
727       gst_cv_monotonic_clock=no
728     ])
729 )
730
731 if test "$gst_cv_monotonic_clock" = "yes"; then
732   AC_DEFINE(HAVE_MONOTONIC_CLOCK,1,[Have a monotonic clock])
733   GST_HAVE_MONOTONIC_CLOCK_DEFINE="#define GST_HAVE_MONOTONIC_CLOCK 1"
734 else
735   GST_HAVE_MONOTONIC_CLOCK_DEFINE="#define GST_HAVE_MONOTONIC_CLOCK 0"
736 fi
737 AC_SUBST(GST_HAVE_MONOTONIC_CLOCK_DEFINE)
738 AM_CONDITIONAL(GST_HAVE_MONOTONIC_CLOCK, test "$gst_cv_monotonic_clock" = "yes")
739
740 dnl Check for a way to display the function name in debug output
741 AG_GST_CHECK_FUNCTION
742
743 dnl test if we have dladdr(); we use it for debugging; see gst/gstinfo.c
744 save_cflags="$CFLAGS"
745 CFLAGS="$CFLAGS -D_GNU_SOURCE"
746 AC_CHECK_LIB(dl, dladdr,
747    AC_DEFINE(HAVE_DLADDR, 1, [Defined if we have dladdr ()])
748    LIBS="$LIBS -ldl")
749 CFLAGS="$save_cflags"
750
751 dnl Check printf stuff
752 if test "x${GST_DISABLE_GST_DEBUG}" != "xyes"; then
753   AC_TYPE_LONG_LONG_INT
754   AC_TYPE_UNSIGNED_LONG_LONG_INT
755
756   if test x$ac_cv_type_long_long_int$ac_cv_type_unsigned_long_long_int = xyesyes; then
757     AC_DEFINE([HAVE_LONG_LONG], [1], [Define to 1 if the system has the type long long])
758   fi
759
760   dnl /usr/share/aclocal/inttypes_h.m4 - ships with gettext apparently
761   gl_AC_HEADER_INTTYPES_H
762
763   dnl /usr/share/aclocal/stdint_h.m4 - ships with gettext apparently
764   gl_AC_HEADER_STDINT_H
765
766   AC_CHECK_TYPES(ptrdiff_t)
767
768   AC_TYPE_INTMAX_T
769   AC_TYPE_SIZE_T
770 fi
771
772 dnl *** checks for dependency libraries ***
773
774 dnl GLib
775 GLIB_REQ=2.40.0
776 AG_GST_GLIB_CHECK([$GLIB_REQ])
777
778 dnl Check for documentation xrefs
779 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
780 AC_SUBST(GLIB_PREFIX)
781
782 dnl GTK is optional and only used in examples
783 HAVE_GTK=no
784 GTK_REQ=3.10
785 if test "x$BUILD_EXAMPLES" = "xyes"; then
786   PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQ, HAVE_GTK=yes, HAVE_GTK=no)
787   AC_SUBST(GTK_LIBS)
788   AC_SUBST(GTK_CFLAGS)
789 fi
790 AM_CONDITIONAL(HAVE_GTK, test "x$HAVE_GTK" = "xyes")
791
792 dnl building of unit test libraries
793 AC_ARG_ENABLE(check,
794   AS_HELP_STRING([--disable-check],[disable building unit test libraries]),
795   [
796     case "${enableval}" in
797       yes) BUILD_CHECK=yes ;;
798       no)  BUILD_CHECK=no ;;
799       *)   AC_MSG_ERROR(bad value ${enableval} for --disable-check) ;;
800     esac
801   ], [
802     dnl Default value
803     case $host_os in
804       mingw* | msvc* | mks*) BUILD_CHECK=no ;;
805       *) BUILD_CHECK=yes ;;
806     esac
807 ])
808 dnl bit of a misnomer, but keep the conditional named like this so we don't
809 dnl have to change too much elsewhere
810 AM_CONDITIONAL(HAVE_CHECK, test "x$BUILD_CHECK" = "xyes")
811
812 dnl configure the desired memory alignment
813 AC_ARG_WITH([memory-alignment],
814   AS_HELP_STRING([--with-memory-alignment],[8,N,malloc,pagesize (default is 32)]),
815   [
816     if test "x$withval" = "xyes"
817     then
818       AC_DEFINE(MEMORY_ALIGNMENT, 32, [Memory alignment to use])
819     else
820       case "${withval}" in
821         malloc) AC_DEFINE(MEMORY_ALIGNMENT_MALLOC, 1, [Memory alignment by malloc default]) ;;
822         pagesize)  AC_DEFINE(MEMORY_ALIGNMENT_PAGESIZE, 1, [Memory alignment by pagesize]) ;;
823         *)   AC_DEFINE_UNQUOTED(MEMORY_ALIGNMENT, ${withval}, [Memory alignment to use]) ;;
824       esac
825     fi
826   ], [
827     AC_DEFINE(MEMORY_ALIGNMENT_MALLOC, 1, [Memory alignment by malloc default]) 
828   ]
829 )
830
831 dnl Check for -Bsymbolic-functions linker flag used to avoid
832 dnl intra-library PLT jumps, if available.
833 AC_ARG_ENABLE(Bsymbolic,
834               [AS_HELP_STRING([--disable-Bsymbolic],[avoid linking with -Bsymbolic])],,
835               [SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}"
836                AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
837                LDFLAGS=-Wl,-Bsymbolic-functions
838                LIBS=
839                AC_TRY_LINK([], [return 0],
840                            AC_MSG_RESULT(yes)
841                            enable_Bsymbolic=yes,
842                            AC_MSG_RESULT(no)
843                            enable_Bsymbolic=no)
844                LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])
845
846
847 dnl *** set variables based on configure arguments
848
849 dnl set license and copyright notice
850 GST_LICENSE="LGPL"
851 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
852 AC_SUBST(GST_LICENSE)
853
854 dnl define LIBDIR, GST_DATADIR so we can inform people where we live
855 AS_AC_EXPAND(LIBDIR, $libdir)
856 AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [library dir])
857 AS_AC_EXPAND(DATADIR, $datadir)
858 AC_DEFINE_UNQUOTED(GST_DATADIR, "$DATADIR", [data dir])
859
860 dnl set location of plugin directory
861 AG_GST_SET_PLUGINDIR
862
863 dnl make sure it doesn't complain about unused variables if debugging is disabled
864 NO_WARNINGS=""
865 if test "x${GST_DISABLE_GST_DEBUG}" = "xyes"; then
866   NO_WARNINGS="-Wno-unused"
867 fi
868
869 dnl define an ERROR_CFLAGS Makefile variable
870 AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs $NO_WARNINGS])
871
872 dnl special warning flags for gst/printf
873 AS_COMPILER_FLAG([-Wno-format-nonliteral], [PRINTF_CFLAGS="-Wno-format-nonliteral"])
874 AC_SUBST(PRINTF_CFLAGS)
875
876 dnl define correct level for debugging messages
877 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
878
879 dnl *** finalize CFLAGS, LDFLAGS, LIBS
880
881 dnl Overview:
882 dnl GST_OPTION_CFLAGS:  common cflags for profiling, debugging, errors, ...
883 dnl GST_ALL_*:          vars shared by all built objects
884 dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
885 dnl GST_OBJ_*:          additional vars to link to the core library
886 dnl                     include GST_ALL_*
887 dnl GST_LT_LDFLAGS:     library versioning of our libraries
888 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
889
890 dnl GST_OPTION_CFLAGS
891 if test "x$USE_DEBUG" = xyes; then
892    PROFILE_CFLAGS="-g"
893 fi
894 AC_SUBST(PROFILE_CFLAGS)
895
896 # GST_DISABLE_DEPRECATED: hide the visibility of deprecated
897 # functionality from the API that gstreamer uses
898 # GST_REMOVE_DEPRECATED: don't compile deprecated functionality (breaks ABI)
899 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
900   dnl Define _only_ when compiling from git (not for pre-releases or releases)
901   DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
902 else
903   DEPRECATED_CFLAGS=""
904 fi
905 AC_SUBST(DEPRECATED_CFLAGS)
906
907 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time via e.g.
908 dnl make DEPRECATED_CFLAGS=''
909 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
910 GST_OPTION_CXXFLAGS="\$(WARNING_CXXFLAGS) \$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
911 GST_OPTION_CFLAGS="$GST_OPTION_CFLAGS"
912 GST_OPTION_CXXFLAGS="$GST_OPTION_CXXFLAGS"
913 AC_SUBST(GST_OPTION_CFLAGS)
914 AC_SUBST(GST_OPTION_CXXFLAGS)
915
916 dnl GST_ALL_*
917 dnl vars common to for all internal objects (core libs, elements, applications)
918 dnl CFLAGS:
919 dnl - src and build dirs need to be added because every piece that gets built
920 dnl   will need the GStreamer source and generated headers
921 dnl LIBS: XML doesn't need to be added because we don't explicitly use symbols
922 dnl       from LibXML except for in the core library
923 GST_ALL_CXXFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS \$(GLIB_EXTRA_CFLAGS) $XML_CFLAGS \$(GST_OPTION_CXXFLAGS) \$(ERROR_CXXFLAGS)"
924 GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS \$(GLIB_EXTRA_CFLAGS) $XML_CFLAGS \$(GST_OPTION_CFLAGS) \$(ERROR_CFLAGS)"
925
926 dnl FIXME: check if LTLIBINTL is needed everywhere
927 dnl I presume it is given that it contains the symbols that _() stuff maps to
928 GST_ALL_LIBS="$GLIB_LIBS $LTLIBINTL \$(GCOV_LIBS)"
929
930 dnl LDFLAGS really should only contain flags, not libs - they get added before
931 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
932 GST_ALL_LDFLAGS="-no-undefined"
933 if test "x${enable_Bsymbolic}" = "xyes"; then
934   GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions"
935 fi
936
937 AC_SUBST(GST_ALL_CFLAGS)
938 AC_SUBST(GST_ALL_CXXFLAGS)
939 AC_SUBST(GST_ALL_LIBS)
940 AC_SUBST(GST_ALL_LDFLAGS)
941
942 dnl GST_LIB_LDFLAGS
943 dnl linker flags shared by all libraries
944 dnl LDFLAGS modifier defining exported symbols from built libraries
945 GST_LIB_LDFLAGS="-export-symbols-regex \^[_]?\(gst_\|Gst\|GST_\).*"
946 AC_SUBST(GST_LIB_LDFLAGS)
947
948 dnl GST_OBJ_*
949 dnl default vars for all internal objects built on libgstreamer
950 dnl includes GST_ALL_*
951 GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS)"
952 GST_OBJ_CXXFLAGS="\$(GST_ALL_CXXFLAGS)"
953 GST_OBJ_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_API_VERSION.la \$(GST_ALL_LIBS)"
954 AC_SUBST(GST_OBJ_CFLAGS)
955 AC_SUBST(GST_OBJ_CXXFLAGS)
956 AC_SUBST(GST_OBJ_LIBS)
957
958 dnl GST_PLUGIN_LDFLAGS
959 dnl LDFLAGS for plugins; includes GST_ALL_LDFLAGS
960 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_.*' $GST_ALL_LDFLAGS"
961 AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
962
963 dnl plugin scanner locations
964 AS_AC_EXPAND(GST_PLUGIN_SCANNER_INSTALLED,${libexecdir}/gstreamer-$GST_API_VERSION/gst-plugin-scanner)
965 AC_DEFINE_UNQUOTED(GST_PLUGIN_SCANNER_INSTALLED,
966     "$GST_PLUGIN_SCANNER_INSTALLED", [location of the installed gst-plugin-scanner])
967 AC_SUBST(GST_PLUGIN_SCANNER_INSTALLED)
968
969 dnl ptp helper locations
970 AS_AC_EXPAND(GST_PTP_HELPER_INSTALLED,${libexecdir}/gstreamer-$GST_API_VERSION/gst-ptp-helper)
971 AC_DEFINE_UNQUOTED(GST_PTP_HELPER_INSTALLED,
972     "$GST_PTP_HELPER_INSTALLED", [location of the installed gst-ptp-helper])
973 AC_SUBST(GST_PTP_HELPER_INSTALLED)
974
975 dnl things for our internal libcheck (must be called even if building
976 dnl libcheck is disabled because it defines conditionals)
977 AG_GST_CHECK_CHECKS()
978
979 AC_CONFIG_FILES(
980 Makefile
981 data/Makefile
982 gst/Makefile
983 gst/gstconfig.h
984 gst/gstversion.h
985 gst/parse/Makefile
986 gst/printf/Makefile
987 libs/Makefile
988 libs/gst/Makefile
989 libs/gst/base/Makefile
990 libs/gst/check/Makefile
991 libs/gst/check/libcheck/Makefile
992 libs/gst/check/internal-check.h:libs/gst/check/libcheck/check.h.in
993 libs/gst/controller/Makefile
994 libs/gst/helpers/Makefile
995 libs/gst/net/Makefile
996 plugins/Makefile
997 plugins/elements/Makefile
998 plugins/tracers/Makefile
999 po/Makefile.in
1000 tests/Makefile
1001 tests/benchmarks/Makefile
1002 tests/check/Makefile
1003 tests/misc/Makefile
1004 tests/examples/Makefile
1005 tests/examples/adapter/Makefile
1006 tests/examples/controller/Makefile
1007 tests/examples/stepping/Makefile
1008 tests/examples/helloworld/Makefile
1009 tests/examples/manual/Makefile
1010 tests/examples/memory/Makefile
1011 tests/examples/netclock/Makefile
1012 tests/examples/ptp/Makefile
1013 tests/examples/streamiddemux/Makefile
1014 tests/examples/streams/Makefile
1015 tools/Makefile
1016 common/Makefile
1017 common/m4/Makefile
1018 docs/Makefile
1019 docs/design/Makefile
1020 docs/faq/Makefile
1021 docs/gst/Makefile
1022 docs/gst/gstreamer.types
1023 docs/libs/Makefile
1024 docs/plugins/Makefile
1025 docs/manual/Makefile
1026 docs/pwg/Makefile
1027 docs/slides/Makefile
1028 docs/xsl/Makefile
1029 docs/version.entities
1030 m4/Makefile
1031 pkgconfig/Makefile
1032 stamp.h
1033 pkgconfig/gstreamer.pc
1034 pkgconfig/gstreamer-uninstalled.pc
1035 pkgconfig/gstreamer-base.pc
1036 pkgconfig/gstreamer-base-uninstalled.pc
1037 pkgconfig/gstreamer-check.pc
1038 pkgconfig/gstreamer-check-uninstalled.pc
1039 pkgconfig/gstreamer-controller.pc
1040 pkgconfig/gstreamer-controller-uninstalled.pc
1041 pkgconfig/gstreamer-net.pc
1042 pkgconfig/gstreamer-net-uninstalled.pc
1043 gstreamer.spec
1044 )
1045
1046 dnl Create the config.h file for Visual Studio builds
1047 dnl Beware of spaces and /'s in some of the shell variable contents.
1048 sed \
1049     -e 's/.*config.h.in.*autoheader.*/\/* Autogenerated config.h created for win32 Visual Studio builds *\/\n\n\/* PREFIX -- specifically added for Windows for easier moving *\/\n#define PREFIX "C:\\\\gstreamer"/' \
1050     -e 's/.* GETTEXT_PACKAGE$/#define GETTEXT_PACKAGE "'$GETTEXT_PACKAGE'"/' \
1051     -e 's/.* GST_DATADIR$/#define GST_DATADIR PREFIX "\\\\share"/' \
1052     -e 's/.* GST_LEVEL_DEFAULT$/#define GST_LEVEL_DEFAULT GST_LEVEL_ERROR/' \
1053     -e 's/.* GST_LICENSE$/#define GST_LICENSE "'$GST_LICENSE'"/' \
1054     -e 's/.* GST_API_VERSION$/#define GST_API_VERSION "'$GST_API_VERSION'"/' \
1055     -e "s,.* GST_PACKAGE_NAME$,#define GST_PACKAGE_NAME \"${GST_PACKAGE_NAME}\"," \
1056     -e 's/.* GST_PACKAGE_ORIGIN$/#define GST_PACKAGE_ORIGIN "Unknown package origin"/' \
1057     -e "s,.* GST_PACKAGE_RELEASE_DATETIME$,#define GST_PACKAGE_RELEASE_DATETIME \"${GST_PACKAGE_RELEASE_DATETIME}\"," \
1058     -e 's/.* HAVE_CPU_I386$/#define HAVE_CPU_I386 1/' \
1059     -e 's/.* HAVE_FGETPOS$/#define HAVE_FGETPOS 1/' \
1060     -e 's/.* HAVE_FSETPOS$/#define HAVE_FSETPOS 1/' \
1061     -e 's/.* HAVE_PROCESS_H$/#define HAVE_PROCESS_H 1/' \
1062     -e 's/.* HAVE_STDLIB_H$/#define HAVE_STDLIB_H 1/' \
1063     -e 's/.* HAVE_STRING_H$/#define HAVE_STRING_H 1/' \
1064     -e 's/.* HAVE_SYS_STAT_H$/#define HAVE_SYS_STAT_H 1/' \
1065     -e 's/.* HAVE_SYS_TYPES_H$/#define HAVE_SYS_TYPES_H 1/' \
1066     -e 's/.* HAVE_WIN32$/#define HAVE_WIN32 1/' \
1067     -e 's/.* HAVE_WINSOCK2_H$/#define HAVE_WINSOCK2_H 1/' \
1068     -e 's/.* HOST_CPU$/#define HOST_CPU "i686"/' \
1069     -e 's/.* MEMORY_ALIGNMENT_MALLOC/#define MEMORY_ALIGNMENT_MALLOC 1/' \
1070     -e 's/.* LIBDIR$/#ifdef _DEBUG\n#  define LIBDIR PREFIX "\\\\debug\\\\lib"\n#else\n#  define LIBDIR PREFIX "\\\\lib"\n#endif/' \
1071     -e 's/.* LOCALEDIR$/#define LOCALEDIR PREFIX "\\\\share\\\\locale"/' \
1072     -e 's/.* PACKAGE$/#define PACKAGE "gstreamer"/' \
1073     -e 's/.* PACKAGE_BUGREPORT$/#define PACKAGE_BUGREPORT "http:\/\/bugzilla.gnome.org\/enter_bug.cgi?product=GStreamer"/' \
1074     -e 's/.* PACKAGE_NAME$/#define PACKAGE_NAME "'$PACKAGE_NAME'"/' \
1075     -e "s/.* PACKAGE_STRING$/#define PACKAGE_STRING \"$PACKAGE_STRING\"/" \
1076     -e 's/.* PACKAGE_TARNAME$/#define PACKAGE_TARNAME "'$PACKAGE_TARNAME'"/' \
1077     -e 's/.* PACKAGE_VERSION$/#define PACKAGE_VERSION "'$PACKAGE_VERSION'"/' \
1078     -e 's/.* PLUGINDIR$/#ifdef _DEBUG\n#  define PLUGINDIR PREFIX "\\\\debug\\\\lib\\\\gstreamer-1.0"\n#else\n#  define PLUGINDIR PREFIX "\\\\lib\\\\gstreamer-1.0"\n#endif/' \
1079     -e 's/.* GST_PLUGIN_SCANNER_INSTALLED$/#define GST_PLUGIN_SCANNER_INSTALLED LIBDIR "\\\\gst-plugin-scanner"/' \
1080     -e 's/.* VERSION$/#define VERSION "'$VERSION'"/' \
1081     config.h.in >win32/common/config.h-new
1082
1083 AC_OUTPUT
1084
1085 dnl negate for output
1086 if test "x${GST_DISABLE_GST_DEBUG}" = "xno"; then enable_gst_debug="yes"; fi
1087 if test "x${GST_DISABLE_PARSE}" = "xno"; then enable_parse="yes"; fi
1088 if test "x${GST_DISABLE_OPTION_PARSING}" = "xno"; then enable_option_parsing="yes"; fi
1089 if test "x${GST_DISABLE_TRACE}" = "xno"; then enable_trace="yes"; fi
1090 if test "x${GST_DISABLE_ALLOC_TRACE}" = "xno"; then enable_alloc_trace="yes"; fi
1091 if test "x${GST_DISABLE_PLUGIN}" = "xno"; then enable_plugin="yes"; fi
1092 if test "x${GST_DISABLE_REGISTRY}" = "xno"; then enable_registry="yes"; fi
1093
1094 echo "
1095
1096 Configuration
1097         Version                    : ${VERSION}
1098         Source code location       : ${srcdir}
1099         Prefix                     : ${prefix}
1100         Compiler                   : ${CC}
1101         Package name               : ${GST_PACKAGE_NAME}
1102         Package origin             : ${GST_PACKAGE_ORIGIN}
1103
1104         Documentation (manuals)    : ${enable_docbook}
1105         Documentation (API)        : ${enable_gtk_doc}
1106
1107         Debug Logging              : ${enable_gst_debug}
1108         Command-line parser        : ${enable_parse}
1109         Option parsing in gst_init : ${enable_option_parsing}
1110         Tracing subsystem          : ${enable_trace}
1111         Allocation tracing         : ${enable_alloc_trace}
1112         Plugin registry            : ${enable_registry}
1113         Plugin support             : ${enable_plugin}
1114         Static plugins             : ${enable_static_plugins}
1115         Unit testing support       : ${BUILD_CHECK}
1116         PTP clock support          : ${HAVE_PTP}
1117
1118         Debug                      : ${USE_DEBUG}
1119         Profiling                  : ${USE_PROFILING}
1120
1121         Building benchmarks        : ${BUILD_BENCHMARKS}
1122         Building examples          : ${BUILD_EXAMPLES}
1123         Building test apps         : ${BUILD_TESTS}
1124         Building tests that fail   : ${BUILD_FAILING_TESTS}
1125         Building tools             : ${BUILD_TOOLS}
1126 "