source: rtems/cpukit/configure.ac @ d063e7b3

5
Last change on this file since d063e7b3 was 7a4b2645, checked in by Joel Sherrill <joel@…>, on 01/11/17 at 15:43:06

Remove obsolete RTEMS_HAVE_SYS_CPUSET_H

  • Property mode set to 100644
File size: 14.6 KB
Line 
1## Process this file with autoconf to produce a configure script.
2
3AC_PREREQ([2.69])
4AC_INIT([rtems-cpukit],[_RTEMS_VERSION],[https://devel.rtems.org/newticket])
5AC_CONFIG_SRCDIR([score])
6RTEMS_TOP([..],[])
7
8RTEMS_CANONICAL_TARGET_CPU
9
10AM_INIT_AUTOMAKE([no-define nostdinc subdir-objects foreign 1.12.2])
11AM_MAINTAINER_MODE
12
13RTEMS_ENABLE_MULTILIB
14RTEMS_ENABLE_MULTIPROCESSING
15RTEMS_ENABLE_POSIX
16RTEMS_ENABLE_CXX
17RTEMS_ENABLE_RTEMS_DEBUG
18RTEMS_ENABLE_NETWORKING
19RTEMS_ENABLE_PARAVIRT
20RTEMS_ENABLE_PROFILING
21RTEMS_ENABLE_DRVMGR
22
23RTEMS_ENV_RTEMSCPU
24RTEMS_CHECK_RTEMS_DEBUG
25
26# Is this a supported CPU?
27AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
28if test -d "$srcdir/score/cpu/$RTEMS_CPU"; then
29  AC_MSG_RESULT(yes)
30else
31  AC_MSG_ERROR(no)
32fi
33
34RTEMS_PROG_CC_FOR_TARGET
35RTEMS_PROG_CXX_FOR_TARGET
36AM_PROG_CC_C_O
37RTEMS_CANONICALIZE_TOOLS
38RTEMS_PROG_CCAS
39AC_PROG_RANLIB
40
41RTEMS_CHECK_NEWLIB
42
43# BSD-isms, used throughout the sources
44# Not really used by this configure script
45# FIXME: They should be eliminated if possible.
46AC_CHECK_FUNCS([strsep strcasecmp snprintf])
47AC_CHECK_FUNCS([strdup strndup strncasecmp])
48AC_CHECK_FUNCS([bcopy bcmp])
49AC_CHECK_FUNCS([isascii fileno])
50
51# <FIXME>
52#   Check for functions supplied by newlib >= 1.17.0
53# Newlib's posix/ directory
54AC_CHECK_FUNCS([readdir_r isatty])
55AC_CHECK_FUNCS([creat \
56  opendir closedir readdir rewinddir scandir seekdir \
57  sleep \
58  telldir \
59  usleep],,
60  [rtems_missing_func="$ac_func";break])
61AS_IF([test -n "$rtems_missing_func"],
62  AC_MSG_ERROR([Missing function $rtems_missing_func in libc])])
63AC_CHECK_FUNCS([__assert])
64AC_CHECK_FUNCS([execl execlp execle execv execvp execve])
65AC_CHECK_FUNCS([regcomp regexec regerror regfree])
66
67# Mandated by POSIX, decls not present in some versions of newlib
68AC_CHECK_DECLS([flockfile],[AC_CHECK_FUNCS([flockfile])],,[#include <stdio.h>])
69AC_CHECK_DECLS([funlockfile],[AC_CHECK_FUNCS([funlockfile])],,[#include <stdio.h>])
70AC_CHECK_DECLS([ftrylockfile],[AC_CHECK_FUNCS([ftrylockfile])],,[#include <stdio.h>])
71
72# Newlib proprietary
73AC_CHECK_HEADERS([envlock.h])
74AC_CHECK_DECLS([__env_lock],,,[#include <envlock.h>])
75AC_CHECK_DECLS([__env_unlock],,,[#include <envlock.h>])
76AC_CHECK_TYPES([struct _Thread_queue_Queue],[],[],[#include <sys/lock.h>])
77AC_CHECK_SIZEOF([pthread_spinlock_t],[],[],[#include <pthread.h>])
78
79# Mandated by POSIX, older newlibs bogusly provided CLOCK_PROCESS_CPUTIME+CLOCK_THREAD_CPUTIME
80AC_CHECK_DECL([CLOCK_PROCESS_CPUTIME_ID],[],[AC_MSG_ERROR([missing define CLOCK_PROCESS_CPUTIME_ID])],[#include <time.h>])
81AC_CHECK_DECL([CLOCK_THREAD_CPUTIME_ID],[],[AC_MSG_ERROR([missing define CLOCK_THREAD_CPUTIME_ID])],[#include <time.h>])
82
83# Mandated by POSIX, decls not present in some versions of newlib,
84# some versions stubbed in newlib's rtems crt0
85RTEMS_CHECK_FUNC([seteuid],[#include <unistd.h>])
86RTEMS_CHECK_FUNC([geteuid],[#include <unistd.h>])
87RTEMS_CHECK_FUNC([setegid],[#include <unistd.h>])
88RTEMS_CHECK_FUNC([getegid],[#include <unistd.h>])
89RTEMS_CHECK_FUNC([setuid],[#include <unistd.h>])
90RTEMS_CHECK_FUNC([getuid],[#include <unistd.h>])
91RTEMS_CHECK_FUNC([setgid],[#include <unistd.h>])
92RTEMS_CHECK_FUNC([getgid],[#include <unistd.h>])
93RTEMS_CHECK_FUNC([setsid],[#include <unistd.h>])
94RTEMS_CHECK_FUNC([getsid],[#include <unistd.h>])
95RTEMS_CHECK_FUNC([setpgid],[#include <unistd.h>])
96RTEMS_CHECK_FUNC([getpgid],[#include <unistd.h>])
97RTEMS_CHECK_FUNC([setpgrp],[#include <unistd.h>])
98RTEMS_CHECK_FUNC([getpgrp],[#include <unistd.h>])
99
100# pthread-functions not declared in some versions of newlib.
101RTEMS_CHECK_FUNC([pthread_attr_getguardsize],[#include <pthread.h>])
102RTEMS_CHECK_FUNC([pthread_attr_setguardsize],[#include <pthread.h>])
103RTEMS_CHECK_FUNC([pthread_attr_setstack],[#include <pthread.h>])
104RTEMS_CHECK_FUNC([pthread_attr_getstack],[#include <pthread.h>])
105
106# These are SMP related and were added to newlib by RTEMS.
107RTEMS_CHECK_FUNC([pthread_attr_setaffinity_np],[
108  #define _GNU_SOURCE
109  #include <pthread.h>])
110RTEMS_CHECK_FUNC([pthread_attr_getaffinity_np],[
111  #define _GNU_SOURCE
112  #include <pthread.h>])
113RTEMS_CHECK_FUNC([pthread_setaffinity_np],[
114  #define _GNU_SOURCE
115  #include <pthread.h>])
116RTEMS_CHECK_FUNC([pthread_getaffinity_np],[
117  #define _GNU_SOURCE
118  #include <pthread.h>])
119RTEMS_CHECK_FUNC([pthread_getattr_np],[
120  #define _GNU_SOURCE
121  #include <pthread.h>])
122
123# This was added to newlib in August 2014 to improve conformance.
124# Disable use of internal definition if it is present.
125RTEMS_CHECK_FUNC([sigaltstack],[
126  #define _GNU_SOURCE
127  #include <signal.h>])
128
129# Mandated by POSIX, not declared in some versions of newlib.
130AC_CHECK_DECLS([getrusage],,,[#include sys/resource.h])
131
132# Newlib's unix/ directory
133AC_CHECK_FUNCS([ttyname getcwd])
134# </FIXME>
135
136# Check if the installed toolchain provides these headers
137# and error out if not.
138AC_CHECK_HEADERS([tar.h errno.h sched.h sys/cdefs.h sys/queue.h],,
139  [rtems_missing_header="$ac_header";break])
140AS_IF([test -n "$rtems_missing_header"],
141  AC_MSG_ERROR([Missing required header $rtems_missing_header])])
142
143AC_CHECK_HEADERS([semaphore.h])
144AM_CONDITIONAL([HAVE_SEMAPHORE_H],[test x"$ac_cv_header_semaphore_h" = x"yes"])
145
146AC_CHECK_HEADERS([threads.h])
147AM_CONDITIONAL([HAVE_THREADS_H],[test x"$ac_cv_header_threads_h" = x"yes"])
148
149## error out if libc doesn't provide stdint.h
150AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
151[AC_MSG_ERROR([Required header stdint.h not found])])
152
153## error out if libc doesn't provide inttypes.h
154AS_IF([test x"${ac_cv_header_inttypes_h}" != xyes],
155[AC_MSG_ERROR([Required header inttypes.h not found])])
156
157AC_HEADER_STDBOOL
158AS_IF([test x"${ac_cv_header_stdbool_h}" != xyes],
159[AC_MSG_ERROR([No sufficient stdbool.h found])])
160
161AC_CHECK_TYPES([ uint8_t,  int8_t])
162AC_CHECK_TYPES([uint16_t, int16_t])
163AC_CHECK_TYPES([uint32_t, int32_t])
164AC_CHECK_TYPES([uint64_t, int64_t])
165AC_CHECK_TYPES([uintmax_t, intmax_t])
166AC_CHECK_TYPES([uintptr_t, intptr_t])
167
168# Some toolchain sanity checks and diagnostics
169RTEMS_CHECK_GCC_SANITY
170
171# These are conditionally defined by the toolchain
172# FIXME: we should either conditionally compile those parts in
173# RTEMS depending on them, or abort - For now, simply check.
174AC_CHECK_HEADER([pthread.h],[
175  AC_CHECK_TYPES([pthread_rwlock_t])
176  AC_CHECK_TYPES([pthread_barrier_t])
177  AC_CHECK_TYPES([pthread_spinlock_t])
178  AC_CHECK_TYPES([struct _pthread_cleanup_context],[],[AC_MSG_ERROR([struct _pthread_cleanup_context in <pthread.h> is mandatory])],[#include <pthread.h>])
179])
180
181AC_CHECK_HEADER([signal.h],[
182  AC_CHECK_TYPES([sighandler_t])
183])
184
185if test x"$RTEMS_USE_NEWLIB" = xyes ; then
186  AC_CHECK_DECLS([__getreent],[],[AC_MSG_ERROR([__getreent() in <sys/reent.h> is mandatory])],[#include <sys/reent.h>])
187fi
188
189RTEMS_CHECK_MULTIPROCESSING
190RTEMS_CHECK_POSIX_API
191RTEMS_CHECK_NETWORKING
192RTEMS_CHECK_SMP
193if test "${RTEMS_HAS_SMP}" = "yes"; then
194  AC_CHECK_HEADERS([stdatomic.h],[],[AC_MSG_ERROR([<stdatomic.h> is required for SMP support])])
195fi
196
197rtems_major=`echo _RTEMS_VERSION | sed "s/\..*//"`
198rtems_minor=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/\..*//"`
199rtems_revision=`echo _RTEMS_VERSION | sed "s/[[0-9]][[0-9]]*\.//;s/[[0-9]][[0-9]]*\.//;s/\..*//"`
200
201_RTEMS_CPUOPT_INIT
202
203RTEMS_CPUOPT([RTEMS_DEBUG],
204  [test x"${enable_rtems_debug}" = x"yes"],
205  [1],
206  [if RTEMS_DEBUG is enabled])
207
208RTEMS_CPUOPT([RTEMS_MULTIPROCESSING],
209  [test x"$enable_multiprocessing" = xyes],
210  [1],
211  [if multiprocessing is enabled])
212
213RTEMS_CPUOPT([RTEMS_NEWLIB],
214  [test x"$RTEMS_USE_NEWLIB" = xyes],
215  [1],
216  [if using newlib])
217
218RTEMS_CPUOPT([RTEMS_POSIX_API],
219  [test x"$rtems_cv_HAS_POSIX_API" = xyes],
220  [1],
221  [if posix api is supported])
222
223RTEMS_CPUOPT([RTEMS_SMP],
224  [test x"$RTEMS_HAS_SMP" = xyes],
225  [1],
226  [if SMP is enabled])
227
228RTEMS_CPUOPT([RTEMS_PARAVIRT],
229  [test x"$RTEMS_HAS_PARAVIRT" = xyes],
230  [1],
231  [PARAVIRT is enabled])
232
233RTEMS_CPUOPT([RTEMS_PROFILING],
234  [test x"$RTEMS_HAS_PROFILING" = xyes],
235  [1],
236  [if profiling is enabled])
237
238RTEMS_CPUOPT([RTEMS_NETWORKING],
239  [test x"$rtems_cv_HAS_NETWORKING" = xyes],
240  [1],
241  [if networking is enabled])
242
243RTEMS_CPUOPT([RTEMS_DRVMGR_STARTUP],
244  [test x"$enable_drvmgr" = xyes],
245  [1],
246  [if driver manager api is supported])
247
248RTEMS_CPUOPT([RTEMS_VERSION],
249  [true],
250  ["]_RTEMS_VERSION["],
251  [RTEMS version string])
252
253## Header file differences that need to be known in .h after install
254RTEMS_CPUOPT([__RTEMS_HAVE_DECL_SIGALTSTACK__],
255  [test x"${ac_cv_have_decl_sigaltstack}" = x"yes"],
256  [1],
257  [indicate if <signal.h> in toolset has sigaltstack()])
258
259## This improves both the size and coverage analysis.
260RTEMS_CPUOPT([__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__],
261  [test x"${RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH}" = x"1"],
262  [1],
263  [disable inlining _Thread_Enable_dispatch])
264
265## Deactivate ada bindings
266RTEMS_CPUOPT([__RTEMS_ADA__],
267  [test x"${enable_ada}" = x"yes"],
268  [1],
269  [Define to 1 if ada/gnat bindings are built-in])
270
271## Then we propagate a private copy of the value into cpuopts.h
272## so it is always available to the RTEMS header files.
273
274RTEMS_CPUOPT([__RTEMS_MAJOR__],
275  [true],
276  [$rtems_major],
277  [major version portion of an RTEMS release])
278
279RTEMS_CPUOPT([__RTEMS_MINOR__],
280  [true],
281  [$rtems_minor],
282  [minor version portion of an RTEMS release])
283
284RTEMS_CPUOPT([__RTEMS_REVISION__],
285  [true],
286  [$rtems_revision],
287  [revision version portion of an RTEMS release])
288
289_RTEMS_CPUOPT_FINI
290
291AC_ENABLE_MULTILIB([Makefile],[..])
292
293# libmisc/shell/* wants to assign file descriptors to stdio file descriptors.
294AC_MSG_CHECKING([for assignable stdio])
295AC_COMPILE_IFELSE(
296  [AC_LANG_PROGRAM(
297    [#include <stdio.h>],
298    [stdin = fopen("/tmp", "r")])],
299  [HAVE_ASSIGNABLE_STDIO=yes],
300  [HAVE_ASSIGNABLE_STDIO=no])
301AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
302
303# libmisc/serdbg exploits weak symbols
304RTEMS_CHECK_GCC_WEAK
305
306# FIXME: These checks are only in here to provide
307# configuration-time diagnostics and are not really used.
308AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>])
309AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>])
310
311# FIXME: We should get rid of this.
312# So far, only used in libfs/src/nfsclient/src/dirutils.c
313AC_CHECK_SIZEOF([mode_t])
314AC_CHECK_SIZEOF([off_t])
315
316# FIXME: We should get rid of this. It's a cludge.
317AC_CHECK_SIZEOF([time_t])
318
319AC_CHECK_SIZEOF([size_t])
320
321# FIXME: Mandatory in SUSv4, optional in SUSv3.
322#   Not implemented in GCC/newlib, so far.
323AC_CHECK_DECLS([WORD_BIT],,,[#include <limits.h>])
324AC_CHECK_DECLS([LONG_BIT],,,[#include <limits.h>])
325
326## BSD-ism, excluded from POSIX, but available on most platforms
327AC_CHECK_DECLS([sbrk],,,[#include <unistd.h>])
328AC_CHECK_DECLS([rcmd],,,[#include <unistd.h>])
329
330## Check if libc provides BSD's strlcpy/strlcat
331AC_CHECK_FUNCS(strlcpy strlcat)
332
333## Check if libc provides decl of utime
334## FIXME: utime has been deprecated in SUSv4.
335##        and is likely to be removed in future versions.
336## FIXME (BUG in newlib): SUSv4 saids including <utime.h> should be sufficient.
337AC_CHECK_DECLS([utime],,,[#include <sys/types.h>
338#include <utime.h>])
339## Check if libc provides decl of utimes
340AC_CHECK_DECLS([utimes],,,[#include <sys/time.h>])
341
342# ... far too many conditionals ...
343AM_CONDITIONAL(LIBRPC,[test x"$rtems_cv_HAS_NETWORKING" = x"yes"])
344AM_CONDITIONAL(NEWLIB,test x"$RTEMS_USE_NEWLIB" = x"yes")
345
346AM_CONDITIONAL(HAS_MP,test x"$enable_multiprocessing" = x"yes" )
347AM_CONDITIONAL(HAS_SMP,[test "$RTEMS_HAS_SMP" = "yes"])
348
349AM_CONDITIONAL(HAS_PTHREADS,test x"$rtems_cv_HAS_POSIX_API" = x"yes")
350AM_CONDITIONAL(LIBNETWORKING,test x"$rtems_cv_HAS_NETWORKING" = x"yes")
351
352AM_CONDITIONAL([LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
353AM_CONDITIONAL([LIBSERDBG],[test x"$rtems_cv_cc_attribute_weak" = x"yes"])
354AM_CONDITIONAL([LIBGNAT],[test x"$rtems_cv_HAS_POSIX_API" = x"yes" \
355&& test x"$enable_ada" = x"yes"])
356
357AM_CONDITIONAL([LIBUTF8PROC],[test $ac_cv_sizeof_size_t -gt 2])
358
359AM_CONDITIONAL([LIBDOSFS],[dnl
360test x"$ac_cv_type_uint8_t" = xyes \
361&& test x"$ac_cv_type_uint16_t" = xyes])
362
363AC_CONFIG_HEADER(config.h)
364
365## These are needed by the NFS Client
366AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
367AM_CONDITIONAL([RPCTOOLS],[test "$RPCGEN" = rpcgen \
368&& test -n "$AWK" \
369&& test "$enable_rpcgen" = yes])
370
371# Filter dynamic loading to only build for architectures that have
372# reloc backends
373AC_MSG_CHECKING([whether CPU supports libdl])
374case $RTEMS_CPU in
375  arm | i386 | m68k | mips | moxie | powerpc | sparc)
376   HAVE_LIBDL=yes ;;
377  # bfin has an issue to resolve with libdl. See ticket #2252
378  bfin)
379   HAVE_LIBDL=no ;;
380  # lm32 has an issue to resolve with libdl. See ticket #2283
381  lm32)
382   HAVE_LIBDL=no ;;
383  # v850 has an issue to resolve with libdl. See ticket #2260
384  v850)
385   HAVE_LIBDL=no ;;
386  *)
387   HAVE_LIBDL=no ;;
388esac
389AM_CONDITIONAL(LIBDL,[test x"$HAVE_LIBDL" = x"yes"])
390AC_MSG_RESULT([$HAVE_LIBDL])
391
392# Filter debugger to only build for architectures that have a target backend
393AC_MSG_CHECKING([whether CPU supports libdebugger])
394case $RTEMS_CPU in
395  arm | i386)
396   HAVE_LIBDEBUGGER=yes ;;
397  *)
398   HAVE_LIBDEBUGGER=no ;;
399esac
400AM_CONDITIONAL(LIBDEBUGGER,[test x"$HAVE_LIBDEBUGGER" = x"yes"])
401AC_MSG_RESULT([$HAVE_LIBDEBUGGER])
402
403AC_MSG_CHECKING([whether CPU supports SHA])
404case $RTEMS_CPU in
405  m32c)
406   HAVE_SHA=no ;;
407  *)
408   HAVE_SHA=yes ;;
409esac
410AM_CONDITIONAL(SHA,[test x"$HAVE_SHA" = x"yes"])
411AC_MSG_RESULT([$HAVE_SHA])
412
413# Filter libpci to only build for architectures that have support for it
414AC_MSG_CHECKING([whether CPU supports libpci])
415case $RTEMS_CPU in
416  sparc)
417   HAVE_LIBPCI=yes ;;
418  *)
419   HAVE_LIBPCI=no ;;
420esac
421AM_CONDITIONAL(LIBPCI,[test x"$HAVE_LIBPCI" = x"yes"])
422AC_MSG_RESULT([$HAVE_LIBPCI])
423
424# Filter libdrvmgr to only build for architectures that have support for it
425AC_MSG_CHECKING([whether CPU supports libdrvmgr])
426case $RTEMS_CPU in
427  sparc)
428   HAVE_LIBDRVMGR=yes ;;
429  *)
430   HAVE_LIBDRVMGR=no ;;
431esac
432AM_CONDITIONAL(LIBDRVMGR,[test x"$HAVE_LIBDRVMGR" = x"yes"])
433AC_MSG_RESULT([$HAVE_LIBDRVMGR])
434
435
436RTEMS_AMPOLISH3
437
438# Explicitly list all Makefiles here
439AC_CONFIG_FILES([
440Doxyfile
441Makefile
442dev/Makefile
443dtc/libfdt/Makefile
444rtems/Makefile
445sapi/Makefile
446score/Makefile
447score/cpu/Makefile
448score/cpu/arm/Makefile
449score/cpu/bfin/Makefile
450score/cpu/epiphany/Makefile
451score/cpu/i386/Makefile
452score/cpu/lm32/Makefile
453score/cpu/m68k/Makefile
454score/cpu/m32c/Makefile
455score/cpu/mips/Makefile
456score/cpu/moxie/Makefile
457score/cpu/nios2/Makefile
458score/cpu/or1k/Makefile
459score/cpu/powerpc/Makefile
460score/cpu/sh/Makefile
461score/cpu/sparc/Makefile
462score/cpu/sparc64/Makefile
463score/cpu/v850/Makefile
464score/cpu/no_cpu/Makefile
465posix/Makefile
466libblock/Makefile
467libdrvmgr/Makefile
468libfs/Makefile
469libfs/src/nfsclient/Makefile
470libgnat/Makefile
471libcrypt/Makefile
472libcsupport/Makefile
473libnetworking/Makefile
474libpci/Makefile
475librpc/Makefile
476libmisc/Makefile
477libi2c/Makefile
478libmd/Makefile
479libdl/Makefile
480libstdthreads/Makefile
481libdebugger/Makefile
482zlib/Makefile
483ftpd/Makefile
484telnetd/Makefile
485pppd/Makefile
486mghttpd/Makefile
487wrapup/Makefile])
488
489AC_CONFIG_COMMANDS([preinstall-stamp],
490[test -z "$with_multisubdir" && ${MAKE} preinstall-stamp],
491[MAKE=${MAKE}
492with_multisubdir="$with_multisubdir"])
493
494AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.