|
|
|
@ -215,7 +215,7 @@ sub processMakefile ($)
|
|
|
|
|
local @programs = (); # lists the names of programs and libraries
|
|
|
|
|
local $program = "";
|
|
|
|
|
|
|
|
|
|
local @kdeinits = (); # lists the kdeinit targets
|
|
|
|
|
local @tdeinits = (); # lists the tdeinit targets
|
|
|
|
|
|
|
|
|
|
local %realObjs = (); # lists the objects compiled into $program
|
|
|
|
|
local %sources = (); # lists the sources used for $program
|
|
|
|
@ -858,125 +858,125 @@ sub tag_KDEINIT()
|
|
|
|
|
{
|
|
|
|
|
my @progs = ();
|
|
|
|
|
my $ltlibs = "";
|
|
|
|
|
my $lookup = 'kdeinit_LTLIBRARIES\s*=[ \t]*(.*)';
|
|
|
|
|
my $lookup = 'tdeinit_LTLIBRARIES\s*=[ \t]*(.*)';
|
|
|
|
|
|
|
|
|
|
if ($MakefileData =~ m/\n$lookup/) {
|
|
|
|
|
@kdeinits = split(/[\034\s]+/, $1);
|
|
|
|
|
@tdeinits = split(/[\034\s]+/, $1);
|
|
|
|
|
my $lines = "";
|
|
|
|
|
foreach my $kdeinit (@kdeinits) {
|
|
|
|
|
if ($kdeinit =~ m/\.la$/) {
|
|
|
|
|
$kdeinit =~ s/\.la$//;
|
|
|
|
|
push(@progs, $kdeinit);
|
|
|
|
|
foreach my $tdeinit (@tdeinits) {
|
|
|
|
|
if ($tdeinit =~ m/\.la$/) {
|
|
|
|
|
$tdeinit =~ s/\.la$//;
|
|
|
|
|
push(@progs, $tdeinit);
|
|
|
|
|
|
|
|
|
|
$lines .= "\n${kdeinit}.la.$cxxsuffix:\n";
|
|
|
|
|
$lines .= "\techo 'extern \"C\" int kdemain(int argc, char* argv[]);' > ${kdeinit}.la.$cxxsuffix; \\\n";
|
|
|
|
|
$lines .= "\techo 'int main(int argc, char* argv[]) { return kdemain(argc,argv); }' >> ${kdeinit}.la.$cxxsuffix\n";
|
|
|
|
|
$lines .= "\n${tdeinit}.la.$cxxsuffix:\n";
|
|
|
|
|
$lines .= "\techo 'extern \"C\" int kdemain(int argc, char* argv[]);' > ${tdeinit}.la.$cxxsuffix; \\\n";
|
|
|
|
|
$lines .= "\techo 'int main(int argc, char* argv[]) { return kdemain(argc,argv); }' >> ${tdeinit}.la.$cxxsuffix\n";
|
|
|
|
|
|
|
|
|
|
$lines .= "\n${kdeinit}_dummy.$cxxsuffix:\n";
|
|
|
|
|
$lines .= "\techo '#include <kdemacros.h>' > ${kdeinit}_dummy.$cxxsuffix; \\\n";
|
|
|
|
|
$lines .= "\techo 'extern \"C\" int kdemain(int argc, char* argv[]);' >> ${kdeinit}_dummy.$cxxsuffix; \\\n";
|
|
|
|
|
$lines .= "\techo 'extern \"C\" KDE_EXPORT int kdeinitmain(int argc, char* argv[]) { return kdemain(argc,argv); }' >> ${kdeinit}_dummy.$cxxsuffix\n";
|
|
|
|
|
$lines .= "\n${tdeinit}_dummy.$cxxsuffix:\n";
|
|
|
|
|
$lines .= "\techo '#include <kdemacros.h>' > ${tdeinit}_dummy.$cxxsuffix; \\\n";
|
|
|
|
|
$lines .= "\techo 'extern \"C\" int kdemain(int argc, char* argv[]);' >> ${tdeinit}_dummy.$cxxsuffix; \\\n";
|
|
|
|
|
$lines .= "\techo 'extern \"C\" KDE_EXPORT int tdeinitmain(int argc, char* argv[]) { return kdemain(argc,argv); }' >> ${tdeinit}_dummy.$cxxsuffix\n";
|
|
|
|
|
|
|
|
|
|
push(@cleanfiles, "${kdeinit}.la.$cxxsuffix");
|
|
|
|
|
push(@cleanfiles, "${kdeinit}_dummy.$cxxsuffix");
|
|
|
|
|
push(@cleanfiles, "${tdeinit}.la.$cxxsuffix");
|
|
|
|
|
push(@cleanfiles, "${tdeinit}_dummy.$cxxsuffix");
|
|
|
|
|
|
|
|
|
|
# add dependency
|
|
|
|
|
$dep_files .= " \$(DEPDIR)/${kdeinit}.la.Po" if($dep_files !~/${kdeinit}.la.Po/ );
|
|
|
|
|
$dep_files .= " \$(DEPDIR)/${kdeinit}_dummy.Plo" if($dep_files !~/${kdeinit}_dummy.Plo/ );
|
|
|
|
|
$dep_files .= " \$(DEPDIR)/${tdeinit}.la.Po" if($dep_files !~/${tdeinit}.la.Po/ );
|
|
|
|
|
$dep_files .= " \$(DEPDIR)/${tdeinit}_dummy.Plo" if($dep_files !~/${tdeinit}_dummy.Plo/ );
|
|
|
|
|
|
|
|
|
|
# make library
|
|
|
|
|
$lookup = $kdeinit . '_la_LIBADD\s*=[ \t]*(.*)';
|
|
|
|
|
$lookup = $tdeinit . '_la_LIBADD\s*=[ \t]*(.*)';
|
|
|
|
|
if($MakefileData =~ m/\n$lookup/) {
|
|
|
|
|
my $libadd = $1;
|
|
|
|
|
substituteLine($lookup, "${kdeinit}_la_LIBADD = libtdeinit_${kdeinit}.la");
|
|
|
|
|
appendLines("libtdeinit_${kdeinit}_la_LIBADD = $libadd\n");
|
|
|
|
|
substituteLine($lookup, "${tdeinit}_la_LIBADD = libtdeinit_${tdeinit}.la");
|
|
|
|
|
appendLines("libtdeinit_${tdeinit}_la_LIBADD = $libadd\n");
|
|
|
|
|
}
|
|
|
|
|
appendLines("libtdeinit_${kdeinit}_la_LDFLAGS = -no-undefined -avoid-version \$(all_libraries)\n");
|
|
|
|
|
appendLines("libtdeinit_${tdeinit}_la_LDFLAGS = -no-undefined -avoid-version \$(all_libraries)\n");
|
|
|
|
|
|
|
|
|
|
# add library dependencies
|
|
|
|
|
$lookup = $kdeinit . '_la_DEPENDENCIES\s*=[ \t]*(.*)';
|
|
|
|
|
$lookup = $tdeinit . '_la_DEPENDENCIES\s*=[ \t]*(.*)';
|
|
|
|
|
if($MakefileData =~ m/\n$lookup/) {
|
|
|
|
|
my $libdeps = $1;
|
|
|
|
|
substituteLine($lookup, "${kdeinit}_la_DEPENDENCIES = libtdeinit_${kdeinit}.la");
|
|
|
|
|
appendLines("libtdeinit_${kdeinit}_la_DEPENDENCIES = $libdeps\n");
|
|
|
|
|
substituteLine($lookup, "${tdeinit}_la_DEPENDENCIES = libtdeinit_${tdeinit}.la");
|
|
|
|
|
appendLines("libtdeinit_${tdeinit}_la_DEPENDENCIES = $libdeps\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# make library objects
|
|
|
|
|
$lookup = "am_${kdeinit}_la_OBJECTS" . '\s*=[ \t]*(.*)';
|
|
|
|
|
$lookup = "am_${tdeinit}_la_OBJECTS" . '\s*=[ \t]*(.*)';
|
|
|
|
|
if($MakefileData =~ m/\n$lookup/) {
|
|
|
|
|
my $libobjects = $1;
|
|
|
|
|
substituteLine($lookup, "am_${kdeinit}_la_OBJECTS = ${kdeinit}_dummy.lo");
|
|
|
|
|
appendLines("am_libtdeinit_${kdeinit}_la_OBJECTS = $libobjects\n");
|
|
|
|
|
my $prog = "libtdeinit_${kdeinit}_la";
|
|
|
|
|
substituteLine($lookup, "am_${tdeinit}_la_OBJECTS = ${tdeinit}_dummy.lo");
|
|
|
|
|
appendLines("am_libtdeinit_${tdeinit}_la_OBJECTS = $libobjects\n");
|
|
|
|
|
my $prog = "libtdeinit_${tdeinit}_la";
|
|
|
|
|
push(@programs, $prog);
|
|
|
|
|
$realObjs{$prog} = $libobjects;
|
|
|
|
|
$realname{$prog} = "libtdeinit_${kdeinit}.la";
|
|
|
|
|
$realname{$prog} = "libtdeinit_${tdeinit}.la";
|
|
|
|
|
}
|
|
|
|
|
$target_adds{"libtdeinit_${kdeinit}.la"} = "\$(libtdeinit_${kdeinit}_la_OBJECTS) \$(libtdeinit_${kdeinit}_la_DEPENDENCIES)\n" .
|
|
|
|
|
"\t\$(CXXLINK) -rpath \$(libdir) \$(libtdeinit_${kdeinit}_la_LDFLAGS) ".
|
|
|
|
|
"\$(libtdeinit_${kdeinit}_la_OBJECTS) " .
|
|
|
|
|
"\$(libtdeinit_${kdeinit}_la_LIBADD) " .
|
|
|
|
|
$target_adds{"libtdeinit_${tdeinit}.la"} = "\$(libtdeinit_${tdeinit}_la_OBJECTS) \$(libtdeinit_${tdeinit}_la_DEPENDENCIES)\n" .
|
|
|
|
|
"\t\$(CXXLINK) -rpath \$(libdir) \$(libtdeinit_${tdeinit}_la_LDFLAGS) ".
|
|
|
|
|
"\$(libtdeinit_${tdeinit}_la_OBJECTS) " .
|
|
|
|
|
"\$(libtdeinit_${tdeinit}_la_LIBADD) " .
|
|
|
|
|
"\$(LIBS)\n";
|
|
|
|
|
|
|
|
|
|
# make libtdeinit sources
|
|
|
|
|
$lookup = $kdeinit . '_la_SOURCES\s*=[ \t]*(.*)';
|
|
|
|
|
$lookup = $tdeinit . '_la_SOURCES\s*=[ \t]*(.*)';
|
|
|
|
|
if($MakefileData =~ m/\n$lookup/) {
|
|
|
|
|
my $srces = $1;
|
|
|
|
|
$sources_changed{"libtdeinit_${kdeinit}_la"} = 1;
|
|
|
|
|
$sources{"libtdeinit_${kdeinit}_la"} = $srces;
|
|
|
|
|
$sources_changed{"libtdeinit_${tdeinit}_la"} = 1;
|
|
|
|
|
$sources{"libtdeinit_${tdeinit}_la"} = $srces;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# make libtdeinit metasources
|
|
|
|
|
$lookup = $kdeinit . '_la_METASOURCES\s*=[ \t]*(.*)';
|
|
|
|
|
substituteLine($lookup, "libtdeinit_${kdeinit}_la_METASOURCES = $1")
|
|
|
|
|
$lookup = $tdeinit . '_la_METASOURCES\s*=[ \t]*(.*)';
|
|
|
|
|
substituteLine($lookup, "libtdeinit_${tdeinit}_la_METASOURCES = $1")
|
|
|
|
|
if($MakefileData =~ m/\n$lookup/);
|
|
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
# make binary sources
|
|
|
|
|
$lookup = $kdeinit. '_SOURCES\s*=[ \t]*(.*)';
|
|
|
|
|
$lookup = $tdeinit. '_SOURCES\s*=[ \t]*(.*)';
|
|
|
|
|
if($MakefileData =~ m/\n$lookup/) {
|
|
|
|
|
substituteLine($lookup, "${kdeinit}_SOURCES = ${kdeinit}.la.$cxxsuffix");
|
|
|
|
|
substituteLine($lookup, "${tdeinit}_SOURCES = ${tdeinit}.la.$cxxsuffix");
|
|
|
|
|
$lookup = 'SOURCES\s*=[ \t]*(.*)';
|
|
|
|
|
if($MakefileData =~ m/\n$lookup/) {
|
|
|
|
|
my $srces = $1;
|
|
|
|
|
$srces =~ s/\b$kdeinit\.c\b/\$(${kdeinit}_SOURCES)/;
|
|
|
|
|
$srces =~ s/\$\(${kdeinit}_la_SOURCES\)/\$(libtdeinit_${kdeinit}_la_SOURCES)/;
|
|
|
|
|
$srces =~ s/\b$tdeinit\.c\b/\$(${tdeinit}_SOURCES)/;
|
|
|
|
|
$srces =~ s/\$\(${tdeinit}_la_SOURCES\)/\$(libtdeinit_${tdeinit}_la_SOURCES)/;
|
|
|
|
|
substituteLine($lookup, "SOURCES = $srces");
|
|
|
|
|
}
|
|
|
|
|
$lookup = 'DIST_SOURCES\s*=[ \t](.*)';
|
|
|
|
|
if($MakefileData =~ m/\n$lookup/) {
|
|
|
|
|
my $srces = $1;
|
|
|
|
|
$srces =~ s/\b$kdeinit\.c\b/\$(${kdeinit}_SOURCES)/;
|
|
|
|
|
$srces =~ s/\$\(${kdeinit}_la_SOURCES\)/\$(libtdeinit_${kdeinit}_la_SOURCES)/;
|
|
|
|
|
$srces =~ s/\b$tdeinit\.c\b/\$(${tdeinit}_SOURCES)/;
|
|
|
|
|
$srces =~ s/\$\(${tdeinit}_la_SOURCES\)/\$(libtdeinit_${tdeinit}_la_SOURCES)/;
|
|
|
|
|
substituteLine($lookup, "DIST_SOURCES = $srces");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# make binary objects / libs
|
|
|
|
|
$lookup = $kdeinit . '_OBJECTS\s*=[ \t]*.*';
|
|
|
|
|
$lookup = $tdeinit . '_OBJECTS\s*=[ \t]*.*';
|
|
|
|
|
if($MakefileData =~ m/\n$lookup/) {
|
|
|
|
|
$realObjs{$kdeinit} = "${kdeinit}.la.\$(OBJEXT)";
|
|
|
|
|
substituteLine("${kdeinit}_LDFLAGS\\s*=.*", "${kdeinit}_LDFLAGS = \$(all_libraries)");
|
|
|
|
|
substituteLine("${kdeinit}_LDADD\\s*=.*", "${kdeinit}_LDADD = libtdeinit_${kdeinit}.la");
|
|
|
|
|
substituteLine("${kdeinit}_DEPENDENCIES\\s*=.*", "${kdeinit}_DEPENDENCIES = libtdeinit_${kdeinit}.la");
|
|
|
|
|
$realObjs{$tdeinit} = "${tdeinit}.la.\$(OBJEXT)";
|
|
|
|
|
substituteLine("${tdeinit}_LDFLAGS\\s*=.*", "${tdeinit}_LDFLAGS = \$(all_libraries)");
|
|
|
|
|
substituteLine("${tdeinit}_LDADD\\s*=.*", "${tdeinit}_LDADD = libtdeinit_${tdeinit}.la");
|
|
|
|
|
substituteLine("${tdeinit}_DEPENDENCIES\\s*=.*", "${tdeinit}_DEPENDENCIES = libtdeinit_${tdeinit}.la");
|
|
|
|
|
}
|
|
|
|
|
=cut
|
|
|
|
|
# add binary
|
|
|
|
|
push(@programs, $kdeinit);
|
|
|
|
|
$realObjs{$kdeinit} = "${kdeinit}.la.\$(OBJEXT)";
|
|
|
|
|
$realname{$kdeinit} = $kdeinit;
|
|
|
|
|
$sources{$kdeinit} = "${kdeinit}.la.$cxxsuffix";
|
|
|
|
|
push(@programs, $tdeinit);
|
|
|
|
|
$realObjs{$tdeinit} = "${tdeinit}.la.\$(OBJEXT)";
|
|
|
|
|
$realname{$tdeinit} = $tdeinit;
|
|
|
|
|
$sources{$tdeinit} = "${tdeinit}.la.$cxxsuffix";
|
|
|
|
|
|
|
|
|
|
$lines .= "${kdeinit}_LDFLAGS = \$(KDE_RPATH) -no-undefined \$(all_libraries)\n";
|
|
|
|
|
$lines .= "${kdeinit}_LDADD = libtdeinit_${kdeinit}.la\n";
|
|
|
|
|
$lines .= "${kdeinit}_DEPENDENCIES = libtdeinit_${kdeinit}.la\n";
|
|
|
|
|
$lines .= "${tdeinit}_LDFLAGS = \$(KDE_RPATH) -no-undefined \$(all_libraries)\n";
|
|
|
|
|
$lines .= "${tdeinit}_LDADD = libtdeinit_${tdeinit}.la\n";
|
|
|
|
|
$lines .= "${tdeinit}_DEPENDENCIES = libtdeinit_${tdeinit}.la\n";
|
|
|
|
|
|
|
|
|
|
$target_adds{"${kdeinit}\$(EXEEXT)"} =
|
|
|
|
|
"\$(${kdeinit}_OBJECTS) \$(${kdeinit}_DEPENDENCIES)\n" .
|
|
|
|
|
"\t\@rm -f ${kdeinit}\$(EXEEXT)\n" .
|
|
|
|
|
"\t\$(CXXLINK) \$(${kdeinit}_LDFLAGS) \$(${kdeinit}_OBJECTS) \$(${kdeinit}_LDADD) \$(LIBS)\n";
|
|
|
|
|
$target_adds{"${tdeinit}\$(EXEEXT)"} =
|
|
|
|
|
"\$(${tdeinit}_OBJECTS) \$(${tdeinit}_DEPENDENCIES)\n" .
|
|
|
|
|
"\t\@rm -f ${tdeinit}\$(EXEEXT)\n" .
|
|
|
|
|
"\t\$(CXXLINK) \$(${tdeinit}_LDFLAGS) \$(${tdeinit}_OBJECTS) \$(${tdeinit}_LDADD) \$(LIBS)\n";
|
|
|
|
|
|
|
|
|
|
$ltlibs .= " libtdeinit_${kdeinit}.la";
|
|
|
|
|
$ltlibs .= " libtdeinit_${tdeinit}.la";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
appendLines($lines);
|
|
|
|
@ -988,14 +988,14 @@ sub tag_KDEINIT()
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
print STDERR
|
|
|
|
|
"Error: lib_LTLIBRARIES missing in $printname (required for kdeinit_LTLIBRARIES).\n";
|
|
|
|
|
"Error: lib_LTLIBRARIES missing in $printname (required for tdeinit_LTLIBRARIES).\n";
|
|
|
|
|
$errorflag = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($#progs >= 0) {
|
|
|
|
|
if($MakefileData !~ m/\nbin_PROGRAMS\s*=/) {
|
|
|
|
|
print STDERR "Error: bin_PROGRAMS missing in $printname (required for kdeinit_LTLIBRARIES).\n";
|
|
|
|
|
print STDERR "Error: bin_PROGRAMS missing in $printname (required for tdeinit_LTLIBRARIES).\n";
|
|
|
|
|
$errorflag = 1;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|