tizen 2.3.1 release
[external/lzo2.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-2008 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-2008 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.59)
40 AC_INIT([lzo],[2.03],[markus@oberhumer.com])
41 AC_MSG_NOTICE([Configuring LZO $PACKAGE_VERSION])
42 AC_CONFIG_SRCDIR(src/lzo_init.c)
43 AC_CONFIG_AUX_DIR(autoconf)
44 AC_PREFIX_DEFAULT(/usr/local)
45 AC_CANONICAL_BUILD
46 AC_CANONICAL_HOST
47 AC_CANONICAL_TARGET
48 AM_MAINTAINER_MODE
49
50 if test -z "$ac_abs_top_srcdir"; then
51     _AC_SRCPATHS(.)
52 fi
53 if test -r .Conf.settings1; then
54     . ./.Conf.settings1
55 fi
56
57 AC_PROG_CC
58 AC_PROG_CPP
59 mfx_PROG_CPPFLAGS
60 AC_C_CONST
61 mfx_LZO_CHECK_ENDIAN
62 AC_SYS_LARGEFILE
63
64 AM_INIT_AUTOMAKE
65 AC_CONFIG_HEADERS([config.h:config.hin])
66
67 AC_ENABLE_STATIC
68 AC_DISABLE_SHARED
69 AC_PROG_LIBTOOL
70
71
72 # /***********************************************************************
73 # // Checks for assembler
74 # ************************************************************************/
75
76 AC_ARG_ENABLE(asm, AS_HELP_STRING(--disable-asm,disable assembly versions))
77
78 asm_arch=
79 asm_dir=
80 asm_msg_amd64=no
81 asm_msg_i386=no
82
83 case $host_cpu in
84     amd64 | x86_64) asm_arch="amd64"; asm_dir="asm/amd64/src_gas/elf64" ;;
85     i?86) asm_arch="i386"; asm_dir="asm/i386/src_gas" ;;
86     *) enable_asm=no ;;
87 esac
88 LZO_ASM_VPATH=
89
90 AC_MSG_CHECKING([whether to build assembly versions])
91 if test "X$enable_asm" != Xno; then
92 mfx_compile_S='${CC-cc} -c conftest.S 1>&AS_MESSAGE_LOG_FD'
93 cat > conftest.S <<EOF
94 #include "$ac_abs_top_srcdir/$asm_dir/lzo1x_f1.S"
95 EOF
96 enable_asm=no
97 if AC_TRY_EVAL(mfx_compile_S); then
98     if AC_TRY_COMMAND([test -s conftest.$ac_objext]); then
99         enable_asm=yes
100         eval asm_msg_$asm_arch="'yes [[$asm_dir]]'"
101         LZO_ASM_VPATH=":$ac_abs_top_srcdir/$asm_dir"
102     fi
103 fi
104 if test "X$enable_asm" = Xno; then
105     echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
106     cat conftest.S >&AS_MESSAGE_LOG_FD
107 fi
108 rm -rf conftest*
109 fi
110 AC_MSG_RESULT([$enable_asm])
111
112 AM_CONDITIONAL(LZO_USE_ASM, [test "X$enable_asm" != Xno])
113 AC_SUBST(LZO_ASM_VPATH)
114
115
116 # /***********************************************************************
117 # // Checks for header files
118 # ************************************************************************/
119
120 mfx_ACC_CHECK_HEADERS
121 dnl AC_CHECK_HEADERS([sys/param.h sys/resource.h sys/times.h])
122 if test "X$ac_cv_header_limits_h" != Xyes; then
123     AC_MSG_ERROR([<limits.h> header not found])
124 fi
125 mfx_CHECK_HEADER_SANE_LIMITS_H
126 if test "X$mfx_cv_header_sane_limits_h" != Xyes; then
127     AC_MSG_ERROR([your <limits.h> header is broken - for details see config.log])
128 fi
129
130
131 # /***********************************************************************
132 # // Checks for typedefs and structures
133 # ************************************************************************/
134
135 AC_TYPE_OFF_T
136 AC_CHECK_TYPE(ptrdiff_t,long)
137 AC_TYPE_SIZE_T
138 AC_TYPE_SIGNAL
139
140 mfx_ACC_CHECK_SIZEOF
141 mfx_CHECK_SIZEOF
142
143
144 # /***********************************************************************
145 # // Checks for library functions
146 # ************************************************************************/
147
148 mfx_ACC_CHECK_FUNCS
149 mfx_CHECK_LIB_WINMM
150
151
152 # /***********************************************************************
153 # // Write output files
154 # ************************************************************************/
155
156 mfx_MINIACC_ACCCHK(["-I$srcdir"],["src/miniacc.h"])
157
158 if test -r .Conf.settings2; then
159     . ./.Conf.settings2
160 fi
161
162 test "X$CPPFLAGS" != "X" && CPPFLAGS="$CPPFLAGS "
163 CPPFLAGS="${CPPFLAGS}-DLZO_HAVE_CONFIG_H"
164 if test "X$enable_asm" != Xno; then
165     CPPFLAGS="$CPPFLAGS -DLZO_USE_ASM"
166 fi
167 AC_SUBST(LZO_CPPFLAGS)
168 AC_SUBST(LZO_EXTRA_CPPFLAGS)
169 AC_SUBST(LZO_CFLAGS)
170 AC_SUBST(LZO_EXTRA_CFLAGS)
171
172 configure_CPPFLAGS=$CPPFLAGS
173 configure_CFLAGS=$CFLAGS
174 AC_SUBST(configure_CPPFLAGS)
175 AC_SUBST(configure_CFLAGS)
176
177 AC_CONFIG_FILES([Makefile examples/Makefile include/Makefile include/lzo/Makefile lzotest/Makefile minilzo/Makefile src/Makefile tests/Makefile])
178 AC_OUTPUT
179
180
181 ##   enable AMD64 assembly code : ${asm_msg_amd64}
182 cat <<EOF
183
184    LZO configuration summary
185    -------------------------
186    LZO version                : ${PACKAGE_VERSION}
187    configured for host        : ${host_cpu}-${host_vendor}-${host_os}
188    source code location       : ${srcdir}
189    compiler                   : ${CC}
190    preprocessor flags         : ${CPPFLAGS}
191    compiler flags             : ${CFLAGS}
192    build static library       : ${enable_static}
193    build shared library       : ${enable_shared}
194    enable i386 assembly code  : ${asm_msg_i386}
195
196
197    LZO ${PACKAGE_VERSION} configured.
198
199    Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer
200    All Rights Reserved.
201
202    The LZO library is free software; you can redistribute it and/or
203    modify it under the terms of the GNU General Public License as
204    published by the Free Software Foundation; either version 2 of
205    the License, or (at your option) any later version.
206
207    The LZO library is distributed in the hope that it will be useful,
208    but WITHOUT ANY WARRANTY; without even the implied warranty of
209    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
210    GNU General Public License for more details.
211
212    Markus F.X.J. Oberhumer
213    <markus@oberhumer.com>
214    http://www.oberhumer.com/opensource/lzo/
215
216
217 Type \`make' to build LZO. Type \`make install' to install LZO.
218 After installing LZO, please read the accompanied documentation.
219
220 EOF
221
222 # vi:ts=4:et