Adding a few more things
[apertium.git] / apertium-tagger-training-tools-unicode / configure.ac
blob040bdca6b09d873cedf3bbcfc722a7273f27f29c
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.52)
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])
14 # Release versioning
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])
36 ARCH=$(/bin/uname -m)
37 if test x$ARCH = xppc
38 then
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"
42 else
43   if test x$ARCH = xi686
44   then
45     AC_MSG_RESULT([i686])
46     CFLAGS="$CFLAGS -ansi -march=i686 -O3 -fno-pic -fomit-frame-pointer"
47     CXXFLAGS="$CXXFLAGS -ansi -march=i686 -O3 -fno-pic -fomit-frame-pointer"
48   else
49     AC_MSG_RESULT([Other])
50     CFLAGS="$CFLAGS -ansi -O3"
51     CXXFLAGS="$CXXFLAGS -ansi -O3"
52   fi
55 AC_PROG_CXX
56 AC_PROG_LIBTOOL
57 AM_SANITY_CHECK
58 AC_LANG_CPLUSPLUS
60 AC_ARG_ENABLE(debug,
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
69 then
70   AC_PATH_PROG(XSLTPROC, sabcmd, no)
71   if test x$ac_cv_path_XSLTPROC = x
72   then
73     AC_MSG_ERROR([You don't have sablotron installed.])
74   fi
75   if test x$ac_cv_path_XSLTPROC = xno
76   then
77     AC_MSG_ERROR([You don't have sablotron installed.])
78   fi
79 else 
80   AC_PATH_PROG(XSLTPROC, xsltproc, no)
81   if test x$ac_cv_path_XSLTPROC = x
82   then
83     AC_MSG_ERROR([You don't have xsltproc installed.])
84   fi
85   if test x$ac_cv_path_XSLTPROC = xno
86   then
87     AC_MSG_ERROR([You don't have xsltproc installed.])
88   fi
91 AC_PATH_PROG(BASH, bash, no)
92 if test x$ac_cv_path_BASH = x
93 then
94   AC_MSG_ERROR([You don't have bash installed.])
96 if test x$ac_cv_path_BASH = xno
97 then
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
103 then
104   AC_MSG_ERROR([You don't have perl installed.])
106 if test x$ac_cv_path_PERL = xno
107 then
108   AC_MSG_ERROR([You don't have perl installed.])
110     
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
116 then
117   AC_MSG_ERROR([You don't have pkg-config installed.])
119 if test x$ac_cv_path_PKG_CONFIG = xno
120 then
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])
129   
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.
137 AC_HEADER_STDC
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.
141 AC_HEADER_STDBOOL
142 AC_C_CONST
143 AC_TYPE_SIZE_T
145 # Checks for library functions.
146 AC_FUNC_ERROR_AT_LINE
147 AC_FUNC_MALLOC
148 AC_FUNC_REALLOC
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])