summaryrefslogtreecommitdiff
path: root/configure.in
blob: 0ace88571c7d66eb81fcde0749aa624733a3b257 (plain)
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
dnl Standard configuration

AC_INIT(pcap.idl)

AC_MSG_CHECKING([for version])
VERSION="`etc/shtool version -l txt -d short VERSION`"
AC_MSG_RESULT([Configuring Version $VERSION])
AC_SUBST(VERSION)

AC_MSG_CHECKING([for platform])
ARCH="`etc/shtool platform`"
AC_MSG_RESULT([$ARCH])
AC_SUBST(ARCH)

AC_PROG_INSTALL
AC_SUBST(INSTALL)

AC_PROG_CC
AC_HEADER_STDC

dnl Ocaml 

AC_CHECK_PROG(ocamlc,ocamlc,ocamlc,no)
if test "x$ocamlc" = "xno"; then
  AC_MSG_ERROR([Cannot find ocamlc.])
fi

AC_CHECK_PROG(ocamlopt,ocamlopt,ocamlopt)
if test "x$ocamlopt" = "xno"; then
  AC_MSG_ERROR([Cannot find ocamlopt.])
fi

AC_CHECK_PROG(ocamlfind,ocamlfind,ocamlfind)
if test "x$ocamlfind" = "xno"; then
  AC_MSG_ERROR([Cannot find ocamlfind.])
fi

dnl -------
dnl Camlidl
dnl -------

AC_CHECK_PROG(camlidl,camlidl,camlidl)
if test "x$camlidl" = "xno"; then
  AC_MSG_ERROR([Cannot find camlidl.])
fi

dnl Header

AC_CHECK_HEADER(caml/camlidlruntime.h,,
                AC_MSG_ERROR([can't find camlidlruntime.h]))

dnl -------
dnl Libpcap
dnl -------

dnl Version 0.8
AC_CHECK_LIB(pcap,
             pcap_datalink_val_to_description, 
             [AC_DEFINE(HAVE_PCAP08)
              cp4flag="-DHAVE_PCAP08"
              LIBS="-lpcap $LIBS"])

if test "x$cp4flag" = "x"; then
  AC_CHECK_LIB(pcap, 
               pcap_open_live,,
               AC_MSG_ERROR([can't find pcap library].))
fi

AC_SUBST(cp4flag)

dnl Header

AC_CHECK_HEADER(pcap.h,,
                AC_MSG_ERROR(can't find pcap.h))

dnl ---------------
dnl Ffcall callback
dnl ---------------

AC_CHECK_LIB(callback,
             alloc_trampoline_r,,
             AC_MSG_ERROR([can't find callback library.]))

dnl Header
	
AC_CHECK_HEADER(callback.h)

dnl Makefile generation

AC_OUTPUT([Makefile tests/Makefile])