configure.ac 4.08 KB
Newer Older
1 2 3 4
AC_PREREQ(2.60)
dnl initialize autoconf
dnl when going to/from release please set the nano (fourth number) right !
dnl releases only do Wall, cvs and prerelease does Werror too
5
AC_INIT([snappy],
6
    [1.0],
7
    NULL,
8
    snappy)
9
AM_MAINTAINER_MODE
10

11
AC_CONFIG_SRCDIR([src/snappy.c])
12 13 14 15
AM_CONFIG_HEADER([config.h])
AC_CONFIG_AUX_DIR([build-aux])

dnl initialize automake
16
AM_INIT_AUTOMAKE([1.11.1 no-dist-gzip dist-xz dist-bzip2 tar-ustar])
17 18 19 20 21 22 23 24 25

dnl use pretty build output with automake >= 1.11
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
  [AM_DEFAULT_VERBOSITY=1
   AC_SUBST(AM_DEFAULT_VERBOSITY)])
m4_define([_LT_AC_TAGCONFIG],[])

dnl find a compiler
AC_PROG_CC
26
AM_PROG_CC_C_O
27 28 29
AC_STDC_HEADERS
AM_PROG_LIBTOOL

30
dnl instruct libtool machinery that the package supports DLLs
31 32 33 34
AC_LIBTOOL_WIN32_DLL

AC_CANONICAL_HOST

35
# keep one single GST_REQ, core/base should be same versions anyway
36
GST_REQ=1.6.0
37
CLUTTER_REQS=1.20.0
38
CLUTTER_GST_REQS=3.0.0
39
CLUTTER_GTK_REQS=1.6.0
40
GTK_REQS=3.5.0
41 42 43 44 45
GIO_REQ=2.32

PKG_CHECK_MODULES([GST], \
    [gstreamer-1.0 >= $GST_REQ
    gstreamer-base-1.0 >= $GST_REQ
46
    gstreamer-plugins-base-1.0 >= $GST_REQ
47 48
    gstreamer-pbutils-1.0 >= $GST_REQ
    gstreamer-video-1.0 >= $GST_REQ])
49

50 51
AC_SUBST(GST_CFLAGS)
AC_SUBST(GST_LIBS)
52

53
PKG_CHECK_MODULES([CLUTTER],
54 55 56 57
    [clutter-1.0 >= $CLUTTER_REQS])
AC_SUBST(CLUTTER_CFLAGS)
AC_SUBST(CLUTTER_LIBS)

58
PKG_CHECK_MODULES([CLUTTER_GST], [clutter-gst-3.0 >= $CLUTTER_GST_REQS])
59 60 61
AC_SUBST(CLUTTER_GST_CFLAGS)
AC_SUBST(CLUTTER_GST_LIBS)

62 63 64 65 66 67 68 69
PKG_CHECK_MODULES([CLUTTER_GTK], [clutter-gtk-1.0 >= $CLUTTER_GTK_REQS])
AC_SUBST(CLUTTER_GTK_CFLAGS)
AC_SUBST(CLUTTER_GTK_LIBS)

PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= $GTK_REQS])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)

70
PKG_CHECK_MODULES(GIO, gio-2.0 >= $GIO_REQ)
71 72 73
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)

74 75 76
case "$host" in
  *-*-mingw*|*-*-cygwin*)
    PKG_CHECK_MODULES(CLUTTER_WIN32, clutter-win32-1.0,
77 78
      [AC_DEFINE(HAVE_WIN32, 1, [Define if Clutter Win32 is available.])],
      [])
79 80 81 82 83 84 85 86 87 88 89 90
    ;;
  *-*-darwin*)
    PKG_CHECK_MODULES(CLUTTER_OSX, clutter-osx-1.0,
      [AC_DEFINE(HAVE_OSX, 1, [Define if Clutter OSX is available.])],
      [
        PKG_CHECK_MODULES(CLUTTER_X11, clutter-x11-1.0,
          [AC_DEFINE(HAVE_X11, 1, [Define if Clutter X11 is available.])],
          [])
      ])
    ;;
  *)
    PKG_CHECK_MODULES(CLUTTER_X11, clutter-x11-1.0,
91 92
      [AC_DEFINE(HAVE_X11, 1, [Define if Clutter X11 is available.])],
      [])
93 94
    ;;
esac
95

96
PKG_CHECK_MODULES(XTEST, xtst,
97
    [AC_DEFINE(HAVE_XTEST, 1, [Define if XTest is available.])], [true])
98 99 100
AC_SUBST(XTEST_CFLAGS)
AC_SUBST(XTEST_LIBS)

101
AC_ARG_ENABLE([dbus],
102
    AS_HELP_STRING([--enable-dbus], [enable DBus support to disable the screensaver (default=yes)]),
103
      [],
104
      [enable_dbus=yes])
105 106 107 108 109 110 111

if test "x$enable_dbus" = "xyes"; then
  PKG_CHECK_MODULES(GIO_2_26, gio-2.0 >= 2.26,
      [AC_DEFINE(ENABLE_DBUS, 1, [Define if DBus support is enabled.])],
      [AC_MSG_ERROR([GIO >= 2.26 not found, which is required for DBus support])])
fi

112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
dnl our libraries and install dirs use major.minor as a version
GST_MAJORMINOR=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
dnl we override it here if we need to for the release candidate of new series
GST_MAJORMINOR=0.10
AC_SUBST(GST_MAJORMINOR)

AM_PROG_LIBTOOL

dnl Add parameters for aclocal
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
AC_CONFIG_MACRO_DIR([m4])

ROOT_UNINSTALLED_DIR="`pwd`"
AC_DEFINE_UNQUOTED(SHARE_UNINSTALLED_DIR,"`pwd`/$srcdir/data",[path to source data dir])
AC_DEFINE_UNQUOTED(SHARE_UNINSTALLED_BUILDDIR,"`pwd`/data",[path to built source data dir])
AC_SUBST(ROOT_UNINSTALLED_DIR)

dnl set license and copyright notice
GST_LICENSE="LGPL"
AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
AC_SUBST(GST_LICENSE)

dnl keep this alphabetic per directory, please
AC_CONFIG_FILES([
Makefile
data/Makefile
Alban Crequy's avatar
Alban Crequy committed
138 139 140
data/icons/Makefile
data/icons/256x256/Makefile
data/icons/48x48/Makefile
141 142 143 144 145 146 147 148 149 150 151 152
src/Makefile
])
AC_OUTPUT

echo "

Configuration
	Version                    : ${VERSION}
	Source code location       : ${srcdir}
	Prefix                     : ${prefix}
	Compiler                   : ${CC}

153
snappy configured. Type 'make' to build.
154
"