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
|
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([libresource],
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
[multimedia at ok.research.nokia.com])
AC_CONFIG_SRCDIR([src])
AC_CONFIG_MACRO_DIR([m4])
#AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AC_CONFIG_HEADERS([config.h])
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_GNU_SOURCE
AC_HEADER_STDC
AC_INCLUDES_DEFAULT
m4_define(version_major, `echo $VERSION | cut -d. -f1 | cut -d- -f1`)
m4_define(version_minor, `echo $VERSION | cut -d. -f2 | cut -d- -f1`)
m4_define(version_patch, `echo $VERSION | cut -d. -f3 | cut -d- -f1`)
AC_SUBST(VERSION)
AC_SUBST(VERSION_MAJOR, version_major)
AC_SUBST(VERSION_MINOR, version_minor)
AC_SUBST(VERSION_PATCH, version_patch)
AC_SUBST(VERSION_FULL, version_major.version_minor.version_patch)
# libtool API versioning
AC_PROG_LIBTOOL
LIBRESOURCE_VERSION_INFO="0:18:0"
AC_SUBST(LIBRESOURCE_VERSION_INFO)
# check pkgconfig
AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
AS_IF([test x"$have_pkg_config" = "xno"], AC_MSG_ERROR([pkg-config is required to install this library]))
# Checks for DBUS.
PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.70 dbus-1 >= 0.70)
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
# options
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug],[Enable debug (log) @<:@default=false@:>@]),
[case "${enableval}" in
yes) debug=true ; CFLAGS="-ggdb -O0 $CFLAGS" ;;
no) debug=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac],[debug=false])
AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
# shave
SHAVE_INIT([build-aux], [enable])
AC_CONFIG_FILES([build-aux/shave
build-aux/shave-libtool
libresource0.pc
libresource0-glib.pc
Makefile
src/Makefile
client/Makefile
examples/Makefile
tests/Makefile
])
AC_OUTPUT
echo "
== $PACKAGE_NAME ==
Version: $VERSION
API: ${LIBRESOURCE_VERSION_INFO//:/.}
Compiler: ${CC}
CFLAGS: ${CFLAGS}
Debug enabled: ${debug}
With example: ${have_dbus_glib}
"
|