[patch] sometimes 'make config' doesn't work well

526 views
Skip to first unread message

Ken Takata

unread,
Jun 18, 2013, 10:59:10 AM6/18/13
to vim...@googlegroups.com
Hi,

Sometimes 'make config' or 'make reconfig' don't work well.

Please consider the following situation:

1. Do 'hg clone' to get the latest source codes.
2. Do 'make config && make'.
3. A few days later, do 'hg pull -u' to get the updated codes
which include updated src/auto/configure. (To simulate this, just do
'touch src/auto/configure'.)
4. Do 'make config' again. Then the following error will be shown:

configure: loading cache auto/config.cache
configure: error: `CFLAGS' has changed since the previous run:
configure: former value: `-g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1'
configure: current value: `-g -O2 -U_FORTIFY_SOURCE -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1'
configure: error: `LDFLAGS' has changed since the previous run:
configure: former value: `-L. -L/usr/local/lib -Wl,--as-needed'
configure: current value: `-L. -L. -L/usr/local/lib -Wl,--as-needed -Wl,--as-needed'
configure: error: in `/cygdrive/c/work/vim/src':
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm auto/config.cache' and start over
Makefile:1657: recipe for target `config' failed
make: *** [config] Error 1

When I run 'make distclean' as the message says, I get the same error again.
This is caused by dependency of 'auto/config.mk'. The 'Makefile' includes
'auto/config.mk' which depends on 'auto/configure'. So if 'auto/configure'
is updated, the 'make' command tries to update 'auto/config.mk' before doing
'make distclean' itself.

If I run 'rm auto/config.cache', 'make config' succeeds at that time.
But if src/auto/configure is updated again, the same error will be shown again.
Additionally, 'CFLAGS' and 'LDFLAGS' become longer and longer when I run
'rm auto/config.cache && make config' again and again.

I made a patch to fix this strange behavior.
'rm auto/config.cache' will be done automatically if needed.
'CFLAGS' and 'LDFLAGS' are also fixed properly.

Best regards,
Ken Takata

fix-make-config.patch

Bram Moolenaar

unread,
Jun 18, 2013, 5:32:40 PM6/18/13
to Ken Takata, vim...@googlegroups.com
Thanks for looking into this! It was indeed very annoying that
auto/config.cache had to be deleted manually. I would blame autoconf,
but apparently they have not solved this problem.

I'm not 100% sure the solution works in all situations, but let's
include it and further improve it where needed.


--
hundred-and-one symptoms of being an internet addict:
250. You've given up the search for the "perfect woman" and instead,
sit in front of the PC until you're just too tired to care.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

John Little

unread,
Jun 19, 2013, 8:28:19 AM6/19/13
to vim...@googlegroups.com
On Wednesday, June 19, 2013 2:59:10 AM UTC+12, Ken Takata wrote:

> Sometimes 'make config' or 'make reconfig' don't work well.

I would get this annoyance about CC, configure complaining that it had been changed to 'gcc'. Thank you!

Reply all
Reply to author
Forward
0 new messages