2 # Process this file with autoconf to produce a configure script.
6 m4_define([required_lttoolbox_version], [2.0])
7 m4_define([required_apertium_version], [2.0])
8 m4_define([required_libxml_version], [2.6.17])
10 AC_INIT([apertium-transfer-tools], [0.9.1], [fsanchez@dlsi.ua.es])
12 AC_CONFIG_HEADERS([src/configure.H])
15 GENERIC_MAJOR_VERSION=0
16 GENERIC_MINOR_VERSION=9
17 GENERIC_MICRO_VERSION=1
19 GENERIC_API_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
20 AC_SUBST(GENERIC_API_VERSION)
22 PACKAGE=apertium-transfer-tools
24 GENERIC_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION.$GENERIC_MICRO_VERSION
25 GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
26 AC_SUBST(GENERIC_RELEASE)
27 AC_SUBST(GENERIC_VERSION)
29 VERSION=$GENERIC_VERSION
31 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
33 # Checks for programs.
35 AC_MSG_CHECKING([Compilation architecture: PPC, i686, Other])
39 AC_MSG_RESULT([PowerPC])
40 CFLAGS="$CFLAGS -ansi -mpowerpc -maltivec -fno-pic -fomit-frame-pointer -Wall"
41 CXXFLAGS="$CXXFLAGS -ansi -mpowerpc -maltivec -fno-pic -fomit-frame-pointer -Wall"
43 if test x$ARCH = xi686
46 CFLAGS="$CFLAGS -ansi -march=i686 -O3 -fno-pic -fomit-frame-pointer -Wall"
47 CXXFLAGS="$CXXFLAGS -ansi -march=i686 -O3 -fno-pic -fomit-frame-pointer -Wall"
49 AC_MSG_RESULT([Other])
50 CFLAGS="$CFLAGS -ansi -O3"
51 CXXFLAGS="$CXXFLAGS -ansi -O3"
61 [ --enable-debug Enable "-g -Wall" compiler options],
62 [CXXFLAGS="-g -Wall"; CFLAGS="-g -Wall"])
64 AC_ARG_ENABLE(profile,
65 [ --enable-profile Enable "-pg -g -Wall" compiler options],
66 [CXXFLAGS="-pg -g -Wall"; CFLAGS="-pg -g -Wall"; LDFLAGS="-pg"])
68 #if test x$ARCH = xppc
70 # AC_PATH_PROG(XSLTPROC, sabcmd, no)
71 # if test x$ac_cv_path_XSLTPROC = x
73 # AC_MSG_ERROR([You don't have sablotron installed.])
75 # if test x$ac_cv_path_XSLTPROC = xno
77 # AC_MSG_ERROR([You don't have sablotron installed.])
80 # AC_PATH_PROG(XSLTPROC, xsltproc, no)
81 # if test x$ac_cv_path_XSLTPROC = x
83 # AC_MSG_ERROR([You don't have xsltproc installed.])
85 # if test x$ac_cv_path_XSLTPROC = xno
87 # AC_MSG_ERROR([You don't have xsltproc installed.])
91 AC_PATH_PROG(BASH, bash, no)
92 if test x$ac_cv_path_BASH = x
94 AC_MSG_ERROR([You don't have bash installed.])
96 if test x$ac_cv_path_BASH = xno
98 AC_MSG_ERROR([You don't have bash installed.])
101 #AC_PATH_PROG(APERTIUM_DESTXT, apertium-destxt, no)
104 AC_PATH_PROG(AWK, awk, no)
105 if test x$ac_cv_path_AWK = x
107 AC_MSG_ERROR([You don't have awk installed.])
109 if test x$ac_cv_path_AWK = xno
111 AC_MSG_ERROR([You don't have awk installed.])
114 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
115 if test x$ac_cv_path_PKG_CONFIG = x
117 AC_MSG_ERROR([You don't have pkg-config installed.])
119 if test x$ac_cv_path_PKG_CONFIG = xno
121 AC_MSG_ERROR([You don't have pkg-config installed.])
127 AC_CHECK_HEADERS(zlib.h,
128 AC_CHECK_LIB(z, gzread,[
129 AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
130 if test "x${Z_DIR}" != "x"
132 Z_CFLAGS="-I${Z_DIR}/include"
133 Z_LIBS="-L${Z_DIR}/lib -lz"
141 PKG_CHECK_MODULES(LIBXML2, [dnl
142 libxml-2.0 >= required_libxml_version])
144 PKG_CHECK_MODULES(LTTOOLBOX, [dnl
145 lttoolbox-2.0 >= required_lttoolbox_version])
147 PKG_CHECK_MODULES(APERTIUM, [dnl
148 apertium-2.0 >= required_apertium_version])
150 AC_PATH_PROG(XMLLINT, xmllint, no)
152 #Check for libraries.
153 AC_CHECK_LIB(xml2, xmlReaderForFile)
155 # Checks for header files.
157 AC_CHECK_HEADERS([regex.h sys/types.h sys/times.h sys/wait.h sys/resource.h locale.h getopt.h])
159 # Checks for typedefs, structures, and compiler characteristics.
164 # Checks for library functions.
165 AC_FUNC_ERROR_AT_LINE
169 #AC_CHECK_DECLS([fread_unlocked, fwrite_unlocked, fgetc_unlocked, fputc_unlocked, fputs_unlocked, getopt_long])
170 AC_CHECK_DECLS([getopt_long])
172 #AC_CHECK_FUNCS([setlocale strdup])
173 #AC_CHECK_FUNCS([setlocale])
175 AC_OUTPUT([Makefile src/Makefile apertium-transfer-tools-0.9.pc])