From: Ben Elliston Date: Wed, 7 Oct 1998 07:57:41 +0000 (+0000) Subject: 1998-10-08 Ben Elliston X-Git-Tag: autoconf-2-13-rc1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40720b3f45fba33fe2b34c947eb929ad0f2e7a58;p=thirdparty%2Fautoconf.git 1998-10-08 Ben Elliston * acgeneral.m4 (AC_TRY_LINK_FUNC): Fix macro ordering. --- diff --git a/ChangeLog b/ChangeLog index d22494fc..32911549 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +1998-10-08 Ben Elliston + + * acgeneral.m4 (AC_TRY_LINK_FUNC): Fix macro ordering. + 1998-10-03 Ben Elliston * acconfig.h (FC_NO_MINUS_C_MINUS_O): Add to complete the Fortran diff --git a/acgeneral.m4 b/acgeneral.m4 index 61ad88cb..e3319b5b 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -1527,6 +1527,28 @@ rm -fr conftest*]) dnl ### Checking for libraries +dnl AC_TRY_LINK_FUNC(func, action-if-found, action-if-not-found) +dnl Try to link a program that calls FUNC, handling GCC builtins. If +dnl the link succeeds, execute ACTION-IF-FOUND; otherwise, execute +dnl ACTION-IF-NOT-FOUND. + +AC_DEFUN(AC_TRY_LINK_FUNC, +AC_TRY_LINK(dnl +ifelse([$2], [main], , dnl Avoid conflicting decl of main. +[/* Override any gcc2 internal prototype to avoid an error. */ +]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus +extern "C" +#endif +])dnl +[/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $1(); +]), +[$1()], +[$2], +[$3])) + + dnl AC_SEARCH_LIBS(func, searchlibs, [action-if-found], [action-if-not-found]) dnl Search for a library defining FUNC, if it's not already available. @@ -1770,27 +1792,6 @@ ifelse([$4], , , [ rm -rf conftest* fi rm -f conftest*]) -dnl AC_TRY_LINK_FUNC(func, action-if-found, action-if-not-found) -dnl Try to link a program that calls FUNC, handling GCC builtins. If -dnl the link succeeds, execute ACTION-IF-FOUND; otherwise, execute -dnl ACTION-IF-NOT-FOUND. - -AC_DEFUN(AC_TRY_LINK_FUNC, -AC_TRY_LINK(dnl -ifelse([$2], [main], , dnl Avoid conflicting decl of main. -[/* Override any gcc2 internal prototype to avoid an error. */ -]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus -extern "C" -#endif -])dnl -[/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $1(); -]), -[$1()], -[$2], -[$3])) - dnl ### Checking for run-time features diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 61ad88cb..e3319b5b 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -1527,6 +1527,28 @@ rm -fr conftest*]) dnl ### Checking for libraries +dnl AC_TRY_LINK_FUNC(func, action-if-found, action-if-not-found) +dnl Try to link a program that calls FUNC, handling GCC builtins. If +dnl the link succeeds, execute ACTION-IF-FOUND; otherwise, execute +dnl ACTION-IF-NOT-FOUND. + +AC_DEFUN(AC_TRY_LINK_FUNC, +AC_TRY_LINK(dnl +ifelse([$2], [main], , dnl Avoid conflicting decl of main. +[/* Override any gcc2 internal prototype to avoid an error. */ +]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus +extern "C" +#endif +])dnl +[/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $1(); +]), +[$1()], +[$2], +[$3])) + + dnl AC_SEARCH_LIBS(func, searchlibs, [action-if-found], [action-if-not-found]) dnl Search for a library defining FUNC, if it's not already available. @@ -1770,27 +1792,6 @@ ifelse([$4], , , [ rm -rf conftest* fi rm -f conftest*]) -dnl AC_TRY_LINK_FUNC(func, action-if-found, action-if-not-found) -dnl Try to link a program that calls FUNC, handling GCC builtins. If -dnl the link succeeds, execute ACTION-IF-FOUND; otherwise, execute -dnl ACTION-IF-NOT-FOUND. - -AC_DEFUN(AC_TRY_LINK_FUNC, -AC_TRY_LINK(dnl -ifelse([$2], [main], , dnl Avoid conflicting decl of main. -[/* Override any gcc2 internal prototype to avoid an error. */ -]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus -extern "C" -#endif -])dnl -[/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $1(); -]), -[$1()], -[$2], -[$3])) - dnl ### Checking for run-time features