Add shapes.dSYM to Git ignore patterns
[shapes.git] / configure.ac
blob651a40a7b4d9c4c13e433b5e2cd6c91d05bb31c3
1 # This file is part of Shapes.
3 # Shapes is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # any later version.
8 # Shapes is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with Shapes.  If not, see <http://www.gnu.org/licenses/>.
16 # Copyright 2008, 2009, 2010, 2013, 2014 Gustaf Hendeby, Henrik Tidefelt
18 #                                               -*- Autoconf -*-
19 # Process this file with autoconf to produce a configure script.
21 AC_PREREQ(2.59)
22 AC_INIT(Shapes, 0.6.0.3, tiddeweb@gmail.com)
23 AC_CONFIG_AUX_DIR([config])
24 AC_CONFIG_MACRO_DIR([m4])
25 AM_INIT_AUTOMAKE([foreign])
27 AC_CONFIG_SRCDIR([source/Shapes_Kernel_decls.h])
28 AC_CONFIG_HEADERS([config.h])
30 # Checks for programs.
31 AC_PROG_CXX
32 AC_PROG_CC
33 AC_PROG_FLEX(2.5.33)
34 AC_PROG_BISON(2.3)
35 AC_PROG_COMPARE(6.4.0)
36 AC_ARG_WITH([doc],
37   [AS_HELP_STRING([--with-doc],
38     [build documentation, useful if SAXON isn't installed (default: yes)])],
39   [],
40   [with_doc=yes]
42 if test "X$with_doc" != "Xno"
43 then
44   AM_PATH_SAXON(9)
46 AC_PROG_LIBTOOL
48 # Set compiler options
49 AC_DEBUG
50 AC_PROFILE
51 AC_OPTIMIZATION
53 # Checks for libraries.
54 AM_ICONV()
55 if test "X$HAVE_ICONV" != "Xyes"
56 then
57   AC_MSG_ERROR(Missing iconv.  Consider installing GNU libiconv.)
59 AH_VERBATIM([ICONV_CAST],
60 [/* Macro to handle different const convention in iconv calls */
61 #define ICONV_CAST( ptr ) const_cast< ICONV_CONST char ** > ( ptr )
63 AM_ICONV_INTERNAL()
64 AM_ICONV_MACROMAN()
65 AC_CHECK_LIB([c], [close])
66 AM_PATH_GSL([1.9],, AC_MSG_ERROR(GSL not found))
67 AC_CHECK_LIB([m], [cos])
68 AM_PATH_ZLIB()
69 AC_CHECK_NANSIGNAL()
71 # Check optional dependencies
72 AM_PATH_LIBPNG()
73 AM_PATH_LIBJPEG()
74 AX_CHECK_OPENSSL([
75  AC_DEFINE_UNQUOTED( HAVE_OPENSSL, true, [Define to true if OpenSSL (library and header) is installed] )
76  HAVE_OPENSSL=true
77 ], [
78  HAVE_OPENSSL=false
80 # First check for the higher FreeType version, since the successful test (if any) should go last.
81 AC_CHECK_FT2(10.0.0,AC_DEFINE_UNQUOTED(HAVE_FT2_10, true, [Define to true if FreeType 2 is library verison 10 or later]),)
82 AC_CHECK_FT2(7.0.1,AC_DEFINE_UNQUOTED(HAVE_FT2, true, [Define to true if FreeType 2 is installed]),missing_ft2=yes)
83 AC_CHECK_HEADER([fontconfig/fontconfig.h],,missing_fontconfig=yes)
84 if test "X$missing_fontconfig" == "X"
85 then
86 AC_SEARCH_LIBS( [FcPatternCreate], [fontconfig],
87  AC_DEFINE_UNQUOTED( HAVE_FONTCONFIG, true, [Define to true if Fontconfig (library and header) is installed] )
88  FONTCONFIG_LIBS=$ac_cv_search_FcPatternCreate
89  AC_SUBST(FONTCONFIG_LIBS)
91  missing_fontconfig=yes )
94 # Allow configuration of operator dispatch implementation.
95 AM_DISPATCH_STYLE()
97 # Checks for header files.
98 AC_FUNC_ALLOCA
99 AC_HEADER_STDC
100 AC_HEADER_SYS_WAIT
101 AC_CHECK_HEADERS([inttypes.h libintl.h limits.h malloc.h stddef.h stdlib.h string.h sys/time.h unistd.h])
103 # Checks for typedefs, structures, and compiler characteristics.
104 AC_HEADER_STDBOOL
105 AC_C_CONST
106 AC_C_INLINE
107 AC_TYPE_PID_T
108 AC_C_RESTRICT
109 AC_TYPE_SIZE_T
110 AC_HEADER_TIME
111 AC_STRUCT_TM
113 # Checks for library functions.
114 AC_FUNC_ERROR_AT_LINE
115 AC_FUNC_FORK
116 AC_FUNC_MALLOC
117 AC_FUNC_REALLOC
118 AC_FUNC_STAT
119 AC_FUNC_STRFTIME
120 AC_FUNC_STRTOD
121 AC_CHECK_FUNCS([floor memchr memset pow rint sqrt strchr strdup strrchr strtol])
124 htmldir='${pkgdatadir}/doc/html'
125 AC_SUBST(htmldir)
128 AC_CONFIG_FILES([Makefile source/Makefile resources/Makefile edit/Makefile
129                  test/Makefile test/text/Makefile test/graphics/Makefile
130                  doc/Makefile doc/tools/Makefile
131                  doc/tools/ssi/Makefile doc/tools/postproc/Makefile
132                  doc/tools/xhtml-deps/Makefile doc/build/Makefile
133                  doc/build/man/Makefile doc/build/html/Makefile doc/build/proj-web/Makefile doc/build/text/Makefile])
135 if test "X$HAVE_FLEX" != "X1"
136 then
137     echo "\
138 WARNING: \`flex' is missing on your system.  You should only need it if you modified a \`.ll' file, but due to problems with the build process it may be needed otherwise as well.  You can get directions for how to obtaion a recent \`Flex' from any GNU archive site."
141 if test "X$COMPARE" != "Xyes"
142 then
143   echo "\
144 WARNING:  The program \`compare' was not found, or its version too low.  Without it, errors in the tests are less likely to be detected."
147 if test "X$with_doc" = "Xno"
148 then
149   echo "\
150 WARNING: Without building the documentation it will not be possible to run make dist.  Rerun configure with --with-doc to reactivate."
152 AM_CONDITIONAL(WITH_DOC, test "X$with_doc" != "Xno")
154 if test "X$HAVE_SAXON" != "X1" -a "X$with_doc" != "Xno"
155 then
156   echo "\
157 WARNING: The program \`Saxon' was not found, without it installed the documentation cannot be rebuilt."
159 AM_CONDITIONAL(HAVE_SAXON, test "X$HAVE_SAXON" = "X1")
161 if test "X$HAVE_LIBPNG" != "Xtrue"
162 then
163   echo "\
164 WARNING:  The library \`libpng' was not found, or its version too low.  Without it, your Shapes compiler will lack some functionality."
167 if test "X$HAVE_LIBJPEG" != "Xtrue"
168 then
169   echo "\
170 WARNING:  The library \`libjpeg' was not found.  Without it, your Shapes compiler will lack some functionality."
173 if test "X$HAVE_OPENSSL" != "Xtrue"
174 then
175   echo "\
176 WARNING:  The library \`openssl' was not found.  Without it, your Shapes compiler will lack some functionality."
179 if test "X$missing_ft2" != "X"
180 then
181   echo "\
182 WARNING:  FreeType 2 was not found.  Without it, your Shapes compiler will lack some functionality."
185 if test "X$missing_fontconfig" != "X"
186 then
187   echo "\
188 WARNING:  Fontconfig was not found.  Without it, your Shapes compiler will lack some functionality."
191 AC_OUTPUT