summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 61656ad4cfcd27390032ef3927957cd0e6929b6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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
80
81
82
83
84
85
86
87
88
89
90
91
92
AC_PREREQ([2.58])
AC_INIT(swfdec-directfb,0.7.3)

[is_dev=$(echo $PACKAGE_VERSION | sed 's/[0-9]\.[0-9][0-9]*\.[0-9]*[13579]/1/')]
if test x"$is_dev" = x1 ; then
  SWFDEC_CVS="yes"
else
  SWFDEC_CVS="no"
fi


AM_INIT_AUTOMAKE(1.6)
dnl AC_CANONICAL_TARGET([])
AM_MAINTAINER_MODE

SWFDEC_MAJORMINOR=0.7
AC_SUBST(SWFDEC_MAJORMINOR)

AM_CONFIG_HEADER(config.h)
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")

dnl decide on error flags
dnl if we support them, we set them unconditionally
AS_COMPILER_FLAG(-Wall, GLOBAL_CFLAGS="-Wall", GLOBAL_CFLAGS="")
AS_COMPILER_FLAG(-Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-nonliteral -Wformat-security -Wswitch-enum -Wswitch-default, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-nonliteral -Wformat-security -Wswitch-enum -Wswitch-default")
dnl if we're in nano >= 1, add -Werror if supported
if test x$SWFDEC_CVS = xyes ; then
  AS_COMPILER_FLAG(-Werror, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Werror")
fi

SWFDEC_LIBVERSION="0:0:0"
AC_SUBST(SWFDEC_LIBVERSION)
AM_PROG_LIBTOOL

AC_PROG_CC
AM_PROG_CC_STDC
AM_PROG_CC_C_O

AC_HEADER_STDC([])

dnl ##############################
dnl # Do automated configuration #
dnl ##############################

dnl Check for tools:
dnl ================

dnl modify pkg-config path
AC_ARG_WITH(pkg-config-path, 
   AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
   [export PKG_CONFIG_PATH=${withval}])

dnl Check for essential libraries first:
dnl ====================================

SWFDEC_REQUIRES=0.7.3
AC_SUBST(SWFDEC_REQUIRES)
PKG_CHECK_MODULES(SWFDEC, swfdec-$SWFDEC_MAJORMINOR = $SWFDEC_REQUIRES, HAVE_SWFDEC=yes, HAVE_SWFDEC=no)
if test "$HAVE_SWFDEC" = "no"; then
  AC_MSG_ERROR([cannot find swfdec-$SWFDEC_MAJORMINOR $SWFDEC_REQUIRES, which is required for build])
fi

DIRECTFB_REQUIRES=0.9.25
AC_SUBST(DIRECTFB_REQUIRES)
PKG_CHECK_MODULES(DIRECTFB, directfb >= $DIRECTFB_REQUIRES, HAVE_DIRECTFB=yes, HAVE_DIRECTFB=no)
if test "$HAVE_DIRECTFB" = "no"; then
  AC_MSG_ERROR([cannot find directfb >= $DIECTFB_REQUIRES, which is required for build])
fi

PKG_CHECK_MODULES(CAIRO, cairo-directfb, HAVE_CAIRO=yes, HAVE_CAIRO=no)
if test "$HAVE_CAIRO" = "no"; then
  AC_MSG_ERROR([Cairo needs to have built-in DirectFB support to build])
fi

AC_SUBST(GLOBAL_CFLAGS)

SWFDEC_DFB_CFLAGS="-I\$(top_srcdir) $SWFDEC_CFLAGS $DIRECTFB_CFLAGS $CAIRO_CFLAGS"
SWFDEC_DFB_LIBS="\$(top_builddir)/swfdec-directfb/libswfdec-directfb-$SWFDEC_MAJORMINOR.la $SWFDEC_LIBS $DIRECTFB_LIBS $CAIRO_LIBS"
AC_SUBST(SWFDEC_DFB_CFLAGS)
AC_SUBST(SWFDEC_DFB_LIBS)

AC_CONFIG_FILES(
  Makefile
  data/swfdec-directfb.pc
  data/Makefile
  swfdec-directfb/Makefile
  player/Makefile
  test/Makefile
)

AC_OUTPUT