source: rtems/c/src/lib/configure.in @ ea562ee9

4.104.114.84.95
Last change on this file since ea562ee9 was ea562ee9, checked in by Joel Sherrill <joel.sherrill@…>, on 08/12/99 at 18:22:17

Patch from Ralf Corsepius <corsepiu@…>:

After upgrading my linux box to the brand new SuSE 6.2 release, which is
glibc-2.1 based, I came across a bug in RTEMS - IIRC, I even warned you
about it about 1/2 a year ago, but nothing has been done since then :-.

The *.m4 macros to check for SYSV/IPC are broken for linux/glibc2.1,
because they assume that linux always defines union semun, which isn't
true anymore for glibc2.1 (the manpage for semctl states _X_OPEN
specifies it this way). Therefore I have tried to implement a more
general approach for handling SYSV for unix/posix which checks for
presence of struct semun, instead of trying to evaluate OS specific
preprocessor symbols.

This approach is a bit adventureous, because I only tested it with
linux/glibc2.1 and linux/libc5, but not under other Unix variants RTEMS
supports. I am quite confident it will work on other hosts, too, but who
knows :-.

[FYI: I think this might also is the cause of some problems with RedHat?
6.X / Mandrake linux recently reported on the rtems list -- rtems-4.0.0
can not be build for posix on any glibc2.1 based host]

Furthermore the patch below contains a couple of minor fixes and
configuration cleanups, which IMO should be applied before releasing a
new snapshot.

To apply this patch:

cd <source-tree>
patch -p1 < rtems-rc-19990709-8.diff
./autogen

  • Property mode set to 100644
File size: 4.8 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2dnl
3dnl  $Id$
4
5AC_PREREQ(2.13)
6AC_INIT(libbsp)
7RTEMS_TOP(../../..)
8AC_CONFIG_AUX_DIR(../../..)
9
10AC_PROG_MAKE_SET
11RTEMS_CANONICAL_TARGET_CPU
12
13AM_MAINTAINER_MODE
14
15RTEMS_ENABLE_MULTIPROCESSING
16RTEMS_ENABLE_NETWORKING
17RTEMS_ENABLE_RDBG
18RTEMS_ENABLE_CXX
19RTEMS_ENABLE_GCC28
20RTEMS_ENABLE_LIBCDIR
21RTEMS_ENABLE_BARE
22RTEMS_ENABLE_HWAPI
23
24RTEMS_ENV_RTEMSBSP
25
26AC_PROG_INSTALL
27
28RTEMS_CHECK_CPU
29RTEMS_CANONICAL_HOST
30
31RTEMS_PROJECT_ROOT
32
33dnl check target cc
34RTEMS_PROG_CC_FOR_TARGET
35
36dnl check for g++
37if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
38  RTEMS_PROG_CXX_FOR_TARGET
39fi
40
41RTEMS_CANONICALIZE_TOOLS
42
43dnl if this is an i386, does gas have good code16 support?
44RTEMS_I386_GAS_CODE16
45AM_CONDITIONAL(RTEMS_GAS_CODE16,test "$RTEMS_GAS_CODE16" = "yes");
46
47# find all the Makefiles for the BSPs
48makefiles="$makefiles libbsp/$RTEMS_CPU/Makefile"
49
50if test "${RTEMS_BSP}" = "bare"; then
51makefiles="$makefiles libbsp/bare/Makefile"
52fi
53
54RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
55RTEMS_CHECK_MULTIPROCESSING(RTEMS_BSP)
56RTEMS_CHECK_CXX(RTEMS_BSP)
57RTEMS_CHECK_NETWORKING(RTEMS_BSP)
58
59RTEMS_BSP_ALIAS(${RTEMS_BSP},bspdir)
60
61# Is there code where there should be for this BSP?
62# The bare bsp is a special case as it is not under the RTEMS_CPU path
63case ${RTEMS_BSP} in
64  bare)
65    bspcpudir=
66    if test "X${BARE_CPU_CFLAGS}" = "X" ; then
67      AC_MSG_ERROR([--enable-bare-cpu-cflags not specified for bare bsp])
68    fi
69    if test "X${BARE_CPU_MODEL}" = "X" ; then
70      AC_MSG_ERROR([--enable-bare-cpu-model not specified for bare bsp])
71    fi
72    ;;
73  *)
74    bspcpudir=$RTEMS_CPU/
75    ;;
76esac
77
78if test "$RTEMS_BSP" = "bare" ; then
79  RTEMS_LIBBSP_CPU_SUBDIR="bare"
80else
81  RTEMS_LIBBSP_CPU_SUBDIR='$(RTEMS_CPU)'
82fi
83AC_SUBST(RTEMS_LIBBSP_CPU_SUBDIR)
84     
85if test -d "$srcdir/libbsp/$bspcpudir$bspdir"; then
86  RTEMS_CHECK_MAKEFILE(libbsp/${bspcpudir}$bspdir)
87  RTEMS_CHECK_MAKEFILE(libbsp/${bspcpudir}shared)
88
89  # HACK: sed out bsp-tools from makefiles
90  t="libbsp/$bspcpudir$bspdir/tools"
91  if test -d "$srcdir/$t"; then
92    bsptools_cfgdirs="$bsptools_cfgdirs $t"
93    makefiles=`echo "$makefiles" | sed -e "s%$t/.*Makefile%%g"`
94  fi
95else
96  AC_MSG_ERROR([unable to find libbsp directory ($bspdir) for  ${RTEMS_BSP}])
97fi
98
99if test "$HAS_MP" = "yes"; then
100  makefiles="$makefiles libbsp/shmdr/Makefile"
101else
102  # HACK: sed out shmsupp/Makefile from makefiles
103  t="libbsp/$bspcpudir$bspdir/shmsupp"
104  makefiles=`echo "$makefiles" | sed -e "s%$t/.*Makefile%%g"`
105fi
106
107AM_CONDITIONAL(UNIX,test "$RTEMS_CPU" = "unix")
108# find all the CPU dependent library Makefiles
109RTEMS_CHECK_MAKEFILE(libcpu/$RTEMS_CPU)
110
111dnl Workaround for go32
112case "${target}" in
113changequote(,)dnl
114  i[3456]86-go32-rtems*)
115changequote([,])dnl
116    ;;
117  *)
118    RTEMS_CHECK_MAKEFILE(start/$RTEMS_CPU)
119    ;;
120esac
121
122# If the TCP/IP stack is enabled, then find all TCP/IP Makefiles
123if test "$HAS_NETWORKING" = "yes"; then
124  RTEMS_CHECK_MAKEFILE(libnetworking)
125  RTEMS_CHECK_MAKEFILE(librpc)
126
127  if test "$HAS_RDBG" = "yes"; then
128    RTEMS_CHECK_RDBG(RTEMS_BSP)
129
130    if test "$HAS_RDBG" = "yes"; then
131      AC_CHECK_PROG(RPCGEN,rpcgen,rpcgen)
132      AC_PROG_AWK
133      if test -z "$RPCGEN"; then
134        AC_MSG_ERROR([missing rpcgen, required to build librdbg])
135      fi
136      if test -z "$AWK"; then
137        AC_MSG_ERROR([missing awk, required to build librdbg])
138      fi
139    fi
140    if test "$HAS_RDBG" = "yes"; then
141      RTEMS_CHECK_MAKEFILE(librdbg)
142    fi
143  fi
144fi
145
146# If the C++ support is enabled, then include the Makefiles
147if test "$HAS_CPLUSPLUS" = "yes"; then
148  RTEMS_CHECK_MAKEFILE(librtems++)
149fi
150
151# If the HWAPI is enabled, the find the HWAPI Makefiles
152RTEMS_ENABLE_HWAPI
153if test "$RTEMS_HAS_HWAPI" = "yes"; then
154  AC_MSG_CHECKING(whether libwapi is present)
155  if test -f ${srcdir}/libhwapi/Makefile.in ; then
156    AC_MSG_RESULT(yes)
157    makefiles="$makefiles libhwapi/Makefile"
158    RTEMS_CHECK_MAKEFILE(libhwapi/analog)
159    RTEMS_CHECK_MAKEFILE(libhwapi/discrete)
160    RTEMS_CHECK_MAKEFILE(libhwapi/drivers)
161    RTEMS_CHECK_MAKEFILE(libhwapi/non_volatile_memory)
162    RTEMS_CHECK_MAKEFILE(libhwapi/serial)
163    RTEMS_CHECK_MAKEFILE(libhwapi/support)
164    RTEMS_CHECK_MAKEFILE(libhwapi/wrapup)
165  else
166    AC_MSG_ERROR(No source code found for the HWAPI)
167  fi
168fi
169
170AC_SUBST(RTEMS_HAS_CPLUSPLUS)
171AC_SUBST(RTEMS_USE_GCC272)
172AC_SUBST(CC_CFLAGS_DEFAULT)
173AC_SUBST(CC_CFLAGS_DEBUG_V)
174AC_SUBST(CC_CFLAGS_PROFILE_V)
175AC_SUBST(CC_LDFLAGS_PROFILE_V)
176
177# pick up all the Makefiles in required parts of the tree
178if test "$RTEMS_CPU" != "unix"; then
179## HACK: Suppress libchip for unix
180RTEMS_CHECK_MAKEFILE(libchip)
181fi
182
183RTEMS_CHECK_MAKEFILE(libmisc)
184
185AC_CONFIG_SUBDIRS($bsptools_cfgdirs)
186
187# FIXME: libhwapi needs a separate configure.in in future ;-
188# AC_CONFIG_SUBDIRS(libhwapi)
189
190# try to explicitly list a Makefile here
191AC_OUTPUT(
192Makefile
193include/Makefile
194libbsp/Makefile
195libc/Makefile
196libcpu/Makefile
197start/Makefile
198wrapup/Makefile
199$makefiles)
Note: See TracBrowser for help on using the repository browser.