Opened 12 years ago

Closed 12 years ago

Last modified 7 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)

Changed 12 years ago by jvprat

Attachment: reconfigure.patch added

Changed 12 years ago by jvprat

Attachment: reconfigure2.patch added

comment:1 Changed 12 years ago by jvprat

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 Changed 12 years ago by fingolfin

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 Changed 12 years ago by jvprat

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 Changed 12 years ago by fingolfin

Owner: set to sev-

comment:5 Changed 12 years ago by fingolfin

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? :)

Changed 12 years ago by jvprat

Attachment: reconfigure3.patch added

comment:6 Changed 12 years ago by jvprat

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

comment:7 Changed 12 years ago by fingolfin

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

comment:8 Changed 12 years ago by fingolfin

Owner: changed from sev- to fingolfin
Status: newclosed

comment:9 Changed 7 months ago by digitall

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