--- eagle-usb-1.9.8.orig/configure.in	Sun May 23 21:57:36 2004
+++ eagle-usb-1.9.8/configure.in	Sat Jun 19 15:22:08 2004
@@ -8,7 +8,7 @@
 #AC_INIT(eagle-usb, 1.9.7)
 #AC_CONFIG_SRCDIR(driver/eu_main.c)
 
-DEBUG=0
+DEBUG=1
 
 KERNEL_SRC_MISSING_MSG="error: kernel-sources cannot be found!\n"
 KERNEL_SRC_MISSING_SUSE_MSG="error:\tkernel-sources cannot be found!\n\tYou should try to launch ./configure in root.\n"
@@ -26,22 +26,36 @@
 # ===== current kernel version =====
 CUR_KERNEL_VER="`uname -r`"
 
-# ===== arg: kernel-source =====
+# ===== arg: build-kernel-ver =====
+AC_ARG_WITH(build-kernel-ver,
+[  --with-build-kernel-ver=vers Kernel source version used to build against (default={uname -r}) ],
+BUILD_KERNEL_VER=${withval},
+BUILD_KERNEL_VER=${CUR_KERNEL_VER}
+)
+
+# ===== arg: kernel-src =====
 AC_ARG_WITH(kernel-src,
-[  --with-kernel-src=path     Path to kernel source (default=/lib/modules/{version}/build) ],
+[  --with-kernel-src=path       Path to kernel source (default=/lib/modules/{uname -r}/build) ],
 KERNELSRC=${withval},
-KERNELSRC=/lib/modules/${CUR_KERNEL_VER}/build
+KERNELSRC=/lib/modules/${BUILD_KERNEL_VER}/build
+)
+#if ! test -d "${KERNELSRC}" ; then
+#	KERNELSRC=/usr/src/linux
+#fi
+
+# ===== arg: machine =====
+AC_ARG_WITH(machine,
+[  --with-machine=type          Machine type (default={uname -m}) ],
+MACHINE=${withval},
+MACHINE="`uname -m`"
 )
-if ! test -d "${KERNELSRC}" ; then
-	KERNELSRC=/usr/src/linux
-fi
 
 # ===== arg: conf-dir =====
-#AC_ARG_WITH(conf-dir,
-#[  --with-conf-dir            Path to system configuration files (default=/etc) ],
-#CONFDIR=${withval},
-#CONFDIR=""
-#)
+AC_ARG_WITH(conf-dir,
+[  --with-conf-dir              Path to system configuration files (default=/etc) ],
+CONFDIR=${withval},
+CONFDIR=${sysconfdir}
+)
 #if test -z "${CONFDIR}" ; then
 #	CONFDIR=/etc
 #fi
@@ -49,14 +63,14 @@
 #echo "confdir    = ${CONFDIR}"
 #echo "sysconfdir = ${sysconfdir}"
 #exit 3
-CONFDIR=${sysconfdir}
+#CONFDIR=${sysconfdir}
 if echo "x${CONFDIR}" | grep -q "x\${prefix}" ; then
 	CONFDIR=/etc
 fi
 
 # ===== arg: dsp-dir =====
 AC_ARG_WITH(dsp-dir,
-[  --with-dsp-dir             Path to DSP files (default=/etc/eagle-usb/dsp) ],
+[  --with-dsp-dir               Path to DSP files (default=/etc/eagle-usb/dsp) ],
 DSPDIR=${withval},
 DSPDIR=""
 )
@@ -66,14 +80,14 @@
 
 # ===== arg: dest-dir =====
 AC_ARG_WITH(dest-dir,
-[  --with-dest-dir            Top of arborescence (default=) ],
+[  --with-dest-dir              Top of arborescence (default=) ],
 DESTDIR=${withval},
 DESTDIR=""
 )
 
 # ===== arg: language =====
 AC_ARG_WITH(lang,
-[  --with-lang=LL             Language (en/de/es/fr/gr/it/pl)],
+[  --with-lang=LL               Language (en/de/es/fr/gr/it/pl)],
 EU_LANG=${withval},
 EU_LANG="auto"
 )
@@ -88,7 +102,7 @@
 
 # ===== arg: use hotplug? =====
 AC_ARG_ENABLE(hotplug,
-[  --disable-hotplug          Disable hotplugging (default autodetect)])
+[  --disable-hotplug            Disable hotplugging (default autodetect)])
 
 # ===== arg: use ifup/ifdown? =====
 AC_ARG_ENABLE(ifupdown,
@@ -97,7 +111,7 @@
 # ===== arg: generate module? =====
 BUILD_MODULE=1
 AC_ARG_ENABLE(module,
-[  --disable-module           Do not build kernel module (default enabled)])
+[  --disable-module             Do not build kernel module (default enabled)])
 if test "x${enable_module}" = "xno" ; then
 	BUILD_MODULE=0
 fi
@@ -138,7 +152,7 @@
 AC_CHECK_PROG(PPPD, pppd, "yes", "no", "/sbin:/usr/sbin:/usr/local/sbin")
 
 # ===== check for pppoe =====
-AC_CHECK_PROG(PPPOE, pppoe, "yes", "no", "/sbin:/usr/sbin:/usr/local/sbin")
+AC_CHECK_PROGS(PPPOE, pppoe rp-pppoe.so pppoe.so, "no", "/sbin:/usr/sbin:/usr/local/sbin:/usr/lib/pppd:/usr/lib/pppd/*")
 
 # ===== check for dialog programs =====
 AC_CHECK_PROGS(DIALOG, gdialog Xdialog dialog whiptail)
@@ -263,6 +277,7 @@
 KERNELVER=${KERNEL_SRC_VER}
 AC_SUBST(KERNELSRC)
 AC_SUBST(KERNELVER)
+AC_SUBST(MACHINE)
 AC_SUBST(CONFDIR)
 AC_SUBST(DSPDIR)
 AC_SUBST(DESTDIR)
@@ -289,7 +304,7 @@
 		rm -f config.cache
 		exit 1
 	fi
-	if test "${KERNEL_SRC_VER}" != "${CUR_KERNEL_VER}" ; then
+	if test "${KERNEL_SRC_VER}" != "${BUILD_KERNEL_VER}" ; then
 		echo -e ${KERNEL_SRC_DIFF_MSG}
 	fi
 fi
@@ -319,7 +334,9 @@
 fi
 
 if test $DEBUG == 1 ; then
-	echo -e "KERNEL=${KERNEL_SRC_VER} - ${CUR_KERNEL_VER}"
+	echo -e "KERNEL: version in source:${KERNEL_SRC_VER} / target kernel ${BUILD_KERNEL_VER}"
+	echo -e "KERNELSRC=${KERNELSRC}"
+	echo -e "MACHINE=${MACHINE}"
 	echo -e "DISTRIB=${DISTRIB} ${DISTVER}"
 	echo -e "SIMPLE=${SIMPLE}"
 	echo -e "USE_HOTPLUG=${USE_HOTPLUG}"
