Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for Debian bug #795061 by Tianming Xie
Original bug description follows:

When building amule from source code, it may happen that building the
first time (that is, no file to generate has been generated yet) fails, for
unable to find a way to generate Scanner.h, but a second time make just after
the first one will succeed.

This is because Scanner.h is generated by the same rule to generate
Scanner.cpp, and there is no explicit rule to generate Scanner.h. In fact, the
command used by the rule to generate Scanner.cpp (as the attached patch file
shows) actually generates two file: one is the target Scanner.cpp, the other is
Scanner.h. So if a command whose rule depending on Scanner.h is unfortunately
called before Scanner.cpp is generated, it will fail, and break the whole
making procedure.

The problem can be fixed by add a rule to make Scanner.h depend on
Scanner.cpp, without any command, as the attached patch file shows. If an
absent Scanner.h is required by rule, according to the Rule of Make(1), the
command to generate Scanner.cpp will be called to generate Scanner.cpp and
Scanner.h simultaneously, and if so, when Scanner.cpp is needed, it is not
generated again, for now it already exists.
  • Loading branch information
gonosztopi committed Jan 25, 2016
1 parent 0d13055 commit ba8470d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docs/Changelog
Expand Up @@ -2,8 +2,8 @@ Version 2.4.0 - The river knows.
----------
201?-??-??

tgragnato:
* Fixed ASIO compilation with libcxx
circulosmeos:
* amuleweb cookies read behind a "lowercase" proxy (http/2 compliant)

Dan64:
* Read AICH root hashes from binary eMuleCollection files
Expand Down Expand Up @@ -52,8 +52,11 @@ Version 2.4.0 - The river knows.
* Projects for Visual Studio 2013 (which is now the preferred Win32 compiler)
* Fixed build with wx 3.0 (including STL build)

circulosmeos:
* amuleweb cookies read behind a "lowercase" proxy (http/2 compliant)
tgragnato:
* Fixed ASIO compilation with libcxx

Tianming Xie:
* Fix for debian bug #795061: There is nor rule to generate Scanner.h

--------------------------------------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions src/Makefile.am
Expand Up @@ -476,6 +476,7 @@ $(srcdir)/Scanner.cpp: Scanner.l Parser.cpp
$(LEX) -o $@ $(srcdir)/Scanner.l; \
echo "// Empty file generated by a flex version unable to create headers" > $(srcdir)/Scanner.h
endif
$(srcdir)/Scanner.h: $(srcdir)/Scanner.cpp

$(srcdir)/IPFilterScanner.cpp: IPFilterScanner.l
$(LEX) -Pyyip -o $@ $(srcdir)/IPFilterScanner.l;
Expand Down

0 comments on commit ba8470d

Please sign in to comment.