The autoconf launcher script in the autoconf bundle created by 
`make/devkit/createAutoconf.sh` currently writes a config file into the bundle 
installation dir every time it runs. This prevents it from functioning when 
installed on a read-only filesystem. We can work around the need for writing to 
this config file by instead adding a parameter to the command line sent to the 
actual autoconf executable.

This is what the script adds to the config file (with the $this_script_dir 
variable expanded):

begin-language: "M4sugar"
args: --prepend-include $this_script_dir/usr/share/autoconf
end-language: "M4sugar"

Looking at the original config file, it has several lines similar to this where 
the --prepend-include arg points to $PREFIX/usr/share/autoconf (where $PREFIX 
was specified at autoconf build time). Removing this addition from the config 
file causes autoconf to fail as it can't find m4sugar.m4 (which is located in 
$this_script_dir/usr/share/autoconf).

My proposed workaround, is to just add `--prepend-include 
$this_script_dir/usr/share/autoconf` as a command line option to the real 
autoconf script, which we call from the wrapper script. This would have the 
benefit of also fixing the other instances of this that are present in the 
config file, but that we aren't using in our configure script.

In addition to this, I made the script conform better to the current standard 
for these bundle creation scripts. The output should end up in a sub directory 
of `build`. No temp dirs should be used instead of the build dir. I also added 
some automation for setting the target platform tuple based on `uname` for the 
most common platforms, and added the ability to override for any others, 
without having to edit the file.

-------------

Commit messages:
 - JDK-8340075

Changes: https://git.openjdk.org/jdk/pull/20978/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20978&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8340075
  Stats: 55 lines in 1 file changed: 21 ins; 9 del; 25 mod
  Patch: https://git.openjdk.org/jdk/pull/20978.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20978/head:pull/20978

PR: https://git.openjdk.org/jdk/pull/20978

Reply via email to