Skip to content

Commit 5b1f67d

Browse files
committed
Make AWK script write config.status.
1 parent ab05233 commit 5b1f67d

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

Tools/configure/transpiler/pyconf.awk

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,6 +1697,7 @@ function pyconf_output( i) {
16971697
_pyconf_resolve_exports()
16981698
_pyconf_write_pyconfig_h()
16991699
_pyconf_process_config_files()
1700+
_pyconf_write_config_status()
17001701
pyconf_cleanup()
17011702
}
17021703

@@ -1837,6 +1838,36 @@ function _pyconf_process_config_files( i, inf, outf, outdir, saved_abs_srcdir
18371838
}
18381839
}
18391840

1841+
function _pyconf_write_config_status( outf, config_args, sd) {
1842+
outf = "config.status"
1843+
config_args = SUBST["CONFIG_ARGS"]
1844+
if (config_args == "")
1845+
config_args = _pyconf_config_args
1846+
sd = SUBST["srcdir"]
1847+
if (sd == "")
1848+
sd = "."
1849+
printf "#!/bin/sh\n" > outf
1850+
printf "# Generated by configure. Do not edit.\n" >> outf
1851+
printf "#\n" >> outf
1852+
printf "# This script re-runs configure to regenerate output files.\n" >> outf
1853+
printf "\n" >> outf
1854+
printf "CONFIG_ARGS=\"%s\"\n", config_args >> outf
1855+
printf "\n" >> outf
1856+
printf "for arg in \"$@\"; do\n" >> outf
1857+
printf " case \"$arg\" in\n" >> outf
1858+
printf " --recheck)\n" >> outf
1859+
printf " echo \"running configure with args: $CONFIG_ARGS\"\n" >> outf
1860+
printf " exec %s/configure $CONFIG_ARGS\n", sd >> outf
1861+
printf " ;;\n" >> outf
1862+
printf " esac\n" >> outf
1863+
printf "done\n" >> outf
1864+
printf "\n" >> outf
1865+
printf "# Regenerate all output files by re-running configure.\n" >> outf
1866+
printf "exec %s/configure $CONFIG_ARGS\n", sd >> outf
1867+
close(outf)
1868+
system("chmod +x " _shell_quote(outf))
1869+
}
1870+
18401871
function _last_index(s, ch, i, last) {
18411872
last = 0
18421873
for (i = 1; i <= length(s); i++)

configure-new

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,6 +1708,7 @@ function pyconf_output( i) {
17081708
_pyconf_resolve_exports()
17091709
_pyconf_write_pyconfig_h()
17101710
_pyconf_process_config_files()
1711+
_pyconf_write_config_status()
17111712
pyconf_cleanup()
17121713
}
17131714

@@ -1848,6 +1849,36 @@ function _pyconf_process_config_files( i, inf, outf, outdir, saved_abs_srcdir
18481849
}
18491850
}
18501851

1852+
function _pyconf_write_config_status( outf, config_args, sd) {
1853+
outf = "config.status"
1854+
config_args = SUBST["CONFIG_ARGS"]
1855+
if (config_args == "")
1856+
config_args = _pyconf_config_args
1857+
sd = SUBST["srcdir"]
1858+
if (sd == "")
1859+
sd = "."
1860+
printf "#!/bin/sh\n" > outf
1861+
printf "# Generated by configure. Do not edit.\n" >> outf
1862+
printf "#\n" >> outf
1863+
printf "# This script re-runs configure to regenerate output files.\n" >> outf
1864+
printf "\n" >> outf
1865+
printf "CONFIG_ARGS=\"%s\"\n", config_args >> outf
1866+
printf "\n" >> outf
1867+
printf "for arg in \"$@\"; do\n" >> outf
1868+
printf " case \"$arg\" in\n" >> outf
1869+
printf " --recheck)\n" >> outf
1870+
printf " echo \"running configure with args: $CONFIG_ARGS\"\n" >> outf
1871+
printf " exec %s/configure $CONFIG_ARGS\n", sd >> outf
1872+
printf " ;;\n" >> outf
1873+
printf " esac\n" >> outf
1874+
printf "done\n" >> outf
1875+
printf "\n" >> outf
1876+
printf "# Regenerate all output files by re-running configure.\n" >> outf
1877+
printf "exec %s/configure $CONFIG_ARGS\n", sd >> outf
1878+
close(outf)
1879+
system("chmod +x " _shell_quote(outf))
1880+
}
1881+
18511882
function _last_index(s, ch, i, last) {
18521883
last = 0
18531884
for (i = 1; i <= length(s); i++)

0 commit comments

Comments
 (0)