source: rtems/configure.in @ e5f4e5a

4.104.114.84.9
Last change on this file since e5f4e5a was e5f4e5a, checked in by Joel Sherrill <joel.sherrill@…>, on Mar 29, 1999 at 10:24:23 PM

Patch from Ralf Corsepius <corsepiu@…>:

rtems-rc-19990326-2.diff: Enhancements to autoconf support for librdbg

  • autoconf-checks for AWK and RPCGEN
  • disable librdbg if either AWK, RPCGEN or librdbg/$target_cpu cannot be found
  • Property mode set to 100644
File size: 13.2 KB
Line 
1
2dnl Process this file with autoconf to produce a configure script.
3dnl
4dnl  $Id$
5
6AC_PREREQ(2.13)
7AC_INIT(README)
8RTEMS_TOP(.)
9
10dnl Checks for programs.
11AC_PROG_MAKE_SET
12AC_CANONICAL_SYSTEM
13
14AC_ARG_WITH(cross-host,[  --with-cross-host=HOST      host (cygnus)], \
15host=$withval)
16
17RTEMS_ENABLE_GMAKE_PRINT
18RTEMS_ENABLE_MULTIPROCESSING
19RTEMS_ENABLE_POSIX
20RTEMS_ENABLE_NETWORKING
21RTEMS_ENABLE_RDBG
22RTEMS_ENABLE_INLINES
23RTEMS_ENABLE_CXX
24RTEMS_ENABLE_GCC28
25RTEMS_ENABLE_LIBCDIR
26RTEMS_ENABLE_BARE
27
28RTEMS_PREFIX=${target_cpu}-${target_vendor}
29
30dnl BEGIN configure.host.in
31
32AC_PATH_PROG(CAT,cat)
33AC_PATH_PROG(RM,rm)
34AC_PATH_PROG(CP,cp)
35AC_PATH_PROG(MV,mv)
36AC_PATH_PROG(LN,ln)
37AC_PROG_LN_S
38AC_PATH_PROG(CHMOD,chmod)
39AC_PATH_PROG(SORT,sort)
40AC_PROG_INSTALL
41RTEMS_PATH_PERL
42
43dnl check mkdir behaviour, try to get mkdir -p -m 0755
44dnl NOTE: This is considered obsolete
45dnl MKDIR is not used anywhere in the source tree anymore.
46dnl In Makefile.ins/Makefile.ams, use
47dnl "mkinstalldirs" for recursive mkdir and
48dnl "mkdir" for non-recursive mkdir, instead
49RTEMS_PATH_MKDIR
50RTEMS_PROG_MKDIR_M
51RTEMS_PROG_MKDIR_P
52test "$rtems_cv_prog_MKDIR_P" = "yes" && MKDIR="$MKDIR -p"
53#test "$rtems_cv_prog_MKDIR_M" = "yes" && MKDIR="$MKDIR -m 0755"
54
55AC_PATH_PROG(TOUCH,touch)
56AC_PATH_PROG(CMP,cmp)
57
58AC_PATH_PROG(SED,sed)
59AC_PATH_PROGS(M4,gm4 m4)
60
61RTEMS_PATH_KSH
62
63dnl BEGIN configure.target.in
64
65dnl echo "TARGET"
66dnl echo "    cpu    --> $target_cpu"
67dnl echo "    os     --> $target_os"
68dnl echo "    vendor --> $target_vendor"
69
70dnl canonicalize target name
71dnl NOTE: Most rtems targets do not fullfil autoconf
72dnl targets naming conventions "processor-vendor-os"
73dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
74dnl and we have to fix it for rtems ourselves
75dnl
76dnl The original plan was to do CPU-BSP-rtems or CPU-rtems to
77dnl imply all BSPs.  Eventually we would like to build a collection
78dnl of CPU model specific RTEMS libraries which in conjunction with
79dnl a BSP library would be used to link an application.
80
81RTEMS_HOST=$host_os
82
83RTEMS_CANONICAL_TARGET_CPU
84RTEMS_CHECK_CPU
85RTEMS_CANONICAL_HOST
86
87changequote(,)dnl
88case "${target}" in
89  i[3456]86-go32-rtems*)
90    rtems_bsp="go32 go32_p5"
91    skip_startfiles="yes"
92    ;;
93  *)
94    ;;
95esac
96changequote([,])dnl
97
98# Override the set of BSPs to be built.
99AC_ARG_ENABLE(rtemsbsp, \
100  [  --enable-rtemsbsp=bsp1 bsp2 ..   BSPs to include in build], \
101      rtems_bsp=$enableval \
102)
103
104RTEMS_TOOL_PREFIX
105
106dnl check target cc
107RTEMS_PROG_CC
108dnl check if the compiler supports --specs
109RTEMS_GCC_SPECS
110dnl check if the target compiler may use --pipe
111RTEMS_GCC_PIPE
112
113dnl check if the compiler supports --specs if gcc28 is requested
114if test "$RTEMS_USE_GCC272" != "yes" ; then
115  if test "$rtems_cv_gcc_specs" = "no"; then
116    AC_MSG_WARN([*** disabling --enable-gcc28])
117     RTEMS_USE_GCC272=yes
118  fi
119fi
120test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
121
122dnl check for g++
123if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
124  RTEMS_PROG_CXX
125  if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then
126    AC_MSG_ERROR([***]
127     [Inconsistency in compiler configuration:]
128     [Target C compiler and Target C++ compiler]
129     [must both either be cross compilers or native compilers]
130     [Hint: If building a posix bsp: LD_LIBRARY_PATH?] )
131  fi
132else
133  CXX_FOR_TARGET="no"
134fi
135
136RTEMS_CANONICALIZE_TOOLS
137
138dnl if this is an i386, does gas have good code16 support?
139RTEMS_I386_GAS_CODE16
140
141dnl check host cc
142AC_PROG_CC
143dnl check for .exe (Cygwin)
144AC_EXEEXT
145
146dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-*
147case $host_os in
148*cygwin32*)     GCCSED="| sed 's%\\\\%/%g'" ;;
149*) ;;
150esac
151AC_SUBST(GCCSED)
152
153dnl FIXME: This is a kludge
154dnl Set flags to settings all gcc variants are assumed to accept.
155if test "$ac_cv_prog_gcc" = "yes"; then
156dnl Add -Wall if using gcc as host compiler
157  CC_CFLAGS_DEFAULT=-Wall
158dnl Add -pg to profile flags, unless specified in the environment
159  CC_CFLAGS_PROFILE_V=${CC_CFLAGS_PROFILE_V-"-pg"}
160dnl propagate cflags to ldflags, unless specified in the environment
161  CC_LDFLAGS_PROFILE_V=${CC_LDFLAGS_PROFILE_V-$CC_CFLAGS_PROFILE_V}
162fi
163
164dnl Add -g if the host compiler accepts -g, assume -g means debugging
165test "$ac_cv_prog_cc_g" = "yes" && CC_CFLAGS_DEBUG_V=${CC_CFLAGS_DEBUG_V-"-g"}
166
167dnl check for SysV IPC used by simulators
168if test "$target_cpu" = "unix" ; then
169  RTEMS_SYSV_SEM
170  if test "$rtems_cv_sysv_sem" != "yes" ; then
171    AC_MSG_ERROR([System V semaphores don't work, required by simulator])
172  fi
173  RTEMS_SYSV_SHM
174  if test "$rtems_cv_sysv_shm" != "yes" ; then
175    AC_MSG_ERROR([System V shared memory doesn't work, required by simulator])
176  fi
177  RTEMS_SYSV_MSG
178  if test "$rtems_cv_sysv_msg" != "yes" ; then
179    AC_MSG_ERROR([System V messages don't work, required by simulator])
180  fi
181fi
182
183# Collect config subdirs for exec/score/tools
184t="c/src/exec/score/tools"
185scoretools_cfgdirs="$t/generic"
186if test -d $srcdir/$t/$target_cpu; then
187  scoretools_cfgdirs="$scoretools_cfgdirs $t/$target_cpu"
188fi
189
190# find all the Executive Makefiles
191RTEMS_CHECK_MAKEFILE(c/src/exec/rtems)
192RTEMS_CHECK_MAKEFILE(c/src/exec/sapi)
193RTEMS_CHECK_MAKEFILE(c/src/exec/score/cpu/$target_cpu)
194
195if test "$RTEMS_HAS_POSIX_API" = "yes"; then
196  RTEMS_CHECK_MAKEFILE(c/src/exec/posix)
197  makefiles="$makefiles c/src/exec/wrapup/posix/Makefile"
198fi
199
200# find all the Makefiles for the BSPs
201if test -d "$srcdir/c/src/lib/libbsp/$target_cpu"; then
202  makefiles="$makefiles c/src/lib/libbsp/$target_cpu/Makefile"
203
204  if test -z "$rtems_bsp"; then
205    AC_MSG_CHECKING([for bsps])
206    files=`ls $srcdir/c/src/lib/libbsp/$target_cpu`
207    for file in $files; do
208      case $file in
209        shared*);;
210        Makefile*);;
211        READ*);;
212        CVS*);;
213        pxfl*);;
214        go32*);;       # so the i386 port can pick up the other Makefiles
215        # Now account for BSPs with build variants
216        gen68360)      rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
217        p4000)         rtems_bsp="$rtems_bsp p4600 p4650";;
218        mvme162)       rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
219        *) rtems_bsp="$rtems_bsp $file";;
220      esac;
221    done
222
223    makefiles="$makefiles c/src/lib/libbsp/bare/Makefile"
224
225    AC_MSG_RESULT([$rtems_bsp done])
226  fi
227
228  # collect makefiles for each bsp
229  for i in $rtems_bsp; do
230    # make sure there is a make/custom file for the bsp
231    if test ! -r "$srcdir/make/custom/${i}.cfg"; then
232      AC_MSG_ERROR([no make/custom/${i}.cfg file for BSP $i])
233    fi
234 
235    # account for "aliased" bsps which share source code
236    case $i in
237      mvme162lx)    bspdir=mvme162  ;;  # mvme162 board variant
238      gen68360_040) bspdir=gen68360 ;;  # 68360 in companion mode
239      go32_p5)      bspdir=go32     ;;  # go32 on Pentium class CPU
240      p4600)        bspdir=p4000    ;;  # p4000 board with IDT 4600
241      p4650)        bspdir=p4000    ;;  # p4000 board with IDT 4650
242      *)            bspdir=$i;;
243    esac
244
245    # Is there code where there should be for this BSP?
246    # The bare bsp is a special case as it is not under the target_cpu path
247    case $i in
248      bare)
249        bspcpudir=
250        if test "X${BARE_CPU_CFLAGS}" = "X" ; then
251          AC_MSG_ERROR([--enable-bare-cpu-cflags not specified for bare bsp])
252        fi
253        if test "X${BARE_CPU_MODEL}" = "X" ; then
254          AC_MSG_ERROR([--enable-bare-cpu-model not specified for bare bsp])
255        fi
256        ;;
257      *)
258        bspcpudir=$target_cpu/
259        ;;
260    esac
261     
262    if test -d "$srcdir/c/src/lib/libbsp/$bspcpudir$bspdir"; then
263      RTEMS_BSP_LIST="$RTEMS_BSP_LIST $i"
264      # make sure the Makefiles in a bsp directory are only done once
265      echo $bspdirs | grep $bspdir >/dev/null 2>&1
266      if test $? -ne 0 ; then
267        bspdirs="$bspdirs $bspdir"
268        RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/$bspcpudir$bspdir)
269        RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/${bspcpudir}shared)
270
271        # HACK: sed out bsp-tools from makefiles
272        t="c/src/lib/libbsp/$bspcpudir$bspdir/tools"
273        if test -d "$srcdir/$t"; then
274          bsptools_cfgdirs="$bsptools_cfgdirs $t"
275          makefiles=`echo "$makefiles" | sed -e "s%$t/Makefile%%g"`
276        fi
277      fi
278    else
279      AC_MSG_ERROR([unable to find libbsp directory ($bspdir) for  $i])
280    fi
281  done
282fi
283
284# find all the CPU dependent library Makefiles
285RTEMS_CHECK_MAKEFILE(c/src/lib/libcpu/$target_cpu)
286
287dnl Workaround for go32
288if test "$skip_startfiles" != "yes"; then
289  RTEMS_CHECK_MAKEFILE(c/src/lib/start/$target_cpu)
290fi
291
292dnl END configure.target.in
293
294PROJECT_ROOT=`pwd;`
295
296# If RTEMS macros are enabled, then use them.  Otherwise, use inlines.
297if test "$RTEMS_USE_MACROS" = "yes"; then
298  inline_dir=macros
299  if test "$RTEMS_HAS_POSIX_API" = "yes"; then
300    # The problem is that there is currently no code in posix/macros :)
301    AC_MSG_ERROR(Macros are not implemented for the POSIX API)
302  fi
303else
304  inline_dir=inline
305fi
306
307# If the TCP/IP stack is enabled, then find all TCP/IP Makefiles
308AC_MSG_CHECKING([if networking is enabled? ])
309AC_MSG_RESULT($RTEMS_HAS_NETWORKING)
310if test "$RTEMS_HAS_NETWORKING" = "yes"; then
311  RTEMS_CHECK_MAKEFILE(c/src/lib/libnetworking)
312  RTEMS_CHECK_MAKEFILE(c/src/lib/librpc)
313  if test "$RTEMS_HAS_RDBG" = "yes"; then
314    AC_MSG_CHECKING([whether cpu supports rdbg? ])
315    test ! -d "$srcdir/c/src/lib/librdbg/$target_cpu" && RTEMS_HAS_RDBG="no" ;
316    AC_MSG_RESULT($RTEMS_HAS_RDBG)
317    if test "$RTEMS_HAS_RDBG" = "yes"; then
318      AC_PATH_PROG(RPCGEN,rpcgen)
319      test -z "$RPCGEN" && RTEMS_HAS_RDBG="no"
320    fi
321    if test "$RTEMS_HAS_RDBG" = "yes"; then
322      AC_PROG_AWK
323      test -z "$AWK" && RTEMS_HAS_RDBG="no"
324    fi
325    if test "$RTEMS_HAS_RDBG" = "yes"; then
326      RTEMS_CHECK_MAKEFILE(c/src/lib/librdbg)
327    else
328      AC_MSG_WARN([*** warning disabling --enable-rdbg])
329    fi
330  fi
331fi
332
333# If the C++ support is enabled, then include the Makefiles
334if test "$RTEMS_HAS_CPLUSPLUS" = "yes"; then
335  makefiles="$makefiles c/src/lib/librtems++/Makefile"
336fi
337
338RTEMS_ENABLE_TESTS
339
340RTEMS_CHECK_MAKEFILE(c/src/tests/tools/$target_cpu)
341
342if test "$tests_enabled" = "yes"; then
343   RTEMS_CHECK_MAKEFILE(c/src/tests/libtests)
344   RTEMS_CHECK_MAKEFILE(c/src/tests/sptests)
345   RTEMS_CHECK_MAKEFILE(c/src/tests/tmtests)
346   if test "$RTEMS_HAS_MULTIPROCESSING" = "yes"; then
347       RTEMS_CHECK_MAKEFILE(c/src/tests/mptests)
348   fi
349   if test "$RTEMS_HAS_POSIX_API" = "yes"; then
350     RTEMS_CHECK_MAKEFILE(c/src/tests/psxtests)
351   fi
352   AC_CONFIG_SUBDIRS(c/src/tests/tools/generic)
353fi
354
355# If the HWAPI is enabled, the find the HWAPI Makefiles
356RTEMS_ENABLE_HWAPI
357if test "$RTEMS_HAS_HWAPI" = "yes"; then
358  AC_MSG_CHECKING(whether libwapi is present)
359  if test -f ${srcdir}/c/src/lib/libhwapi/Makefile.in ; then
360    AC_MSG_RESULT(yes)
361    makefiles="$makefiles c/src/lib/libhwapi/Makefile"
362    RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/analog)
363    RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/discrete)
364    RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/drivers)
365    RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/non_volatile_memory)
366    RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/serial)
367    RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/support)
368    RTEMS_CHECK_MAKEFILE(c/src/lib/libhwapi/wrapup)
369  else
370    AC_MSG_ERROR(No source code found for the HWAPI)
371  fi
372fi
373
374AC_SUBST(RTEMS_GAS_CODE16)
375AC_SUBST(rtems_cv_prog_cc_cross)
376AC_SUBST(RTEMS_BSP_LIST)
377AC_SUBST(RTEMS_HOST)
378AC_SUBST(RTEMS_LIBC_DIR)
379AC_SUBST(RTEMS_USE_OWN_PDIR)
380AC_SUBST(RTEMS_HAS_POSIX_API)
381AC_SUBST(RTEMS_HAS_MULTIPROCESSING)
382AC_SUBST(RTEMS_HAS_NETWORKING)
383AC_SUBST(RTEMS_HAS_RDBG)
384AC_SUBST(RTEMS_USE_MACROS)
385AC_SUBST(RTEMS_HAS_CPLUSPLUS)
386AC_SUBST(RTEMS_USE_GCC272)
387AC_SUBST(RTEMS_LIBC_DIR)
388AC_SUBST(BARE_CPU_CFLAGS)
389AC_SUBST(BARE_CPU_MODEL)
390AC_SUBST(PROJECT_ROOT)
391AC_SUBST(program_prefix)
392AC_SUBST(CC_CFLAGS_DEFAULT)
393AC_SUBST(CC_CFLAGS_DEBUG_V)
394AC_SUBST(CC_CFLAGS_PROFILE_V)
395AC_SUBST(CC_LDFLAGS_PROFILE_V)
396
397# pick up all the Makefiles in required parts of the tree
398RTEMS_CHECK_MAKEFILE(make)
399RTEMS_CHECK_MAKEFILE(c/src/lib/libchip)
400RTEMS_CHECK_MAKEFILE(c/src/lib/libmisc)
401RTEMS_CHECK_MAKEFILE(c/src/tests/samples)
402
403AC_CONFIG_SUBDIRS(c/build-tools)
404AC_CONFIG_SUBDIRS($scoretools_cfgdirs)
405AC_CONFIG_SUBDIRS($bsptools_cfgdirs)
406
407# FIXME: libwapi needs a separate configure.in in future ;-
408# AC_CONFIG_SUBDIRS(c/src/lib/libwapi)
409
410# try not to explicitly list a Makefile here
411AC_OUTPUT(
412Makefile
413make/host.cfg
414make/target.cfg
415make/Templates/Makefile.inc
416make/compilers/gcc.cfg
417c/Makefile
418c/src/Makefile
419c/src/exec/Makefile
420c/src/exec/score/Makefile
421c/src/exec/score/cpu/Makefile
422c/src/exec/score/include/Makefile
423c/src/exec/score/include/rtems/Makefile
424c/src/exec/score/include/rtems/wrap/Makefile
425c/src/exec/score/include/rtems/score/Makefile
426c/src/exec/score/${inline_dir}/Makefile
427c/src/exec/score/${inline_dir}/rtems/Makefile
428c/src/exec/score/${inline_dir}/rtems/score/Makefile
429c/src/exec/score/src/Makefile
430c/src/exec/score/tools/Makefile
431c/src/exec/wrapup/Makefile
432c/src/exec/wrapup/rtems/Makefile
433c/src/lib/Makefile
434c/src/lib/include/Makefile
435c/src/lib/libbsp/Makefile
436c/src/lib/libbsp/shmdr/Makefile
437c/src/lib/libc/Makefile
438c/src/lib/libcpu/Makefile
439c/src/lib/start/Makefile
440c/src/lib/wrapup/Makefile
441c/src/tests/Makefile
442c/src/tests/support/Makefile
443c/src/tests/support/include/Makefile
444c/src/tests/support/stubdr/Makefile
445c/src/tests/support/wrapup/Makefile
446c/src/tests/tools/Makefile
447$makefiles
448c/update-tools/Makefile)
449
450echo
451echo target architecture: $target_cpu.
452echo available BSPs: $rtems_bsp.
453echo \'make all\' will build the following BSPs: $RTEMS_BSP_LIST.
454echo other BSPs can be built with \'make RTEMS_BSP=\"bsp1 bsp2 ...\"\'
455echo
Note: See TracBrowser for help on using the repository browser.