3 # this script patches a config.status file, to use our own perl script
5 # we do it this way to circumvent hacking (and thereby including)
6 # autoconf function (which are GPL) into our LGPL acinclude.m4.in
7 # written by Michael Matz <matz@ifh.de>
9 # we have to change two places
10 # 1. the splitting of the substitutions into chunks of 90 (or even 48 in
12 # 2. the big main loop which patches all Makefile.in's
15 my $ac_aux_dir = dirname
($0);
22 # usage of $flag: 0 -- we have seen nothing yet
24 # 2 -- we have ended (1)
30 } elsif ($flag == 0) {
31 # 1. begins with (including): "ac_max_sed_\S+\s*=\s*[0-9]+..."
32 # ends with (excluding) "CONFIG_FILE=..."
33 # in later autoconf (2.14.1) there is no CONFIG_FILES= line,
34 # but instead the (2) directly follow (1)
35 if (/^\s*ac_max_sed_([a-z]+).*=\s*[0-9]+/ ) {
39 } elsif ($1 eq 'cmds') {
42 # hmm, we don't know the autoconf version, but we try anyway
46 } elsif ($flag == 1) {
47 if (/^\s*CONFIG_FILES=/ ) {
50 } elsif (/^\s*for\s+ac_file\s+in\s+.*CONFIG_FILES/ ) {
52 if ($ac_version != 2141) {
56 } elsif ($flag == 2) {
57 # 2. begins with: "for ac_file in.*CONFIG_FILES" (the next 'for' after (1))
58 # end with: "rm -f conftest.s\*"
59 if (/^\s*for\s+ac_file\s+in\s+.*CONFIG_FILES/ ) {
64 } elsif ($flag == 3) {
65 if (/^\s*rm\s+-f\s+conftest/ ) {
68 } elsif (/^\s*rm\s+-f\s+.*ac_cs_root/ ) {
72 if ($ac_version != 2141) {
73 print STDERR
"hmm, don't know autoconf version\n";
81 die "wrong input (flag != 4)" unless $flag == 4;
82 print STDERR
"hmm, don't know autoconf version\n" unless $ac_version;
84 sub insert_main_loop
{
86 #echo Doing the fast build of Makefiles -- autoconf $ac_version
87 if test "x\$ac_cs_root" = "x" ; then
93 # VPATH subst was seen in original config.status main loop
94 echo '/^[ ]*VPATH[ ]*=[^:]*\$/d' >> \$ac_cs_root.subs
98 rm -f \$ac_cs_root.sacfiles
99 for ac_file in .. \$CONFIG_FILES ; do
100 if test "x\$ac_file" != x..; then
101 echo \$ac_file >> \$ac_cs_root.sacfiles
104 if test -f \$ac_cs_root.sacfiles ; then
105 perl $ac_aux_dir/config.pl "\$ac_cs_root" "\$ac_given_srcdir" "\$ac_given_INSTALL"
107 rm -f \$ac_cs_root.s*