author | Florian Pose <fp@igh-essen.com> |
Mon, 09 Oct 2006 14:43:20 +0000 | |
changeset 387 | e6e708a5d502 |
parent 385 | c33367851350 |
child 392 | eaee3c8d6ae0 |
permissions | -rw-r--r-- |
365 | 1 |
#------------------------------------------------------------------------------ |
2 |
# $Id$ |
|
3 |
#------------------------------------------------------------------------------ |
|
4 |
||
5 |
AC_INIT([ethercat],[1.1],[fp@igh-essen.com]) |
|
387 | 6 |
AC_CONFIG_AUX_DIR([autoconf]) |
7 |
AC_PREFIX_DEFAULT([/opt/etherlab]) |
|
365 | 8 |
AM_INIT_AUTOMAKE([-Wall -Werror foreign dist-bzip2]) |
9 |
||
10 |
#------------------------------------------------------------------------------ |
|
11 |
# Linux sources |
|
12 |
#------------------------------------------------------------------------------ |
|
13 |
||
367
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
14 |
AC_ARG_WITH([linux], |
365 | 15 |
AC_HELP_STRING( |
367
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
16 |
[--with-linux=<version>], |
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
17 |
[Linux kernel version @<:@running kernel@:>@] |
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
18 |
), |
368 | 19 |
[version=[$withval]], |
20 |
[version=[`uname -r`]] |
|
367
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
21 |
) |
365 | 22 |
|
367
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
23 |
AC_MSG_CHECKING([for Linux kernel]) |
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
24 |
modulesdir=/lib/modules/${version} |
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
25 |
if test \! -d ${modulesdir} || test \! -d ${modulesdir}/build; then |
365 | 26 |
echo |
367
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
27 |
AC_MSG_ERROR([Invalid modules directory ${modulesdir}]) |
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
28 |
fi |
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
29 |
sourcedir=`cd ${modulesdir}/build && pwd -P` |
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
30 |
if test \! -r ${sourcedir}/Makefile; then |
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
31 |
echo |
373 | 32 |
AC_MSG_ERROR([No Linux kernel sources in $sourcedir]) |
365 | 33 |
fi |
34 |
||
367
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
35 |
AC_SUBST(LINUX_KERNEL_VERSION,[$version]) |
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
36 |
AC_SUBST(LINUX_SOURCE_DIR,[$sourcedir]) |
365 | 37 |
AC_SUBST(LINUX_MODULES_DIR,[$modulesdir]) |
38 |
||
367
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
39 |
AC_MSG_RESULT($LINUX_KERNEL_VERSION) |
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
40 |
|
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
41 |
#------------------------------------------------------------------------------ |
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
42 |
# Depmod |
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 |
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
|
46 |
|
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
47 |
if test -z "$DEPMOD"; then |
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
48 |
AC_MSG_WARN([depmod was not found!]); |
e85e3143dc8d
Autotools "--with-linux" switch; "mydist" target
Florian Pose <fp@igh-essen.com>
parents:
365
diff
changeset
|
49 |
fi |
365 | 50 |
|
51 |
#------------------------------------------------------------------------------ |
|
52 |
||
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
|
53 |
AC_CONFIG_FILES([ |
c33367851350
Added file ./bootstrap; Added $(DESTDIR) to */Makefile.am make alternate root installs possible
Richard Hacker <ha@igh-essen.com>
parents:
373
diff
changeset
|
54 |
Makefile |
c33367851350
Added file ./bootstrap; Added $(DESTDIR) to */Makefile.am make alternate root installs possible
Richard Hacker <ha@igh-essen.com>
parents:
373
diff
changeset
|
55 |
master/Makefile |
c33367851350
Added file ./bootstrap; Added $(DESTDIR) to */Makefile.am make alternate root installs possible
Richard Hacker <ha@igh-essen.com>
parents:
373
diff
changeset
|
56 |
devices/Makefile |
c33367851350
Added file ./bootstrap; Added $(DESTDIR) to */Makefile.am make alternate root installs possible
Richard Hacker <ha@igh-essen.com>
parents:
373
diff
changeset
|
57 |
script/Makefile |
387 | 58 |
include/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
|
59 |
examples/mini/Makefile |
387 | 60 |
examples/rtai/Makefile |
61 |
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
|
62 |
]) |
365 | 63 |
AC_OUTPUT |
64 |
||
65 |
#------------------------------------------------------------------------------ |