configure.ac
changeset 440 16fddae16c94
parent 393 9cfbb344adc0
child 444 31223539fc00
equal deleted inserted replaced
439:0f5a3d983908 440:16fddae16c94
    12 
    12 
    13 #------------------------------------------------------------------------------
    13 #------------------------------------------------------------------------------
    14 # Linux sources
    14 # Linux sources
    15 #------------------------------------------------------------------------------
    15 #------------------------------------------------------------------------------
    16 
    16 
    17 AC_ARG_WITH([linux],
    17 AC_ARG_WITH([linux-dir],
    18     AC_HELP_STRING(
    18     AC_HELP_STRING(
    19         [--with-linux=<version>],
    19         [--with-linux-dir=<DIR>],
    20         [Linux kernel version @<:@running kernel@:>@]
    20         [Linux kernel sources @<:@running kernel@:>@]
    21     ),
    21     ),
    22     [version=[$withval]],
    22     [
    23     [version=[`uname -r`]]
    23         sourcedir=[$withval]
       
    24     ],
       
    25     [
       
    26         version=[`uname -r`]
       
    27         modulesdir=/lib/modules/${version}
       
    28         if test \! -d ${modulesdir} || test \! -d ${modulesdir}/build; then
       
    29            echo
       
    30            AC_MSG_ERROR([Invalid modules directory ${modulesdir}])
       
    31         fi
       
    32         sourcedir=`cd ${modulesdir}/build && pwd -P`
       
    33     ]
    24 )
    34 )
    25 
    35 
    26 AC_MSG_CHECKING([for Linux kernel])
    36 AC_MSG_CHECKING([for Linux kernel sources])
    27 modulesdir=/lib/modules/${version}
    37 
    28 if test \! -d ${modulesdir} || test \! -d ${modulesdir}/build; then
    38 if test \! -r ${sourcedir}/.config; then
    29    echo
    39    echo
    30    AC_MSG_ERROR([Invalid modules directory ${modulesdir}])
    40    AC_MSG_ERROR([No configured Linux kernel sources in $sourcedir])
    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 sources in $sourcedir])
       
    36 fi
    41 fi
    37 
    42 
    38 AC_SUBST(LINUX_KERNEL_VERSION,[$version])
       
    39 AC_SUBST(LINUX_SOURCE_DIR,[$sourcedir])
    43 AC_SUBST(LINUX_SOURCE_DIR,[$sourcedir])
    40 AC_SUBST(LINUX_MODULES_DIR,[$modulesdir])
    44 AC_MSG_RESULT($LINUX_SOURCE_DIR)
    41 
       
    42 AC_MSG_RESULT($LINUX_KERNEL_VERSION)
       
    43 
    45 
    44 #------------------------------------------------------------------------------
    46 #------------------------------------------------------------------------------
    45 # Depmod
    47 # Depmod
    46 #------------------------------------------------------------------------------
    48 #------------------------------------------------------------------------------
    47 
    49 
    54 #------------------------------------------------------------------------------
    56 #------------------------------------------------------------------------------
    55 # Debug interface
    57 # Debug interface
    56 #------------------------------------------------------------------------------
    58 #------------------------------------------------------------------------------
    57 
    59 
    58 AC_ARG_ENABLE([debug-if],
    60 AC_ARG_ENABLE([debug-if],
    59 		AS_HELP_STRING([--enable-dbg-if],
    61     AS_HELP_STRING([--enable-dbg-if],
    60 						[Create a debug interface for each master @<:@NO@:>@]),
    62                    [Create a debug interface for each master @<:@NO@:>@]),
    61 		[case "${enableval}" in
    63     [
    62 			  yes) dbg=1
    64         case "${enableval}" in
    63 				   AC_DEFINE([EC_DBG_IF], [1], [Debug interfaces enabled])
    65             yes) dbg=1
    64 				   ;;
    66                 AC_DEFINE([EC_DBG_IF], [1], [Debug interfaces enabled])
    65 			  no)  dbg=0
    67                 ;;
    66 				   ;;
    68             no) dbg=0
    67 			  *)   AC_MSG_ERROR([Invalid value for --enable-dbg-if])
    69                 ;;
    68 				   ;;
    70             *) AC_MSG_ERROR([Invalid value for --enable-dbg-if])
    69 		esac],
    71                 ;;
    70 		[dbg=0]
    72         esac
       
    73     ],
       
    74     [dbg=0]
    71 )
    75 )
       
    76 
    72 AM_CONDITIONAL(EC_DBG_IF, test "x$dbg" = x1)
    77 AM_CONDITIONAL(EC_DBG_IF, test "x$dbg" = x1)
    73 AC_SUBST([EC_DBG_IF],${dbg})
    78 AC_SUBST([EC_DBG_IF],${dbg})
    74 
    79 
    75 #------------------------------------------------------------------------------
    80 #------------------------------------------------------------------------------
    76 
    81