2 # Process this file with autoconf to produce a configure script.
6 m4_define([required_lttoolbox_version], [2.0.0])
7 m4_define([required_apertium_version], [2.0.0])
9 #m4_define([required_pkg_config_version], [0.15])
11 AC_INIT([apertium-lang-detect], [1.0.0], [sortiz@dlsi.ua.es])
12 AC_CONFIG_HEADER([apertium-lang-detect/apertium-lang-detect-config.h])
14 GENERIC_LIBRARY_NAME=apertium-lang-detect
17 GENERIC_MAJOR_VERSION=1
18 GENERIC_MINOR_VERSION=0
19 GENERIC_MICRO_VERSION=0
21 # API version (often = GENERIC_MAJOR_VERSION.GENERIC_MINOR_VERSION)
22 GENERIC_API_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
23 AC_SUBST(GENERIC_API_VERSION)
25 # Shared library versioning
26 GENERIC_LIBRARY_VERSION=0:0:0
30 # current:revision:age
32 # | | +- increment if interfaces have been added
33 # | | set to zero if interfaces have been removed
35 # | +- increment if source code has changed
36 # | set to zero if current is incremented
37 # +- increment if interfaces have been added, removed or changed
39 AC_SUBST(GENERIC_LIBRARY_VERSION)
40 PACKAGE=$GENERIC_LIBRARY_NAME
41 AC_SUBST(GENERIC_LIBRARY_NAME)
43 GENERIC_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION.$GENERIC_MICRO_VERSION
44 GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
45 AC_SUBST(GENERIC_RELEASE)
46 AC_SUBST(GENERIC_VERSION)
48 VERSION=$GENERIC_VERSION
50 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
52 # Checks for programs.
54 AC_MSG_CHECKING([Compilation architecture: PPC, i686, Other])
58 AC_MSG_RESULT([PowerPC])
59 CFLAGS="$CFLAGS -Wall -ansi -mpowerpc -maltivec -fno-pic -fomit-frame-pointer"
60 CXXFLAGS="$CXXFLAGS -Wall -ansi -mpowerpc -maltivec -fno-pic -fomit-frame-pointer"
62 if test x$ARCH = xi686
65 CFLAGS="$CFLAGS -Wall -ansi -march=i686 -O3 -fomit-frame-pointer -funroll-loops"
66 CXXFLAGS="$CXXFLAGS -Wall -ansi -march=i686 -O3 \
67 -fomit-frame-pointer -funroll-loops"
69 AC_MSG_RESULT([Other])
70 CFLAGS="$CFLAGS -Wall -ansi -O3"
71 CXXFLAGS="$CXXFLAGS -Wall -ansi -O3"
81 [ --enable-debug Enable "-g -Wall" compiler options],
82 [CXXFLAGS="-g -Wall"; CFLAGS="-g -Wall"])
84 AC_ARG_ENABLE(profile,
85 [ --enable-profile Enable "-pg -g -Wall" compiler options],
86 [CXXFLAGS="-pg -g -Wall"; CFLAGS="-pg -g -Wall"; LDFLAGS="-pg"])
88 AC_PATH_PROG(XMLLINT, xmllint, no)
89 if test x$ac_cv_path_XMLLINT = x
91 AC_MSG_ERROR([You don't have xmllint installed.])
93 if test x$ac_cv_path_XMLLINT = xno
95 AC_MSG_ERROR([You don't have xmllint installed.])
100 AC_PATH_PROG(XSLTPROC, sabcmd, no)
101 if test x$ac_cv_path_XSLTPROC = x
103 AC_MSG_ERROR([You don't have sablotron installed.])
105 if test x$ac_cv_path_XSLTPROC = xno
107 AC_MSG_ERROR([You don't have sablotron installed.])
110 AC_PATH_PROG(XSLTPROC, xsltproc, no)
111 if test x$ac_cv_path_XSLTPROC = x
113 AC_MSG_ERROR([You don't have xsltproc installed.])
115 if test x$ac_cv_path_XSLTPROC = xno
117 AC_MSG_ERROR([You don't have xsltproc installed.])
121 AC_PATH_PROG(BASH, bash, no)
122 if test x$ac_cv_path_BASH = x
124 AC_MSG_ERROR([You don't have bash installed.])
126 if test x$ac_cv_path_BASH = xno
128 AC_MSG_ERROR([You don't have bash installed.])
131 AC_PATH_PROG(FLEX, flex, no)
132 if test x$ac_cv_path_FLEX = x
134 AC_MSG_ERROR([You don't have flex installed.])
136 if test x$ac_cv_path_FLEX = xno
138 AC_MSG_ERROR([You don't have flex installed.])
141 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
142 if test x$ac_cv_path_PKG_CONFIG = x
144 AC_MSG_ERROR([You don't have pkg-config installed.])
146 if test x$ac_cv_path_PKG_CONFIG = xno
148 AC_MSG_ERROR([You don't have pkg-config installed.])
151 PKG_CHECK_MODULES(DETLANG, [dnl
152 lttoolbox-2.0 >= required_lttoolbox_version dnl
153 apertium-2.0 >= required_apertium_version])
155 # Checks for header files.
157 AC_CHECK_HEADERS([stdlib.h string.h unistd.h stddef.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])
171 if test $prefix = "NONE"
172 then echo "Entrando por la primera"
173 AC_DEFINE_UNQUOTED(ALL_MAPS_DIR, "$ac_default_prefix/apertium-lang-detect-$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION", [Data directory])
174 AC_DEFINE_UNQUOTED(INDICADORES_DIR, ALL_MAPS_DIR, [Data directory])
175 else echo $prefix " - Entrando por la segunda"
176 AC_DEFINE_UNQUOTED(ALL_MAPS_DIR, "$prefix/apertium-lang-detect-$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION", [Data directory])
177 AC_DEFINE_UNQUOTED(INDICADORES_DIR, ALL_MAPS_DIR, [Data directory])
179 AC_CHECK_FUNCS([setlocale strdup])
181 AC_OUTPUT([Makefile apertium-lang-detect-1.0.pc apertium-lang-detect/Makefile])