summaryrefslogtreecommitdiff
path: root/pppd_plugin/configure.in
diff options
context:
space:
mode:
authorxeb <xeb@mail.ru>2009-06-17 00:56:34 +0400
committerxeb <xeb@mail.ru>2009-06-17 00:56:34 +0400
commitdf2441c834cf341d9b969dacc2dd8dac07cd588e (patch)
treeca0c7d8bade520ac35f5cd5c34dec54b136bd491 /pppd_plugin/configure.in
downloadaccel-ppp-xebd-df2441c834cf341d9b969dacc2dd8dac07cd588e.tar.gz
accel-ppp-xebd-df2441c834cf341d9b969dacc2dd8dac07cd588e.zip
initial import
Diffstat (limited to 'pppd_plugin/configure.in')
-rw-r--r--pppd_plugin/configure.in73
1 files changed, 73 insertions, 0 deletions
diff --git a/pppd_plugin/configure.in b/pppd_plugin/configure.in
new file mode 100644
index 0000000..28807f9
--- /dev/null
+++ b/pppd_plugin/configure.in
@@ -0,0 +1,73 @@
+AC_INIT(configure.in)
+
+AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE(pptp,0.8.3)
+
+AC_LANG_C
+AC_PROG_CC
+AM_PROG_LIBTOOL
+
+AC_DEFINE(PPPD_VERSION,[],"PPPD version")
+AC_DEFINE(KERNELVERSION,[],"kernel version")
+
+CFLAGS="${CFLAGS:=}"
+
+dnl check linux headers
+AC_MSG_CHECKING([for linux kernel herders])
+if test -n "${KDIR}"; then
+ if test -f ${KDIR}/include/linux/version.h; then
+ header=${KDIR}/include
+ else
+ AC_MSG_RESULT(not found)
+ AC_MSG_ERROR(Could not find linux kernel headers)
+ fi
+else
+ kernel=`uname -r`
+ if test -f /usr/src/linux/include/linux/version.h; then
+ header=/usr/src/linux/include
+ elif test -f /lib/modules/${kernel}/build/include/linux/version.h; then
+ header=/lib/modules/${kernel}/build/include
+ else
+ AC_MSG_RESULT(not found)
+ AC_MSG_ERROR(Could not find linux kernel headers)
+ fi
+fi
+VERSION=$(cat ${header/include}Makefile | grep '^VERSION = ' | awk '{print $3}')
+PATCHLEVEL=$(cat ${header/include}Makefile | grep '^PATCHLEVEL = ' | awk '{print $3}')
+SUBLEVEL=$(cat ${header/include}Makefile | grep '^SUBLEVEL = ' | awk '{print $3}')
+EXTRAVERSION=$(cat ${header/include}Makefile | grep '^EXTRAVERSION = ' | awk '{print $3}')
+KERNELVERSION=$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION
+AC_MSG_RESULT(found ($KERNELVERSION at ${header/include}))
+AC_DEFINE_UNQUOTED(KERNELVERSION,"$KERNELVERSION")
+
+
+CFLAGS="${CFLAGS} -I. -I${header}"
+
+AC_MSG_CHECKING([for pppd])
+pppd=`which pppd 2>&1`
+if test $? -eq 1; then
+ pppd=""
+ for path in /usr/sbin /usr/local/sbin /usr/bin /usr/local/bin /sbin; do
+ if test -x ${path}/pppd; then
+ pppd=${path}/pppd
+ break;
+ fi
+ done
+fi
+
+if test -z "${pppd}"; then
+ AC_MSG_RESULT(not found)
+ AC_MSG_ERROR(Could not find pppd)
+fi
+pppd_ver=`${pppd} --version 2>&1 | grep version | sed 's/pppd version //'`
+AC_MSG_RESULT($pppd ($pppd_ver))
+AC_DEFINE_UNQUOTED(PPPD_VERSION,"${pppd_ver}")
+
+echo '==============================================================================='
+
+echo 'Configuration chosen:'
+echo ' PPPD: '${pppd_ver}
+echo ' linux kernel : '$KERNELVERSION at ${header/include}
+
+AC_OUTPUT(Makefile src/Makefile)
+ \ No newline at end of file