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
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 Gustaf Hendeby
19 # Process this file with autoconf to produce a configure script.
22 AC_INIT(Shapes, 0.6.0.1, tidefelt@isy.liu.se)
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 AM_CONFIG_HEADER([config.h])
30 # Checks for programs.
35 AC_PROG_COMPARE(6.4.0)
39 # Set compiler options
44 # Checks for libraries.
46 if test "X$HAVE_ICONV" != "Xyes"
48 AC_MSG_ERROR(Missing iconv. Consider installing GNU libiconv.)
50 AH_VERBATIM([ICONV_CAST],
51 [/* Macro to handle different const convention in iconv calls */
52 #define ICONV_CAST( ptr ) const_cast< ICONV_CONST char ** > ( ptr )
56 AC_CHECK_LIB([c], [close])
57 AM_PATH_GSL([1.9],, AC_MSG_ERROR(GSL not found))
58 AC_CHECK_LIB([m], [cos])
62 # Check optional dependencies
65 # First check for the higher FreeType version, since the successful test (if any) should go last.
66 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]),)
67 AC_CHECK_FT2(7.0.1,AC_DEFINE_UNQUOTED(HAVE_FT2, true, [Define to true if FreeType 2 is installed]),missing_ft2=yes)
68 AC_CHECK_HEADER([fontconfig/fontconfig.h],,missing_fontconfig=yes)
69 if test "X$missing_fontconfig" == "X"
71 AC_SEARCH_LIBS( [FcPatternCreate], [fontconfig],
72 AC_DEFINE_UNQUOTED( HAVE_FONTCONFIG, true, [Define to true if Fontconfig (library and header) is installed] )
73 FONTCONFIG_LIBS=$ac_cv_search_FcPatternCreate
74 AC_SUBST(FONTCONFIG_LIBS)
76 missing_fontconfig=yes )
79 # Allow configuration of operator dispatch implementation.
82 # Checks for header files.
86 AC_CHECK_HEADERS([inttypes.h libintl.h limits.h malloc.h stddef.h stdlib.h string.h sys/time.h unistd.h])
88 # Checks for typedefs, structures, and compiler characteristics.
98 # Checks for library functions.
106 AC_CHECK_FUNCS([floor memchr memset pow rint sqrt strchr strdup strrchr strtol])
109 htmldir='${pkgdatadir}/doc/html'
113 AC_CONFIG_FILES([Makefile source/Makefile resources/Makefile edit/Makefile
114 test/Makefile test/text/Makefile test/graphics/Makefile
115 doc/Makefile doc/tools/Makefile
116 doc/tools/ssi/Makefile doc/tools/postproc/Makefile
117 doc/tools/xhtml-deps/Makefile doc/build/Makefile
118 doc/build/man/Makefile doc/build/html/Makefile doc/build/proj-web/Makefile doc/build/text/Makefile])
120 if test "X$HAVE_FLEX" != "X1"
123 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."
126 if test "X$COMPARE" != "Xyes"
129 WARNING: The program \`compare' was not found, or its version too low. Without it, errors in the tests are less likely to be detected."
132 if test "X$HAVE_SAXON" != "X1"
135 WARNING: The program \`Saxon' was not found, without it installed the documentation cannot be rebuilt."
137 AM_CONDITIONAL(HAVE_SAXON, test "X$HAVE_SAXON" = "X1")
139 if test "X$HAVE_LIBPNG" != "Xtrue"
142 WARNING: The library \`libpng' was not found, or its version too low. Without it, your Shapes compiler will lack some functionality."
145 if test "X$HAVE_LIBJPEG" != "Xtrue"
148 WARNING: The library \`libjpeg' was not found. Without it, your Shapes compiler will lack some functionality."
151 if test "X$missing_ft2" != "X"
154 WARNING: FreeType 2 was not found. Without it, your Shapes compiler will lack some functionality."
157 if test "X$missing_fontconfig" != "X"
160 WARNING: Fontconfig was not found. Without it, your Shapes compiler will lack some functionality."