chiark / gitweb /
Setting the maximum interface count now does the right thing.
[unet] / configure.in
... / ...
CommitLineData
1dnl -*-fundamental-*-
2dnl
3dnl $Id: configure.in,v 1.2 2001/02/03 18:39:37 mdw Exp $
4dnl
5dnl Configuration script for usernet
6dnl
7dnl (c) 1998 Mark Wooding
8dnl
9
10dnl----- Licensing notice ---------------------------------------------------
11dnl
12dnl This program is free software; you can redistribute it and/or modify
13dnl it under the terms of the GNU General Public License as published by
14dnl the Free Software Foundation; either version 2 of the License, or
15dnl (at your option) any later version.
16dnl
17dnl This program is distributed in the hope that it will be useful,
18dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
19dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20dnl GNU General Public License for more details.
21dnl
22dnl You should have received a copy of the GNU General Public License
23dnl along with this program; if not, write to the Free Software Foundation,
24dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26dnl --- Boring header things ---
27
28AC_INIT(unet.c)
29AM_INIT_AUTOMAKE(usernet, 1.1)
30AM_CONFIG_HEADER(unetconf.h)
31AC_PROG_CC
32AC_CANONICAL_HOST
33
34dnl --- Make sure we recognise the environment ---
35
36case $host in
37 *-linux*) ;;
38 *)
39 AC_MSG_ERROR([It would help a lot if you compiled under Linux.])
40 ;;
41esac
42
43kernelversion=`uname -r`
44
45dnl --- Find the Linux kernel sources ---
46
47AC_ARG_WITH([linux-source],
48[ --with-linux-source=DIR directory containing Linux kernel source],
49[linuxdir="$withval"],
50[AC_CACHE_CHECK([where the Linux kernel source is],
51[mdw_cv_linux_source],
52[for i in /usr/src/linux /usr/src/linux-$kernelversion; do
53 if test -f $i/kernel/ksyms.c; then
54 mdw_cv_linux_source=$i
55 break
56 fi
57done
58if test -z "$mdw_cv_linux_source"; then
59 AC_MSG_ERROR([Failed to find the Linux source. Where is it?])
60fi])
61linuxdir="$mdw_cv_linux_source"])
62AC_SUBST(linuxdir)
63
64dnl --- Find Perl ---
65
66mdw_PROG_PERL(5.003)
67mdw_CHECK_PERL(5.003)
68
69dnl --- Play with GCC command line arguments ---
70
71mdw_GCC_FLAGS([-Wall -fomit-frame-pointer -fno-strength-reduce])
72
73NCFLAGS=""
74for i in $CFLAGS; do
75 case $i in
76 -g) ;;
77 *) NCFLAGS="$NCFLAGS $i"
78 esac
79done
80CFLAGS="$NCFLAGS"
81
82dnl --- Decide where to put the module ---
83
84AC_ARG_WITH([module-dir],
85[ --with-module-dir=DIR directory to install the module in],
86[moduledir="$withval"],
87[AC_CACHE_CHECK([for a good place to store kernel modules],
88[mdw_cv_module_dir],
89[for i in /lib/modules/misc /lib/modules/$kernelversion/misc; do
90 if test -d $i; then
91 mdw_cv_module_dir=$i
92 break
93 fi
94done])
95if test -z "$mdw_cv_module_dir"; then
96 mdw_cv_module_dir="/lib/modules/$kernelversion/misc"
97fi
98moduledir=$mdw_cv_module_dir])
99AC_SUBST(moduledir)
100
101dnl --- Tweakable parameters ---
102
103AC_ARG_WITH([major-device],
104[ --with-major-device=NUM set major device number for Usernet],
105[MAJORDEV="$WITHVAL"],
106[MAJORDEV=63])
107AC_SUBST(MAJORDEV)
108AC_DEFINE_UNQUOTED(UNET_MAJOR, $MAJORDEV)
109
110AC_ARG_WITH([persistent-devices],
111[ --with-persistent-devices=NUM
112 create NUM persistent devices],
113[NPERSIST="$withval"],
114[NPERSIST=1])
115AC_SUBST(NPERSIST)
116AC_DEFINE_UNQUOTED(UNET_NPERSIST, $NPERSIST)
117
118AC_ARG_WITH([transient-minor],
119[ --with-transient-minor=NUM
120 set minor device number of /dev/unet],
121[TRANSMINOR="$withval"],
122[TRANSMINOR=255])
123AC_SUBST(TRANSMINOR)
124AC_DEFINE_UNQUOTED(UNET_TRANSMINOR, $TRANSMINOR)
125
126AC_ARG_WITH([max-queue-length],
127[ --with-max-queue-length=NUM
128 queue at most NUM packets],
129[QMAXLEN="$withval"],
130[QMAXLEN=128])
131AC_SUBST(QMAXLEN)
132AC_DEFINE_UNQUOTED(UNET_QMAXLEN, $QMAXLEN)
133
134AC_ARG_WITH([max-interfaces],
135[ --with-max-interfaces=NUM
136 maximum number of interfaces allowed],
137[MAXIF="$withval"],
138[MAXIF=64])
139AC_SUBST(MAXIF)
140AC_DEFINE_UNQUOTED(UNET_MAXIF, $MAXIF)
141
142AC_ARG_WITH([debugging],
143[ --with-debugging=OPT enable debugging output from the module
144 (options are "yes", "no" and "runtime")],
145[case "$withval" in
146 yes) AC_DEFINE(UNET_DEBUG, 1) ;;
147 no) AC_DEFINE(UNET_DEBUG, -1) ;;
148 runtime) AC_DEFINE(UNET_DEBUG, 0) ;;
149 *) AC_MSG_ERROR([bad argument to --with-debugging]) ;;
150esac],
151[AC_DEFINE(UNET_DEBUG, 0)])
152
153dnl --- Should be enough for today ---
154
155AC_OUTPUT(Makefile makedev.unet)