configure.ac
author Florian Pose <fp@igh-essen.com>
Mon, 06 Nov 2006 16:27:40 +0000
changeset 485 8354ddf38481
parent 479 610ddcf35d5c
child 490 258e7fbdec65
permissions -rw-r--r--
Improved autotools, added config.kbuild, --with-msr-dir, --with-rtai-dir, --with-8139too-kernel.
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)
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     6
AC_INIT([ethercat],[1.1],[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
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    53
if test -r ${sourcedir}/.kernelrelease; then
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    54
    kernelrelease=`cat $sourcedir/.kernelrelease`
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    55
elif test -r ${sourcedir}/include/linux/version.h; then
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    56
    hdr=$sourcedir/include/linux/version.h
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    57
    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
    58
fi
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    59
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    60
if test -z "$kernelrelease"; then
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    61
    echo
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    62
    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
    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
# Extract three numbers from kernel release string
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    66
linuxversion=`echo $kernelrelease | grep -oE [[0-9]]+\.[[0-9]]+\.[[0-9]]+`
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    67
367
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    68
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
    69
AC_SUBST(LINUX_KERNEL_RELEASE,[$kernelrelease])
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    70
AC_SUBST(LINUX_KERNEL_VERSION,[$linuxversion])
69d05643041f Improved installation, added quick modules_install target.
Florian Pose <fp@igh-essen.com>
parents: 471
diff changeset
    71
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
    72
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
    73
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    74
#------------------------------------------------------------------------------
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
    75
# 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
    76
#------------------------------------------------------------------------------
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
    77
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
    78
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
    79
    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
    80
        [--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
    81
        [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
    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
    [
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
        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
    85
    ],
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
    [
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
        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
    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
)
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
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
    92
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
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
    94
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
    95
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
    96
    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
    97
        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
    98
    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
    99
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
   100
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
   101
    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
   102
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
   103
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
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
   105
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
#------------------------------------------------------------------------------
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
# 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
   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
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
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
   111
    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
   112
        [--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
   113
        [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
   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
    [
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
        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
   117
    ],
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
    [
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
        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
   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
)
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
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
   124
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
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
   126
    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
   127
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
   128
    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
   129
        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
   130
    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
   131
    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
   132
    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
   133
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
   134
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
#------------------------------------------------------------------------------
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
# 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
   137
#------------------------------------------------------------------------------
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
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
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
   140
    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
   141
        [--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
   142
        [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
   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
    [
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
        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
   146
    ],
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
    [
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
        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
   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
)
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
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
   153
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
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
   155
    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
   156
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
   157
    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
   158
        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
   159
    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
   160
    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
   161
    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
   162
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
   163
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
#------------------------------------------------------------------------------
392
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   165
# Debug interface
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   166
#------------------------------------------------------------------------------
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   167
471
0a6bd71bf4d3 Fixed debug interfaces.
Florian Pose <fp@igh-essen.com>
parents: 468
diff changeset
   168
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
   169
    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
   170
                   [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
   171
    [
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   172
        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
   173
            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
   174
                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
   175
                ;;
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   176
            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
   177
                ;;
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   178
            *) 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
   179
                ;;
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   180
        esac
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   181
    ],
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   182
    [dbg=0]
392
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   183
)
440
16fddae16c94 Altered configure --with-linux parameter to --with-linux-dir; removed depmod call.
Florian Pose <fp@igh-essen.com>
parents: 393
diff changeset
   184
392
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   185
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
   186
AC_SUBST([EC_DBG_IF],${dbg})
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   187
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   188
#------------------------------------------------------------------------------
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   189
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
   190
# 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
   191
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
   192
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
   193
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
   194
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
   195
# 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
   196
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
   197
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
   198
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
   199
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
   200
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
   201
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
#------------------------------------------------------------------------------
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
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
   204
AC_CONFIG_FILES([
392
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   205
        Makefile
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   206
        master/Makefile
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
   207
        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
   208
        script/Makefile
387
e6e708a5d502 Improved autotools files.
Florian Pose <fp@igh-essen.com>
parents: 385
diff changeset
   209
        include/Makefile
393
9cfbb344adc0 Distribution makefile for examples.
Florian Pose <fp@igh-essen.com>
parents: 392
diff changeset
   210
        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
   211
        examples/mini/Makefile
387
e6e708a5d502 Improved autotools files.
Florian Pose <fp@igh-essen.com>
parents: 385
diff changeset
   212
        examples/rtai/Makefile
e6e708a5d502 Improved autotools files.
Florian Pose <fp@igh-essen.com>
parents: 385
diff changeset
   213
        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
   214
])
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   215
AC_OUTPUT
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   216
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   217
#------------------------------------------------------------------------------