File: configure.in

package info (click to toggle)
4g8 1.0-3.3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 632 kB
  • sloc: sh: 3,736; ansic: 1,413; makefile: 75
file content (211 lines) | stat: -rw-r--r-- 6,089 bytes parent folder | download | duplicates (5)
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#
# author: Darren Bounds <dbounds@intrusense.com>
# copyright: Copyright (C) 2002 by Darren Bounds
# license: This software is under GPL version 2 of license
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#  official page at http://forgate.sourceforge.net
#
#

dnl Copyright (c) 2002-2003 Darren Bounds
dnl All rights reserved.

AC_INIT(src/main.c)
AM_CONFIG_HEADER(config.h)
FORGATE_VERSION=`cat VERSION`
AC_MSG_RESULT(beginning auto-configuration process for 4g8-$FORGATE_VERSION...)
AM_INIT_AUTOMAKE(4g8, $FORGATE_VERSION)
AC_SUBST(FORGATE_VERSION)
AC_PREFIX_DEFAULT(/usr/local)

AC_PROG_CC
AC_MSG_CHECKING(for gcc)
if test "$GCC" = yes; then
    CFLAGS="${CFLAGS} -Wall"
    AC_MSG_RESULT(yes)
else
    AC_MSG_RESULT(no)
fi

DEBUG="no"
BINS="4g8"

AC_ARG_ENABLE(debug, 
    [ --enable-debug          Enable debugging],
    [ if test "$GCC" = yes; then
          DEBUG="yes"
          CFLAGS="${CFLAGS} -DDEBUG -ggdb"
      else
          DEBUG="yes"
          CFLAGS="${CFLAGS} -DDEBUG"
      fi
    ],)

AC_SUBST(BINS)
AC_CANONICAL_HOST

SHELL="/bin/sh"

INCLUDES='-I$(top_srcdir) -I$(top_srcdir)/includes'

dnl Checks for OS type.
case "$host" in
    *-freebsd*)
        AC_DEFINE(BSD_DERIVED, 1, OS BSD Derived)
        AC_DEFINE(FREEBSD, 1, FreeBSD)
        ;;
    *-netbsd*)
        AC_DEFINE(BSD_DERIVED, 1, OS BSD Derived)
        AC_DEFINE(NETBSD, 1, NetBSD)
        ;;
    *-openbsd*)
        AC_DEFINE(BSD_DERIVED, 1, OS BSD Derived)
        AC_DEFINE(FREEBSD, 1, OpenBSD)
        ;;
    *-apple*)
        AC_DEFINE(BSD_DERIVED, 1, OS BSD Derived)
        AC_DEFINE(MACOS, 1, MacOS)
        LDFLAGS="${LDFLAGS} -L/sw/lib"
        INCLUDES="${INCLUDES} -I/sw/include";
        ;;
    *-linux*)
        AC_DEFINE(SYSV_DERIVED, 1, OS SysV Derived)
        AC_DEFINE(LINUX, 1, Linux)
        INCLUDES="${INCLUDES} -I/usr/include/pcap";
        ;;
    *-solaris*)
        AC_DEFINE(SYSV_DERIVED, 1, OS SysV Derived)
        AC_DEFINE(SOLARIS, 1, Solaris)
        ;;
    *-aix*)
        AC_DEFINE(SYSV_DERIVED, 1, OS SysV Derived)
        AC_DEFINE(AIX, 1, AIX)
        ;;
    *-hpux*)
        AC_DEFINE(SYSV_DERIVED, 1, OS SysV Derived)
        AC_DEFINE(HPUX, 1, HPUX) 
        ;;
esac

AC_SUBST(INCLUDES)

dnl Checks for typedef
AC_CHECK_TYPE(u_int8_t, unsigned char)
AC_CHECK_TYPE(u_int16_t, unsigned short)
AC_CHECK_TYPE(u_int32_t, unsigned int)
AC_CHECK_TYPE(u_int64_t, unsigned long long)

dnl Checks for header files.
AC_CHECK_HEADERS(signal.h net/bpf.h sys/time.h)

AC_ARG_WITH(libnet_includes,
    [  --with-libnet-includes=DIR    libnet include directory],
    [with_libnet_includes="$withval"],[with_libnet_includes=no])

if test "$with_libnet_includes" != "no"; then
    CFLAGS="${CFLAGS} -I${with_libnet_includes}"
fi

AC_CHECK_HEADERS(libnet.h,, LIBNET="no")
if test "$LIBNET" = "no"; then
    echo ""
    echo "Error: Can't find libnet 1.1.0 or greater. Visit http://www.packetfactory.net/libnet for the latest version."
    exit;
fi  

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

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

AC_CHECK_HEADERS(pcap.h,, LIBPCAP="no")
if test "$LIBNET" = "no"; then
    echo ""
    echo "Error: Can't find Libpcap. Visit http://www.tcpdump.org for the latest version."
    exit;
fi

dnl Checks for library functions.
AC_CHECK_FUNCS(printf fprintf snprintf sprintf strdup strrchr strstr strncasecmp \
    strtol strncmp strncat memset malloc gethostbyname gettimeofday getuid \
    select setitimer)

AC_ARG_WITH(libnet_libraries,
    [  --with-libnet-libraries=DIR   libnet library directory],
    [with_libnet_libraries="$withval"],[with_libnet_libraries=no])

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

AC_CHECK_LIB(net, libnet_build_ipv4,, LIBNET="no")
if test "$LIBNET" = "no"; then
    echo ""
    echo "Error: Can't find libnet 1.1.0 or greater. Visit http://www.packetfactory.net/libnet for the latest version."
    exit;
fi  

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

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

AC_CHECK_LIB(pcap, pcap_open_live,, LIBPCAP="no")
if test "$LIBPCAP" = "no"; then
    echo ""
    echo "Error: Can't find Libpcap. Visit http://www.tcpdump.org for the latest version."
    exit;
fi

AC_MSG_CHECKING(for bpf)
if test -r /dev/bpf0; then
    AC_DEFINE(HAVE_BPF, 1, BPF)
    AC_MSG_RESULT(yes)
elif test -c /dev/bpf0; then
    AC_DEFINE(HAVE_BPF, 1, BPF)
    AC_MSG_RESULT(yes)
else
    AC_MSG_RESULT(no)
fi

AC_PROG_INSTALL
AC_OUTPUT(Makefile src/Makefile src/version.h)

BINDIR=`eval echo ${bindir}`; BINDIR=`eval echo ${BINDIR}`;

echo ""
echo "4g8 has been configured with the following options:"
echo "-----------------------------------------------"
echo "Host type             : ${host}"
echo "Compiler              : ${CC}"
echo "Compiler flags        : ${CFLAGS}"
echo "Linker flags          : ${LDFLAGS}"
echo "Libraries             : ${LIBS}"
echo ""
echo "Binary                : ${BINDIR}"
echo ""
echo "Enable debugging      : ${DEBUG}"
echo "-----------------------------------------------"
echo ""

dnl EOF