source: rtems/cpukit/configure.ac @ 6e46fa73

4.104.114.84.95
Last change on this file since 6e46fa73 was 6e46fa73, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/18/06 at 03:42:04

Use rtems_cv_HAS_NETWORKING instead of HAS_NETWORKING.

  • Property mode set to 100644
File size: 7.9 KB
Line 
1## Process this file with autoconf to produce a configure script.
2##
3## $Id$
4
5AC_PREREQ(2.60)
6AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
7AC_CONFIG_SRCDIR([score])
8RTEMS_TOP([..],[])
9
10RTEMS_CANONICAL_TARGET_CPU
11
12AM_INIT_AUTOMAKE([no-define nostdinc subdir-objects foreign 1.10])
13AM_MAINTAINER_MODE
14
15RTEMS_ENABLE_MULTILIB
16RTEMS_ENABLE_MULTIPROCESSING
17RTEMS_ENABLE_POSIX
18RTEMS_ENABLE_ITRON
19RTEMS_ENABLE_RTEMS_DEBUG
20RTEMS_ENABLE_NETWORKING
21
22RTEMS_ENV_RTEMSCPU
23RTEMS_CHECK_RTEMS_DEBUG
24
25# Is this a supported CPU?
26AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
27if test -d "$srcdir/score/cpu/$RTEMS_CPU"; then
28  AC_MSG_RESULT(yes)
29else
30  AC_MSG_ERROR(no)
31fi
32
33RTEMS_PROG_CC_FOR_TARGET([-fasm])
34RTEMS_PROG_CCAS
35RTEMS_CANONICALIZE_TOOLS
36AM_PROG_CC_C_O
37AC_PROG_RANLIB
38
39RTEMS_CHECK_NEWLIB
40
41AC_ARG_ENABLE([deprecated],
42[AS_HELP_STRING(--enable-deprecated,allow using deprecated files)],
43[case "${enable_deprecated}" in
44  yes) ;;
45  no) ;;
46  *) enable_deprecated=no ;;
47esac],[enable_deprecated=no])
48AM_CONDITIONAL([DEPRECATED],[test "$enable_deprecated" = "yes"])
49
50AS_IF([ test "$enable_deprecated" = "yes" ],[
51AC_DEFINE_UNQUOTED([RTEMS_DEPRECATED_TYPES],[1],
52  [whether to support deprecated types])
53])
54
55# HACK: We should use a feature-based configuration.
56AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
57# HACK: silently accept --enable-unixlib
58  test -n "${enable_unixlib}" || enable_unixlib="yes"
59])
60
61# BSD-isms, used throughout the sources
62# Not really used by this configure script
63# FIXME: They should be eliminated if possible.
64AC_CHECK_FUNCS([strsep strcasecmp snprintf])
65AC_CHECK_FUNCS([bcopy bcmp])
66AC_CHECK_FUNCS([isascii fileno])
67
68## Check if the installed toolchain has these headers
69AC_CHECK_HEADER([tar.h])
70
71## BSD-ism, should not be used in RTEMS,
72## nevertheless it still is.
73AC_CHECK_HEADER([sys/errno.h],[],
74  [AC_MSG_ERROR([Missing required header sys/errno.h])])
75
76## if libc provides stdint.h, use it.
77AS_IF([test x"${ac_cv_header_stdint_h}" = xyes],
78[RTEMS_USES_STDINT_H=yes],
79[RTEMS_USES_STDINT_H=no])
80
81## error out if libc doesn't at least provide inttypes.h
82AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
83[AC_MSG_ERROR([Required header inttypes.h not found])])
84
85AC_CHECK_TYPES([ uint8_t,  int8_t])
86AC_CHECK_TYPES([uint16_t, int16_t])
87AC_CHECK_TYPES([uint32_t, int32_t])
88AC_CHECK_TYPES([uint64_t, int64_t])
89
90RTEMS_CHECK_MULTIPROCESSING
91RTEMS_CHECK_POSIX_API
92RTEMS_CHECK_ITRON_API
93RTEMS_CHECK_NETWORKING
94
95AS_IF([test x"${RTEMS_USE_NEWLIB}" = xyes],
96[RTEMS_USES_TAR_H=yes],
97[RTEMS_USES_TAR_H=$ac_cv_header_tar_h])
98
99AS_IF([test x"${RTEMS_CPU}" = x"unix"],[
100## FIXME: This check is doubtful
101AS_IF([test "$HAS_MP" = "yes"],
102  [RTEMS_CHECK_SYSV_UNIX])
103
104## The code fragment below had been used in tools/cpu/unix/gensize.c.
105## FIXME:
106## * The pad very likely is not necessary.
107AC_CHECK_SIZEOF([CPU_CONTEXT],[],[
108#include <stdio.h>
109#include <setjmp.h>
110
111typedef struct {
112  jmp_buf     regs;
113  int         isr_level;
114  int         pad[4]; /* just in case */
115} CPU_CONTEXT;
116])
117])
118
119cat >>cpuopts.tmp <<\_ACEOF
120/**
121 * @file rtems/score/cpuopts.h
122 */
123/* target cpu dependent options file */
124/* automatically generated -- DO NOT EDIT!! */
125#ifndef _RTEMS_SCORE_CPUOPTS_H
126#define _RTEMS_SCORE_CPUOPTS_H
127_ACEOF
128
129RTEMS_CPUOPT([RTEMS_DEBUG],
130  [test x"${enable_rtems_debug}" = x"yes"],
131  [1],
132  [if RTEMS_DEBUG is enabled])
133
134RTEMS_CPUOPT([RTEMS_ITRON_API],
135  [test x"$rtems_cv_HAS_ITRON_API" = x"yes"],
136  [1],
137  [if itron api is supported])
138
139RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
140  [test x"$enable_multiprocessing" = xyes],
141  [1],
142  [if multiprocessing is enabled])
143
144RTEMS_CPUOPT([RTEMS_NEWLIB],
145  [test x"$RTEMS_USE_NEWLIB" = xyes],
146  [1],
147  [if using newlib])
148
149RTEMS_CPUOPT([RTEMS_POSIX_API],
150  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
151  [1],
152  [if posix api is supported])
153
154RTEMS_CPUOPT([RTEMS_NETWORKING],
155  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
156  [1],
157  [if networking is enabled])
158
159RTEMS_CPUOPT([RTEMS_UNIX],
160  [test x"$RTEMS_CPU" = xunix],
161  [1],
162  [to indicate RTEMS unix])
163
164RTEMS_CPUOPT([RTEMS_UNIXLIB],
165  [test x"${enable_unixlib}" = xyes],
166  [1],
167  [to indicate RTEMS using RTEMS's unixlib])
168
169RTEMS_CPUOPT([RTEMS_USES_STDINT_H],
170  [test x"${RTEMS_USES_STDINT_H}" = x"yes"],
171  [1],
172  [if RTEMS uses stdint.h])
173
174RTEMS_CPUOPT([RTEMS_USES_TAR_H],
175  [test x"${RTEMS_USES_TAR_H}" = x"yes"],
176  [1],
177  [if RTEMS uses tar.h])
178
179RTEMS_CPUOPT([RTEMS_VERSION],
180  [true],
181  ["]_RTEMS_VERSION["],
182  [RTEMS version string])
183
184RTEMS_CPUOPT([SIZEOF_CPU_CONTEXT],
185  [test x"$RTEMS_CPU" = x"unix"],
186  [$ac_cv_sizeof_CPU_CONTEXT],
187  [The size of a 'CPU_CONTEXT', as computed by sizeof])
188
189cat >>cpuopts.tmp <<\_ACEOF
190
191#endif /* _RTEMS_SCORE_CPUOPTS_H */
192_ACEOF
193
194AS_MKDIR_P(score/include/rtems/score)
195AS_IF([test -f score/include/rtems/score/cpuopts.h],
196[
197  AS_IF([cmp -s score/include/rtems/score/cpuopts.h cpuopts.tmp 2>/dev/null],
198  [
199    AC_MSG_NOTICE([score/include/rtems/score/cpuopts.h is unchanged])
200    rm -f cpuopts.tmp
201  ],[
202    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
203    rm -f score/include/rtems/score/cpuopts.h
204    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
205  ])
206],[
207    AC_MSG_NOTICE([creating score/include/rtems/score/cpuopts.h])
208    rm -f score/include/rtems/score/cpuopts.h
209    mv cpuopts.tmp score/include/rtems/score/cpuopts.h
210])
211
212AC_ENABLE_MULTILIB([Makefile],[..])
213
214# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
215AC_MSG_CHECKING([for assignable stdio])
216AC_COMPILE_IFELSE(
217  [AC_LANG_PROGRAM(
218    [#include <stdio.h>],
219    [stdin = fopen("/tmp", "r")])],
220  [HAVE_ASSIGNABLE_STDIO=yes],
221  [HAVE_ASSIGNABLE_STDIO=no])
222AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
223
224# libmisc/serdbg exploits weak symbols
225RTEMS_CHECK_GCC_WEAK
226
227AC_CHECK_HEADERS([sys/cdefs.h],[NEED_SYS_CDEFS_H=no],[NEED_SYS_CDEFS_H=yes])
228AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes])
229
230# FIXME: These checks are only in here to provide
231# configuration-time diagnostics and are not really used.
232AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
233AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
234
235## BSD-ism, excluded from POSIX, but available on most platforms
236AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
237
238## Check if libc provides BSD's strlcpy/strlcat
239AC_CHECK_FUNCS(strlcpy strlcat)
240
241
242# ... far too many conditionals ...
243AM_CONDITIONAL(LIBRPC,[test "$rtems_cv_HAS_NETWORKING" = "yes"])
244AM_CONDITIONAL(UNIX,[test x"${RTEMS_CPU}" = x"unix"])
245AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
246
247AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
248
249AM_CONDITIONAL(HAS_POSIX,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
250AM_CONDITIONAL(LIBITRON,test x"$rtems_cv_HAS_ITRON_API" = x"yes")
251AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
252
253AM_CONDITIONAL([NEED_SYS_CDEFS_H],[test x"$NEED_SYS_CDEFS_H" = x"yes"])
254AM_CONDITIONAL([NEED_SYS_QUEUE_H],[test x"$NEED_SYS_QUEUE_H" = x"yes"])
255
256AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
257AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
258
259AM_CONDITIONAL([LIBDOSFS],[dnl
260test x"${RTEMS_CPU}" != x"unix" \
261&& test x"$ac_cv_type_uint8_t" = xyes \
262&& test x"$ac_cv_type_uint16_t" = xyes])
263
264AC_CONFIG_HEADER(config.h)
265
266# Explicitly list all Makefiles here
267AC_CONFIG_FILES([
268Makefile
269rtems/Makefile
270sapi/Makefile
271score/Makefile
272score/cpu/Makefile
273score/cpu/arm/Makefile
274score/cpu/bfin/Makefile
275score/cpu/avr/Makefile
276score/cpu/c4x/Makefile
277score/cpu/h8300/Makefile
278score/cpu/i386/Makefile
279score/cpu/m68k/Makefile
280score/cpu/mips/Makefile
281score/cpu/nios2/Makefile
282score/cpu/powerpc/Makefile
283score/cpu/sh/Makefile
284score/cpu/sparc/Makefile
285score/cpu/unix/Makefile
286score/cpu/no_cpu/Makefile
287posix/Makefile
288itron/Makefile
289libblock/Makefile
290libfs/Makefile
291libcsupport/Makefile
292libnetworking/Makefile
293librpc/Makefile
294libmisc/Makefile
295libi2c/Makefile
296zlib/Makefile
297httpd/Makefile
298ftpd/Makefile
299telnetd/Makefile
300pppd/Makefile
301wrapup/Makefile])
302
303AC_CONFIG_COMMANDS([preinstall-stamp],
304[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
305[MAKE=${MAKE}
306with_multisubdir="$with_multisubdir"])
307
308AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.