Opened 12 years ago

Closed 12 years ago

Last modified 13 months ago

#8744 closed patch

Make: reconfigure on configure change (saving environment)

Reported by: jvprat Owned by: fingolfin
Priority: normal Component: --Other--
Keywords: Cc:
Game:

Description

This is an updated and (hopefully) complete version of patch #1550165 saving all the environment variables documented on the configure help. I'll revive a question from the original tracker item: should make fail if config.mk is missing? (just reconfiguring if it was properly configured before)

Ticket imported from: #1826459. Ticket imported from: patches/849.

Attachments (3)

reconfigure.patch (1.7 KB ) - added by jvprat 12 years ago.
reconfigure2.patch (1.8 KB ) - added by jvprat 12 years ago.
reconfigure3.patch (1.8 KB ) - added by jvprat 12 years ago.

Download all attachments as: .zip

Change History (12)

by jvprat, 12 years ago

Attachment: reconfigure.patch added

by jvprat, 12 years ago

Attachment: reconfigure2.patch added

comment:1 by jvprat, 12 years ago

I'm attaching an updated version of the patch that fails when config.mk is missing and it just reconfigures when it was previously configured. File Added: reconfigure2.patch

comment:2 by fingolfin, 12 years ago

I prefer the 2nd patch, i.e. that "make" fails with an error if config.mk is missing.

One small caveat, though: This patch will produce incorrect results if the user has never run the "new" configure. In particular, in that case SAVE_CONFIGFLAGS won't be set. So, instead of checking for BACKENDS in Makefile, I'd check for SAVE_CONFIGFLAGS. That seems to be more logical anyway. Or is there a specific reasons you check for BACKENDS?

comment:3 by jvprat, 12 years ago

My first approach was to check for SAVE_CONFIGFLAGS, but ifndef interprets it's undefined if it's empty, so if you called configure with no parameters it acted like you had no config.mk. I chose BACKEND because it always has a value, you can't assure any of the environment variables will be always set. Should we add a new always-set variable just for this? (SAVED_ENV=1?)

comment:4 by fingolfin, 12 years ago

Owner: set to sev-

comment:5 by fingolfin, 12 years ago

Hmmm, I see. So, maybe we should do it that way, i.e. added a SAVED_ENV:=1 or so. Or maybe call it CONFIG_MAK_IS_PRESENT :-)

Also, shouldn't we rename SAVE_CONFIGFLAGS to SAVED_CONFIGFLAGS?

Finally: Eugene, anything else to remark before we commit this? :)

by jvprat, 12 years ago

Attachment: reconfigure3.patch added

comment:6 by jvprat, 12 years ago

I'm attaching an updated patch with the changes you proposed. File Added: reconfigure3.patch

comment:7 by fingolfin, 12 years ago

Great, added to SVN with one minor tweak (CONFIG_MAK -> CONFIG_MK).

comment:8 by fingolfin, 12 years ago

Owner: changed from sev- to fingolfin
Status: newclosed

comment:9 by digitall, 13 months ago

Component: --Other--
Note: See TracTickets for help on using tickets.