]> git.cworth.org Git - gzip/blob - configure.ac
Imported Debian patch 1.3.9-1
[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.9], [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_CHECK_TOOL([NM], [nm], [nm])
32 AC_PROG_LN_S
33 AC_PROG_RANLIB
34 AC_PROG_SHELL
35
36 gl_EARLY
37 AC_SYS_LARGEFILE
38
39 gl_INIT
40
41 # cc -E produces incorrect asm files on SVR4, so postprocess it.
42 ASCPPPOST="sed '/^ *#/d; s,//.*,,; s/% /%/g; s/\\. /./g'"
43 AC_SUBST([ASCPPPOST])
44
45 AC_CACHE_CHECK([for underline in external names], [gzip_cv_underline],
46   [gzip_cv_underline=yes
47    AC_TRY_COMPILE([int foo() {return 0;}], [],
48      [$NM conftest.$OBJEXT | grep _foo >/dev/null 2>&1 ||
49         gzip_cv_underline=no])])
50 ASCPPFLAGS=
51 if test $gzip_cv_underline = no; then
52   ASCPPFLAGS='-DNO_UNDERLINE'
53 fi
54 AC_SUBST([ASCPPFLAGS])
55 AC_OBJEXT
56
57 # Try to assemble match.S.
58 # "gcc -E match.s" ignores -E, so we must use _match.S.
59 AC_CACHE_CHECK([for an assembler syntax supported by this package],
60   [gzip_cv_assembler],
61   [gzip_cv_assembler=no
62    case " $DEFS " in
63    *' NO_ASM '*) ;;
64    *)
65      if cp $srcdir/lib/match.c _match.S &&
66         eval "$CPP $CPPFLAGS $ASCPPFLAGS _match.S > _match.i" 2>/dev/null &&
67         eval "$ASCPPPOST < _match.i > match_.s" 2>/dev/null; then
68        if test ! -s match_.s || grep error < match_.s > /dev/null; then
69          :
70        elif eval "$CC $CPPFLAGS $CFLAGS -c match_.s >/dev/null 2>&1" &&
71             test -f match_.$OBJEXT; then
72          rm -f match_.$OBJEXT
73          gzip_cv_assembler=yes
74          if echo 'void foo (void) {}' > conftest.c &&
75             eval "$CC $CPPFLAGS $CFLAGS -S conftest.c >/dev/null 2>&1" &&
76             grep '\.note\.GNU-stack' conftest.s >/dev/null 2>&1 &&
77             eval "$CC $CPPFLAGS $CFLAGS -c -Wa,--noexecstack match_.s >/dev/null 2>&1" &&
78             test -f match_.$OBJEXT; then
79            gzip_cv_assembler='yes, with -Wa,--noexecstack'
80          fi
81        fi
82      fi
83      rm -f conftest* _match.i _match.S match_.s match_.$OBJEXT;;
84    esac])
85 if test "$gzip_cv_assembler" != no; then
86   AC_DEFINE(ASMV, ,
87     [Define if an assembler version of longest_match is available.])
88   AC_LIBOBJ(match)
89 fi
90 if test "$gzip_cv_assembler" = 'yes, with -Wa,--noexecstack'; then
91   ASFLAGS_config='-Wa,--noexecstack'
92 else
93   ASFLAGS_config=
94 fi
95 AC_SUBST([ASFLAGS_config])
96
97 AC_ISC_POSIX
98 AC_C_CONST
99 AC_HEADER_STDC
100 AC_CHECK_HEADERS_ONCE(fcntl.h limits.h memory.h time.h)
101 AC_CHECK_FUNCS_ONCE([chown fchmod fchown fdopendir lstat siginterrupt])
102 AC_HEADER_DIRENT
103 AC_TYPE_SIGNAL
104 AC_TYPE_SIZE_T
105 AC_TYPE_OFF_T
106
107 AC_PREFIX_PROGRAM(gzip)
108
109 AC_CONFIG_FILES([Makefile doc/Makefile lib/Makefile])
110 AC_OUTPUT