aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2016-07-30 10:14:19 +0300
committerSergey Poznyakoff <gray@gnu.org>2016-07-30 10:19:04 +0300
commit71e51308e7fe0136b76799f5e6dbbec94e279f46 (patch)
tree820ee704751fd7a498464ecfb5c42ea6da530ead
parentbde49d719c1894d0e502a73d42ab546d905492f2 (diff)
downloaddico-71e51308e7fe0136b76799f5e6dbbec94e279f46.tar.gz
dico-71e51308e7fe0136b76799f5e6dbbec94e279f46.tar.bz2
Rename modinc to bootstrap.modinc
* modinc: Rename to bootstrap. * bootstrap: Add generic bootstrapping code. * stub.ac: Rename to configure.boot. * Makefile.am: Fix EXTRA_DIST * README-hacking: Document bootstrap.
-rw-r--r--Makefile.am4
-rw-r--r--README-hacking36
-rwxr-xr-xbootstrap807
-rw-r--r--configure.boot (renamed from stub.ac)10
-rwxr-xr-xmodinc641
5 files changed, 813 insertions, 685 deletions
diff --git a/Makefile.am b/Makefile.am
index a157141..fa15921 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
1# This file is part of GNU Dico 1# This file is part of GNU Dico
2# Copyright (C) 1998-2000, 2008-2010, 2012 Sergey Poznyakoff 2# Copyright (C) 1998-2000, 2008-2010, 2012, 2016 Sergey Poznyakoff
3# 3#
4# GNU Dico is free software; you can redistribute it and/or modify 4# GNU Dico is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by 5# it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@ SUBDIRS=\
34 po 34 po
35#FIXME: add these when ready: makedict client fonts 35#FIXME: add these when ready: makedict client fonts
36 36
37EXTRA_DIST = ChangeLog.2008 stub.ac modinc 37EXTRA_DIST = ChangeLog.2008 configure.boot bootstrap
38 38
39dist-hook: 39dist-hook:
40 tar -C $(srcdir) -c -f - --exclude-vcs app dicoweb | \ 40 tar -C $(srcdir) -c -f - --exclude-vcs app dicoweb | \
diff --git a/README-hacking b/README-hacking
index 74cb866..7037357 100644
--- a/README-hacking
+++ b/README-hacking
@@ -42,39 +42,43 @@ which are extracted from other source packages:
42 42
43 ./bootstrap 43 ./bootstrap
44 44
45Use one or more --verbose options to see details about its progress.
46
45Once done, proceed as described in the file README (section 47Once done, proceed as described in the file README (section
46INSTALLATION). 48INSTALLATION).
47 49
48Normally you will have to run bootstrap only once. However, if you
49intend to hack on Dico, you might need to run it again later. In
50this case, you will probably want to save some time and bandwidth by
51avoiding downloading the same files again. If so, create in the project's
52root directory a file named `.bootstrap' with the following
53contents:
54
55 --gnulib-srcdir=$HOME/gnulib
56
57Replace `$HOME/gnulib' with the actual directory where the Gnulib
58sources reside.
59
60For more information about `bootstrap', run `bootstrap --help'. 50For more information about `bootstrap', run `bootstrap --help'.
61 51
62* Debugging 52* Debugging
63 53
64To debug dictd, use the following command: 54To debug dicod, use the following command:
65 55
66 libtool --mode execute gdb dictd 56 libtool --mode execute gdb dicod
67 57
68For debugging from Emacs run: 58For debugging from Emacs run:
69 59
70 M-x gdb RET gud-wrapper dictd RET 60 M-x gdb RET gud-wrapper dicod RET
71 61
72(the script gud-wrapper is located in the ./utils subdirectory) 62(the script gud-wrapper is located in the ./utils subdirectory)
73 63
64* Adding new modules
65
66If you want to add a new module to Dico (e.g. named `foo'), run the
67following command from the Dico source tree topmost directory:
68
69 ./bootstrap --add foo
70
71This will create the directory modules/foo, populate it with the
72necessary files, and add the appropriate statements to configure.ac
73and modules/Makefile.am files.
74
75After running this command, change to the modules/foo directory and
76start hacking on your new module.
77
74 78
75* Copyright information 79* Copyright information
76 80
77Copyright (C) 2008, 2010, 2012 Sergey Poznyakoff 81Copyright (C) 2008, 2010, 2012, 2016 Sergey Poznyakoff
78 82
79 Permission is granted to anyone to make or distribute verbatim copies 83 Permission is granted to anyone to make or distribute verbatim copies
80 of this document as received, in any medium, provided that the 84 of this document as received, in any medium, provided that the
diff --git a/bootstrap b/bootstrap
index 7589553..5a3ce01 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,23 +1,784 @@
1#! /bin/sh 1#! /usr/bin/perl
2 2# This file is part of GNU Dico
3chksrc() { 3# Copyright (C) 2014, 2016 Sergey Poznyakoff
4 test -f modinc || return 1 4#
5 test -f stub.ac || return 1 5# GNU Dico is free software; you can redistribute it and/or modify
6 src=`sed -n 's/AC_CONFIG_SRCDIR(\[\(.*\)\]).*/\1/p' stub.ac` 6# it under the terms of the GNU General Public License as published by
7 test -n "$src" || return 1 7# the Free Software Foundation; either version 3, or (at your option)
8 test -f $src 8# any later version.
9} 9#
10 10# GNU Dico is distributed in the hope that it will be useful,
11if ! chksrc; then 11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12 echo "$0: must be run from the Dico source tree root directory" 12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 exit 1 13# GNU General Public License for more details.
14fi 14#
15 15# You should have received a copy of the GNU General Public License
16set -e 16# along with GNU Dico. If not, see <http://www.gnu.org/licenses/>.
17git submodule init 17
18git submodule update 18=head1 NAME
19./modinc 19
20set +e 20bootstrap - Bootstrap the Dico project
21gnulib=gnulibinit 21
22test -L $gnulib || ln -sf ./gnulib/build-aux/bootstrap $gnulib 22=head1 SYNOPSIS
23./$gnulib 23
24B<bootstrap>
25[B<-ahmnv>]
26[B<--add>]
27[B<--help>]
28[B<--new>]
29[B<--modules>]
30[B<--dry-run>]
31[B<--verbose>]
32[I<NAME>...]
33
34=head1 DESCRIPTION
35
36Bootstrap the Dico project. This is the first command that should be run
37after cloning the project from the repository in order to be able to built
38it.
39
40When run without arguments performs the following actions:
41
42=over 4
43
44=item 1. Pulls in git submodules.
45
46=item 2. Creates autoconf/automake sources for building Dico modules.
47
48Recreates F<configure.ac> and F<modules/Makefile.am> from stub files
49F<configure.boot> and F<modules/stub.am>. The list of modules is obtained
50from the contents of the F<modules> directory -- each subdirectory
51is supposed to contain one module.
52
53Additional F<configure.ac> code for each module is obtained from
54file F<module.ac> in each module directory. See the description of
55this file in section B<FILES>.
56
57=item 3. Bootstraps the B<gnulib> submodule.
58
59=back
60
61The program must be run from the Dico source tree topmost directory.
62
63When given the B<-m> (B<--modules>) option, only the second step is
64performed.
65
66When run with B<-a> (B<--add>, B<--new>) option, the program creates
67basic infrastructure for modules named in the command line. For each
68I<NAME> it creates directory F<modules/I<NAME>>. Withih that directory,
69it creates two files: F<Makefile.am> from F<modules/template.am>, and
70F<I<NAME>.c>, which contains a stub code for the module. The new module
71is then integrated into F<configure.ac> and F<modules/Makefile.am> files.
72
73By default, the program prints only error diagnostics. That means that
74upon success, it will terminate quietly, without producing a single line
75on output. This can be changed using the B<-v> (or B<--verbose>) option.
76When the option is given once, the program prints general description before
77running each of the three steps described above. Two B<-v> options instruct
78it to also print whatever output that was generated when running auxiliary
79commands. Finally, three B<-v>'s produce additional debugging information.
80
81The B<-n> (B<--dry-run>) option instructs the tool to print what would have
82been done without actually doing it.
83
84=head1 OPTIONS
85
86=over 4
87
88=item B<-a>, B<--add>, B<--new>
89
90Create basic infrastructure for modules named in the command line and
91add them to F<configure.ac> and F<modules/Makefile.am>
92
93=item B<-n>, B<--dry-run>
94
95Don't do anything, just print what would have been done.
96
97=item B<-m>, B<--modules>
98
99Run only the second step: creation of autoconf/automake sources for
100Dico modules.
101
102=item B<-v>, B<--verbose>
103
104Increase output verbosity. Multiple options accumulate.
105
106=back
107
108The following options are passed to the B<gnulib> bootstrap script
109verbatim:
110
111=over 4
112
113=item B<--gnulib-srcdir=>I<DIRNAME>
114
115Specifies the local directory where B<gnulib> sources reside. Use this if
116you already have gnulib sources on your machine, and do not want to waste
117your bandwidth downloading them again.
118
119=item B<--no-git>
120
121Do not use git to update B<gnulib>. Requires that B<--gnulib-srcdir> point
122to a correct gnulib snapshot.
123
124=item B<--skip-po>
125
126Do not download po files.
127
128=back
129
130