| 1 |
AC_PREREQ(2.52) |
| 2 |
|
| 3 |
dnl please read gstreamer/docs/random/autotools before changing this file |
| 4 |
|
| 5 |
dnl initialize autoconf |
| 6 |
dnl releases only do -Wall, cvs and prerelease does -Werror too |
| 7 |
dnl use a three digit version number for releases, and four for cvs/prerelease |
| 8 |
AC_INIT(GStreamer BufferClass Plug-in, 0.10.1.1, |
| 9 |
http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer, |
| 10 |
gst-plugin-bc) |
| 11 |
|
| 12 |
AG_GST_INIT |
| 13 |
|
| 14 |
dnl initialize automake |
| 15 |
AM_INIT_AUTOMAKE |
| 16 |
|
| 17 |
dnl define PACKAGE_VERSION_* variables |
| 18 |
AS_VERSION |
| 19 |
|
| 20 |
dnl check if this is a release version |
| 21 |
AS_NANO(GST_CVS="no", GST_CVS="yes") |
| 22 |
|
| 23 |
dnl libtoolize complains about wrong macros |
| 24 |
AC_CONFIG_MACRO_DIR([m4]) |
| 25 |
|
| 26 |
dnl can autoconf find the source ? |
| 27 |
AC_CONFIG_SRCDIR([gst/bc/gstbc.c]) |
| 28 |
|
| 29 |
dnl define the output header for config |
| 30 |
AM_CONFIG_HEADER([config.h]) |
| 31 |
|
| 32 |
dnl AM_MAINTAINER_MODE only provides the option to configure to enable it |
| 33 |
AM_MAINTAINER_MODE |
| 34 |
|
| 35 |
dnl sets host_* variables |
| 36 |
AC_CANONICAL_HOST |
| 37 |
|
| 38 |
dnl our libraries and install dirs use major.minor as a version |
| 39 |
GST_MAJORMINOR=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR |
| 40 |
dnl we override it here if we need to for the release candidate of new series |
| 41 |
GST_MAJORMINOR=0.10 |
| 42 |
AC_SUBST(GST_MAJORMINOR) |
| 43 |
|
| 44 |
dnl CURRENT, REVISION, AGE |
| 45 |
dnl - library source changed -> increment REVISION |
| 46 |
dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0 |
| 47 |
dnl - interfaces added -> increment AGE |
| 48 |
dnl - interfaces removed -> AGE = 0 |
| 49 |
dnl sets GST_LT_LDFLAGS |
| 50 |
AS_LIBTOOL(GST, 0, 0, 0) |
| 51 |
|
| 52 |
dnl FIXME: this macro doesn't actually work; |
| 53 |
dnl the generated libtool script has no support for the listed tags. |
| 54 |
dnl So this needs to be fixed first if we want to use this |
| 55 |
dnl AS_LIBTOOL_TAGS |
| 56 |
|
| 57 |
AC_LIBTOOL_WIN32_DLL |
| 58 |
AM_PROG_LIBTOOL |
| 59 |
AS_PROG_OBJC |
| 60 |
|
| 61 |
dnl *** required versions of GStreamer stuff *** |
| 62 |
GST_REQ=0.10.23 |
| 63 |
GSTPB_REQ=0.10.23 |
| 64 |
|
| 65 |
dnl *** autotools stuff **** |
| 66 |
|
| 67 |
dnl allow for different autotools |
| 68 |
AS_AUTOTOOLS_ALTERNATE |
| 69 |
|
| 70 |
dnl Add parameters for aclocal |
| 71 |
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4") |
| 72 |
|
| 73 |
dnl set up gettext |
| 74 |
dnl the version check needs to stay here because autopoint greps for it |
| 75 |
AM_GNU_GETTEXT_VERSION([0.11.5]) |
| 76 |
AM_GNU_GETTEXT([external]) |
| 77 |
AG_GST_GETTEXT([gst-plugin-bt-$GST_MAJORMINOR]) |
| 78 |
|
| 79 |
dnl *** check for arguments to configure *** |
| 80 |
|
| 81 |
AG_GST_ARG_DEBUG |
| 82 |
AG_GST_ARG_PROFILING |
| 83 |
AG_GST_ARG_VALGRIND |
| 84 |
AG_GST_ARG_GCOV |
| 85 |
|
| 86 |
AG_GST_ARG_EXAMPLES |
| 87 |
|
| 88 |
AG_GST_ARG_WITH_PKG_CONFIG_PATH |
| 89 |
AG_GST_ARG_WITH_PACKAGE_NAME |
| 90 |
AG_GST_ARG_WITH_PACKAGE_ORIGIN |
| 91 |
AG_GST_ARG_WITH_PLUGINS |
| 92 |
|
| 93 |
dnl *** checks for platform *** |
| 94 |
|
| 95 |
dnl * hardware/architecture * |
| 96 |
AC_CHECK_SIZEOF(void *) |
| 97 |
|
| 98 |
dnl common/m4/gst-arch.m4 |
| 99 |
dnl check CPU type |
| 100 |
AG_GST_ARCH |
| 101 |
|
| 102 |
dnl check for large file support |
| 103 |
dnl affected plugins must include config.h |
| 104 |
AC_SYS_LARGEFILE |
| 105 |
|
| 106 |
dnl *** checks for programs *** |
| 107 |
|
| 108 |
dnl find a compiler |
| 109 |
AC_PROG_CC |
| 110 |
AC_PROG_CXX |
| 111 |
|
| 112 |
dnl check if the compiler supports '-c' and '-o' options |
| 113 |
AM_PROG_CC_C_O |
| 114 |
|
| 115 |
AC_PATH_PROG(VALGRIND_PATH, valgrind, no) |
| 116 |
AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno") |
| 117 |
|
| 118 |
dnl check for documentation tools |
| 119 |
GTK_DOC_CHECK([1.3]) |
| 120 |
AS_PATH_PYTHON([2.1]) |
| 121 |
AG_GST_PLUGIN_DOCS([1.3],[2.1]) |
| 122 |
|
| 123 |
dnl *** checks for libraries *** |
| 124 |
|
| 125 |
dnl For interactive UNIX (a Sun thing) |
| 126 |
dnl FIXME: this adds -lcposix to LIBS, but I doubt we use LIBS |
| 127 |
AC_ISC_POSIX |
| 128 |
|
| 129 |
dnl libm, for sin() etc. |
| 130 |
AC_CHECK_LIBM |
| 131 |
AC_SUBST(LIBM) |
| 132 |
|
| 133 |
dnl *** checks for header files *** |
| 134 |
|
| 135 |
dnl check if we have ANSI C header files |
| 136 |
AC_HEADER_STDC |
| 137 |
|
| 138 |
dnl *** checks for types/defines *** |
| 139 |
|
| 140 |
dnl *** checks for structures *** |
| 141 |
|
| 142 |
dnl *** checks for compiler characteristics *** |
| 143 |
|
| 144 |
dnl make sure we can use "inline" from C code |
| 145 |
AC_C_INLINE |
| 146 |
|
| 147 |
dnl *** checks for library functions *** |
| 148 |
|
| 149 |
dnl Check for a way to display the function name in debug output |
| 150 |
AG_GST_CHECK_FUNCTION |
| 151 |
|
| 152 |
dnl *** checks for dependency libraries *** |
| 153 |
|
| 154 |
dnl GLib is required |
| 155 |
AG_GST_GLIB_CHECK([2.6]) |
| 156 |
|
| 157 |
dnl checks for gstreamer |
| 158 |
dnl uninstalled is selected preferentially -- see pkg-config(1) |
| 159 |
AG_GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ], yes) |
| 160 |
AG_GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ], yes) |
| 161 |
AG_GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no) |
| 162 |
AG_GST_CHECK_GST_PLUGINS_BASE($GST_MAJORMINOR, [$GSTPB_REQ], yes) |
| 163 |
AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes") |
| 164 |
|
| 165 |
dnl Check for documentation xrefs |
| 166 |
GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`" |
| 167 |
GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_MAJORMINOR`" |
| 168 |
GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_MAJORMINOR`" |
| 169 |
AC_SUBST(GLIB_PREFIX) |
| 170 |
AC_SUBST(GST_PREFIX) |
| 171 |
AC_SUBST(GSTPB_PREFIX) |
| 172 |
|
| 173 |
|
| 174 |
dnl *** set variables based on configure arguments *** |
| 175 |
|
| 176 |
AC_ARG_WITH(kpath,[ --with-kpath specify the path to the kernel modules],[ |
| 177 |
kpath="$withval" |
| 178 |
]) |
| 179 |
AC_SUBST(kpath) |
| 180 |
|
| 181 |
AC_ARG_WITH(gsdk,[ --with-gsdk specify the path to the GFX DDK],[ |
| 182 |
gsdk="$withval" |
| 183 |
]) |
| 184 |
AC_SUBST(gsdk) |
| 185 |
|
| 186 |
AC_ARG_ENABLE(module-only, |
| 187 |
AC_HELP_STRING([--enable-module-only], [Build only kernel module (default: disabled)]), |
| 188 |
[case "${enableval}" in |
| 189 |
yes) enable_module_only=true ;; |
| 190 |
no) enable_module_only=false ;; |
| 191 |
*) AC_MSG_ERROR(bad value ${enableval} for --enable-module-only) ;; |
| 192 |
esac], [enable_module_only=false]) |
| 193 |
if test "x$enable_module_only" = "xtrue"; then |
| 194 |
if ! test -n "$kpath"; then |
| 195 |
AC_MSG_ERROR(if --enable-module-only is given, --with-kpath must also be used) |
| 196 |
enable_module_only=false |
| 197 |
fi |
| 198 |
if ! test -n "$gsdk"; then |
| 199 |
AC_MSG_ERROR(if --enable-module-only is given, --with-gsdk must also be used) |
| 200 |
enable_module_only=false |
| 201 |
fi |
| 202 |
fi |
| 203 |
|
| 204 |
AM_CONDITIONAL([BUILD_MODULE], test -n "$kpath" && test -n "$gsdk") |
| 205 |
AM_CONDITIONAL([BUILD_GST], test "x$enable_module_only" != "xtrue") |
| 206 |
|
| 207 |
|
| 208 |
AC_ARG_ENABLE(gles1-example, |
| 209 |
AC_HELP_STRING([--enable-gles1-example], [Enable OpenGLES 1.x example (default: disabled)]), |
| 210 |
[case "${enableval}" in |
| 211 |
yes) enable_gles1_example=true ;; |
| 212 |
no) enable_gles1_example=false ;; |
| 213 |
*) AC_MSG_ERROR(bad value ${enableval} for --enable-gles1-example) ;; |
| 214 |
esac], [enable_gles1_example=false]) |
| 215 |
if test "x$enable_gles1_example" = "xtrue"; then |
| 216 |
gllibs="$gllibs -lGLES_CM -lEGL" |
| 217 |
AC_DEFINE(ENABLE_GLES1_EXAMPLE, [], [Enable OpenGLES 1.x example (default: disabled)]) |
| 218 |
fi |
| 219 |
|
| 220 |
AC_ARG_ENABLE(gles2-example, |
| 221 |
AC_HELP_STRING([--enable-gles2-example], [Enable OpenGLES 2.x example (default: disabled)]), |
| 222 |
[case "${enableval}" in |
| 223 |
yes) enable_gles2_example=true ;; |
| 224 |
no) enable_gles2_example=false ;; |
| 225 |
*) AC_MSG_ERROR(bad value ${enableval} for --enable-gles2-example) ;; |
| 226 |
esac], [enable_gles2_example=false]) |
| 227 |
if test "x$enable_gles2_example" = "xtrue"; then |
| 228 |
gllibs="$gllibs -lGLESv2 -lEGL" |
| 229 |
AC_DEFINE(ENABLE_GLES2_EXAMPLE, [], [Enable OpenGLES 2.x example (default: disabled)]) |
| 230 |
fi |
| 231 |
AC_SUBST(gllibs) |
| 232 |
|
| 233 |
dnl set license and copyright notice |
| 234 |
GST_LICENSE="LGPL" |
| 235 |
AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license]) |
| 236 |
AC_SUBST(GST_LICENSE) |
| 237 |
|
| 238 |
dnl set location of plugin directory |
| 239 |
AG_GST_SET_PLUGINDIR |
| 240 |
|
| 241 |
dnl define an ERROR_CFLAGS Makefile variable |
| 242 |
AG_GST_SET_ERROR_CFLAGS($GST_CVS) |
| 243 |
AG_GST_SET_ERROR_CXXFLAGS($GST_CVS) |
| 244 |
|
| 245 |
dnl define correct level for debugging messages |
| 246 |
AG_GST_SET_LEVEL_DEFAULT($GST_CVS) |
| 247 |
|
| 248 |
dnl used in examples |
| 249 |
AG_GST_DEFAULT_ELEMENTS |
| 250 |
|
| 251 |
dnl *** plugins to includes *** |
| 252 |
|
| 253 |
dnl *** sys plug-ins *** |
| 254 |
|
| 255 |
echo |
| 256 |
AC_MSG_NOTICE([Checking libraries for plugins in sys/]) |
| 257 |
echo |
| 258 |
|
| 259 |
dnl *** finalize CFLAGS, LDFLAGS, LIBS |
| 260 |
|
| 261 |
dnl Overview: |
| 262 |
dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ... |
| 263 |
dnl GST_*: flags shared by built objects to link against GStreamer |
| 264 |
dnl GST_ALL_LDFLAGS: linker flags shared by all |
| 265 |
dnl GST_LIB_LDFLAGS: additional linker flags for all libaries |
| 266 |
dnl GST_LT_LDFLAGS: library versioning of our libraries |
| 267 |
dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins |
| 268 |
|
| 269 |
dnl GST_OPTION_CFLAGS |
| 270 |
if test "x$USE_DEBUG" = xyes; then |
| 271 |
PROFILE_CFLAGS="-g" |
| 272 |
fi |
| 273 |
AC_SUBST(PROFILE_CFLAGS) |
| 274 |
|
| 275 |
if test "x$GST_CVS" = "xyes"; then |
| 276 |
DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED" |
| 277 |
else |
| 278 |
DEPRECATED_CFLAGS="" |
| 279 |
fi |
| 280 |
AC_SUBST(DEPRECATED_CFLAGS) |
| 281 |
|
| 282 |
dnl every flag in GST_OPTION_CFLAGS can be overridden at make time |
| 283 |
GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)" |
| 284 |
GST_OPTION_CXXFLAGS="\$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)" |
| 285 |
AC_SUBST(GST_OPTION_CFLAGS) |
| 286 |
AC_SUBST(GST_OPTION_CXXFLAGS) |
| 287 |
|
| 288 |
dnl our libraries need to be versioned correctly |
| 289 |
AC_SUBST(GST_LT_LDFLAGS) |
| 290 |
|
| 291 |
dnl FIXME: do we want to rename to GST_ALL_* ? |
| 292 |
dnl add GST_OPTION_CFLAGS, but overridable |
| 293 |
GST_CXXFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GST_CXXFLAGS \$(GST_OPTION_CXXFLAGS)" |
| 294 |
GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS \$(GST_OPTION_CFLAGS)" |
| 295 |
AC_SUBST(GST_CFLAGS) |
| 296 |
AC_SUBST(GST_CXXFLAGS) |
| 297 |
|
| 298 |
dnl add GCOV libs because libtool strips -fprofile-arcs -ftest-coverage |
| 299 |
GST_LIBS="$GST_LIBS \$(GCOV_LIBS)" |
| 300 |
AC_SUBST(GST_LIBS) |
| 301 |
|
| 302 |
dnl LDFLAGS really should only contain flags, not libs - they get added before |
| 303 |
dnl whatevertarget_LIBS and -L flags here affect the rest of the linking |
| 304 |
GST_ALL_LDFLAGS="-no-undefined" |
| 305 |
AC_SUBST(GST_ALL_LDFLAGS) |
| 306 |
|
| 307 |
dnl GST_LIB_LDFLAGS |
| 308 |
dnl linker flags shared by all libraries |
| 309 |
dnl LDFLAGS modifier defining exported symbols from built libraries |
| 310 |
dnl (export _gst_foo but not __gst_foo) |
| 311 |
GST_LIB_LDFLAGS="-export-symbols-regex ^_?\(gst_\|Gst\|GST_\).*" |
| 312 |
AC_SUBST(GST_LIB_LDFLAGS) |
| 313 |
|
| 314 |
dnl this really should only contain flags, not libs - they get added before |
| 315 |
dnl whatevertarget_LIBS and -L flags here affect the rest of the linking |
| 316 |
GST_PLUGIN_LDFLAGS="-module -avoid-version $GST_ALL_LDFLAGS" |
| 317 |
AC_SUBST(GST_PLUGIN_LDFLAGS) |
| 318 |
|
| 319 |
dnl *** output files *** |
| 320 |
|
| 321 |
AC_CONFIG_FILES( |
| 322 |
Makefile |
| 323 |
gst/Makefile |
| 324 |
gst/bc/Makefile |
| 325 |
bc-app/Makefile |
| 326 |
module/Makefile |
| 327 |
module/Kbuild |
| 328 |
po/Makefile.in |
| 329 |
common/Makefile |
| 330 |
common/m4/Makefile |
| 331 |
) |
| 332 |
AC_OUTPUT |
| 333 |
|
| 334 |
AG_GST_OUTPUT_PLUGINS |