Description of problem: In the documentation there is: By default runstatedir is a subdirectory of ${localstatedir}, but it doesn't behave in such way. The expectation was that after setting --localstatedir=/dirA will it change also @runstatedir@ to /dirA/run. But @runstatedir@ changes always to /run. Version-Release number of selected component (if applicable): autoconf-2.69-35 How reproducible: Reproducer with description available here[2] Steps to Reproduce: 1. run autoreconf --verbose --install --force 2. mkdir /tmp/run/ 3. touch /tmp/run/file1 4. ./configure --localstatedir=/tmp 5. ./test.sh Actual results: list /run Expected results: list /tmp/run Additional info: [1] https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.70/autoconf.txt [2] https://fjanus.fedorapeople.org/autoconf/
Upstream issue: https://lists.gnu.org/archive/html/bug-autoconf/2021-03/msg00001.html
From my perspective and according to documentation, I would prefer adding the below patch to autoconf diff --git a/config.site b/config.site index 5bea225..87750f7 100644 --- a/config.site +++ b/config.site @@ -18,6 +18,7 @@ then test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc test "$sharedstatedir" = '${prefix}/com' && sharedstatedir=/var test "$localstatedir" = '${prefix}/var' && localstatedir=/var + test "$runstatedir" = '${localstatedir}/run' && runstatedir=/run ARCH=`uname -m` for i in x86_64 ppc64 s390x aarch64; do It does not solve our problem, but in my opinion, it should be there.
Proposed fix for this issue: https://src.fedoraproject.org/rpms/autoconf/pull-request/7 We should wait, what upstream says about this.
I looked a bit at this issue, and I'm afraid I believe the current version works as expected. More specifically, autoconf doesn't expand these kind of variable on purpose, as stated in the following snippet: # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) More specifically, the following phrase: # These are left unexpanded so users can "make install exec_prefix=/foo" must be interpreted: # These are left unexpanded so users can "make install exec_prefix=/foo", assuming their makefile support these variables This applies to a few variables, which includes runstatedir and localstatedir. Therefore, the user should be careful while using them. In the provided example, the shell script ends up with the following value: ls "${localstatedir}/run" Since "${localstatedir}" isn't set in the context of the shell script, that ends up being interpreted as: ls "/run" Autoconf is generally combined with automake, which will collect the (unexpanded) values of all these variables. Expansion will therefore be done while interpreting the makefile, which will result in the correct behavior. A typical Makefile.in file, will include the following lines: localstatedir = @localstatedir@ ... runstatedir = @runstatedir@ Anything provided in configure commandline will therefore be properly interpreted later on.