165db1a8 |
1 | dnl -*-autoconf-*- |
410c8acf |
2 | dnl |
165db1a8 |
3 | dnl $Id: configure.in,v 1.13 2003/10/15 09:30:18 mdw Exp $ |
410c8acf |
4 | dnl |
5 | dnl Configuration script for TrIPE |
6 | dnl |
7 | dnl (c) 2001 Straylight/Edgeware |
8 | dnl |
9 | |
10 | dnl ----- Licensing notice -------------------------------------------------- |
11 | dnl |
12 | dnl This file is part of Trivial IP Encryption (TrIPE). |
13 | dnl |
14 | dnl TrIPE is free software; you can redistribute it and/or modify |
15 | dnl it under the terms of the GNU General Public License as published by |
16 | dnl the Free Software Foundation; either version 2 of the License, or |
17 | dnl (at your option) any later version. |
18 | dnl |
19 | dnl TrIPE is distributed in the hope that it will be useful, |
20 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
21 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22 | dnl GNU General Public License for more details. |
23 | dnl |
24 | dnl You should have received a copy of the GNU General Public License |
25 | dnl along with TrIPE; if not, write to the Free Software Foundation, |
26 | dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
27 | |
28 | dnl ----- Revision history -------------------------------------------------- |
29 | dnl |
30 | dnl $Log: configure.in,v $ |
165db1a8 |
31 | dnl Revision 1.13 2003/10/15 09:30:18 mdw |
32 | dnl Add support for Ethereal protocol analysis. |
33 | dnl |
acde3175 |
34 | dnl Revision 1.12 2003/07/13 11:54:40 mdw |
35 | dnl Version bump. |
36 | dnl |
0fa31a96 |
37 | dnl Revision 1.11 2003/05/17 11:04:38 mdw |
38 | dnl Ship new configuration and startup kit. |
39 | dnl |
7dd8b2bb |
40 | dnl Revision 1.9 2003/04/06 10:33:31 mdw |
41 | dnl And again. (Sigh.) |
42 | dnl |
3e1bf5a8 |
43 | dnl Revision 1.8 2003/04/06 10:31:13 mdw |
44 | dnl Fix stupid bug. |
45 | dnl |
37075862 |
46 | dnl Revision 1.7 2003/04/06 10:25:17 mdw |
47 | dnl Support Linux TUN/TAP device. Fix some bugs. |
48 | dnl |
21c78c92 |
49 | dnl Revision 1.6 2001/06/19 22:13:57 mdw |
50 | dnl Version bump. |
51 | dnl |
1f531e36 |
52 | dnl Revision 1.5 2001/03/03 12:30:39 mdw |
53 | dnl Make this a pre-release. |
54 | dnl |
9bb1a373 |
55 | dnl Revision 1.4 2001/02/22 09:07:28 mdw |
56 | dnl Build documents now. |
57 | dnl |
aa7f0bd9 |
58 | dnl Revision 1.3 2001/02/16 21:24:12 mdw |
59 | dnl Don't link the client against Catacomb. |
60 | dnl |
73189848 |
61 | dnl Revision 1.2 2001/02/04 01:17:54 mdw |
62 | dnl Create a configuration header file to tidy up command lines. |
63 | dnl |
410c8acf |
64 | dnl Revision 1.1 2001/02/03 20:26:37 mdw |
65 | dnl Initial checkin. |
66 | dnl |
67 | |
68 | AC_INIT(tripe.c) |
acde3175 |
69 | AM_INIT_AUTOMAKE(tripe, 1.0.0pre5) |
73189848 |
70 | AM_CONFIG_HEADER(config.h) |
410c8acf |
71 | AC_CANONICAL_HOST |
72 | |
165db1a8 |
73 | AC_PROG_MAKE_SET |
410c8acf |
74 | AC_PROG_CC |
165db1a8 |
75 | AM_PROG_LIBTOOL |
37075862 |
76 | mdw_GCC_FLAGS([-Wall]) |
73189848 |
77 | mdw_OPT_TRACE |
410c8acf |
78 | |
37075862 |
79 | AC_ARG_WITH([linux-includes], |
80 | [ --with-linux-includes=DIR |
81 | search for Linux kernel includes in DIR], |
82 | [CFLAGS="$CFLAGS -I$withval"], |
83 | [:]) |
84 | |
165db1a8 |
85 | DIRS="" |
86 | AC_ARG_WITH([ethereal], |
87 | [ --with-ethereal build and install Ethereal plugin], |
88 | [case "$withval" in |
89 | no) ethereal=false;; |
90 | yes) ethereal='${prefix}/lib/ethereal/plugins';; |
91 | *) ethereal=$withval;; |
92 | esac], |
93 | [ethereal=false]) |
94 | |
410c8acf |
95 | case $host_os in |
96 | linux*) |
37075862 |
97 | case `uname -r` in |
7dd8b2bb |
98 | changequote(,)dnl |
3e1bf5a8 |
99 | 2.[4-9].* | 2.[1-9][0-9]*.* | [3-9].* | [1-9][0-9]*.*) |
7dd8b2bb |
100 | changequote([,])dnl |
37075862 |
101 | tun=linux |
102 | AC_DEFINE([TUN_TYPE], [TUN_LINUX]) |
103 | ;; |
104 | *) |
105 | tun=unet |
106 | AC_DEFINE([TUN_TYPE], [TUN_UNET]) |
107 | ;; |
108 | esac |
410c8acf |
109 | ;; |
110 | *bsd*) |
111 | tun=bsd |
112 | AC_DEFINE([TUN_TYPE], [TUN_BSD]) |
113 | ;; |
114 | *) |
115 | AC_MSG_ERROR([Unsupported OS: no tunnel interface available]) |
116 | ;; |
117 | esac |
118 | AC_SUBST(tun) |
119 | |
cc1668bb |
120 | mdw_MLIB(2.0.0) |
165db1a8 |
121 | mdw_CATACOMB(2.0.1, [CFLAGS="$CFLAGS $CATACOMB_CFLAGS"]) |
122 | |
123 | if test "$ethereal" != false; then |
124 | AM_PATH_GLIB([1.2.0], [], AC_MSG_ERROR([failed to find GLib]), [gmodule]) |
125 | bad=true |
126 | mdw_CFLAGS=$CFLAGS |
127 | AC_CACHE_CHECK([how to find the Ethereal headers], |
128 | [mdw_cv_ethereal_includes], [ |
129 | for i in "" "-I/usr/include/ethereal"; do |
130 | CFLAGS="$GLIB_CFLAGS $i" |
131 | AC_TRY_COMPILE([ |
132 | #include <netinet/in.h> |
133 | #include <glib.h> |
134 | #include <epan/packet.h> |
135 | ], [ |
136 | dissector_handle_t dh; |
137 | dh = creat_dissector_handle(0, 0); |
138 | ], [bad=false; break]) |
139 | done |
140 | if $bad; then |
141 | AC_MSG_ERROR([failed to find Ethereal headers]) |
142 | fi |
143 | mdw_cv_ethereal_includes=$i |
144 | CFLAGS=$mdw_CFLAGS |
145 | ]) |
146 | AC_CACHE_CHECK([whether the Ethereal headers are broken], |
147 | [mdw_cv_ethereal_buggered], [ |
148 | CFLAGS="$GLIB_CFLAGS $i" |
149 | AC_TRY_COMPILE([ |
150 | #include <netinet/in.h> |
151 | #include <glib.h> |
152 | #include <epan/packet.h> |
153 | #include <plugins/plugin_api.h> |
154 | ], [ |
155 | G_MODULE_EXPORT void plugin_init(plugin_address_table_t *pat) |
156 | { |
157 | plugin_address_table_init(pat); |
158 | } |
159 | ], [mdw_cv_ethereal_buggered=no], [mdw_cv_ethereal_buggered=yes]) |
160 | CFLAGS=$mdw_CFLAGS |
161 | ]) |
162 | if test $mdw_cv_ethereal_buggered = yes; then |
163 | AC_DEFINE(ETHEREAL_BUGGERED) |
164 | fi |
165 | |
166 | ETHEREAL_CFLAGS="$CFLAGS $GLIB_CFLAGS $mdw_cv_ethereal_includes" |
167 | ETHEREAL_PLUGIN_DIR=$ethereal |
168 | AC_SUBST(ETHEREAL_CFLAGS) |
169 | AC_SUBST(ETHEREAL_PLUGIN_DIR) |
170 | DIRS="$DIRS ethereal" |
171 | fi |
410c8acf |
172 | |
165db1a8 |
173 | AC_SUBST(DIRS) |
174 | AC_OUTPUT(Makefile doc/Makefile ethereal/Makefile tripe-init) |
410c8acf |
175 | |
176 | dnl ----- That's all, folks ------------------------------------------------- |