Updated the program name to apertium-talk
[apertium.git] / lttoolbox / configure.ac
blob3405605e7788f6ddb1a9780b042da447b35b9417
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.52)
6 m4_define([required_libxml_version], [2.6.17])
7 #m4_define([required_pkg_config_version], [0.15])
9 AC_INIT([lttoolbox/lttoolbox.H], [2.0.3], [sortiz@users.sourceforge.net])
10 AC_CONFIG_HEADER([lttoolbox/LttoolsConfig.H])
12 GENERIC_LIBRARY_NAME=lttoolbox
14 # Release versioning
15 GENERIC_MAJOR_VERSION=2
16 GENERIC_MINOR_VERSION=0
17 GENERIC_MICRO_VERSION=3
19 # API version (often = GENERIC_MAJOR_VERSION.GENERIC_MINOR_VERSION)
20 GENERIC_API_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
21 AC_SUBST(GENERIC_API_VERSION)
23 # Shared library versioning
24 GENERIC_LIBRARY_VERSION=0:0:0
25 #                       | | |
26 #                +------+ | +---+
27 #                |        |     |
28 #             current:revision:age
29 #                |        |     |
30 #                |        |     +- increment if interfaces have been added
31 #                |        |        set to zero if interfaces have been removed
32 #                                  or changed
33 #                |        +- increment if source code has changed
34 #                |           set to zero if current is incremented
35 #                +- increment if interfaces have been added, removed or changed
37 AC_SUBST(GENERIC_LIBRARY_VERSION)
38 PACKAGE=$GENERIC_LIBRARY_NAME
39 AC_SUBST(GENERIC_LIBRARY_NAME)
41 GENERIC_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION.$GENERIC_MICRO_VERSION
42 GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
43 AC_SUBST(GENERIC_RELEASE)
44 AC_SUBST(GENERIC_VERSION)
46 VERSION=$GENERIC_VERSION
48 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
50 # Checks for programs.
52 AC_MSG_CHECKING([Compilation architecture: PPC, i686, Other])
53 ARCH=$(/bin/arch)
54 if test x$ARCH = xppc
55 then
56   AC_MSG_RESULT([PowerPC])
57   CFLAGS="$CFLAGS -Wall -ansi -mpowerpc -maltivec -fno-pic -fomit-frame-pointer"
58   CXXFLAGS="$CXXFLAGS -Wall -ansi -mpowerpc -maltivec -fno-pic -fomit-frame-pointer"
59 else
60   if test x$ARCH = xi686
61   then
62     AC_MSG_RESULT([i686])
63     CFLAGS="$CFLAGS -Wall -ansi -march=i686 -O3 -fomit-frame-pointer -funroll-loops"
64     CXXFLAGS="$CXXFLAGS -Wall -ansi -march=i686 -O3 \
65               -fomit-frame-pointer -funroll-loops"
66   else
67     AC_MSG_RESULT([Other])
68     CFLAGS="$CFLAGS -Wall -ansi -O3"
69     CXXFLAGS="$CXXFLAGS -Wall -ansi -O3"
70   fi
73 AC_PROG_CXX
74 AM_PROG_LIBTOOL
75 AM_SANITY_CHECK
76 AC_LANG_CPLUSPLUS
78 AC_ARG_ENABLE(debug,
79               [  --enable-debug  Enable "-g -Wall" compiler options],
80               [CXXFLAGS="-g -Wall";CFLAGS="-g -Wall"])
82 AC_ARG_ENABLE(profile,
83               [  --enable-profile  Enable "-pg -g -Wall" compiler options],
84               [CXXFLAGS="-pg -g -Wall"; CFLAGS="-pg -g -Wall"; LDFLAGS="-pg"])
85                             
87 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
88 if test x$ac_cv_path_PKG_CONFIG = x
89 then
90   AC_MSG_ERROR([You don't have pkg-config installed])
92 if test x$ac_cv_path_PKG_CONFIG = xno
93 then
94   AC_MSG_ERROR([You don't have pkg-config installed])
97 PKG_CHECK_MODULES(LTTOOLBOX, [dnl
98   libxml-2.0 >= required_libxml_version])
100 # Checks for libraries.
101 AC_CHECK_LIB(xml2, xmlReaderForFile)
103 # Checks for header files.
104 AC_HEADER_STDC
105 AC_CHECK_HEADERS([stdlib.h string.h unistd.h stddef.h])
107 # Checks for typedefs, structures, and compiler characteristics.
108 AC_HEADER_STDBOOL
109 AC_C_CONST
110 AC_TYPE_SIZE_T
112 # Checks for library functions.
113 AC_FUNC_ERROR_AT_LINE
114 AC_FUNC_MALLOC
115 AC_FUNC_REALLOC
117 AC_CHECK_DECLS([fread_unlocked, fwrite_unlocked, fgetc_unlocked, fputc_unlocked, fputs_unlocked])
118                 
119 AC_CHECK_FUNCS([setlocale strdup getopt_long])
121 AC_OUTPUT([Makefile lttoolbox-2.0.pc lttoolbox/Makefile])