mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
build: handle @ALLOCA@-vs-non-recursive make problems
Here is a good reason to avoid alloca with non-recursive make. These:
$ grep @ALLOCA lib/gnulib.mk
lib_libcoreutils_a_LIBADD += lib/@ALLOCA@
lib_libcoreutils_a_DEPENDENCIES += lib/@ALLOCA@
would lead to this, when @ALLOCA@ expands to the empty string,
which is essentially "always", now:
$ grep ' lib/$' Makefile
lib_libcoreutils_a_LIBADD = $(gl_LIBOBJS) lib/
lib_libcoreutils_a_DEPENDENCIES = $(gl_LIBOBJS) lib/
Tell the prefix-adding script not to add a prefix when the word it's
prefixing is "@ALLOCA@". That is fine for most cases, but what about
when the expansion of @ALLOCA@ is nonempty?
* build-aux/prefix-gnulib-mk (prefix_word): Exclude @ALLOCA@.
* gl/m4/non-recursive-gnulib-prefix-hack.m4: Prefix non-empty
$ALLOCA with "lib/". FIXME: I'm not sure this is required,
now that we...
Use AC_CONFIG_LIBOBJ_DIR([lib]).
Without using AC_CONFIG_LIBOBJ_DIR([lib]), automake (not autoconf)
would complain of failure to find aclocal.c, due to the use of
AC_LIBSOURCES(alloca.c).
This commit is contained in:
1 parent
640fb7a108
commit
ada994274c
2 files changed
+8
-1
No files matched your search
@@ -66,7 +66,8 @@ sub prefix_word ($)
|
||||
{
|
||||
local ($_) = @_;
|
||||
$_ = $prefix . $_
|
||||
unless /^-/ || m{^\$\(\w+\)} || $_ eq "Makefile" || $_ eq '\\';
|
||||
unless (/^-/ || m{^\$\(\w+\)} || $_ eq "Makefile" || $_ eq '\\'
|
||||
|| $_ eq '@ALLOCA@');
|
||||
return $_;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@ dnl with a value ending in ".h" to reflect that these files are located
|
||||
dnl in the directory specified by LIB_DIR.
|
||||
AC_DEFUN([gl_NON_RECURSIVE_GNULIB_PREFIX_HACK],
|
||||
[
|
||||
# Tell AC_LIBSOURCES where to find source files like alloca.c.
|
||||
AC_CONFIG_LIBOBJ_DIR([lib])
|
||||
|
||||
# This hack originated in bison. It is required when using non-recursive
|
||||
# automake rules to build from gnulib-provided lib/ sources. Hence, LIB_DIR
|
||||
# is usually simply "lib". Those rules use the list of names like "fchdir.o"
|
||||
@@ -26,4 +29,7 @@ AC_DEFUN([gl_NON_RECURSIVE_GNULIB_PREFIX_HACK],
|
||||
(*_H:*.h) eval "$ac_var=$1/\$$ac_var";;
|
||||
esac
|
||||
done
|
||||
|
||||
# If $ALLOCA is not empty, prefix its value with "lib/".
|
||||
test -n "$ALLOCA" && ALLOCA="lib/$ALLOCA"
|
||||
])
|
||||
Reference in new issue
Block a user