3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(pptp,0.8.5)
10 AC_DEFINE(PPPD_VERSION,[],"PPPD version")
11 AC_DEFINE(KERNELVERSION,[],"kernel version")
15 dnl check linux headers
16 AC_MSG_CHECKING([for linux kernel herders])
17 if test -n "${KDIR}"; then
18 if test -f ${KDIR}/include/linux/version.h; then
19 header=${KDIR}/include
21 AC_MSG_RESULT(not found)
22 AC_MSG_ERROR(Could not find linux kernel headers)
26 if test -f /usr/src/linux/include/linux/version.h; then
27 header=/usr/src/linux/include
28 elif test -f /lib/modules/${kernel}/build/include/linux/version.h; then
29 header=/lib/modules/${kernel}/build/include
31 AC_MSG_RESULT(not found)
32 AC_MSG_ERROR(Could not find linux kernel headers)
35 VERSION=$(cat ${header/include}Makefile | grep '^VERSION = ' | awk '{print $3}')
36 PATCHLEVEL=$(cat ${header/include}Makefile | grep '^PATCHLEVEL = ' | awk '{print $3}')
37 SUBLEVEL=$(cat ${header/include}Makefile | grep '^SUBLEVEL = ' | awk '{print $3}')
38 EXTRAVERSION=$(cat ${header/include}Makefile | grep '^EXTRAVERSION = ' | awk '{print $3}')
39 KERNELVERSION=$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION
40 AC_MSG_RESULT(found ($KERNELVERSION at ${header/include}))
41 AC_DEFINE_UNQUOTED(KERNELVERSION,"$KERNELVERSION")
44 CFLAGS="${CFLAGS} -I. -I${header}"
46 AC_MSG_CHECKING([for pppd])
47 pppd=`which pppd 2>&1`
48 if test $? -eq 1; then
50 for path in /usr/sbin /usr/local/sbin /usr/bin /usr/local/bin /sbin; do
51 if test -x ${path}/pppd; then
58 if test -z "${pppd}"; then
59 AC_MSG_RESULT(not found)
60 AC_MSG_ERROR(Could not find pppd)
62 pppd_ver=`${pppd} --version 2>&1 | grep version | sed 's/pppd version //'`
63 AC_MSG_RESULT($pppd ($pppd_ver))
64 AC_DEFINE_UNQUOTED(PPPD_VERSION,"${pppd_ver}")
66 echo '==============================================================================='
68 echo 'Configuration chosen:'
69 echo ' PPPD: '${pppd_ver}
70 echo ' linux kernel : '$KERNELVERSION at ${header/include}
72 AC_OUTPUT(Makefile src/Makefile)