~ubuntu-branches/ubuntu/karmic/rkward/karmic

« back to all changes in this revision

Viewing changes to admin/am_edit

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Friedrichsmeier
  • Date: 2006-11-06 16:30:00 UTC
  • mfrom: (1.2.1 upstream) (3.1.1 feisty)
  • Revision ID: james.westby@ubuntu.com-20061106163000-qi8ju75eqecrfay7
* new upstream release
* depend on either php4-cli or php5-cli

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
sub pruneMocCandidates ($);
52
52
sub checkMocCandidates ();
53
53
sub addMocRules ();
 
54
sub findKcfgFile($);
54
55
 
55
56
sub tag_AUTOMAKE ();
56
57
sub tag_META_INCLUDES ();
60
61
sub tag_LOCALINSTALL();
61
62
sub tag_IDLFILES();
62
63
sub tag_UIFILES();
 
64
sub tag_KCFGFILES();
63
65
sub tag_SUBDIRS();
64
66
sub tag_ICON();
65
67
sub tag_CLOSURE();
111
113
    {
112
114
        $verbose = 1;       # Oh is there a problem...?
113
115
    }
114
 
    elsif (/^-p(.+)$|^--path=(.+)$/)
 
116
    elsif (/^(?:-p|--path=)(.+)$/)
115
117
    {
116
 
        $thisProg = "$1/".basename($thisProg) if($1);
117
 
        $thisProg = "$2/".basename($thisProg) if($2);
 
118
        my $p = $1;
 
119
        $thisProg = $p . "/". basename($thisProg);
118
120
        warn ("$thisProg doesn't exist\n")      if (!(-f $thisProg));
 
121
        $thisProg .= " -p".$p;
119
122
        $pathoption=1;
120
123
    }
121
124
    elsif (/^--help$|^-h$/)
222
225
    local %globalmocs = ();# list of all mocfiles (in %mocFiles format)
223
226
    local %important = (); # list of files to be generated asap
224
227
    local %uiFiles = ();
 
228
    local %kcfgFiles = ();
225
229
 
226
230
    local $allidls = "";
227
231
    local $idl_output = "";# lists all idl generated files for cleantarget
228
232
    local $ui_output = "";# lists all uic generated files for cleantarget
 
233
    local $kcfg_output = "";# lists all kcfg generated files for cleantarget
229
234
 
230
235
    local %dependmocs = ();
231
236
    
263
268
        tag_NO_UNDEFINED();
264
269
        tag_CLOSURE();
265
270
        tag_NMCHECK();
266
 
        tag_UIFILES();             # Sorts out ui rules
 
271
        tag_UIFILES();              # Sorts out ui rules
 
272
        tag_KCFGFILES();            # Sorts out kcfg rules
267
273
        tag_METASOURCES ();         # Sorts out the moc rules
268
274
        if ($sources_changed{$program}) {
269
275
            my $lookup = $program . '_SOURCES\s*=[ \t]*(.*)';
270
276
 
271
277
            if($program =~ /libkdeinit_(.*)/) {
272
278
                my $prog = $1;
273
 
                substituteLine($prog . '_SOURCES\s*=[ \t]*.*', 
 
279
                substituteLine($prog . '_SOURCES\s*=[ \t]*(.*)', 
274
280
                    "${prog}_SOURCES = ${prog}_dummy.$cxxsuffix\n" .
275
281
                    "libkdeinit_${prog}_SOURCES = " . $sources{$program});
276
282
                $sources{$prog} = "${prog}_dummy.$cxxsuffix";
320
326
        $target_adds{"$cleantarget-am"} .= "$cleantarget-ui ";
321
327
    }
322
328
 
 
329
    if ($kcfg_output) {
 
330
        appendLines ("$cleantarget-kcfg:\n\t-rm -f $kcfg_output\n");
 
331
        $target_adds{"$cleantarget-am"} .= "$cleantarget-kcfg ";
 
332
    }
 
333
 
323
334
    if ($closure_output) {
324
335
        appendLines ("$cleantarget-closures:\n\t-rm -f $closure_output\n");
325
336
        $target_adds{"$cleantarget-am"} .= "$cleantarget-closures ";
340
351
    my $tmp = "force-reedit:\n";
341
352
    $tmp   .= "\t$automkCall\n\tcd \$(top_srcdir) && perl $thisProg $printname\n\n";
342
353
    appendLines($tmp);
343
 
    
 
354
 
344
355
    make_bcheck_target();
345
356
    make_meta_classes();
346
357
    tag_COMPILE_FIRST();
411
422
      substituteLine($lookup, "RECURSIVE_TARGETS = $1 nmcheck-recursive bcheck-recursive");
412
423
    }
413
424
 
414
 
    my $cvs_lines = "cvs-clean:\n";
415
 
    $cvs_lines .= "\t\$(MAKE) admindir=\$(top_srcdir)/admin -f \$(top_srcdir)/admin/Makefile.common cvs-clean\n";
416
 
    appendLines($cvs_lines);
417
 
 
418
425
    $cvs_lines  = "kde-rpo-clean:\n";
419
426
    $cvs_lines .= "\t-rm -f *.rpo\n";
420
427
    appendLines($cvs_lines);
472
479
            $MakefileData =~ s/$lookup/$replacement/;
473
480
            $lookup =~ s/\\\$\\\(CXXFLAGS\\\)/\\\$\\\(KCXXFLAGS\\\)/;
474
481
            $replacement = "$stuff_before\$(KCXXFLAGS) \$(KDE_CXXFLAGS)$stuff_after";
 
482
            next if ($stuff_before =~ /\$\(KDE_CXXFLAGS\)/ or $stuff_after =~ /\$\(KDE_CXXFLAGS\)/);
475
483
            substituteLine($lookup, $replacement);
476
484
        } else {
477
485
            $found = 0;
527
535
    }
528
536
 
529
537
    # Checking for files to process...
530
 
    open (FILEIN, $makefile)
531
 
      || die "Could not open $makefileDir/$makefile: $!\n";
 
538
 
 
539
    open (FILEIN, $makefile) || die "Can't open $makefileDir/$makefile: $!\n";
 
540
    # perl bug in 5.8.0: in utf8 mode it badly screws up
 
541
    binmode(FILEIN, ":bytes") if ($] >= 5.008);
532
542
    # Read the file
533
543
    # stat(FILEIN)[7] might look more elegant, but is slower as it 
534
544
    # requires stat'ing the file
621
631
                if ($pre eq '' && exists($varcontent{$variable})) {
622
632
                    my @addlist = split(/[\034\s]+/, $varcontent{$variable});
623
633
                    push(@objlist, @addlist);
624
 
                } elsif ($variable !~ 'OBJEXT') {
 
634
                } elsif ($variable !~ 'OBJEXT' && $variable !~ /am__objects_\d+/ ) {
625
635
                    $ocv = 1;
626
636
                }
627
637
            }
734
744
        my %shash = ();
735
745
        @shash{@progsources} = 1;  # we are only interested in the existence
736
746
        my %sourcelist = ();
 
747
        my %extradeps = ();
737
748
        
738
749
        foreach $source (@progsources) {
739
750
            my $suffix = $source;
751
762
                $moc_cpp_added = 1;
752
763
            }
753
764
        }
 
765
 
 
766
        # scan for extra given dependencies and add them to our target
 
767
        while ($MakefileData =~ /\n\s*(\S+)\.(?:lo|o)\s*:([^\n]*)/g) {
 
768
            $extradeps{$1} = $2;
 
769
        }
 
770
 
754
771
        foreach $suffix (keys %sourcelist) {
755
 
            
756
772
            # See if this file contains c++ code. (i.e., just check the file's suffix against c++ extensions)
757
773
            my $suffix_is_cxx = 0;
758
774
            if($suffix =~ /($cppExt)$/) {
769
785
                # we support IDL on our own
770
786
                if ($suffix eq "skel" || $suffix =~ /^stub/
771
787
                    || $suffix =~ /^signals/ # obsolete, remove in KDE-4
772
 
                    || $suffix eq "h" || $suffix eq "ui" ) {
 
788
                    || $suffix eq "h" || $suffix eq "ui" 
 
789
                    || $suffix eq "kcfgc" ) {
773
790
                    next;
774
791
                }
775
792
                
793
810
                } else {
794
811
                    $source_deps .= " $source";
795
812
                }
 
813
                my $plainsource = $source;
 
814
                $plainsource =~ s/\.$cppExt$//;
 
815
                $source_deps .= " " . $extradeps{$plainsource} if (exists($extradeps{$plainsource}));
796
816
            }
797
817
 
798
818
            $handling = "$program.all_$suffix.$suffix: \$(srcdir)/Makefile.in" . $source_deps . " " . join(' ', $mocs)  . "\n";
852
872
                $lines .= "\techo 'int main(int argc, char* argv[]) { return kdemain(argc,argv); }' >> ${kdeinit}.la.$cxxsuffix\n";
853
873
 
854
874
                $lines .= "\n${kdeinit}_dummy.$cxxsuffix:\n";
855
 
                $lines .= "\t echo > ${kdeinit}_dummy.$cxxsuffix\n";
 
875
                $lines .= "\techo '#include <kdemacros.h>' > ${kdeinit}_dummy.$cxxsuffix; \\\n";
 
876
                $lines .= "\techo 'extern \"C\" int kdemain(int argc, char* argv[]);' >> ${kdeinit}_dummy.$cxxsuffix; \\\n";
 
877
                $lines .= "\techo 'extern \"C\" KDE_EXPORT int kdeinitmain(int argc, char* argv[]) { return kdemain(argc,argv); }' >> ${kdeinit}_dummy.$cxxsuffix\n";
856
878
 
857
879
                push(@cleanfiles, "${kdeinit}.la.$cxxsuffix");
858
880
                push(@cleanfiles, "${kdeinit}_dummy.$cxxsuffix");
868
890
                    substituteLine($lookup, "${kdeinit}_la_LIBADD = libkdeinit_${kdeinit}.la");
869
891
                    appendLines("libkdeinit_${kdeinit}_la_LIBADD = $libadd\n");
870
892
                }
871
 
                appendLines("libkdeinit_${kdeinit}_la_LDFLAGS = \$(all_libraries)\n");
 
893
                appendLines("libkdeinit_${kdeinit}_la_LDFLAGS = -no-undefined -avoid-version \$(all_libraries)\n");
872
894
 
873
895
                # add library dependencies
874
896
                $lookup = $kdeinit . '_la_DEPENDENCIES\s*=[ \t]*(.*)';
944
966
                $realname{$kdeinit} = $kdeinit;
945
967
                $sources{$kdeinit} = "${kdeinit}.la.$cxxsuffix";
946
968
 
947
 
                $lines .= "${kdeinit}_LDFLAGS = \$(all_libraries)\n";
 
969
                $lines .= "${kdeinit}_LDFLAGS = \$(KDE_RPATH) -no-undefined \$(all_libraries)\n";
948
970
                $lines .= "${kdeinit}_LDADD = libkdeinit_${kdeinit}.la\n";
949
971
                $lines .= "${kdeinit}_DEPENDENCIES = libkdeinit_${kdeinit}.la\n";
950
972
 
972
994
 
973
995
    if($#progs >= 0) {
974
996
        if($MakefileData !~ m/\nbin_PROGRAMS\s*=/) {
975
 
            print STDERR "Error: bin_PROGRAMS missing in $printname (required for bin_PROGRAMS).\n";
 
997
            print STDERR "Error: bin_PROGRAMS missing in $printname (required for kdeinit_LTLIBRARIES).\n";
976
998
            $errorflag = 1;
977
999
        }
978
1000
        else {
1026
1048
          next if defined($donesources{$depend});
1027
1049
          push @deps, $depend;
1028
1050
        }
1029
 
        $target_adds{$sdeps} = join(' ', @deps) if (@deps);
 
1051
        $target_adds{$sdeps} .= join(' ', @deps) . ' ' if (@deps);
1030
1052
        $donesources{$source} = 1;
1031
1053
      }
1032
1054
    }
1123
1145
    print STDOUT "AUTOMAKE processing <$1>\n"        if ($verbose);
1124
1146
 
1125
1147
    my $newLine = $1."\n\tcd \$(top_srcdir) && perl $thisProg $printname";
 
1148
 
 
1149
    # automake 1.8.x adds another automake call. *sigh*
 
1150
    $newLine =~ s/;([\034\s]+cd\s+\$\(srcdir\)\s+&&[\034\s]+\$\(AUTOMAKE\).*)[\034\s]+\&\&[\034\s]+exit[\034\s]+0;([\034\s]+exit\s+1)/; \034 ( $1 ) || exit 1; echo \' cd \$(top_srcdir) && perl $thisProg \'; cd \$(top_srcdir) && perl $thisProg && exit 0; $2/;
1126
1151
    substituteLine ($lookup, $newLine);
1127
1152
    $automkCall = $1;
1128
1153
 
1129
1154
    $lookup = '.*cd \$\(srcdir\)\s+&&[\034\s]+\$\(AUTOCONF\)(.*)';
1130
1155
    if ($MakefileData =~ /\n($lookup)\n/) {
1131
 
      $newLine = "\tcd \$(srcdir) && rm -f configure && \$(MAKE) -f admin/Makefile.common configure";
 
1156
      $newLine  = "\tcd \$(srcdir) && rm -f configure\n";
 
1157
      $newLine .= "\tcd \$(top_srcdir) && \$(MAKE) -f admin/Makefile.common configure";
1132
1158
      substituteLine ($lookup, $newLine);
1133
1159
    }
1134
1160
 
1236
1262
            
1237
1263
            if ($allidls !~ /$source\_kidl/) {
1238
1264
                
 
1265
                $use_ng = ($MakefileData =~ /\n$source\_DCOPIDLNG\s*=\s*(\S+)\n/);
 
1266
                $dcopidl =  $use_ng ? "KDECONFIG=\"\$(KDECONFIG)\" \$(DCOPIDLNG)" : "\$(DCOPIDL)";
 
1267
 
1239
1268
                $dep_lines .= "$source.kidl: $sourcedir$source.h \$(DCOP_DEPENDENCIES)\n";
1240
 
                $dep_lines .= "\t\$(DCOPIDL) $sourcedir$source.h > $source.kidl || ( rm -f $source.kidl ; false )\n";
 
1269
                $dep_lines .= "\t$dcopidl $sourcedir$source.h > $source.kidl || ( rm -f $source.kidl ; false )\n";
1241
1270
                
1242
1271
                $allidls .= $source . "_kidl ";
1243
1272
            }
1332
1361
                my $dep_lines = "$source.$cxxsuffix: $sourcedir$source.ui $source.h $source.moc\n";
1333
1362
                $dep_lines .= "\trm -f $source.$cxxsuffix\n";
1334
1363
                if (!$kdeopts{"qtonly"}) {
1335
 
                    $dep_lines .= "\techo '#include <klocale.h>' > $source.$cxxsuffix\n";
 
1364
                    $dep_lines .= "\techo '#include <kdialog.h>' > $source.$cxxsuffix\n";
 
1365
                    $dep_lines .= "\techo '#include <klocale.h>' >> $source.$cxxsuffix\n";
1336
1366
                    my ($mangled_source) = $source;
1337
1367
                    $mangled_source =~ s/[^A-Za-z0-9]/_/g;  # get rid of garbage
1338
1368
                    $dep_lines .= "\t\$(UIC) -tr \${UIC_TR} -i $source.h $sourcedir$source.ui > $source.$cxxsuffix.temp ; ret=\$\$?; \\\n";
1339
 
                    $dep_lines .= "\tsed -e \"s,\${UIC_TR}( \\\"\\\" ),QString::null,g\" $source.$cxxsuffix.temp | sed -e \"s,\${UIC_TR}( \\\"\\\"\\, \\\"\\\" ),QString::null,g\" | sed -e \"s,image\\([0-9][0-9]*\\)_data,img\\1_" . $mangled_source . ",g\" >> $source.$cxxsuffix ;\\\n";
 
1369
                    $dep_lines .= "\t\$(PERL) -pe \"s,\${UIC_TR}( \\\"\\\" ),QString::null,g\" $source.$cxxsuffix.temp | \$(PERL) -pe \"s,\${UIC_TR}( \\\"\\\"\\, \\\"\\\" ),QString::null,g\" | \$(PERL) -pe \"s,image([0-9][0-9]*)_data,img\\\$\$1_" . $mangled_source . ",g\" | \$(PERL) -pe \"s,: QWizard\\(,: KWizard(,g\" >> $source.$cxxsuffix ;\\\n";
1340
1370
                    $dep_lines .= "\trm -f $source.$cxxsuffix.temp ;\\\n";
1341
1371
                } else {
1342
1372
                    $dep_lines .= "\t\$(UIC) -i $source.h $sourcedir$source.ui > $source.$cxxsuffix; ret=\$\$?; \\\n";
1343
1373
                }
1344
1374
                $dep_lines .= "\tif test \"\$\$ret\" = 0; then echo '#include \"$source.moc\"' >> $source.$cxxsuffix; else rm -f $source.$cxxsuffix ; exit \$\$ret ; fi\n\n";
1345
1375
                $dep_lines .= "$source.h: $sourcedir$source.ui\n";
1346
 
                $dep_lines .= "\t\$(UIC) -o $source.h $sourcedir$source.ui\n\n";
 
1376
                $dep_lines .= "\trm -rf $source.h;\n";
 
1377
                if (!$kdeopts{"qtonly"}) {
 
1378
                    $dep_lines .= "\t\$(UIC) $sourcedir$source.ui | \$(PERL) -pi -e \"s,public QWizard,public KWizard,g; s,#include <qwizard.h>,#include <kwizard.h>,g\" >> $source.h ;\n";
 
1379
                } else {
 
1380
                    $dep_lines .= "\t\$(UIC) -o $source.h $sourcedir$source.ui\n";
 
1381
                }
1347
1382
                $dep_lines .= "$source.moc: $source.h\n";
1348
1383
                $dep_lines .= "\t\$(MOC) $source.h -o $source.moc\n";
1349
1384
 
1364
1399
            $important{$program} .= "$source.h ";
1365
1400
            $ui_output .= "\\\n\t$source.$cxxsuffix $source.h $source.moc ";
1366
1401
            push(@cleanfiles, "$source.$cxxsuffix");
1367
 
            push(@cleanfiles, "source.h");
 
1402
            push(@cleanfiles, "$source.h");
1368
1403
            push(@cleanfiles, "$source.moc");
1369
1404
            $dep_files .= " \$(DEPDIR)/$source.P" if($dep_files !~/$source.P/ );
1370
1405
        }
1371
1406
    }
1372
1407
}
1373
1408
 
 
1409
sub tag_KCFGFILES ()
 
1410
{
 
1411
    my @psources = split(/[\034\s]+/, $sources{$program});
 
1412
    my @depFiles = ();
 
1413
    
 
1414
    foreach $source (@psources) {
 
1415
 
 
1416
        if ($source =~ m/\.kcfgc$/) {
 
1417
 
 
1418
            print STDERR "adding KCFG file $source\n" if ($verbose);
 
1419
 
 
1420
            my $qs = quotemeta($source);
 
1421
            $sources{$program} =~ s/$qs//;
 
1422
            $sources_changed{$program} = 1;
 
1423
      
 
1424
            $source =~ s/\.kcfgc$//;
 
1425
 
 
1426
            my $sourcedir = '';
 
1427
            if (-f "$makefileDir/$source.kcfgc") {
 
1428
                $sourcedir = '$(srcdir)/';
 
1429
            }
 
1430
 
 
1431
            if (!$kcfgFiles{$source}) {
 
1432
                $kcfg = "$program.kcfg";
 
1433
                findKcfgFile("$source.kcfgc");
 
1434
 
 
1435
                my $fixsuffix = "";
 
1436
                $fixsuffix = "else mv $source.cpp $source.$cxxsuffix ; " 
 
1437
                    unless "cpp" eq $cxxsuffix;
 
1438
 
 
1439
                my $dep_lines = "$source.$cxxsuffix: $source.h\n";
 
1440
                $dep_lines .= "$source.h: $sourcedir$kcfg $sourcedir$source.kcfgc \$(KCFG_DEPENDENCIES)\n";
 
1441
                $dep_lines .= "\t\$(KCONFIG_COMPILER) $sourcedir$kcfg $sourcedir$source.kcfgc; ret=\$\$?; \\\n";
 
1442
                $dep_lines .= "\tif test \"\$\$ret\" != 0; then rm -f $source.h ; exit \$\$ret ; $fixsuffix fi\n\n";
 
1443
 
 
1444
                $rule_adds{"$source.$cxxsuffix"} = $dep_lines;
 
1445
 
 
1446
                $kcfgFiles{$source} = 1;
 
1447
            }
 
1448
            
 
1449
            if ($program =~ /_la$/) {
 
1450
                $realObjs{$program} .= " $source.lo";
 
1451
            } else {
 
1452
                $realObjs{$program} .= " $source.\$(OBJEXT)";
 
1453
            }
 
1454
            $sources{$program} .= " $source.$cxxsuffix";
 
1455
            $sources_changed{$program} = 1;
 
1456
            $important{$program} .= "$source.h ";
 
1457
            $kcfg_output .= "\\\n\t$source.$cxxsuffix $source.h ";
 
1458
            push(@cleanfiles, "$source.$cxxsuffix");
 
1459
            push(@cleanfiles, "$source.h");
 
1460
            $dep_files .= " \$(DEPDIR)/$source.P" if($dep_files !~/$source.P/ );
 
1461
        }
 
1462
    }
 
1463
}
 
1464
 
1374
1465
sub tag_ICON()
1375
1466
{
1376
1467
    my $lookup = '([^\s]*)_ICON\s*=[ \t]*(.*)';
1611
1702
  appendLines ($tmp);
1612
1703
 
1613
1704
  if (!$lang) {
1614
 
    appendLines("merge:\n\t\$(MAKE) -C \$(top_srcdir)/po -f \$(top_srcdir)/admin/Makefile.common package-merge POFILES=\"\${POFILES}\" PACKAGE=\${PACKAGE}\n\n");
 
1705
    appendLines("merge:\n\t\$(MAKE) -f \$(top_srcdir)/admin/Makefile.common package-merge POFILES=\"\${POFILES}\" PACKAGE=\${PACKAGE}\n\n");
1615
1706
  }
1616
1707
 
1617
1708
}
1644
1735
        $pofiles =  join(" ", grep(/\.po$/, readdir(THISDIR)));
1645
1736
        closedir (THISDIR);
1646
1737
        print STDOUT "pofiles found = $pofiles\n"   if ($verbose);
1647
 
        if (-f "charset" && -f "kdelibs.po") {
 
1738
        if (-f "charset" && -f "kdelibs/kdelibs.po") {
1648
1739
            handle_TOPLEVEL();
1649
1740
        }
1650
1741
    }
1937
2028
 
1938
2029
      $lines .= "\n";
1939
2030
      $lines .= "uninstall-docs:\n";
1940
 
      $lines .= "\t-rm -rf \$(kde_htmldir)/$kdelang/$appname\n";
 
2031
      $lines .= "\t-rm -rf \$(DESTDIR)\$(kde_htmldir)/$kdelang/$appname\n";
1941
2032
      $lines .= "\n";
1942
2033
      $lines .= "clean-docs:\n";
1943
2034
      $lines .= "\t-rm -f index.cache.bz2\n";
2186
2277
           "\t        echo \"\$\$i\"; \\\n" . 
2187
2278
           "\t        if ! ";
2188
2279
    $t .=  $cxxsuffix eq "KKK" ?
2189
 
           "\$(CXX) \$(DEFS) -I. -I\$(srcdir) -I\$(top_builddir) \$(INCLUDES) \$(AM_CPPFLAGS) \$(CPPFLAGS) \$(KDE_CXXFLAGS) " :
 
2280
           "\$(CXX) \$(DEFS) -I. -I\$(srcdir) -I\$(top_builddir) \$(INCLUDES) \$(AM_CPPFLAGS) \$(CPPFLAGS) \$(CXXFLAGS) \$(KDE_CXXFLAGS) " :
2190
2281
           "\$(CXXCOMPILE) ";
2191
 
    $t .=  " --dump-class-hierarchy \$\$i.bchecktest.cc; then \\\n" .
 
2282
    $t .=  " --dump-class-hierarchy -c \$\$i.bchecktest.cc; then \\\n" .
2192
2283
           "\t            rm -f \$\$i.bchecktest.cc; exit 1; \\\n" .
2193
2284
           "\t        fi ; \\\n" .
2194
2285
           "\t        echo \"\" >> \$\$i.bchecktest.cc.class; \\\n" .
2262
2353
    $MakefileData =~ s/\034/\\\n/g;    # Restore continuation lines
2263
2354
    # Append our $progId line, _below_ the "generated by automake" line
2264
2355
    # because automake-1.6 relies on the first line to be his own.
2265
 
    my $progIdLine = "\# $progId - " . '$Revision: 1.3 $ '."\n";
 
2356
    my $progIdLine = "\# $progId - " . '$Revision: 1.4 $ '."\n";
2266
2357
    if ( !( $MakefileData =~ s/^(.*generated .*by automake.*\n)/$1$progIdLine/ ) ) {
2267
2358
        warn "automake line not found in $makefile\n";
2268
2359
        # Fallback: first line
2337
2428
}
2338
2429
 
2339
2430
#-----------------------------------------------------------------------------
 
2431
 
 
2432
# find the .kcfg file listed in the .kcfgc file
 
2433
sub findKcfgFile($)
 
2434
{
 
2435
  my ($kcfgf) = @_;
 
2436
  open (KCFGFIN, $kcfgf) || die "Could not open $kcfgf: $!\n";
 
2437
  seek(KCFGFIN, 0, 2);
 
2438
  my $kcfgfsize = tell(KCFGFIN);
 
2439
  seek(KCFGFIN, 0, 0);
 
2440
  read KCFGFIN, $kcfgfData, $kcfgfsize;
 
2441
  close KCFGFIN;
 
2442
  if(($kcfgfData =~ m/^File=(.*\.kcfg)/gm)) {
 
2443
    $kcfg = $1;
 
2444
  }
 
2445
}