351 |
# ----------------- |
# ----------------- |
352 |
# FIXME: The GCC team has specific needs which the current Autoconf |
# FIXME: The GCC team has specific needs which the current Autoconf |
353 |
# framework cannot solve elegantly. This macro implements a dirty |
# framework cannot solve elegantly. This macro implements a dirty |
354 |
# hack until Autoconf is abble to provide the services its users |
# hack until Autoconf is able to provide the services its users |
355 |
# needs. |
# need. |
356 |
# |
# |
357 |
# Several of the support libraries that are often built with GCC can't |
# Several of the support libraries that are often built with GCC can't |
358 |
# assume the tool-chain is already capable of linking a program: the |
# assume the tool-chain is already capable of linking a program: the |
363 |
# avoid the AC_PROG_CC_WORKS test, that would just abort their |
# avoid the AC_PROG_CC_WORKS test, that would just abort their |
364 |
# configuration. The introduction of AC_EXEEXT, enabled either by |
# configuration. The introduction of AC_EXEEXT, enabled either by |
365 |
# libtool or by CVS autoconf, have just made matters worse. |
# libtool or by CVS autoconf, have just made matters worse. |
366 |
|
# |
367 |
|
# Unlike an earlier version of this macro, using AC_NO_EXECUTABLES does |
368 |
|
# not disable link tests at autoconf time, but at configure time. |
369 |
|
# This allows AC_NO_EXECUTABLES to be invoked conditionally. |
370 |
AC_DEFUN_ONCE([AC_NO_EXECUTABLES], |
AC_DEFUN_ONCE([AC_NO_EXECUTABLES], |
371 |
[m4_divert_push([KILL]) |
[m4_divert_push([KILL]) |
372 |
|
m4_divert_text([DEFAULTS], [ac_no_link=no]) |
373 |
|
|
|
AC_BEFORE([$0], [_AC_COMPILER_EXEEXT_WORKS]) |
|
374 |
AC_BEFORE([$0], [_AC_COMPILER_EXEEXT]) |
AC_BEFORE([$0], [_AC_COMPILER_EXEEXT]) |
375 |
|
AC_BEFORE([$0], [AC_LINK_IFELSE]) |
|
m4_define([_AC_COMPILER_EXEEXT_WORKS], |
|
|
[cross_compiling=maybe |
|
|
]) |
|
376 |
|
|
377 |
m4_define([_AC_COMPILER_EXEEXT], |
m4_define([_AC_COMPILER_EXEEXT], |
378 |
[EXEEXT= |
[AC_LANG_CONFTEST([AC_LANG_PROGRAM()]) |
379 |
|
if AC_TRY_EVAL(ac_link); then |
380 |
|
ac_no_link=no |
381 |
|
]m4_defn([_AC_COMPILER_EXEEXT])[ |
382 |
|
else |
383 |
|
ac_no_link=yes |
384 |
|
# Setting cross_compile will disable run tests; it will |
385 |
|
# also disable AC_CHECK_FILE but that's generally |
386 |
|
# correct if we can't link. |
387 |
|
cross_compiling=yes |
388 |
|
EXEEXT= |
389 |
|
_AC_COMPILER_EXEEXT_CROSS |
390 |
|
fi |
391 |
]) |
]) |
392 |
|
|
393 |
m4_define([AC_LINK_IFELSE], |
m4_define([AC_LINK_IFELSE], |
394 |
[AC_FATAL([All the tests involving linking were disabled by $0])]) |
[if test x$ac_no_link = xyes; then |
395 |
|
AC_MSG_ERROR([Link tests are not allowed after AC@&t@_NO_EXECUTABLES.]) |
396 |
|
fi |
397 |
|
]m4_defn([AC_LINK_IFELSE])) |
398 |
|
|
399 |
m4_divert_pop()dnl |
m4_divert_pop()dnl |
400 |
])# AC_NO_EXECUTABLES |
])# AC_NO_EXECUTABLES |