1 | dnl aclocal.m4 generated automatically by aclocal 1.2 |
---|
2 | |
---|
3 | dnl $Id$ |
---|
4 | |
---|
5 | dnl macro to detect mkdir |
---|
6 | AC_DEFUN(RTEMS_PATH_MKDIR, |
---|
7 | [AC_PATH_PROG(MKDIR,mkdir) |
---|
8 | ]) |
---|
9 | |
---|
10 | dnl macro to check for mkdir -p |
---|
11 | AC_DEFUN(RTEMS_PROG_MKDIR_P, |
---|
12 | [ |
---|
13 | AC_REQUIRE([RTEMS_PATH_MKDIR]) |
---|
14 | AC_MSG_CHECKING([for working $MKDIR -p]) |
---|
15 | AC_CACHE_VAL(rtems_cv_prog_mkdir_p, |
---|
16 | [rm -rf conftestdata |
---|
17 | if $MKDIR -p conftestdata 2>/dev/null ;then |
---|
18 | rtems_cv_prog_MKDIR_P="yes" |
---|
19 | else |
---|
20 | rtems_cv_prog_MKDIR_P="no" |
---|
21 | fi])dnl |
---|
22 | rm -rf conftestdata |
---|
23 | AC_MSG_RESULT($rtems_cv_prog_MKDIR_P) |
---|
24 | ]) |
---|
25 | |
---|
26 | dnl macro to check for mkdir -m 0755 |
---|
27 | AC_DEFUN(RTEMS_PROG_MKDIR_M, |
---|
28 | [ |
---|
29 | AC_REQUIRE([RTEMS_PATH_MKDIR]) |
---|
30 | AC_MSG_CHECKING([for working $MKDIR -m 0755]) |
---|
31 | AC_CACHE_VAL(rtems_cv_prog_MKDIR_P, |
---|
32 | [rm -rf conftestdata |
---|
33 | if $MKDIR -m 0775 conftestdata 2>/dev/null; then |
---|
34 | rtems_cv_prog_MKDIR_M="yes" |
---|
35 | else |
---|
36 | rtems_cv_prog_MKDIR_M="no" |
---|
37 | fi])dnl |
---|
38 | rm -rf conftestdata |
---|
39 | AC_MSG_RESULT($rtems_cv_prog_MKDIR_M) |
---|
40 | ]) |
---|
41 | |
---|
42 | |
---|
43 | dnl $Id$ |
---|
44 | |
---|
45 | dnl canonicalize target name |
---|
46 | dnl NOTE: Most rtems targets do not fullfil autoconf's |
---|
47 | dnl target naming conventions "processor-vendor-os" |
---|
48 | dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them |
---|
49 | dnl and we have to fix it for rtems ourselves |
---|
50 | |
---|
51 | AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU, |
---|
52 | [AC_MSG_CHECKING(rtems target cpu) |
---|
53 | changequote(<<, >>)dnl |
---|
54 | target_cpu=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'` |
---|
55 | changequote([, ])dnl |
---|
56 | AC_MSG_RESULT($target_cpu) |
---|
57 | ]) |
---|
58 | |
---|
59 | dnl Set program_prefix |
---|
60 | dnl |
---|
61 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
62 | dnl Extracted from configure |
---|
63 | |
---|
64 | AC_DEFUN(RTEMS_TOOL_PREFIX, |
---|
65 | [AC_REQUIRE([AC_CANONICAL_TARGET])dnl |
---|
66 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl |
---|
67 | |
---|
68 | if [[ "${program_prefix}" = "NONE" ]] ; then |
---|
69 | if [[ "${target}" = "${host}" ]] ; then |
---|
70 | program_prefix= |
---|
71 | else |
---|
72 | program_prefix=${target}- |
---|
73 | fi |
---|
74 | fi |
---|
75 | ]) |
---|
76 | |
---|
77 | dnl |
---|
78 | dnl $Id$ |
---|
79 | dnl |
---|
80 | dnl Check for target gcc |
---|
81 | dnl |
---|
82 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
83 | dnl Completely reworked |
---|
84 | |
---|
85 | AC_DEFUN(RTEMS_PROG_CC, |
---|
86 | [ |
---|
87 | AC_BEFORE([$0], [AC_PROG_CPP])dnl |
---|
88 | AC_BEFORE([$0], [AC_PROG_CC])dnl |
---|
89 | AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl |
---|
90 | |
---|
91 | dnl Only accept gcc and cc |
---|
92 | dnl NOTE: This might be too restrictive for native compilation |
---|
93 | AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc ) |
---|
94 | test -z "$CC_FOR_TARGET" \ |
---|
95 | && AC_MSG_ERROR([no acceptable cc found in \$PATH]) |
---|
96 | |
---|
97 | dnl backup |
---|
98 | rtems_save_CC=$CC |
---|
99 | rtems_save_CFLAGS=$CFLAGS |
---|
100 | |
---|
101 | dnl temporarily set CC |
---|
102 | CC=$CC_FOR_TARGET |
---|
103 | |
---|
104 | AC_PROG_CC_WORKS |
---|
105 | AC_PROG_CC_GNU |
---|
106 | |
---|
107 | if test $ac_cv_prog_gcc = yes; then |
---|
108 | GCC=yes |
---|
109 | dnl Check whether -g works, even if CFLAGS is set, in case the package |
---|
110 | dnl plays around with CFLAGS (such as to build both debugging and |
---|
111 | dnl normal versions of a library), tasteless as that idea is. |
---|
112 | ac_test_CFLAGS="${CFLAGS+set}" |
---|
113 | ac_save_CFLAGS="$CFLAGS" |
---|
114 | CFLAGS= |
---|
115 | AC_PROG_CC_G |
---|
116 | if test "$ac_test_CFLAGS" = set; then |
---|
117 | CFLAGS="$ac_save_CFLAGS" |
---|
118 | elif test $ac_cv_prog_cc_g = yes; then |
---|
119 | CFLAGS="-g -O2" |
---|
120 | else |
---|
121 | CFLAGS="-O2" |
---|
122 | fi |
---|
123 | else |
---|
124 | GCC= |
---|
125 | test "${CFLAGS+set}" = set || CFLAGS="-g" |
---|
126 | fi |
---|
127 | |
---|
128 | rtems_cv_prog_gcc=$ac_cv_prog_gcc |
---|
129 | rtems_cv_prog_cc_g=$ac_cv_prog_cc_g |
---|
130 | rtems_cv_prog_cc_works=$ac_cv_prog_cc_works |
---|
131 | rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross |
---|
132 | |
---|
133 | dnl restore initial values |
---|
134 | CC=$rtems_save_CC |
---|
135 | CFLAGS=$rtems_save_CFLAGS |
---|
136 | |
---|
137 | unset ac_cv_prog_gcc |
---|
138 | unset ac_cv_prog_cc_g |
---|
139 | unset ac_cv_prog_cc_works |
---|
140 | unset ac_cv_prog_cc_cross |
---|
141 | ]) |
---|
142 | |
---|
143 | dnl |
---|
144 | dnl $Id$ |
---|
145 | dnl |
---|
146 | dnl Check whether the target compiler accepts -specs |
---|
147 | dnl |
---|
148 | dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de |
---|
149 | dnl |
---|
150 | |
---|
151 | AC_DEFUN(RTEMS_GCC_SPECS, |
---|
152 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
153 | AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs, |
---|
154 | [touch confspec |
---|
155 | echo 'void f(){}' >conftest.c |
---|
156 | if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then |
---|
157 | rtems_cv_gcc_specs=yes |
---|
158 | else |
---|
159 | rtems_cv_gcc_specs=no |
---|
160 | fi |
---|
161 | rm -f confspec conftest* |
---|
162 | ])]) |
---|
163 | |
---|
164 | dnl |
---|
165 | dnl $Id$ |
---|
166 | dnl |
---|
167 | dnl Check whether the target compiler accepts -pipe |
---|
168 | dnl |
---|
169 | dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de |
---|
170 | dnl |
---|
171 | |
---|
172 | AC_DEFUN(RTEMS_GCC_PIPE, |
---|
173 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
174 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
175 | AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe, |
---|
176 | [ |
---|
177 | case "$host_os" in |
---|
178 | cygwin32*) |
---|
179 | rtems_cv_gcc_pipe=no |
---|
180 | ;; |
---|
181 | *) |
---|
182 | echo 'void f(){}' >conftest.c |
---|
183 | if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then |
---|
184 | rtems_cv_gcc_pipe=yes |
---|
185 | else |
---|
186 | rtems_cv_gcc_pipe=no |
---|
187 | fi |
---|
188 | rm -f conftest* |
---|
189 | ;; |
---|
190 | esac |
---|
191 | ]) |
---|
192 | ]) |
---|
193 | |
---|
194 | dnl |
---|
195 | dnl $Id$ |
---|
196 | dnl |
---|
197 | dnl Check for target g++ |
---|
198 | dnl |
---|
199 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
200 | dnl Completely reworked |
---|
201 | |
---|
202 | AC_DEFUN(RTEMS_PROG_CXX, |
---|
203 | [ |
---|
204 | AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl |
---|
205 | AC_BEFORE([$0], [AC_PROG_CXX])dnl |
---|
206 | AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl |
---|
207 | |
---|
208 | dnl Only accept g++ and c++ |
---|
209 | dnl NOTE: This might be too restrictive for native compilation |
---|
210 | AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++) |
---|
211 | test -z "$CXX_FOR_TARGET" \ |
---|
212 | && AC_MSG_ERROR([no acceptable c++ found in \$PATH]) |
---|
213 | |
---|
214 | dnl backup |
---|
215 | rtems_save_CXX=$CXX |
---|
216 | rtems_save_CXXFLAGS=$CXXFLAGS |
---|
217 | |
---|
218 | dnl temporarily set CXX |
---|
219 | CXX=$CXX_FOR_TARGET |
---|
220 | |
---|
221 | AC_PROG_CXX_WORKS |
---|
222 | AC_PROG_CXX_GNU |
---|
223 | |
---|
224 | if test $ac_cv_prog_gxx = yes; then |
---|
225 | GXX=yes |
---|
226 | dnl Check whether -g works, even if CXXFLAGS is set, in case the package |
---|
227 | dnl plays around with CXXFLAGS (such as to build both debugging and |
---|
228 | dnl normal versions of a library), tasteless as that idea is. |
---|
229 | ac_test_CXXFLAGS="${CXXFLAGS+set}" |
---|
230 | ac_save_CXXFLAGS="$CXXFLAGS" |
---|
231 | CXXFLAGS= |
---|
232 | AC_PROG_CXX_G |
---|
233 | if test "$ac_test_CXXFLAGS" = set; then |
---|
234 | CXXFLAGS="$ac_save_CXXFLAGS" |
---|
235 | elif test $ac_cv_prog_cxx_g = yes; then |
---|
236 | CXXFLAGS="-g -O2" |
---|
237 | else |
---|
238 | CXXFLAGS="-O2" |
---|
239 | fi |
---|
240 | else |
---|
241 | GXX= |
---|
242 | test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" |
---|
243 | fi |
---|
244 | |
---|
245 | rtems_cv_prog_gxx=$ac_cv_prog_gxx |
---|
246 | rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g |
---|
247 | rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works |
---|
248 | rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross |
---|
249 | |
---|
250 | CXX=$rtems_save_CXX |
---|
251 | CXXFLAGS=$rtems_save_CXXFLAGS |
---|
252 | |
---|
253 | dnl restore initial values |
---|
254 | unset ac_cv_prog_gxx |
---|
255 | unset ac_cv_prog_cc_g |
---|
256 | unset ac_cv_prog_cxx_works |
---|
257 | unset ac_cv_prog_cxx_cross |
---|
258 | ]) |
---|
259 | |
---|
260 | dnl $Id$ |
---|
261 | dnl |
---|
262 | dnl Set target tools |
---|
263 | dnl |
---|
264 | dnl 98/02/12 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
265 | dnl |
---|
266 | |
---|
267 | AC_DEFUN(RTEMS_CANONICALIZE_TOOLS, |
---|
268 | [AC_REQUIRE([RTEMS_PROG_CC])dnl |
---|
269 | if test "$rtems_cv_prog_gcc" = "yes" ; then |
---|
270 | dnl We are using gcc, now ask it about its tools |
---|
271 | dnl Necessary if gcc was configured to use the target's native tools |
---|
272 | dnl or uses prefixes for gnutools (e.g. gas instead of as) |
---|
273 | AR_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=ar` |
---|
274 | AS_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=as` |
---|
275 | LD_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=ld` |
---|
276 | NM_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=nm` |
---|
277 | RANLIB_FOR_TARGET=`$CC_FOR_TARGET --print-prog-name=ranlib` |
---|
278 | fi |
---|
279 | |
---|
280 | dnl check whether the tools exist |
---|
281 | dnl FIXME: What shall be done if they don't exist? |
---|
282 | |
---|
283 | dnl FIXME: This may fail if the compiler has not been recognized as gcc |
---|
284 | dnl and uses tools with different names |
---|
285 | AC_PATH_PROG(AR_FOR_TARGET,"$program_prefix"ar,no) |
---|
286 | AC_PATH_PROG(AS_FOR_TARGET,"$program_prefix"as,no) |
---|
287 | AC_PATH_PROG(NM_FOR_TARGET,"$program_prefix"nm,no) |
---|
288 | AC_PATH_PROG(LD_FOR_TARGET,"$program_prefix"ld,no) |
---|
289 | |
---|
290 | dnl NOTE: This is doubtful, but should not disturb all current rtems' |
---|
291 | dnl targets (remark: solaris fakes ranlib!!) |
---|
292 | AC_PATH_PROG(RANLIB_FOR_TARGET,"$program_prefix"ranlib,no) |
---|
293 | |
---|
294 | dnl NOTE: These may not be available, if not using gnutools |
---|
295 | AC_PATH_PROG(OBJCOPY_FOR_TARGET,"$program_prefix"objcopy,no) |
---|
296 | AC_PATH_PROG(SIZE_FOR_TARGET,"$program_prefix"size,no) |
---|
297 | ]) |
---|
298 | |
---|
299 | dnl $Id$ |
---|
300 | |
---|
301 | dnl RTEMS_CHECK_MAKEFILE(path) |
---|
302 | dnl Search for Makefile.in's within the directory starting |
---|
303 | dnl at path and append an entry for Makefile to global variable |
---|
304 | dnl "makefiles" (from configure.in) for each Makefile.in found |
---|
305 | dnl |
---|
306 | AC_DEFUN(RTEMS_CHECK_MAKEFILE, |
---|
307 | [RTEMS_CHECK_FILES_IN($1,Makefile,makefiles) |
---|
308 | ]) |
---|
309 | |
---|
310 | dnl $Id$ |
---|
311 | |
---|
312 | dnl RTEMS_CHECK_FILES_IN(path,file,var) |
---|
313 | dnl path .. path relative to srcdir, where to start searching for files |
---|
314 | dnl file .. name of the files to search for |
---|
315 | dnl var .. shell variable to append files found |
---|
316 | AC_DEFUN(RTEMS_CHECK_FILES_IN, |
---|
317 | [ |
---|
318 | AC_MSG_CHECKING(for $2.in in $1) |
---|
319 | if test -d $srcdir/$1; then |
---|
320 | rtems_av_save_dir=`pwd`; |
---|
321 | cd $srcdir; |
---|
322 | rtems_av_tmp=`find $1 -name "$2.in" -print | sed "s/$2\.in/%/" | sort | sed "s/%/$2/"` |
---|
323 | $3="$$3 $rtems_av_tmp"; |
---|
324 | cd $rtems_av_save_dir; |
---|
325 | AC_MSG_RESULT(done) |
---|
326 | else |
---|
327 | AC_MSG_RESULT(no) |
---|
328 | fi |
---|
329 | ]) |
---|
330 | |
---|
331 | |
---|