flex icon indicating copy to clipboard operation
flex copied to clipboard

Fix "make distcheck" failure and use Automake 1.16.1

Open Explorer09 opened this issue 6 years ago • 6 comments

Not sure if flex needs this, but I can update ".travis/install-automake.sh" to use Automake 1.16.1. (Automake 1.16 would fail to build in this Travis server (which runs Ubuntu 14.04) due to the compatibility bug.)

Explorer09 avatar Mar 12 '18 16:03 Explorer09

The idea seems reasonable, yes.

westes avatar Mar 12 '18 16:03 westes

It looks like Automake 1.16.1 reveals a "make distcleancheck" bug for us. (See the build log.) The error is:

ERROR: files left in build directory after distclean:
./tests/.deps/reject_nr.reject.Po

The file is used for dependency tracking, and was generated by the compiler when --enable-dependency-tracking in configure was enabled. Normally, Automake will track, include, and clean up .Po files for every .c file mentioned in the *_SOURCES variables. And unfortunately this one got missed by Automake due to a technicality in the reject_nr test. I know how to fix this one, but there're two ways that can be done and I need help to pick which approach.

  1. Have Automake aware of the generated reject_nr.reject.Po file (and the corresponding reject_nr.reject.c), by defining a variable:
nodist_reject_nr_reject_SOURCES = reject_nr.reject.c

This allows reject_nr.reject.o to continue to be generated using the Automake-default .c.o rule without making an exception recipe (commands), as the approach 2...

  1. Override the generating rule of reject_nr.reject.$(OBJEXT) just like how reject_r test has done:
reject_r.reject.$(OBJEXT): reject_r.reject.c
	$(AM_V_CC)$(COMPILE) -DTEST_IS_REENTRANT -c -o $@ $<

The override disabled the generation of reject_r.reject.Po, and that was why reject_r did not suffer from the distcleancheck error mentioned above, and why Automake did not need to care about the reject_r.reject.c file at least directly.

Now, which approach?

Explorer09 avatar Mar 12 '18 17:03 Explorer09

On Monday, 12 March 2018, 5:48 pm +0000, "Kang-Che Sung (宋岡哲)" [email protected] wrote:

It looks like Automake 1.16.1 reveals a "make distcleancheck" bug for us. (See the build log.) The error is:

ERROR: files left in build directory after distclean:
./tests/.deps/reject_nr.reject.Po

The file is used for dependency tracking, and was generated by the compiler when --enable-dependency-tracking in configure was enabled. Normally, Automake will track, include, and clean up .Po files for every .c file mentioned in the *_SOURCES variables. And unfortunately this one got missed by Automake due to a technicality in the reject_nr test. I know how to fix this one, but there're two ways that can be done and I need help to pick which approach.

  1. Have Automake aware of the generated reject_nr.reject.Po file (and the corresponding reject_nr.reject.c), by defining a variable:
nodist_reject_nr_reject_SOURCES = reject_nr.reject.c

This allows reject_nr.reject.o to continue to be generated using the Automake-default .c.o rule without making an exception recipe (commands), as the approach 2...

  1. Override the generating rule of reject_nr.reject.$(OBJEXT) just like how reject_r test has done:
reject_r.reject.$(OBJEXT): reject_r.reject.c
	$(AM_V_CC)$(COMPILE) -DTEST_IS_REENTRANT -c -o $@ $<

The override disabled the generation of reject_r.reject.Po, and that was why reject_r did not suffer from the distcleancheck error mentioned above, and why Automake did not need to care about the reject_r.reject.c file at least directly.

Now, which approach?

I think we want the second approach.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/westes/flex/pull/325#issuecomment-372402291

-- Will Estes [email protected]

westes avatar Mar 12 '18 18:03 westes

Since this pr is generating build failures, I'm moving it to 2.6.6 to allow more time to sort out the issues you list.

westes avatar Mar 14 '18 11:03 westes

Pushed the testsuite fix here, but I'm lazy to file another pull request just for that small fix. I expect you cherry-pick it if you are convenient to do that.

Explorer09 avatar Mar 14 '18 14:03 Explorer09

Currently, the Travis build still uses Automake 1.15.x. Could you please rebase your branch, and force-push?

paulmenzel avatar Aug 20 '21 09:08 paulmenzel

Closing due to age. Makefile.am in a few places will get some love, especially tests/ so this will get picked up but in other ways.

westes avatar Mar 29 '24 14:03 westes