1#
2#  configure.ac -- autoconf configuration for the UCL library
3#
4#  This file is part of the UCL data compression library.
5#
6#  Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
7#  All Rights Reserved.
8#
9#  The UCL 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 UCL 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 UCL library; see the file COPYING.
21#  If not, write to the Free Software Foundation, Inc.,
22#  59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23#
24#  Markus F.X.J. Oberhumer
25#  <markus@oberhumer.com>
26#  http://www.oberhumer.com/opensource/ucl/
27#
28
29
30# /***********************************************************************
31# // Init
32# ************************************************************************/
33
34AC_COPYRIGHT([Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer.
35All Rights Reserved.
36This configure script may be copied, distributed and modified under the
37terms of the GNU General Public License; see COPYING for more details.])
38
39AC_PREREQ(2.59)
40AC_INIT(ucl,1.03,markus@oberhumer.com)
41AC_MSG_NOTICE([Configuring UCL $PACKAGE_VERSION])
42AC_CONFIG_SRCDIR(src/ucl_init.c)
43AC_CONFIG_AUX_DIR(acconfig)
44AC_PREFIX_DEFAULT(/usr/local)
45AC_CANONICAL_BUILD
46AC_CANONICAL_HOST
47AC_CANONICAL_TARGET
48AM_MAINTAINER_MODE
49
50if test -z "$ac_abs_top_srcdir"; then
51    _AC_SRCPATHS(.)
52fi
53if test -r .Conf.settings1; then
54    . ./.Conf.settings1
55fi
56
57AC_PROG_CC
58AC_PROG_CPP
59mfx_PROG_CPPFLAGS
60AC_C_CONST
61mfx_ACC_CHECK_ENDIAN
62AC_SYS_LARGEFILE
63
64AM_INIT_AUTOMAKE
65AM_CONFIG_HEADER(config.h:config.hin)
66
67AC_ENABLE_STATIC
68AC_DISABLE_SHARED
69AC_PROG_LIBTOOL
70
71
72# /***********************************************************************
73# // Checks for assembler
74# ************************************************************************/
75
76AC_ARG_ENABLE(asm, AC_HELP_STRING([--disable-asm], [disable i386 assembly versions]))
77case $host_cpu in
78    i?86) ;;
79    *) enable_asm=no ;;
80esac
81UCL_ASM_VPATH=
82
83AC_MSG_CHECKING([whether to build i386 assembly versions])
84if test "X$enable_asm" != Xno; then
85mfx_compile_S='${CC-cc} -c conftest.S 1>&AS_MESSAGE_LOG_FD'
86cat > conftest.S <<EOF
87#include "$ac_abs_top_srcdir/asm/i386/src_gas/crc_asm.S"
88EOF
89enable_asm=no
90if AC_TRY_EVAL(mfx_compile_S); then
91    if AC_TRY_COMMAND([test -s conftest.$ac_objext]); then
92        enable_asm=yes
93        UCL_ASM_VPATH=":$ac_abs_top_srcdir/asm/i386/src_gas"
94    fi
95fi
96if test "X$enable_asm" = Xno; then
97    echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
98    cat conftest.S >&AS_MESSAGE_LOG_FD
99fi
100rm -rf conftest*
101fi
102AC_MSG_RESULT([$enable_asm])
103
104AM_CONDITIONAL(UCL_USE_ASM, [test "X$enable_asm" != Xno])
105AC_SUBST(UCL_ASM_VPATH)
106
107
108# /***********************************************************************
109# // Checks for header files
110# ************************************************************************/
111
112mfx_ACC_CHECK_HEADERS
113dnl AC_CHECK_HEADERS([sys/param.h sys/resource.h sys/times.h])
114if test "X$ac_cv_header_limits_h" != Xyes; then
115    AC_MSG_ERROR([<limits.h> header not found])
116fi
117mfx_CHECK_HEADER_SANE_LIMITS_H
118if test "X$mfx_cv_header_sane_limits_h" != Xyes; then
119    AC_MSG_ERROR([your <limits.h> header is broken - for details see config.log])
120fi
121
122
123# /***********************************************************************
124# // Checks for typedefs and structures
125# ************************************************************************/
126
127AC_TYPE_OFF_T
128AC_CHECK_TYPE(ptrdiff_t,long)
129AC_TYPE_SIZE_T
130AC_TYPE_SIGNAL
131
132mfx_ACC_CHECK_SIZEOF
133mfx_CHECK_SIZEOF
134
135
136# /***********************************************************************
137# // Checks for library functions
138# ************************************************************************/
139
140mfx_ACC_CHECK_FUNCS
141mfx_CHECK_LIB_WINMM
142
143
144# /***********************************************************************
145# // Write output files
146# ************************************************************************/
147
148mfx_ACC_ACCCHK(["-I$srcdir -I$srcdir/acc"])
149
150if test -r .Conf.settings2; then
151    . ./.Conf.settings2
152fi
153
154CPPFLAGS="$CPPFLAGS -DUCL_HAVE_CONFIG_H"
155if test "X$enable_asm" != Xno; then
156    CPPFLAGS="$CPPFLAGS -DUCL_USE_ASM"
157fi
158AC_SUBST(UCL_CPPFLAGS)
159AC_SUBST(UCL_EXTRA_CPPFLAGS)
160AC_SUBST(UCL_CFLAGS)
161AC_SUBST(UCL_EXTRA_CFLAGS)
162
163configure_CPPFLAGS=$CPPFLAGS
164configure_CFLAGS=$CFLAGS
165AC_SUBST(configure_CPPFLAGS)
166AC_SUBST(configure_CFLAGS)
167
168AC_CONFIG_FILES([Makefile examples/Makefile include/Makefile include/ucl/Makefile src/Makefile])
169AC_OUTPUT
170
171
172cat <<EOF
173
174   UCL configuration summary
175   -------------------------
176   UCL version               : ${PACKAGE_VERSION}
177   host operating system     : ${host_cpu}-${host_vendor}-${host_os}
178   source code location      : ${srcdir}
179   compiler                  : ${CC}
180   preprocessor flags        : ${CPPFLAGS}
181   compiler flags            : ${CFLAGS}
182   build static library      : ${enable_static}
183   build shared library      : ${enable_shared}
184   enable i386 assembly code : ${enable_asm}
185
186
187   UCL ${PACKAGE_VERSION} configured.
188
189   Copyright (C) 1996-2004 Markus Franz Xaver Johannes Oberhumer
190   All Rights Reserved.
191
192   The UCL library is free software; you can redistribute it and/or
193   modify it under the terms of the GNU General Public License as
194   published by the Free Software Foundation; either version 2 of
195   the License, or (at your option) any later version.
196
197   The UCL library is distributed in the hope that it will be useful,
198   but WITHOUT ANY WARRANTY; without even the implied warranty of
199   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
200   GNU General Public License for more details.
201
202   Markus F.X.J. Oberhumer
203   <markus@oberhumer.com>
204   http://www.oberhumer.com/opensource/ucl/
205
206
207Type \`make' to build UCL. Type \`make install' to install UCL.
208After installing UCL, please read the accompanied documentation.
209
210EOF
211
212# vi:ts=4:et
213