Moving a pair and adding some makefiles
[apertium.git] / apertium-transfer-tools / configure.ac
blobabc0d1293888b5703e43f43674d134e4ddc206a3
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])
7 m4_define([required_apertium_version], [2.0])
8 m4_define([required_libxml_version], [2.6.17])
10 AC_INIT([apertium-transfer-tools], [0.9.1], [fsanchez@dlsi.ua.es])
12 AC_CONFIG_HEADERS([src/configure.H])
14 # Release versioning
15 GENERIC_MAJOR_VERSION=0
16 GENERIC_MINOR_VERSION=9
17 GENERIC_MICRO_VERSION=1
19 GENERIC_API_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
20 AC_SUBST(GENERIC_API_VERSION)
22 PACKAGE=apertium-transfer-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 -Wall"
41   CXXFLAGS="$CXXFLAGS -ansi -mpowerpc -maltivec -fno-pic -fomit-frame-pointer -Wall"
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 -Wall"
47     CXXFLAGS="$CXXFLAGS -ansi -march=i686 -O3 -fno-pic -fomit-frame-pointer -Wall"
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"])
67               
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
89 #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(APERTIUM_DESTXT, apertium-destxt, no)
104 AC_PATH_PROG(AWK, awk, no)
105 if test x$ac_cv_path_AWK = x
106 then
107   AC_MSG_ERROR([You don't have awk installed.])
109 if test x$ac_cv_path_AWK = xno
110 then
111   AC_MSG_ERROR([You don't have awk installed.])
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.])
125 # Checking zlib
126 echo Checking zlib
127 AC_CHECK_HEADERS(zlib.h,
128   AC_CHECK_LIB(z, gzread,[
129     AC_DEFINE([HAVE_LIBZ], [], [Have compression library])
130       if test "x${Z_DIR}" != "x"
131       then
132         Z_CFLAGS="-I${Z_DIR}/include"
133         Z_LIBS="-L${Z_DIR}/lib -lz"
134       else
135         Z_LIBS="-lz"
136       fi]))
138 AC_SUBST(Z_CFLAGS)
139 AC_SUBST(Z_LIBS)
141 PKG_CHECK_MODULES(LIBXML2, [dnl
142   libxml-2.0 >= required_libxml_version])
144 PKG_CHECK_MODULES(LTTOOLBOX, [dnl
145   lttoolbox-2.0 >= required_lttoolbox_version])
146   
147 PKG_CHECK_MODULES(APERTIUM, [dnl
148   apertium-2.0 >= required_apertium_version])
150 AC_PATH_PROG(XMLLINT, xmllint, no)
152 #Check for libraries.
153 AC_CHECK_LIB(xml2, xmlReaderForFile)
155 # Checks for header files.
156 AC_HEADER_STDC
157 AC_CHECK_HEADERS([regex.h sys/types.h sys/times.h sys/wait.h sys/resource.h locale.h getopt.h])
159 # Checks for typedefs, structures, and compiler characteristics.
160 AC_HEADER_STDBOOL
161 AC_C_CONST
162 AC_TYPE_SIZE_T
164 # Checks for library functions.
165 AC_FUNC_ERROR_AT_LINE
166 AC_FUNC_MALLOC
167 AC_FUNC_REALLOC
169 #AC_CHECK_DECLS([fread_unlocked, fwrite_unlocked, fgetc_unlocked, fputc_unlocked, fputs_unlocked, getopt_long])
170 AC_CHECK_DECLS([getopt_long])
172 #AC_CHECK_FUNCS([setlocale strdup])
173 #AC_CHECK_FUNCS([setlocale])
175 AC_OUTPUT([Makefile src/Makefile apertium-transfer-tools-0.9.pc])