configure.ac
branchstable-1.1
changeset 1725 a5a8a64d2b52
parent 1724 07c82e520ddd
child 368 5526520f323f
equal deleted inserted replaced
1724:07c82e520ddd 1725:a5a8a64d2b52
    12 
    12 
    13 #------------------------------------------------------------------------------
    13 #------------------------------------------------------------------------------
    14 # Linux sources
    14 # Linux sources
    15 #------------------------------------------------------------------------------
    15 #------------------------------------------------------------------------------
    16 
    16 
    17 AC_ARG_WITH([linux-dir],
    17 AC_ARG_WITH([linux],
    18     AC_HELP_STRING(
    18     AC_HELP_STRING(
    19         [--with-linux-dir=<linux-dir>],
    19         [--with-linux=<version>],
    20         [Linux source directory @<:@/lib/modules/<kernelversion>/build@:>@]),
    20         [Linux kernel version @<:@running kernel@:>@]
       
    21     ),
    21     [ ],
    22     [ ],
    22     [
    23     [version=`uname -r`]
    23 	modulesdir=/lib/modules/`uname -r`
    24 )
    24         withval=${modulesdir}/build
       
    25     ])
       
    26 
    25 
    27 AC_MSG_CHECKING([for Linux source tree])
    26 AC_MSG_CHECKING([for Linux kernel])
    28 
    27 modulesdir=/lib/modules/${version}
    29 if test \! -r ${withval}/Makefile; then
    28 if test \! -d ${modulesdir} || test \! -d ${modulesdir}/build; then
    30    echo
    29    echo
    31    AC_MSG_ERROR([No Linux kernel tree in $withval])
    30    AC_MSG_ERROR([Invalid modules directory ${modulesdir}])
       
    31 fi
       
    32 sourcedir=`cd ${modulesdir}/build && pwd -P`
       
    33 if test \! -r ${sourcedir}/Makefile; then
       
    34    echo
       
    35    AC_MSG_ERROR([No Linux kernel tree in $sourcedir])
    32 fi
    36 fi
    33 
    37 
    34 AC_SUBST(LINUX_DIR,[$withval])
    38 AC_SUBST(LINUX_KERNEL_VERSION,[$version])
       
    39 AC_SUBST(LINUX_SOURCE_DIR,[$sourcedir])
    35 AC_SUBST(LINUX_MODULES_DIR,[$modulesdir])
    40 AC_SUBST(LINUX_MODULES_DIR,[$modulesdir])
    36 
    41 
    37 AC_MSG_RESULT($LINUX_DIR)
    42 AC_MSG_RESULT($LINUX_KERNEL_VERSION)
       
    43 
       
    44 #------------------------------------------------------------------------------
       
    45 # Depmod
       
    46 #------------------------------------------------------------------------------
       
    47 
       
    48 AC_PATH_PROG([DEPMOD], [depmod],, [$PATH:/sbin:/usr/sbin:/usr/local/sbin])
       
    49 
       
    50 if test -z "$DEPMOD"; then
       
    51    AC_MSG_WARN([depmod was not found!]);
       
    52 fi
    38 
    53 
    39 #------------------------------------------------------------------------------
    54 #------------------------------------------------------------------------------
    40 
    55 
    41 AC_OUTPUT
    56 AC_OUTPUT
    42 
    57