Fix build failure on case-insensitive file systems.
[debian/gzip] / configure.ac
1 # Configure template for gzip.
2
3 # Copyright (C) 1999, 2000, 2001, 2002, 2006 Free Software Foundation, Inc.
4 # Copyright (C) 1992-1993 Jean-loup Gailly
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 # 02111-1307, USA.
20
21 AC_PREREQ([2.60])
22 AC_INIT([gzip], [1.3.6], [bug-gzip@gnu.org])
23 AC_CONFIG_SRCDIR(gzip.c)
24 AC_CONFIG_AUX_DIR(build-aux)
25 AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
26 AM_INIT_AUTOMAKE([gnits])
27
28 AC_PROG_CC_STDC
29 AM_PROG_CC_C_O
30 AC_PROG_CPP
31 AC_PROG_LN_S
32 AC_PROG_RANLIB
33 AC_PROG_SHELL
34
35 gl_EARLY
36 AC_SYS_LARGEFILE
37
38 gl_INIT
39
40 # cc -E produces incorrect asm files on SVR4, we must use /lib/cpp.
41 test -z "$ASCPP" && test -f /lib/cpp && ASCPP=/lib/cpp
42 test -z "$ASCPP" && ASCPP="$CPP"
43
44 AC_CACHE_CHECK([for underline in external names], [gzip_cv_underline],
45   [gzip_cv_underline=yes
46    AC_TRY_COMPILE([int foo() {return 0;}], [],
47      [nm conftest.$OBJEXT | grep _foo >/dev/null 2>&1 ||
48         gzip_cv_underline=no])])
49 if test $gzip_cv_underline = no; then
50   ASCPP="${ASCPP} -DNO_UNDERLINE"
51 fi
52 AC_OBJEXT
53
54 # Try to assemble match.S.
55 # "gcc -E match.s" ignores -E, so we must use match.S.
56 AC_CACHE_CHECK([for assembler], [gzip_cv_assembler],
57   [gzip_cv_assembler=no
58    case " $DEFS " in
59    *' NO_ASM '*) ;;
60    *)
61      if cp $srcdir/lib/match.c _match.S &&
62         eval "$ASCPP _match.S > match_.s 2>/dev/null"; then
63        if test ! -s match_.s || grep error < match_.s > /dev/null; then
64          :
65        elif eval "$CC -c match_.s >/dev/null 2>&1" &&
66             test -f match_.$OBJEXT; then
67          gzip_cv_assembler=yes
68        fi
69      fi
70      rm -f _match.S match_.s match_.$OBJEXT;;
71    esac])
72 if test $gzip_cv_assembler = yes; then
73   AC_DEFINE(ASMV, ,
74     [Define if an assembler version of longest_match is available.])
75   AC_LIBOBJ(match)
76 fi
77
78 AC_ISC_POSIX
79 AC_C_CONST
80 AC_HEADER_STDC
81 AC_CHECK_HEADERS_ONCE(fcntl.h limits.h memory.h time.h)
82 AC_CHECK_FUNCS_ONCE([fchmod fchown fdopendir lstat siginterrupt])
83 AC_HEADER_DIRENT
84 AC_TYPE_SIGNAL
85 AC_TYPE_SIZE_T
86 AC_TYPE_OFF_T
87
88 AC_PREFIX_PROGRAM(gzip)
89 AC_SUBST(ASCPP)dnl
90
91 AC_CONFIG_FILES([Makefile doc/Makefile lib/Makefile])
92 AC_OUTPUT