source: rtems/aclocal.m4 @ 0737710

4.104.114.84.95
Last change on this file since 0737710 was fe2401b2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/21/98 at 16:38:17

Regenerated.

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