gimp/plug-ins/common/mkgen.pl
Sven Neumann a56949222f HACKING Makefile.am acconfig.h autogen.sh use AM_GLIB_GNU_GETTEXT. Since
2001-09-27  Sven Neumann  <sven@gimp.org>

        * HACKING
        * Makefile.am
        * acconfig.h
        * autogen.sh
        * configure.in: use AM_GLIB_GNU_GETTEXT. Since glib and GTK+ rely on
        gettext being available, we don't need to ship with the option to use
        an included implementation. The intl subdirectory will not be created
        anymore. Had to put the old sed hacks back in that create Makefiles
        from Makefile.in in the extra po directories.

        * almost all Makefile.am: removed $(top_srcdir)/intl from INCLUDES.

        * app/main.c
        * libgimp/stdplugins-intl.h
        * plug-ins/perl/Gimp.xs
        * plug-ins/script-fu/script-fu-intl.h: changed package names to
        gimp14* so the po files don't clash with gimp12.
2001-09-27 15:33:53 +00:00

133 lines
3.1 KiB
Perl
Executable file

#!/usr/bin/perl -w
use lib '../../tools/pdbgen';
require 'util.pl';
*write_file = \&Gimp::CodeGen::util::write_file;
*FILE_EXT = \$Gimp::CodeGen::util::FILE_EXT;
$outmk = "Makefile.am$FILE_EXT";
$outignore = ".cvsignore$FILE_EXT";
open MK, "> $outmk";
open IGNORE, "> $outignore";
require 'plugin-defs.pl';
$bins = ""; $opts = "";
foreach (sort keys %plugins) {
$bins .= "\t";
if (exists $plugins{$_}->{optional}) {
$bins .= "\$(\U$_\E)";
$opts .= "\t$_ \\\n";
}
else {
$bins .= $_;
}
$bins .= " \\\n";
}
$extra = "";
foreach (@extra) { $extra .= "\t$_\t\\\n" }
if ($extra) {
$extra =~ s/\t\\\n$//s;
$extra = "\t\\\n$extra";
}
foreach ($bins, $opts) { s/ \\\n$//s }
print MK <<EOT;
## This file is autogenerated by mkgen.pl and plugin-defs.pl
libexecdir = \$(gimpplugindir)/plug-ins
EXTRA_DIST = \@STRIP_BEGIN\@ \\
mkgen.pl \\
plugin-defs.pl$extra \\
\@STRIP_END\@
AM_CPPFLAGS = \@STRIP_BEGIN\@ \\
-DLOCALEDIR=\\""\$(localedir)"\\" \\
\@STRIP_END\@
INCLUDES = \@STRIP_BEGIN\@ \\
-I\$(top_srcdir) \\
\$(GTK_CFLAGS) \\
-I\$(includedir) \\
\@STRIP_END\@
libexec_PROGRAMS = \@STRIP_BEGIN\@ \\
$bins \\
\@STRIP_END\@
EXTRA_PROGRAMS = \\
$opts
install-\%: \%
\@\$(NORMAL_INSTALL)
\$(mkinstalldirs) \$(DESTDIRS)\$(libexecdir)
\@if test -f \$<; then \\
echo " \$(LIBTOOL) --mode=install \$(INSTALL_PROGRAM) \$< \$(DESTDIR)\$(libexecdir)/`echo \$<|sed 's/\$(EXEEXT)\$\$//'|sed '\$(transform)'|sed 's/\$\$/\$(EXEEXT)/'`"; \\
\$(LIBTOOL) --mode=install \$(INSTALL_PROGRAM) \$< \$(DESTDIR)\$(libexecdir)/`echo \$<|sed 's/\$(EXEEXT)\$\$//'|sed '\$(transform)'|sed 's/\$\$/\$(EXEEXT)/'`; \\
else :; fi
EOT
print IGNORE <<EOT;
Makefile
Makefile.in
.deps
.libs
EOT
foreach (sort keys %plugins) {
my $libgimp = "";
$libgimp .= "\$(top_builddir)/libgimp/libgimp-\$(LT_RELEASE).la";
if (exists $plugins{$_}->{ui}) {
$libgimp .= "\t\t\\\n\t$libgimp";
$libgimp =~ s/gimp-/gimpui-/;
$libgimp .= "\t\t\\\n\t\$(top_builddir)/libgimpwidgets/libgimpwidgets-\$(LT_RELEASE).la";
$libgimp .= "\t\\\n\t\$(top_builddir)/libgimpcolor/libgimpcolor-\$(LT_RELEASE).la";
$libgimp .= "\t\\\n\t\$(top_builddir)/libgimpbase/libgimpbase-\$(LT_RELEASE).la";
} else {
$libgimp .= "\t\t\\\n\t\$(top_builddir)/libgimpcolor/libgimpcolor-\$(LT_RELEASE).la";
$libgimp .= "\t\\\n\t\$(top_builddir)/libgimpbase/libgimpbase-\$(LT_RELEASE).la";
}
my $optlib = "";
if (exists $plugins{$_}->{optional}) {
my $name = exists $plugins{$_}->{libopt} ? $plugins{$_}->{libopt} : $_;
$optlib = "\n\t\$(LIB\U$name\E)\t\t\t\t\t\t\t\\";
}
if (exists $plugins{$_}->{libsupp}) {
my @lib = split(/:/, $plugins{$_}->{libsupp});
foreach $lib (@lib) {
$libgimp = "\$(top_builddir)/plug-ins/$lib/lib$lib.a\t\\\n\t$libgimp";
}
}
print MK <<EOT;
${_}_SOURCES = \@STRIP_BEGIN\@ \\
$_.c \\
\@STRIP_END\@
${_}_LDADD = \@STRIP_BEGIN\@ \\
$libgimp \\$optlib
\$(\U$plugins{$_}->{libdep}\E_LIBS) \\
\$(INTLLIBS) \\
\@STRIP_END\@
EOT
print IGNORE "$_\n";
}
close MK;
close IGNORE;
&write_file($outmk);
&write_file($outignore);