File: configure.in

package info (click to toggle)
libhsync 0.5.7-1.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,060 kB
  • ctags: 543
  • sloc: sh: 7,944; ansic: 5,413; makefile: 154
file content (126 lines) | stat: -rw-r--r-- 3,958 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# -*- shell-script -*-
dnl Process this file with autoconf to produce a configure script. 

AC_REVISION($Id: configure.in,v 1.42 2000/08/27 07:58:50 mbp Exp $)
AC_INIT(dec.c)
my_version=0.5.7
my_package=libhsync
my_url=http://linuxcare.com.au/rproxy/
echo "Configuring $my_package $my_version   ($my_url)"
AM_INIT_AUTOMAKE($my_package, $my_version)
AM_CONFIG_HEADER(config.h)

dnl Set up to get as many features as we can manage
dnl trying to do large file support is not so simple
dnl we will turn it off for the moment
dnl AC_DEFINE(_FILE_OFFSET_BITS, 64)
AC_DEFINE(_GNU_SOURCE)

AC_CANONICAL_HOST

dnl Checks for programs.
AC_PROG_CC
AC_ISC_POSIX
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_RANLIB

# See if the compiler has the nice GNU feature of 
# putting argv[0] into a global
AC_MSG_CHECKING([for program_invocation_short_name])
AC_TRY_COMPILE([#include <errno.h>], 
    [strlen(program_invocation_short_name)],
    [ AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME)
      AC_MSG_RESULT(yes) ],
    [ AC_MSG_RESULT(no) ])

dnl # We don't use Python at the moment
dnl AC_CHECK_PROG(PYTHON, python, python)

dnl Checks for libraries.
dnl AC_CHECK_LIB(z, deflate)

# On us4 SGI IRIX64, the linker reports
# ld32: WARNING 84 : /usr/lib32/libnsl.so is not used for resolving any symbol.

# HEY!  Do we need SGI cc to do 64-bit mode?  Does gcc only do 32bit?

# FIXME: Ideally, we would use this library only for programs that
# actually need networking.  This test will stick it in LIBS, which is
# I suppose harmless
AC_SEARCH_LIBS(connect, [nsl socket inet])

# supply a snprintf if the system doesn't have one
AC_REPLACE_FUNCS(snprintf)
AC_CHECK_FUNCS(vsnprintf)

dnl Check for declarations
AC_MSG_CHECKING(for sockaddr.sin_len)
AC_EGREP_HEADER(sin_len, sys/socket.h, 
	[ AC_DEFINE(HAVE_SOCK_SIN_LEN)
          AC_MSG_RESULT(yes) ],
        [ AC_MSG_RESULT(no) ])

dnl Check configuration options
if test "$GCC" = "yes" 
then 
    # I'm fussy.
    CFLAGS="-Wall -W -Wshadow -Wundef -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align $CFLAGS"
fi
# TODO: Similar conditions for other known compilers.  For SUNWspro, use `-v'.

AC_ARG_ENABLE(ccmalloc,
	[  --enable-ccmalloc       use ccmalloc debugger (default no)],
	[ LIBS="$LIBS -lccmalloc -ldl" ])

AC_ARG_ENABLE(trace,
        [  --disable-trace         turn off library tracing])
AC_MSG_CHECKING("whether to include trace code")
if test "$enable_trace" = "yes" -o -z "$enable_trace"
then
    AC_MSG_RESULT(yes)
    AC_DEFINE(DO_HS_TRACE)
elif test "$enable_trace" = "no"
then
    AC_MSG_RESULT(no)
else
    AC_MSG_RESULT(failed)
    AC_MSG_ERROR("--enable-trace must be set to yes or no")
fi

# TODO: Check for stdint.h.  If it's missing, try to find definitions
# of critical integer types through other means.  On Linux, we might
# find it in the kernel headers.  In general, perhaps we have to test
# the sizes of various things and find something suitable.  That said,
# this code probably overuses specific-sizes integers, and we might be
# better off just using generics that are large enough.
AC_CHECK_HEADERS(stdint.h)
AC_CHECK_SIZEOF([unsigned char], 1)
if test "$ac_cv_sizeof_unsigned_char" -ne 1
then
    AC_MSG_WARN(unsigned char seems to be $ac_cv_sizeof_unsigned_char bytes.  Expect trouble.)
fi

AC_CHECK_SIZEOF(off_t, 4)

dnl Checks for header files.
AC_CHECK_HEADERS(sys/endian.h)
AC_HEADER_STDC

# GNU library versioning: This is NOT the libhsync release number.
# Rather, it is a CURRENT:REVISION:AGE tuple describing binary
# compatibility to libtool.  It is only updated on major public
# releases where there is the possibility of binaries hanging around.

libhsync_libversion=0:57:0
AC_DEFINE_UNQUOTED(HS_LIBVERSION, "$libhsync_libversion")

AC_SUBST(libhsync_libversion)
AC_SUBST(OBJ_SAVE)
AC_SUBST(OBJ_RESTORE)
AC_SUBST(CC_SHOBJ_FLAG)
AC_SUBST(CCMALLOC_LIB)
AC_SUBST(net_libs)
AC_SUBST(LIBOBJS)

AC_OUTPUT([./Makefile])