use AC_LIBOBJ

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11000 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2002-05-19 19:17:47 +00:00
parent ff3e2cf70f
commit 4de66b10ed
5 changed files with 23 additions and 40 deletions

View File

@@ -4,15 +4,9 @@ dnl
dnl Same as AC _REPLACE_FUNCS, just define HAVE_func if found in normal dnl Same as AC _REPLACE_FUNCS, just define HAVE_func if found in normal
dnl libraries dnl libraries
AC_DEFUN(AC_BROKEN, AC_DEFUN([AC_BROKEN],
[for ac_func in $1 [AC_FOREACH([rk_func], [$1],
do [AC_CHECK_FUNC(rk_func,
AC_CHECK_FUNC($ac_func, [ [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]rk_func), 1,
ac_tr_func=HAVE_[]upcase($ac_func) [Define if you have the function `]rk_func['.])],
AC_DEFINE_UNQUOTED($ac_tr_func)],[LIBOBJS[]="$LIBOBJS ${ac_func}.o"]) [AC_LIBOBJ(rk_func)])])])
if false; then
AC_CHECK_FUNCS($1)
fi
done
AC_SUBST(LIBOBJS)dnl
])

View File

@@ -3,33 +3,24 @@ dnl
dnl AC_BROKEN but with more arguments dnl AC_BROKEN but with more arguments
dnl AC_BROKEN2(func, includes, arguments) dnl AC_BROKEN2(func, includes, arguments)
AC_DEFUN(AC_BROKEN2, AC_DEFUN([AC_BROKEN2],
[for ac_func in $1 [AC_MSG_CHECKING([for $1])
do AC_CACHE_VAL(ac_cv_func_[]$1,
AC_MSG_CHECKING([for $ac_func])
AC_CACHE_VAL(ac_cv_func_$ac_func,
[AC_TRY_LINK([$2], [AC_TRY_LINK([$2],
[ [
/* The GNU C library defines this for functions which it implements /* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */ something starting with __ and the normal name is an alias. */
#if defined (__stub_$1) || defined (__stub___$1) #if defined (__stub_[]$1) || defined (__stub___[]$1)
choke me choke me
#else #else
$ac_func($3) $1($3)
#endif #endif
], [eval "ac_cv_func_$ac_func=yes"], [eval "ac_cv_func_$ac_func=no"])]) ], [eval "ac_cv_func_[]$1=yes"], [eval "ac_cv_func_[]$1=no"])])
if eval "test \"\${ac_cv_func_$ac_func}\" = yes"; then if eval "test \"\${ac_cv_func_[]$1}\" = yes"; then
ac_tr_func=HAVE_[]upcase($ac_func) AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]$1), 1, define)
AC_DEFINE_UNQUOTED($ac_tr_func)
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
else else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
LIBOBJS[]="$LIBOBJS ${ac_func}.o" AC_LIBOBJ($1)
fi fi])
done
if false; then
AC_CHECK_FUNCS($1)
fi
AC_SUBST(LIBOBJS)dnl
])

View File

@@ -6,8 +6,7 @@ dnl
AC_DEFUN(AC_FIND_IF_NOT_BROKEN, AC_DEFUN(AC_FIND_IF_NOT_BROKEN,
[AC_FIND_FUNC([$1], [$2], [$3], [$4]) [AC_FIND_FUNC([$1], [$2], [$3], [$4])
if eval "test \"$ac_cv_func_$1\" != yes"; then if eval "test \"$ac_cv_func_$1\" != yes"; then
LIBOBJS[]="$LIBOBJS $1.o" AC_LIBOBJ([$1])
fi fi
AC_SUBST(LIBOBJS)dnl
]) ])

View File

@@ -32,8 +32,7 @@ int main()
]) ])
if test "$ac_cv_func_getcwd_broken" = yes; then if test "$ac_cv_func_getcwd_broken" = yes; then
AC_DEFINE(BROKEN_GETCWD, 1, [Define if getcwd is broken (like in SunOS 4).])dnl AC_DEFINE(BROKEN_GETCWD, 1, [Define if getcwd is broken (like in SunOS 4).])dnl
LIBOBJS="$LIBOBJS getcwd.o" AC_LIBOBJ(getcwd)
AC_SUBST(LIBOBJS)dnl
AC_MSG_RESULT($ac_cv_func_getcwd_broken) AC_MSG_RESULT($ac_cv_func_getcwd_broken)
else else
AC_MSG_RESULT([seems ok]) AC_MSG_RESULT([seems ok])

View File

@@ -149,7 +149,7 @@ AC_BROKEN_VSNPRINTF
AC_BROKEN_GLOB AC_BROKEN_GLOB
if test "$ac_cv_func_glob_working" != yes; then if test "$ac_cv_func_glob_working" != yes; then
LIBOBJS="$LIBOBJS glob.o" AC_LIBOBJ(glob)
fi fi
AM_CONDITIONAL(have_glob_h, test "$ac_cv_func_glob_working" = yes) AM_CONDITIONAL(have_glob_h, test "$ac_cv_func_glob_working" = yes)
@@ -184,7 +184,7 @@ AC_CHECK_FUNCS([ \
]) ])
if test "$ac_cv_func_cgetent" = no; then if test "$ac_cv_func_cgetent" = no; then
LIBOBJS="$LIBOBJS getcap.o" AC_LIBOBJ(getcap)
fi fi
AC_REQUIRE([AC_FUNC_GETLOGIN]) AC_REQUIRE([AC_FUNC_GETLOGIN])
@@ -404,14 +404,14 @@ AC_HAVE_STRUCT_FIELD(struct sockaddr, sa_len, [#include <sys/types.h>
if test "$ac_cv_func_getnameinfo" = "yes"; then if test "$ac_cv_func_getnameinfo" = "yes"; then
rk_BROKEN_GETNAMEINFO rk_BROKEN_GETNAMEINFO
if test "$ac_cv_func_getnameinfo_broken" = yes; then if test "$ac_cv_func_getnameinfo_broken" = yes; then
LIBOBJS="$LIBOBJS getnameinfo.o" AC_LIBOBJ(getnameinfo)
fi fi
fi fi
if test "$ac_cv_func_getaddrinfo" = "yes"; then if test "$ac_cv_func_getaddrinfo" = "yes"; then
rk_BROKEN_GETADDRINFO rk_BROKEN_GETADDRINFO
if test "$ac_cv_func_getaddrinfo_numserv" = no; then if test "$ac_cv_func_getaddrinfo_numserv" = no; then
LIBOBJS="$LIBOBJS getaddrinfo.o freeaddrinfo.o" AC_LIBOBJ(getaddrinfo freeaddrinfo)
fi fi
fi fi