GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — bpo-45723: Add helpers for save/restore env (GH-29637) by erlend-aasland · Pull Request #29637 · python/cpython Conversation
|
|
@tiran: there might be a smoother way to do this, but this should do the trick. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PoC: Apply to SQLite check.
8316e5f to
6579627
Compare
|
Another option is to patch the built-in macros, but I prefer this explicit approach. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Possible improvement: minimise future Proposed patchdiff --git a/configure.ac b/configure.ac index 02463ae717..90507e206b 100644 --- a/configure.ac +++ b/configure.ac @@ -32,21 +32,21 @@ dnl - WITH_SAVE_ENV([SCRIPT]) Runs SCRIPT wrapped with SAVE_ENV/RESTORE_ENV AC_DEFUN([_SAVE_VAR], [AS_VAR_COPY([save_][$1], [$1])])dnl AC_DEFUN([_RESTORE_VAR], [AS_VAR_COPY([$1], [save_][$1])])dnl AC_DEFUN([SAVE_ENV], - [_SAVE_VAR([CFLAGS])] - [_SAVE_VAR([CPPFLAGS])] - [_SAVE_VAR([LDFLAGS])] - [_SAVE_VAR([LIBS])] +[_SAVE_VAR([CFLAGS])] +[_SAVE_VAR([CPPFLAGS])] +[_SAVE_VAR([LDFLAGS])] +[_SAVE_VAR([LIBS])] )dnl AC_DEFUN([RESTORE_ENV], - [_RESTORE_VAR([CFLAGS])] - [_RESTORE_VAR([CPPFLAGS])] - [_RESTORE_VAR([LDFLAGS])] - [_RESTORE_VAR([LIBS])] +[_RESTORE_VAR([CFLAGS])] +[_RESTORE_VAR([CPPFLAGS])] +[_RESTORE_VAR([LDFLAGS])] +[_RESTORE_VAR([LIBS])] )dnl AC_DEFUN([WITH_SAVE_ENV], - [SAVE_ENV] - [$1] - [RESTORE_ENV] +[SAVE_ENV] +m4_strip([$1]) +[RESTORE_ENV] )dnl AC_SUBST(BASECPPFLAGS) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| [_SAVE_VAR([CFLAGS])] | ||
| [_SAVE_VAR([CPPFLAGS])] | ||
| [_SAVE_VAR([LDFLAGS])] | ||
| [_SAVE_VAR([LIBS])] |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It looks like the indention adds some extra space to the output:
save_CFLAGS=$CFLAGS
save_CPPFLAGS=$CPPFLAGS
save_LDFLAGS=$LDFLAGS
save_LIBS=$LIBS
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yeah. We can tweak the new macros to further minimise configure diffs. I think that could be worth it, as it would be easier to review future PRs.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Does it look better with dcc2ba9 applied?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.