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 | dnl Determine RTEMS Version string from the VERSION file |
---|
31 | dnl Hopefully, Joel never changes its format ;- |
---|
32 | AC_MSG_CHECKING([for RTEMS Version]) |
---|
33 | if test -r "${srcdir}/${RTEMS_TOPdir}/VERSION"; then |
---|
34 | changequote(,)dnl |
---|
35 | RTEMS_VERSION=`grep Version ${srcdir}/${RTEMS_TOPdir}/VERSION | \ |
---|
36 | sed -e 's%RTEMS[ ]*Version[ ]*\(.*\)[ ]*%\1%g'` |
---|
37 | changequote([,])dnl |
---|
38 | else |
---|
39 | AC_MSG_ERROR(Unable to find ${RTEMS_TOPdir}/VERSION) |
---|
40 | fi |
---|
41 | if test -z "$RTEMS_VERSION"; then |
---|
42 | AC_MSG_ERROR(Unable to determine version) |
---|
43 | fi |
---|
44 | AC_MSG_RESULT($RTEMS_VERSION) |
---|
45 | ])dnl |
---|
46 | |
---|
47 | # Do all the work for Automake. This macro actually does too much -- |
---|
48 | # some checks are only needed if your package does certain things. |
---|
49 | # But this isn't really a big deal. |
---|
50 | |
---|
51 | # serial 1 |
---|
52 | |
---|
53 | dnl Usage: |
---|
54 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) |
---|
55 | |
---|
56 | AC_DEFUN(AM_INIT_AUTOMAKE, |
---|
57 | [AC_REQUIRE([AC_PROG_INSTALL]) |
---|
58 | PACKAGE=[$1] |
---|
59 | AC_SUBST(PACKAGE) |
---|
60 | VERSION=[$2] |
---|
61 | AC_SUBST(VERSION) |
---|
62 | dnl test to see if srcdir already configured |
---|
63 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then |
---|
64 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) |
---|
65 | fi |
---|
66 | ifelse([$3],, |
---|
67 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) |
---|
68 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) |
---|
69 | AC_REQUIRE([AM_SANITY_CHECK]) |
---|
70 | AC_REQUIRE([AC_ARG_PROGRAM]) |
---|
71 | dnl FIXME This is truly gross. |
---|
72 | missing_dir=`cd $ac_aux_dir && pwd` |
---|
73 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) |
---|
74 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) |
---|
75 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) |
---|
76 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) |
---|
77 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) |
---|
78 | AC_REQUIRE([AC_PROG_MAKE_SET])]) |
---|
79 | |
---|
80 | # |
---|
81 | # Check to make sure that the build environment is sane. |
---|
82 | # |
---|
83 | |
---|
84 | AC_DEFUN(AM_SANITY_CHECK, |
---|
85 | [AC_MSG_CHECKING([whether build environment is sane]) |
---|
86 | # Just in case |
---|
87 | sleep 1 |
---|
88 | echo timestamp > conftestfile |
---|
89 | # Do `set' in a subshell so we don't clobber the current shell's |
---|
90 | # arguments. Must try -L first in case configure is actually a |
---|
91 | # symlink; some systems play weird games with the mod time of symlinks |
---|
92 | # (eg FreeBSD returns the mod time of the symlink's containing |
---|
93 | # directory). |
---|
94 | if ( |
---|
95 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` |
---|
96 | if test "[$]*" = "X"; then |
---|
97 | # -L didn't work. |
---|
98 | set X `ls -t $srcdir/configure conftestfile` |
---|
99 | fi |
---|
100 | if test "[$]*" != "X $srcdir/configure conftestfile" \ |
---|
101 | && test "[$]*" != "X conftestfile $srcdir/configure"; then |
---|
102 | |
---|
103 | # If neither matched, then we have a broken ls. This can happen |
---|
104 | # if, for instance, CONFIG_SHELL is bash and it inherits a |
---|
105 | # broken ls alias from the environment. This has actually |
---|
106 | # happened. Such a system could not be considered "sane". |
---|
107 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken |
---|
108 | alias in your environment]) |
---|
109 | fi |
---|
110 | |
---|
111 | test "[$]2" = conftestfile |
---|
112 | ) |
---|
113 | then |
---|
114 | # Ok. |
---|
115 | : |
---|
116 | else |
---|
117 | AC_MSG_ERROR([newly created file is older than distributed files! |
---|
118 | Check your system clock]) |
---|
119 | fi |
---|
120 | rm -f conftest* |
---|
121 | AC_MSG_RESULT(yes)]) |
---|
122 | |
---|
123 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) |
---|
124 | dnl The program must properly implement --version. |
---|
125 | AC_DEFUN(AM_MISSING_PROG, |
---|
126 | [AC_MSG_CHECKING(for working $2) |
---|
127 | # Run test in a subshell; some versions of sh will print an error if |
---|
128 | # an executable is not found, even if stderr is redirected. |
---|
129 | # Redirect stdin to placate older versions of autoconf. Sigh. |
---|
130 | if ($2 --version) < /dev/null > /dev/null 2>&1; then |
---|
131 | $1=$2 |
---|
132 | AC_MSG_RESULT(found) |
---|
133 | else |
---|
134 | $1="$3/missing $2" |
---|
135 | AC_MSG_RESULT(missing) |
---|
136 | fi |
---|
137 | AC_SUBST($1)]) |
---|
138 | |
---|
139 | # Add --enable-maintainer-mode option to configure. |
---|
140 | # From Jim Meyering |
---|
141 | |
---|
142 | # serial 1 |
---|
143 | |
---|
144 | AC_DEFUN(AM_MAINTAINER_MODE, |
---|
145 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) |
---|
146 | dnl maintainer-mode is disabled by default |
---|
147 | AC_ARG_ENABLE(maintainer-mode, |
---|
148 | [ --enable-maintainer-mode enable make rules and dependencies not useful |
---|
149 | (and sometimes confusing) to the casual installer], |
---|
150 | USE_MAINTAINER_MODE=$enableval, |
---|
151 | USE_MAINTAINER_MODE=no) |
---|
152 | AC_MSG_RESULT($USE_MAINTAINER_MODE) |
---|
153 | AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) |
---|
154 | MAINT=$MAINTAINER_MODE_TRUE |
---|
155 | AC_SUBST(MAINT)dnl |
---|
156 | ] |
---|
157 | ) |
---|
158 | |
---|
159 | # Define a conditional. |
---|
160 | |
---|
161 | AC_DEFUN(AM_CONDITIONAL, |
---|
162 | [AC_SUBST($1_TRUE) |
---|
163 | AC_SUBST($1_FALSE) |
---|
164 | if $2; then |
---|
165 | $1_TRUE= |
---|
166 | $1_FALSE='#' |
---|
167 | else |
---|
168 | $1_TRUE='#' |
---|
169 | $1_FALSE= |
---|
170 | fi]) |
---|
171 | |
---|
172 | dnl $Id$ |
---|
173 | |
---|
174 | AC_DEFUN(RTEMS_PATH_KSH, |
---|
175 | [ |
---|
176 | dnl NOTE: prefer bash over ksh over sh |
---|
177 | AC_PATH_PROGS(KSH,bash ksh sh) |
---|
178 | if test -z "$KSH"; then |
---|
179 | dnl NOTE: This cannot happen -- /bin/sh must always exist |
---|
180 | AC_MSG_ERROR( |
---|
181 | [***] |
---|
182 | [ Cannot determine a usable shell bash/ksh/sh] |
---|
183 | [ Please contact your system administrator] ); |
---|
184 | fi |
---|
185 | ]) |
---|
186 | |
---|
187 | # Like AC_CONFIG_HEADER, but automatically create stamp file. |
---|
188 | |
---|
189 | AC_DEFUN(AM_CONFIG_HEADER, |
---|
190 | [AC_PREREQ([2.12]) |
---|
191 | AC_CONFIG_HEADER([$1]) |
---|
192 | dnl When config.status generates a header, we must update the stamp-h file. |
---|
193 | dnl This file resides in the same directory as the config header |
---|
194 | dnl that is generated. We must strip everything past the first ":", |
---|
195 | dnl and everything past the last "/". |
---|
196 | AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl |
---|
197 | ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, |
---|
198 | <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, |
---|
199 | <<am_indx=1 |
---|
200 | for am_file in <<$1>>; do |
---|
201 | case " <<$>>CONFIG_HEADERS " in |
---|
202 | *" <<$>>am_file "*<<)>> |
---|
203 | echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx |
---|
204 | ;; |
---|
205 | esac |
---|
206 | am_indx=`expr "<<$>>am_indx" + 1` |
---|
207 | done<<>>dnl>>) |
---|
208 | changequote([,]))]) |
---|
209 | |
---|