* bug#20894: make libgnu.a doesn't generate everything it requires
@ 2015-06-25 0:12 Glenn Morris
2015-06-25 0:15 ` Glenn Morris
2015-06-25 6:39 ` Paul Eggert
0 siblings, 2 replies; 6+ messages in thread
From: Glenn Morris @ 2015-06-25 0:12 UTC (permalink / raw)
To: 20894
Package: emacs
Version: 25.0.50
Current master on x86_64 RHEL7:
make maintainer-clean
configure
cd lib
make libgnu.a
Fails with:
In file included from binary-io.c:3:0:
binary-io.h: In function 'set_binary_mode':
binary-io.h:57:10: error: 'O_BINARY' undeclared (first use in this function)
'make libgnu.a' doesn't generate the lib/ version of fcntl.h, which is
what defines O_BINARY.
In contrast, 'make all' (in lib) does.
I noticed this because src/temacs depends on libgnu.a and calls 'make
libgnu.a' to create it (I would like 'make -C src emacs' to work).
Perhaps it should call 'make -C lib all' instead (an Emacs issue);
or perhaps 'make libgnu.a' should generate the files it requires
(a gnulib issue?).
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#20894: make libgnu.a doesn't generate everything it requires
2015-06-25 0:12 bug#20894: make libgnu.a doesn't generate everything it requires Glenn Morris
@ 2015-06-25 0:15 ` Glenn Morris
2015-06-25 6:39 ` Paul Eggert
1 sibling, 0 replies; 6+ messages in thread
From: Glenn Morris @ 2015-06-25 0:15 UTC (permalink / raw)
To: 20894
Glenn Morris wrote:
> Perhaps it should call 'make -C lib all' instead (an Emacs issue);
Same thing for lib-src/Makefile.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#20894: make libgnu.a doesn't generate everything it requires
2015-06-25 0:12 bug#20894: make libgnu.a doesn't generate everything it requires Glenn Morris
2015-06-25 0:15 ` Glenn Morris
@ 2015-06-25 6:39 ` Paul Eggert
2015-06-25 16:02 ` Glenn Morris
1 sibling, 1 reply; 6+ messages in thread
From: Paul Eggert @ 2015-06-25 6:39 UTC (permalink / raw)
To: Glenn Morris; +Cc: 20894
> 'make libgnu.a' doesn't generate the lib/ version of fcntl.h, which is
> what defines O_BINARY.
>
> In contrast, 'make all' (in lib) does.
That's a known problem with Automake, when dependency checking is turned on.
The short version is that it can't compute dependencies until it has the .h
files, and it can't make the .h files until it knows the dependencies. The
usual workaround is BUILT_SOURCES, but as the Automake manual says in
<http://www.gnu.org/software/automake/manual/html_node/Sources.html>:
=====
It might be important to emphasize that BUILT_SOURCES is honored only by ‘make
all’, ‘make check’ and ‘make install’. This means you cannot build a specific
target (e.g., ‘make foo’) in a clean tree if it depends on a built source.
However it will succeed if you have run ‘make all’ earlier, because accurate
dependencies are already available.
=====
Ways to work around this issue are described in
<http://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html>.
They are all a bit of a pain, though, and the simplest thing is probably to
say “don't try to make libgnu.a by hand without doing an ordinary make first”....
> (I would like 'make -C src emacs' to work).
*That* we can arrange.
> Perhaps it should call 'make -C lib all' instead (an Emacs issue);
Yes, that's an easy way to arrange things. I installed that as part of commit
319eeeb0fb154a0cd1d36ec33c68029ff9d6c290. Good enough?
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#20894: make libgnu.a doesn't generate everything it requires
2015-06-25 6:39 ` Paul Eggert
@ 2015-06-25 16:02 ` Glenn Morris
2015-06-25 20:33 ` Paul Eggert
0 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2015-06-25 16:02 UTC (permalink / raw)
To: Paul Eggert; +Cc: 20894
Paul Eggert wrote:
>> (I would like 'make -C src emacs' to work).
>
> *That* we can arrange.
>
>> Perhaps it should call 'make -C lib all' instead (an Emacs issue);
>
> Yes, that's an easy way to arrange things. I installed that as part
> of commit 319eeeb0fb154a0cd1d36ec33c68029ff9d6c290. Good enough?
'make -C src emacs' now works, but 'make -j8 -C src emacs' fails in lib with
GEN stddef.h
mv: cannot stat 'alloca.h-t': No such file or directory
make[2]: *** [alloca.h] Error 1
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#20894: make libgnu.a doesn't generate everything it requires
2015-06-25 16:02 ` Glenn Morris
@ 2015-06-25 20:33 ` Paul Eggert
2015-06-25 23:06 ` Glenn Morris
0 siblings, 1 reply; 6+ messages in thread
From: Paul Eggert @ 2015-06-25 20:33 UTC (permalink / raw)
To: Glenn Morris; +Cc: 20894
[-- Attachment #1: Type: text/plain, Size: 321 bytes --]
Glenn Morris wrote:
> 'make -C src emacs' now works, but 'make -j8 -C src emacs' fails in lib with
>
> GEN stddef.h
> mv: cannot stat 'alloca.h-t': No such file or directory
Hmm, well, I'm sure there are other dependency bugs like that in the makefiles
somewhere. Anyway I fixed this bug with the attached.
[-- Attachment #2: 0001-Fix-submake-dependency-bug-with-.h-files.patch --]
[-- Type: text/x-diff, Size: 976 bytes --]
From 1dbeff026f3dd8244d648501cfcb84621dc3a655 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 25 Jun 2015 13:31:18 -0700
Subject: [PATCH] Fix submake dependency bug with .h files
* src/Makefile.in ($(libsrc)/make-docfile$(EXEEXT)):
Depend on $(lib)/libgnu.a, so that we build $(lib)/*/*.h
before the submake in $(libsrc) would spin off a subsubmake
for $(lib) in parallel with our submake for $(lib) (Bug#20894).
---
src/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile.in b/src/Makefile.in
index bfb911e..1fb770d 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -529,7 +529,7 @@ $(etc)/DOC: lisp.mk $(libsrc)/make-docfile$(EXEEXT) $(obj) $(lisp)
$(AM_V_at)$(libsrc)/make-docfile -a $(etc)/DOC -d $(lispsource) \
$(shortlisp)
-$(libsrc)/make-docfile$(EXEEXT):
+$(libsrc)/make-docfile$(EXEEXT): $(lib)/libgnu.a
$(MAKE) -C $(libsrc) make-docfile$(EXEEXT)
buildobj.h: Makefile
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* bug#20894: make libgnu.a doesn't generate everything it requires
2015-06-25 20:33 ` Paul Eggert
@ 2015-06-25 23:06 ` Glenn Morris
0 siblings, 0 replies; 6+ messages in thread
From: Glenn Morris @ 2015-06-25 23:06 UTC (permalink / raw)
To: Paul Eggert; +Cc: 20894
Thanks, it works now.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-06-25 23:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-25 0:12 bug#20894: make libgnu.a doesn't generate everything it requires Glenn Morris
2015-06-25 0:15 ` Glenn Morris
2015-06-25 6:39 ` Paul Eggert
2015-06-25 16:02 ` Glenn Morris
2015-06-25 20:33 ` Paul Eggert
2015-06-25 23:06 ` Glenn Morris
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).