configure.ac
author Florian Pose <fp@igh-essen.com>
Fri, 09 Feb 2007 18:33:07 +0000
changeset 546 616ccc2dea71
parent 537 c715766e0f81
child 563 d113b63c55c4
permissions -rw-r--r--
Version 1.2.0, release candidate 2.
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     1
#------------------------------------------------------------------------------
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
# $Id$
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     3
#------------------------------------------------------------------------------
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
392
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
     5
AC_PREREQ(2.59)
546
616ccc2dea71 Version 1.2.0, release candidate 2.
Florian Pose <fp@igh-essen.com>
parents: 537
diff changeset
     6
AC_INIT([ethercat],[1.2.0-rc2],[fp@igh-essen.com])
387
e6e708a5d502 Improved autotools files.
Florian Pose <fp@igh-essen.com>
parents: 385
diff changeset
     7
AC_CONFIG_AUX_DIR([autoconf])
479
610ddcf35d5c Removed --foreign switch for autotools.
Florian Pose <fp@igh-essen.com>
parents: 477
diff changeset
     8
AM_INIT_AUTOMAKE([-Wall -Werror dist-bzip2])
387
e6e708a5d502 Improved autotools files.
Florian Pose <fp@igh-essen.com>
parents: 385
diff changeset
     9
AC_PREFIX_DEFAULT([/opt/etherlab])
392
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    10
AC_CONFIG_HEADERS([config.h])
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    11
AC_CONFIG_SRCDIR([config.h.in])
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    12
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    13
#------------------------------------------------------------------------------
444
31223539fc00 Compiler flag -DSVNREV only for module.c to avoid unnecessary recompiling.
Florian Pose <fp@igh-essen.com>
parents: 440
diff changeset
    14
# Global
31223539fc00 Compiler flag -DSVNREV only for module.c to avoid unnecessary recompiling.
Florian Pose <fp@igh-essen.com>
parents: 440
diff changeset
    15
#------------------------------------------------------------------------------
31223539fc00 Compiler flag -DSVNREV only for module.c to avoid unnecessary recompiling.
Florian Pose <fp@igh-essen.com>
parents: 440
diff changeset
    16
31223539fc00 Compiler flag -DSVNREV only for module.c to avoid unnecessary recompiling.
Florian Pose <fp@igh-essen.com>
parents: 440
diff changeset
    17
branch=trunk
31223539fc00 Compiler flag -DSVNREV only for module.c to avoid unnecessary recompiling.
Florian Pose <fp@igh-essen.com>
parents: 440
diff changeset
    18
31223539fc00 Compiler flag -DSVNREV only for module.c to avoid unnecessary recompiling.
Florian Pose <fp@igh-essen.com>
parents: 440
diff changeset
    19
AC_DEFINE_UNQUOTED(BRANCH, ["$branch"], [Subversion branch])
31223539fc00 Compiler flag -DSVNREV only for module.c to avoid unnecessary recompiling.
Florian Pose <fp@igh-essen.com>
parents: 440
diff changeset
    20
AC_SUBST(BRANCH, [$branch])
31223539fc00 Compiler flag -DSVNREV only for module.c to avoid unnecessary recompiling.
Florian Pose <fp@igh-essen.com>
parents: 440
diff changeset
    21
31223539fc00 Compiler flag -DSVNREV only for module.c to avoid unnecessary recompiling.
Florian Pose <fp@igh-essen.com>
parents: 440
diff changeset
    22
#------------------------------------------------------------------------------
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    23
# Linux sources
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    24
#------------------------------------------------------------------------------
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    25
440
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    26
AC_ARG_WITH([linux-dir],
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    27
    AC_HELP_STRING(
440
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    28
        [--with-linux-dir=<DIR>],
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    29
        [Linux kernel sources @<:@running kernel@:>@]
367
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    30
    ),
440
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    31
    [
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    32
        sourcedir=[$withval]
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    33
    ],
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    34
    [
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    35
        version=[`uname -r`]
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    36
        modulesdir=/lib/modules/${version}
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    37
        if test \! -d ${modulesdir} || test \! -d ${modulesdir}/build; then
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    38
           echo
477
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    39
           AC_MSG_ERROR([Failed to find Linux sources. Use --with-linux-dir!])
440
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    40
        fi
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    41
        sourcedir=`cd ${modulesdir}/build && pwd -P`
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    42
    ]
367
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    43
)
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    44
440
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    45
AC_MSG_CHECKING([for Linux kernel sources])
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    46
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
    47
if test \! -r ${sourcedir}/.config; then
477
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    48
    echo
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    49
    AC_MSG_ERROR([No configured Linux kernel sources in $sourcedir])
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    50
fi
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    51
477
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    52
# Try to get kernel release string
537
c715766e0f81 Fixed bad configure behavior with complex kernel version strings.
Florian Pose <fp@igh-essen.com>
parents: 507
diff changeset
    53
if test -r ${sourcedir}/include/config/kernel.release; then
c715766e0f81 Fixed bad configure behavior with complex kernel version strings.
Florian Pose <fp@igh-essen.com>
parents: 507
diff changeset
    54
    kernelrelease=`cat $sourcedir/include/config/kernel.release`
c715766e0f81 Fixed bad configure behavior with complex kernel version strings.
Florian Pose <fp@igh-essen.com>
parents: 507
diff changeset
    55
elif test -r ${sourcedir}/.kernelrelease; then
477
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    56
    kernelrelease=`cat $sourcedir/.kernelrelease`
507
4687f9d8254e Configuring for kernels 2.6.18 and 2.6.19, thanks to Ralf Roesch.
Florian Pose <fp@igh-essen.com>
parents: 506
diff changeset
    57
elif test -r ${sourcedir}/include/linux/utsrelease.h; then
4687f9d8254e Configuring for kernels 2.6.18 and 2.6.19, thanks to Ralf Roesch.
Florian Pose <fp@igh-essen.com>
parents: 506
diff changeset
    58
    hdr=${sourcedir}/include/linux/utsrelease.h
4687f9d8254e Configuring for kernels 2.6.18 and 2.6.19, thanks to Ralf Roesch.
Florian Pose <fp@igh-essen.com>
parents: 506
diff changeset
    59
    kernelrelease=`grep UTS_RELEASE $hdr | cut -d " " -f 3- | tr -d \"`
477
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    60
elif test -r ${sourcedir}/include/linux/version.h; then
507
4687f9d8254e Configuring for kernels 2.6.18 and 2.6.19, thanks to Ralf Roesch.
Florian Pose <fp@igh-essen.com>
parents: 506
diff changeset
    61
    hdr=${sourcedir}/include/linux/version.h
477
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    62
    kernelrelease=`grep UTS_RELEASE $hdr | cut -d " " -f 3- | tr -d \"`
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    63
fi
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    64
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    65
if test -z "$kernelrelease"; then
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    66
    echo
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    67
    AC_MSG_ERROR([Failed to extract Linux kernel version!])
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    68
fi
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    69
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    70
# Extract three numbers from kernel release string
537
c715766e0f81 Fixed bad configure behavior with complex kernel version strings.
Florian Pose <fp@igh-essen.com>
parents: 507
diff changeset
    71
linuxversion=`echo $kernelrelease | grep -oE "^[[0-9]]+\.[[0-9]]+\.[[0-9]]+"`
477
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    72
367
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    73
AC_SUBST(LINUX_SOURCE_DIR,[$sourcedir])
477
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    74
AC_SUBST(LINUX_KERNEL_RELEASE,[$kernelrelease])
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    75
AC_SUBST(LINUX_KERNEL_VERSION,[$linuxversion])
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    76
AC_SUBST(LINUX_MOD_PATH,[/lib/modules/$kernelrelease/ethercat])
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    77
AC_MSG_RESULT([$LINUX_SOURCE_DIR (Kernel $LINUX_KERNEL_RELEASE)])
367
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    78
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    79
#------------------------------------------------------------------------------
485
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    80
# 8139too Kernel
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    81
#------------------------------------------------------------------------------
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    82
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    83
AC_ARG_WITH([8139too-kernel],
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    84
    AC_HELP_STRING(
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    85
        [--with-8139too-kernel=<X.Y.Z>],
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    86
        [8139too kernel (only if differing)]
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    87
    ),
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    88
    [
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    89
        kernel8139too=[$withval]
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    90
    ],
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    91
    [
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    92
        kernel8139too=$linuxversion
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    93
    ]
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    94
)
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    95
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    96
AC_MSG_CHECKING([for kernel for 8139too driver])
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    97
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    98
kernels=`ls -1 devices/ | grep -oE "^8139too-.*-" | cut -d "-" -f 2 | uniq`
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
    99
found=0
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   100
for k in $kernels; do
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   101
    if test "$kernel8139too" = "$k"; then
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   102
        found=1
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   103
    fi
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   104
done
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   105
if test $found -ne 1; then
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   106
    AC_MSG_ERROR([kernel $kernel8139too not available for 8139too driver!])
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   107
fi
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   108
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   109
AC_MSG_RESULT([$kernel8139too])
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   110
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   111
#------------------------------------------------------------------------------
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   112
# RTAI path (optional)
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   113
#------------------------------------------------------------------------------
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   114
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   115
AC_ARG_WITH([rtai-dir],
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   116
    AC_HELP_STRING(
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   117
        [--with-rtai-dir=<DIR>],
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   118
        [RTAI path (only for RTAI examples)]
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   119
    ),
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   120
    [
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   121
        rtaidir=[$withval]
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   122
    ],
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   123
    [
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   124
        rtaidir=""
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   125
    ]
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   126
)
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   127
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   128
AC_MSG_CHECKING([for RTAI path])
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   129
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   130
if test -z "${rtaidir}"; then
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   131
    AC_MSG_RESULT([not specified.])
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   132
else
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   133
    if test \! -r ${rtaidir}/include/rtai.h; then
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   134
        AC_MSG_ERROR([no RTAI installation found in ${rtaidir}!])
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   135
    fi
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   136
    AC_MSG_RESULT([$rtaidir])
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   137
    AC_SUBST(RTAI_DIR,[$rtaidir])
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   138
fi
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   139
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   140
#------------------------------------------------------------------------------
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   141
# MSR path (optional)
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   142
#------------------------------------------------------------------------------
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   143
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   144
AC_ARG_WITH([msr-dir],
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   145
    AC_HELP_STRING(
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   146
        [--with-msr-dir=<DIR>],
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   147
        [MSR path (only for MSR example)]
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   148
    ),
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   149
    [
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   150
        msrdir=[$withval]
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   151
    ],
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   152
    [
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   153
        msrdir=""
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   154
    ]
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   155
)
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   156
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   157
AC_MSG_CHECKING([for MSR path])
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   158
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   159
if test -z "${msrdir}"; then
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   160
    AC_MSG_RESULT([not specified.])
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   161
else
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   162
    if test \! -r ${msrdir}/include/msr.h; then
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   163
        AC_MSG_ERROR([no MSR installation found in ${msrdir}!])
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   164
    fi
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   165
    AC_MSG_RESULT([$msrdir])
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   166
    AC_SUBST(MSR_DIR,[$msrdir])
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   167
fi
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   168
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   169
#------------------------------------------------------------------------------
392
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   170
# Debug interface
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   171
#------------------------------------------------------------------------------
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   172
471
0a6bd71bf4d3 Fixed debug interfaces.
Florian Pose <fp@igh-essen.com>
parents: 468
diff changeset
   173
AC_ARG_ENABLE([dbg-if],
440
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   174
    AS_HELP_STRING([--enable-dbg-if],
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   175
                   [Create a debug interface for each master @<:@NO@:>@]),
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   176
    [
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   177
        case "${enableval}" in
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   178
            yes) dbg=1
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   179
                AC_DEFINE([EC_DBG_IF], [1], [Debug interfaces enabled])
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   180
                ;;
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   181
            no) dbg=0
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   182
                ;;
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   183
            *) AC_MSG_ERROR([Invalid value for --enable-dbg-if])
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   184
                ;;
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   185
        esac
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   186
    ],
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   187
    [dbg=0]
392
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   188
)
440
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   189
392
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   190
AM_CONDITIONAL(EC_DBG_IF, test "x$dbg" = x1)
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   191
AC_SUBST([EC_DBG_IF],${dbg})
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   192
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   193
#------------------------------------------------------------------------------
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   194
485
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   195
# Create config.kbuild
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   196
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   197
echo configure: creating config.kbuild...
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   198
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   199
cat > config.kbuild <<EOF
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   200
# config.kbuild - created by configure
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   201
EC_DBG_IF := ${dbg}
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   202
EC_8139TOO_KERNEL := ${kernel8139too}
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   203
EC_RTAI_DIR := "${rtaidir}"
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   204
EC_MSR_DIR := "${msrdir}"
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   205
EOF
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   206
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   207
#------------------------------------------------------------------------------
8354ddf38481 Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
Florian Pose <fp@igh-essen.com>
parents: 479
diff changeset
   208
385
c33367851350 Added file ./bootstrap; Added $(DESTDIR) to */Makefile.am make alternate root installs possible
Richard Hacker <ha@igh-essen.com>
parents: 373
diff changeset
   209
AC_CONFIG_FILES([
392
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   210
        Makefile
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   211
        master/Makefile
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   212
        devices/Makefile
385
c33367851350 Added file ./bootstrap; Added $(DESTDIR) to */Makefile.am make alternate root installs possible
Richard Hacker <ha@igh-essen.com>
parents: 373
diff changeset
   213
        script/Makefile
387
e6e708a5d502 Improved autotools files.
Florian Pose <fp@igh-essen.com>
parents: 385
diff changeset
   214
        include/Makefile
393
9cfbb344adc0 Distribution makefile for examples.
Florian Pose <fp@igh-essen.com>
parents: 392
diff changeset
   215
        examples/Makefile
385
c33367851350 Added file ./bootstrap; Added $(DESTDIR) to */Makefile.am make alternate root installs possible
Richard Hacker <ha@igh-essen.com>
parents: 373
diff changeset
   216
        examples/mini/Makefile
387
e6e708a5d502 Improved autotools files.
Florian Pose <fp@igh-essen.com>
parents: 385
diff changeset
   217
        examples/rtai/Makefile
e6e708a5d502 Improved autotools files.
Florian Pose <fp@igh-essen.com>
parents: 385
diff changeset
   218
        examples/msr/Makefile
385
c33367851350 Added file ./bootstrap; Added $(DESTDIR) to */Makefile.am make alternate root installs possible
Richard Hacker <ha@igh-essen.com>
parents: 373
diff changeset
   219
])
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   220
AC_OUTPUT
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   221
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   222
#------------------------------------------------------------------------------