Bump to lzop 1.04.01
[platform/upstream/lzop.git] / configure.ac
1 #
2 #  configure.ac -- autoconf configuration for the lzop package
3 #
4 #  This file is part of the lzop file compressor.
5 #
6 #  Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer
7 #  All Rights Reserved.
8 #
9 #  lzop and the LZO library are free software; you can redistribute them
10 #  and/or modify them 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 #  This program 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 this program; 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/lzop/
27 #
28
29
30 # /***********************************************************************
31 # // Init
32 # ************************************************************************/
33
34 AC_COPYRIGHT([Copyright (C) 1996-2017 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([lzop],[1.04],[lzop-bugs@oberhumer.com],[lzop],[http://www.oberhumer.com/opensource/lzop/])
41 AC_MSG_NOTICE([Configuring $PACKAGE_NAME $PACKAGE_VERSION])
42 AC_CONFIG_SRCDIR(src/lzop.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_ARG_ENABLE(asm, AS_HELP_STRING(--disable-asm,disable LZO assembly versions))
62 AC_ARG_ENABLE(ansi, AS_HELP_STRING(--disable-ansi,disable ansi console))
63 if test "X$enable_ansi" != Xno; then
64     AC_DEFINE(LZOP_ENABLE_ANSI,1,[Define to 1 if should be enabled.])
65 fi
66
67 AC_PROG_CC
68 AM_PROG_CC_C_O
69 AM_PROG_AS
70 AC_PROG_CPP
71 gl_USE_SYSTEM_EXTENSIONS
72 mfx_PROG_CPPFLAGS
73 AC_C_CONST
74 mfx_ACC_CHECK_ENDIAN
75 AC_SYS_LARGEFILE
76
77 AM_INIT_AUTOMAKE([1.14.1 foreign subdir-objects])
78 AM_SILENT_RULES([yes])
79 AC_CONFIG_HEADERS([config.h:config.hin])
80 AH_TOP([#ifndef LZOP_AUTOCONF_CONFIG_H_INCLUDED__
81 #define LZOP_AUTOCONF_CONFIG_H_INCLUDED__ 1])
82 AH_BOTTOM([#endif /* already included */])
83
84
85 # /***********************************************************************
86 # // Checks for header files 1)
87 # ************************************************************************/
88
89 mfx_ACC_CHECK_HEADERS
90 if test "X$ac_cv_header_limits_h" != Xyes; then
91     AC_MSG_ERROR([<limits.h> header not found])
92 fi
93 mfx_CHECK_HEADER_SANE_LIMITS_H
94 if test "X$mfx_cv_header_sane_limits_h" != Xyes; then
95     AC_MSG_ERROR([your <limits.h> header is broken - for details see config.log])
96 fi
97
98
99 # /***********************************************************************
100 # // Checks for LZO library
101 # ************************************************************************/
102
103 lzoconf_h=
104 if test "X$lzoconf_h" = X; then
105     AC_CHECK_HEADERS([lzo/lzoconf.h lzo/lzo1x.h])
106     if test "X$ac_cv_header_lzo_lzoconf_h$ac_cv_header_lzo_lzo1x_h" = Xyesyes; then
107         lzoconf_h='lzo/lzoconf.h'
108     fi
109 fi
110 if test "X$lzoconf_h" = X; then
111     AC_CHECK_HEADERS([lzoconf.h lzo1x.h])
112     if test "X$ac_cv_header_lzoconf_h$ac_cv_header_lzo1x_h" = Xyesyes; then
113         lzoconf_h='lzoconf.h'
114     fi
115 fi
116 if test "X$lzoconf_h" = X; then
117   AC_MSG_ERROR([LZO header files not found. Please check your installation or set the environment variable \`CPPFLAGS'.])
118 fi
119
120
121 AC_MSG_CHECKING([for version information in $lzoconf_h...])
122 lzoconf_h_version=
123 if test "X$lzoconf_h_version" = X; then
124     AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <$lzoconf_h>
125 #if defined(LZO_VERSION) && (LZO_VERSION >= 0x2000)
126 #else
127 #  error "LZO_VERSION v2"
128 #endif
129 ])], [lzoconf_h_version=2], [])
130 fi
131 if test "X$lzoconf_h_version" = X; then
132     AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <$lzoconf_h>
133 #if defined(LZO_VERSION) && (LZO_VERSION >= 0x1040)
134 #else
135 #  error "LZO_VERSION v1"
136 #endif
137 ])], [lzoconf_h_version=1], [])
138 fi
139 AC_MSG_RESULT([v$lzoconf_h_version])
140 if test "X$lzoconf_h_version" = X; then
141     AC_MSG_ERROR([your LZO headers are broken - for details see config.log])
142 fi
143
144
145 if test "X$lzoconf_h_version" = X1; then
146     AC_CHECK_LIB(lzo,__lzo_init2,,AC_MSG_ERROR([LZO library v1 not found. Please check your installation or set the environment variable \`LDFLAGS'.]))
147 fi
148 if test "X$lzoconf_h_version" = X2; then
149     AC_CHECK_LIB(lzo2,__lzo_init_v2,,AC_MSG_ERROR([LZO library v2 not found. Please check your installation or set the environment variable \`LDFLAGS'.]))
150 fi
151
152
153 # /***********************************************************************
154 # // Checks for header files 2)
155 # ************************************************************************/
156
157 AC_CHECK_HEADERS([conio.h direct.h dos.h io.h share.h sys/utime.h])
158 dnl AC_CHECK_HEADERS([linux/kd.h linux/kdev_t.h linux/major.h])
159 dnl AC_CHECK_HEADERS([curses.h ncurses.h])
160
161
162 # /***********************************************************************
163 # // Checks for typedefs and structures
164 # ************************************************************************/
165
166 AC_TYPE_OFF_T
167 AC_CHECK_TYPE(ptrdiff_t,long)
168 AC_TYPE_SIZE_T
169 AC_TYPE_SIGNAL
170 gl_STAT_TIME
171
172 mfx_ACC_CHECK_SIZEOF
173 mfx_CHECK_SIZEOF
174
175
176 # /***********************************************************************
177 # // Checks for library functions
178 # ************************************************************************/
179
180 mfx_ACC_CHECK_FUNCS
181 mfx_CHECK_LIB_WINMM
182
183
184 # /***********************************************************************
185 # // Write output files
186 # ************************************************************************/
187
188 mfx_MINIACC_ACCCHK(["-I$srcdir"],["src/miniacc.h"])
189
190 if test -r .Conf.settings2; then
191     . ./.Conf.settings2
192 fi
193
194 my_DEFS="-DLZOP_HAVE_CONFIG_H=1"
195
196 AC_CONFIG_COMMANDS_PRE([
197     test "X$DEFS" = "X-DHAVE_CONFIG_H" && DEFS=
198     test "X$DEFS" != "X" && DEFS="$DEFS "
199     DEFS="${DEFS}${my_DEFS}"
200 ])
201 AC_CONFIG_FILES([Makefile])
202 AC_OUTPUT
203
204
205 cat <<EOF
206
207    lzop configuration summary
208    --------------------------
209    lzop version               : ${PACKAGE_VERSION}
210    configured for host        : ${host_cpu}-${host_vendor}-${host_os}
211    source code location       : ${srcdir}
212    compiler                   : ${CC}
213    preprocessor definitions   : ${DEFS}
214    preprocessor flags         : ${CPPFLAGS}
215    compiler flags             : ${CFLAGS}
216    linker flags               : ${LDFLAGS}
217    link libraries             : ${LIBS}
218
219
220    ${PACKAGE_NAME} ${PACKAGE_VERSION} configured.
221
222    Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer
223    All Rights Reserved.
224
225    lzop and the LZO library are free software; you can redistribute them
226    and/or modify them under the terms of the GNU General Public License as
227    published by the Free Software Foundation; either version 2 of
228    the License, or (at your option) any later version.
229
230    This program is distributed in the hope that it will be useful,
231    but WITHOUT ANY WARRANTY; without even the implied warranty of
232    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
233    GNU General Public License for more details.
234
235    Markus F.X.J. Oberhumer
236    <markus@oberhumer.com>
237    http://www.oberhumer.com/opensource/lzop/
238
239
240 Type \`make' to build ${PACKAGE_NAME}. Type \`make install' to install ${PACKAGE_NAME}.
241 After installing ${PACKAGE_NAME}, please read the accompanied documentation.
242
243 EOF
244
245 # vim:set ts=4 sw=4 et: