mirror of https://github.com/Gnucash/gnucash
This includes removal of the now unused make-gnucash-potfiles.in, checking for CMakeLists.txt rather than Makefile.am in gnc-vcs-info, upating the HACKING file, and generally updating references to autotools. I have kept "Makefile.*" exclude patterns in our CMakeLists.txt files because they may still be lingering in the source directory from previous autogen.sh runs. At some point these should probably be removed as well still, together with the gitignore references to them.pull/269/head
parent
1b02517ea1
commit
85bfbd8e82
@ -1,83 +0,0 @@
|
||||
-*-text-*-
|
||||
|
||||
===========================================================================
|
||||
Automake
|
||||
|
||||
GnuCash uses automake to handle the build process. Make sure you
|
||||
understand what automake provides/requires before you add anything
|
||||
particularly fancy to the Makefile.am files.
|
||||
|
||||
Most of the time, a "make" or "make install" will automatically DTRT
|
||||
and regenerate Makefiles or Makefile.ins, re-run configure, regenerate
|
||||
configure from configure.in, etc. whenever needed. However, it is
|
||||
possible, if you make a mistake when working on the Makefile.am's to
|
||||
leave yourself in a situation where automake won't work because a
|
||||
Makefile is broken. To fix this, just run:
|
||||
|
||||
./autogen.sh
|
||||
./configure <your usual options>
|
||||
|
||||
That should sledgehammer the problem bit back into place.
|
||||
|
||||
===========================================================================
|
||||
Adding files to AC_OUTPUT in configure.in.
|
||||
|
||||
Please do not add any non-makefiles to AC_OUTPUT unless you're
|
||||
*absolutely* sure that it's safe and necessary to do so. If you're
|
||||
not sure, then please use the "generation with sed by hand approach"
|
||||
that we use for other non-makefiles like src/scm/bootstrap.scm. See
|
||||
src/scm/bootstrap.scm.in and src/scm/Makefile.in for details.
|
||||
|
||||
The reasoning behind this is that there are often variables that
|
||||
autoconf uses and replaces via the @@ mechanism that are recursively
|
||||
defined in terms of other variables. For example, @datadir@ might
|
||||
expand into $prefix/share, which itself contains an unexpanded
|
||||
variable. Unless the @datadir@ replacement is performed on a file
|
||||
that will eventually be processed by make, there's no guarantee that
|
||||
the variable will *ever* be fully expanded and then your code will
|
||||
break.
|
||||
|
||||
To get around this, we handle all non-makefiles (with a few notable
|
||||
exceptions) manually with sed. For example, we have
|
||||
src/scm/bootstrap.scm.in which is processed in src/scm/Makefile.in
|
||||
according to the following rule:
|
||||
|
||||
bootstrap.scm: bootstrap.scm.in
|
||||
rm -f $@.tmp
|
||||
sed < $@.in > $@.tmp \
|
||||
-e 's:[@]VERSION[@]:${VERSION}:g' \
|
||||
-e 's:[@]GNC_CONFIGDIR[@]:${GNC_SHAREDIR}:g' \
|
||||
-e 's:[@]GNC_SHAREDIR[@]:${GNC_CONFIGDIR}:g'
|
||||
chmod +x $@.tmp
|
||||
mv $@.tmp $@
|
||||
|
||||
This approach guarantees that the variables referred to will be
|
||||
properly expanded at the right times.
|
||||
|
||||
Note that on OSX, you MUST have the GNU version of sed installed
|
||||
via fink - the BSD version installed by default will not work with
|
||||
some of the substitution operators used in the gnucash build.
|
||||
|
||||
The only non-Makefiles files that must be handled directly by
|
||||
AC_OUTPUT are files that refer to variables that, when expanded, may
|
||||
have makefile-hostile characters like '#' in them like
|
||||
INCLUDE_LOCALE_H. These may need to be replaced directly in the
|
||||
relevant file via AC_OUTPUT since going through a makefile would break
|
||||
the makefile when it interprets the '#' as the beginning of a comment.
|
||||
You'd have something like this:
|
||||
|
||||
FOO = "#include <locale.h>"
|
||||
|
||||
If you end up in a situation where you need to refer to both these
|
||||
makefile-hostile variables and non-makefile hostile variables in the
|
||||
same file, please restructure things (breaking the file up if
|
||||
necessary) so that only the makefile hostile variables are in the
|
||||
files being handled by AC_OUTPUT directly.
|
||||
|
||||
===========================================================================
|
||||
|
||||
It is not safe to use $prefix in configure.in for anything other than
|
||||
an unexpanded reference. If the user doesn't specify a --prefix, then
|
||||
it'll be set to NONE until the end of the configure process.
|
||||
|
||||
===========================================================================
|
||||
@ -1,83 +0,0 @@
|
||||
#!@PERL@ -w
|
||||
# -*- perl -*-
|
||||
#
|
||||
# This perl script is used to make po/POTFILES.in, the list
|
||||
# of files to be searched for translatable strings.
|
||||
#
|
||||
# It will exclude any files listed in po/POTFILES.skip, po/POTFILES.ignore
|
||||
# or that match the regexp patterns listed in @ignorepatterns.
|
||||
#
|
||||
# Author: Dave Peticolas <dave@krondo.com>
|
||||
|
||||
use strict;
|
||||
use File::Basename;
|
||||
|
||||
# Note: These are perl regexp patterns, *not* normal shell wildcards!
|
||||
my @ignorepatterns = ('gw-', 'test', 'experimental', 'python-bindings', 'swig-.*\.c');
|
||||
my (@skipped_files, @ignored_files);
|
||||
open(IN, "< @SRCDIR@/po/POTFILES.skip");
|
||||
while (<IN>) {
|
||||
push @skipped_files, $_ unless $_ =~ /^\#/;
|
||||
}
|
||||
close IN;
|
||||
open(IN, "< @SRCDIR@/po/POTFILES.ignore");
|
||||
while (<IN>) {
|
||||
push @ignored_files, $_ unless $_ =~ /^\#/;
|
||||
}
|
||||
close IN;
|
||||
|
||||
# Sort filenames in POTFILES.in in a consistent way
|
||||
# This reduces the amount of clutter in our version manangement system
|
||||
# The files will be sorted
|
||||
# * per directory
|
||||
# * case-insensitive
|
||||
# * ignoring punctuation (-,_,.)
|
||||
#
|
||||
# This sort function has been extracted into a separate file (util/elegant-sort.pl)
|
||||
# in order to use the same algorithm in both cmake and autools based builds
|
||||
|
||||
my @possible_files = `cd @SRCDIR@ && \\
|
||||
find bindings borrowed common libgnucash gnucash -name '*.c' \\
|
||||
-o -name '*.cpp' -o -name '*.glade' \\
|
||||
-o -name '*.desktop.in' -o -name '*.keys.in' \\
|
||||
-o -name '*.gschema.xml.in.in' -o -name '*.scm' \\
|
||||
| util/elegant-sort.pl`;
|
||||
## For perl files add the following:
|
||||
# -o -name '*.pl'
|
||||
|
||||
print "# This is a list of files which contain translatable strings.\n";
|
||||
print "# This file was generated by ../make-gnucash-potfiles.\n";
|
||||
|
||||
my %ignores;
|
||||
foreach my $file (@possible_files) {
|
||||
chomp($file);
|
||||
my ($name, $path) = fileparse($file);
|
||||
$path =~ s/^\.\///;
|
||||
|
||||
foreach my $pat (@ignorepatterns, @skipped_files, @ignored_files) {
|
||||
chomp($pat);
|
||||
next unless $pat;
|
||||
|
||||
if ($file =~ m/$pat/ || $name =~ m/$pat/ || $path =~ m/$pat/) {
|
||||
$ignores{$path . $name} = 1;
|
||||
}
|
||||
}
|
||||
next if $ignores{$path . $name};
|
||||
|
||||
# Ignore unreadable files, e.g. dangling symlinks
|
||||
next unless (-r "@SRCDIR@/" . $path . $name);
|
||||
|
||||
# Force parse type for gsettings files
|
||||
my $type = "";
|
||||
if ($file =~ m/.gschema.xml.in.in/ ){
|
||||
$type = "[type: gettext/gsettings]";
|
||||
}
|
||||
|
||||
print $type . $path . $name . "\n";
|
||||
}
|
||||
|
||||
# These are manually added, because they're not picked up by the generation script
|
||||
print "gnucash/gnome/gnucash.appdata.xml.in\n";
|
||||
print "gnucash/gnome/gnucash.desktop.in.in\n";
|
||||
print "libgnucash/engine/qofbookslots.h\n";
|
||||
print "doc/tip_of_the_day.list.in\n";
|
||||
Loading…
Reference in new issue