1## Copyright (c) 2009  Openismus GmbH  <http://www.openismus.com/>
2##
3## This file is part of cairomm.
4##
5## cairomm is free software: you can redistribute it and/or modify it
6## under the terms of the GNU Lesser General Public License as published
7## by the Free Software Foundation, either version 2.1 of the License,
8## or (at your option) any later version.
9##
10## cairomm is distributed in the hope that it will be useful, but
11## WITHOUT ANY WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13## See the GNU Lesser General Public License for more details.
14##
15## You should have received a copy of the GNU Lesser General Public License
16## along with this library.  If not, see <http://www.gnu.org/licenses/>.
17
18AC_INIT([cairomm], [1.12.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=cairomm],
19        [cairomm], [http://www.cairographics.org/cairomm/])
20AC_PREREQ([2.62])
21
22AC_CONFIG_SRCDIR([cairomm/cairomm.h])
23AC_CONFIG_AUX_DIR([build])
24AC_CONFIG_MACRO_DIR([build])
25AC_CONFIG_HEADERS([build/config.h cairommconfig.h])
26
27AM_INIT_AUTOMAKE([1.10 -Wno-portability no-define nostdinc tar-pax])
28m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
29AM_MAINTAINER_MODE
30AC_ARG_VAR([ACLOCAL_FLAGS], [aclocal flags, e.g. -I <macro dir>])
31
32MM_PREREQ([0.8])
33MM_INIT_MODULE([cairomm-1.0])
34MM_CONFIG_DOCTOOL_DIR([docs])
35
36# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
37AC_SUBST([CAIROMM_SO_VERSION], [5:0:4])
38
39AC_PROG_CXX
40MM_AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
41
42AC_DISABLE_STATIC
43AC_LIBTOOL_WIN32_DLL
44AC_PROG_LIBTOOL
45PKG_PROG_PKG_CONFIG
46
47AC_SUBST([CAIROMM_MODULES], ['cairo >= 1.10.0 sigc++-2.0 >= 2.5.1'])
48cairomm_allmodules=$CAIROMM_MODULES
49CAIROMM_INSTALL_PC='data/cairomm-1.0.pc'
50
51for cairomm_mod in ft pdf png ps svg xlib xlib-xrender \
52                   win32 win32-font quartz quartz-font quartz-image
53do
54  PKG_CHECK_EXISTS([cairo-$cairomm_mod],
55  [
56    cairomm_allmodules="$cairomm_allmodules cairo-$cairomm_mod"
57    CAIROMM_INSTALL_PC="$CAIROMM_INSTALL_PC data/cairomm-$cairomm_mod-1.0.pc"
58  ])
59done
60AC_SUBST([CAIROMM_INSTALL_PC])
61PKG_CHECK_MODULES([CAIROMM], [$cairomm_allmodules])
62
63MM_ARG_ENABLE_DOCUMENTATION
64MM_ARG_WITH_TAGFILE_DOC([libstdc++.tag], [mm-common-libstdc++])
65MM_ARG_WITH_TAGFILE_DOC([libsigc++-2.0.tag], [sigc++-2.0])
66
67AC_LANG([C++])
68MM_ARG_ENABLE_WARNINGS([CAIROMM_WXXFLAGS],
69                       [-Wall],
70                       [-pedantic -Wall -Wextra -Wformat-security -Wsuggest-override],
71                       [SIGCXX])
72
73AC_ARG_ENABLE([tests],
74              [AS_HELP_STRING([--enable-tests], [enable automated tests [default=no]])],
75              [ENABLE_TESTS=$enableval],
76              [ENABLE_TESTS=no])
77
78BOOST_UNIT_TEST_FRAMEWORK_STATIC_LIB=
79AS_IF([test "x$ENABLE_TESTS" = xyes],
80[
81#######################################################
82#boost build system sucks no end.
83#it is damn hard to detect the version of boost
84#that is installed. All that because our friends of
85#the boost project don't want to integrate to autofoo.
86#So we resort to hugly hacks to detect the version of
87#boost that is installed.
88#######################################################
89    AX_BOOST_BASE([1.33.1])
90    AX_BOOST_UNIT_TEST_FRAMEWORK
91
92    dnl AX_BOOST_BASE defines a --with-boost[=DIR] option that sets
93    dnl $ac_boost_path as a custom boost prefix, so use that if it was specified
94    AS_IF([test "x$ac_boost_path" != x],
95          [for i in "$ac_boost_path/lib/libboost_unit_test_framework.a" \
96                    "$ac_boost_path/lib/libboost_unit_test_framework-st.a" \
97                    "$ac_boost_path/libboost_unit_test_framework.a" \
98                    "$ac_boost_path/libboost_unit_test_framework-st.a"
99           do
100               AS_IF([test -f "$i"], [BOOST_UNIT_TEST_FRAMEWORK_STATIC_LIB=$i; break])
101           done],
102          [for i in /usr/lib/libboost_unit_test_framework-st.a \
103                    /usr/lib/libboost_unit_test_framework.a \
104                    /usr/lib64/libboost_unit_test_framework-st.a \
105                    /usr/lib64/libboost_unit_test_framework.a
106           do
107               AS_IF([test -f "$i"], [BOOST_UNIT_TEST_FRAMEWORK_STATIC_LIB=$i; break])
108           done])
109    AS_IF([test "x$BOOST_UNIT_TEST_FRAMEWORK_STATIC_LIB" != x],
110          [AC_MSG_NOTICE([support of automated tests enabled])],
111          [AC_MSG_ERROR([Tried to enable unit tests, but could not find Boost Unit Test
112framework static library candidate.  You can specify a custom location
113using --with-boost=/path/to/lib])])
114], [
115    AC_MSG_NOTICE([disabled support of automated tests])
116])
117AC_SUBST([BOOST_UNIT_TEST_FRAMEWORK_STATIC_LIB])
118
119AM_CONDITIONAL([AUTOTESTS], [test "x$ENABLE_TESTS" = xyes])
120CAIROMM_ARG_ENABLE_API_EXCEPTIONS
121
122AC_CONFIG_FILES([Makefile
123                 cairomm/Makefile
124                 tests/Makefile
125                 examples/Makefile
126                 docs/Makefile
127                 docs/reference/Doxyfile
128                 data/cairomm-1.0.pc
129                 data/cairomm-ft-1.0.pc
130                 data/cairomm-pdf-1.0.pc
131                 data/cairomm-png-1.0.pc
132                 data/cairomm-ps-1.0.pc
133                 data/cairomm-quartz-1.0.pc
134                 data/cairomm-quartz-font-1.0.pc
135                 data/cairomm-quartz-image-1.0.pc
136                 data/cairomm-svg-1.0.pc
137                 data/cairomm-win32-1.0.pc
138                 data/cairomm-win32-font-1.0.pc
139                 data/cairomm-xlib-1.0.pc
140                 data/cairomm-xlib-xrender-1.0.pc
141                 MSVC_Net2013/cairomm/cairomm.rc])
142
143AC_CONFIG_COMMANDS([MSVC_Net2013/cairomm/cairommconfig.h],
144                   [cp -f cairommconfig.h MSVC_Net2013/cairomm/cairommconfig.h])
145AC_OUTPUT
146