source: rtems/c/src/exec/score/cpu/aclocal.m4 @ 473b4e5

4.104.114.84.95
Last change on this file since 473b4e5 was 473b4e5, checked in by Joel Sherrill <joel.sherrill@…>, on 10/04/99 at 13:30:15

Regenerated.

  • Property mode set to 100644
File size: 21.0 KB
RevLine 
[473b4e5]1dnl aclocal.m4 generated automatically by aclocal 1.4a
[a24c280]2
3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13dnl $Id$
14
15dnl
16dnl RTEMS_TOP($1)
17dnl
18dnl $1 .. relative path from this configure.in to the toplevel configure.in
19dnl
20AC_DEFUN(RTEMS_TOP,
21[dnl
22AC_ARG_WITH(target-subdir,
23[  --with-target-subdir=DIR],
24TARGET_SUBDIR="$withval",
25TARGET_SUBDIR=".")
26
27RTEMS_TOPdir="$1";
28AC_SUBST(RTEMS_TOPdir)
29
30dnl Determine RTEMS Version string from the VERSION file
31dnl Hopefully, Joel never changes its format ;-
32AC_MSG_CHECKING([for RTEMS Version])
33if test -r "${srcdir}/${RTEMS_TOPdir}/VERSION"; then
34changequote(,)dnl
35RTEMS_VERSION=`grep Version ${srcdir}/${RTEMS_TOPdir}/VERSION | \
36sed -e 's%RTEMS[        ]*Version[      ]*\(.*\)[       ]*%\1%g'`
37changequote([,])dnl
38else
39AC_MSG_ERROR(Unable to find ${RTEMS_TOPdir}/VERSION)
40fi
41if test -z "$RTEMS_VERSION"; then
42AC_MSG_ERROR(Unable to determine version)
43fi
44AC_MSG_RESULT($RTEMS_VERSION)
45])dnl
46
47dnl
48dnl $Id$
49dnl
50
51dnl canonicalize target cpu
52dnl NOTE: Most rtems targets do not fullfil autoconf's
53dnl target naming conventions "processor-vendor-os"
54dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
55dnl and we have to fix it for rtems ourselves
56
57AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU,
58[
59AC_CANONICAL_SYSTEM
60AC_MSG_CHECKING(rtems target cpu)
61changequote(,)dnl
62case "${target}" in
63  # hpux unix port should go here
64  i[3456]86-go32-rtems*)
65        RTEMS_CPU=i386
66        ;;
67  i[3456]86-pc-linux*)          # unix "simulator" port
68        RTEMS_CPU=unix
69        ;;
70  i[3456]86-*freebsd2*)         # unix "simulator" port
71        RTEMS_CPU=unix
72        ;;
73  no_cpu-*rtems*)
74        RTEMS_CPU=no_cpu
75        ;;
76  sparc-sun-solaris*)           # unix "simulator" port
77        RTEMS_CPU=unix
78        ;;
79  *)
80        RTEMS_CPU=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'`
81        ;;
82esac
83changequote([,])dnl
84AC_SUBST(RTEMS_CPU)
85AC_MSG_RESULT($RTEMS_CPU)
86])
87
88# Add --enable-maintainer-mode option to configure.
89# From Jim Meyering
90
91# serial 1
92
93AC_DEFUN(AM_MAINTAINER_MODE,
94[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
95  dnl maintainer-mode is disabled by default
96  AC_ARG_ENABLE(maintainer-mode,
97[  --enable-maintainer-mode enable make rules and dependencies not useful
98                          (and sometimes confusing) to the casual installer],
99      USE_MAINTAINER_MODE=$enableval,
100      USE_MAINTAINER_MODE=no)
101  AC_MSG_RESULT($USE_MAINTAINER_MODE)
102  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
103  MAINT=$MAINTAINER_MODE_TRUE
104  AC_SUBST(MAINT)dnl
105]
106)
107
108# Define a conditional.
109
110AC_DEFUN(AM_CONDITIONAL,
111[AC_SUBST($1_TRUE)
112AC_SUBST($1_FALSE)
113if $2; then
114  $1_TRUE=
115  $1_FALSE='#'
116else
117  $1_TRUE='#'
118  $1_FALSE=
119fi])
120
121dnl $Id$
122
123AC_DEFUN(RTEMS_ENABLE_MULTIPROCESSING,
124[
125AC_ARG_ENABLE(multiprocessing,
126[  --enable-multiprocessing             enable multiprocessing interface],
127[case "${enableval}" in
128  yes) RTEMS_HAS_MULTIPROCESSING=yes ;;
129  no) RTEMS_HAS_MULTIPROCESSING=no ;;
130  *)  AC_MSG_ERROR(bad value ${enableval} for enable-multiprocessing option) ;;
131esac],[RTEMS_HAS_MULTIPROCESSING=no])
132AC_SUBST(RTEMS_HAS_MULTIPROCESSING)dnl
133])
134
135dnl $Id$
136
137AC_DEFUN(RTEMS_ENABLE_POSIX,
138[
139AC_ARG_ENABLE(posix,
140[  --enable-posix                       enable posix interface],
141[case "${enableval}" in
142  yes) RTEMS_HAS_POSIX_API=yes ;;
143  no) RTEMS_HAS_POSIX_API=no ;;
144  *)  AC_MSG_ERROR(bad value ${enableval} for enable-posix option) ;;
145esac],[RTEMS_HAS_POSIX_API=yes])
146AC_SUBST(RTEMS_HAS_POSIX_API)
147
148changequote(,)dnl
149case "${target}" in
150  # hpux unix port should go here
151  i[3456]86-go32-rtems*)
152        RTEMS_HAS_POSIX_API=no
153        ;;
154  i[3456]86-pc-linux*)         # unix "simulator" port
155        RTEMS_HAS_POSIX_API=no
156        ;;
157  i[3456]86-*freebsd2*) # unix "simulator" port
158        RTEMS_HAS_POSIX_API=no
159        ;;
160  no_cpu-*rtems*)
161        RTEMS_HAS_POSIX_API=no
162        ;;
163  sparc-sun-solaris*)             # unix "simulator" port
164        RTEMS_HAS_POSIX_API=no
165        ;;
166  *)
167        ;;
168esac
169changequote([,])dnl
170AC_SUBST(RTEMS_HAS_POSIX_API)
171])
172
173dnl $Id$
174
175AC_DEFUN(RTEMS_ENABLE_INLINES,
176[AC_ARG_ENABLE(rtems-inlines,
177[  --enable-rtems-inlines               enable RTEMS inline functions]
178[                                       (default:enabled, disable to use macros)],
179[case "${enableval}" in
180  yes) RTEMS_USE_MACROS=no ;;
181  no) RTEMS_USE_MACROS=yes ;;
182  *)  AC_MSG_ERROR(bad value ${enableval} for disable-rtems-inlines option) ;;
183esac],[RTEMS_USE_MACROS=no])
184AC_SUBST(RTEMS_USE_MACROS)dnl
185])
186
187dnl $Id$
188
189AC_DEFUN(RTEMS_ENABLE_LIBCDIR,
190[
191AC_ARG_ENABLE(libcdir,
192[  --enable-libcdir=directory           set the directory for the C library],
193[ RTEMS_LIBC_DIR="${enableval}" ; \
194test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] )
195AC_SUBST(RTEMS_LIBC_DIR)dnl
196])
197
198dnl $Id$
199
200dnl Override the set of BSPs to be built.
201dnl used by the toplevel configure script
202dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list)
203AC_DEFUN(RTEMS_ENABLE_RTEMSBSP,
204[
205AC_ARG_ENABLE(rtemsbsp,
206[  --enable-rtemsbsp=bsp1 bsp2 ..      BSPs to include in build],
207[case "${enableval}" in
208  yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);;
209  *) $1=$enableval;;
210esac],[$1=""])
211])
212
213dnl Pass a single BSP via an environment variable
214dnl used by per BSP configure scripts
215AC_DEFUN(RTEMS_ENV_RTEMSBSP,
216[dnl
217AC_MSG_CHECKING([for RTEMS_BSP])
218AC_CACHE_VAL(rtems_cv_RTEMS_BSP,
219[dnl
220  test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP";
221])dnl
222if test -z "$rtems_cv_RTEMS_BSP"; then
223  AC_MSG_ERROR([Missing RTEMS_BSP])
224fi
225RTEMS_BSP="$rtems_cv_RTEMS_BSP"
226AC_MSG_RESULT(${RTEMS_BSP})
227AC_SUBST(RTEMS_BSP)
228])
229
230dnl $Id$
231
232dnl check if RTEMS support a cpu
233AC_DEFUN(RTEMS_CHECK_CPU,
234[dnl
235AC_REQUIRE([RTEMS_TOP])
236AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])
237# Is this a supported CPU?
238AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
239if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then
240  AC_MSG_RESULT(yes)
241else
242  AC_MSG_ERROR(no)
243fi
244])dnl
245
246
247dnl $Id$
248
249AC_DEFUN(RTEMS_CANONICAL_HOST,
250[dnl
251AC_REQUIRE([AC_CANONICAL_HOST])
252RTEMS_HOST=$host_os
253changequote(,)dnl
254case "${target}" in
255  # hpux unix port should go here
256  i[3456]86-pc-linux*)         # unix "simulator" port
257        RTEMS_HOST=Linux
258        ;;
259  i[3456]86-*freebsd2*) # unix "simulator" port
260        RTEMS_HOST=FreeBSD
261        ;;
262  sparc-sun-solaris*)             # unix "simulator" port
263        RTEMS_HOST=Solaris
264        ;;
265  *)
266        ;;
267esac
268changequote([,])dnl
269AC_SUBST(RTEMS_HOST)
270])dnl
271
272dnl
273dnl $Id$
274dnl
275
276AC_DEFUN(RTEMS_PROJECT_ROOT,
277[dnl
278AC_REQUIRE([RTEMS_TOP])
279if test "$TARGET_SUBDIR" = "." ; then
280PROJECT_ROOT=$RTEMS_TOPdir/'$(top_builddir)';
281else
282PROJECT_ROOT=../$RTEMS_TOPdir/'$(top_builddir)'
283fi
284AC_SUBST(PROJECT_ROOT)
285
286RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP
287AC_SUBST(RTEMS_ROOT)
288
289INSTALL_CHANGE="\$(KSH) \$(PROJECT_ROOT)/tools/build/install-if-change"
290AC_SUBST(INSTALL_CHANGE)
291
292PACKHEX="\$(PROJECT_ROOT)/tools/build/packhex"
293AC_SUBST(PACKHEX)
294])
295
296
297dnl
298dnl $Id$
299dnl
300dnl Check for target gcc
301dnl
302dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
303dnl                             Completely reworked
304
305AC_DEFUN(RTEMS_PROG_CC,
306[
307AC_BEFORE([$0], [AC_PROG_CPP])dnl
308AC_BEFORE([$0], [AC_PROG_CC])dnl
309AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
310
311dnl Only accept gcc and cc
312dnl NOTE: This might be too restrictive for native compilation
313AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
314test -z "$CC_FOR_TARGET" \
315  && AC_MSG_ERROR([no acceptable cc found in \$PATH])
316
317dnl backup
318rtems_save_CC=$CC
319rtems_save_CFLAGS=$CFLAGS
320
321dnl temporarily set CC
322CC=$CC_FOR_TARGET
323
324AC_PROG_CC_WORKS
325AC_PROG_CC_GNU
326
327if test $ac_cv_prog_gcc = yes; then
328  GCC=yes
329dnl Check whether -g works, even if CFLAGS is set, in case the package
330dnl plays around with CFLAGS (such as to build both debugging and
331dnl normal versions of a library), tasteless as that idea is.
332  ac_test_CFLAGS="${CFLAGS+set}"
333  ac_save_CFLAGS="$CFLAGS"
334  CFLAGS=
335  AC_PROG_CC_G
336  if test "$ac_test_CFLAGS" = set; then
337    CFLAGS="$ac_save_CFLAGS"
338  elif test $ac_cv_prog_cc_g = yes; then
339    CFLAGS="-g -O2"
340  else
341    CFLAGS="-O2"
342  fi
343else
344  GCC=
345  test "${CFLAGS+set}" = set || CFLAGS="-g"
346fi
347
348rtems_cv_prog_gcc=$ac_cv_prog_gcc
349rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
350rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
351rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
352
353dnl restore initial values
354CC=$rtems_save_CC
355CFLAGS=$rtems_save_CFLAGS
356
357unset ac_cv_prog_gcc
358unset ac_cv_prog_cc_g
359unset ac_cv_prog_cc_works
360unset ac_cv_prog_cc_cross
361])
362
363AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET,
364[
365dnl check target cc
366RTEMS_PROG_CC
367dnl check if the compiler supports --specs
368RTEMS_GCC_SPECS
369dnl check if the target compiler may use --pipe
370RTEMS_GCC_PIPE
371dnl check if the compiler supports --specs if gcc28 is requested
372if test "$RTEMS_USE_GCC272" != "yes" ; then
373  if test "$rtems_cv_gcc_specs" = "no"; then
374    AC_MSG_WARN([*** disabling --enable-gcc28])
375      RTEMS_USE_GCC272=yes
376  fi
377fi
378test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
379
380dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-*
381case $host_os in
382*cygwin*)     GCCSED="| sed 's%\\\\%/%g'" ;;
383*) ;;
384esac
385AC_SUBST(GCCSED)
386])
387
388dnl
389dnl  $Id$
390dnl
391dnl Set program_prefix
392dnl
393dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
394dnl                             Extracted from configure
395
396AC_DEFUN(RTEMS_TOOL_PREFIX,
397[AC_REQUIRE([AC_CANONICAL_TARGET])dnl
398AC_REQUIRE([AC_CANONICAL_BUILD])dnl
399
400changequote(,)dnl
401if [ "${program_prefix}" = "NONE" ] ; then
402  if [ "${target}" = "${host}" ] ; then
403    program_prefix=
404  else
405    program_prefix=${target}-
406  fi
407fi
408changequote([,])dnl
409])
410
411dnl
412dnl $Id$
413dnl
414dnl Check whether the target compiler accepts -specs
415dnl
416dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
417dnl
418
419AC_DEFUN(RTEMS_GCC_SPECS,
420[AC_REQUIRE([RTEMS_PROG_CC])
421AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs,
422[
423rtems_cv_gcc_specs=no
424if test "$rtems_cv_prog_gcc" = "yes"; then
425  touch confspec
426  echo 'void f(){}' >conftest.c
427  if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then
428    rtems_cv_gcc_specs=yes
429  fi
430fi
431rm -f confspec conftest*
432])])
433
434dnl
435dnl $Id$
436dnl
437dnl Check whether the target compiler accepts -pipe
438dnl
439dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
440dnl
441
442AC_DEFUN(RTEMS_GCC_PIPE,
443[AC_REQUIRE([RTEMS_PROG_CC])
444AC_REQUIRE([AC_CANONICAL_HOST])
445AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe,
446[
447rtems_cv_gcc_pipe=no
448if test "$rtems_cv_prog_gcc" = "yes"; then
449case "$host_os" in
450  cygwin*)
451    ;;
452  *)
453    echo 'void f(){}' >conftest.c
454    if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then
455      rtems_cv_gcc_pipe=yes
456    fi
457    rm -f conftest*
458    ;;
459esac
460fi
461])
462])
463
464dnl
465dnl $Id$
466dnl
467dnl Set target tools
468dnl
469dnl 98/06/23 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
470dnl             fixing cache/environment variable handling
471dnl             adding checks for cygwin/egcs '\\'-bug
472dnl             adding checks for ranlib/ar -s problem
473dnl
474dnl 98/02/12 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
475dnl
476
477AC_DEFUN(RTEMS_GCC_PRINT,
478[ case $host_os in
479  *cygwin*)
480    dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/'
481    dnl        Should be removed once cygwin/egcs reports '/' only
482    $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' `
483    ;;
484  *)
485    $1=`$CC_FOR_TARGET --print-prog-name=$2`
486    ;;
487  esac
488])
489
490AC_DEFUN(RTEMS_PATH_TOOL,
491[
492AC_MSG_CHECKING([target's $2])
493AC_CACHE_VAL(ac_cv_path_$1,:)
494AC_MSG_RESULT([$ac_cv_path_$1])
495
496if test -n "$ac_cv_path_$1"; then
497  dnl retrieve the value from the cache
498  $1=$ac_cv_path_$1
499else
500  dnl the cache was not set
501  if test -z "[$]$1" ; then
502    if test "$rtems_cv_prog_gcc" = "yes"; then
503      # We are using gcc, ask it about its tool
504      # NOTE: Necessary if gcc was configured to use the target's
505      # native tools or uses prefixes for gnutools (e.g. gas instead of as)
506      RTEMS_GCC_PRINT($1,$2)
507    fi
508  else
509    # The user set an environment variable.
510    # Check whether it is an absolute path, otherwise AC_PATH_PROG
511    # will override the environment variable, which isn't what the user
512    # intends
513    AC_MSG_CHECKING([whether environment variable $1 is an absolute path])
514    case "[$]$1" in
515    /*) # valid
516      AC_MSG_RESULT("yes")
517    ;;
518    *)  # invalid for AC_PATH_PROG
519      AC_MSG_RESULT("no")
520      AC_MSG_ERROR([***]
521        [Environment variable $1 should either]
522        [be unset (preferred) or contain an absolute path])
523    ;;
524    esac
525  fi
526
527  AC_PATH_PROG($1,"$program_prefix"$2,$3)
528fi
529])
530
531AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
532[AC_REQUIRE([RTEMS_PROG_CC])dnl
533
534dnl FIXME: What shall be done if these tools are not available?
535  RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no)
536  RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no)
537  RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no)
538  RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no)
539
540dnl special treatment of ranlib
541  RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no)
542  if test "$RANLIB_FOR_TARGET" = "no"; then
543    # ranlib wasn't found; check if ar -s is available
544    RTEMS_AR_FOR_TARGET_S
545    if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
546      dnl override RANLIB_FOR_TARGET's cache
547      ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
548      RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
549    else
550      AC_MSG_ERROR([***]
551        [Can't figure out how to build a library index]
552        [Neither ranlib nor ar -s seem to be available] )
553    fi
554  fi
555
556dnl NOTE: These may not be available if not using gnutools
557  RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no)
558  RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no)
559  RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no)
560])
561
562dnl
563dnl $Id$
564dnl
565
566AC_DEFUN(RTEMS_AR_FOR_TARGET_S,
567[
568AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works,
569rtems_cv_AR_FOR_TARGET_S,
570[
571cat > conftest.$ac_ext <<EOF
572int foo( int b )
573{ return b; }
574EOF
575if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \
576  && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \
577  && test -s conftest.a ; \
578then
579  rtems_cv_AR_FOR_TARGET_S="yes"
580else
581  rtems_cv_AR_FOR_TARGET_S="no"
582fi
583  rm -f conftest*
584])
585])
586
587
588dnl $Id$
589
590AC_DEFUN(RTEMS_CHECK_NEWLIB,
591[dnl
592AC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET])dnl
593AC_REQUIRE([RTEMS_CANONICALIZE_TOOLS])dnl
594AC_CACHE_CHECK([for newlib],
595  rtems_cv_use_newlib,
596  [
597    rtems_save_CC=$CC
598    CC=$CC_FOR_TARGET
599
600dnl some versions of newlib provide not_required_by_rtems
601    AC_TRY_LINK(
602      [extern int not_required_by_rtems() ;],
603      [not_required_by_rtems()],
604      rtems_cv_use_newlib="yes")
605
606dnl older versions of newlib provided rtems_provides_crt0
607    if test -z "$rtems_cv_use_newlib"; then
608      AC_TRY_LINK(
609        [extern int rtems_provides_crt0 ;],
610        [rtems_provides_crt0 = 0],
611        rtems_cv_use_newlib="yes",
612        rtems_cv_use_newlib="no")
613    fi
614  CC=$rtems_save_CC])
615RTEMS_USE_NEWLIB="$rtems_cv_use_newlib"
616AC_SUBST(RTEMS_USE_NEWLIB)
617])
618
619
620dnl $Id$
621
622dnl Report all available bsps for a target,
623dnl check if a bsp-subdirectory is present for all bsps found
624dnl
625dnl RTEMS_CHECK_BSPS(bsp_list)
626AC_DEFUN(RTEMS_CHECK_BSPS,
627[
628AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target
629AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
630AC_MSG_CHECKING([for bsps])
631case "${target}" in
632changequote(,)dnl
633  i[3456]86-go32-rtems*)
634changequote([,])dnl
635    $1="go32 go32_p5"
636    ;;
637  *)
638    files=`ls $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU`
639    for file in $files; do
640      case $file in
641        shared*);;
642        Makefile*);;
643        READ*);;
644        CVS*);;
645        pxfl*);;
646        go32*);;       # so the i386 port can pick up the other Makefiles
647        # Now account for BSPs with build variants
648        gen68360)      rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
649        p4000)         rtems_bsp="$rtems_bsp p4600 p4650";;
650        mvme162)       rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
651        *) $1="[$]$1 $file";;
652      esac;
653    done
654    ;;
655esac
656AC_MSG_RESULT([[$]$1 .. done])
657])dnl
658
659AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP,
660[dnl
661AC_MSG_CHECKING([for make/custom/[$]$1.cfg])
662if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then
663  AC_MSG_RESULT([yes])
664else
665  AC_MSG_ERROR([no])
666fi
667])dnl
668
669dnl
670dnl $Id$
671dnl
672
673AC_DEFUN(RTEMS_CHECK_MULTIPROCESSING,
674[dnl
675AC_REQUIRE([RTEMS_TOP])dnl
676AC_REQUIRE([RTEMS_CHECK_CPU])dnl
677AC_CACHE_CHECK([whether BSP supports multiprocessing],
678  rtems_cv_HAS_MP,
679  [dnl
680    if test -d "$srcdir/${RTEMS_TOPdir}/c/src/lib/libbsp/${RTEMS_CPU}/${$1}/shmsupp"; then
681      if test "$RTEMS_HAS_MULTIPROCESSING" = "yes"; then
682        rtems_cv_HAS_MP="yes" ;
683      else
684        rtems_cv_HAS_MP="disabled";
685      fi
686    else
687      rtems_cv_HAS_MP="no";
688    fi])
689if test "$rtems_cv_HAS_MP" = "yes"; then
690HAS_MP="yes"
691else
692HAS_MP="no"
693fi
694AC_SUBST(HAS_MP)
695])
696
697dnl $Id$
698dnl
699AC_DEFUN(RTEMS_CHECK_POSIX_API,
700[dnl
701AC_REQUIRE([RTEMS_CHECK_CPU])dnl
702AC_CACHE_CHECK([whether BSP supports libposix],
703  rtems_cv_HAS_POSIX_API,
704  [dnl
705    case "$RTEMS_CPU" in
706    unix*)
707      rtems_cv_HAS_POSIX_API="no"
708      ;;
709    *)
710      if test "${RTEMS_HAS_POSIX_API}" = "yes"; then
711        rtems_cv_HAS_POSIX_API="yes";
712      else
713        rtems_cv_HAS_POSIX_API="disabled";
714      fi
715      ;;
716    esac])
717if test "$rtems_cv_HAS_POSIX_API" = "yes"; then
718  HAS_POSIX_API="yes";
719else
720  HAS_POSIX_API="no";
721fi
722AC_SUBST(HAS_POSIX_API)dnl
723])
724
725dnl
726dnl $Id$
727dnl
728dnl Check for System V IPC calls used by Unix simulators
729dnl
730dnl 98/07/17 Dario Alcocer     alcocer@netcom.com
731dnl          Ralf Corsepius    corsepiu@faw.uni-ulm.de
732dnl
733dnl Note: $host_os should probably *not* ever be used here to
734dnl determine if host supports System V IPC calls, since some
735dnl (e.g. FreeBSD 2.x) are configured by default to include only
736dnl a subset of the System V IPC calls.  Therefore, to make sure
737dnl all of the required calls are found, test for each call explicitly.
738dnl
739dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally
740dnl modify any existing key sets.  See the man pages for semget, shmget,
741dnl msgget, semctl, shmctl and msgctl for details.
742
743AC_DEFUN(RTEMS_UNION_SEMUN,
744[
745AC_CACHE_CHECK([whether $RTEMS_HOST defines union semun],
746  rtems_cv_HAS_UNION_SEMUN,
747  [AC_TRY_COMPILE([
748#include <sys/types.h>
749#include <sys/ipc.h>
750#include <sys/sem.h>],
751[union semun arg ;],
752[rtems_cv_HAS_UNION_SEMUN="yes"],
753[rtems_cv_HAS_UNION_SEMUN="no"])
754
755if test "$rtems_cv_HAS_UNION_SEMUN" = "yes"; then
756    AC_DEFINE(HAS_UNION_SEMUN)
757fi])
758])
759
760AC_DEFUN(RTEMS_SYSV_SEM,
761[AC_REQUIRE([AC_PROG_CC])
762AC_REQUIRE([RTEMS_CANONICAL_HOST])
763AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores,
764rtems_cv_sysv_sem,
765[
766AC_TRY_RUN(
767[
768#include <sys/types.h>
769#include <sys/ipc.h>
770#include <sys/sem.h>
771#if !HAS_UNION_SEMUN
772  union semun {
773    int val;
774    struct semid_ds *buf;
775    ushort *array;
776  } ;
777#endif
778int main () {
779  union semun arg ;
780
781  int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
782  if (id == -1)
783    exit(1);
784  arg.val = 0; /* avoid implicit type cast to union */
785  if (semctl(id, 0, IPC_RMID, arg) == -1)
786    exit(1);
787  exit(0);
788}
789],
790rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :)
791])
792])
793
794AC_DEFUN(RTEMS_SYSV_SHM,
795[AC_REQUIRE([AC_PROG_CC])
796AC_REQUIRE([RTEMS_CANONICAL_HOST])
797AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory,
798rtems_cv_sysv_shm,
799[
800AC_TRY_RUN([
801#include <sys/types.h>
802#include <sys/ipc.h>
803#include <sys/shm.h>
804int main () {
805  int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
806  if (id == -1)
807    exit(1);
808  if (shmctl(id, IPC_RMID, 0) == -1)
809    exit(1);
810  exit(0);
811}
812],
813rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :)
814])
815])
816
817AC_DEFUN(RTEMS_SYSV_MSG,
818[AC_REQUIRE([AC_PROG_CC])
819AC_REQUIRE([RTEMS_CANONICAL_HOST])
820AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages,
821rtems_cv_sysv_msg,
822[
823AC_TRY_RUN([
824#include <sys/types.h>
825#include <sys/ipc.h>
826#include <sys/msg.h>
827int main () {
828  int id=msgget(IPC_PRIVATE,IPC_CREAT|0400);
829  if (id == -1)
830    exit(1);
831  if (msgctl(id, IPC_RMID, 0) == -1)
832    exit(1);
833  exit(0);
834}
835],
836rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :)
837])
838])
839
840AC_DEFUN(RTEMS_CHECK_SYSV_UNIX,
841[AC_REQUIRE([RTEMS_CANONICAL_HOST])
842if test "$RTEMS_CPU" = "unix" ; then
843  RTEMS_UNION_SEMUN
844  RTEMS_SYSV_SEM
845  if test "$rtems_cv_sysv_sem" != "yes" ; then
846    AC_MSG_ERROR([System V semaphores don't work, required by simulator])
847  fi
848  RTEMS_SYSV_SHM
849  if test "$rtems_cv_sysv_shm" != "yes" ; then
850    AC_MSG_ERROR([System V shared memory doesn't work, required by simulator])
851  fi
852  RTEMS_SYSV_MSG
853  if test "$rtems_cv_sysv_msg" != "yes" ; then
854    AC_MSG_ERROR([System V messages don't work, required by simulator])
855  fi
856fi
857])
858
859dnl
860dnl $Id$
861dnl
862
863dnl RTEMS_CHECK_MAKEFILE(path)
864dnl Search for Makefile.in's within the directory starting
865dnl at path and append an entry for Makefile to global variable
866dnl "makefiles" (from configure.in) for each Makefile.in found
867dnl
868AC_DEFUN(RTEMS_CHECK_MAKEFILE,
869[RTEMS_CHECK_FILES_IN($1,Makefile,makefiles)
870])
871
872dnl
873dnl $Id$
874dnl
875
876dnl RTEMS_CHECK_FILES_IN(path,file,var)
877dnl path .. path relative to srcdir, where to start searching for files
878dnl file .. name of the files to search for
879dnl var  .. shell variable to append files found
880
881AC_DEFUN(RTEMS_CHECK_FILES_IN,
882[
883AC_MSG_CHECKING(for $2.in in $1)
884if test -d $srcdir/$1; then
885  rtems_av_save_dir=`pwd`;
886  cd $srcdir;
887  rtems_av_tmp=`find $1 -name "$2.in" -print | sed "s/$2\.in/%/" | sort | sed "s/%/$2/"`
888  $3="$$3 $rtems_av_tmp";
889  cd $rtems_av_save_dir;
890  AC_MSG_RESULT(done)
891else
892  AC_MSG_RESULT(no)
893fi
894])
895
896
Note: See TracBrowser for help on using the repository browser.