1 | dnl aclocal.m4 generated automatically by aclocal 1.4 |
---|
2 | |
---|
3 | dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. |
---|
4 | dnl This file is free software; the Free Software Foundation |
---|
5 | dnl gives unlimited permission to copy and/or distribute it, |
---|
6 | dnl with or without modifications, as long as this notice is preserved. |
---|
7 | |
---|
8 | dnl This program is distributed in the hope that it will be useful, |
---|
9 | dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without |
---|
10 | dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
---|
11 | dnl PARTICULAR PURPOSE. |
---|
12 | |
---|
13 | dnl $Id$ |
---|
14 | |
---|
15 | dnl |
---|
16 | dnl RTEMS_TOP($1) |
---|
17 | dnl |
---|
18 | dnl $1 .. relative path from this configure.in to the toplevel configure.in |
---|
19 | dnl |
---|
20 | AC_DEFUN(RTEMS_TOP, |
---|
21 | [dnl |
---|
22 | AC_ARG_WITH(target-subdir, |
---|
23 | [ --with-target-subdir=DIR], |
---|
24 | TARGET_SUBDIR="$withval", |
---|
25 | TARGET_SUBDIR=".") |
---|
26 | |
---|
27 | RTEMS_TOPdir="$1"; |
---|
28 | AC_SUBST(RTEMS_TOPdir) |
---|
29 | |
---|
30 | PROJECT_ROOT=`pwd`/$RTEMS_TOPdir; |
---|
31 | test "$TARGET_SUBDIR" = "." || PROJECT_ROOT="$PROJECT_ROOT/.." |
---|
32 | AC_SUBST(PROJECT_ROOT) |
---|
33 | |
---|
34 | dnl Determine RTEMS Version string from the VERSION file |
---|
35 | dnl Hopefully, Joel never changes its format ;- |
---|
36 | AC_MSG_CHECKING([for RTEMS Version]) |
---|
37 | if test -r "${srcdir}/${RTEMS_TOPdir}/VERSION"; then |
---|
38 | changequote(,)dnl |
---|
39 | RTEMS_VERSION=`grep Version ${srcdir}/${RTEMS_TOPdir}/VERSION | \ |
---|
40 | sed -e 's%RTEMS[ ]*Version[ ]*\(.*\)[ ]*%\1%g'` |
---|
41 | changequote([,])dnl |
---|
42 | else |
---|
43 | AC_MSG_ERROR(Unable to find ${RTEMS_TOPdir}/VERSION) |
---|
44 | fi |
---|
45 | if test -z "$RTEMS_VERSION"; then |
---|
46 | AC_MSG_ERROR(Unable to determine version) |
---|
47 | fi |
---|
48 | AC_MSG_RESULT($RTEMS_VERSION) |
---|
49 | |
---|
50 | RTEMS_ROOT='$(top_srcdir)'/$RTEMS_TOPdir; |
---|
51 | AC_SUBST(RTEMS_ROOT) |
---|
52 | ])dnl |
---|
53 | |
---|
54 | dnl |
---|
55 | dnl $Id$ |
---|
56 | dnl |
---|
57 | |
---|
58 | dnl canonicalize target cpu |
---|
59 | dnl NOTE: Most rtems targets do not fullfil autoconf's |
---|
60 | dnl target naming conventions "processor-vendor-os" |
---|
61 | dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them |
---|
62 | dnl and we have to fix it for rtems ourselves |
---|
63 | |
---|
64 | AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU, |
---|
65 | [ |
---|
66 | AC_REQUIRE([AC_CANONICAL_SYSTEM]) |
---|
67 | AC_MSG_CHECKING(rtems target cpu) |
---|
68 | changequote(,)dnl |
---|
69 | case "${target}" in |
---|
70 | # hpux unix port should go here |
---|
71 | i[3456]86-go32-rtems*) |
---|
72 | target_cpu=i386 |
---|
73 | ;; |
---|
74 | i[3456]86-pc-linux*) # unix "simulator" port |
---|
75 | target_cpu=unix |
---|
76 | ;; |
---|
77 | i[3456]86-*freebsd2*) # unix "simulator" port |
---|
78 | target_cpu=unix |
---|
79 | ;; |
---|
80 | no_cpu-*rtems*) |
---|
81 | target_cpu=no_cpu |
---|
82 | ;; |
---|
83 | ppc*-*rtems*) |
---|
84 | target_cpu=powerpc |
---|
85 | ;; |
---|
86 | sparc-sun-solaris*) # unix "simulator" port |
---|
87 | target_cpu=unix |
---|
88 | ;; |
---|
89 | *) |
---|
90 | target_cpu=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'` |
---|
91 | ;; |
---|
92 | esac |
---|
93 | changequote([,])dnl |
---|
94 | AC_MSG_RESULT($target_cpu) |
---|
95 | ]) |
---|
96 | |
---|
97 | # Do all the work for Automake. This macro actually does too much -- |
---|
98 | # some checks are only needed if your package does certain things. |
---|
99 | # But this isn't really a big deal. |
---|
100 | |
---|
101 | # serial 1 |
---|
102 | |
---|
103 | dnl Usage: |
---|
104 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) |
---|
105 | |
---|
106 | AC_DEFUN(AM_INIT_AUTOMAKE, |
---|
107 | [AC_REQUIRE([AC_PROG_INSTALL]) |
---|
108 | PACKAGE=[$1] |
---|
109 | AC_SUBST(PACKAGE) |
---|
110 | VERSION=[$2] |
---|
111 | AC_SUBST(VERSION) |
---|
112 | dnl test to see if srcdir already configured |
---|
113 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then |
---|
114 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) |
---|
115 | fi |
---|
116 | ifelse([$3],, |
---|
117 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) |
---|
118 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) |
---|
119 | AC_REQUIRE([AM_SANITY_CHECK]) |
---|
120 | AC_REQUIRE([AC_ARG_PROGRAM]) |
---|
121 | dnl FIXME This is truly gross. |
---|
122 | missing_dir=`cd $ac_aux_dir && pwd` |
---|
123 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) |
---|
124 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) |
---|
125 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) |
---|
126 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) |
---|
127 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) |
---|
128 | AC_REQUIRE([AC_PROG_MAKE_SET])]) |
---|
129 | |
---|
130 | # |
---|
131 | # Check to make sure that the build environment is sane. |
---|
132 | # |
---|
133 | |
---|
134 | AC_DEFUN(AM_SANITY_CHECK, |
---|
135 | [AC_MSG_CHECKING([whether build environment is sane]) |
---|
136 | # Just in case |
---|
137 | sleep 1 |
---|
138 | echo timestamp > conftestfile |
---|
139 | # Do `set' in a subshell so we don't clobber the current shell's |
---|
140 | # arguments. Must try -L first in case configure is actually a |
---|
141 | # symlink; some systems play weird games with the mod time of symlinks |
---|
142 | # (eg FreeBSD returns the mod time of the symlink's containing |
---|
143 | # directory). |
---|
144 | if ( |
---|
145 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` |
---|
146 | if test "[$]*" = "X"; then |
---|
147 | # -L didn't work. |
---|
148 | set X `ls -t $srcdir/configure conftestfile` |
---|
149 | fi |
---|
150 | if test "[$]*" != "X $srcdir/configure conftestfile" \ |
---|
151 | && test "[$]*" != "X conftestfile $srcdir/configure"; then |
---|
152 | |
---|
153 | # If neither matched, then we have a broken ls. This can happen |
---|
154 | # if, for instance, CONFIG_SHELL is bash and it inherits a |
---|
155 | # broken ls alias from the environment. This has actually |
---|
156 | # happened. Such a system could not be considered "sane". |
---|
157 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken |
---|
158 | alias in your environment]) |
---|
159 | fi |
---|
160 | |
---|
161 | test "[$]2" = conftestfile |
---|
162 | ) |
---|
163 | then |
---|
164 | # Ok. |
---|
165 | : |
---|
166 | else |
---|
167 | AC_MSG_ERROR([newly created file is older than distributed files! |
---|
168 | Check your system clock]) |
---|
169 | fi |
---|
170 | rm -f conftest* |
---|
171 | AC_MSG_RESULT(yes)]) |
---|
172 | |
---|
173 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) |
---|
174 | dnl The program must properly implement --version. |
---|
175 | AC_DEFUN(AM_MISSING_PROG, |
---|
176 | [AC_MSG_CHECKING(for working $2) |
---|
177 | # Run test in a subshell; some versions of sh will print an error if |
---|
178 | # an executable is not found, even if stderr is redirected. |
---|
179 | # Redirect stdin to placate older versions of autoconf. Sigh. |
---|
180 | if ($2 --version) < /dev/null > /dev/null 2>&1; then |
---|
181 | $1=$2 |
---|
182 | AC_MSG_RESULT(found) |
---|
183 | else |
---|
184 | $1="$3/missing $2" |
---|
185 | AC_MSG_RESULT(missing) |
---|
186 | fi |
---|
187 | AC_SUBST($1)]) |
---|
188 | |
---|
189 | AC_DEFUN(RTEMS_TOOLPATHS, |
---|
190 | [ |
---|
191 | # tooldir='$(exec_prefix)/'$target_alias |
---|
192 | # Temporary work-around until building in source tree is supported |
---|
193 | tooldir='$(PROJECT_ROOT)' |
---|
194 | AC_SUBST(tooldir) |
---|
195 | |
---|
196 | project_includedir='$(tooldir)'/include |
---|
197 | AC_SUBST(project_includedir) |
---|
198 | |
---|
199 | project_libdir='$(tooldir)/lib$(MULTISUBDIR)' |
---|
200 | AC_SUBST(project_libdir) |
---|
201 | |
---|
202 | project_bindir='$(tooldir)/bin' |
---|
203 | AC_SUBST(project_bindir) |
---|
204 | ]) |
---|
205 | |
---|