Jim Meyering wrote: > That is because it's looking in the wrong place. > This patch fixes the immediate problem
Indeed, thanks. But the bug is really in the AC_FUNC_GETLOADAVG macro in autoconf. The macros AC_FUNC_ERROR_AT_LINE, AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, AC_FUNC_MALLOC, AC_FUNC_MEMCMP, AC_FUNC_MKTIME, AC_FUNC_OBSTACK, AC_FUNC_REALLOC, AC_FUNC_STRTOD, AC_FUNC_STRNLEN, AC_REPLACE_FNMATCH are all able to call AC_LIBOBJ without additional hassles on the user. AC_FUNC_GETLOADAVG is not. I'd ask to remove these lines from the AC_FUNC_GETLOADAVG macro: ------------------------------------------------------------------------- # Make sure getloadavg.c is where it belongs, at configure-time. test -f "$srcdir/$ac_config_libobj_dir/getloadavg.c" || AC_MSG_ERROR([$srcdir/$ac_config_libobj_dir/getloadavg.c is missing]) ------------------------------------------------------------------------- and to change AC_FUNC_GETLOADAVG so that it doesn't need to #include this file at configure time. Rationale: It's not autoconf's business to impose file name restrictions on a project, nor to check file names at configure time. "configure" is there to test a platform's and compiler's feature. Checking a project's files integrity is the job of automake. > may cause trouble for people who put the libobj directory elsewhere. > If any of you know of such a package, please let me know. There are many such packages: - gettext: both libgrep and lib (not just one directory). - libiconv: srclib. - libtasn1: gl - m4: gnu - gpg: gl - libksba: gl - prelude: libmissing ... I can hack gnulib-tool to override AC_LIBOBJ and AC_REPLACE_FUNCS so that it works with two different directories with .c files, but no workaround is possible against hardcoded file checks in autoconf macros. Bruno