2 # Process this file with autoconf to produce a configure script.
6 m4_define([required_lttoolbox_version], [3.0])
7 m4_define([required_apertium_version], [3.0])
8 m4_define([required_libxml_version], [2.6.17])
10 AC_INIT([apertium-tagger-training-tools], [1.0.0], [fsanchez@dlsi.ua.es])
12 AC_CONFIG_HEADERS([src/configure.H])
15 GENERIC_MAJOR_VERSION=1
16 GENERIC_MINOR_VERSION=0
17 GENERIC_MICRO_VERSION=0
19 GENERIC_API_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
20 AC_SUBST(GENERIC_API_VERSION)
22 PACKAGE=apertium-tagger-training-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"
41 CXXFLAGS="$CXXFLAGS -ansi -mpowerpc -maltivec -fno-pic -fomit-frame-pointer"
43 if test x$ARCH = xi686
46 CFLAGS="$CFLAGS -ansi -march=i686 -O3 -fno-pic -fomit-frame-pointer"
47 CXXFLAGS="$CXXFLAGS -ansi -march=i686 -O3 -fno-pic -fomit-frame-pointer"
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"])
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(PERL, perl, no)
102 if test x$ac_cv_path_PERL = x
104 AC_MSG_ERROR([You don't have perl installed.])
106 if test x$ac_cv_path_PERL = xno
108 AC_MSG_ERROR([You don't have perl installed.])
111 AC_PATH_PROG(APERTIUM_DESTXT, apertium-destxt, no)
112 AC_PATH_PROG(LTPROC, lt-proc, no)
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.])
124 PKG_CHECK_MODULES(LIBXML2, [dnl
125 libxml-2.0 >= required_libxml_version])
127 PKG_CHECK_MODULES(LTTOOLBOX, [dnl
128 lttoolbox-3.0 >= required_lttoolbox_version])
130 PKG_CHECK_MODULES(APERTIUM, [dnl
131 apertium-3.0 >= required_apertium_version])
133 #Check for libraries.
134 AC_CHECK_LIB(xml2, xmlReaderForFile)
136 # Checks for header files.
138 AC_CHECK_HEADERS([regex.h sys/types.h sys/times.h sys/wait.h sys/resource.h locale.h getopt.h])
140 # Checks for typedefs, structures, and compiler characteristics.
145 # Checks for library functions.
146 AC_FUNC_ERROR_AT_LINE
150 #AC_CHECK_DECLS([fread_unlocked, fwrite_unlocked, fgetc_unlocked, fputc_unlocked, fputs_unlocked, getopt_long])
151 AC_CHECK_DECLS([getopt_long])
153 #AC_CHECK_FUNCS([setlocale strdup])
154 AC_CHECK_FUNCS([setlocale])
156 AC_OUTPUT([Makefile src/Makefile apertium-tagger-training-tools-1.0.pc])