Update suitable examples and tests to use blank mode
[shapes.git] / configure.ac
blob86fbfc2115861fd3bf0adb1859fd4a036d2bf07d
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
17 # Copyright 2015 Henrik Tidefelt
19 #                                               -*- Autoconf -*-
20 # Process this file with autoconf to produce a configure script.
22 AC_PREREQ(2.59)
23 AC_INIT(Shapes, 0.6.0.3, tiddeweb@gmail.com)
24 AC_CONFIG_AUX_DIR([config])
25 AC_CONFIG_MACRO_DIR([m4])
26 AM_INIT_AUTOMAKE([foreign])
28 AC_CONFIG_SRCDIR([source/Shapes_Kernel_decls.h])
29 AC_CONFIG_HEADERS([config.h])
31 # Checks for programs.
32 AC_PROG_CXX
33 AC_PROG_CC
34 AC_PROG_FLEX(2.5.33)
35 AC_PROG_BISON(2.3)
36 AC_PROG_COMPARE(6.4.0)
37 AC_ARG_WITH([doc],
38   [AS_HELP_STRING([--with-doc],
39     [build documentation, useful if SAXON isn't installed (default: yes)])],
40   [],
41   [with_doc=yes]
43 if test "X$with_doc" != "Xno"
44 then
45   AM_PATH_SAXON(9)
47 AC_PROG_LIBTOOL
49 # Set compiler options
50 AC_DEBUG
51 AC_PROFILE
52 AC_OPTIMIZATION
54 # Checks for libraries.
55 AM_ICONV()
56 if test "X$HAVE_ICONV" != "Xyes"
57 then
58   AC_MSG_ERROR(Missing iconv.  Consider installing GNU libiconv.)
60 AH_VERBATIM([ICONV_CAST],
61 [/* Macro to handle different const convention in iconv calls */
62 #define ICONV_CAST( ptr ) const_cast< ICONV_CONST char ** > ( ptr )
64 AM_ICONV_INTERNAL()
65 AM_ICONV_MACROMAN()
66 AC_CHECK_LIB([c], [close])
67 AM_PATH_GSL([1.9],, AC_MSG_ERROR(GSL not found))
68 AC_CHECK_LIB([m], [cos])
69 AM_PATH_ZLIB()
70 AC_CHECK_NANSIGNAL()
72 # Check optional dependencies
73 AM_PATH_LIBPNG()
74 AM_PATH_LIBJPEG()
75 AX_CHECK_OPENSSL([
76  AC_DEFINE_UNQUOTED( HAVE_OPENSSL, true, [Define to true if OpenSSL (library and header) is installed] )
77  HAVE_OPENSSL=true
78 ], [
79  HAVE_OPENSSL=false
81 # First check for the higher FreeType version, since the successful test (if any) should go last.
82 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]),)
83 AC_CHECK_FT2(7.0.1,AC_DEFINE_UNQUOTED(HAVE_FT2, true, [Define to true if FreeType 2 is installed]),missing_ft2=yes)
84 AC_CHECK_HEADER([fontconfig/fontconfig.h],,missing_fontconfig=yes)
85 if test "X$missing_fontconfig" == "X"
86 then
87 AC_SEARCH_LIBS( [FcPatternCreate], [fontconfig],
88  AC_DEFINE_UNQUOTED( HAVE_FONTCONFIG, true, [Define to true if Fontconfig (library and header) is installed] )
89  FONTCONFIG_LIBS=$ac_cv_search_FcPatternCreate
90  AC_SUBST(FONTCONFIG_LIBS)
92  missing_fontconfig=yes )
95 # Allow configuration of operator dispatch implementation.
96 AM_DISPATCH_STYLE()
98 # Checks for header files.
99 AC_FUNC_ALLOCA
100 AC_HEADER_STDC
101 AC_HEADER_SYS_WAIT
102 AC_CHECK_HEADERS([inttypes.h libintl.h limits.h malloc.h stddef.h stdlib.h string.h sys/time.h unistd.h])
104 # Checks for typedefs, structures, and compiler characteristics.
105 AC_HEADER_STDBOOL
106 AC_C_CONST
107 AC_C_INLINE
108 AC_TYPE_PID_T
109 AC_C_RESTRICT
110 AC_TYPE_SIZE_T
111 AC_HEADER_TIME
112 AC_STRUCT_TM
114 # Checks for library functions.
115 AC_FUNC_ERROR_AT_LINE
116 AC_FUNC_FORK
117 AC_FUNC_MALLOC
118 AC_FUNC_REALLOC
119 AC_FUNC_STAT
120 AC_FUNC_STRFTIME
121 AC_FUNC_STRTOD
122 AC_CHECK_FUNCS([floor memchr memset pow rint sqrt strchr strdup strrchr strtol])
125 htmldir='${pkgdatadir}/doc/html'
126 AC_SUBST(htmldir)
129 AC_CONFIG_FILES([
130     Makefile source/Makefile edit/Makefile
131     test/Makefile test/text/Makefile test/graphics/Makefile
132     doc/Makefile doc/tools/Makefile
133     doc/tools/ssi/Makefile doc/tools/postproc/Makefile
134     doc/tools/xhtml-deps/Makefile doc/build/Makefile
135     doc/build/man/Makefile doc/build/html/Makefile doc/build/proj-web/Makefile doc/build/text/Makefile
136     resources/fontmetrics/Makefile
137     resources/extensions/Applications/Blockdraw/Makefile
138     resources/extensions/Applications/Circuit/Makefile
139     resources/extensions/Shapes/Makefile
140     resources/extensions/Shapes/Alternative/Makefile
141     resources/extensions/Shapes/Control/Makefile
142     resources/extensions/Shapes/Data/Makefile
143     resources/extensions/Shapes/Geometry/Makefile
144     resources/extensions/Shapes/Geometry3D/Makefile
145     resources/extensions/Shapes/Graphics/Makefile
146     resources/extensions/Shapes/Graphics3D/Makefile
147     resources/extensions/Shapes/Layout/Makefile
148     resources/extensions/Shapes/Numeric/Makefile
149     resources/extensions/Shapes/Numeric/Constant/Makefile
150   ])
152 if test "X$HAVE_FLEX" != "X1"
153 then
154     echo "\
155 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."
158 if test "X$COMPARE" != "Xyes"
159 then
160   echo "\
161 WARNING:  The program \`compare' was not found, or its version too low.  Without it, errors in the tests are less likely to be detected."
164 if test "X$with_doc" = "Xno"
165 then
166   echo "\
167 WARNING: Without building the documentation it will not be possible to run make dist.  Rerun configure with --with-doc to reactivate."
169 AM_CONDITIONAL(WITH_DOC, test "X$with_doc" != "Xno")
171 if test "X$HAVE_SAXON" != "X1" -a "X$with_doc" != "Xno"
172 then
173   echo "\
174 WARNING: The program \`Saxon' was not found, without it installed the documentation cannot be rebuilt."
176 AM_CONDITIONAL(HAVE_SAXON, test "X$HAVE_SAXON" = "X1")
178 if test "X$HAVE_LIBPNG" != "Xtrue"
179 then
180   echo "\
181 WARNING:  The library \`libpng' was not found, or its version too low.  Without it, your Shapes compiler will lack some functionality."
184 if test "X$HAVE_LIBJPEG" != "Xtrue"
185 then
186   echo "\
187 WARNING:  The library \`libjpeg' was not found.  Without it, your Shapes compiler will lack some functionality."
190 if test "X$HAVE_OPENSSL" != "Xtrue"
191 then
192   echo "\
193 WARNING:  The library \`openssl' was not found.  Without it, your Shapes compiler will lack some functionality."
196 if test "X$missing_ft2" != "X"
197 then
198   echo "\
199 WARNING:  FreeType 2 was not found.  Without it, your Shapes compiler will lack some functionality."
202 if test "X$missing_fontconfig" != "X"
203 then
204   echo "\
205 WARNING:  Fontconfig was not found.  Without it, your Shapes compiler will lack some functionality."
208 AC_OUTPUT