source: rtems/c/src/lib/start/a29k/aclocal.m4 @ a24c280

4.104.114.84.95
Last change on this file since a24c280 was a24c280, checked in by Joel Sherrill <joel.sherrill@…>, on 09/09/99 at 21:22:36

Applied patch rtems-rc-19990820-6.diff.gz from
Ralf Corsepius <corsepiu@…> which converted many
Makefile.in's to Makefile.am's. This added a lot of files.

  • Property mode set to 100644
File size: 14.6 KB
Line 
1dnl aclocal.m4 generated automatically by aclocal 1.4
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_LIBCDIR,
124[
125AC_ARG_ENABLE(libcdir,
126[  --enable-libcdir=directory           set the directory for the C library],
127[ RTEMS_LIBC_DIR="${enableval}" ; \
128test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] )
129AC_SUBST(RTEMS_LIBC_DIR)dnl
130])
131
132AC_DEFUN(RTEMS_ENABLE_BARE,
133[
134AC_ARG_ENABLE(bare-cpu-cflags,
135[  --enable-bare-cpu-cflags             specify a particular cpu cflag]
136[                                       (bare bsp specific)],
137[case "${enableval}" in
138  no) BARE_CPU_CFLAGS="" ;;
139  *)    BARE_CPU_CFLAGS="${enableval}" ;;
140esac],
141[BARE_CPU_CFLAGS=""])
142
143AC_ARG_ENABLE(bare-cpu-model,
144[  --enable-bare-cpu-model              specify a particular cpu model]
145[                                       (bare bsp specific)],
146[case "${enableval}" in
147  no)   BARE_CPU_MODEL="" ;;
148  *)    BARE_CPU_MODEL="${enableval}" ;;
149esac],
150[BARE_CPU_MODEL=""])
151])
152
153
154dnl $Id$
155
156dnl Override the set of BSPs to be built.
157dnl used by the toplevel configure script
158dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list)
159AC_DEFUN(RTEMS_ENABLE_RTEMSBSP,
160[
161AC_ARG_ENABLE(rtemsbsp,
162[  --enable-rtemsbsp=bsp1 bsp2 ..      BSPs to include in build],
163[case "${enableval}" in
164  yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);;
165  *) $1=$enableval;;
166esac],[$1=""])
167])
168
169dnl Pass a single BSP via an environment variable
170dnl used by per BSP configure scripts
171AC_DEFUN(RTEMS_ENV_RTEMSBSP,
172[dnl
173AC_MSG_CHECKING([for RTEMS_BSP])
174AC_CACHE_VAL(rtems_cv_RTEMS_BSP,
175[dnl
176  test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP";
177])dnl
178if test -z "$rtems_cv_RTEMS_BSP"; then
179  AC_MSG_ERROR([Missing RTEMS_BSP])
180fi
181RTEMS_BSP="$rtems_cv_RTEMS_BSP"
182AC_MSG_RESULT(${RTEMS_BSP})
183AC_SUBST(RTEMS_BSP)
184])
185
186dnl $Id$
187
188dnl check if RTEMS support a cpu
189AC_DEFUN(RTEMS_CHECK_CPU,
190[dnl
191AC_REQUIRE([RTEMS_TOP])
192AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU])
193# Is this a supported CPU?
194AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported])
195if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then
196  AC_MSG_RESULT(yes)
197else
198  AC_MSG_ERROR(no)
199fi
200])dnl
201
202
203dnl $Id$
204
205AC_DEFUN(RTEMS_CANONICAL_HOST,
206[dnl
207AC_REQUIRE([AC_CANONICAL_HOST])
208RTEMS_HOST=$host_os
209changequote(,)dnl
210case "${target}" in
211  # hpux unix port should go here
212  i[3456]86-pc-linux*)         # unix "simulator" port
213        RTEMS_HOST=Linux
214        ;;
215  i[3456]86-*freebsd2*) # unix "simulator" port
216        RTEMS_HOST=FreeBSD
217        ;;
218  sparc-sun-solaris*)             # unix "simulator" port
219        RTEMS_HOST=Solaris
220        ;;
221  *)
222        ;;
223esac
224changequote([,])dnl
225AC_SUBST(RTEMS_HOST)
226])dnl
227
228dnl
229dnl $Id$
230dnl
231
232AC_DEFUN(RTEMS_PROJECT_ROOT,
233[dnl
234AC_REQUIRE([RTEMS_TOP])
235if test "$TARGET_SUBDIR" = "." ; then
236PROJECT_ROOT=$RTEMS_TOPdir/'$(top_builddir)';
237else
238PROJECT_ROOT=../$RTEMS_TOPdir/'$(top_builddir)'
239fi
240AC_SUBST(PROJECT_ROOT)
241
242RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP
243AC_SUBST(RTEMS_ROOT)
244
245INSTALL_CHANGE="\$(KSH) \$(PROJECT_ROOT)/tools/build/install-if-change"
246AC_SUBST(INSTALL_CHANGE)
247
248PACKHEX="\$(PROJECT_ROOT)/tools/build/packhex"
249AC_SUBST(PACKHEX)
250])
251
252
253dnl
254dnl $Id$
255dnl
256dnl Check for target gcc
257dnl
258dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
259dnl                             Completely reworked
260
261AC_DEFUN(RTEMS_PROG_CC,
262[
263AC_BEFORE([$0], [AC_PROG_CPP])dnl
264AC_BEFORE([$0], [AC_PROG_CC])dnl
265AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl
266
267dnl Only accept gcc and cc
268dnl NOTE: This might be too restrictive for native compilation
269AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc )
270test -z "$CC_FOR_TARGET" \
271  && AC_MSG_ERROR([no acceptable cc found in \$PATH])
272
273dnl backup
274rtems_save_CC=$CC
275rtems_save_CFLAGS=$CFLAGS
276
277dnl temporarily set CC
278CC=$CC_FOR_TARGET
279
280AC_PROG_CC_WORKS
281AC_PROG_CC_GNU
282
283if test $ac_cv_prog_gcc = yes; then
284  GCC=yes
285dnl Check whether -g works, even if CFLAGS is set, in case the package
286dnl plays around with CFLAGS (such as to build both debugging and
287dnl normal versions of a library), tasteless as that idea is.
288  ac_test_CFLAGS="${CFLAGS+set}"
289  ac_save_CFLAGS="$CFLAGS"
290  CFLAGS=
291  AC_PROG_CC_G
292  if test "$ac_test_CFLAGS" = set; then
293    CFLAGS="$ac_save_CFLAGS"
294  elif test $ac_cv_prog_cc_g = yes; then
295    CFLAGS="-g -O2"
296  else
297    CFLAGS="-O2"
298  fi
299else
300  GCC=
301  test "${CFLAGS+set}" = set || CFLAGS="-g"
302fi
303
304rtems_cv_prog_gcc=$ac_cv_prog_gcc
305rtems_cv_prog_cc_g=$ac_cv_prog_cc_g
306rtems_cv_prog_cc_works=$ac_cv_prog_cc_works
307rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross
308
309dnl restore initial values
310CC=$rtems_save_CC
311CFLAGS=$rtems_save_CFLAGS
312
313unset ac_cv_prog_gcc
314unset ac_cv_prog_cc_g
315unset ac_cv_prog_cc_works
316unset ac_cv_prog_cc_cross
317])
318
319AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET,
320[
321dnl check target cc
322RTEMS_PROG_CC
323dnl check if the compiler supports --specs
324RTEMS_GCC_SPECS
325dnl check if the target compiler may use --pipe
326RTEMS_GCC_PIPE
327dnl check if the compiler supports --specs if gcc28 is requested
328if test "$RTEMS_USE_GCC272" != "yes" ; then
329  if test "$rtems_cv_gcc_specs" = "no"; then
330    AC_MSG_WARN([*** disabling --enable-gcc28])
331      RTEMS_USE_GCC272=yes
332  fi
333fi
334test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe"
335
336dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-*
337case $host_os in
338*cygwin*)     GCCSED="| sed 's%\\\\%/%g'" ;;
339*) ;;
340esac
341AC_SUBST(GCCSED)
342])
343
344dnl
345dnl  $Id$
346dnl
347dnl Set program_prefix
348dnl
349dnl 98/05/20 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
350dnl                             Extracted from configure
351
352AC_DEFUN(RTEMS_TOOL_PREFIX,
353[AC_REQUIRE([AC_CANONICAL_TARGET])dnl
354AC_REQUIRE([AC_CANONICAL_BUILD])dnl
355
356changequote(,)dnl
357if [ "${program_prefix}" = "NONE" ] ; then
358  if [ "${target}" = "${host}" ] ; then
359    program_prefix=
360  else
361    program_prefix=${target}-
362  fi
363fi
364changequote([,])dnl
365])
366
367dnl
368dnl $Id$
369dnl
370dnl Check whether the target compiler accepts -specs
371dnl
372dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
373dnl
374
375AC_DEFUN(RTEMS_GCC_SPECS,
376[AC_REQUIRE([RTEMS_PROG_CC])
377AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs,
378[
379rtems_cv_gcc_specs=no
380if test "$rtems_cv_prog_gcc" = "yes"; then
381  touch confspec
382  echo 'void f(){}' >conftest.c
383  if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then
384    rtems_cv_gcc_specs=yes
385  fi
386fi
387rm -f confspec conftest*
388])])
389
390dnl
391dnl $Id$
392dnl
393dnl Check whether the target compiler accepts -pipe
394dnl
395dnl 98/02/11 Ralf Corsepius     corsepiu@faw.uni-ulm.de
396dnl
397
398AC_DEFUN(RTEMS_GCC_PIPE,
399[AC_REQUIRE([RTEMS_PROG_CC])
400AC_REQUIRE([AC_CANONICAL_HOST])
401AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe,
402[
403rtems_cv_gcc_pipe=no
404if test "$rtems_cv_prog_gcc" = "yes"; then
405case "$host_os" in
406  cygwin*)
407    ;;
408  *)
409    echo 'void f(){}' >conftest.c
410    if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then
411      rtems_cv_gcc_pipe=yes
412    fi
413    rm -f conftest*
414    ;;
415esac
416fi
417])
418])
419
420dnl
421dnl $Id$
422dnl
423dnl Set target tools
424dnl
425dnl 98/06/23 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
426dnl             fixing cache/environment variable handling
427dnl             adding checks for cygwin/egcs '\\'-bug
428dnl             adding checks for ranlib/ar -s problem
429dnl
430dnl 98/02/12 Ralf Corsepius     (corsepiu@faw.uni-ulm.de)
431dnl
432
433AC_DEFUN(RTEMS_GCC_PRINT,
434[ case $host_os in
435  *cygwin*)
436    dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/'
437    dnl        Should be removed once cygwin/egcs reports '/' only
438    $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' `
439    ;;
440  *)
441    $1=`$CC_FOR_TARGET --print-prog-name=$2`
442    ;;
443  esac
444])
445
446AC_DEFUN(RTEMS_PATH_TOOL,
447[
448AC_MSG_CHECKING([target's $2])
449AC_CACHE_VAL(ac_cv_path_$1,:)
450AC_MSG_RESULT([$ac_cv_path_$1])
451
452if test -n "$ac_cv_path_$1"; then
453  dnl retrieve the value from the cache
454  $1=$ac_cv_path_$1
455else
456  dnl the cache was not set
457  if test -z "[$]$1" ; then
458    if test "$rtems_cv_prog_gcc" = "yes"; then
459      # We are using gcc, ask it about its tool
460      # NOTE: Necessary if gcc was configured to use the target's
461      # native tools or uses prefixes for gnutools (e.g. gas instead of as)
462      RTEMS_GCC_PRINT($1,$2)
463    fi
464  else
465    # The user set an environment variable.
466    # Check whether it is an absolute path, otherwise AC_PATH_PROG
467    # will override the environment variable, which isn't what the user
468    # intends
469    AC_MSG_CHECKING([whether environment variable $1 is an absolute path])
470    case "[$]$1" in
471    /*) # valid
472      AC_MSG_RESULT("yes")
473    ;;
474    *)  # invalid for AC_PATH_PROG
475      AC_MSG_RESULT("no")
476      AC_MSG_ERROR([***]
477        [Environment variable $1 should either]
478        [be unset (preferred) or contain an absolute path])
479    ;;
480    esac
481  fi
482
483  AC_PATH_PROG($1,"$program_prefix"$2,$3)
484fi
485])
486
487AC_DEFUN(RTEMS_CANONICALIZE_TOOLS,
488[AC_REQUIRE([RTEMS_PROG_CC])dnl
489
490dnl FIXME: What shall be done if these tools are not available?
491  RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no)
492  RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no)
493  RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no)
494  RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no)
495
496dnl special treatment of ranlib
497  RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no)
498  if test "$RANLIB_FOR_TARGET" = "no"; then
499    # ranlib wasn't found; check if ar -s is available
500    RTEMS_AR_FOR_TARGET_S
501    if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then
502      dnl override RANLIB_FOR_TARGET's cache
503      ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s"
504      RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET
505    else
506      AC_MSG_ERROR([***]
507        [Can't figure out how to build a library index]
508        [Neither ranlib nor ar -s seem to be available] )
509    fi
510  fi
511
512dnl NOTE: These may not be available if not using gnutools
513  RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no)
514  RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no)
515  RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no)
516])
517
518dnl
519dnl $Id$
520dnl
521
522AC_DEFUN(RTEMS_AR_FOR_TARGET_S,
523[
524AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works,
525rtems_cv_AR_FOR_TARGET_S,
526[
527cat > conftest.$ac_ext <<EOF
528int foo( int b )
529{ return b; }
530EOF
531if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \
532  && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \
533  && test -s conftest.a ; \
534then
535  rtems_cv_AR_FOR_TARGET_S="yes"
536else
537  rtems_cv_AR_FOR_TARGET_S="no"
538fi
539  rm -f conftest*
540])
541])
542
543
544dnl $Id$
545
546dnl Report all available bsps for a target,
547dnl check if a bsp-subdirectory is present for all bsps found
548dnl
549dnl RTEMS_CHECK_BSPS(bsp_list)
550AC_DEFUN(RTEMS_CHECK_BSPS,
551[
552AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target
553AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir
554AC_MSG_CHECKING([for bsps])
555case "${target}" in
556changequote(,)dnl
557  i[3456]86-go32-rtems*)
558changequote([,])dnl
559    $1="go32 go32_p5"
560    ;;
561  *)
562    files=`ls $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU`
563    for file in $files; do
564      case $file in
565        shared*);;
566        Makefile*);;
567        READ*);;
568        CVS*);;
569        pxfl*);;
570        go32*);;       # so the i386 port can pick up the other Makefiles
571        # Now account for BSPs with build variants
572        gen68360)      rtems_bsp="$rtems_bsp gen68360 gen68360_040";;
573        p4000)         rtems_bsp="$rtems_bsp p4600 p4650";;
574        mvme162)       rtems_bsp="$rtems_bsp mvme162 mvme162lx";;
575        *) $1="[$]$1 $file";;
576      esac;
577    done
578    ;;
579esac
580AC_MSG_RESULT([[$]$1 .. done])
581])dnl
582
583AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP,
584[dnl
585AC_MSG_CHECKING([for make/custom/[$]$1.cfg])
586if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then
587  AC_MSG_RESULT([yes])
588else
589  AC_MSG_ERROR([no])
590fi
591])dnl
592
593dnl
594dnl  $Id$
595dnl
596
597dnl RTEMS_BSP_ALIAS(BSP_ALIAS,BSP_RETURNED)
598dnl convert a bsp alias $1 into its bsp directory $2
599AC_DEFUN(RTEMS_BSP_ALIAS,
600[
601    # account for "aliased" bsps which share source code
602    case $1 in
603      mvme162lx)    $2=mvme162  ;;  # mvme162 board variant
604      gen68360_040) $2=gen68360 ;;  # 68360 in companion mode
605      go32_p5)      $2=go32     ;;  # go32 on Pentium class CPU
606      p4600)        $2=p4000    ;;  # p4000 board with IDT 4600
607      p4650)        $2=p4000    ;;  # p4000 board with IDT 4650
608      *)            $2=$1;;
609    esac
610])
611
Note: See TracBrowser for help on using the repository browser.