Deleting old new pair howto and moving webspace
[apertium.git] / apertium / configure.ac
blob8bcaede2f32355dc3178a6ea3514648aa327d8ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.52)
6 m4_define([required_lttoolbox_version], [2.0.0])
7 m4_define([required_libxml_version], [2.6.17])
9 #m4_define([required_pkg_config_version], [0.15])
11 AC_INIT([apertium], [2.0.3], [sortiz@users.sourceforge.net])
12 AC_CONFIG_HEADER([apertium/ApertiumConfig.H])
14 GENERIC_LIBRARY_NAME=apertium
16 # Release versioning
17 GENERIC_MAJOR_VERSION=2
18 GENERIC_MINOR_VERSION=0
19 GENERIC_MICRO_VERSION=3
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
27 #                       | | |
28 #                +------+ | +---+
29 #                |        |     |
30 #             current:revision:age
31 #                |        |     |
32 #                |        |     +- increment if interfaces have been added
33 #                |        |        set to zero if interfaces have been removed
34 #                                  or changed
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])
55 ARCH=$(/bin/arch)
56 if test x$ARCH = xppc
57 then
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"
61 else
62   if test x$ARCH = xi686
63   then
64     AC_MSG_RESULT([i686])
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"
68   else
69     AC_MSG_RESULT([Other])
70     CFLAGS="$CFLAGS -Wall -ansi -O3"
71     CXXFLAGS="$CXXFLAGS -Wall -ansi -O3"
72   fi
75 AC_PROG_CXX
76 AC_PROG_LIBTOOL
77 AM_SANITY_CHECK
78 AC_LANG_CPLUSPLUS
80 AC_ARG_ENABLE(debug,
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
90 then
91   AC_MSG_ERROR([You don't have xmllint installed.])
93 if test x$ac_cv_path_XMLLINT = xno
94 then
95   AC_MSG_ERROR([You don't have xmllint installed.])
98   AC_PATH_PROG(XSLTPROC, xsltproc, no)
99   if test x$ac_cv_path_XSLTPROC = x
100   then
101     AC_MSG_ERROR([You don't have xsltproc installed.])
102   fi
103   if test x$ac_cv_path_XSLTPROC = xno
104   then
105     AC_MSG_ERROR([You don't have xsltproc installed.])
106   fi
109 AC_PATH_PROG(BASH, bash, no)
110 if test x$ac_cv_path_BASH = x
111 then
112   AC_MSG_ERROR([You don't have bash installed.])
114 if test x$ac_cv_path_BASH = xno
115 then
116   AC_MSG_ERROR([You don't have bash installed.])
119 AC_PATH_PROG(FLEX, flex, no)
120 if test x$ac_cv_path_FLEX = x
121 then
122   AC_MSG_ERROR([You don't have flex installed.])
124 if test x$ac_cv_path_FLEX = xno
125 then
126   AC_MSG_ERROR([You don't have flex installed.])
129 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
130 if test x$ac_cv_path_PKG_CONFIG = x
131 then
132   AC_MSG_ERROR([You don't have pkg-config installed.])
134 if test x$ac_cv_path_PKG_CONFIG = xno
135 then
136   AC_MSG_ERROR([You don't have pkg-config installed.])
139 PKG_CHECK_MODULES(APERTIUM, [dnl
140   lttoolbox-2.0 >= required_lttoolbox_version dnl
141   libxml-2.0 >= required_libxml_version])
142   
143 # Checks for header files.
144 AC_HEADER_STDC
145 AC_CHECK_HEADERS([stdlib.h string.h unistd.h stddef.h])
147 # Checks for typedefs, structures, and compiler characteristics.
148 AC_HEADER_STDBOOL
149 AC_C_CONST
150 AC_TYPE_SIZE_T
152 # Checks for library functions.
153 AC_FUNC_ERROR_AT_LINE
154 AC_FUNC_MALLOC
155 AC_FUNC_REALLOC
157 AC_CHECK_DECLS([fread_unlocked, fwrite_unlocked, fgetc_unlocked, fputc_unlocked, fputs_unlocked, getopt_long])
159 AC_CHECK_FUNCS([setlocale strdup])
161 AC_OUTPUT([Makefile apertium-2.0.pc apertium/Makefile])