[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 | |
---|
| 47 | dnl |
---|
| 48 | dnl $Id$ |
---|
| 49 | dnl |
---|
| 50 | |
---|
| 51 | dnl canonicalize target cpu |
---|
| 52 | dnl NOTE: Most rtems targets do not fullfil autoconf's |
---|
| 53 | dnl target naming conventions "processor-vendor-os" |
---|
| 54 | dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them |
---|
| 55 | dnl and we have to fix it for rtems ourselves |
---|
| 56 | |
---|
| 57 | AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU, |
---|
| 58 | [ |
---|
| 59 | AC_CANONICAL_SYSTEM |
---|
| 60 | AC_MSG_CHECKING(rtems target cpu) |
---|
| 61 | changequote(,)dnl |
---|
| 62 | case "${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 | ;; |
---|
| 82 | esac |
---|
| 83 | changequote([,])dnl |
---|
| 84 | AC_SUBST(RTEMS_CPU) |
---|
| 85 | AC_MSG_RESULT($RTEMS_CPU) |
---|
| 86 | ]) |
---|
| 87 | |
---|
| 88 | # Add --enable-maintainer-mode option to configure. |
---|
| 89 | # From Jim Meyering |
---|
| 90 | |
---|
| 91 | # serial 1 |
---|
| 92 | |
---|
| 93 | AC_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 | |
---|
| 110 | AC_DEFUN(AM_CONDITIONAL, |
---|
| 111 | [AC_SUBST($1_TRUE) |
---|
| 112 | AC_SUBST($1_FALSE) |
---|
| 113 | if $2; then |
---|
| 114 | $1_TRUE= |
---|
| 115 | $1_FALSE='#' |
---|
| 116 | else |
---|
| 117 | $1_TRUE='#' |
---|
| 118 | $1_FALSE= |
---|
| 119 | fi]) |
---|
| 120 | |
---|
| 121 | dnl $Id$ |
---|
| 122 | |
---|
| 123 | AC_DEFUN(RTEMS_ENABLE_MULTIPROCESSING, |
---|
| 124 | [ |
---|
| 125 | AC_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) ;; |
---|
| 131 | esac],[RTEMS_HAS_MULTIPROCESSING=no]) |
---|
| 132 | AC_SUBST(RTEMS_HAS_MULTIPROCESSING)dnl |
---|
| 133 | ]) |
---|
| 134 | |
---|
| 135 | dnl $Id$ |
---|
| 136 | |
---|
| 137 | AC_DEFUN(RTEMS_ENABLE_POSIX, |
---|
| 138 | [ |
---|
| 139 | AC_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) ;; |
---|
| 145 | esac],[RTEMS_HAS_POSIX_API=yes]) |
---|
| 146 | AC_SUBST(RTEMS_HAS_POSIX_API) |
---|
| 147 | |
---|
| 148 | changequote(,)dnl |
---|
| 149 | case "${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 | ;; |
---|
| 168 | esac |
---|
| 169 | changequote([,])dnl |
---|
| 170 | AC_SUBST(RTEMS_HAS_POSIX_API) |
---|
| 171 | ]) |
---|
| 172 | |
---|
| 173 | dnl $Id$ |
---|
| 174 | |
---|
| 175 | AC_DEFUN(RTEMS_ENABLE_NETWORKING, |
---|
| 176 | [ |
---|
| 177 | AC_ARG_ENABLE(networking, |
---|
| 178 | [ --enable-networking enable TCP/IP stack], |
---|
| 179 | [case "${enableval}" in |
---|
| 180 | yes) RTEMS_HAS_NETWORKING=yes ;; |
---|
| 181 | no) RTEMS_HAS_NETWORKING=no ;; |
---|
| 182 | *) AC_MSG_ERROR(bad value ${enableval} for enable-networking option) ;; |
---|
| 183 | esac],[RTEMS_HAS_NETWORKING=yes]) |
---|
| 184 | AC_SUBST(RTEMS_HAS_NETWORKING)dnl |
---|
| 185 | ]) |
---|
| 186 | |
---|
| 187 | dnl $Id$ |
---|
| 188 | |
---|
| 189 | AC_DEFUN(RTEMS_ENABLE_RDBG, |
---|
| 190 | [ |
---|
| 191 | AC_ARG_ENABLE(rdbg, |
---|
| 192 | [ --enable-rdbg enable remote debugger], |
---|
| 193 | [case "${enableval}" in |
---|
| 194 | yes) RTEMS_HAS_RDBG=yes ;; |
---|
| 195 | no) RTEMS_HAS_RDBG=no ;; |
---|
| 196 | *) AC_MSG_ERROR(bad value ${enableval} for enable-rdbg option) ;; |
---|
| 197 | esac],[RTEMS_HAS_RDBG=no]) |
---|
| 198 | AC_SUBST(RTEMS_HAS_RDBG)dnl |
---|
| 199 | ]) |
---|
| 200 | |
---|
| 201 | dnl $Id$ |
---|
| 202 | |
---|
| 203 | AC_DEFUN(RTEMS_ENABLE_INLINES, |
---|
| 204 | [AC_ARG_ENABLE(rtems-inlines, |
---|
| 205 | [ --enable-rtems-inlines enable RTEMS inline functions] |
---|
| 206 | [ (default:enabled, disable to use macros)], |
---|
| 207 | [case "${enableval}" in |
---|
| 208 | yes) RTEMS_USE_MACROS=no ;; |
---|
| 209 | no) RTEMS_USE_MACROS=yes ;; |
---|
| 210 | *) AC_MSG_ERROR(bad value ${enableval} for disable-rtems-inlines option) ;; |
---|
| 211 | esac],[RTEMS_USE_MACROS=no]) |
---|
| 212 | AC_SUBST(RTEMS_USE_MACROS)dnl |
---|
| 213 | ]) |
---|
| 214 | |
---|
| 215 | dnl $Id$ |
---|
| 216 | |
---|
| 217 | AC_DEFUN(RTEMS_ENABLE_CXX, |
---|
| 218 | [ |
---|
| 219 | AC_ARG_ENABLE(cxx, |
---|
| 220 | [ --enable-cxx enable C++ support,] |
---|
| 221 | [ and build the rtems++ library], |
---|
| 222 | [case "${enableval}" in |
---|
| 223 | yes) RTEMS_HAS_CPLUSPLUS=yes ;; |
---|
| 224 | no) RTEMS_HAS_CPLUSPLUS=no ;; |
---|
| 225 | *) AC_MSG_ERROR(bad value ${enableval} for enable-cxx option) ;; |
---|
| 226 | esac], [RTEMS_HAS_CPLUSPLUS=no]) |
---|
| 227 | ]) |
---|
| 228 | |
---|
| 229 | dnl $Id$ |
---|
| 230 | |
---|
| 231 | AC_DEFUN(RTEMS_ENABLE_GCC28, |
---|
| 232 | [ |
---|
| 233 | AC_ARG_ENABLE(gcc28, |
---|
| 234 | [ --enable-gcc28 enable use of gcc 2.8.x features], |
---|
| 235 | [case "${enableval}" in |
---|
| 236 | yes) RTEMS_USE_GCC272=no ;; |
---|
| 237 | no) RTEMS_USE_GCC272=yes ;; |
---|
| 238 | *) AC_MSG_ERROR(bad value ${enableval} for gcc-28 option) ;; |
---|
| 239 | esac],[RTEMS_USE_GCC272=no]) |
---|
| 240 | ]) |
---|
| 241 | |
---|
| 242 | dnl $Id$ |
---|
| 243 | |
---|
| 244 | AC_DEFUN(RTEMS_ENABLE_LIBCDIR, |
---|
| 245 | [ |
---|
| 246 | AC_ARG_ENABLE(libcdir, |
---|
| 247 | [ --enable-libcdir=directory set the directory for the C library], |
---|
| 248 | [ RTEMS_LIBC_DIR="${enableval}" ; \ |
---|
| 249 | test -d ${enableval} || AC_MSG_ERROR("$enableval is not a directory" ) ] ) |
---|
| 250 | AC_SUBST(RTEMS_LIBC_DIR)dnl |
---|
| 251 | ]) |
---|
| 252 | |
---|
| 253 | AC_DEFUN(RTEMS_ENABLE_BARE, |
---|
| 254 | [ |
---|
| 255 | AC_ARG_ENABLE(bare-cpu-cflags, |
---|
| 256 | [ --enable-bare-cpu-cflags specify a particular cpu cflag] |
---|
| 257 | [ (bare bsp specific)], |
---|
| 258 | [case "${enableval}" in |
---|
| 259 | no) BARE_CPU_CFLAGS="" ;; |
---|
| 260 | *) BARE_CPU_CFLAGS="${enableval}" ;; |
---|
| 261 | esac], |
---|
| 262 | [BARE_CPU_CFLAGS=""]) |
---|
| 263 | |
---|
| 264 | AC_ARG_ENABLE(bare-cpu-model, |
---|
| 265 | [ --enable-bare-cpu-model specify a particular cpu model] |
---|
| 266 | [ (bare bsp specific)], |
---|
| 267 | [case "${enableval}" in |
---|
| 268 | no) BARE_CPU_MODEL="" ;; |
---|
| 269 | *) BARE_CPU_MODEL="${enableval}" ;; |
---|
| 270 | esac], |
---|
| 271 | [BARE_CPU_MODEL=""]) |
---|
| 272 | ]) |
---|
| 273 | |
---|
| 274 | |
---|
| 275 | dnl $Id$ |
---|
| 276 | dnl |
---|
| 277 | dnl FIXME: this needs to be reworked |
---|
| 278 | |
---|
| 279 | AC_DEFUN(RTEMS_ENABLE_HWAPI, |
---|
| 280 | [dnl |
---|
| 281 | AC_ARG_ENABLE(hwapi, \ |
---|
| 282 | [ --enable-hwapi enable hardware API library], |
---|
| 283 | [case "${enableval}" in |
---|
| 284 | yes) RTEMS_HAS_HWAPI=yes ;; |
---|
| 285 | no) RTEMS_HAS_HWAPI=no ;; |
---|
| 286 | *) AC_MSG_ERROR(bad value ${enableval} for hwapi option) ;; |
---|
| 287 | esac],[RTEMS_HAS_HWAPI=no]) |
---|
| 288 | AC_SUBST(RTEMS_HAS_HWAPI)dnl |
---|
| 289 | ])dnl |
---|
| 290 | |
---|
| 291 | dnl $Id$ |
---|
| 292 | |
---|
| 293 | dnl Override the set of BSPs to be built. |
---|
| 294 | dnl used by the toplevel configure script |
---|
| 295 | dnl RTEMS_ENABLE_RTEMSBSP(rtems_bsp_list) |
---|
| 296 | AC_DEFUN(RTEMS_ENABLE_RTEMSBSP, |
---|
| 297 | [ |
---|
| 298 | AC_ARG_ENABLE(rtemsbsp, |
---|
| 299 | [ --enable-rtemsbsp=bsp1 bsp2 .. BSPs to include in build], |
---|
| 300 | [case "${enableval}" in |
---|
| 301 | yes|no) AC_MSG_ERROR([missing argument to --enable-rtemsbsp=\"bsp1 bsp2\"]);; |
---|
| 302 | *) $1=$enableval;; |
---|
| 303 | esac],[$1=""]) |
---|
| 304 | ]) |
---|
| 305 | |
---|
| 306 | dnl Pass a single BSP via an environment variable |
---|
| 307 | dnl used by per BSP configure scripts |
---|
| 308 | AC_DEFUN(RTEMS_ENV_RTEMSBSP, |
---|
| 309 | [dnl |
---|
| 310 | AC_MSG_CHECKING([for RTEMS_BSP]) |
---|
| 311 | AC_CACHE_VAL(rtems_cv_RTEMS_BSP, |
---|
| 312 | [dnl |
---|
| 313 | test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP"; |
---|
| 314 | ])dnl |
---|
| 315 | if test -z "$rtems_cv_RTEMS_BSP"; then |
---|
| 316 | AC_MSG_ERROR([Missing RTEMS_BSP]) |
---|
| 317 | fi |
---|
| 318 | RTEMS_BSP="$rtems_cv_RTEMS_BSP" |
---|
| 319 | AC_MSG_RESULT(${RTEMS_BSP}) |
---|
| 320 | AC_SUBST(RTEMS_BSP) |
---|
| 321 | ]) |
---|
| 322 | |
---|
| 323 | dnl $Id$ |
---|
| 324 | |
---|
| 325 | dnl check if RTEMS support a cpu |
---|
| 326 | AC_DEFUN(RTEMS_CHECK_CPU, |
---|
| 327 | [dnl |
---|
| 328 | AC_REQUIRE([RTEMS_TOP]) |
---|
| 329 | AC_REQUIRE([RTEMS_CANONICAL_TARGET_CPU]) |
---|
| 330 | # Is this a supported CPU? |
---|
| 331 | AC_MSG_CHECKING([if cpu $RTEMS_CPU is supported]) |
---|
| 332 | if test -d "$srcdir/$RTEMS_TOPdir/c/src/exec/score/cpu/$RTEMS_CPU"; then |
---|
| 333 | AC_MSG_RESULT(yes) |
---|
| 334 | else |
---|
| 335 | AC_MSG_ERROR(no) |
---|
| 336 | fi |
---|
| 337 | ])dnl |
---|
| 338 | |
---|
| 339 | |
---|
| 340 | dnl $Id$ |
---|
| 341 | |
---|
| 342 | AC_DEFUN(RTEMS_CANONICAL_HOST, |
---|
| 343 | [dnl |
---|
| 344 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
| 345 | RTEMS_HOST=$host_os |
---|
| 346 | changequote(,)dnl |
---|
| 347 | case "${target}" in |
---|
| 348 | # hpux unix port should go here |
---|
| 349 | i[3456]86-pc-linux*) # unix "simulator" port |
---|
| 350 | RTEMS_HOST=Linux |
---|
| 351 | ;; |
---|
| 352 | i[3456]86-*freebsd2*) # unix "simulator" port |
---|
| 353 | RTEMS_HOST=FreeBSD |
---|
| 354 | ;; |
---|
| 355 | sparc-sun-solaris*) # unix "simulator" port |
---|
| 356 | RTEMS_HOST=Solaris |
---|
| 357 | ;; |
---|
| 358 | *) |
---|
| 359 | ;; |
---|
| 360 | esac |
---|
| 361 | changequote([,])dnl |
---|
| 362 | AC_SUBST(RTEMS_HOST) |
---|
| 363 | ])dnl |
---|
| 364 | |
---|
| 365 | dnl |
---|
| 366 | dnl $Id$ |
---|
| 367 | dnl |
---|
| 368 | |
---|
| 369 | AC_DEFUN(RTEMS_PROJECT_ROOT, |
---|
| 370 | [dnl |
---|
| 371 | AC_REQUIRE([RTEMS_TOP]) |
---|
| 372 | if test "$TARGET_SUBDIR" = "." ; then |
---|
| 373 | PROJECT_ROOT=$RTEMS_TOPdir/'$(top_builddir)'; |
---|
| 374 | else |
---|
| 375 | PROJECT_ROOT=../$RTEMS_TOPdir/'$(top_builddir)' |
---|
| 376 | fi |
---|
| 377 | AC_SUBST(PROJECT_ROOT) |
---|
| 378 | |
---|
| 379 | RTEMS_ROOT=$RTEMS_TOPdir/'$(top_builddir)'/c/$RTEMS_BSP |
---|
| 380 | AC_SUBST(RTEMS_ROOT) |
---|
| 381 | |
---|
| 382 | INSTALL_CHANGE="\$(KSH) \$(PROJECT_ROOT)/tools/build/install-if-change" |
---|
| 383 | AC_SUBST(INSTALL_CHANGE) |
---|
| 384 | |
---|
| 385 | PACKHEX="\$(PROJECT_ROOT)/tools/build/packhex" |
---|
| 386 | AC_SUBST(PACKHEX) |
---|
| 387 | ]) |
---|
| 388 | |
---|
| 389 | |
---|
| 390 | dnl |
---|
| 391 | dnl $Id$ |
---|
| 392 | dnl |
---|
| 393 | dnl Check for target gcc |
---|
| 394 | dnl |
---|
| 395 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
| 396 | dnl Completely reworked |
---|
| 397 | |
---|
| 398 | AC_DEFUN(RTEMS_PROG_CC, |
---|
| 399 | [ |
---|
| 400 | AC_BEFORE([$0], [AC_PROG_CPP])dnl |
---|
| 401 | AC_BEFORE([$0], [AC_PROG_CC])dnl |
---|
| 402 | AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl |
---|
| 403 | |
---|
| 404 | dnl Only accept gcc and cc |
---|
| 405 | dnl NOTE: This might be too restrictive for native compilation |
---|
| 406 | AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc ) |
---|
| 407 | test -z "$CC_FOR_TARGET" \ |
---|
| 408 | && AC_MSG_ERROR([no acceptable cc found in \$PATH]) |
---|
| 409 | |
---|
| 410 | dnl backup |
---|
| 411 | rtems_save_CC=$CC |
---|
| 412 | rtems_save_CFLAGS=$CFLAGS |
---|
| 413 | |
---|
| 414 | dnl temporarily set CC |
---|
| 415 | CC=$CC_FOR_TARGET |
---|
| 416 | |
---|
| 417 | AC_PROG_CC_WORKS |
---|
| 418 | AC_PROG_CC_GNU |
---|
| 419 | |
---|
| 420 | if test $ac_cv_prog_gcc = yes; then |
---|
| 421 | GCC=yes |
---|
| 422 | dnl Check whether -g works, even if CFLAGS is set, in case the package |
---|
| 423 | dnl plays around with CFLAGS (such as to build both debugging and |
---|
| 424 | dnl normal versions of a library), tasteless as that idea is. |
---|
| 425 | ac_test_CFLAGS="${CFLAGS+set}" |
---|
| 426 | ac_save_CFLAGS="$CFLAGS" |
---|
| 427 | CFLAGS= |
---|
| 428 | AC_PROG_CC_G |
---|
| 429 | if test "$ac_test_CFLAGS" = set; then |
---|
| 430 | CFLAGS="$ac_save_CFLAGS" |
---|
| 431 | elif test $ac_cv_prog_cc_g = yes; then |
---|
| 432 | CFLAGS="-g -O2" |
---|
| 433 | else |
---|
| 434 | CFLAGS="-O2" |
---|
| 435 | fi |
---|
| 436 | else |
---|
| 437 | GCC= |
---|
| 438 | test "${CFLAGS+set}" = set || CFLAGS="-g" |
---|
| 439 | fi |
---|
| 440 | |
---|
| 441 | rtems_cv_prog_gcc=$ac_cv_prog_gcc |
---|
| 442 | rtems_cv_prog_cc_g=$ac_cv_prog_cc_g |
---|
| 443 | rtems_cv_prog_cc_works=$ac_cv_prog_cc_works |
---|
| 444 | rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross |
---|
| 445 | |
---|
| 446 | dnl restore initial values |
---|
| 447 | CC=$rtems_save_CC |
---|
| 448 | CFLAGS=$rtems_save_CFLAGS |
---|
| 449 | |
---|
| 450 | unset ac_cv_prog_gcc |
---|
| 451 | unset ac_cv_prog_cc_g |
---|
| 452 | unset ac_cv_prog_cc_works |
---|
| 453 | unset ac_cv_prog_cc_cross |
---|
| 454 | ]) |
---|
| 455 | |
---|
| 456 | AC_DEFUN(RTEMS_PROG_CC_FOR_TARGET, |
---|
| 457 | [ |
---|
| 458 | dnl check target cc |
---|
| 459 | RTEMS_PROG_CC |
---|
| 460 | dnl check if the compiler supports --specs |
---|
| 461 | RTEMS_GCC_SPECS |
---|
| 462 | dnl check if the target compiler may use --pipe |
---|
| 463 | RTEMS_GCC_PIPE |
---|
| 464 | dnl check if the compiler supports --specs if gcc28 is requested |
---|
| 465 | if test "$RTEMS_USE_GCC272" != "yes" ; then |
---|
| 466 | if test "$rtems_cv_gcc_specs" = "no"; then |
---|
| 467 | AC_MSG_WARN([*** disabling --enable-gcc28]) |
---|
| 468 | RTEMS_USE_GCC272=yes |
---|
| 469 | fi |
---|
| 470 | fi |
---|
| 471 | test "$rtems_cv_gcc_pipe" = "yes" && CC_FOR_TARGET="$CC_FOR_TARGET --pipe" |
---|
| 472 | |
---|
| 473 | dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-* |
---|
| 474 | case $host_os in |
---|
| 475 | *cygwin*) GCCSED="| sed 's%\\\\%/%g'" ;; |
---|
| 476 | *) ;; |
---|
| 477 | esac |
---|
| 478 | AC_SUBST(GCCSED) |
---|
| 479 | ]) |
---|
| 480 | |
---|
| 481 | dnl |
---|
| 482 | dnl $Id$ |
---|
| 483 | dnl |
---|
| 484 | dnl Set program_prefix |
---|
| 485 | dnl |
---|
| 486 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
| 487 | dnl Extracted from configure |
---|
| 488 | |
---|
| 489 | AC_DEFUN(RTEMS_TOOL_PREFIX, |
---|
| 490 | [AC_REQUIRE([AC_CANONICAL_TARGET])dnl |
---|
| 491 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl |
---|
| 492 | |
---|
| 493 | changequote(,)dnl |
---|
| 494 | if [ "${program_prefix}" = "NONE" ] ; then |
---|
| 495 | if [ "${target}" = "${host}" ] ; then |
---|
| 496 | program_prefix= |
---|
| 497 | else |
---|
| 498 | program_prefix=${target}- |
---|
| 499 | fi |
---|
| 500 | fi |
---|
| 501 | changequote([,])dnl |
---|
| 502 | ]) |
---|
| 503 | |
---|
| 504 | dnl |
---|
| 505 | dnl $Id$ |
---|
| 506 | dnl |
---|
| 507 | dnl Check whether the target compiler accepts -specs |
---|
| 508 | dnl |
---|
| 509 | dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de |
---|
| 510 | dnl |
---|
| 511 | |
---|
| 512 | AC_DEFUN(RTEMS_GCC_SPECS, |
---|
| 513 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
| 514 | AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs, |
---|
| 515 | [ |
---|
| 516 | rtems_cv_gcc_specs=no |
---|
| 517 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
| 518 | touch confspec |
---|
| 519 | echo 'void f(){}' >conftest.c |
---|
| 520 | if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then |
---|
| 521 | rtems_cv_gcc_specs=yes |
---|
| 522 | fi |
---|
| 523 | fi |
---|
| 524 | rm -f confspec conftest* |
---|
| 525 | ])]) |
---|
| 526 | |
---|
| 527 | dnl |
---|
| 528 | dnl $Id$ |
---|
| 529 | dnl |
---|
| 530 | dnl Check whether the target compiler accepts -pipe |
---|
| 531 | dnl |
---|
| 532 | dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de |
---|
| 533 | dnl |
---|
| 534 | |
---|
| 535 | AC_DEFUN(RTEMS_GCC_PIPE, |
---|
| 536 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
| 537 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
| 538 | AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe, |
---|
| 539 | [ |
---|
| 540 | rtems_cv_gcc_pipe=no |
---|
| 541 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
| 542 | case "$host_os" in |
---|
| 543 | cygwin*) |
---|
| 544 | ;; |
---|
| 545 | *) |
---|
| 546 | echo 'void f(){}' >conftest.c |
---|
| 547 | if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then |
---|
| 548 | rtems_cv_gcc_pipe=yes |
---|
| 549 | fi |
---|
| 550 | rm -f conftest* |
---|
| 551 | ;; |
---|
| 552 | esac |
---|
| 553 | fi |
---|
| 554 | ]) |
---|
| 555 | ]) |
---|
| 556 | |
---|
| 557 | dnl |
---|
| 558 | dnl $Id$ |
---|
| 559 | dnl |
---|
| 560 | dnl Check for target g++ |
---|
| 561 | dnl |
---|
| 562 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
| 563 | dnl Completely reworked |
---|
| 564 | |
---|
| 565 | AC_DEFUN(RTEMS_PROG_CXX, |
---|
| 566 | [ |
---|
| 567 | AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl |
---|
| 568 | AC_BEFORE([$0], [AC_PROG_CXX])dnl |
---|
| 569 | AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl |
---|
| 570 | |
---|
| 571 | dnl Only accept g++ and c++ |
---|
| 572 | dnl NOTE: This might be too restrictive for native compilation |
---|
| 573 | AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++) |
---|
| 574 | test -z "$CXX_FOR_TARGET" \ |
---|
| 575 | && AC_MSG_ERROR([no acceptable c++ found in \$PATH]) |
---|
| 576 | |
---|
| 577 | dnl backup |
---|
| 578 | rtems_save_CXX=$CXX |
---|
| 579 | rtems_save_CXXFLAGS=$CXXFLAGS |
---|
| 580 | |
---|
| 581 | dnl temporarily set CXX |
---|
| 582 | CXX=$CXX_FOR_TARGET |
---|
| 583 | |
---|
| 584 | AC_PROG_CXX_WORKS |
---|
| 585 | AC_PROG_CXX_GNU |
---|
| 586 | |
---|
| 587 | if test $ac_cv_prog_gxx = yes; then |
---|
| 588 | GXX=yes |
---|
| 589 | dnl Check whether -g works, even if CXXFLAGS is set, in case the package |
---|
| 590 | dnl plays around with CXXFLAGS (such as to build both debugging and |
---|
| 591 | dnl normal versions of a library), tasteless as that idea is. |
---|
| 592 | ac_test_CXXFLAGS="${CXXFLAGS+set}" |
---|
| 593 | ac_save_CXXFLAGS="$CXXFLAGS" |
---|
| 594 | CXXFLAGS= |
---|
| 595 | AC_PROG_CXX_G |
---|
| 596 | if test "$ac_test_CXXFLAGS" = set; then |
---|
| 597 | CXXFLAGS="$ac_save_CXXFLAGS" |
---|
| 598 | elif test $ac_cv_prog_cxx_g = yes; then |
---|
| 599 | CXXFLAGS="-g -O2" |
---|
| 600 | else |
---|
| 601 | CXXFLAGS="-O2" |
---|
| 602 | fi |
---|
| 603 | else |
---|
| 604 | GXX= |
---|
| 605 | test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" |
---|
| 606 | fi |
---|
| 607 | |
---|
| 608 | rtems_cv_prog_gxx=$ac_cv_prog_gxx |
---|
| 609 | rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g |
---|
| 610 | rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works |
---|
| 611 | rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross |
---|
| 612 | |
---|
| 613 | CXX=$rtems_save_CXX |
---|
| 614 | CXXFLAGS=$rtems_save_CXXFLAGS |
---|
| 615 | |
---|
| 616 | dnl restore initial values |
---|
| 617 | unset ac_cv_prog_gxx |
---|
| 618 | unset ac_cv_prog_cc_g |
---|
| 619 | unset ac_cv_prog_cxx_works |
---|
| 620 | unset ac_cv_prog_cxx_cross |
---|
| 621 | ]) |
---|
| 622 | |
---|
| 623 | AC_DEFUN(RTEMS_PROG_CXX_FOR_TARGET, |
---|
| 624 | [ |
---|
| 625 | RTEMS_PROG_CXX |
---|
| 626 | if test "$rtems_cv_prog_cc_cross" != "$rtems_cv_prog_cxx_cross"; then |
---|
| 627 | AC_MSG_ERROR([***] |
---|
| 628 | [Inconsistency in compiler configuration:] |
---|
| 629 | [Target C compiler and Target C++ compiler] |
---|
| 630 | [must both either be cross compilers or native compilers] |
---|
| 631 | [Hint: If building a posix bsp: LD_LIBRARY_PATH?] ) |
---|
| 632 | fi |
---|
| 633 | ]) |
---|
| 634 | |
---|
| 635 | dnl |
---|
| 636 | dnl $Id$ |
---|
| 637 | dnl |
---|
| 638 | dnl Set target tools |
---|
| 639 | dnl |
---|
| 640 | dnl 98/06/23 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
| 641 | dnl fixing cache/environment variable handling |
---|
| 642 | dnl adding checks for cygwin/egcs '\\'-bug |
---|
| 643 | dnl adding checks for ranlib/ar -s problem |
---|
| 644 | dnl |
---|
| 645 | dnl 98/02/12 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
| 646 | dnl |
---|
| 647 | |
---|
| 648 | AC_DEFUN(RTEMS_GCC_PRINT, |
---|
| 649 | [ case $host_os in |
---|
| 650 | *cygwin*) |
---|
| 651 | dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/' |
---|
| 652 | dnl Should be removed once cygwin/egcs reports '/' only |
---|
| 653 | $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' ` |
---|
| 654 | ;; |
---|
| 655 | *) |
---|
| 656 | $1=`$CC_FOR_TARGET --print-prog-name=$2` |
---|
| 657 | ;; |
---|
| 658 | esac |
---|
| 659 | ]) |
---|
| 660 | |
---|
| 661 | AC_DEFUN(RTEMS_PATH_TOOL, |
---|
| 662 | [ |
---|
| 663 | AC_MSG_CHECKING([target's $2]) |
---|
| 664 | AC_CACHE_VAL(ac_cv_path_$1,:) |
---|
| 665 | AC_MSG_RESULT([$ac_cv_path_$1]) |
---|
| 666 | |
---|
| 667 | if test -n "$ac_cv_path_$1"; then |
---|
| 668 | dnl retrieve the value from the cache |
---|
| 669 | $1=$ac_cv_path_$1 |
---|
| 670 | else |
---|
| 671 | dnl the cache was not set |
---|
| 672 | if test -z "[$]$1" ; then |
---|
| 673 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
| 674 | # We are using gcc, ask it about its tool |
---|
| 675 | # NOTE: Necessary if gcc was configured to use the target's |
---|
| 676 | # native tools or uses prefixes for gnutools (e.g. gas instead of as) |
---|
| 677 | RTEMS_GCC_PRINT($1,$2) |
---|
| 678 | fi |
---|
| 679 | else |
---|
| 680 | # The user set an environment variable. |
---|
| 681 | # Check whether it is an absolute path, otherwise AC_PATH_PROG |
---|
| 682 | # will override the environment variable, which isn't what the user |
---|
| 683 | # intends |
---|
| 684 | AC_MSG_CHECKING([whether environment variable $1 is an absolute path]) |
---|
| 685 | case "[$]$1" in |
---|
| 686 | /*) # valid |
---|
| 687 | AC_MSG_RESULT("yes") |
---|
| 688 | ;; |
---|
| 689 | *) # invalid for AC_PATH_PROG |
---|
| 690 | AC_MSG_RESULT("no") |
---|
| 691 | AC_MSG_ERROR([***] |
---|
| 692 | [Environment variable $1 should either] |
---|
| 693 | [be unset (preferred) or contain an absolute path]) |
---|
| 694 | ;; |
---|
| 695 | esac |
---|
| 696 | fi |
---|
| 697 | |
---|
| 698 | AC_PATH_PROG($1,"$program_prefix"$2,$3) |
---|
| 699 | fi |
---|
| 700 | ]) |
---|
| 701 | |
---|
| 702 | AC_DEFUN(RTEMS_CANONICALIZE_TOOLS, |
---|
| 703 | [AC_REQUIRE([RTEMS_PROG_CC])dnl |
---|
| 704 | |
---|
| 705 | dnl FIXME: What shall be done if these tools are not available? |
---|
| 706 | RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no) |
---|
| 707 | RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no) |
---|
| 708 | RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no) |
---|
| 709 | RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no) |
---|
| 710 | |
---|
| 711 | dnl special treatment of ranlib |
---|
| 712 | RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no) |
---|
| 713 | if test "$RANLIB_FOR_TARGET" = "no"; then |
---|
| 714 | # ranlib wasn't found; check if ar -s is available |
---|
| 715 | RTEMS_AR_FOR_TARGET_S |
---|
| 716 | if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then |
---|
| 717 | dnl override RANLIB_FOR_TARGET's cache |
---|
| 718 | ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s" |
---|
| 719 | RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET |
---|
| 720 | else |
---|
| 721 | AC_MSG_ERROR([***] |
---|
| 722 | [Can't figure out how to build a library index] |
---|
| 723 | [Neither ranlib nor ar -s seem to be available] ) |
---|
| 724 | fi |
---|
| 725 | fi |
---|
| 726 | |
---|
| 727 | dnl NOTE: These may not be available if not using gnutools |
---|
| 728 | RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no) |
---|
| 729 | RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no) |
---|
| 730 | RTEMS_PATH_TOOL(STRIP_FOR_TARGET,strip,no) |
---|
| 731 | ]) |
---|
| 732 | |
---|
| 733 | dnl |
---|
| 734 | dnl $Id$ |
---|
| 735 | dnl |
---|
| 736 | |
---|
| 737 | AC_DEFUN(RTEMS_AR_FOR_TARGET_S, |
---|
| 738 | [ |
---|
| 739 | AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works, |
---|
| 740 | rtems_cv_AR_FOR_TARGET_S, |
---|
| 741 | [ |
---|
| 742 | cat > conftest.$ac_ext <<EOF |
---|
| 743 | int foo( int b ) |
---|
| 744 | { return b; } |
---|
| 745 | EOF |
---|
| 746 | if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \ |
---|
| 747 | && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \ |
---|
| 748 | && test -s conftest.a ; \ |
---|
| 749 | then |
---|
| 750 | rtems_cv_AR_FOR_TARGET_S="yes" |
---|
| 751 | else |
---|
| 752 | rtems_cv_AR_FOR_TARGET_S="no" |
---|
| 753 | fi |
---|
| 754 | rm -f conftest* |
---|
| 755 | ]) |
---|
| 756 | ]) |
---|
| 757 | |
---|
| 758 | |
---|
| 759 | dnl |
---|
| 760 | dnl $Id$ |
---|
| 761 | dnl |
---|
| 762 | |
---|
| 763 | dnl check for i386 gas supporting 16 bit mode |
---|
| 764 | dnl - binutils 2.9.1.0.7 and higher |
---|
| 765 | |
---|
| 766 | AC_DEFUN(RTEMS_I386_GAS_CODE16, |
---|
| 767 | [ if test "${target_cpu}" = "i386"; then |
---|
| 768 | AC_CACHE_CHECK([for 16 bit mode assembler support], |
---|
| 769 | rtems_cv_prog_gas_code16, |
---|
| 770 | [cat > conftest.s << EOF |
---|
| 771 | .code16 |
---|
| 772 | data32 |
---|
| 773 | addr32 |
---|
| 774 | lgdt 0 |
---|
| 775 | EOF |
---|
| 776 | if AC_TRY_COMMAND($AS_FOR_TARGET -o conftest.o conftest.s); then |
---|
| 777 | rtems_cv_prog_gas_code16=yes |
---|
| 778 | else |
---|
| 779 | rtems_cv_prog_gas_code16=no |
---|
| 780 | fi]) |
---|
| 781 | RTEMS_GAS_CODE16="$rtems_cv_prog_gas_code16" |
---|
| 782 | fi |
---|
| 783 | AC_SUBST(RTEMS_GAS_CODE16) |
---|
| 784 | ]) |
---|
| 785 | |
---|
| 786 | |
---|
| 787 | dnl |
---|
| 788 | dnl $Id$ |
---|
| 789 | dnl |
---|
| 790 | dnl Check for System V IPC calls used by Unix simulators |
---|
| 791 | dnl |
---|
| 792 | dnl 98/07/17 Dario Alcocer alcocer@netcom.com |
---|
| 793 | dnl Ralf Corsepius corsepiu@faw.uni-ulm.de |
---|
| 794 | dnl |
---|
| 795 | dnl Note: $host_os should probably *not* ever be used here to |
---|
| 796 | dnl determine if host supports System V IPC calls, since some |
---|
| 797 | dnl (e.g. FreeBSD 2.x) are configured by default to include only |
---|
| 798 | dnl a subset of the System V IPC calls. Therefore, to make sure |
---|
| 799 | dnl all of the required calls are found, test for each call explicitly. |
---|
| 800 | dnl |
---|
| 801 | dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally |
---|
| 802 | dnl modify any existing key sets. See the man pages for semget, shmget, |
---|
| 803 | dnl msgget, semctl, shmctl and msgctl for details. |
---|
| 804 | |
---|
| 805 | AC_DEFUN(RTEMS_SYSV_SEM, |
---|
| 806 | [AC_REQUIRE([AC_PROG_CC]) |
---|
| 807 | AC_REQUIRE([RTEMS_CANONICAL_HOST]) |
---|
| 808 | AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores, |
---|
| 809 | rtems_cv_sysv_sem, |
---|
| 810 | [ |
---|
| 811 | AC_TRY_RUN([ |
---|
| 812 | #include <sys/types.h> |
---|
| 813 | #include <sys/ipc.h> |
---|
| 814 | #include <sys/sem.h> |
---|
| 815 | int main () { |
---|
| 816 | #if !defined(sun) |
---|
| 817 | union semun arg ; |
---|
| 818 | #else |
---|
| 819 | union semun { |
---|
| 820 | int val; |
---|
| 821 | struct semid_ds *buf; |
---|
| 822 | ushort *array; |
---|
| 823 | } arg; |
---|
| 824 | #endif |
---|
| 825 | int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400); |
---|
| 826 | if (id == -1) |
---|
| 827 | exit(1); |
---|
| 828 | arg.val = 0; /* avoid implicit type cast to union */ |
---|
| 829 | if (semctl(id, 0, IPC_RMID, arg) == -1) |
---|
| 830 | exit(1); |
---|
| 831 | exit(0); |
---|
| 832 | } |
---|
| 833 | ], |
---|
| 834 | rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :) |
---|
| 835 | ]) |
---|
| 836 | ]) |
---|
| 837 | |
---|
| 838 | AC_DEFUN(RTEMS_SYSV_SHM, |
---|
| 839 | [AC_REQUIRE([AC_PROG_CC]) |
---|
| 840 | AC_REQUIRE([RTEMS_CANONICAL_HOST]) |
---|
| 841 | AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory, |
---|
| 842 | rtems_cv_sysv_shm, |
---|
| 843 | [ |
---|
| 844 | AC_TRY_RUN([ |
---|
| 845 | #include <sys/types.h> |
---|
| 846 | #include <sys/ipc.h> |
---|
| 847 | #include <sys/shm.h> |
---|
| 848 | int main () { |
---|
| 849 | int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400); |
---|
| 850 | if (id == -1) |
---|
| 851 | exit(1); |
---|
| 852 | if (shmctl(id, IPC_RMID, 0) == -1) |
---|
| 853 | exit(1); |
---|
| 854 | exit(0); |
---|
| 855 | } |
---|
| 856 | ], |
---|
| 857 | rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :) |
---|
| 858 | ]) |
---|
| 859 | ]) |
---|
| 860 | |
---|
| 861 | AC_DEFUN(RTEMS_SYSV_MSG, |
---|
| 862 | [AC_REQUIRE([AC_PROG_CC]) |
---|
| 863 | AC_REQUIRE([RTEMS_CANONICAL_HOST]) |
---|
| 864 | AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages, |
---|
| 865 | rtems_cv_sysv_msg, |
---|
| 866 | [ |
---|
| 867 | AC_TRY_RUN([ |
---|
| 868 | #include <sys/types.h> |
---|
| 869 | #include <sys/ipc.h> |
---|
| 870 | #include <sys/msg.h> |
---|
| 871 | int main () { |
---|
| 872 | int id=msgget(IPC_PRIVATE,IPC_CREAT|0400); |
---|
| 873 | if (id == -1) |
---|
| 874 | exit(1); |
---|
| 875 | if (msgctl(id, IPC_RMID, 0) == -1) |
---|
| 876 | exit(1); |
---|
| 877 | exit(0); |
---|
| 878 | } |
---|
| 879 | ], |
---|
| 880 | rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :) |
---|
| 881 | ]) |
---|
| 882 | ]) |
---|
| 883 | |
---|
| 884 | AC_DEFUN(RTEMS_CHECK_SYSV_UNIX, |
---|
| 885 | [AC_REQUIRE([RTEMS_CANONICAL_HOST]) |
---|
| 886 | if test "$RTEMS_CPU" = "unix" ; then |
---|
| 887 | RTEMS_SYSV_SEM |
---|
| 888 | if test "$rtems_cv_sysv_sem" != "yes" ; then |
---|
| 889 | AC_MSG_ERROR([System V semaphores don't work, required by simulator]) |
---|
| 890 | fi |
---|
| 891 | RTEMS_SYSV_SHM |
---|
| 892 | if test "$rtems_cv_sysv_shm" != "yes" ; then |
---|
| 893 | AC_MSG_ERROR([System V shared memory doesn't work, required by simulator]) |
---|
| 894 | fi |
---|
| 895 | RTEMS_SYSV_MSG |
---|
| 896 | if test "$rtems_cv_sysv_msg" != "yes" ; then |
---|
| 897 | AC_MSG_ERROR([System V messages don't work, required by simulator]) |
---|
| 898 | fi |
---|
| 899 | fi |
---|
| 900 | ]) |
---|
| 901 | |
---|
| 902 | dnl $Id$ |
---|
| 903 | |
---|
| 904 | dnl Report all available bsps for a target, |
---|
| 905 | dnl check if a bsp-subdirectory is present for all bsps found |
---|
| 906 | dnl |
---|
| 907 | dnl RTEMS_CHECK_BSPS(bsp_list) |
---|
| 908 | AC_DEFUN(RTEMS_CHECK_BSPS, |
---|
| 909 | [ |
---|
| 910 | AC_REQUIRE([RTEMS_CHECK_CPU])dnl sets RTEMS_CPU, target |
---|
| 911 | AC_REQUIRE([RTEMS_TOP])dnl sets RTEMS_TOPdir |
---|
| 912 | AC_MSG_CHECKING([for bsps]) |
---|
| 913 | case "${target}" in |
---|
| 914 | changequote(,)dnl |
---|
| 915 | i[3456]86-go32-rtems*) |
---|
| 916 | changequote([,])dnl |
---|
| 917 | $1="go32 go32_p5" |
---|
| 918 | ;; |
---|
| 919 | *) |
---|
| 920 | files=`ls $srcdir/$RTEMS_TOPdir/c/src/lib/libbsp/$RTEMS_CPU` |
---|
| 921 | for file in $files; do |
---|
| 922 | case $file in |
---|
| 923 | shared*);; |
---|
| 924 | Makefile*);; |
---|
| 925 | READ*);; |
---|
| 926 | CVS*);; |
---|
| 927 | pxfl*);; |
---|
| 928 | go32*);; # so the i386 port can pick up the other Makefiles |
---|
| 929 | # Now account for BSPs with build variants |
---|
| 930 | gen68360) rtems_bsp="$rtems_bsp gen68360 gen68360_040";; |
---|
| 931 | p4000) rtems_bsp="$rtems_bsp p4600 p4650";; |
---|
| 932 | mvme162) rtems_bsp="$rtems_bsp mvme162 mvme162lx";; |
---|
| 933 | *) $1="[$]$1 $file";; |
---|
| 934 | esac; |
---|
| 935 | done |
---|
| 936 | ;; |
---|
| 937 | esac |
---|
| 938 | AC_MSG_RESULT([[$]$1 .. done]) |
---|
| 939 | ])dnl |
---|
| 940 | |
---|
| 941 | AC_DEFUN(RTEMS_CHECK_CUSTOM_BSP, |
---|
| 942 | [dnl |
---|
| 943 | AC_MSG_CHECKING([for make/custom/[$]$1.cfg]) |
---|
| 944 | if test -r "$srcdir/$RTEMS_TOPdir/make/custom/[$]$1.cfg"; then |
---|
| 945 | AC_MSG_RESULT([yes]) |
---|
| 946 | else |
---|
| 947 | AC_MSG_ERROR([no]) |
---|
| 948 | fi |
---|
| 949 | ])dnl |
---|
| 950 | |
---|
| 951 | dnl |
---|
| 952 | dnl $Id$ |
---|
| 953 | dnl |
---|
| 954 | |
---|
| 955 | dnl RTEMS_BSP_ALIAS(BSP_ALIAS,BSP_RETURNED) |
---|
| 956 | dnl convert a bsp alias $1 into its bsp directory $2 |
---|
| 957 | AC_DEFUN(RTEMS_BSP_ALIAS, |
---|
| 958 | [ |
---|
| 959 | # account for "aliased" bsps which share source code |
---|
| 960 | case $1 in |
---|
| 961 | mvme162lx) $2=mvme162 ;; # mvme162 board variant |
---|
| 962 | gen68360_040) $2=gen68360 ;; # 68360 in companion mode |
---|
| 963 | go32_p5) $2=go32 ;; # go32 on Pentium class CPU |
---|
| 964 | p4600) $2=p4000 ;; # p4000 board with IDT 4600 |
---|
| 965 | p4650) $2=p4000 ;; # p4000 board with IDT 4650 |
---|
| 966 | *) $2=$1;; |
---|
| 967 | esac |
---|
| 968 | ]) |
---|
| 969 | |
---|
| 970 | dnl |
---|
| 971 | dnl $Id$ |
---|
| 972 | dnl |
---|
| 973 | |
---|
| 974 | dnl RTEMS_CHECK_MAKEFILE(path) |
---|
| 975 | dnl Search for Makefile.in's within the directory starting |
---|
| 976 | dnl at path and append an entry for Makefile to global variable |
---|
| 977 | dnl "makefiles" (from configure.in) for each Makefile.in found |
---|
| 978 | dnl |
---|
| 979 | AC_DEFUN(RTEMS_CHECK_MAKEFILE, |
---|
| 980 | [RTEMS_CHECK_FILES_IN($1,Makefile,makefiles) |
---|
| 981 | ]) |
---|
| 982 | |
---|
| 983 | dnl |
---|
| 984 | dnl $Id$ |
---|
| 985 | dnl |
---|
| 986 | |
---|
| 987 | dnl RTEMS_CHECK_FILES_IN(path,file,var) |
---|
| 988 | dnl path .. path relative to srcdir, where to start searching for files |
---|
| 989 | dnl file .. name of the files to search for |
---|
| 990 | dnl var .. shell variable to append files found |
---|
| 991 | |
---|
| 992 | AC_DEFUN(RTEMS_CHECK_FILES_IN, |
---|
| 993 | [ |
---|
| 994 | AC_MSG_CHECKING(for $2.in in $1) |
---|
| 995 | if test -d $srcdir/$1; then |
---|
| 996 | rtems_av_save_dir=`pwd`; |
---|
| 997 | cd $srcdir; |
---|
| 998 | rtems_av_tmp=`find $1 -name "$2.in" -print | sed "s/$2\.in/%/" | sort | sed "s/%/$2/"` |
---|
| 999 | $3="$$3 $rtems_av_tmp"; |
---|
| 1000 | cd $rtems_av_save_dir; |
---|
| 1001 | AC_MSG_RESULT(done) |
---|
| 1002 | else |
---|
| 1003 | AC_MSG_RESULT(no) |
---|
| 1004 | fi |
---|
| 1005 | ]) |
---|
| 1006 | |
---|
| 1007 | |
---|
| 1008 | AC_DEFUN(RTEMS_CHECK_RDBG, |
---|
| 1009 | [dnl |
---|
| 1010 | AC_REQUIRE([RTEMS_TOP])dnl |
---|
| 1011 | AC_REQUIRE([RTEMS_CHECK_CPU])dnl |
---|
| 1012 | AC_CACHE_CHECK([whether cpu supports librdbg], |
---|
| 1013 | rtems_cv_has_rdbg, |
---|
| 1014 | [ |
---|
| 1015 | if test -d "$srcdir/${RTEMS_TOPdir}/c/src/lib/librdbg/${RTEMS_CPU}"; then |
---|
| 1016 | rtems_cv_has_rdbg="yes" ; |
---|
| 1017 | else |
---|
| 1018 | rtems_cv_has_rdbg="no"; |
---|
| 1019 | fi |
---|
| 1020 | ]) |
---|
| 1021 | ]) |
---|
| 1022 | |
---|