dnl -*-fundamental-*- dnl dnl $Id: configure.in,v 1.3 2001/03/03 12:58:55 mdw Exp $ dnl dnl Configuration script for usernet dnl dnl (c) 1998 Mark Wooding dnl dnl----- Licensing notice --------------------------------------------------- dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software Foundation, dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. dnl --- Boring header things --- AC_INIT(unet.c) AM_INIT_AUTOMAKE(usernet, 1.1.1) AM_CONFIG_HEADER(unetconf.h) AC_PROG_CC AC_CANONICAL_HOST dnl --- Make sure we recognise the environment --- case $host in *-linux*) ;; *) AC_MSG_ERROR([It would help a lot if you compiled under Linux.]) ;; esac kernelversion=`uname -r` dnl --- Find the Linux kernel sources --- AC_ARG_WITH([linux-source], [ --with-linux-source=DIR directory containing Linux kernel source], [linuxdir="$withval"], [AC_CACHE_CHECK([where the Linux kernel source is], [mdw_cv_linux_source], [for i in /usr/src/linux /usr/src/linux-$kernelversion; do if test -f $i/kernel/ksyms.c; then mdw_cv_linux_source=$i break fi done if test -z "$mdw_cv_linux_source"; then AC_MSG_ERROR([Failed to find the Linux source. Where is it?]) fi]) linuxdir="$mdw_cv_linux_source"]) AC_SUBST(linuxdir) dnl --- Find Perl --- mdw_PROG_PERL(5.003) mdw_CHECK_PERL(5.003) dnl --- Play with GCC command line arguments --- mdw_GCC_FLAGS([-Wall -fomit-frame-pointer -fno-strength-reduce]) NCFLAGS="" for i in $CFLAGS; do case $i in -g) ;; *) NCFLAGS="$NCFLAGS $i" esac done CFLAGS="$NCFLAGS" dnl --- Decide where to put the module --- AC_ARG_WITH([module-dir], [ --with-module-dir=DIR directory to install the module in], [moduledir="$withval"], [AC_CACHE_CHECK([for a good place to store kernel modules], [mdw_cv_module_dir], [for i in /lib/modules/misc /lib/modules/$kernelversion/misc; do if test -d $i; then mdw_cv_module_dir=$i break fi done]) if test -z "$mdw_cv_module_dir"; then mdw_cv_module_dir="/lib/modules/$kernelversion/misc" fi moduledir=$mdw_cv_module_dir]) AC_SUBST(moduledir) dnl --- Tweakable parameters --- AC_ARG_WITH([major-device], [ --with-major-device=NUM set major device number for Usernet], [MAJORDEV="$WITHVAL"], [MAJORDEV=63]) AC_SUBST(MAJORDEV) AC_DEFINE_UNQUOTED(UNET_MAJOR, $MAJORDEV) AC_ARG_WITH([persistent-devices], [ --with-persistent-devices=NUM create NUM persistent devices], [NPERSIST="$withval"], [NPERSIST=1]) AC_SUBST(NPERSIST) AC_DEFINE_UNQUOTED(UNET_NPERSIST, $NPERSIST) AC_ARG_WITH([transient-minor], [ --with-transient-minor=NUM set minor device number of /dev/unet], [TRANSMINOR="$withval"], [TRANSMINOR=255]) AC_SUBST(TRANSMINOR) AC_DEFINE_UNQUOTED(UNET_TRANSMINOR, $TRANSMINOR) AC_ARG_WITH([max-queue-length], [ --with-max-queue-length=NUM queue at most NUM packets], [QMAXLEN="$withval"], [QMAXLEN=128]) AC_SUBST(QMAXLEN) AC_DEFINE_UNQUOTED(UNET_QMAXLEN, $QMAXLEN) AC_ARG_WITH([max-interfaces], [ --with-max-interfaces=NUM maximum number of interfaces allowed], [MAXIF="$withval"], [MAXIF=64]) AC_SUBST(MAXIF) AC_DEFINE_UNQUOTED(UNET_MAXIF, $MAXIF) AC_ARG_WITH([debugging], [ --with-debugging=OPT enable debugging output from the module (options are "yes", "no" and "runtime")], [case "$withval" in yes) AC_DEFINE(UNET_DEBUG, 1) ;; no) AC_DEFINE(UNET_DEBUG, -1) ;; runtime) AC_DEFINE(UNET_DEBUG, 0) ;; *) AC_MSG_ERROR([bad argument to --with-debugging]) ;; esac], [AC_DEFINE(UNET_DEBUG, 0)]) dnl --- Should be enough for today --- AC_OUTPUT(Makefile makedev.unet)