dnl
dnl Copyright (C) 2005 Pawel Kot
dnl Configuration script for nokia_dku2 kernel drivers
dnl
dnl $Id: configure.in,v 1.1 2005/07/10 13:27:05 pkot Exp $
dnl

dnl === Some general stuff
AC_INIT(nokia_dku2.c)
AC_CONFIG_AUX_DIR(../../config)

dnl === Handle custom Linux kernel sources directory
SOURCESDIR="/lib/modules/`uname -r`/build"
AC_ARG_WITH(kernsrcdir,
	[  --with-kernsrcdir=dir   specifies the kernel sources dir],
	[ if test x$withval = xyes; then
		AC_MSG_WARN(Usage is: --with-kernsrcdir=dir)
	  else
		SOURCESDIR="$withval"
	  fi
	]
)

dnl === Hanlde custom Linux modules directory
MODULESDIR="/lib/modules/`uname -r`"
AC_ARG_WITH(kernmoddir,
	[  --with-kernmoddir=dir   specifies the kernel modules dir],
	[ if test x$withval = xyes; then
		AC_MSG_WARN(Usage is: --with-kermoddir=dir)
	  else
		MODULESDIR="$withval"
	  fi
	]
)

dnl === Prepare the Makefiles
AC_SUBST(SOURCESDIR)
AC_SUBST(MODULESDIR)
AC_OUTPUT(Makefile)

dnl === Output the configuration paths and instruction for the next steps
echo "
Sources located at $SOURCESDIR will be used.
Compiled kernel module will be installed into $MODULESDIR.
Now type:
 $ make
to compile the driver, and then become root and type:
 # make install
to install the driver. Next step is to:
 # modprobe nokia_dku2
and see the kernel logs to verify whether the driver works. If you have any problems
doing this, consult gnokii FAQ (distributed withing gnokii tarball or online at
http://www.gnokii.org/faq.shtml), gnokii wiki (http://wiki.gnokii.org) or gnokii
users mailing list (http://lists.gnu.org/mailman/listinfo/gnokii-users).
"
