source: trunk/configure.ac @ 223

Last change on this file since 223 was 223, checked in by simon, 4 years ago

Bump version to 0.2.2, update ChangeLog?

File size: 3.2 KB
Line 
1#
2# Process this file with autoconf to produce a configure script.
3#
4m4_define([memphis_major_version], [0])
5m4_define([memphis_minor_version], [2])
6m4_define([memphis_micro_version], [2])
7m4_define([memphis_version],
8          [memphis_major_version.memphis_minor_version.memphis_micro_version])
9m4_define([api_version],
10          [memphis_major_version.memphis_minor_version])
11
12AC_PREREQ(2.62)
13AC_INIT([memphis],
14        [memphis_version],
15        [http://trac.openstreetmap.ch/trac/memphis/])
16AC_CONFIG_SRCDIR([memphis/memphis.h])
17AC_CONFIG_HEADER([config.h])
18AC_CONFIG_MACRO_DIR([m4])
19
20AM_INIT_AUTOMAKE([-Wno-portability])
21AC_LIBTOOL_DLOPEN
22
23m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
24
25# Checks for programs.
26AC_PROG_CC
27AM_PROG_CC_C_O
28AM_PROG_LIBTOOL
29
30CPPFLAGS+="-Wall -Werror"
31
32# API_VERSION is used to generate pc file only
33API_VERSION=api_version
34AC_SUBST(API_VERSION)
35
36# used for -version-info current[:revision[:age]]
37# see http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html
38LIBRARY_VERSION=0:2:0
39AC_SUBST(LIBRARY_VERSION)
40
41AC_SUBST(DEPS_CFLAGS)
42AC_SUBST(DEPS_LIBS)
43
44# check for gnome libraries
45PKG_CHECK_MODULES(DEPS,
46  [   glib-2.0 >= 2.16,
47      gobject-2.0 >= 2.10,
48      cairo >= 1.4
49  ]
50)
51
52# link against libmath
53DEPS_LIBS+="-lm"
54
55# check for expat
56AC_CHECK_LIB([expat], [XML_ParserCreate], [DEPS_LIBS="$DEPS_LIBS -lexpat"],
57  [AC_MSG_ERROR([cannot find expat library])])
58AC_CHECK_HEADER([expat.h], [],
59  [AC_MSG_ERROR([cannot find expat.h header])])
60
61# check for gtk-doc
62GTK_DOC_CHECK(1.12)
63
64# check for gobject-introspection
65GOBJECT_INTROSPECTION_CHECK([0.6.7])
66
67# -----------------------------------------------------------
68# Enable debug
69# -----------------------------------------------------------
70
71AC_ARG_ENABLE(debug,
72  AC_HELP_STRING([--enable-debug],
73    [turn on debugging [default=no]]),[],[enable_debug="no"])
74if test x$enable_debug = xyes; then
75  AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
76fi
77
78# -----------------------------------------------------------
79# Enable Vala Bindings
80# -----------------------------------------------------------
81
82AC_ARG_ENABLE(vala,
83  AC_HELP_STRING([--enable-vala],
84    [install Vala bindings [default=no]]),[],[enable_vala="no"])
85
86if test x$enable_vala = xyes; then
87  AM_PROG_VALAC([0.8.0])
88  if test x${VALAC} = x""; then
89    exit 0;
90  fi
91  VALA_EXAMPLE_PACKAGES="--pkg cairo --pkg memphis-0.2"
92  PKG_CHECK_MODULES(VALA_EXAMPLE, [glib-2.0, cairo, memphis-0.2])
93  AC_SUBST(VALA_EXAMPLE_CFLAGS)
94  AC_SUBST(VALA_EXAMPLE_LIBS)
95  AC_SUBST(VALA_EXAMPLE_PACKAGES)
96fi
97
98AM_CONDITIONAL(ENABLE_VALA, test x${VALAC} != x"")
99
100# -----------------------------------------------------------
101AC_CONFIG_FILES([Makefile
102                 memphis/Makefile
103                 demos/Makefile
104                 tests/Makefile
105                 docs/reference/Makefile
106                 memphis.pc
107                 bindings/Makefile
108                 bindings/vala/Makefile
109                 bindings/vala/demos/Makefile
110                ])
111AC_OUTPUT
112
113echo ""
114echo " memphis $VERSION"
115echo ""
116echo "          Prefix: ${prefix}"
117echo "  Compiler flags: ${CPPFLAGS}"
118echo "           Debug: ${enable_debug}"
119echo "   Documentation: ${enable_gtk_doc}"
120echo ""
121echo "   Introspection: ${enable_introspection}"
122echo "   Vala bindings: ${enable_vala}"
123echo ""
124
Note: See TracBrowser for help on using the repository browser.