Bump to version 2.08
[platform/upstream/lzo.git] / configure.ac
1 #
2 #  configure.ac -- autoconf configuration for the LZO library
3 #
4 #  This file is part of the LZO data compression library.
5 #
6 #  Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
7 #  All Rights Reserved.
8 #
9 #  The LZO library is free software; you can redistribute it and/or
10 #  modify it under the terms of the GNU General Public License as
11 #  published by the Free Software Foundation; either version 2 of
12 #  the License, or (at your option) any later version.
13 #
14 #  The LZO library is distributed in the hope that it will be useful,
15 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 #  GNU General Public License for more details.
18 #
19 #  You should have received a copy of the GNU General Public License
20 #  along with the LZO library; see the file COPYING.
21 #  If not, write to the Free Software Foundation, Inc.,
22 #  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #
24 #  Markus F.X.J. Oberhumer
25 #  <markus@oberhumer.com>
26 #  http://www.oberhumer.com/opensource/lzo/
27 #
28
29
30 # /***********************************************************************
31 # // Init
32 # ************************************************************************/
33
34 AC_COPYRIGHT([Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer.
35 All Rights Reserved.
36 This configure script may be copied, distributed and modified under the
37 terms of the GNU General Public License; see COPYING for more details.])
38
39 AC_PREREQ(2.69)
40 AC_INIT([LZO],[2.08],[markus@oberhumer.com],[lzo],[http://www.oberhumer.com/opensource/lzo/])
41 AC_MSG_NOTICE([Configuring LZO $PACKAGE_VERSION])
42 AC_CONFIG_SRCDIR(src/lzo_init.c)
43 AC_CONFIG_AUX_DIR(autoconf)
44 m4_include([autoconf/local.m4])
45 AC_PREFIX_DEFAULT(/usr/local)
46 AC_CANONICAL_BUILD
47 AC_CANONICAL_HOST
48 AC_CANONICAL_TARGET
49 AM_MAINTAINER_MODE
50
51 if test -z "$ac_abs_top_srcdir"; then
52     _AC_SRCDIRS([.])
53 fi
54 if test -z "$ac_abs_top_srcdir"; then
55     as_fn_error 1 "internal error: ac_abs_top_srcdir is not set"
56 fi
57 if test -r .Conf.settings1; then
58     . ./.Conf.settings1
59 fi
60
61 AC_PROG_CC
62 AM_PROG_CC_C_O
63 AM_PROG_AS
64 AC_PROG_CPP
65 mfx_PROG_CPPFLAGS
66 AC_C_CONST
67 mfx_LZO_CHECK_ENDIAN
68 AC_SYS_LARGEFILE
69
70 AM_INIT_AUTOMAKE([1.14.1 gnu subdir-objects])
71 AM_SILENT_RULES([yes])
72 AC_CONFIG_HEADERS([config.h:config.hin])
73
74 AC_ENABLE_STATIC
75 AC_DISABLE_SHARED
76 LT_INIT
77
78
79 # /***********************************************************************
80 # // Checks for header files
81 # ************************************************************************/
82
83 mfx_ACC_CHECK_HEADERS
84 dnl AC_CHECK_HEADERS([sys/param.h sys/resource.h sys/times.h])
85 if test "X$ac_cv_header_limits_h" != Xyes; then
86     AC_MSG_ERROR([<limits.h> header not found])
87 fi
88 mfx_CHECK_HEADER_SANE_LIMITS_H
89 if test "X$mfx_cv_header_sane_limits_h" != Xyes; then
90     AC_MSG_ERROR([your <limits.h> header is broken - for details see config.log])
91 fi
92
93
94 # /***********************************************************************
95 # // Checks for typedefs and structures
96 # ************************************************************************/
97
98 AC_TYPE_OFF_T
99 AC_CHECK_TYPE(ptrdiff_t,long)
100 AC_TYPE_SIZE_T
101 AC_TYPE_SIGNAL
102
103 mfx_ACC_CHECK_SIZEOF
104 mfx_CHECK_SIZEOF
105
106
107 # /***********************************************************************
108 # // Checks for library functions
109 # ************************************************************************/
110
111 mfx_ACC_CHECK_FUNCS
112 mfx_CHECK_LIB_WINMM
113
114
115 # /***********************************************************************
116 # // Checks for assembler
117 # ************************************************************************/
118
119 AC_ARG_ENABLE(asm, AS_HELP_STRING(--disable-asm,disable assembly versions))
120
121 asm_arch=
122 asm_dir=
123 asm_msg_amd64=no
124 asm_msg_i386=no
125
126 case "$host_cpu-$ac_cv_sizeof_void_p" in
127     amd64-8 | x86_64-8) asm_arch="amd64"; asm_dir="asm/amd64/src_gas/elf64"; asm_mode="amd64_src_gas_elf64" ;;
128     i?86-4) asm_arch="i386"; asm_dir="asm/i386/src_gas"; asm_mode="i386_src_gas" ;;
129     *) enable_asm=no ;;
130 esac
131 LZO_USE_ASM_i386_src_gas=no
132
133 AC_MSG_CHECKING([whether to build assembly versions])
134 if test "X$enable_asm" != Xno; then
135 mfx_compile_S='${CCAS} ${CCASFLAGS} -c conftest.S 1>&AS_MESSAGE_LOG_FD'
136 cat > conftest.S <<EOF
137 #if !defined(__i386__) && !defined(__i386)
138 #error
139 this+is+an+error
140 #endif
141 #include "$ac_abs_top_srcdir/$asm_dir/lzo1x_f1.S"
142 EOF
143 enable_asm=no
144 if AC_TRY_EVAL(mfx_compile_S); then
145     if AC_TRY_COMMAND([test -s conftest.$ac_objext]); then
146         enable_asm=yes
147         eval asm_msg_$asm_arch="'yes [[$asm_dir]]'"
148         eval LZO_USE_ASM_$asm_mode=yes
149     fi
150 fi
151 if test "X$enable_asm" = Xno; then
152     echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
153     cat conftest.S >&AS_MESSAGE_LOG_FD
154 fi
155 rm -rf conftest*
156 fi
157 AC_MSG_RESULT([$enable_asm])
158
159 AM_CONDITIONAL(LZO_USE_ASM_i386_src_gas, [test "X$LZO_USE_ASM_i386_src_gas" != Xno])
160 AM_CONDITIONAL(LZO_USE_ASM_i386_obj_elf32, [false])
161
162
163 # /***********************************************************************
164 # // Write output files
165 # ************************************************************************/
166
167 mfx_LZO_LZOCHK(["-I$srcdir"],[#include "include/lzo/lzoconf.h"],["src/lzo_supp.h"])
168
169 if test -r .Conf.settings2; then
170     . ./.Conf.settings2
171 fi
172
173 my_DEFS="-DLZO_HAVE_CONFIG_H=1"
174 if test "X$enable_asm" != Xno; then
175     my_DEFS="$my_DEFS -DLZO_USE_ASM=1"
176 fi
177
178 AC_CONFIG_COMMANDS_PRE([
179     test "X$DEFS" = "X-DHAVE_CONFIG_H" && DEFS=
180     test "X$DEFS" != "X" && DEFS="$DEFS "
181     DEFS="${DEFS}${my_DEFS}"
182 ])
183 AC_CONFIG_FILES([Makefile])
184 AC_OUTPUT
185
186
187 ##   enable AMD64 assembly code : ${asm_msg_amd64}
188 cat <<EOF
189
190    LZO configuration summary
191    -------------------------
192    LZO version                : ${PACKAGE_VERSION}
193    configured for host        : ${host_cpu}-${host_vendor}-${host_os}
194    source code location       : ${srcdir}
195    compiler                   : ${CC}
196    preprocessor definitions   : ${DEFS}
197    preprocessor flags         : ${CPPFLAGS}
198    compiler flags             : ${CFLAGS}
199    build static library       : ${enable_static}
200    build shared library       : ${enable_shared}
201    enable i386 assembly code  : ${asm_msg_i386}
202
203
204    LZO ${PACKAGE_VERSION} configured.
205
206    Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
207    All Rights Reserved.
208
209    The LZO library is free software; you can redistribute it and/or
210    modify it under the terms of the GNU General Public License as
211    published by the Free Software Foundation; either version 2 of
212    the License, or (at your option) any later version.
213
214    The LZO library is distributed in the hope that it will be useful,
215    but WITHOUT ANY WARRANTY; without even the implied warranty of
216    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
217    GNU General Public License for more details.
218
219    Markus F.X.J. Oberhumer
220    <markus@oberhumer.com>
221    http://www.oberhumer.com/opensource/lzo/
222
223
224 Type \`make' to build LZO. Type \`make install' to install LZO.
225 After installing LZO, please read the accompanied documentation.
226
227 EOF
228
229 # vi:ts=4:et