1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312
|
dnl Process this file with autoconf to produce a configure script.
#
# configure.in -- autoconf configuration for the UCL library
#
# This file is part of the UCL data compression library.
#
# Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
# All Rights Reserved.
#
# The UCL library is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# The UCL library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the UCL library; see the file COPYING.
# If not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Markus F.X.J. Oberhumer
# <markus@oberhumer.com>
#
# /***********************************************************************
# // Init autoconf
# ************************************************************************/
AC_PREREQ(2.52)
AC_INIT(ucl,1.01)
AC_CONFIG_SRCDIR(src/ucl_init.c)
AC_CONFIG_AUX_DIR(acconfig)
AC_PREFIX_DEFAULT(/usr/local)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
# /***********************************************************************
# // Prepare local settings
# ************************************************************************/
CPPFLAGS="$CPPFLAGS"
CFLAGS="$CFLAGS"
CXXFLAGS="$CXXFLAGS"
CFLAGS_O=""
CFLAGS_W=""
CFLAGS_W_PEDANTIC=""
AC_SUBST(CFLAGS_O)
AC_SUBST(CFLAGS_W)
AC_SUBST(CFLAGS_W_PEDANTIC)
AC_SUBST(ASFLAGS)
AC_SUBST(UCL_CFLAGS)
mfx_settings="./Conf.settings"
if test -r "$mfx_settings"; then
echo "loading settings $mfx_settings"
mfx_settings_stage=1
. $mfx_settings
fi
# /***********************************************************************
# // Init automake
# ************************************************************************/
AC_PROG_CC
mfx_CHECK_CROSS
mfx_PROG_CC_ANSI
AM_INIT_AUTOMAKE(ucl,1.01)
AM_CONFIG_HEADER(config.h:config.hin)
AM_MAINTAINER_MODE
mfx_PROG_MAKE_GNU(mfx_GMAKE)
AM_CONDITIONAL(GMAKE, test x$mfx_GMAKE = xyes)
MOSTLYCLEANFILES='*.i'
CLEANFILES='*.bb *.bbg *.da *.gcov bb.out bbtrace* gmon.out'
AC_SUBST(MOSTLYCLEANFILES)
AC_SUBST(CLEANFILES)
mfx_enable_static="$enable_static"
mfx_enable_shared="$enable_shared"
AC_ENABLE_STATIC
AC_DISABLE_SHARED
AM_WITH_DMALLOC
dnl Allow the --disable-asm flag to stop us from building assembler functions.
dnl AC_ARG_ENABLE(asm,
dnl [ --enable-asm try to build assembler versions [default=yes]],
dnl [test "$enableval" = no && enable_asm=no])
dnl test "$enable_asm" = no || enable_asm=yes
AC_ARG_ENABLE(debug,
[ --enable-debug build a debug version [default=no]],
[test "$enableval" = yes && enable_debug=yes])
test "$enable_debug" = yes || enable_debug=no
dnl AC_ARG_ENABLE(profiling,
dnl [ --enable-profiling build a profiling version [default=no]],
dnl [test "$enableval" = yes && enable_profiling=yes])
dnl test "$enable_profiling" = yes || enable_profiling=no
dnl AC_ARG_ENABLE(coverage,
dnl [ --enable-coverage build a coverage version [default=no]],
dnl [test "$enableval" = yes && enable_coverage=yes])
dnl test "$enable_coverage" = yes || enable_coverage=no
# /***********************************************************************
# // Checks for compiler
# ************************************************************************/
AC_EXEEXT
dnl AC_PROG_CXX
AC_PROG_CPP
dnl AC_PROG_CXXCPP
AC_PROG_CC_C_O
mfx_PROG_CC_INTEGRAL_PROMOTION
mfx_PROG_CC_CHECKERGCC
if test "$enable_debug" = yes; then
CPPFLAGS="$CPPFLAGS -DUCL_DEBUG"
fi
AC_MSG_CHECKING([whether to build a debug version])
AC_MSG_RESULT($enable_debug)
# /***********************************************************************
# // Initialize libtool
# ************************************************************************/
dnl maintainer defaults to --disable-shared
if test "X$USE_MAINTAINER_MODE" = Xyes; then
test -z "$mfx_enable_shared" && enable_shared=no
fi
AC_PROG_LIBTOOL
if test "X$USE_MAINTAINER_MODE" = Xyes; then
dnl configure libtool: use /bin/ash (it's quite a bit faster), be silent
if test -x /bin/ash; then
LIBTOOL='/bin/ash $(top_builddir)/libtool'
fi
LIBTOOL="$LIBTOOL --silent"
fi
libucl='$(top_builddir)/src/libucl.la'
AC_SUBST(libucl)
# /***********************************************************************
# // Checks for other programs
# ************************************************************************/
AC_CHECK_PROG(NASM,nasm,nasm)
# /***********************************************************************
# // Checks for libraries
# ************************************************************************/
# /***********************************************************************
# // Checks for system and library header files
# ************************************************************************/
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS(assert.h ctype.h limits.h signal.h stddef.h time.h)
AC_CHECK_HEADERS(malloc.h memory.h unistd.h)
AC_CHECK_HEADERS(sys/param.h sys/resource.h sys/time.h sys/times.h)
AC_CHECK_HEADERS(endian.h sys/endian.h unchecked.h)
if test "X$ac_cv_header_limits_h" = Xno; then
AC_MSG_ERROR([<limits.h> header not found found])
fi
mfx_CHECK_HEADER_SANE_LIMITS_H
if test "X$mfx_cv_header_sane_limits_h" = Xno; then
AC_MSG_ERROR([your limits.h header is broken - for details see config.log])
fi
# /***********************************************************************
# // Checks for typedefs and structures
# ************************************************************************/
AC_CHECK_TYPE(ptrdiff_t,long)
AC_TYPE_SIZE_T
AC_CHECK_SIZEOF(unsigned short)
AC_CHECK_SIZEOF(unsigned)
AC_CHECK_SIZEOF(unsigned long)
AC_CHECK_SIZEOF(char *)
AC_CHECK_SIZEOF(ptrdiff_t)
AC_CHECK_SIZEOF(size_t)
# /***********************************************************************
# // Checks for compiler characteristics
# ************************************************************************/
AC_C_CONST
dnl not available when cross-compiling
mfx_C_BYTE_ORDER
# /***********************************************************************
# // Checks for library functions
# ************************************************************************/
AC_CHECK_FUNCS(memcmp memcpy memmove memset)
AC_CHECK_FUNCS(memicmp strcasecmp strncasecmp stricmp strnicmp)
AC_CHECK_FUNCS(atol fstat getrusage gettimeofday lstat stat times)
mfx_FUNC_MEMCMP
# /***********************************************************************
# //
# ************************************************************************/
if test "X$enable_debug" = Xyes; then
if test "X$GCC" = yes -a "X$USE_MAINTAINER_MODE" = yes; then
test "X$ac_cv_prog_cc_g" = Xyes && CFLAGS="$CFLAGS -gstabs+"
test "X$ac_cv_prog_cxx_g" = Xyes && CXXFLAGS="$CXXFLAGS -gstabs+"
else
test "X$ac_cv_prog_cc_g" = Xyes && CFLAGS="$CFLAGS -g"
test "X$ac_cv_prog_cxx_g" = Xyes && CXXFLAGS="$CXXFLAGS -g"
fi
fi
if test "X$GCC" = Xyes; then
if test "X$enable_debug" = Xyes; then
CFLAGS_O="$CFLAGS_O -O0"
else
CFLAGS_O="$CFLAGS_O -O2"
fi
CFLAGS_W="$CFLAGS_W -Wall"
case $host_cpu in
i[[3456789]]86)
MFX_ARCH="i386"
mfx_unaligned_ok_2="yes"
mfx_unaligned_ok_4="yes"
if test "X$enable_debug" != Xyes; then
CFLAGS_O="$CFLAGS_O -fomit-frame-pointer"
fi
CFLAGS_O="$CFLAGS_O -fno-strength-reduce"
;;
*)
if test "X$mfx_cv_prog_gcc_bug_strength_reduce" = Xyes; then
CFLAGS="$CFLAGS_O -fno-strength-reduce"
fi
;;
esac
if test "X$mfx_cv_prog_gcc_bug_schedule_insns" = Xyes; then
CFLAGS="$CFLAGS_O -fno-schedule-insns -fno-schedule-insns2"
fi
fi
# /***********************************************************************
# // Maintainer uses -Werror and lots of pedantic warnings.
# // This is not enabled by default because it requires
# // very clean system headers.
# ************************************************************************/
if test "X$USE_MAINTAINER_MODE" = Xyes; then
if test "X$GCC" = Xyes; then
CFLAGS_W="$CFLAGS_W -Wcast-align -Wcast-qual -Wwrite-strings"
x=`grep -h '^-' $srcdir/B/gcc_ucl.opt`
x=`echo $x`
CFLAGS_W_PEDANTIC="$CFLAGS_W_PEDANTIC -W -pedantic $x"
#
test "X${Werror+set}" = Xset || Werror="-Werror"
test "X$enable_debug" = Xyes && Werror=""
test "X$mfx_cv_prog_checkergcc" = Xyes && Werror=""
test -z "$Werror" || CFLAGS_W_PEDANTIC="$CFLAGS_W_PEDANTIC $Werror"
fi
fi
CPPFLAGS="$CPPFLAGS -DUCL_HAVE_CONFIG_H"
test "X$USE_MAINTAINER_MODE" = Xyes && CPPFLAGS="$CPPFLAGS -DMAINT"
# /***********************************************************************
# // Write output files
# ************************************************************************/
AC_OUTPUT([
Makefile
examples/Makefile
include/Makefile
include/ucl/Makefile
src/Makefile
])
|