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 libraries
AC_DEFUN(AC_BROKEN,
[for ac_func in $1
do
AC_CHECK_FUNC($ac_func, [
ac_tr_func=HAVE_[]upcase($ac_func)
AC_DEFINE_UNQUOTED($ac_tr_func)],[LIBOBJS[]="$LIBOBJS ${ac_func}.o"])
if false; then
AC_CHECK_FUNCS($1)
fi
done
AC_SUBST(LIBOBJS)dnl
])
AC_DEFUN([AC_BROKEN],
[AC_FOREACH([rk_func], [$1],
[AC_CHECK_FUNC(rk_func,
[AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]rk_func), 1,
[Define if you have the function `]rk_func['.])],
[AC_LIBOBJ(rk_func)])])])

View File

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

View File

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

View File

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

View File

@@ -149,7 +149,7 @@ AC_BROKEN_VSNPRINTF
AC_BROKEN_GLOB
if test "$ac_cv_func_glob_working" != yes; then
LIBOBJS="$LIBOBJS glob.o"
AC_LIBOBJ(glob)
fi
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
LIBOBJS="$LIBOBJS getcap.o"
AC_LIBOBJ(getcap)
fi
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
rk_BROKEN_GETNAMEINFO
if test "$ac_cv_func_getnameinfo_broken" = yes; then
LIBOBJS="$LIBOBJS getnameinfo.o"
AC_LIBOBJ(getnameinfo)
fi
fi
if test "$ac_cv_func_getaddrinfo" = "yes"; then
rk_BROKEN_GETADDRINFO
if test "$ac_cv_func_getaddrinfo_numserv" = no; then
LIBOBJS="$LIBOBJS getaddrinfo.o freeaddrinfo.o"
AC_LIBOBJ(getaddrinfo freeaddrinfo)
fi
fi