File: configure.in

package info (click to toggle)
daemonlogger 1.2.1-7
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 676 kB
  • sloc: ansic: 3,516; sh: 3,036; makefile: 18
file content (184 lines) | stat: -rw-r--r-- 4,222 bytes parent folder | download | duplicates (3)
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# $Id: configure.in,v 1.11 2008/11/24 19:56:48 roesch Exp $

AC_INIT(daemonlogger.c)

AM_INIT_AUTOMAKE(daemonlogger, 1.2.1)
AM_CONFIG_HEADER(config.h)

AM_MAINTAINER_MODE

AC_CANONICAL_HOST

linux=no
sunos4=no

case "$host" in
  *-openbsd2.6|*-openbsd2.5|*-openbsd2.4|*-openbsd2.3*)
    AC_DEFINE(OPENBSD,,[Define if OPENBSD])
    AC_DEFINE(BROKEN_SIOCGIFMTU,,[Define if BROKEN_SIOCGIFMTU])

    ;;
  *-openbsd*)
    AC_DEFINE(OPENBSD)

    ;;
  *-sgi-irix5*)
    AC_DEFINE(IRIX,,[Define if IRIX])
    if test -z "$GCC"; then
      sgi_cc=yes
    fi
    LDFLAGS=${LDFLAGS} -L/usr/local/lib
    extra_incl=-I/usr/local/include
    ;;
  *-sgi-irix6*)
    AC_DEFINE(IRIX)
    if test -z "$GCC"; then
      sgi_cc=yes
    fi
    LDFLAGS=${LDFLAGS} -L/usr/local/lib
    extra_incl=-I/usr/local/include
    ;;
  *-solaris*)
    AC_DEFINE(SOLARIS,,[Define if SOLARIS])
    CPPFLAGS="${CPPFLAGS} -DBSD_COMP -D_REENTRANT"
    ;;
  *-sunos*)
    AC_DEFINE(SUNOS,,[Define if SUNOS])
    sunos4=yes
    ;;
  *-linux*)
    linux=yes
    AC_DEFINE(LINUX,,[Define if LINUX])
    if test -d "/usr/local/lib"; then
        LDFLAGS=${LDFLAGS} -L/usr/local/lib
    fi
    if test -d "/usr/include/pcap"; then
        AC_SUBST(extra_incl)
        extra_incl=-I/usr/include/pcap
    fi
    ;;
  *-hpux10*)
    AC_DEFINE(HPUX,,[Define if HPUX])
    AC_SUBST(extra_incl)
    extra_incl=-I/usr/local/include
    ;;

  *-freebsd*)
    AC_DEFINE(FREEBSD,,[Define if FREEBSD])

    ;;
  *-bsdi*)
    AC_DEFINE(BSDI,,[Define if BSDI])
    ;;
  *-aix*)
    AC_DEFINE(AIX,,[Define if AIX])
     broken_types=yes
    ;;
  *-osf4*)
    AC_DEFINE(OSF1,,[Define if OSF1])
    tru64_types=yes
    ;;
  *-osf5.1*)
    AC_DEFINE(OSF1)
    ;;
  *-tru64*)
    AC_DEFINE(OSF1)
    tru64_types=yes
    ;;
  *-apple*)
    AC_DEFINE(MACOS,,[Define if MACOS])
    AC_DEFINE(BROKEN_SIOCGIFMTU)
    if test -d "/sw"; then
      LDFLAGS="${LDFLAGS} -L/sw/lib"
      extra_incl="-I/sw/include"
    fi
    if test -d "/opt/local"; then
      LDFLAGS="${LDFLAGS} -L/opt/local/lib"
      extra_incl="-I/opt/local/include"
    fi
esac

if test "$prefix" = "NONE"; then
    prefix="/usr/local"
fi

AC_PROG_CC
AC_PROG_INSTALL

AC_CHECK_HEADERS(stdio.h stdlib.h stdarg.h errno.h getopt.h unistd.h \
                 fcntl.h string.h signal.h time.h limits.h)
AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/time.h sys/queue.h)
if test "x$ac_cv_header_sys_queue_h" = "xyes"; then
    AC_MSG_CHECKING(for TAILQ_FOREACH in sys/queue.h)
    AC_EGREP_CPP(yes,
[
#include <sys/queue.h>
#ifdef TAILQ_FOREACH
 yes
#endif
],  [AC_MSG_RESULT(yes)
     AC_DEFINE(HAVE_TAILQFOREACH, 1,
         [Define if TAILQ_FOREACH is defined in <sys/queue.h>])],
    AC_MSG_RESULT(no)
    )
fi

AC_CHECK_HEADERS(arpa/inet.h)

AC_C_CONST
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_PROG_GCC_TRADITIONAL
if test "$GCC" = yes ; then
    CFLAGS="$CFLAGS -g -O0 -Wall"
fi

LDFLAGS="${LDFLAGS} `dumbnet-config --libs`"
CFLAGS="${CFLAGS} `dumbnet-config --cflags`"
LDNET=""
AC_CHECK_LIB(dumbnet, intf_open,, LDNET="no")
echo "LDFLAGS set to $LDFLAGS"
echo "CFLAGS set to $CFLAGS"

if test "$LDNET" = "no"; then
   echo
   echo "   ERROR!  Libdumbnet library/headers not found, go get it from"
   echo "   http://libdnet.sourceforge.net"
   echo "   (in Debian systems, install the libdumbnet-dev package)"
   exit
fi

AC_CHECK_HEADERS(sys/queue.h)

AC_ARG_WITH(libpcap_includes,
	[  --with-libpcap-includes=DIR  libpcap include directory],
	[with_libpcap_includes="$withval"],[with_libpcap_includes=no])

AC_ARG_WITH(libpcap_libraries,
	[  --with-libpcap-libraries=DIR  libpcap library directory],
	[with_libpcap_libraries="$withval"],[with_libpcap_libraries=no])


if test "$with_libpcap_includes" != "no"; then
   CPPFLAGS="${CPPFLAGS} -I${with_libpcap_includes}"
fi

if test "$with_libpcap_libraries" != "no"; then
   LDFLAGS="${LDFLAGS}  -L${with_libpcap_libraries}"
fi

LPCAP=""
AC_CHECK_LIB(pcap, pcap_datalink,, LPCAP="no")

if test "$LPCAP" = "no"; then
  echo
  echo "   ERROR!  Libpcap library/headers not found, go get it from"
  echo "   http://www.tcpdump.org"
  echo "   or use the --with-libpcap-* options, if you have it installed"
  echo "   in unusual place"
  exit 1
fi

AC_OUTPUT(Makefile)