1 # Configure template for gzip.
3 # Copyright (C) 1999, 2000, 2001, 2002, 2006, 2007 Free Software
6 # Copyright (C) 1992-1993 Jean-loup Gailly
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3, or (at your option)
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 m4_esyscmd([build-aux/git-version-gen .tarball-version]),
28 AC_CONFIG_SRCDIR(gzip.c)
29 AC_CONFIG_AUX_DIR(build-aux)
30 AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
32 AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
37 AC_CHECK_TOOL([NM], [nm], [nm])
47 # cc -E produces incorrect asm files on SVR4, so postprocess it.
48 ASCPPPOST="sed '/^ *#/d; s,//.*,,; s/% /%/g; s/\\. /./g'"
51 AC_CACHE_CHECK([for underline in external names], [gzip_cv_underline],
52 [gzip_cv_underline=yes
53 AC_TRY_COMPILE([int foo() {return 0;}], [],
54 [$NM conftest.$OBJEXT | grep _foo >/dev/null 2>&1 ||
55 gzip_cv_underline=no])])
57 if test $gzip_cv_underline = no; then
58 ASCPPFLAGS='-DNO_UNDERLINE'
60 AC_SUBST([ASCPPFLAGS])
63 # Try to assemble match.S.
64 # "gcc -E match.s" ignores -E, so we must use _match.S.
65 AC_CACHE_CHECK([for an assembler syntax supported by this package],
71 if cp $srcdir/lib/match.c _match.S &&
72 eval "$CPP $CPPFLAGS $ASCPPFLAGS _match.S > _match.i" 2>/dev/null &&
73 eval "$ASCPPPOST < _match.i > match_.s" 2>/dev/null; then
74 if test ! -s match_.s || grep error < match_.s > /dev/null; then
76 elif eval "$CC $CPPFLAGS $CFLAGS -c match_.s >/dev/null 2>&1" &&
77 test -f match_.$OBJEXT; then
80 if echo 'void foo (void) {}' > conftest.c &&
81 eval "$CC $CPPFLAGS $CFLAGS -S conftest.c >/dev/null 2>&1" &&
82 grep '\.note\.GNU-stack' conftest.s >/dev/null 2>&1 &&
83 eval "$CC $CPPFLAGS $CFLAGS -c -Wa,--noexecstack match_.s >/dev/null 2>&1" &&
84 test -f match_.$OBJEXT; then
85 gzip_cv_assembler='yes, with -Wa,--noexecstack'
89 rm -f conftest* _match.i _match.S match_.s match_.$OBJEXT;;
91 if test "$gzip_cv_assembler" != no; then
93 [Define if an assembler version of longest_match is available.])
96 if test "$gzip_cv_assembler" = 'yes, with -Wa,--noexecstack'; then
97 ASFLAGS_config='-Wa,--noexecstack'
101 AC_SUBST([ASFLAGS_config])
106 AC_CHECK_HEADERS_ONCE(fcntl.h limits.h memory.h time.h)
107 AC_CHECK_FUNCS_ONCE([chown fchmod fchown fdopendir lstat siginterrupt])
113 AC_PREFIX_PROGRAM(gzip)
115 AC_CONFIG_FILES([Makefile doc/Makefile lib/Makefile])