-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Autotools: Quote PHP_SUBST arguments in extensions #14748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@petk, thanks so much for your work. Sorry to be a dummy, but can you briefly bring me up to speed on the background of this change? I have hacked on autoconf scripts here and there but don't understand them as well as I should. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems sensible to me
Hm, good question. :D Quoting characters in Autoconf take care among other things whether to pass the content in them further or do an early expansion (if in the content there is macro name used it gets expanded earlier). And when there are special characters used (commas etc). In this specific case, there won't be much difference. It's a more like a consistency change at the moment but done more for future - a code style sync with other calls where quotes are used. To give you some sort of documentation like example. Hm. I'd really have to think about this how to explain simply. This becomes more apparent when macro calls are wrapped inside other macros or in their arguments. These later Autoconf versions from 2.70 on, they also have this slightly differently solved. But mostly the issue comes when dealing with $1 and how to pass that further or to assign it to a variable. |
Sync with php/php-src#14748
So, one very simple but still a bit stupid example of quoting and expansion in effect since Autoconf 2.70 and later versions (I think): dnl In PHP's configure.ac file, for example.
dnl Define a macro named PHP_FOO, that expands to a some string PHP_BAR.
AC_DEFUN([PHP_FOO], [PHP_BAR])
dnl Define a macro that emits an error with content of the first argument.
AC_DEFUN([PHP_FOO_SUBST], [AC_MSG_NOTICE([m4_normalize([$1])])])
dnl First one is not quoted, second one is:
PHP_FOO_SUBST(PHP_FOO)
PHP_FOO_SUBST([PHP_FOO]) This will output something this:
However, this all depends on how the PHP_FOO_SUBST is implemented. This is perhaps more noticeable in Autoconf's macros where all sorts of parsing, normalization, expansion etc happens on arguments. |
No description provided.