gzip 1.2.4
[debian/gzip] / configure.in
1 dnl Process this file with autoconf to produce a configure script for gzip
2 dnl
3 dnl Same as AC_RETSIGTYPE, but use a void default.
4 dnl
5 define(AC_RETSIGTYP,
6 [AC_COMPILE_CHECK([return type of signal handlers],
7 [#include <sys/types.h>
8 #include <signal.h>
9 #ifdef signal
10 #undef signal
11 #endif
12 extern void (*signal ()) ();],
13 [int i;],
14 [],
15 [AC_DEFINE(RETSIGTYPE, int)],
16 )]
17 )dnl
18 dnl
19 dnl End of local macros
20 dnl
21 AC_INIT(gzip.c)
22 AC_PROG_CC
23 AC_PROG_CPP
24 dnl
25 dnl Try to assemble match.S with and without leading underline.
26 dnl cc -E produces incorrect asm files on SVR4, we must use /lib/cpp.
27 dnl Also, "gcc -E match.s" ignores -E, so we must use match.S.
28 echo checking for underline in external names
29 test -z "$ASCPP" -a -f /lib/cpp && ASCPP=/lib/cpp
30 test -z "$ASCPP" && ASCPP="$CC -E"
31 cat > conftest.c <<EOF
32 int foo() {return 0;}
33 EOF
34 eval "$CC -c conftest.c > /dev/null 2>&1"
35 if nm conftest.o | grep _foo > /dev/null 2>&1 ; then
36   :
37 else
38   ASCPP="${ASCPP} -DNO_UNDERLINE"
39 fi
40 rm -f _match.o conftest.c conftest.o
41 if echo "$DEFS" | grep NO_ASM >/dev/null; then
42   :
43 else
44   echo checking for assembler
45   OBJA=""
46   if eval "$ASCPP $srcdir/match.S > _match.s 2>/dev/null"; then
47     if test ! -s _match.s || grep error < _match.s > /dev/null; then
48       :
49     elif eval "$CC -c _match.s >/dev/null 2>&1" && test -f _match.o; then
50       DEFS="${DEFS} -DASMV"
51       OBJA=match.o
52     fi
53   fi
54   rm -f _match.s _match.o
55 fi
56 dnl
57 AC_PROG_INSTALL
58 AC_AIX
59 AC_MINIX
60 AC_ISC_POSIX
61 AC_DYNIX_SEQ
62 AC_STDC_HEADERS
63 dnl if STDC_HEADERS can't be defined, look for special files:
64 AC_HEADER_CHECK(string.h, ,AC_DEFINE(NO_STRING_H))
65 AC_HEADER_CHECK(stdlib.h, ,AC_DEFINE(NO_STDLIB_H))
66 AC_HEADER_CHECK(memory.h, ,AC_DEFINE(NO_MEMORY_H))
67 AC_HEADER_CHECK(fcntl.h,  ,AC_DEFINE(NO_FCNTL_H))
68 AC_HEADER_CHECK(time.h,   ,AC_DEFINE(NO_TIME_H))
69 AC_HAVE_HEADERS(unistd.h)
70 utime=0
71 AC_HEADER_CHECK(utime.h, utime=1 ,AC_DEFINE(NO_UTIME_H))
72 if test $utime -eq 0; then
73   AC_HAVE_HEADERS(sys/utime.h)
74 fi
75 AC_DIR_HEADER
76 AC_XENIX_DIR
77 AC_RETSIGTYP
78 AC_SIZE_T
79 AC_HEADER_EGREP(off_t, sys/types.h, ,AC_DEFINE(NO_OFF_T))
80 AC_HAVE_POUNDBANG([SEDCMD="1d"], [SEDCMD=""])
81 AC_PREFIX(gzip)
82 if test -z "$G" -a -n "$prefix" -a -f $prefix/bin/gznew; then
83   G=g
84 fi
85 if test -z "$ZCAT"; then
86   if test -n "$prefix" -a -f $prefix/bin/gzcat; then
87     ZCAT=gzcat
88   else
89     ZCAT=${G}zcat
90   fi
91 fi
92 AC_SUBST(ZCAT)dnl
93 AC_SUBST(G)dnl
94 AC_SUBST(CFLAGS)dnl
95 AC_SUBST(ASCPP)dnl
96 AC_SUBST(OBJA)dnl
97 AC_SUBST(SEDCMD)dnl
98 AC_OUTPUT(Makefile)