configure.ac
author Florian Pose <fp@igh-essen.com>
Tue, 17 Oct 2006 07:30:01 +0000
changeset 401 484e248e94de
parent 393 9cfbb344adc0
child 440 16fddae16c94
permissions -rw-r--r--
Removed varsized_fields II
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])
392
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
     8
AM_INIT_AUTOMAKE([-Wall -Werror foreign 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
#------------------------------------------------------------------------------
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    14
# Linux sources
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    15
#------------------------------------------------------------------------------
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    16
367
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    17
AC_ARG_WITH([linux],
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    18
    AC_HELP_STRING(
367
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    19
        [--with-linux=<version>],
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    20
        [Linux kernel version @<:@running kernel@:>@]
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    21
    ),
368
5526520f323f Fixed --with-linux switch.
Florian Pose <fp@igh-essen.com>
parents: 367
diff changeset
    22
    [version=[$withval]],
5526520f323f Fixed --with-linux switch.
Florian Pose <fp@igh-essen.com>
parents: 367
diff changeset
    23
    [version=[`uname -r`]]
367
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    24
)
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    25
367
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    26
AC_MSG_CHECKING([for Linux kernel])
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    27
modulesdir=/lib/modules/${version}
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    28
if test \! -d ${modulesdir} || test \! -d ${modulesdir}/build; then
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    29
   echo
367
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    30
   AC_MSG_ERROR([Invalid modules directory ${modulesdir}])
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    31
fi
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    32
sourcedir=`cd ${modulesdir}/build && pwd -P`
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    33
if test \! -r ${sourcedir}/Makefile; then
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    34
   echo
373
c9cb34469c74 Minor changes.
Florian Pose <fp@igh-essen.com>
parents: 368
diff changeset
    35
   AC_MSG_ERROR([No Linux kernel sources in $sourcedir])
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    36
fi
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    37
367
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    38
AC_SUBST(LINUX_KERNEL_VERSION,[$version])
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    39
AC_SUBST(LINUX_SOURCE_DIR,[$sourcedir])
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    40
AC_SUBST(LINUX_MODULES_DIR,[$modulesdir])
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    41
367
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    42
AC_MSG_RESULT($LINUX_KERNEL_VERSION)
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    43
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    44
#------------------------------------------------------------------------------
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    45
# Depmod
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    46
#------------------------------------------------------------------------------
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    47
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    48
AC_PATH_PROG([DEPMOD], [depmod],, [$PATH:/sbin:/usr/sbin:/usr/local/sbin])
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    49
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    50
if test -z "$DEPMOD"; then
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    51
   AC_MSG_WARN([depmod was not found!]);
e85e3143dc8d Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents: 365
diff changeset
    52
fi
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    53
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    54
#------------------------------------------------------------------------------
392
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    55
# Debug interface
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    56
#------------------------------------------------------------------------------
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    57
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    58
AC_ARG_ENABLE([debug-if],
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    59
		AS_HELP_STRING([--enable-dbg-if],
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    60
						[Create a debug interface for each master @<:@NO@:>@]),
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    61
		[case "${enableval}" in
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    62
			  yes) dbg=1
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    63
				   AC_DEFINE([EC_DBG_IF], [1], [Debug interfaces enabled])
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    64
				   ;;
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    65
			  no)  dbg=0
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    66
				   ;;
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    67
			  *)   AC_MSG_ERROR([Invalid value for --enable-dbg-if])
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    68
				   ;;
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    69
		esac],
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    70
		[dbg=0]
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    71
)
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    72
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
    73
AC_SUBST([EC_DBG_IF],${dbg})
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    74
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    75
#------------------------------------------------------------------------------
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    76
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
    77
AC_CONFIG_FILES([
392
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    78
        Makefile
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    79
        master/Makefile
eaee3c8d6ae0 Debug interfaces not compiled by default.
Florian Pose <fp@igh-essen.com>
parents: 387
diff changeset
    80
        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
    81
        script/Makefile
387
e6e708a5d502 Improved autotools files.
Florian Pose <fp@igh-essen.com>
parents: 385
diff changeset
    82
        include/Makefile
393
9cfbb344adc0 Distribution makefile for examples.
Florian Pose <fp@igh-essen.com>
parents: 392
diff changeset
    83
        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
    84
        examples/mini/Makefile
387
e6e708a5d502 Improved autotools files.
Florian Pose <fp@igh-essen.com>
parents: 385
diff changeset
    85
        examples/rtai/Makefile
e6e708a5d502 Improved autotools files.
Florian Pose <fp@igh-essen.com>
parents: 385
diff changeset
    86
        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
    87
])
365
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    88
AC_OUTPUT
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    89
7aede8ed6025 Corrected autotools.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    90
#------------------------------------------------------------------------------