diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2016-07-30 10:14:19 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2016-07-30 10:19:04 +0300 |
commit | 71e51308e7fe0136b76799f5e6dbbec94e279f46 (patch) | |
tree | 820ee704751fd7a498464ecfb5c42ea6da530ead | |
parent | bde49d719c1894d0e502a73d42ab546d905492f2 (diff) | |
download | dico-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.am | 4 | ||||
-rw-r--r-- | README-hacking | 36 | ||||
-rwxr-xr-x | bootstrap | 807 | ||||
-rw-r--r-- | configure.boot (renamed from stub.ac) | 10 | ||||
-rwxr-xr-x | modinc | 641 |
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 | ||
37 | EXTRA_DIST = ChangeLog.2008 stub.ac modinc | 37 | EXTRA_DIST = ChangeLog.2008 configure.boot bootstrap |
38 | 38 | ||
39 | dist-hook: | 39 | dist-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 | ||
45 | Use one or more --verbose options to see details about its progress. | ||
46 | |||
45 | Once done, proceed as described in the file README (section | 47 | Once done, proceed as described in the file README (section |
46 | INSTALLATION). | 48 | INSTALLATION). |
47 | 49 | ||
48 | Normally you will have to run bootstrap only once. However, if you | ||
49 | intend to hack on Dico, you might need to run it again later. In | ||
50 | this case, you will probably want to save some time and bandwidth by | ||
51 | avoiding downloading the same files again. If so, create in the project's | ||
52 | root directory a file named `.bootstrap' with the following | ||
53 | contents: | ||
54 | |||
55 | --gnulib-srcdir=$HOME/gnulib | ||
56 | |||
57 | Replace `$HOME/gnulib' with the actual directory where the Gnulib | ||
58 | sources reside. | ||
59 | |||
60 | For more information about `bootstrap', run `bootstrap --help'. | 50 | For more information about `bootstrap', run `bootstrap --help'. |
61 | 51 | ||
62 | * Debugging | 52 | * Debugging |
63 | 53 | ||
64 | To debug dictd, use the following command: | 54 | To debug dicod, use the following command: |
65 | 55 | ||
66 | libtool --mode execute gdb dictd | 56 | libtool --mode execute gdb dicod |
67 | 57 | ||
68 | For debugging from Emacs run: | 58 | For 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 | |||
66 | If you want to add a new module to Dico (e.g. named `foo'), run the | ||
67 | following command from the Dico source tree topmost directory: | ||
68 | |||
69 | ./bootstrap --add foo | ||
70 | |||
71 | This will create the directory modules/foo, populate it with the | ||
72 | necessary files, and add the appropriate statements to configure.ac | ||
73 | and modules/Makefile.am files. | ||
74 | |||
75 | After running this command, change to the modules/foo directory and | ||
76 | start hacking on your new module. | ||
77 | |||
74 | 78 | ||
75 | * Copyright information | 79 | * Copyright information |
76 | 80 | ||
77 | Copyright (C) 2008, 2010, 2012 Sergey Poznyakoff | 81 | Copyright (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 |
@@ -1,23 +1,784 @@ | |||
1 | #! /bin/sh | 1 | #! /usr/bin/perl |
2 | 2 | # This file is part of GNU Dico | |
3 | chksrc() { | 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, | |
11 | if ! 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. |
14 | fi | 14 | # |
15 | 15 | # You should have received a copy of the GNU General Public License | |
16 | set -e | 16 | # along with GNU Dico. If not, see <http://www.gnu.org/licenses/>. |
17 | git submodule init | 17 | |
18 | git submodule update | 18 | =head1 NAME |
19 | ./modinc | 19 | |
20 | set +e | 20 | bootstrap - Bootstrap the Dico project |
21 | gnulib=gnulibinit | 21 | |
22 | test -L $gnulib || ln -sf ./gnulib/build-aux/bootstrap $gnulib | 22 | =head1 SYNOPSIS |
23 | ./$gnulib | 23 | |
24 | B<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 | |||
36 | Bootstrap the Dico project. This is the first command that should be run | ||
37 | after cloning the project from the repository in order to be able to built | ||
38 | it. | ||
39 | |||
40 | When 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 | |||
48 | Recreates F<configure.ac> and F<modules/Makefile.am> from stub files | ||
49 | F<configure.boot> and F<modules/stub.am>. The list of modules is obtained | ||
50 | from the contents of the F<modules> directory -- each subdirectory | ||
51 | is supposed to contain one module. | ||
52 | |||
53 | Additional F<configure.ac> code for each module is obtained from | ||
54 | file F<module.ac> in each module directory. See the description of | ||
55 | this file in section B<FILES>. | ||
56 | |||
57 | =item 3. Bootstraps the B<gnulib> submodule. | ||
58 | |||
59 | =back | ||
60 | |||
61 | The program must be run from the Dico source tree topmost directory. | ||
62 | |||
63 | When given the B<-m> (B<--modules>) option, only the second step is | ||
64 | performed. | ||
65 | |||
66 | When run with B<-a> (B<--add>, B<--new>) option, the program creates | ||
67 | basic infrastructure for modules named in the command line. For each | ||
68 | I<NAME> it creates directory F<modules/I<NAME>>. Withih that directory, | ||
69 | it creates two files: F<Makefile.am> from F<modules/template.am>, and | ||
70 | F<I<NAME>.c>, which contains a stub code for the module. The new module | ||
71 | is then integrated into F<configure.ac> and F<modules/Makefile.am> files. | ||
72 | |||
73 | By default, the program prints only error diagnostics. That means that | ||
74 | upon success, it will terminate quietly, without producing a single line | ||
75 | on output. This can be changed using the B<-v> (or B<--verbose>) option. | ||
76 | When the option is given once, the program prints general description before | ||
77 | running each of the three steps described above. Two B<-v> options instruct | ||
78 | it to also print whatever output that was generated when running auxiliary | ||
79 | commands. Finally, three B<-v>'s produce additional debugging information. | ||
80 | |||
81 | The B<-n> (B<--dry-run>) option instructs the tool to print what would have | ||
82 | been done without actually doing it. | ||
83 | |||
84 | =head1 OPTIONS | ||
85 | |||
86 | =over 4 | ||
87 | |||
88 | =item B<-a>, B<--add>, B<--new> | ||
89 | |||
90 | Create basic infrastructure for modules named in the command line and | ||
91 | add them to F<configure.ac> and F<modules/Makefile.am> | ||
92 | |||
93 | =item B<-n>, B<--dry-run> | ||
94 | |||
95 | Don't do anything, just print what would have been done. | ||
96 | |||
97 | =item B<-m>, B<--modules> | ||
98 | |||
99 | Run only the second step: creation of autoconf/automake sources for | ||
100 | Dico modules. | ||
101 | |||
102 | =item B<-v>, B<--verbose> | ||
103 | |||
104 | Increase output verbosity. Multiple options accumulate. | ||
105 | |||
106 | =back | ||
107 | |||
108 | The following options are passed to the B<gnulib> bootstrap script | ||
109 | verbatim: | ||
110 | |||
111 | =over 4 | ||
112 | |||
113 | =item B<--gnulib-srcdir=>I<DIRNAME> | ||
114 | |||
115 | Specifies the local directory where B<gnulib> sources reside. Use this if | ||
116 | you already have gnulib sources on your machine, and do not want to waste | ||
117 | your bandwidth downloading them again. | ||
118 | |||
119 | =item B<--no-git> | ||
120 | |||
121 | Do not use git to update B<gnulib>. Requires that B<--gnulib-srcdir> point | ||
122 | to a correct gnulib snapshot. | ||
123 | |||
124 | =item B<--skip-po> | ||
125 | |||
126 | Do not download po files. | ||
127 | |||
128 | =back | ||
129 | |||
130 |