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-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, x86_64, Other])
36 if test x$(which arch) = x
37 then ARCH=$($(which uname) -m)
38 else ARCH=$($(which arch))
43 AC_MSG_RESULT([PowerPC])
44 CFLAGS="-Wall -ansi -mpowerpc -maltivec -fno-pic -fomit-frame-pointer $CFLAGS"
45 CXXFLAGS="-Wall -ansi -mpowerpc -maltivec -fno-pic -fomit-frame-pointer $CXXFLAGS"
47 if test x$ARCH = xi686
50 CFLAGS="-Wall -ansi -march=i686 -O3 -fomit-frame-pointer -funroll-loops $CFLAGS"
51 CXXFLAGS="-Wall -ansi -march=i686 -O3 \
52 -fomit-frame-pointer -funroll-loops $CXXFLAGS"
55 if test x$ARCH = xx86_64
57 AC_MSG_RESULT([x86_64])
58 CFLAGS="-Wall -ansi -O3 -mtune=nocona -fomit-frame-pointer -funroll-loops $CFLAGS"
59 CXXFLAGS="-Wall -ansi -O3 -mtune=nocona \
60 -fomit-frame-pointer -funroll-loops $CXXFLAGS"
62 AC_MSG_RESULT([Other])
63 CFLAGS="-Wall -ansi -O3 $CFLAGS"
64 CXXFLAGS="-Wall -ansi -O3 $CXXFLAGS"
75 [ --enable-debug Enable "-g -Wall" compiler options],
76 [CXXFLAGS="-g -Wall"; CFLAGS="-g -Wall"])
78 AC_ARG_ENABLE(profile,
79 [ --enable-profile Enable "-pg -g -Wall" compiler options],
80 [CXXFLAGS="-pg -g -Wall"; CFLAGS="-pg -g -Wall"; LDFLAGS="-pg"])
84 AC_PATH_PROG(XSLTPROC, sabcmd, no)
85 if test x$ac_cv_path_XSLTPROC = x
87 AC_MSG_ERROR([You don't have sablotron installed.])
89 if test x$ac_cv_path_XSLTPROC = xno
91 AC_MSG_ERROR([You don't have sablotron installed.])
94 AC_PATH_PROG(XSLTPROC, xsltproc, no)
95 if test x$ac_cv_path_XSLTPROC = x
97 AC_MSG_ERROR([You don't have xsltproc installed.])
99 if test x$ac_cv_path_XSLTPROC = xno
101 AC_MSG_ERROR([You don't have xsltproc installed.])
105 AC_PATH_PROG(BASH, bash, no)
106 if test x$ac_cv_path_BASH = x
108 AC_MSG_ERROR([You don't have bash installed.])
110 if test x$ac_cv_path_BASH = xno
112 AC_MSG_ERROR([You don't have bash installed.])
115 AC_PATH_PROG(PERL, perl, no)
116 if test x$ac_cv_path_PERL = x
118 AC_MSG_ERROR([You don't have perl installed.])
120 if test x$ac_cv_path_PERL = xno
122 AC_MSG_ERROR([You don't have perl installed.])
125 AC_PATH_PROG(APERTIUM_DESTXT, apertium-destxt, no)
126 AC_PATH_PROG(LTPROC, lt-proc, no)
128 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
129 if test x$ac_cv_path_PKG_CONFIG = x
131 AC_MSG_ERROR([You don't have pkg-config installed.])
133 if test x$ac_cv_path_PKG_CONFIG = xno
135 AC_MSG_ERROR([You don't have pkg-config installed.])
138 PKG_CHECK_MODULES(LIBXML2, [dnl
139 libxml-2.0 >= required_libxml_version])
141 PKG_CHECK_MODULES(LTTOOLBOX, [dnl
142 lttoolbox-2.0 >= required_lttoolbox_version])
144 PKG_CHECK_MODULES(APERTIUM, [dnl
145 apertium-2.0 >= required_apertium_version])
147 #Check for libraries.
148 AC_CHECK_LIB(xml2, xmlReaderForFile)
150 # Checks for header files.
152 AC_CHECK_HEADERS([regex.h sys/types.h sys/times.h sys/wait.h sys/resource.h locale.h getopt.h])
154 # Checks for typedefs, structures, and compiler characteristics.
159 # Checks for library functions.
160 AC_FUNC_ERROR_AT_LINE
164 #AC_CHECK_DECLS([fread_unlocked, fwrite_unlocked, fgetc_unlocked, fputc_unlocked, fputs_unlocked, getopt_long])
165 AC_CHECK_DECLS([getopt_long])
167 #AC_CHECK_FUNCS([setlocale strdup])
168 AC_CHECK_FUNCS([setlocale])
170 AC_OUTPUT([Makefile src/Makefile apertium-tagger-training-tools-1.0.pc])