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