AC_INIT dnl versions of gstreamer and plugins-base GST_MAJORMINOR=0.10 GST_REQUIRED=0.10.0 GSTPB_REQUIRED=0.10.0 LIBMFLD_REQUIRED=0.10.0 dnl fill in your package name and version here dnl the fourth (nano) number should be 0 for a release, 1 for CVS, dnl and 2... for a prerelease dnl when going to/from release please set the nano correctly ! dnl releases only do Wall, cvs and prerelease does Werror too AS_VERSION(gst-plugins-camera, GST_PLUGIN_VERSION, 0, 10, 0, 0, GST_PLUGIN_CVS="no", GST_PLUGIN_CVS="yes") dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode AM_MAINTAINER_MODE AM_INIT_AUTOMAKE($PACKAGE, $VERSION) AM_SILENT_RULES dnl make aclocal work in maintainer mode AC_SUBST(ACLOCAL_AMFLAGS, "-I m4") AC_CONFIG_MACRO_DIR(m4) AM_CONFIG_HEADER(config.h) dnl check for tools AC_PROG_CC AC_PROG_LIBTOOL # check for gtk-doc # GTK_DOC_CHECK(1.6) dnl decide on error flags AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no") if test "x$GST_WALL" = "xyes"; then GST_ERROR="$GST_ERROR -Wall" if test "x$GST_PLUGIN_CVS" = "xyes"; then AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR") fi fi dnl Check for pkgconfig first AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no) dnl Give error and exit if we don't have pkgconfig if test "x$HAVE_PKGCONFIG" = "xno"; then AC_MSG_ERROR(you need to have pkgconfig installed !) fi dnl Now we're ready to ask for gstreamer libs and cflags dnl And we can also ask for the right version of gstreamer PKG_CHECK_MODULES(GST, \ gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED, HAVE_GST=yes,HAVE_GST=no) dnl Give error and exit if we don't have gstreamer if test "x$HAVE_GST" = "xno"; then AC_MSG_ERROR(you need gstreamer development packages installed !) fi dnl append GST_ERROR cflags to GST_CFLAGS GST_CFLAGS="$GST_CFLAGS $GST_ERROR" dnl make GST_CFLAGS and GST_LIBS available AC_SUBST(GST_CFLAGS) AC_SUBST(GST_LIBS) dnl make GST_MAJORMINOR available in Makefile.am AC_SUBST(GST_MAJORMINOR) AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [compile with DEBUG]),,enable_debug=no) DEBUG_FLAGS= dnl Check for debug build if test "x$enable_debug" = "xyes"; then DEBUG_FLAGS="-DDEBUG" fi dnl If we need them, we can also use the base class libraries PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQUIRED, HAVE_GST_BASE=yes, HAVE_GST_BASE=no) dnl Give a warning if we don't have gstreamer libs dnl you can turn this into an error if you need them if test "x$HAVE_GST_BASE" = "xno"; then AC_MSG_NOTICE(no GStreamer base class libraries found (gstreamer-base-$GST_MAJORMINOR)) fi dnl make _CFLAGS and _LIBS available AC_SUBST(GST_BASE_CFLAGS) AC_SUBST(GST_BASE_LIBS) dnl If we need them, we can also use the base class libraries PKG_CHECK_MODULES(GST_CONTROLLER, gstreamer-controller-$GST_MAJORMINOR >= $GST_REQUIRED, HAVE_GST_BASE=yes, HAVE_GST_BASE=no) dnl Give a warning if we don't have gstreamer libs dnl you can turn this into an error if you need them if test "x$HAVE_GST_BASE" = "xno"; then AC_MSG_NOTICE(no GStreamer controllerlibraries found (gstreamer-controller-$GST_MAJORMINOR)) fi dnl make _CFLAGS and _LIBS available AC_SUBST(GST_CONTROLLER_CFLAGS) AC_SUBST(GST_CONTROLLER_LIBS) dnl Check gst-plugins-bad PKG_CHECK_MODULES(GST_BAD, gstreamer-plugins-bad-$GST_MAJORMINOR, HAVE_GST_BAD=yes, HAVE_GST_BAD=no) if test "x$HAVE_GST_BAD" = "xno"; then AC_MSG_NOTICE(no gstreamer-plugins-bad libraries found (gstreamer-plugins-bad-$GST_MAJORMINOR)) fi dnl make _CFLAGS and _LIBS available AC_SUBST(GST_BAD_CFLAGS) AC_SUBST(GST_BAD_LIBS) dnl set the plugindir where plugins should be installed if test "x${prefix}" = "x$HOME"; then plugindir="$HOME/.gstreamer-$GST_MAJORMINOR/plugins" else plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR" fi AC_SUBST(plugindir) dnl set proper LDFLAGS for plugins GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*' AC_SUBST(GST_PLUGIN_LDFLAGS) 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 GST_ALL_LDFLAGS="-no-undefined" AC_SUBST(GST_ALL_LDFLAGS) dnl GST_LIB_LDFLAGS dnl linker flags shared by all libraries dnl LDFLAGS modifier defining exported symbols from built libraries dnl (export _gst_foo but not __gst_foo) GST_LIB_LDFLAGS="-export-symbols-regex ^_?\(gst_\|Gst\|GST_\).*" AC_SUBST(GST_LIB_LDFLAGS) dnl check gst check support HAVE_GST_CHECK=no PKG_CHECK_MODULES(GST_CHECK, gstreamer-check-$GST_MAJORMINOR, HAVE_GST_CHECK=yes, HAVE_GST_CHECK=no) AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes") AC_SUBST(GST_CHECK_CFLAGS) AC_SUBST(GST_CHECK_LIBS) dnl check gst check 3a support dnl LIBMFLDADVCI_CFLAGS dnl LIBMFLDADVCI_LIBS HAVE_LIBMFLDADVCI=yes PKG_CHECK_MODULES(LIBMFLDADVCI, libmfldadvci >= $LIBMFLD_REQUIRED, HAVE_LIBMFLDADVCI=yes, HAVE_LIBMFLDADVCI=no) AM_CONDITIONAL(HAVE_LIBMFLDADVCI, test ! "x$LIBMFLDADVCI" = "xyes") if test "x$HAVE_LIBMFLDADVCI" = "xyes"; then LIBMFLDADVCI_CFLAGS="" LIBMFLDADVCI_LIBS="" AC_SUBST(LIBMFLDADVCI_CFLAGS) AC_SUBST(LIBMFLDADVCI_LIBS) fi AC_PATH_PROG(VALGRIND_PATH, valgrind, no) AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno") GST_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-$GST_MAJORMINOR` AC_MSG_NOTICE([using GStreamer plug-ins in $GST_PLUGINS_DIR]) AC_SUBST(GST_PLUGINS_DIR) GENERAL_CFLAGS="-D___LINUX___ -D___GNUC___ -DOSAL_ROVER $DEBUG_FLAGS" AC_SUBST(GENERAL_CFLAGS) AC_OUTPUT(Makefile \ m4/Makefile \ gst-libs/Makefile \ gst-libs/atomisphal/Makefile \ gst-libs/gst/Makefile \ gst-libs/gst/camera/Makefile \ gst/Makefile \ gst/mfldv4l2cam/Makefile \ docs/Makefile \ docs/reference/Makefile \ docs/reference/gst-mfld-videosrc/Makefile pkgconfig/Makefile pkgconfig/gstreamer-atomisphal.pc pkgconfig/gstreamer-mfld-videosrc.pc)