[e81ef51] | 1 | dnl aclocal.m4 generated automatically by aclocal 1.2 |
---|
| 2 | |
---|
[2c3840b] | 3 | dnl |
---|
[e81ef51] | 4 | dnl $Id$ |
---|
[2c3840b] | 5 | dnl |
---|
[b5ddb74] | 6 | |
---|
| 7 | dnl macro to detect mkdir |
---|
| 8 | AC_DEFUN(RTEMS_PATH_MKDIR, |
---|
| 9 | [AC_PATH_PROG(MKDIR,mkdir) |
---|
| 10 | ]) |
---|
| 11 | |
---|
| 12 | dnl macro to check for mkdir -p |
---|
| 13 | AC_DEFUN(RTEMS_PROG_MKDIR_P, |
---|
| 14 | [ |
---|
| 15 | AC_REQUIRE([RTEMS_PATH_MKDIR]) |
---|
| 16 | AC_MSG_CHECKING([for working $MKDIR -p]) |
---|
| 17 | AC_CACHE_VAL(rtems_cv_prog_mkdir_p, |
---|
| 18 | [rm -rf conftestdata |
---|
| 19 | if $MKDIR -p conftestdata 2>/dev/null ;then |
---|
| 20 | rtems_cv_prog_MKDIR_P="yes" |
---|
| 21 | else |
---|
| 22 | rtems_cv_prog_MKDIR_P="no" |
---|
| 23 | fi])dnl |
---|
| 24 | rm -rf conftestdata |
---|
| 25 | AC_MSG_RESULT($rtems_cv_prog_MKDIR_P) |
---|
| 26 | ]) |
---|
| 27 | |
---|
| 28 | dnl macro to check for mkdir -m 0755 |
---|
| 29 | AC_DEFUN(RTEMS_PROG_MKDIR_M, |
---|
| 30 | [ |
---|
| 31 | AC_REQUIRE([RTEMS_PATH_MKDIR]) |
---|
| 32 | AC_MSG_CHECKING([for working $MKDIR -m 0755]) |
---|
| 33 | AC_CACHE_VAL(rtems_cv_prog_MKDIR_P, |
---|
| 34 | [rm -rf conftestdata |
---|
| 35 | if $MKDIR -m 0775 conftestdata 2>/dev/null; then |
---|
| 36 | rtems_cv_prog_MKDIR_M="yes" |
---|
| 37 | else |
---|
| 38 | rtems_cv_prog_MKDIR_M="no" |
---|
| 39 | fi])dnl |
---|
| 40 | rm -rf conftestdata |
---|
| 41 | AC_MSG_RESULT($rtems_cv_prog_MKDIR_M) |
---|
| 42 | ]) |
---|
[1670eede] | 43 | |
---|
[e81ef51] | 44 | |
---|
[2c3840b] | 45 | dnl |
---|
[e81ef51] | 46 | dnl $Id$ |
---|
[2c3840b] | 47 | dnl |
---|
[e81ef51] | 48 | |
---|
| 49 | dnl canonicalize target name |
---|
| 50 | dnl NOTE: Most rtems targets do not fullfil autoconf's |
---|
| 51 | dnl target naming conventions "processor-vendor-os" |
---|
| 52 | dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them |
---|
| 53 | dnl and we have to fix it for rtems ourselves |
---|
| 54 | |
---|
| 55 | AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU, |
---|
| 56 | [AC_MSG_CHECKING(rtems target cpu) |
---|
| 57 | changequote(<<, >>)dnl |
---|
| 58 | target_cpu=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'` |
---|
| 59 | changequote([, ])dnl |
---|
| 60 | AC_MSG_RESULT($target_cpu) |
---|
| 61 | ]) |
---|
| 62 | |
---|
[2c3840b] | 63 | dnl |
---|
| 64 | dnl $Id$ |
---|
| 65 | dnl |
---|
[fe2401b2] | 66 | dnl Set program_prefix |
---|
| 67 | dnl |
---|
| 68 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
| 69 | dnl Extracted from configure |
---|
| 70 | |
---|
| 71 | AC_DEFUN(RTEMS_TOOL_PREFIX, |
---|
| 72 | [AC_REQUIRE([AC_CANONICAL_TARGET])dnl |
---|
| 73 | AC_REQUIRE([AC_CANONICAL_BUILD])dnl |
---|
| 74 | |
---|
| 75 | if [[ "${program_prefix}" = "NONE" ]] ; then |
---|
| 76 | if [[ "${target}" = "${host}" ]] ; then |
---|
| 77 | program_prefix= |
---|
| 78 | else |
---|
| 79 | program_prefix=${target}- |
---|
| 80 | fi |
---|
| 81 | fi |
---|
| 82 | ]) |
---|
| 83 | |
---|
[e81ef51] | 84 | dnl |
---|
| 85 | dnl $Id$ |
---|
| 86 | dnl |
---|
| 87 | dnl Check for target gcc |
---|
| 88 | dnl |
---|
[fe2401b2] | 89 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
| 90 | dnl Completely reworked |
---|
[e81ef51] | 91 | |
---|
| 92 | AC_DEFUN(RTEMS_PROG_CC, |
---|
| 93 | [ |
---|
| 94 | AC_BEFORE([$0], [AC_PROG_CPP])dnl |
---|
| 95 | AC_BEFORE([$0], [AC_PROG_CC])dnl |
---|
[fe2401b2] | 96 | AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl |
---|
| 97 | |
---|
| 98 | dnl Only accept gcc and cc |
---|
| 99 | dnl NOTE: This might be too restrictive for native compilation |
---|
| 100 | AC_PATH_PROGS(CC_FOR_TARGET, "$program_prefix"gcc "$program_prefix"cc ) |
---|
| 101 | test -z "$CC_FOR_TARGET" \ |
---|
| 102 | && AC_MSG_ERROR([no acceptable cc found in \$PATH]) |
---|
| 103 | |
---|
| 104 | dnl backup |
---|
| 105 | rtems_save_CC=$CC |
---|
| 106 | rtems_save_CFLAGS=$CFLAGS |
---|
[e81ef51] | 107 | |
---|
[fe2401b2] | 108 | dnl temporarily set CC |
---|
| 109 | CC=$CC_FOR_TARGET |
---|
| 110 | |
---|
| 111 | AC_PROG_CC_WORKS |
---|
[e81ef51] | 112 | AC_PROG_CC_GNU |
---|
| 113 | |
---|
| 114 | if test $ac_cv_prog_gcc = yes; then |
---|
| 115 | GCC=yes |
---|
| 116 | dnl Check whether -g works, even if CFLAGS is set, in case the package |
---|
| 117 | dnl plays around with CFLAGS (such as to build both debugging and |
---|
| 118 | dnl normal versions of a library), tasteless as that idea is. |
---|
| 119 | ac_test_CFLAGS="${CFLAGS+set}" |
---|
| 120 | ac_save_CFLAGS="$CFLAGS" |
---|
| 121 | CFLAGS= |
---|
| 122 | AC_PROG_CC_G |
---|
| 123 | if test "$ac_test_CFLAGS" = set; then |
---|
| 124 | CFLAGS="$ac_save_CFLAGS" |
---|
| 125 | elif test $ac_cv_prog_cc_g = yes; then |
---|
| 126 | CFLAGS="-g -O2" |
---|
| 127 | else |
---|
| 128 | CFLAGS="-O2" |
---|
| 129 | fi |
---|
| 130 | else |
---|
| 131 | GCC= |
---|
| 132 | test "${CFLAGS+set}" = set || CFLAGS="-g" |
---|
| 133 | fi |
---|
| 134 | |
---|
| 135 | rtems_cv_prog_gcc=$ac_cv_prog_gcc |
---|
| 136 | rtems_cv_prog_cc_g=$ac_cv_prog_cc_g |
---|
[fe2401b2] | 137 | rtems_cv_prog_cc_works=$ac_cv_prog_cc_works |
---|
| 138 | rtems_cv_prog_cc_cross=$ac_cv_prog_cc_cross |
---|
[e81ef51] | 139 | |
---|
| 140 | dnl restore initial values |
---|
[fe2401b2] | 141 | CC=$rtems_save_CC |
---|
| 142 | CFLAGS=$rtems_save_CFLAGS |
---|
| 143 | |
---|
[e81ef51] | 144 | unset ac_cv_prog_gcc |
---|
| 145 | unset ac_cv_prog_cc_g |
---|
[fe2401b2] | 146 | unset ac_cv_prog_cc_works |
---|
| 147 | unset ac_cv_prog_cc_cross |
---|
[e81ef51] | 148 | ]) |
---|
| 149 | |
---|
| 150 | dnl |
---|
| 151 | dnl $Id$ |
---|
| 152 | dnl |
---|
| 153 | dnl Check whether the target compiler accepts -specs |
---|
| 154 | dnl |
---|
| 155 | dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de |
---|
| 156 | dnl |
---|
| 157 | |
---|
| 158 | AC_DEFUN(RTEMS_GCC_SPECS, |
---|
| 159 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
| 160 | AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts -specs,rtems_cv_gcc_specs, |
---|
[98100d2] | 161 | [ |
---|
| 162 | rtems_cv_gcc_specs=no |
---|
| 163 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
| 164 | touch confspec |
---|
| 165 | echo 'void f(){}' >conftest.c |
---|
| 166 | if test -z "`${CC_FOR_TARGET} -specs confspec -c conftest.c 2>&1`";then |
---|
| 167 | rtems_cv_gcc_specs=yes |
---|
| 168 | fi |
---|
[e81ef51] | 169 | fi |
---|
| 170 | rm -f confspec conftest* |
---|
| 171 | ])]) |
---|
| 172 | |
---|
| 173 | dnl |
---|
| 174 | dnl $Id$ |
---|
| 175 | dnl |
---|
| 176 | dnl Check whether the target compiler accepts -pipe |
---|
| 177 | dnl |
---|
| 178 | dnl 98/02/11 Ralf Corsepius corsepiu@faw.uni-ulm.de |
---|
| 179 | dnl |
---|
| 180 | |
---|
| 181 | AC_DEFUN(RTEMS_GCC_PIPE, |
---|
[a7a08713] | 182 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
| 183 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
[e81ef51] | 184 | AC_CACHE_CHECK(whether $CC_FOR_TARGET accepts --pipe,rtems_cv_gcc_pipe, |
---|
| 185 | [ |
---|
[98100d2] | 186 | rtems_cv_gcc_pipe=no |
---|
| 187 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
[a7a08713] | 188 | case "$host_os" in |
---|
| 189 | cygwin32*) |
---|
| 190 | ;; |
---|
| 191 | *) |
---|
| 192 | echo 'void f(){}' >conftest.c |
---|
| 193 | if test -z "`${CC_FOR_TARGET} --pipe -c conftest.c 2>&1`";then |
---|
| 194 | rtems_cv_gcc_pipe=yes |
---|
| 195 | fi |
---|
| 196 | rm -f conftest* |
---|
| 197 | ;; |
---|
| 198 | esac |
---|
[98100d2] | 199 | fi |
---|
[a7a08713] | 200 | ]) |
---|
| 201 | ]) |
---|
[e81ef51] | 202 | |
---|
| 203 | dnl |
---|
| 204 | dnl $Id$ |
---|
| 205 | dnl |
---|
| 206 | dnl Check for target g++ |
---|
| 207 | dnl |
---|
[fe2401b2] | 208 | dnl 98/05/20 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
| 209 | dnl Completely reworked |
---|
| 210 | |
---|
[e81ef51] | 211 | AC_DEFUN(RTEMS_PROG_CXX, |
---|
| 212 | [ |
---|
| 213 | AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl |
---|
| 214 | AC_BEFORE([$0], [AC_PROG_CXX])dnl |
---|
[fe2401b2] | 215 | AC_REQUIRE([RTEMS_TOOL_PREFIX])dnl |
---|
| 216 | |
---|
| 217 | dnl Only accept g++ and c++ |
---|
| 218 | dnl NOTE: This might be too restrictive for native compilation |
---|
| 219 | AC_PATH_PROGS(CXX_FOR_TARGET, "$program_prefix"g++ "$program_prefix"c++) |
---|
| 220 | test -z "$CXX_FOR_TARGET" \ |
---|
| 221 | && AC_MSG_ERROR([no acceptable c++ found in \$PATH]) |
---|
| 222 | |
---|
| 223 | dnl backup |
---|
| 224 | rtems_save_CXX=$CXX |
---|
| 225 | rtems_save_CXXFLAGS=$CXXFLAGS |
---|
| 226 | |
---|
| 227 | dnl temporarily set CXX |
---|
| 228 | CXX=$CXX_FOR_TARGET |
---|
[e81ef51] | 229 | |
---|
[fe2401b2] | 230 | AC_PROG_CXX_WORKS |
---|
[e81ef51] | 231 | AC_PROG_CXX_GNU |
---|
| 232 | |
---|
| 233 | if test $ac_cv_prog_gxx = yes; then |
---|
| 234 | GXX=yes |
---|
| 235 | dnl Check whether -g works, even if CXXFLAGS is set, in case the package |
---|
| 236 | dnl plays around with CXXFLAGS (such as to build both debugging and |
---|
| 237 | dnl normal versions of a library), tasteless as that idea is. |
---|
| 238 | ac_test_CXXFLAGS="${CXXFLAGS+set}" |
---|
| 239 | ac_save_CXXFLAGS="$CXXFLAGS" |
---|
| 240 | CXXFLAGS= |
---|
| 241 | AC_PROG_CXX_G |
---|
| 242 | if test "$ac_test_CXXFLAGS" = set; then |
---|
| 243 | CXXFLAGS="$ac_save_CXXFLAGS" |
---|
| 244 | elif test $ac_cv_prog_cxx_g = yes; then |
---|
| 245 | CXXFLAGS="-g -O2" |
---|
| 246 | else |
---|
| 247 | CXXFLAGS="-O2" |
---|
| 248 | fi |
---|
| 249 | else |
---|
| 250 | GXX= |
---|
| 251 | test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" |
---|
| 252 | fi |
---|
| 253 | |
---|
[fe2401b2] | 254 | rtems_cv_prog_gxx=$ac_cv_prog_gxx |
---|
| 255 | rtems_cv_prog_cxx_g=$ac_cv_prog_cxx_g |
---|
| 256 | rtems_cv_prog_cxx_works=$ac_cv_prog_cxx_works |
---|
| 257 | rtems_cv_prog_cxx_cross=$ac_cv_prog_cxx_cross |
---|
[e81ef51] | 258 | |
---|
[fe2401b2] | 259 | CXX=$rtems_save_CXX |
---|
| 260 | CXXFLAGS=$rtems_save_CXXFLAGS |
---|
[e81ef51] | 261 | |
---|
[fe2401b2] | 262 | dnl restore initial values |
---|
| 263 | unset ac_cv_prog_gxx |
---|
| 264 | unset ac_cv_prog_cc_g |
---|
| 265 | unset ac_cv_prog_cxx_works |
---|
| 266 | unset ac_cv_prog_cxx_cross |
---|
[e81ef51] | 267 | ]) |
---|
| 268 | |
---|
[2c3840b] | 269 | dnl |
---|
[e81ef51] | 270 | dnl $Id$ |
---|
| 271 | dnl |
---|
| 272 | dnl Set target tools |
---|
| 273 | dnl |
---|
[98100d2] | 274 | dnl 98/06/23 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
| 275 | dnl fixing cache/environment variable handling |
---|
| 276 | dnl adding checks for cygwin/egcs '\\'-bug |
---|
| 277 | dnl adding checks for ranlib/ar -s problem |
---|
| 278 | dnl |
---|
[e81ef51] | 279 | dnl 98/02/12 Ralf Corsepius (corsepiu@faw.uni-ulm.de) |
---|
| 280 | dnl |
---|
| 281 | |
---|
[98100d2] | 282 | AC_DEFUN(RTEMS_GCC_PRINT, |
---|
| 283 | [ case $host_os in |
---|
| 284 | *cygwin32*) |
---|
| 285 | dnl FIXME: Hack for cygwin/egcs reporting mixed '\\' and '/' |
---|
| 286 | dnl Should be removed once cygwin/egcs reports '/' only |
---|
[32067a30] | 287 | $1=`$CC_FOR_TARGET --print-prog-name=$2 | sed -e 's%\\\\%/%g' ` |
---|
[98100d2] | 288 | ;; |
---|
| 289 | *) |
---|
| 290 | $1=`$CC_FOR_TARGET --print-prog-name=$2` |
---|
| 291 | ;; |
---|
| 292 | esac |
---|
| 293 | ]) |
---|
| 294 | |
---|
| 295 | AC_DEFUN(RTEMS_PATH_TOOL, |
---|
| 296 | [ |
---|
| 297 | AC_MSG_CHECKING([target's $2]) |
---|
| 298 | AC_CACHE_VAL(ac_cv_path_$1,:) |
---|
| 299 | AC_MSG_RESULT([$ac_cv_path_$1]) |
---|
| 300 | |
---|
| 301 | if test -n "$ac_cv_path_$1"; then |
---|
| 302 | dnl retrieve the value from the cache |
---|
| 303 | $1=$ac_cv_path_$1 |
---|
| 304 | else |
---|
| 305 | dnl the cache was not set |
---|
| 306 | if test -z "[$]$1" ; then |
---|
| 307 | if test "$rtems_cv_prog_gcc" = "yes"; then |
---|
| 308 | # We are using gcc, ask it about its tool |
---|
| 309 | # NOTE: Necessary if gcc was configured to use the target's |
---|
| 310 | # native tools or uses prefixes for gnutools (e.g. gas instead of as) |
---|
| 311 | RTEMS_GCC_PRINT($1,$2) |
---|
| 312 | fi |
---|
| 313 | else |
---|
| 314 | # The user set an environment variable. |
---|
| 315 | # Check whether it is an absolute path, otherwise AC_PATH_PROG |
---|
| 316 | # will override the environment variable, which isn't what the user |
---|
| 317 | # intends |
---|
| 318 | AC_MSG_CHECKING([whether environment variable $1 is an absolute path]) |
---|
| 319 | case "[$]$1" in |
---|
| 320 | /*) # valid |
---|
| 321 | AC_MSG_RESULT("yes") |
---|
| 322 | ;; |
---|
| 323 | *) # invalid for AC_PATH_PROG |
---|
| 324 | AC_MSG_RESULT("no") |
---|
| 325 | AC_MSG_ERROR([***] |
---|
| 326 | [Environment variable $1 should ether] |
---|
| 327 | [be unset (preferred) or contain an absolute path]) |
---|
| 328 | ;; |
---|
| 329 | esac |
---|
| 330 | fi |
---|
| 331 | |
---|
| 332 | AC_PATH_PROG($1,"$program_prefix"$2,$3) |
---|
| 333 | fi |
---|
| 334 | ]) |
---|
| 335 | |
---|
[e81ef51] | 336 | AC_DEFUN(RTEMS_CANONICALIZE_TOOLS, |
---|
| 337 | [AC_REQUIRE([RTEMS_PROG_CC])dnl |
---|
[98100d2] | 338 | |
---|
| 339 | dnl FIXME: What shall be done if these tools are not available? |
---|
| 340 | RTEMS_PATH_TOOL(AR_FOR_TARGET,ar,no) |
---|
| 341 | RTEMS_PATH_TOOL(AS_FOR_TARGET,as,no) |
---|
| 342 | RTEMS_PATH_TOOL(LD_FOR_TARGET,ld,no) |
---|
| 343 | RTEMS_PATH_TOOL(NM_FOR_TARGET,nm,no) |
---|
| 344 | |
---|
| 345 | dnl special treatment of ranlib |
---|
| 346 | RTEMS_PATH_TOOL(RANLIB_FOR_TARGET,ranlib,no) |
---|
| 347 | if test "$RANLIB_FOR_TARGET" = "no"; then |
---|
| 348 | # ranlib wasn't found; check if ar -s is available |
---|
| 349 | RTEMS_AR_FOR_TARGET_S |
---|
| 350 | if test $rtems_cv_AR_FOR_TARGET_S = "yes" ; then |
---|
| 351 | dnl override RANLIB_FOR_TARGET's cache |
---|
| 352 | ac_cv_path_RANLIB_FOR_TARGET="$AR_FOR_TARGET -s" |
---|
| 353 | RANLIB_FOR_TARGET=$ac_cv_path_RANLIB_FOR_TARGET |
---|
| 354 | else |
---|
| 355 | AC_MSG_ERROR([***] |
---|
| 356 | [Can't figure out how to build a library index] |
---|
| 357 | [Nether ranlib nor ar -s seem to be available] ) |
---|
| 358 | fi |
---|
| 359 | fi |
---|
| 360 | |
---|
| 361 | dnl NOTE: These may not be available if not using gnutools |
---|
| 362 | RTEMS_PATH_TOOL(OBJCOPY_FOR_TARGET,objcopy,no) |
---|
| 363 | RTEMS_PATH_TOOL(SIZE_FOR_TARGET,size,no) |
---|
| 364 | ]) |
---|
| 365 | |
---|
[2c3840b] | 366 | dnl |
---|
| 367 | dnl $Id$ |
---|
| 368 | dnl |
---|
| 369 | |
---|
[98100d2] | 370 | AC_DEFUN(RTEMS_AR_FOR_TARGET_S, |
---|
| 371 | [ |
---|
| 372 | AC_CACHE_CHECK(whether $AR_FOR_TARGET -s works, |
---|
| 373 | rtems_cv_AR_FOR_TARGET_S, |
---|
| 374 | [ |
---|
| 375 | cat > conftest.$ac_ext <<EOF |
---|
| 376 | int foo( int b ) |
---|
| 377 | { return b; } |
---|
| 378 | EOF |
---|
| 379 | if AC_TRY_COMMAND($CC_FOR_TARGET -o conftest.o -c conftest.$ac_ext) \ |
---|
| 380 | && AC_TRY_COMMAND($AR_FOR_TARGET -sr conftest.a conftest.o) \ |
---|
| 381 | && test -s conftest.a ; \ |
---|
| 382 | then |
---|
| 383 | rtems_cv_AR_FOR_TARGET_S="yes" |
---|
| 384 | else |
---|
| 385 | rtems_cv_AR_FOR_TARGET_S="no" |
---|
[e81ef51] | 386 | fi |
---|
[98100d2] | 387 | rm -f conftest* |
---|
| 388 | ]) |
---|
| 389 | ]) |
---|
[e81ef51] | 390 | |
---|
| 391 | |
---|
[2c3840b] | 392 | dnl |
---|
| 393 | dnl $Id$ |
---|
| 394 | dnl |
---|
| 395 | |
---|
| 396 | dnl check for i386 gas supporting 16 bit mode |
---|
[1c823363] | 397 | dnl - binutils 2.9.1.0.7 and higher |
---|
[2c3840b] | 398 | |
---|
| 399 | AC_DEFUN(RTEMS_I386_GAS_CODE16, |
---|
| 400 | if test "${target_cpu}" = "i386"; then |
---|
| 401 | AC_CACHE_CHECK([for 16 bit mode assembler support], |
---|
| 402 | rtems_cv_prog_gas_code16, |
---|
| 403 | [cat > conftest.s << EOF |
---|
| 404 | .code16 |
---|
[f44a81b] | 405 | data32 |
---|
| 406 | addr32 |
---|
| 407 | lgdt |
---|
| 408 | 0 |
---|
[2c3840b] | 409 | EOF |
---|
| 410 | if AC_TRY_COMMAND($AS_FOR_TARGET -o conftest.o conftest.s); then |
---|
| 411 | rtems_cv_prog_gas_code16=yes |
---|
| 412 | else |
---|
| 413 | rtems_cv_prog_gas_code16=no |
---|
| 414 | fi]) |
---|
| 415 | RTEMS_GAS_CODE16="$rtems_cv_prog_gas_code16" |
---|
| 416 | fi |
---|
| 417 | ) |
---|
| 418 | |
---|
| 419 | |
---|
| 420 | dnl |
---|
| 421 | dnl $Id$ |
---|
| 422 | dnl |
---|
[98100d2] | 423 | dnl Detect the Cygwin32 environment (unix under Win32) |
---|
| 424 | dnl |
---|
| 425 | dnl 98/06/16 David Fiddes (D.J.Fiddes@hw.ac.uk) |
---|
| 426 | dnl Hacked from automake-1.3 |
---|
[e81ef51] | 427 | |
---|
[98100d2] | 428 | # Check to see if we're running under Cygwin32, without using |
---|
| 429 | # AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes". |
---|
| 430 | # Otherwise set it to "no". |
---|
| 431 | |
---|
| 432 | dnl RTEMS_CYGWIN32() |
---|
| 433 | AC_DEFUN(RTEMS_CYGWIN32, |
---|
| 434 | [AC_CACHE_CHECK(for Cygwin32 environment, rtems_cv_cygwin32, |
---|
| 435 | [AC_TRY_COMPILE(,[return __CYGWIN32__;], |
---|
| 436 | rtems_cv_cygwin32=yes, rtems_cv_cygwin32=no) |
---|
| 437 | rm -f conftest*]) |
---|
| 438 | CYGWIN32= |
---|
| 439 | test "$rtems_cv_cygwin32" = yes && CYGWIN32=yes]) |
---|
| 440 | |
---|
| 441 | |
---|
[2c3840b] | 442 | dnl |
---|
| 443 | dnl $Id$ |
---|
| 444 | dnl |
---|
[98100d2] | 445 | dnl Set the EXE extension |
---|
| 446 | dnl |
---|
| 447 | dnl 98/06/16 David Fiddes (D.J.Fiddes@hw.ac.uk) |
---|
| 448 | dnl Hacked from automake-1.3 |
---|
| 449 | |
---|
| 450 | # Check to see if we're running under Win32, without using |
---|
| 451 | # AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe". |
---|
| 452 | # Otherwise set it to "". |
---|
| 453 | |
---|
| 454 | dnl RTEMS_EXEEXT() |
---|
| 455 | dnl This knows we add .exe if we're building in the Cygwin32 |
---|
| 456 | dnl environment. But if we're not, then it compiles a test program |
---|
| 457 | dnl to see if there is a suffix for executables. |
---|
| 458 | AC_DEFUN(RTEMS_EXEEXT, |
---|
| 459 | [AC_REQUIRE([RTEMS_CYGWIN32]) |
---|
| 460 | AC_MSG_CHECKING([for executable suffix]) |
---|
| 461 | AC_CACHE_VAL(rtems_cv_exeext, |
---|
| 462 | [if test "$CYGWIN32" = yes; then |
---|
| 463 | rtems_cv_exeext=.exe |
---|
| 464 | else |
---|
| 465 | cat > rtems_c_test.c << 'EOF' |
---|
| 466 | int main() { |
---|
| 467 | /* Nothing needed here */ |
---|
| 468 | } |
---|
| 469 | EOF |
---|
| 470 | ${CC-cc} -o rtems_c_test $CFLAGS $CPPFLAGS $LDFLAGS rtems_c_test.c $LIBS 1>&5 |
---|
| 471 | rtems_cv_exeext=`echo rtems_c_test.* | grep -v rtems_c_test.c | sed -e s/rtems_c_test//` |
---|
| 472 | rm -f rtems_c_test*]) |
---|
| 473 | test x"${rtems_cv_exeext}" = x && rtems_cv_exeext=no |
---|
| 474 | fi |
---|
| 475 | EXEEXT="" |
---|
| 476 | test x"${rtems_cv_exeext}" != xno && EXEEXT=${rtems_cv_exeext} |
---|
| 477 | AC_MSG_RESULT(${rtems_cv_exeext}) |
---|
| 478 | AC_SUBST(EXEEXT)]) |
---|
[e81ef51] | 479 | |
---|
| 480 | |
---|
[613ab62] | 481 | dnl |
---|
| 482 | dnl $Id$ |
---|
| 483 | dnl |
---|
| 484 | dnl Check for System V IPC calls used by Unix simulators |
---|
| 485 | dnl |
---|
| 486 | dnl 98/07/17 Dario Alcocer alcocer@netcom.com |
---|
| 487 | dnl Ralf Corsepius corsepiu@faw.uni-ulm.de |
---|
| 488 | dnl |
---|
| 489 | dnl Note: $host_os should probably *not* ever be used here to |
---|
| 490 | dnl determine if host supports System V IPC calls, since some |
---|
| 491 | dnl (e.g. FreeBSD 2.x) are configured by default to include only |
---|
| 492 | dnl a subset of the System V IPC calls. Therefore, to make sure |
---|
| 493 | dnl all of the required calls are found, test for each call explicitly. |
---|
| 494 | dnl |
---|
| 495 | dnl All of the calls use IPC_PRIVATE, so tests will not unintentionally |
---|
| 496 | dnl modify any existing key sets. See the man pages for semget, shmget, |
---|
| 497 | dnl msgget, semctl, shmctl and msgctl for details. |
---|
| 498 | |
---|
| 499 | AC_DEFUN(RTEMS_SYSV_SEM, |
---|
| 500 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
| 501 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
| 502 | AC_CACHE_CHECK(whether $RTEMS_HOST supports System V semaphores, |
---|
| 503 | rtems_cv_sysv_sem, |
---|
| 504 | [ |
---|
| 505 | AC_TRY_RUN([ |
---|
| 506 | #include <sys/types.h> |
---|
| 507 | #include <sys/ipc.h> |
---|
| 508 | #include <sys/sem.h> |
---|
| 509 | int main () { |
---|
[2d7d605] | 510 | #if !defined(sun) |
---|
| 511 | union semun arg ; |
---|
[06fa582] | 512 | #else |
---|
| 513 | union semun { |
---|
| 514 | int val; |
---|
| 515 | struct semid_ds *buf; |
---|
| 516 | ushort *array; |
---|
| 517 | } arg; |
---|
| 518 | #endif |
---|
[613ab62] | 519 | int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400); |
---|
| 520 | if (id == -1) |
---|
| 521 | exit(1); |
---|
| 522 | arg.val = 0; /* avoid implicit type cast to union */ |
---|
| 523 | if (semctl(id, 0, IPC_RMID, arg) == -1) |
---|
| 524 | exit(1); |
---|
| 525 | exit(0); |
---|
| 526 | } |
---|
| 527 | ], |
---|
| 528 | rtems_cv_sysv_sem="yes", rtems_cv_sysv_sem="no", :) |
---|
| 529 | ]) |
---|
| 530 | ]) |
---|
| 531 | |
---|
| 532 | AC_DEFUN(RTEMS_SYSV_SHM, |
---|
| 533 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
| 534 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
| 535 | AC_CACHE_CHECK(whether $RTEMS_HOST supports System V shared memory, |
---|
| 536 | rtems_cv_sysv_shm, |
---|
| 537 | [ |
---|
| 538 | AC_TRY_RUN([ |
---|
| 539 | #include <sys/types.h> |
---|
| 540 | #include <sys/ipc.h> |
---|
| 541 | #include <sys/shm.h> |
---|
| 542 | int main () { |
---|
| 543 | int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400); |
---|
| 544 | if (id == -1) |
---|
| 545 | exit(1); |
---|
| 546 | if (shmctl(id, IPC_RMID, 0) == -1) |
---|
| 547 | exit(1); |
---|
| 548 | exit(0); |
---|
| 549 | } |
---|
| 550 | ], |
---|
| 551 | rtems_cv_sysv_shm="yes", rtems_cv_sysv_shm="no", :) |
---|
| 552 | ]) |
---|
| 553 | ]) |
---|
| 554 | |
---|
| 555 | AC_DEFUN(RTEMS_SYSV_MSG, |
---|
| 556 | [AC_REQUIRE([RTEMS_PROG_CC]) |
---|
| 557 | AC_REQUIRE([AC_CANONICAL_HOST]) |
---|
| 558 | AC_CACHE_CHECK(whether $RTEMS_HOST supports System V messages, |
---|
| 559 | rtems_cv_sysv_msg, |
---|
| 560 | [ |
---|
| 561 | AC_TRY_RUN([ |
---|
| 562 | #include <sys/types.h> |
---|
| 563 | #include <sys/ipc.h> |
---|
| 564 | #include <sys/msg.h> |
---|
| 565 | int main () { |
---|
| 566 | int id=msgget(IPC_PRIVATE,IPC_CREAT|0400); |
---|
| 567 | if (id == -1) |
---|
| 568 | exit(1); |
---|
| 569 | if (msgctl(id, IPC_RMID, 0) == -1) |
---|
| 570 | exit(1); |
---|
| 571 | exit(0); |
---|
| 572 | } |
---|
| 573 | ], |
---|
| 574 | rtems_cv_sysv_msg="yes", rtems_cv_sysv_msg="no", :) |
---|
| 575 | ]) |
---|
| 576 | ]) |
---|
| 577 | |
---|
[2c3840b] | 578 | dnl |
---|
[e81ef51] | 579 | dnl $Id$ |
---|
[2c3840b] | 580 | dnl |
---|
[e81ef51] | 581 | |
---|
| 582 | dnl RTEMS_CHECK_MAKEFILE(path) |
---|
| 583 | dnl Search for Makefile.in's within the directory starting |
---|
| 584 | dnl at path and append an entry for Makefile to global variable |
---|
| 585 | dnl "makefiles" (from configure.in) for each Makefile.in found |
---|
| 586 | dnl |
---|
| 587 | AC_DEFUN(RTEMS_CHECK_MAKEFILE, |
---|
| 588 | [RTEMS_CHECK_FILES_IN($1,Makefile,makefiles) |
---|
| 589 | ]) |
---|
| 590 | |
---|
[2c3840b] | 591 | dnl |
---|
[e81ef51] | 592 | dnl $Id$ |
---|
[2c3840b] | 593 | dnl |
---|
[e81ef51] | 594 | |
---|
[37717818] | 595 | dnl RTEMS_CHECK_FILES_IN(path,file,var) |
---|
| 596 | dnl path .. path relative to srcdir, where to start searching for files |
---|
| 597 | dnl file .. name of the files to search for |
---|
[e81ef51] | 598 | dnl var .. shell variable to append files found |
---|
[2c3840b] | 599 | |
---|
[37717818] | 600 | AC_DEFUN(RTEMS_CHECK_FILES_IN, |
---|
| 601 | [ |
---|
[2f03a608] | 602 | AC_MSG_CHECKING(for $2.in in $1) |
---|
[37717818] | 603 | if test -d $srcdir/$1; then |
---|
| 604 | rtems_av_save_dir=`pwd`; |
---|
| 605 | cd $srcdir; |
---|
[2f03a608] | 606 | rtems_av_tmp=`find $1 -name "$2.in" -print | sed "s/$2\.in/%/" | sort | sed "s/%/$2/"` |
---|
[37717818] | 607 | $3="$$3 $rtems_av_tmp"; |
---|
| 608 | cd $rtems_av_save_dir; |
---|
| 609 | AC_MSG_RESULT(done) |
---|
| 610 | else |
---|
| 611 | AC_MSG_RESULT(no) |
---|
| 612 | fi |
---|
[1670eede] | 613 | ]) |
---|
| 614 | |
---|
| 615 | |
---|