* bugfix from http://tracker.ardour.org/view.php?id=2155 thanks to kristian: fix...
[ardour.git] / libs / cairomm / configure.in
1 AC_INIT(cairomm/cairomm.h)
2
3 #release versioning
4 GENERIC_MAJOR_VERSION=1
5 GENERIC_MINOR_VERSION=4
6 GENERIC_MICRO_VERSION=6
7 GENERIC_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION.$GENERIC_MICRO_VERSION
8 AC_SUBST(GENERIC_MAJOR_VERSION)
9 AC_SUBST(GENERIC_MINOR_VERSION)
10 AC_SUBST(GENERIC_MICRO_VERSION)
11 AC_SUBST(GENERIC_VERSION)
12
13 #shared library versioning
14 GENERIC_LIBRARY_VERSION=2:0:1
15 #                       | | |
16 #                +------+ | +---+
17 #                |        |     |
18 #             current:revision:age
19 #                |        |     |
20 #                |        |     +- increment if interfaces have been added
21 #                |        |        set to zero if interfaces have been removed
22 #                                  or changed
23 #                |        +- increment if source code has changed
24 #                |           set to zero if current is incremented
25 #                +- increment if interfaces have been added, removed or changed
26 AC_SUBST(GENERIC_LIBRARY_VERSION)
27
28
29 VERSION=$GENERIC_VERSION
30
31 AM_INIT_AUTOMAKE(cairomm, $GENERIC_VERSION)
32
33 AM_CONFIG_HEADER(cairomm/cairommconfig.h)
34
35 AC_PROG_CXX
36 AC_PROG_CXXCPP
37 AC_LANG_CPLUSPLUS
38 AC_PROG_INSTALL
39 AC_LIBTOOL_WIN32_DLL
40 AM_PROG_LIBTOOL
41
42 dnl Used for enabling the "-no-undefined" and "-export-all-symbols" flags
43 dnl while generating DLLs. Borrowed from the official gtk+-2 configure.in
44 AC_MSG_CHECKING([for some Win32 platform])
45 case "$host" in
46   *-*-mingw*|*-*-cygwin*)
47     platform_win32=yes
48     ;;
49   *)
50     platform_win32=no
51     ;;
52 esac
53 AC_MSG_RESULT([$platform_win32])
54 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
55
56 AC_MSG_CHECKING([for native Win32])
57 case "$host" in
58   *-*-mingw*)
59     os_win32=yes
60     ;;
61   *)
62     os_win32=no
63     ;;
64 esac
65 AC_MSG_RESULT([$os_win32])
66 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
67
68 # Ensure MSVC-compatible struct packing convention is used when
69 # compiling for Win32 with gcc.
70 # What flag to depends on gcc version: gcc3 uses "-mms-bitfields", while
71 # gcc2 uses "-fnative-struct".
72 if test x"$os_win32" = xyes; then
73   if test x"$GCC" = xyes; then
74     msnative_struct=''
75     AC_MSG_CHECKING([how to get MSVC-compatible struct packing])
76     if test -z "$ac_cv_prog_CC"; then
77       our_gcc="$CC"
78     else
79       our_gcc="$ac_cv_prog_CC"
80     fi
81     case `$our_gcc --version | sed -e 's,\..*,.,' -e q` in
82       2.)
83         if $our_gcc -v --help 2>/dev/null | grep fnative-struct >/dev/null; then
84           msnative_struct='-fnative-struct'
85         fi
86         ;;
87       *)
88         if $our_gcc -v --help 2>/dev/null | grep ms-bitfields >/dev/null; then
89           msnative_struct='-mms-bitfields'
90         fi
91         ;;
92     esac
93     if test x"$msnative_struct" = x ; then
94       AC_MSG_RESULT([no way])
95       AC_MSG_WARN([produced libraries might be incompatible with MSVC-compiled code])
96     else
97       CXXFLAGS="$CXXFLAGS $msnative_struct"
98       AC_MSG_RESULT([${msnative_struct}])
99     fi
100   fi
101 fi
102
103 AC_CHECK_HEADERS(string list map, , exit)
104
105 PKG_CHECK_MODULES(CAIROMM, cairo >= 1.4)
106
107 AC_ARG_ENABLE(tests,
108               AC_HELP_STRING([--enable-tests=yes|no],
109                              [enable automated tests (default is no)]),
110               ENABLE_TESTS=$enableval,
111               ENABLE_TESTS=no)
112 if test x$CAIROMM_DEVEL = xon ; then
113     ENABLE_TESTS=yes
114 fi
115
116 if test x$ENABLE_TESTS = xyes ; then
117 AX_BOOST_BASE([1.33.1])
118 AX_BOOST_UNIT_TEST_FRAMEWORK
119 AC_MSG_NOTICE(support of automated tests enabled)
120 else
121     AC_MSG_NOTICE(disabled support of automated tests)
122 fi
123 AM_CONDITIONAL(AUTOTESTS, test x$ENABLE_TESTS = xyes)
124
125 dnl enable compiler warnings when the CAIROMM_DEVEL environment variable is set to 'on'
126 if test  "x$CAIROMM_DEVEL" = "xon" ; then
127     CXXFLAGS="$CXXFLAGS -Wall -g -Werror -Wextra"
128 fi
129
130 CAIROMM_ARG_ENABLE_API_EXCEPTIONS()
131
132 dnl Check whether to build the documentation directory
133 DOCS_SUBDIR="" dnl set DOCS_SUBDIR initially blank
134 AC_ARG_ENABLE(docs, [AC_HELP_STRING([--enable-docs],
135               [build the included docs [default=yes]])],,
136               [enable_docs=yes])
137 if test "x$enable_docs" = "xyes"; then
138   dnl check if doxygen is installed
139   AC_CHECK_PROGS(DOXYGEN, [doxygen], no)
140   if test x$DOXYGEN = xno; then
141     AC_MSG_WARN([Doxygen not found, documentation will not be rebuilt])
142   else
143     dnl check if graphviz / dot is installed (used by doxygen)
144     AC_CHECK_PROGS(DOT, [dot], no)
145     if test x$DOT = xno; then
146       AC_MSG_WARN([graphviz / dot not found, documentation graphs will not be rebuilt])
147     fi
148   fi
149
150   DOCS_SUBDIR="docs"
151   AC_CONFIG_FILES(
152     docs/Makefile
153     docs/reference/Makefile
154     docs/reference/Doxyfile
155   )
156 fi
157 AC_SUBST(DOCS_SUBDIR)
158
159
160 AC_CONFIG_FILES(
161   Makefile
162   cairomm/Makefile
163
164   examples/Makefile
165   examples/png_file/Makefile
166   examples/pdf-surface/Makefile
167   examples/ps-surface/Makefile
168   examples/svg-surface/Makefile
169   examples/text-rotate/Makefile
170
171   tests/Makefile
172
173   cairomm-1.0.pc
174 )
175
176 AC_CONFIG_FILES([
177   MSVC/Makefile
178     MSVC/gendef/Makefile
179     MSVC/cairomm/Makefile
180     MSVC/cairomm/cairomm.rc
181     MSVC/examples/Makefile
182       MSVC/examples/pdf-surface/Makefile
183       MSVC/examples/png_file/Makefile
184       MSVC/examples/ps-surface/Makefile
185       MSVC/examples/svg-surface/Makefile
186       MSVC/examples/text-rotate/Makefile
187 ])
188
189 AC_OUTPUT()