3 dnl $Id: configure.in,v 1.2 2001/02/03 18:39:37 mdw Exp $
5 dnl Configuration script for usernet
7 dnl (c) 1998 Mark Wooding
10 dnl----- Licensing notice ---------------------------------------------------
12 dnl This program is free software; you can redistribute it and/or modify
13 dnl it under the terms of the GNU General Public License as published by
14 dnl the Free Software Foundation; either version 2 of the License, or
15 dnl (at your option) any later version.
17 dnl This program is distributed in the hope that it will be useful,
18 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
19 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 dnl GNU General Public License for more details.
22 dnl You should have received a copy of the GNU General Public License
23 dnl along with this program; if not, write to the Free Software Foundation,
24 dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 dnl --- Boring header things ---
29 AM_INIT_AUTOMAKE(usernet, 1.1)
30 AM_CONFIG_HEADER(unetconf.h)
34 dnl --- Make sure we recognise the environment ---
39 AC_MSG_ERROR([It would help a lot if you compiled under Linux.])
43 kernelversion=`uname -r`
45 dnl --- Find the Linux kernel sources ---
47 AC_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
58 if test -z "$mdw_cv_linux_source"; then
59 AC_MSG_ERROR([Failed to find the Linux source. Where is it?])
61 linuxdir="$mdw_cv_linux_source"])
69 dnl --- Play with GCC command line arguments ---
71 mdw_GCC_FLAGS([-Wall -fomit-frame-pointer -fno-strength-reduce])
77 *) NCFLAGS="$NCFLAGS $i"
82 dnl --- Decide where to put the module ---
84 AC_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],
89 [for i in /lib/modules/misc /lib/modules/$kernelversion/misc; do
95 if test -z "$mdw_cv_module_dir"; then
96 mdw_cv_module_dir="/lib/modules/$kernelversion/misc"
98 moduledir=$mdw_cv_module_dir])
101 dnl --- Tweakable parameters ---
103 AC_ARG_WITH([major-device],
104 [ --with-major-device=NUM set major device number for Usernet],
105 [MAJORDEV="$WITHVAL"],
108 AC_DEFINE_UNQUOTED(UNET_MAJOR, $MAJORDEV)
110 AC_ARG_WITH([persistent-devices],
111 [ --with-persistent-devices=NUM
112 create NUM persistent devices],
113 [NPERSIST="$withval"],
116 AC_DEFINE_UNQUOTED(UNET_NPERSIST, $NPERSIST)
118 AC_ARG_WITH([transient-minor],
119 [ --with-transient-minor=NUM
120 set minor device number of /dev/unet],
121 [TRANSMINOR="$withval"],
124 AC_DEFINE_UNQUOTED(UNET_TRANSMINOR, $TRANSMINOR)
126 AC_ARG_WITH([max-queue-length],
127 [ --with-max-queue-length=NUM
128 queue at most NUM packets],
129 [QMAXLEN="$withval"],
132 AC_DEFINE_UNQUOTED(UNET_QMAXLEN, $QMAXLEN)
134 AC_ARG_WITH([max-interfaces],
135 [ --with-max-interfaces=NUM
136 maximum number of interfaces allowed],
140 AC_DEFINE_UNQUOTED(UNET_MAXIF, $MAXIF)
142 AC_ARG_WITH([debugging],
143 [ --with-debugging=OPT enable debugging output from the module
144 (options are "yes", "no" and "runtime")],
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]) ;;
151 [AC_DEFINE(UNET_DEBUG, 0)])
153 dnl --- Should be enough for today ---
155 AC_OUTPUT(Makefile makedev.unet)