2 # Process this file with autoconf to produce a configure script.
6 m4_define([required_libxml_version], [2.6.17])
8 AC_INIT([lttoolbox/lttoolbox.h], [3.0.2], [sortiz@users.sourceforge.net])
9 AC_CONFIG_HEADER([lttoolbox/lttools_config.h])
11 GENERIC_LIBRARY_NAME=lttoolbox
14 GENERIC_MAJOR_VERSION=3
15 GENERIC_MINOR_VERSION=0
16 GENERIC_MICRO_VERSION=2
18 # API version (often = GENERIC_MAJOR_VERSION.GENERIC_MINOR_VERSION)
19 GENERIC_API_VERSION=$GENERIC_MAJOR_VERSION
20 AC_SUBST(GENERIC_API_VERSION)
22 # Shared library versioning
23 GENERIC_LIBRARY_VERSION=0:0:0
27 # current:revision:age
29 # | | +- increment if interfaces have been added
30 # | | set to zero if interfaces have been removed
32 # | +- increment if source code has changed
33 # | set to zero if current is incremented
34 # +- increment if interfaces have been added, removed or changed
36 AC_SUBST(GENERIC_LIBRARY_VERSION)
37 PACKAGE=$GENERIC_LIBRARY_NAME
38 AC_SUBST(GENERIC_LIBRARY_NAME)
40 GENERIC_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION.$GENERIC_MICRO_VERSION
41 GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
42 AC_SUBST(GENERIC_RELEASE)
43 AC_SUBST(GENERIC_VERSION)
45 VERSION=$GENERIC_VERSION
47 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
49 # Checks for programs.
51 AC_MSG_CHECKING([Compilation architecture: PPC, i686, x86_64, Other])
52 if test x$(which arch) = x
53 then ARCH=$($(which uname) -m)
54 else ARCH=$($(which arch))
59 AC_MSG_RESULT([PowerPC])
60 CFLAGS="-Wall -ansi -mpowerpc -maltivec -fno-pic -fomit-frame-pointer $CFLAGS"
61 CXXFLAGS="-Wall -ansi -mpowerpc -maltivec -fno-pic -fomit-frame-pointer $CXXFLAGS"
63 if test x$ARCH = xi686
66 CFLAGS="-Wall -ansi -march=i686 -O3 -fomit-frame-pointer -funroll-loops $CFLAGS"
67 CXXFLAGS="-Wall -ansi -march=i686 -O3 \
68 -fomit-frame-pointer -funroll-loops $CXXFLAGS"
71 if test x$ARCH = xx86_64
73 AC_MSG_RESULT([x86_64])
74 CFLAGS="-Wall -ansi -O3 -mtune=nocona -fomit-frame-pointer -funroll-loops $CFLAGS"
75 CXXFLAGS="-Wall -ansi -O3 -mtune=nocona \
76 -fomit-frame-pointer -funroll-loops $CXXFLAGS"
78 AC_MSG_RESULT([Other])
79 CFLAGS="-Wall -ansi -O3 $CFLAGS"
80 CXXFLAGS="-Wall -ansi -O3 $CXXFLAGS"
91 [ --enable-debug Enable "-g -Wall" compiler options],
92 [CXXFLAGS="-g -Wall";CFLAGS="-g -Wall"])
94 AC_ARG_ENABLE(profile,
95 [ --enable-profile Enable "-pg -g -Wall" compiler options],
96 [CXXFLAGS="-pg -g -Wall"; CFLAGS="-pg -g -Wall"; LDFLAGS="-pg"])
99 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
100 if test x$ac_cv_path_PKG_CONFIG = x
102 AC_MSG_ERROR([You don't have pkg-config installed])
104 if test x$ac_cv_path_PKG_CONFIG = xno
106 AC_MSG_ERROR([You don't have pkg-config installed])
109 PKG_CHECK_MODULES(LTTOOLBOX, [dnl
110 libxml-2.0 >= required_libxml_version])
112 # Checks for libraries.
113 AC_CHECK_LIB(xml2, xmlReaderForFile)
115 # Checks for header files.
117 AC_CHECK_HEADERS([stdlib.h string.h unistd.h stddef.h])
119 # Checks for typedefs, structures, and compiler characteristics.
124 # Checks for library functions.
125 AC_FUNC_ERROR_AT_LINE
129 AC_CHECK_DECLS([fread_unlocked, fwrite_unlocked, fgetc_unlocked, \
130 fputc_unlocked, fputs_unlocked, \
131 fgetwc_unlocked, fputwc_unlocked, fputws_unlocked])
133 AC_CHECK_FUNCS([setlocale strdup getopt_long])
135 AC_OUTPUT([Makefile lttoolbox-3.0.pc lttoolbox/Makefile])