1AC_PREREQ([2.69]) 2 3dnl please read gstreamer/docs/random/autotools before changing this file 4 5dnl initialize autoconf 6dnl releases only do -Wall, cvs and prerelease does -Werror too 7dnl use a three digit version number for releases, and four for cvs/prerelease 8AC_INIT([GStreamer Ugly Plug-ins],[1.16.2],[http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer],[gst-plugins-ugly]) 9 10AG_GST_INIT 11 12dnl initialize automake 13AM_INIT_AUTOMAKE([-Wno-portability 1.14 no-dist-gzip dist-xz tar-ustar subdir-objects]) 14 15dnl define PACKAGE_VERSION_* variables 16AS_VERSION 17 18dnl check if this is a release version 19AS_NANO(GST_GIT="no", GST_GIT="yes") 20 21dnl can autoconf find the source ? 22AC_CONFIG_SRCDIR([gst/asfdemux/gstasfdemux.c]) 23 24dnl define the output header for config 25AC_CONFIG_HEADERS(config.h) 26 27dnl AM_MAINTAINER_MODE only provides the option to configure to enable it 28AM_MAINTAINER_MODE([enable]) 29 30dnl sets host_* variables 31AC_CANONICAL_HOST 32 33dnl use pretty build output with automake >= 1.11 34m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])], 35 [AM_DEFAULT_VERBOSITY=1 36 AC_SUBST(AM_DEFAULT_VERBOSITY)]) 37 38dnl our libraries and install dirs use GST_API_VERSION in the filename 39dnl to allow side-by-side installation of different API versions 40GST_API_VERSION=1.0 41AC_SUBST(GST_API_VERSION) 42AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION", 43 [GStreamer API Version]) 44 45AS_LIBTOOL(GST, 1602, 0, 1602) 46 47dnl *** required versions of GStreamer stuff *** 48GST_REQ=1.16.2 49GSTPB_REQ=1.16.2 50 51dnl *** autotools stuff **** 52 53dnl allow for different autotools 54AS_AUTOTOOLS_ALTERNATE 55 56dnl Add parameters for aclocal 57AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4") 58 59dnl set up gettext 60dnl the version check needs to stay here because autopoint greps for it 61AM_GNU_GETTEXT_VERSION(0.17) 62AM_GNU_GETTEXT([external]) 63AG_GST_GETTEXT([gst-plugins-ugly-$GST_API_VERSION]) 64 65dnl *** check for arguments to configure *** 66 67AG_GST_ARG_DISABLE_FATAL_WARNINGS 68AG_GST_ARG_ENABLE_EXTRA_CHECKS 69 70AG_GST_ARG_DEBUG 71AG_GST_ARG_PROFILING 72AG_GST_ARG_VALGRIND 73AG_GST_ARG_GCOV 74 75AG_GST_ARG_EXAMPLES 76 77AG_GST_ARG_WITH_PKG_CONFIG_PATH 78AG_GST_ARG_WITH_PACKAGE_NAME 79AG_GST_ARG_WITH_PACKAGE_ORIGIN 80 81AG_GST_ARG_WITH_PLUGINS 82 83AG_GST_ARG_ENABLE_EXTERNAL 84 85AG_GST_ARG_ENABLE_EXPERIMENTAL 86 87dnl *** checks for platform *** 88 89dnl * hardware/architecture * 90 91dnl common/m4/gst-arch.m4 92dnl check CPU type 93AG_GST_ARCH 94 95dnl Determine endianness 96AC_C_BIGENDIAN 97 98dnl *** software *** 99 100dnl check for large file support 101dnl affected plugins must include config.h 102AC_SYS_LARGEFILE 103 104dnl *** checks for programs *** 105 106dnl find a compiler 107AC_PROG_CC 108AC_PROG_CC_STDC 109 110dnl determine c++ compiler 111AC_PROG_CXX 112dnl determine if c++ is available on this system 113AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no) 114 115dnl check if the compiler supports '-c' and '-o' options 116AM_PROG_CC_C_O 117 118AC_PATH_PROG(VALGRIND_PATH, valgrind, no) 119AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno") 120 121dnl check if the compiler supports do while(0) macros 122AG_GST_CHECK_DOWHILE_MACROS 123 124dnl check for documentation tools 125GTK_DOC_CHECK([1.12]) 126AG_GST_PLUGIN_DOCS([1.12]) 127 128dnl *** checks for libraries *** 129 130dnl check for libm, for sin() 131LT_LIB_M 132AC_SUBST(LIBM) 133 134dnl *** checks for header files *** 135 136dnl used by ext/a52dec 137AX_CREATE_STDINT_H 138 139dnl Check for malloc.h 140AC_CHECK_HEADERS([malloc.h]) 141 142dnl *** checks for types/defines *** 143 144dnl *** checks for structures *** 145 146dnl *** checks for compiler characteristics *** 147 148dnl *** checks for library functions *** 149 150dnl Check for a way to display the function name in debug output 151AG_GST_CHECK_FUNCTION 152 153dnl *** checks for dependency libraries *** 154 155dnl GLib is required 156GLIB_REQ=2.40.0 157AG_GST_GLIB_CHECK([$GLIB_REQ]) 158 159ORC_CHECK([0.4.16]) 160 161dnl checks for gstreamer 162dnl uninstalled is selected preferentially -- see pkg-config(1) 163AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes) 164AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], yes) 165AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no) 166AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], yes) 167AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes") 168 169dnl Check for documentation xrefs 170GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`" 171GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`" 172GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_API_VERSION`" 173AC_SUBST(GLIB_PREFIX) 174AC_SUBST(GST_PREFIX) 175AC_SUBST(GSTPB_PREFIX) 176 177dnl Needed by plugins that use g_module_*() API 178PKG_CHECK_MODULES(GMODULE_NO_EXPORT, gmodule-no-export-2.0) 179 180dnl Check for -Bsymbolic-functions linker flag used to avoid 181dnl intra-library PLT jumps, if available. 182AC_ARG_ENABLE(Bsymbolic, 183 [AS_HELP_STRING([--disable-Bsymbolic],[avoid linking with -Bsymbolic])],, 184 [SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}" 185 AC_MSG_CHECKING([for -Bsymbolic-functions linker flag]) 186 LDFLAGS=-Wl,-Bsymbolic-functions 187 LIBS= 188 AC_TRY_LINK([], [return 0], 189 AC_MSG_RESULT(yes) 190 enable_Bsymbolic=yes, 191 AC_MSG_RESULT(no) 192 enable_Bsymbolic=no) 193 LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"]) 194 195dnl *** set variables based on configure arguments *** 196 197dnl set license and copyright notice 198GST_LICENSE="LGPL" 199AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license]) 200AC_SUBST(GST_LICENSE) 201 202dnl set location of plugin directory 203AG_GST_SET_PLUGINDIR 204 205dnl set release date/time 206AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO], 207 ["${srcdir}/gst-plugins-ugly.doap"], 208 [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO]) 209 210dnl define an ERROR_CFLAGS Makefile variable 211AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [ 212 -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls 213 -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition 214 -Winit-self -Wmissing-include-dirs -Waddress 215 -Waggregate-return -Wno-multichar -Wnested-externs ]) 216 217dnl define an ERROR_CXXFLAGS Makefile variable 218AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [ 219 -Wmissing-declarations -Wredundant-decls 220 -Wwrite-strings -Wformat-nonliteral -Wformat-security 221 -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return 222 -Wno-multichar]) 223 224dnl define correct level for debugging messages 225AG_GST_SET_LEVEL_DEFAULT($GST_GIT) 226 227dnl used in examples 228AG_GST_DEFAULT_ELEMENTS 229 230dnl *** plug-ins to include *** 231 232dnl these are all the gst plug-ins, compilable without additional libs 233AG_GST_CHECK_PLUGIN(asfdemux) 234AG_GST_CHECK_PLUGIN(dvdlpcmdec) 235AG_GST_CHECK_PLUGIN(dvdsub) 236AG_GST_CHECK_PLUGIN(xingmux) 237AG_GST_CHECK_PLUGIN(realmedia) 238 239AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes) 240 241if test "x$HAVE_WINSOCK2_H" = "xyes"; then 242 WIN32_LIBS="-lws2_32" 243 AC_SUBST(WIN32_LIBS) 244fi 245 246dnl *** ext plug-ins *** 247dnl keep this list sorted alphabetically ! 248 249if test "x$BUILD_EXTERNAL" = "xyes"; then 250 251echo 252AC_MSG_NOTICE([Checking libraries for plugins in ext/]) 253echo 254 255dnl *** a52dec *** 256translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true) 257AG_GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [ 258 AC_CHECK_A52DEC(HAVE_A52DEC=yes, HAVE_A52DEC=no) 259]) 260 261dnl *** amr-nb *** 262translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true) 263AG_GST_CHECK_FEATURE(AMRNB, [amrnb library], amrnb, [ 264 AG_GST_PKG_CHECK_MODULES(AMRNB, opencore-amrnb >= 0.1.3) 265]) 266 267dnl *** amr-wb dec *** 268translit(dnm, m, l) AM_CONDITIONAL(USE_AMRWB, true) 269AG_GST_CHECK_FEATURE(AMRWB, [amrwb library], amrwbdec, [ 270 AG_GST_PKG_CHECK_MODULES(AMRWB, opencore-amrwb >= 0.1.3) 271]) 272 273dnl *** cdio *** 274translit(dnm, m, l) AM_CONDITIONAL(USE_CDIO, true) 275AG_GST_CHECK_FEATURE(CDIO, [cdio library], cdio, [ 276 AG_GST_PKG_CHECK_MODULES(CDIO, libcdio >= 0.76) 277]) 278 279dnl *** dvdread *** 280translit(dnm, m, l) AM_CONDITIONAL(USE_DVDREAD, true) 281AG_GST_CHECK_FEATURE(DVDREAD, [dvdread library], dvdreadsrc, [ 282 AG_GST_CHECK_LIBHEADER(DVDREAD, dvdread, DVDOpen, , dvdread/dvd_reader.h, DVDREAD_LIBS="-ldvdread") 283 AC_SUBST(DVDREAD_LIBS) 284]) 285 286dnl *** mpeg2dec *** 287translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true) 288AG_GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [ 289 AG_GST_PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.5.1) 290]) 291 292dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) *** 293translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true) 294AG_GST_CHECK_FEATURE(SIDPLAY, [libsidplay], sid, [ 295 GST_PATH_SIDPLAY() 296]) 297 298dnl *** x264 (MPEG-4 part 10/h.264/AVC encoder) *** 299translit(dnm, m, l) AM_CONDITIONAL(USE_X264, true) 300AG_GST_CHECK_FEATURE(X264, [x264 plug-in], x264, [ 301 AG_GST_PKG_CHECK_MODULES(X264, x264 >= 0.120) 302 303 dnl Paths to additional x264 library variants, e.g. 10/12 bit 304 AC_ARG_WITH([x264-libraries], 305 AS_HELP_STRING([--with-x264-libraries=PATHS], [Colon separated list of additional x264 library paths, e.g. for 10-bit version]), 306 [ 307 if test "x$withval" != "x" 308 then 309 AC_DEFINE_UNQUOTED(HAVE_X264_ADDITIONAL_LIBRARIES, "$withval", [Additional x264 libraries]) 310 fi 311 ], [] 312 ) 313]) 314 315else 316 317dnl not building plugins with external dependencies, 318dnl but we still need to set the conditionals 319 320AM_CONDITIONAL(USE_A52DEC, false) 321AM_CONDITIONAL(USE_AMRNB, false) 322AM_CONDITIONAL(USE_AMRWB, false) 323AM_CONDITIONAL(USE_CDIO, false) 324AM_CONDITIONAL(USE_DVDREAD, false) 325AM_CONDITIONAL(USE_MPEG2DEC, false) 326AM_CONDITIONAL(USE_SIDPLAY, false) 327AM_CONDITIONAL(USE_X264, false) 328 329fi dnl of EXT plugins 330 331dnl *** finalize CFLAGS, LDFLAGS, LIBS 332 333dnl Overview: 334dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ... 335dnl GST_*: flags shared by built objects to link against GStreamer 336dnl GST_ALL_LDFLAGS: linker flags shared by all 337dnl GST_LIB_LDFLAGS: additional linker flags for all libaries 338dnl GST_LT_LDFLAGS: library versioning of our libraries 339dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins 340 341dnl GST_OPTION_CFLAGS 342if test "x$USE_DEBUG" = xyes; then 343 PROFILE_CFLAGS="-g" 344fi 345AC_SUBST(PROFILE_CFLAGS) 346 347if test "x$PACKAGE_VERSION_NANO" = "x1"; then 348 dnl Define _only_ during CVS (not pre-releases or releases) 349 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED" 350else 351 DEPRECATED_CFLAGS="" 352fi 353AC_SUBST(DEPRECATED_CFLAGS) 354 355VISIBILITY_CFLAGS="" 356AS_COMPILER_FLAG([-fvisibility=hidden], [VISIBILITY_CFLAGS="-fvisibility=hidden"]) 357AC_SUBST(VISIBILITY_CFLAGS) 358 359VISIBILITY_CXXFLAGS="" 360if test "x$HAVE_CXX" = "xyes"; then 361 AS_CXX_COMPILER_FLAG([-fvisibility=hidden], [VISIBILITY_CXXFLAGS="-fvisibility=hidden"]) 362fi 363AC_SUBST(VISIBILITY_CXXFLAGS) 364 365dnl disable strict aliasing 366AS_COMPILER_FLAG([-fno-strict-aliasing], [EXTRA_CFLAGS="-fno-strict-aliasing"]) 367AC_SUBST(EXTRA_CFLAGS) 368 369dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden 370dnl at make time with e.g. make ERROR_CFLAGS="" 371GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)" 372GST_OPTION_CXXFLAGS="\$(WARNING_CXXFLAGS) \$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)" 373AC_SUBST(GST_OPTION_CFLAGS) 374AC_SUBST(GST_OPTION_CXXFLAGS) 375 376dnl FIXME: do we want to rename to GST_ALL_* ? 377dnl prefer internal headers to already installed ones 378dnl also add builddir include for enumtypes and marshal 379dnl add GST_OPTION_CFLAGS, but overridable 380GST_CFLAGS="$GST_CFLAGS" 381GST_CXXFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $EXTRA_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CXXFLAGS) \$(VISIBILITY_CXXFLAGS)" 382GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $EXTRA_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS) \$(VISIBILITY_CFLAGS)" 383AC_SUBST(GST_CFLAGS) 384AC_SUBST(GST_CXXFLAGS) 385AC_SUBST(GST_LIBS) 386 387dnl LDFLAGS really should only contain flags, not libs - they get added before 388dnl whatevertarget_LIBS and -L flags here affect the rest of the linking 389GST_ALL_LDFLAGS="-no-undefined" 390if test "x${enable_Bsymbolic}" = "xyes"; then 391 GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions" 392fi 393AC_SUBST(GST_ALL_LDFLAGS) 394 395dnl this really should only contain flags, not libs - they get added before 396dnl whatevertarget_LIBS and -L flags here affect the rest of the linking 397GST_PLUGIN_LDFLAGS="-module -avoid-version $GST_ALL_LDFLAGS" 398AC_SUBST(GST_PLUGIN_LDFLAGS) 399 400dnl *** output files *** 401 402AC_CONFIG_FILES( 403Makefile 404common/Makefile 405common/m4/Makefile 406gst-libs/Makefile 407gst-libs/gst/Makefile 408gst/Makefile 409gst/asfdemux/Makefile 410gst/dvdlpcmdec/Makefile 411gst/dvdsub/Makefile 412gst/realmedia/Makefile 413gst/xingmux/Makefile 414ext/Makefile 415ext/a52dec/Makefile 416ext/amrnb/Makefile 417ext/amrwbdec/Makefile 418ext/cdio/Makefile 419ext/dvdread/Makefile 420ext/mpeg2dec/Makefile 421ext/sidplay/Makefile 422ext/x264/Makefile 423docs/Makefile 424docs/plugins/Makefile 425docs/version.entities 426tests/Makefile 427tests/check/Makefile 428tests/files/Makefile 429m4/Makefile 430po/Makefile.in 431pkgconfig/Makefile 432pkgconfig/gstreamer-plugins-ugly-uninstalled.pc 433) 434 435AC_OUTPUT 436 437AG_GST_OUTPUT_PLUGINS 438 439ORC_OUTPUT 440