[eb299afc] | 1 | dnl aclocal.m4 generated automatically by aclocal 1.4 |
---|
| 2 | |
---|
| 3 | dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. |
---|
| 4 | dnl This file is free software; the Free Software Foundation |
---|
| 5 | dnl gives unlimited permission to copy and/or distribute it, |
---|
| 6 | dnl with or without modifications, as long as this notice is preserved. |
---|
| 7 | |
---|
| 8 | dnl This program is distributed in the hope that it will be useful, |
---|
| 9 | dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without |
---|
| 10 | dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
---|
| 11 | dnl PARTICULAR PURPOSE. |
---|
| 12 | |
---|
| 13 | dnl $Id$ |
---|
| 14 | |
---|
| 15 | dnl |
---|
| 16 | dnl RTEMS_TOP($1) |
---|
| 17 | dnl |
---|
| 18 | dnl $1 .. relative path from this configure.in to the toplevel configure.in |
---|
| 19 | dnl |
---|
| 20 | AC_DEFUN(RTEMS_TOP, |
---|
| 21 | [dnl |
---|
| 22 | AC_ARG_WITH(target-subdir, |
---|
| 23 | [ --with-target-subdir=DIR], |
---|
| 24 | TARGET_SUBDIR="$withval", |
---|
| 25 | TARGET_SUBDIR=".") |
---|
| 26 | |
---|
| 27 | RTEMS_TOPdir="$1"; |
---|
| 28 | AC_SUBST(RTEMS_TOPdir) |
---|
| 29 | |
---|
| 30 | dnl Determine RTEMS Version string from the VERSION file |
---|
| 31 | dnl Hopefully, Joel never changes its format ;- |
---|
| 32 | AC_MSG_CHECKING([for RTEMS Version]) |
---|
| 33 | if test -r "${srcdir}/${RTEMS_TOPdir}/VERSION"; then |
---|
| 34 | changequote(,)dnl |
---|
| 35 | RTEMS_VERSION=`grep Version ${srcdir}/${RTEMS_TOPdir}/VERSION | \ |
---|
| 36 | sed -e 's%RTEMS[ ]*Version[ ]*\(.*\)[ ]*%\1%g'` |
---|
| 37 | changequote([,])dnl |
---|
| 38 | else |
---|
| 39 | AC_MSG_ERROR(Unable to find ${RTEMS_TOPdir}/VERSION) |
---|
| 40 | fi |
---|
| 41 | if test -z "$RTEMS_VERSION"; then |
---|
| 42 | AC_MSG_ERROR(Unable to determine version) |
---|
| 43 | fi |
---|
| 44 | AC_MSG_RESULT($RTEMS_VERSION) |
---|
| 45 | ])dnl |
---|
| 46 | |
---|
[e1d8abb] | 47 | dnl $Id$ |
---|
| 48 | |
---|
| 49 | AC_DEFUN(RTEMS_ENABLE_CXX, |
---|
| 50 | [ |
---|
| 51 | AC_ARG_ENABLE(cxx, |
---|
| 52 | [ --enable-cxx enable C++ support,] |
---|
| 53 | [ and build the rtems++ library], |
---|
| 54 | [case "${enableval}" in |
---|
| 55 | yes) RTEMS_HAS_CPLUSPLUS=yes ;; |
---|
| 56 | no) RTEMS_HAS_CPLUSPLUS=no ;; |
---|
| 57 | *) AC_MSG_ERROR(bad value ${enableval} for enable-cxx option) ;; |
---|
| 58 | esac], [RTEMS_HAS_CPLUSPLUS=no]) |
---|
| 59 | ]) |
---|
| 60 | |
---|
[eb299afc] | 61 | dnl |
---|
| 62 | dnl $Id$ |
---|
| 63 | dnl |
---|
| 64 | |
---|
| 65 | dnl canonicalize target cpu |
---|
| 66 | dnl NOTE: Most rtems targets do not fullfil autoconf's |
---|
| 67 | dnl target naming conventions "processor-vendor-os" |
---|
| 68 | dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them |
---|
| 69 | dnl and we have to fix it for rtems ourselves |
---|
| 70 | |
---|
| 71 | AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU, |
---|
| 72 | [ |
---|
| 73 | AC_CANONICAL_SYSTEM |
---|
| 74 | AC_MSG_CHECKING(rtems target cpu) |
---|
| 75 | changequote(,)dnl |
---|
| 76 | case "${target}" in |
---|
| 77 | # hpux unix port should go here |
---|
| 78 | i[3456]86-go32-rtems*) |
---|
| 79 | RTEMS_CPU=i386 |
---|
| 80 | ;; |
---|
| 81 | i[3456]86-pc-linux*) # unix "simulator" port |
---|
| 82 | RTEMS_CPU=unix |
---|
| 83 | ;; |
---|
| 84 | i[3456]86-*freebsd2*) # unix "simulator" port |
---|
| 85 | RTEMS_CPU=unix |
---|
| 86 | ;; |
---|
| 87 | no_cpu-*rtems*) |
---|
| 88 | RTEMS_CPU=no_cpu |
---|
| 89 | ;; |
---|
| 90 | sparc-sun-solaris*) # unix "simulator" port |
---|
| 91 | RTEMS_CPU=unix |
---|
| 92 | ;; |
---|
| 93 | *) |
---|
| 94 | RTEMS_CPU=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'` |
---|
| 95 | ;; |
---|
| 96 | esac |
---|
| 97 | changequote([,])dnl |
---|
| 98 | AC_SUBST(RTEMS_CPU) |
---|
| 99 | AC_MSG_RESULT($RTEMS_CPU) |
---|
| 100 | ]) |
---|
| 101 | |
---|
| 102 | # Do all the work for Automake. This macro actually does too much -- |
---|
| 103 | # some checks are only needed if your package does certain things. |
---|
| 104 | # But this isn't really a big deal. |
---|
| 105 | |
---|
| 106 | # serial 1 |
---|
| 107 | |
---|
| 108 | dnl Usage: |
---|
| 109 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) |
---|
| 110 | |
---|
| 111 | AC_DEFUN(AM_INIT_AUTOMAKE, |
---|
| 112 | [AC_REQUIRE([AC_PROG_INSTALL]) |
---|
| 113 | PACKAGE=[$1] |
---|
| 114 | AC_SUBST(PACKAGE) |
---|
| 115 | VERSION=[$2] |
---|
| 116 | AC_SUBST(VERSION) |
---|
| 117 | dnl test to see if srcdir already configured |
---|
| 118 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then |
---|
| 119 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) |
---|
| 120 | fi |
---|
| 121 | ifelse([$3],, |
---|
| 122 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) |
---|
| 123 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) |
---|
| 124 | AC_REQUIRE([AM_SANITY_CHECK]) |
---|
| 125 | AC_REQUIRE([AC_ARG_PROGRAM]) |
---|
| 126 | dnl FIXME This is truly gross. |
---|
| 127 | missing_dir=`cd $ac_aux_dir && pwd` |
---|
| 128 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) |
---|
| 129 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) |
---|
| 130 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) |
---|
| 131 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) |
---|
| 132 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) |
---|
| 133 | AC_REQUIRE([AC_PROG_MAKE_SET])]) |
---|
| 134 | |
---|
| 135 | # |
---|
| 136 | # Check to make sure that the build environment is sane. |
---|
| 137 | # |
---|
| 138 | |
---|
| 139 | AC_DEFUN(AM_SANITY_CHECK, |
---|
| 140 | [AC_MSG_CHECKING([whether build environment is sane]) |
---|
| 141 | # Just in case |
---|
| 142 | sleep 1 |
---|
| 143 | echo timestamp > conftestfile |
---|
| 144 | # Do `set' in a subshell so we don't clobber the current shell's |
---|
| 145 | # arguments. Must try -L first in case configure is actually a |
---|
| 146 | # symlink; some systems play weird games with the mod time of symlinks |
---|
| 147 | # (eg FreeBSD returns the mod time of the symlink's containing |
---|
| 148 | # directory). |
---|
| 149 | if ( |
---|
| 150 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` |
---|
| 151 | if test "[$]*" = "X"; then |
---|
| 152 | # -L didn't work. |
---|
| 153 | set X `ls -t $srcdir/configure conftestfile` |
---|
| 154 | fi |
---|
| 155 | if test "[$]*" != "X $srcdir/configure conftestfile" \ |
---|
| 156 | && test "[$]*" != "X conftestfile $srcdir/configure"; then |
---|
| 157 | |
---|
| 158 | # If neither matched, then we have a broken ls. This can happen |
---|
| 159 | # if, for instance, CONFIG_SHELL is bash and it inherits a |
---|
| 160 | # broken ls alias from the environment. This has actually |
---|
| 161 | # happened. Such a system could not be considered "sane". |
---|
| 162 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken |
---|
| 163 | alias in your environment]) |
---|
| 164 | fi |
---|
| 165 | |
---|
| 166 | test "[$]2" = conftestfile |
---|
| 167 | ) |
---|
| 168 | then |
---|
| 169 | # Ok. |
---|
| 170 | : |
---|
| 171 | else |
---|
| 172 | AC_MSG_ERROR([newly created file is older than distributed files! |
---|
| 173 | Check your system clock]) |
---|
| 174 | fi |
---|
| 175 | rm -f conftest* |
---|
| 176 | AC_MSG_RESULT(yes)]) |
---|
| 177 | |
---|
| 178 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) |
---|
| 179 | dnl The program must properly implement --version. |
---|
| 180 | AC_DEFUN(AM_MISSING_PROG, |
---|
| 181 | [AC_MSG_CHECKING(for working $2) |
---|
| 182 | # Run test in a subshell; some versions of sh will print an error if |
---|
| 183 | # an executable is not found, even if stderr is redirected. |
---|
| 184 | # Redirect stdin to placate older versions of autoconf. Sigh. |
---|
| 185 | if ($2 --version) < /dev/null > /dev/null 2>&1; then |
---|
| 186 | $1=$2 |
---|
| 187 | AC_MSG_RESULT(found) |
---|
| 188 | else |
---|
| 189 | $1="$3/missing $2" |
---|
| 190 | AC_MSG_RESULT(missing) |
---|
| 191 | fi |
---|
| 192 | AC_SUBST($1)]) |
---|
| 193 | |
---|
| 194 | # Add --enable-maintainer-mode option to configure. |
---|
| 195 | # From Jim Meyering |
---|
| 196 | |
---|
| 197 | # serial 1 |
---|
| 198 | |
---|
| 199 | AC_DEFUN(AM_MAINTAINER_MODE, |
---|
| 200 | [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) |
---|
| 201 | dnl maintainer-mode is disabled by default |
---|
| 202 | AC_ARG_ENABLE(maintainer-mode, |
---|
| 203 | [ --enable-maintainer-mode enable make rules and dependencies not useful |
---|
| 204 | (and sometimes confusing) to the casual installer], |
---|
| 205 | USE_MAINTAINER_MODE=$enableval, |
---|
| 206 | USE_MAINTAINER_MODE=no) |
---|
| 207 | AC_MSG_RESULT($USE_MAINTAINER_MODE) |
---|
| 208 | AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) |
---|
| 209 | MAINT=$MAINTAINER_MODE_TRUE |
---|
| 210 | AC_SUBST(MAINT)dnl |
---|
| 211 | ] |
---|
| 212 | ) |
---|
| 213 | |
---|
| 214 | # Define a conditional. |
---|
| 215 | |
---|
| 216 | AC_DEFUN(AM_CONDITIONAL, |
---|
| 217 | [AC_SUBST($1_TRUE) |
---|
| 218 | AC_SUBST($1_FALSE) |
---|
| 219 | if $2; then |
---|
| 220 | $1_TRUE= |
---|
| 221 | $1_FALSE='#' |
---|
| 222 | else |
---|
| 223 | $1_TRUE='#' |
---|
| 224 | $1_FALSE= |
---|
| 225 | fi]) |
---|
| 226 | |
---|
| 227 | dnl $Id$ |
---|
| 228 | |
---|
| 229 | dnl Override the set of BSPs to be built. |
---|
| 230 | dnl used by the toplevel configure script |
---|
| 231 | dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list) |
---|
| 232 | AC_DEFUN(RTEMS_ENABLE_RTEMSBSP, |
---|
| 233 | [ |
---|
| 234 | AC_ARG_ENABLE(rtemsbsp, |
---|
| 235 | [ --enable-rtemsbsp=bsp1 bsp2 .. BSPs to include in build], |
---|
| 236 | [case "${enableval}" in |
---|
| 237 | yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);; |
---|
| 238 | *) $1=$enableval;; |
---|
| 239 | esac],[$1=""]) |
---|
| 240 | ]) |
---|
| 241 | |
---|
| 242 | dnl Pass a single BSP via an environment variable |
---|
| 243 | dnl used by per BSP configure scripts |
---|
| 244 | AC_DEFUN(RTEMS_ENV_RTEMSBSP, |
---|
| 245 | [dnl |
---|
| 246 | AC_MSG_CHECKING([for RTEMS_BSP]) |
---|
| 247 | AC_CACHE_VAL(rtems_cv_RTEMS_BSP, |
---|
| 248 | [dnl |
---|
| 249 | test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP"; |
---|
| 250 | ])dnl |
---|
| 251 | if test -z "$rtems_cv_RTEMS_BSP"; then |
---|
| 252 | AC_MSG_ERROR([Missing RTEMS_BSP]) |
---|
| 253 | fi |
---|
| 254 | RTEMS_BSP="$rtems_cv_RTEMS_BSP" |
---|
| 255 | AC_MSG_RESULT(${RTEMS_BSP}) |
---|
| 256 | AC_SUBST(RTEMS_BSP) |
---|
| 257 | ]) |
---|
| 258 | |
---|
| 259 | dnl $Id$ |
---|
| 260 | |
---|
| 261 | dnl check if RTEMS support a cpu |
---|
| 262 | AC_DEFUN(RTEMS_CHECK_CPU, |
---|
| 263 | [dnl |
---|
| 264 | AC_REQUIRE([RTEMS_TOP]) |
---|
| 265 | AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU]) |
---|
| 266 | # Is this a supported CPU? |
---|
| 267 | AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported]) |
---|
| 268 | if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then |
---|
| 269 | AC_MSG_RESULT(yes) |
---|
| 270 | else |
---|
| 271 | AC_MSG_ERROR(no) |
---|
| 272 | fi |
---|
| 273 | ])dnl |
---|
| 274 | |
---|
| 275 | |
---|
| 276 | dnl $Id$ |
---|
| 277 | |
---|
| 278 | AC_DEFUN(RTEMS_CANONICAL_HOST, |
---|
| 279 | [dnl |
---|
| 280 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
| 281 | RTEMS_HOST=$host_os |
---|
| 282 | changequote(,)dnl |
---|
| 283 | case "${target}" in |
---|
| 284 | # hpux unix port should go here |
---|
| 285 | i[3456]86-pc-linux*) # unix "simulator" port |
---|
| 286 | RTEMS_HOST=Linux |
---|
| 287 | ;; |
---|
| 288 | i[3456]86-*freebsd2*) # unix "simulator" port |
---|
| 289 | RTEMS_HOST=FreeBSD |
---|
| 290 | ;; |
---|
| 291 | sparc-sun-solaris*) # unix "simulator" port |
---|
| 292 | RTEMS_HOST=Solaris |
---|
| 293 | ;; |
---|
| 294 | *) |
---|
| 295 | ;; |
---|
| 296 | esac |
---|
| 297 | changequote([,])dnl |
---|
| 298 | AC_SUBST(RTEMS_HOST) |
---|
| 299 | ])dnl |
---|
| 300 | |
---|
| 301 | dnl |
---|
| 302 | dnl $Id$ |
---|
| 303 | dnl |
---|
| 304 | |
---|
| 305 | AC_DEFUN(RTEMS_PROJECT_ROOT, |
---|
| 306 | [dnl |
---|
| 307 | AC_REQUIRE([RTEMS_TOP]) |
---|
| 308 | if test "$TARGET_SUBDIR" = "." ; then |
---|
| 309 | PROJECT_ROOT=$RTEMS_TOPdir/'$(top_builddir)'; |
---|
| 310 | else |
---|
| 311 | PROJECT_ROOT=../$RTEMS_TOPdir/'$(top_builddir)' |
---|
| 312 | fi |
---|
| 313 | AC_SUBST(PROJECT_ROOT) |
---|
| 314 | |
---|
| 315 | RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP |
---|
| 316 | AC_SUBST(RTEMS_ROOT) |
---|
| 317 | |
---|
| 318 | INSTALL_CHANGE="\$(KSH) \$(PROJECT_ROOT)/tools/build/install-if-change" |
---|
| 319 | AC_SUBST(INSTALL_CHANGE) |
---|
| 320 | |
---|
| 321 | PACKHEX="\$(PROJECT_ROOT)/tools/build/packhex" |
---|
| 322 | AC_SUBST(PACKHEX) |
---|
| 323 | ]) |
---|
| 324 | |
---|
| 325 | |
---|
| 326 | dnl $Id$ |
---|
| 327 | |
---|
| 328 | dnl Report all available bsps for a target, |
---|
| 329 | dnl check if a bsp-subdirectory is present for all bsps found |
---|
| 330 | dnl |
---|
| 331 | dnl RTEMS_CHECK_BSPS(bsp_list) |
---|
| 332 | AC_DEFUN(RTEMS_CHECK_BSPS, |
---|
| 333 | [ |
---|
| 334 | AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target |
---|
| 335 | AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir |
---|
| 336 | AC_MSG_CHECKING([for bsps]) |
---|
| 337 | case "${target}" in |
---|
| 338 | changequote(,)dnl |
---|
| 339 | i[3456]86-go32-rtems*) |
---|
| 340 | changequote([,])dnl |
---|
| 341 | $1="go32 go32_p5" |
---|
| 342 | ;; |
---|
| 343 | *) |
---|
| 344 | files=`ls $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU` |
---|
| 345 | for file in $files; do |
---|
| 346 | case $file in |
---|
| 347 | shared*);; |
---|
| 348 | Makefile*);; |
---|
| 349 | READ*);; |
---|
| 350 | CVS*);; |
---|
| 351 | pxfl*);; |
---|
| 352 | go32*);; # so the i386 port can pick up the other Makefiles |
---|
| 353 | # Now account for BSPs with build variants |
---|
| 354 | gen68360) rtems_bsp="$rtems_bsp gen68360 gen68360_040";; |
---|
| 355 | p4000) rtems_bsp="$rtems_bsp p4600 p4650";; |
---|
| 356 | mvme162) rtems_bsp="$rtems_bsp mvme162 mvme162lx";; |
---|
| 357 | *) $1="[$]$1 $file";; |
---|
| 358 | esac; |
---|
| 359 | done |
---|
| 360 | ;; |
---|
| 361 | esac |
---|
| 362 | AC_MSG_RESULT([[$]$1 .. done]) |
---|
| 363 | ])dnl |
---|
| 364 | |
---|
| 365 | AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP, |
---|
| 366 | [dnl |
---|
| 367 | AC_MSG_CHECKING([for make/custom/[$]$1.cfg]) |
---|
| 368 | if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then |
---|
| 369 | AC_MSG_RESULT([yes]) |
---|
| 370 | else |
---|
| 371 | AC_MSG_ERROR([no]) |
---|
| 372 | fi |
---|
| 373 | ])dnl |
---|
| 374 | |
---|