libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / accel-pptp / configure.in
bloba9d4a44124dcacac385d8317dc5cc093571e8fca
1 AC_INIT(configure.in)
3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE(pptp,0.8.5)
6 AC_LANG_C
7 AC_PROG_CC
8 AM_PROG_LIBTOOL
10 AC_DEFINE(PPPD_VERSION,[],"PPPD version")
11 AC_DEFINE(KERNELVERSION,[],"kernel version")
13 CFLAGS="${CFLAGS:=}"
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
20     else
21         AC_MSG_RESULT(not found)
22         AC_MSG_ERROR(Could not find linux kernel headers)
23     fi
24 else
25     kernel=`uname -r`
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
30     else
31         AC_MSG_RESULT(not found)
32         AC_MSG_ERROR(Could not find linux kernel headers)
33     fi
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
49     pppd=""
50     for path in /usr/sbin /usr/local/sbin /usr/bin /usr/local/bin /sbin; do
51         if test -x ${path}/pppd; then
52             pppd=${path}/pppd
53             break;
54         fi
55     done
58 if test -z "${pppd}"; then
59     AC_MSG_RESULT(not found)
60     AC_MSG_ERROR(Could not find pppd)
61 fi    
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)