File: configure.ac

package info (click to toggle)
sniffit 0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 424 kB
  • sloc: ansic: 4,196; sh: 21; makefile: 11
file content (67 lines) | stat: -rw-r--r-- 2,035 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
# configure.ac for sniffit
# Copyright 1997-1998 Brecht Claerhout
# Copyright 2016-2020 Joao Eriberto Mota Filho <eriberto@eriberto.pro.br.
# Copyright 2024      Denis Ovsienko <denis@ovsienko.info>
# Under BSD-3-CLause license.

AC_PREREQ([2.69])
AC_INIT([sniffit], [0.7], [https://github.com/resurrecting-open-source-projects/sniffit/issues])
AC_CONFIG_SRCDIR([src/sn_generation.h])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC

# Checks for libraries.
# FIXME: sniffit links with libncurses when it is available, even if it does
# not use it because src/sn_config.h does not define INCLUDE_INTERFACE because
# other conditions are not met.  It would be better to move that logic entirely
# to Autoconf and to define (or not) INCLUDE_INTERFACE only here.
AC_CHECK_LIB(ncurses, initscr)
AC_CHECK_LIB(pcap, pcap_open_live, , [AC_MSG_ERROR([Couldn't find libpcap])])

# Checks for header files.
AC_CHECK_HEADERS([ncurses.h])
AC_CHECK_HEADERS([pcap.h], , AC_MSG_ERROR([pcap.h not found]))

dnl Check Shared Memory support
AC_CHECK_FUNCS(shmget)

dnl exit function check
AC_CHECK_FUNCS(atexit)

# Other checks
# On Haiku sendto(), socket(), setservent() and inet_addr() are in libnetwork.
AC_CHECK_FUNC(setservent, ,
	[
		AC_CHECK_LIB(network,
			setservent,
			[LIBS="-lnetwork $LIBS"],
			[AC_MSG_ERROR([setservent() is required, but wasn't found])]
		)
	]
)

dnl Check the datalength
AC_CHECK_SIZEOF(unsigned short int)
if test $ac_cv_sizeof_unsigned_short_int -ne 2; then
    AC_MSG_ERROR([unsigned short is NOT 2 bytes... quiting])
fi

AC_CHECK_SIZEOF(unsigned long int)
if test $ac_cv_sizeof_unsigned_long_int -eq 4; then
AC_DEFINE(USE_32_LONG_INT, 1, [none])
else
    echo "unsigned long is NOT 4 bytes... hmmm..."
    AC_CHECK_SIZEOF(unsigned int)
    if test $ac_cv_sizeof_unsigned_int -ne 4; then
        AC_MSG_ERROR([unsigned int is NOT 4 bytes either... quiting])
    else
        AC_DEFINE(USE_32_INT, 1, [none])
    fi
fi

AC_CONFIG_FILES([Makefile src/Makefile])
AM_INIT_AUTOMAKE([foreign])

AC_OUTPUT