| 1 | # Configure template for gzip. | 
|---|
| 2 |  | 
|---|
| 3 | # Copyright (C) 1999, 2000, 2001, 2002, 2006, 2007 Free Software | 
|---|
| 4 | # Foundation, Inc. | 
|---|
| 5 |  | 
|---|
| 6 | # Copyright (C) 1992-1993 Jean-loup Gailly | 
|---|
| 7 |  | 
|---|
| 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 2, or (at your option) | 
|---|
| 11 | # any later version. | 
|---|
| 12 |  | 
|---|
| 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. | 
|---|
| 17 |  | 
|---|
| 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 | 
|---|
| 21 | # 02111-1307, USA. | 
|---|
| 22 |  | 
|---|
| 23 | AC_PREREQ([2.60]) | 
|---|
| 24 | AC_INIT([gzip], [1.3.11], [bug-gzip@gnu.org]) | 
|---|
| 25 | AC_CONFIG_SRCDIR(gzip.c) | 
|---|
| 26 | AC_CONFIG_AUX_DIR(build-aux) | 
|---|
| 27 | AC_CONFIG_HEADERS([lib/config.h:lib/config.hin]) | 
|---|
| 28 | AM_INIT_AUTOMAKE([gnits]) | 
|---|
| 29 |  | 
|---|
| 30 | AC_PROG_CC_STDC | 
|---|
| 31 | AM_PROG_CC_C_O | 
|---|
| 32 | AC_PROG_CPP | 
|---|
| 33 | AC_CHECK_TOOL([NM], [nm], [nm]) | 
|---|
| 34 | AC_PROG_LN_S | 
|---|
| 35 | AC_PROG_RANLIB | 
|---|
| 36 | AC_PROG_SHELL | 
|---|
| 37 |  | 
|---|
| 38 | gl_EARLY | 
|---|
| 39 | AC_SYS_LARGEFILE | 
|---|
| 40 |  | 
|---|
| 41 | gl_INIT | 
|---|
| 42 |  | 
|---|
| 43 | # cc -E produces incorrect asm files on SVR4, so postprocess it. | 
|---|
| 44 | ASCPPPOST="sed '/^ *#/d; s,//.*,,; s/% /%/g; s/\\. /./g'" | 
|---|
| 45 | AC_SUBST([ASCPPPOST]) | 
|---|
| 46 |  | 
|---|
| 47 | AC_CACHE_CHECK([for underline in external names], [gzip_cv_underline], | 
|---|
| 48 | [gzip_cv_underline=yes | 
|---|
| 49 | AC_TRY_COMPILE([int foo() {return 0;}], [], | 
|---|
| 50 | [$NM conftest.$OBJEXT | grep _foo >/dev/null 2>&1 || | 
|---|
| 51 | gzip_cv_underline=no])]) | 
|---|
| 52 | ASCPPFLAGS= | 
|---|
| 53 | if test $gzip_cv_underline = no; then | 
|---|
| 54 | ASCPPFLAGS='-DNO_UNDERLINE' | 
|---|
| 55 | fi | 
|---|
| 56 | AC_SUBST([ASCPPFLAGS]) | 
|---|
| 57 | AC_OBJEXT | 
|---|
| 58 |  | 
|---|
| 59 | # Try to assemble match.S. | 
|---|
| 60 | # "gcc -E match.s" ignores -E, so we must use _match.S. | 
|---|
| 61 | AC_CACHE_CHECK([for an assembler syntax supported by this package], | 
|---|
| 62 | [gzip_cv_assembler], | 
|---|
| 63 | [gzip_cv_assembler=no | 
|---|
| 64 | case " $DEFS " in | 
|---|
| 65 | *' NO_ASM '*) ;; | 
|---|
| 66 | *) | 
|---|
| 67 | if cp $srcdir/lib/match.c _match.S && | 
|---|
| 68 | eval "$CPP $CPPFLAGS $ASCPPFLAGS _match.S > _match.i" 2>/dev/null && | 
|---|
| 69 | eval "$ASCPPPOST < _match.i > match_.s" 2>/dev/null; then | 
|---|
| 70 | if test ! -s match_.s || grep error < match_.s > /dev/null; then | 
|---|
| 71 | : | 
|---|
| 72 | elif eval "$CC $CPPFLAGS $CFLAGS -c match_.s >/dev/null 2>&1" && | 
|---|
| 73 | test -f match_.$OBJEXT; then | 
|---|
| 74 | rm -f match_.$OBJEXT | 
|---|
| 75 | gzip_cv_assembler=yes | 
|---|
| 76 | if echo 'void foo (void) {}' > conftest.c && | 
|---|
| 77 | eval "$CC $CPPFLAGS $CFLAGS -S conftest.c >/dev/null 2>&1" && | 
|---|
| 78 | grep '\.note\.GNU-stack' conftest.s >/dev/null 2>&1 && | 
|---|
| 79 | eval "$CC $CPPFLAGS $CFLAGS -c -Wa,--noexecstack match_.s >/dev/null 2>&1" && | 
|---|
| 80 | test -f match_.$OBJEXT; then | 
|---|
| 81 | gzip_cv_assembler='yes, with -Wa,--noexecstack' | 
|---|
| 82 | fi | 
|---|
| 83 | fi | 
|---|
| 84 | fi | 
|---|
| 85 | rm -f conftest* _match.i _match.S match_.s match_.$OBJEXT;; | 
|---|
| 86 | esac]) | 
|---|
| 87 | if test "$gzip_cv_assembler" != no; then | 
|---|
| 88 | AC_DEFINE(ASMV, , | 
|---|
| 89 | [Define if an assembler version of longest_match is available.]) | 
|---|
| 90 | AC_LIBOBJ(match) | 
|---|
| 91 | fi | 
|---|
| 92 | if test "$gzip_cv_assembler" = 'yes, with -Wa,--noexecstack'; then | 
|---|
| 93 | ASFLAGS_config='-Wa,--noexecstack' | 
|---|
| 94 | else | 
|---|
| 95 | ASFLAGS_config= | 
|---|
| 96 | fi | 
|---|
| 97 | AC_SUBST([ASFLAGS_config]) | 
|---|
| 98 |  | 
|---|
| 99 | AC_ISC_POSIX | 
|---|
| 100 | AC_C_CONST | 
|---|
| 101 | AC_HEADER_STDC | 
|---|
| 102 | AC_CHECK_HEADERS_ONCE(fcntl.h limits.h memory.h time.h) | 
|---|
| 103 | AC_CHECK_FUNCS_ONCE([chown fchmod fchown fdopendir lstat siginterrupt]) | 
|---|
| 104 | AC_HEADER_DIRENT | 
|---|
| 105 | AC_TYPE_SIGNAL | 
|---|
| 106 | AC_TYPE_SIZE_T | 
|---|
| 107 | AC_TYPE_OFF_T | 
|---|
| 108 |  | 
|---|
| 109 | AC_PREFIX_PROGRAM(gzip) | 
|---|
| 110 |  | 
|---|
| 111 | AC_CONFIG_FILES([Makefile doc/Makefile lib/Makefile]) | 
|---|
| 112 | AC_OUTPUT | 
|---|