configure.ac 6.46 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# gst version number
m4_define([gst_major_version], [0])
m4_define([gst_minor_version], [10])
m4_define([gst_micro_version], [0])
m4_define([gst_major_minor_version],
          [gst_major_version.gst_minor_version])
m4_define([gst_version],
          [gst_major_version.gst_minor_version.gst_micro_version])

# gst plugins-base version number
m4_define([gst_plugins_base_major_version], [0])
m4_define([gst_plugins_base_minor_version], [10])
m4_define([gst_plugins_base_micro_version], [0])
m4_define([gst_plugins_base_version],
          [gst_plugins_base_major_version.gst_plugins_base_minor_version.gst_plugins_base_micro_version])

# gst_vaapi package version number
m4_define([gst_vaapi_major_version], [0])
m4_define([gst_vaapi_minor_version], [1])
m4_define([gst_vaapi_micro_version], [0])
m4_define([gst_vaapi_version],
          [gst_vaapi_major_version.gst_vaapi_minor_version.gst_vaapi_micro_version])

gb's avatar
gb committed
24 25 26 27 28 29 30 31 32 33 34 35
# libva package version number
m4_define([libva_sds_version_0_29], [8])
m4_define([libva_sds_package_version_0_29], [0.29-2+sds11])
m4_define([libva_sds_version_0_30], [1])
m4_define([libva_sds_package_version_0_30], [0.30-1+sds1])
m4_define([libva_glx_sds_version_0_30], [5])
m4_define([libva_glx_sds_package_version_0_30], [0.30.4-1+sds6])
m4_define([libva_glx_sds_version_0_31], [1])
m4_define([libva_glx_sds_package_version_0_31], [0.31.0-1+sds1])
m4_define([libva_sds_version], [libva_glx_sds_version_0_31])
m4_define([libva_sds_package_version], [libva_glx_sds_package_version_0_31])

36 37 38 39 40 41 42 43 44
AC_PREREQ([2.57])
AC_INIT([gst_vaapi], [gst_vaapi_version],
    [gbeauchesne@splitted-desktop.com],
    [gstreamer-vaapi])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER([config.h])

gb's avatar
gb committed
45 46 47 48 49 50 51 52 53
TODAY="`LC_ALL=C date +'%a, %d %b %Y %X %z'`"
AC_SUBST(TODAY)

GST_VAAPI_MAJOR_VERSION=gst_vaapi_major_version
AC_SUBST(GST_VAAPI_MAJOR_VERSION)

LIBVA_SDS_PACKAGE_VERSION=libva_sds_package_version
AC_SUBST(LIBVA_SDS_PACKAGE_VERSION)

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
dnl Check for __attribute__((visibility()))
AC_CACHE_CHECK([whether __attribute__((visibility())) is supported],
  vaapi_cv_visibility_attribute,
  [cat > conftest.c <<EOF
int foo __attribute__ ((visibility ("hidden"))) = 1;
int bar __attribute__ ((visibility ("protected"))) = 1;
EOF
  vaapi_cv_visibility_attribute=no
  if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
    if grep '\.hidden.*foo' conftest.s >/dev/null; then
      if grep '\.protected.*bar' conftest.s >/dev/null; then
	vaapi_cv_visibility_attribute=yes
      fi
    fi
  fi
  rm -f conftest.[cs]
])
if test $vaapi_cv_visibility_attribute = yes; then
  vaapi_cv_visibility_attribute_hidden="__attribute__((visibility(\"hidden\")))"
else
  vaapi_cv_visibility_attribute_hidden=""
fi
AC_DEFINE_UNQUOTED([attribute_hidden],
                   [$vaapi_cv_visibility_attribute_hidden],
                   [Define the "hidden" visibility attribute])

80 81 82 83 84 85 86 87
dnl Versions for GStreamer and plugins-base
GST_MAJORMINOR=gst_major_minor_version
GST_VERSION_REQUIRED=gst_version
GST_PLUGINS_BASE_VERSION_REQUIRED=gst_plugins_base_version
AC_SUBST(GST_MAJORMINOR)

dnl Check for tools
AC_PROG_CC
88
AM_PROG_CC_C_O
89 90
AC_PROG_LIBTOOL

91 92 93 94 95
dnl Check for GLib
PKG_CHECK_MODULES([GLIB], [glib-2.0])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)

96 97 98 99 100 101 102 103 104 105 106 107 108 109
dnl Check for GStreamer
PKG_CHECK_MODULES([GST],
    [gstreamer-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED]
)
AC_SUBST(GST_CFLAGS)
AC_SUBST(GST_LIBS)

dnl Check for GStreamer plugins-base
PKG_CHECK_MODULES([GST_PLUGINS_BASE],
    [gstreamer-plugins-base-$GST_MAJORMINOR >= $GST_PLUGINS_BASE_VERSION_REQUIRED]
)
AC_SUBST(GST_PLUGINS_BASE_CFLAGS)
AC_SUBST(GST_PLUGINS_BASE_LIBS)

110 111 112 113 114 115 116 117 118 119 120 121 122 123
dnl Check for GStreamer base
PKG_CHECK_MODULES([GST_BASE],
    [gstreamer-base-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED]
)
AC_SUBST(GST_BASE_CFLAGS)
AC_SUBST(GST_BASE_LIBS)

dnl Check for GStreamer video
PKG_CHECK_MODULES([GST_VIDEO],
    [gstreamer-video-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED]
)
AC_SUBST(GST_VIDEO_CFLAGS)
AC_SUBST(GST_VIDEO_LIBS)

124 125 126 127 128 129 130 131 132 133 134
dnl Check for the GStreamer plugins directory
AC_MSG_CHECKING([for GStreamer plugins directory])
GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_MAJORMINOR --variable pluginsdir`
if test -z "$GST_PLUGINS_DIR"; then
    echo "FAIL FAIL FAIL"
    GST_PLUGINS_DIR="\$(libdir)/gstreamer-$GST_MAJORMINOR"
fi
AC_MSG_RESULT([$GST_PLUGINS_DIR])
plugindir="$GST_PLUGINS_DIR"
AC_SUBST(plugindir)

gb's avatar
gb committed
135 136
dnl Check for VA-API
PKG_CHECK_MODULES(LIBVA, [libva])
gb's avatar
gb committed
137
PKG_CHECK_MODULES(X11, [x11])
gb's avatar
gb committed
138
PKG_CHECK_MODULES(LIBVA_X11, [libva-x11])
139

gb's avatar
gb committed
140 141
dnl Check for SDS extensions to VA-API
AC_CACHE_CHECK([for VA-API],
142 143 144 145 146 147 148
  ac_cv_libva_sds_extensions, [
  saved_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS $LIBVA_DEPS_CFLAGS"
  AC_TRY_COMPILE([
    #include <va/va_version.h>
    #if VA_MAJOR_VERSION == 0 && VA_MINOR_VERSION == 29
    # if !defined(VA_SDS_VERSION) || (VA_SDS_VERSION < $LIBVA_SDS_VERSION_0_29)
gb's avatar
gb committed
149
    #  error "VA-API version >= 0.29.0-sds$LIBVA_SDS_VERSION_0_29 is required"
150 151 152
    # endif
    #elif VA_MAJOR_VERSION == 0 && VA_MINOR_VERSION == 30
    # if !defined(VA_SDS_VERSION) || (VA_SDS_VERSION < $LIBVA_SDS_VERSION_0_30)
gb's avatar
gb committed
153
    #  error "VA-API version >= 0.30.0-sds$LIBVA_SDS_VERSION_0_30 is required"
154 155
    # endif
    #elif !VA_CHECK_VERSION(0,31,0)
gb's avatar
gb committed
156
    # error "VA-API version >= 0.31 is required"
157 158 159 160 161 162 163 164 165 166 167 168 169
    #endif
  ], [],
  [ac_cv_libva_sds_extensions="yes"],
  [ac_cv_libva_sds_extensions="no"])
  CFLAGS="$saved_CFLAGS"
])
VA_VERSION=`$PKG_CONFIG --modversion libva`
VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1`
VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2`
VA_DRIVER_INIT_FUNC="__vaDriverInit_${VA_MAJOR_VERSION}_${VA_MINOR_VERSION}_sds"
if test "$ac_cv_libva_sds_extensions" = "yes"; then
    AC_DEFINE_UNQUOTED([VA_DRIVER_INIT_FUNC], [$VA_DRIVER_INIT_FUNC], [Define driver entry-point])
else
gb's avatar
gb committed
170
    AC_MSG_ERROR([Your VA-API SDK does not include SDS extensions])
171 172
fi

gb's avatar
gb committed
173 174 175
pkgconfigdir=${libdir}/pkgconfig
AC_SUBST(pkgconfigdir)

176 177
AC_OUTPUT([
    Makefile
gb's avatar
gb committed
178 179 180
    debian/Makefile
    debian/changelog
    debian/control
gb's avatar
gb committed
181 182 183 184 185 186 187 188
    debian/gstreamer$GST_MAJORMINOR-vaapi.install:\
debian/gstreamer-vaapi.install.in
    debian/libgstvaapi$GST_VAAPI_MAJOR_VERSION.install:\
debian/libgstvaapi.install.in
    debian/libgstvaapi$GST_VAAPI_MAJOR_VERSION-dev.install:\
debian/libgstvaapi-dev.install.in
    debian/libgstvaapi-x11-$GST_VAAPI_MAJOR_VERSION.install:\
debian/libgstvaapi-x11.install.in
189 190 191
    gst-libs/Makefile
    gst-libs/gst/Makefile
    gst-libs/gst/vaapi/Makefile
gb's avatar
gb committed
192 193 194
    pkgconfig/Makefile
    pkgconfig/gstreamer-vaapi.pc
    pkgconfig/gstreamer-vaapi-x11.pc
195
    sys/Makefile
gb's avatar
gb committed
196 197
    sys/vaapiconvert/Makefile
    sys/vaapisink/Makefile
gb's avatar
gb committed
198
    tests/Makefile
199
])